summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Damen <albrt@gmx.net>2009-10-07 21:55:42 +0200
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-10-13 10:51:24 -0700
commitfcc2ee48b866b81c79315ff10189b56fc201539d (patch)
tree40ed44625729bdb46dd906242a51d014a1b34eec
parent8a77877f9c2c6a8a1308bc1a3be9e7ad88bc7f49 (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>
-rw-r--r--src/drmmode_display.c15
-rw-r--r--src/i830.h1
-rw-r--r--src/i830_driver.c1
3 files changed, 17 insertions, 0 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index c2ef514e..472bc742 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1429,3 +1429,18 @@ drmmode_crtc_id(xf86CrtcPtr crtc)
1429 1429
1430 return drmmode_crtc->mode_crtc->crtc_id; 1430 return drmmode_crtc->mode_crtc->crtc_id;
1431} 1431}
1432
1433void drmmode_closefb(ScrnInfoPtr scrn)
1434{
1435 xf86CrtcConfigPtr xf86_config;
1436 drmmode_crtc_private_ptr drmmode_crtc;
1437 drmmode_ptr drmmode;
1438
1439 xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
1440
1441 drmmode_crtc = xf86_config->crtc[0]->driver_private;
1442 drmmode = drmmode_crtc->drmmode;
1443
1444 drmModeRmFB(drmmode->fd, drmmode->fb_id);
1445 drmmode->fb_id = 0;
1446}
diff --git a/src/i830.h b/src/i830.h
index 7a64f00e..2d7fc5ba 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -330,6 +330,7 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen);
330void I830DRI2CloseScreen(ScreenPtr pScreen); 330void I830DRI2CloseScreen(ScreenPtr pScreen);
331 331
332extern Bool drmmode_pre_init(ScrnInfoPtr scrn, int fd, int cpp); 332extern Bool drmmode_pre_init(ScrnInfoPtr scrn, int fd, int cpp);
333extern void drmmode_closefb(ScrnInfoPtr scrn);
333extern int drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr * bufmgr, 334extern int drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr * bufmgr,
334 xf86CrtcPtr crtc); 335 xf86CrtcPtr crtc);
335extern int drmmode_output_dpms_status(xf86OutputPtr output); 336extern int drmmode_output_dpms_status(xf86OutputPtr output);
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 47bc4dff..8b5e946f 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1519,6 +1519,7 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen)
1519 } 1519 }
1520 if (intel->front_buffer) { 1520 if (intel->front_buffer) {
1521 i830_set_pixmap_bo(screen->GetScreenPixmap(screen), NULL); 1521 i830_set_pixmap_bo(screen->GetScreenPixmap(screen), NULL);
1522 drmmode_closefb(scrn);
1522 i830_free_memory(scrn, intel->front_buffer); 1523 i830_free_memory(scrn, intel->front_buffer);
1523 intel->front_buffer = NULL; 1524 intel->front_buffer = NULL;
1524 } 1525 }