summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-12 04:45:14 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-12 04:45:14 +0100
commitb23be9747bd9c53e2437dfe95eaef87897095995 (patch)
tree99cae94fa8e43fd8663acb737229af7feaadcba9 /src
parentm (diff)
downloadblueshift-b23be9747bd9c53e2437dfe95eaef87897095995.tar.gz
blueshift-b23be9747bd9c53e2437dfe95eaef87897095995.tar.bz2
blueshift-b23be9747bd9c53e2437dfe95eaef87897095995.tar.xz
map to crtc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r--src/blueshift_drm_c.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/blueshift_drm_c.c b/src/blueshift_drm_c.c
index f045b97..dcba7c5 100644
--- a/src/blueshift_drm_c.c
+++ b/src/blueshift_drm_c.c
@@ -176,7 +176,16 @@ int main(int argc, char** argv)
/* Accurate dimension on area not covered by the edges */
printf("Connected: %i\n", connector->connection == DRM_MODE_CONNECTED);
/* DRM_MODE_DISCONNECTED DRM_MODE_UNKNOWNCONNECTION */
- printf("Encoder: %i\n", connector->encoder_id);
+ if (connector->connection == DRM_MODE_CONNECTED)
+ {
+ drmModeEncoder* encoder = drmModeGetEncoder(drm_fd, connector->encoder_id);
+ uint32_t crtc_id = encoder->crtc_id;
+ int crtc;
+ drmModeFreeEncoder(encoder);
+ for (crtc = 0; crtc < drm_res->count_crtcs; crtc++)
+ if (*(drm_res->crtcs + crtc) == crtc_id)
+ printf("CRTC: %i\n", crtc);
+ }
static const char* types[] = {"Unknown", "VGA", "DVII", "DVID", "DVIA", "Composite", "SVIDEO", "LVDS",
"Component", "9PinDIN", "DisplayPort", "HDMIA", "HDMIB", "TV", "eDP",
"VIRTUAL", "DSI"};