mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
backend/drm: properly handle GPUs without CRTCs
This commit is contained in:
parent
eb44d18cdd
commit
776008da69
1 changed files with 5 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue