diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-12 05:10:47 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-12 05:10:47 +0100 |
commit | 7eac2061687056eba5af5ae49fc8ebfc1f5cd77a (patch) | |
tree | b2f3a5052a9d82a291f77f59e23adb874c898140 /src/blueshift_drm_c.c | |
parent | read gamma ramps (diff) | |
download | blueshift-7eac2061687056eba5af5ae49fc8ebfc1f5cd77a.tar.gz blueshift-7eac2061687056eba5af5ae49fc8ebfc1f5cd77a.tar.bz2 blueshift-7eac2061687056eba5af5ae49fc8ebfc1f5cd77a.tar.xz |
non-complete implementatation of setting gamma ramps
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/blueshift_drm_c.c')
-rw-r--r-- | src/blueshift_drm_c.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/blueshift_drm_c.c b/src/blueshift_drm_c.c index 8cb45c4..be6a5e1 100644 --- a/src/blueshift_drm_c.c +++ b/src/blueshift_drm_c.c @@ -171,7 +171,7 @@ int main(int argc, char** argv) printf("Connector count: %i\n", blueshift_drm_connector_count()); printf("Gamma size: %i\n", blueshift_drm_gamma_size(0)); - drmModeConnector* connector = drmModeGetConnector(drm_fd, *(drm_res->connectors + 2)); + drmModeConnector* connector = drmModeGetConnector(drm_fd, *(drm_res->connectors + 3)); printf("Physical size: %i mm by %i mm\n", connector->mmWidth, connector->mmHeight); /* Accurate dimension on area not covered by the edges */ printf("Connected: %i\n", connector->connection == DRM_MODE_CONNECTED); @@ -214,6 +214,16 @@ int main(int argc, char** argv) for (j = 0; j < gamma_size; j++) printf(" %u", *(blue + j)); printf("\n"); + + for (j = 0; j < gamma_size; j++) + *(red + j) /= 2; + for (j = 0; j < gamma_size; j++) + *(green + j) /= 2; + for (j = 0; j < gamma_size; j++) + *(blue + j) /= 2; + + printf("(%i)\n", drmModeCrtcSetGamma(drm_fd, crtc_id, gamma_size, red, green, blue)); + /* TODO what more is required to set gamma ramps? */ } } } |