diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index e057970a6..4c6726ce5 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -1685,12 +1685,12 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) #ifdef GLAMOR_HAS_GBM if (ms->drmmode.glamor) { - if (!ms_dri2_screen_init(pScreen)) { + if (!(ms->drmmode.dri2_enable = ms_dri2_screen_init(pScreen))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize the DRI2 extension.\n"); } - if (!ms_present_screen_init(pScreen)) { + if (!(ms->drmmode.present_enable = ms_present_screen_init(pScreen))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize the Present extension.\n"); } @@ -1783,7 +1783,7 @@ CloseScreen(ScreenPtr pScreen) ms_ent->assigned_crtcs = 0; #ifdef GLAMOR_HAS_GBM - if (ms->drmmode.glamor) { + if (ms->drmmode.dri2_enable) { ms_dri2_close_screen(pScreen); } #endif diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h index 2630f9347..65e127c52 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.h +++ b/hw/xfree86/drivers/modesetting/drmmode_display.h @@ -83,6 +83,9 @@ typedef struct { Bool dri2_flipping; Bool present_flipping; + + Bool dri2_enable; + Bool present_enable; } drmmode_rec, *drmmode_ptr; typedef struct {