aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-10-07 12:59:00 +0200
committeremersion <contact@emersion.fr>2018-10-07 12:59:00 +0200
commit776008da69fad8b776c93b42b19426c7ae43f326 (patch)
tree5eb73c229802231642b1cbab4dd61118cd5fa05f /backend
parenteb44d18cdd62cd04cda2660541996e5bd54504a9 (diff)
backend/drm: properly handle GPUs without CRTCs
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/drm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index b9ab7f82..19dad63d 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -156,6 +156,11 @@ bool init_drm_resources(struct wlr_drm_backend *drm) {
wlr_log(WLR_INFO, "Found %d DRM CRTCs", res->count_crtcs);
drm->num_crtcs = res->count_crtcs;
+ if (drm->num_crtcs == 0) {
+ drmModeFreeResources(res);
+ return true;
+ }
+
drm->crtcs = calloc(drm->num_crtcs, sizeof(drm->crtcs[0]));
if (!drm->crtcs) {
wlr_log_errno(WLR_ERROR, "Allocation failed");