summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-12 03:40:25 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-12 03:40:25 +0100
commit24e4b242dd8dfd2c4b12faeac14da53d06a5fafd (patch)
treefa4041e8b18932e0240a0cab1a979cf02c4820d3
parentcrtc and connector count (diff)
downloadblueshift-24e4b242dd8dfd2c4b12faeac14da53d06a5fafd.tar.gz
blueshift-24e4b242dd8dfd2c4b12faeac14da53d06a5fafd.tar.bz2
blueshift-24e4b242dd8dfd2c4b12faeac14da53d06a5fafd.tar.xz
gamma size retrieval
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/blueshift_drm_c.c19
1 files changed, 19 insertions, 0 deletions
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();