From 9efbcb03914fd84cf006b269edcfde2a9b072399 Mon Sep 17 00:00:00 2001 From: Albert Damen Date: Wed, 7 Oct 2009 21:55:42 +0200 Subject: [PATCH] Drop frontbuffer from crtc in I830CloseScreen By dropping the frontbuffer from the crtc, the new frontbuffer can be properly added to the crtc when the xserver is reset. Signed-off-by: Albert Damen --- src/drmmode_display.c | 15 +++++++++++++++ src/i830.h | 1 + src/i830_driver.c | 2 ++ 3 files changed, 18 insertions(+), 0 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index e8a6c01..1c0ed02 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1415,3 +1415,18 @@ drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crtc) return drm_intel_get_pipe_from_crtc_id (bufmgr, drmmode_crtc->mode_crtc->crtc_id); } + +void drmmode_closefb(ScrnInfoPtr pScrn) +{ + xf86CrtcConfigPtr xf86_config; + drmmode_crtc_private_ptr drmmode_crtc; + drmmode_ptr drmmode; + + xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + + drmmode_crtc = xf86_config->crtc[0]->driver_private; + drmmode = drmmode_crtc->drmmode; + + drmModeRmFB(drmmode->fd, drmmode->fb_id); + drmmode->fb_id = 0; +} diff --git a/src/i830.h b/src/i830.h index 009641a..7eb06b0 100644 --- a/src/i830.h +++ b/src/i830.h @@ -691,6 +691,7 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen); void I830DRI2CloseScreen(ScreenPtr pScreen); extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp); +extern void drmmode_closefb(ScrnInfoPtr pScrn); extern int drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crtc); extern int drmmode_output_dpms_status(xf86OutputPtr output); void diff --git a/src/i830_driver.c b/src/i830_driver.c index 316a1fa..b2b1cb1 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -3079,6 +3079,8 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen) } if (pI830->front_buffer) { i830_set_pixmap_bo(pScreen->GetScreenPixmap(pScreen), NULL); + if (pI830->use_drm_mode) + drmmode_closefb(pScrn); i830_free_memory(pScrn, pI830->front_buffer); pI830->front_buffer = NULL; } -- 1.6.3.3