From f1c36c611efaa56e49758d8e8b19d07c10a8277e Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Tue, 20 Sep 2011 17:10:50 +0800 Subject: [PATCH] glamor-ddx: Don't need to call preInit in screen_init. The previous implementation call preInit again to reopen the device if the device is closed by eglTerminate. Now we don't need it anymore, as glamor dix doesn't call eglTerminate any more when close screen. Signed-off-by: Zhigang Gong --- hw/xfree86/glamor/glamor.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/hw/xfree86/glamor/glamor.c b/hw/xfree86/glamor/glamor.c index 0dbee1806..f4b37ab6b 100644 --- a/hw/xfree86/glamor/glamor.c +++ b/hw/xfree86/glamor/glamor.c @@ -287,11 +287,8 @@ glamor_ddx_close_screen(int scrnIndex, ScreenPtr screen) glamor_fini(screen); glamor_close_egl_screen(screen); gbm_bo_destroy(glamor->root_bo); - drmmode_closefb(scrn); - glamor->fd = -1; - return TRUE; } @@ -301,22 +298,6 @@ glamor_ddx_screen_init(int scrnIndex, ScreenPtr screen, int argc, char **argv) ScrnInfoPtr scrn = xf86Screens[screen->myNum]; struct glamor_ddx_screen_private *glamor = glamor_ddx_get_screen_private(scrn); VisualPtr visual; - /* If serverGeneration != 1 then fd was closed during the last - time closing screen, actually in eglTerminate(). */ - - if (glamor->fd == -1 && serverGeneration != 1) { - glamor->fd = open(dri_device_name, O_RDWR); - if (glamor->fd == -1 ) { - ErrorF("Failed to open %s: %s\n", dri_device_name, strerror(errno)); - return FALSE; - } - if (drmmode_pre_init(scrn, glamor->fd, glamor->cpp) == FALSE) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Kernel modesetting setup failed\n"); - return FALSE; - } - - } glamor->gbm = gbm_create_device(glamor->fd); if (glamor->gbm == NULL) {