From 776008da69fad8b776c93b42b19426c7ae43f326 Mon Sep 17 00:00:00 2001 From: emersion Date: Sun, 7 Oct 2018 12:59:00 +0200 Subject: backend/drm: properly handle GPUs without CRTCs --- backend/drm/drm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'backend') 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"); -- cgit v1.2.3