From 24e4b242dd8dfd2c4b12faeac14da53d06a5fafd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 12 Mar 2014 03:40:25 +0100 Subject: gamma size retrieval 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 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/blueshift_drm_c.c') diff --git a/src/blueshift_drm_c.c b/src/blueshift_drm_c.c index d143ddc..c9dea2f 100644 --- a/src/blueshift_drm_c.c +++ b/src/blueshift_drm_c.c @@ -137,6 +137,24 @@ int blueshift_drm_connector_count() } +/** + * Return the size of the gamma ramps on a CRTC + * + * @param crtc_index The index of the CRTC + * @return The size of the gamma ramps on a CRTC + */ +int blueshift_drm_gamma_size(int crtc_index) +{ + drmModeCrtc* crtc = drmModeGetCrtc(drm_fd, *(drm_res->crtcs + crtc_index)); + int gamma_size; + + gamma_size = crtc->gamma_size; + drmModeFreeCrtc(crtc); + + return gamma_size; +} + + int main(int argc, char** argv) { @@ -150,6 +168,7 @@ int main(int argc, char** argv) blueshift_drm_update(); printf("CRTC count: %i\n", blueshift_drm_crtc_count()); printf("Connector count: %i\n", blueshift_drm_connector_count()); + printf("Gamma size: %i\n", blueshift_drm_gamma_size(0)); blueshift_drm_close(); -- cgit v1.2.3-70-g09d2