From 9ae52d88de80cbea384bf40eda0ad208203af6f4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 3 Jun 2014 08:23:52 +0200 Subject: doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/lib/gamma-linux-drm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/lib') diff --git a/src/lib/gamma-linux-drm.c b/src/lib/gamma-linux-drm.c index 8d6a0e9..5587a2a 100644 --- a/src/lib/gamma-linux-drm.c +++ b/src/lib/gamma-linux-drm.c @@ -452,8 +452,14 @@ static drmModeConnector* find_connector(libgamma_crtc_state_t* restrict this, in /* Fill connector and encoder arrays. */ for (i = 0; i < n; i++) { + /* Get connector, */ if ((card->connectors[i] = drmModeGetConnector(card->fd, card->res->connectors[i])) == NULL) goto fail; + /* Get encoder if the connector is enabled. + If it is disabled it will not have an + encoder, which is indicated by the + encoder ID being 0. In such case, leave + the encoder to be `NULL`. */ if ((card->connectors[i]->encoder_id != 0) && ((card->encoders[i] = drmModeGetEncoder(card->fd, card->connectors[i]->encoder_id)) == NULL)) goto fail; -- cgit v1.2.3-70-g09d2