aboutsummaryrefslogtreecommitdiff
path: root/libdrm/xf86drmMode.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2007-12-03 13:42:32 +1000
committerDave Airlie <airlied@redhat.com>2007-12-03 15:30:05 +1000
commit96df9b11ad8974d7a2a0a589114cbbb04a584f18 (patch)
tree1d1abe533919afcdc3530a214eb43fcf78e51dbf /libdrm/xf86drmMode.c
parent91cd3e3c097d581ea75ec4bcbc1ba8d23b471a2e (diff)
finish of mode add/remove, just have attach/detach modes
Diffstat (limited to 'libdrm/xf86drmMode.c')
-rw-r--r--libdrm/xf86drmMode.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index 8b701381..cf596730 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -372,38 +372,22 @@ err_allocs:
return r;
}
-#if 0
-uint32_t drmModeAddMode(int fd, struct drm_mode_modeinfo *mode_info)
+int drmModeAttachMode(int fd, uint32_t output_id, struct drm_mode_modeinfo *mode_info)
{
- if (ioctl(fd, DRM_IOCTL_MODE_ADDMODE, mode_info))
- return 0;
-
- return mode_info->id;
-}
-
-int drmModeRmMode(int fd, uint32_t mode_id)
-{
- return ioctl(fd, DRM_IOCTL_MODE_RMMODE, &mode_id);
-}
-#endif
-
-int drmModeAttachMode(int fd, uint32_t output_id, uint32_t mode_id)
-{
-
struct drm_mode_mode_cmd res;
+ memcpy(&res.mode, mode_info, sizeof(struct drm_mode_modeinfo));
res.output_id = output_id;
- res.mode_id = mode_id;
return ioctl(fd, DRM_IOCTL_MODE_ATTACHMODE, &res);
}
-int drmModeDetachMode(int fd, uint32_t output_id, uint32_t mode_id)
+int drmModeDetachMode(int fd, uint32_t output_id, struct drm_mode_modeinfo *mode_info)
{
struct drm_mode_mode_cmd res;
+ memcpy(&res.mode, mode_info, sizeof(struct drm_mode_modeinfo));
res.output_id = output_id;
- res.mode_id = mode_id;
return ioctl(fd, DRM_IOCTL_MODE_DETACHMODE, &res);
}