backend/drm: properly handle GPUs without CRTCs
This commit is contained in:
parent
eb44d18cdd
commit
776008da69
|
@ -156,6 +156,11 @@ bool init_drm_resources(struct wlr_drm_backend *drm) {
|
||||||
wlr_log(WLR_INFO, "Found %d DRM CRTCs", res->count_crtcs);
|
wlr_log(WLR_INFO, "Found %d DRM CRTCs", res->count_crtcs);
|
||||||
|
|
||||||
drm->num_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]));
|
drm->crtcs = calloc(drm->num_crtcs, sizeof(drm->crtcs[0]));
|
||||||
if (!drm->crtcs) {
|
if (!drm->crtcs) {
|
||||||
wlr_log_errno(WLR_ERROR, "Allocation failed");
|
wlr_log_errno(WLR_ERROR, "Allocation failed");
|
||||||
|
|
Loading…
Reference in New Issue