aboutsummaryrefslogtreecommitdiff
path: root/libdrm/xf86drmMode.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-06-02 14:04:41 +1000
committerDave Airlie <airlied@redhat.com>2008-06-02 14:04:41 +1000
commit4e7b24639808e5e1e2c05143028db1a3bc2812e9 (patch)
treeba16702759e87caa1119a46a1e18d27048c9667d /libdrm/xf86drmMode.c
parenteba6cdc936cb33d929997ccb9bade6f75bb40670 (diff)
drm: add functions to get/set gamma ramps
Diffstat (limited to 'libdrm/xf86drmMode.c')
-rw-r--r--libdrm/xf86drmMode.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index d11fc12e..a393f965 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -657,3 +657,39 @@ int drmModeReplaceFB(int fd, uint32_t buffer_id,
return 0;
}
+
+int drmModeCrtcGetGamma(int fd, uint32_t crtc_id, uint32_t size,
+ uint16_t *red, uint16_t *green, uint16_t *blue)
+{
+ int ret;
+ struct drm_mode_crtc_lut l;
+
+ l.crtc_id = crtc_id;
+ l.gamma_size = size;
+ l.red = VOID2U64(red);
+ l.green = VOID2U64(green);
+ l.blue = VOID2U64(blue);
+
+ if ((ret = ioctl(fd, DRM_IOCTL_MODE_GETGAMMA, &l)))
+ return ret;
+
+ return 0;
+}
+
+int drmModeCrtcSetGamma(int fd, uint32_t crtc_id, uint32_t size,
+ uint16_t *red, uint16_t *green, uint16_t *blue)
+{
+ int ret;
+ struct drm_mode_crtc_lut l;
+
+ l.crtc_id = crtc_id;
+ l.gamma_size = size;
+ l.red = VOID2U64(red);
+ l.green = VOID2U64(green);
+ l.blue = VOID2U64(blue);
+
+ if ((ret = ioctl(fd, DRM_IOCTL_MODE_SETGAMMA, &l)))
+ return ret;
+
+ return 0;
+}