diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-08-10 22:24:08 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-08-10 22:24:08 +0200 |
commit | 08b0efd69bb5b9b7d3c4bf7a69bceac116baf835 (patch) | |
tree | 195207bde7b151a89e65c5797f604066002619d6 | |
parent | update dist (diff) | |
download | crt-calibrator-1.2.tar.gz crt-calibrator-1.2.tar.bz2 crt-calibrator-1.2.tar.xz |
add support for graphics cards that report crtc:s without connectors1.2
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/drmgamma.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/drmgamma.c b/src/drmgamma.c index d738dd4..8f3dd97 100644 --- a/src/drmgamma.c +++ b/src/drmgamma.c @@ -166,6 +166,8 @@ int drm_crtc_open(size_t index, drm_card_t* restrict card, drm_crtc_t* restrict crtc->id = card->res->crtcs[index]; crtc->card = card; + crtc->connector = NULL; + crtc->encoder = NULL; for (i = 0; i < card->connector_count; i++) if (card->encoders[i] != NULL) if (card->encoders[i]->crtc_id == crtc->id) @@ -174,7 +176,7 @@ int drm_crtc_open(size_t index, drm_card_t* restrict card, drm_crtc_t* restrict crtc->encoder = card->encoders[i]; } - crtc->connected = crtc->connector->connection == DRM_MODE_CONNECTED; + crtc->connected = (crtc->connector != NULL) && (crtc->connector->connection == DRM_MODE_CONNECTED); info = drmModeGetCrtc(card->fd, crtc->id); if (info == NULL) @@ -189,6 +191,8 @@ int drm_crtc_open(size_t index, drm_card_t* restrict card, drm_crtc_t* restrict crtc->green = crtc->red + crtc->gamma_stops; crtc->blue = crtc->green + crtc->gamma_stops; + if (crtc->connector == NULL) + return 0; for (i = 0; i < (size_t)(crtc->connector->count_props); i++) { size_t j; |