summaryrefslogtreecommitdiff
path: root/libdrm/xf86drmMode.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-05-17 10:35:07 -0700
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-05-17 10:35:07 -0700
commitb7bf317f42915dc4f5fde4a696e37985cea45104 (patch)
tree7101a08e7a10e0a74ac3971b99aeaee6ed1f888f /libdrm/xf86drmMode.c
parenta18b4befb9b76c4b2662ff6caa0e4f0975eb8e9c (diff)
parentfd63ea971322246734fca5977a800c3ef51cc3fe (diff)
Merge branch 'modesetting-101' of git+ssh://git.freedesktop.org/git/mesa/drm into origin/modesetting-101
Conflicts: linux-core/drm_crtc.c linux-core/drm_fb.c Lots of changes to merge with alanh's latest stuff: o fix use of fb->pitch now that it has the right value o add new helper for finding the CRTC given an FB o fix new fb_probe/fb_remove functions to take a CRTC o fixup callers of new FB routines o port drm_fb changes to intel_fb o check for errors after creating fb buffer object o go back to using cfb_imageblit since the accel stubs aren't ready
Diffstat (limited to 'libdrm/xf86drmMode.c')
-rw-r--r--libdrm/xf86drmMode.c63
1 files changed, 23 insertions, 40 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index b695467b..a7241ffd 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -238,15 +238,10 @@ drmModeFBPtr drmModeGetFB(int fd, uint32_t buf)
return r;
}
-#if 0
-int drmModeForceProbe(int fd, uint32_t outputId)
-{
- /* TODO impl/keep? */
-}
-#endif
+
/*
- * Crtc function.
+ * Crtc functions
*/
drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId)
@@ -274,9 +269,7 @@ drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId)
r->x = crtc.x;
r->y = crtc.y;
r->mode = crtc.mode;
-// r->width = crtc.width;
-// r->height = crtc.height;
- r->buffer_id = crtc.fb_id;
+ r->buffer_id = crtc.fb_id;
r->gamma_size = crtc.gamma_size;
r->count_outputs = crtc.count_outputs;
r->count_possibles = crtc.count_possibles;
@@ -305,8 +298,8 @@ int drmModeSetCrtc(int fd, uint32_t crtcId, uint32_t bufferId,
crtc.x = x;
crtc.y = y;
- crtc.crtc_id = crtcId;
- crtc.fb_id = bufferId;
+ crtc.crtc_id = crtcId;
+ crtc.fb_id = bufferId;
crtc.set_outputs = outputs;
crtc.count_outputs = count;
crtc.mode = modeId;
@@ -314,22 +307,11 @@ int drmModeSetCrtc(int fd, uint32_t crtcId, uint32_t bufferId,
return ioctl(fd, DRM_IOCTL_MODE_SETCRTC, &crtc);
}
-#if 0
-drmModeGammaTriplePtr drmModeGetCrtcGamma(int fd, uint32_t crtc, int *count)
-{
- /* TODO impl */
-}
-
-int drmModeSetCrtcGamma(int fd, uint32_t crtcId,
- drmModeGammaTriplePtr ptr, int count)
-{
- /* TODO impl */
-}
-#endif
/*
* Output manipulation
*/
+
drmModeOutputPtr drmModeGetOutput(int fd, uint32_t output_id)
{
struct drm_mode_get_output out;
@@ -376,37 +358,38 @@ err_allocs:
return 0;
}
-#if 0
-uint32_t drmModeNewMode(int fd, struct drm_mode_modeinfo *modeInfo)
+uint32_t drmModeAddMode(int fd, struct drm_mode_modeinfo *mode_info)
{
- /* TODO impl */
+ if (ioctl(fd, DRM_IOCTL_MODE_ADDMODE, mode_info))
+ return 0;
+
+ return mode_info->id;
}
-int drmModeDesMode(int fd, uint32_t modeId)
+int drmModeRmMode(int fd, uint32_t mode_id)
{
- // return ioctl(fd, DRM_IOCTL_MODE_DESMODE, modeId);
+ return ioctl(fd, DRM_IOCTL_MODE_RMMODE, mode_id);
}
-int drmModeAddMode(int fd, uint32_t outputId, uint32_t modeId)
+int drmModeAttachMode(int fd, uint32_t output_id, uint32_t mode_id)
{
- drm_mode_outputmode_t res;
+ struct drm_mode_mode_cmd res;
- res.outputId = outputId;
- res.modeId = modeId;
+ res.output_id = output_id;
+ res.mode_id = mode_id;
- // return ioctl(fd, DRM_IOCTL_MODE_ADDMODE, &res);
+ return ioctl(fd, DRM_IOCTL_MODE_ATTACHMODE, &res);
}
-int drmModeDelMode(int fd, uint32_t outputId, uint32_t modeId)
+int drmModeDetachMode(int fd, uint32_t output_id, uint32_t mode_id)
{
- drm_mode_outputmode_t res;
+ struct drm_mode_mode_cmd res;
- res.outputId = outputId;
- res.modeId = modeId;
+ res.output_id = output_id;
+ res.mode_id = mode_id;
- // return ioctl(fd, DRM_IOCTL_MODE_DELMODE, &res);
+ return ioctl(fd, DRM_IOCTL_MODE_DETACHMODE, &res);
}
-#endif