summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Damen <albrt@gmx.net>2009-10-07 21:55:42 +0200
committerCarl Worth <cworth@cworth.org>2009-10-13 11:16:14 -0700
commit22b85d0198508a13273ab58fd5fa3a127880a0be (patch)
tree08497801b8924fe939a6e3bc7a33255b7f7a525a
parent7ccf084b7a281d8aa877f91401d3df7192da408c (diff)
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 <albrt@gmx.net> (cherry picked from commit fcc2ee48b866b81c79315ff10189b56fc201539d) Fixes https://bugs.freedesktop.org/show_bug.cgi?id=24383
-rw-r--r--src/drmmode_display.c15
-rw-r--r--src/i830.h1
-rw-r--r--src/i830_driver.c2
3 files changed, 18 insertions, 0 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 7845fc5e..8ab8a4b4 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1420,3 +1420,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 scrn)
+{
+ xf86CrtcConfigPtr xf86_config;
+ drmmode_crtc_private_ptr drmmode_crtc;
+ drmmode_ptr drmmode;
+
+ xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ 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 009641ad..9d9335bf 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -692,6 +692,7 @@ void I830DRI2CloseScreen(ScreenPtr pScreen);
extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp);
extern int drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crtc);
+extern void drmmode_closefb(ScrnInfoPtr scrn);
extern int drmmode_output_dpms_status(xf86OutputPtr output);
void
drmmode_crtc_set_cursor_bo(xf86CrtcPtr crtc, dri_bo *cursor);
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 316a1fa1..b2b1cb10 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;
}