From b23be9747bd9c53e2437dfe95eaef87897095995 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 12 Mar 2014 04:45:14 +0100 Subject: map to crtc 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') 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"}; -- cgit v1.2.3-70-g09d2