modesetting: Fail in ScreenInit if we can't get a gbm device

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
stefan11111
2026-02-06 22:28:32 +02:00
committed by Enrico Weigelt
parent 0de74bf2e9
commit 0ac903f4b9

View File

@@ -1986,6 +1986,10 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
}
#endif
if (!ms->drmmode.gbm) {
return FALSE;
}
/* HW dependent - FIXME */
pScrn->displayWidth = pScrn->virtualX;
if (!drmmode_create_initial_bos(pScrn, &ms->drmmode))
@@ -2315,7 +2319,7 @@ CloseScreen(ScreenPtr pScreen)
#ifdef GLAMOR_HAS_GBM
/* If we didn't get the gbm device from glamor, we have to free it ourserves */
if (!ms->drmmode.glamor && ms->drmmode.gbm) {
if (!ms->drmmode.glamor) {
gbm_device_destroy(ms->drmmode.gbm);
ms->drmmode.gbm = NULL;
}