From 7eac2061687056eba5af5ae49fc8ebfc1f5cd77a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 12 Mar 2014 05:10:47 +0100 Subject: non-complete implementatation of setting gamma ramps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blueshift_drm_c.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/blueshift_drm_c.c') 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? */ } } } -- cgit v1.2.3-70-g09d2