Mesa (7.9): st/xorg: Don't try to remove invalid fbs

Thomas Hellstrom thomash at kemper.freedesktop.org
Tue Oct 12 13:09:14 UTC 2010


Module: Mesa
Branch: 7.9
Commit: 6730630804b6948dbb42340b1de1cf9ee04bf0fd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6730630804b6948dbb42340b1de1cf9ee04bf0fd

Author: Thomas Hellstrom <thellstrom at vmware.com>
Date:   Tue Oct 12 11:10:59 2010 +0200

st/xorg: Don't try to remove invalid fbs

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>

---

 src/gallium/state_trackers/xorg/xorg_driver.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
index f7b3ad3..ca74539 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -369,6 +369,7 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
     ms = modesettingPTR(pScrn);
     ms->pEnt = pEnt;
     ms->cust = cust;
+    ms->fb_id = 1;
 
     pScrn->displayWidth = 640;	       /* default it */
 
@@ -864,8 +865,10 @@ drv_leave_vt(int scrnIndex, int flags)
 	}
     }
 
-    drmModeRmFB(ms->fd, ms->fb_id);
-    ms->fb_id = -1;
+    if (ms->fb_id != -1) {
+	drmModeRmFB(ms->fd, ms->fb_id);
+	ms->fb_id = -1;
+    }
 
     /* idle hardware */
     if (!ms->kms)
@@ -946,7 +949,6 @@ drv_close_screen(int scrnIndex, ScreenPtr pScreen)
     }
 #endif
 
-    drmModeRmFB(ms->fd, ms->fb_id);
     ms->destroy_front_buffer(pScrn);
 
     if (ms->exa)




More information about the mesa-commit mailing list