Mesa (mesa_7_7_branch): st/xorg: Fix crash on resize with libkms

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Mon Jan 25 20:41:22 UTC 2010


Module: Mesa
Branch: mesa_7_7_branch
Commit: 6749310d3f60df70ad8f82db986871ab9496793b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6749310d3f60df70ad8f82db986871ab9496793b

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Mon Jan 25 20:07:43 2010 +0100

st/xorg: Fix crash on resize with libkms

---

 src/gallium/state_trackers/xorg/xorg_driver.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
index 0ff6c52..e4ad789 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -1066,12 +1066,22 @@ drv_bind_front_buffer_kms(ScrnInfoPtr pScrn)
 	goto err_destroy;
 
     pScreen->ModifyPixmapHeader(rootPixmap,
-				pScreen->width,
-				pScreen->height,
+				pScrn->virtualX,
+				pScrn->virtualY,
 				pScreen->rootDepth,
 				pScrn->bitsPerPixel,
 				stride,
 				ptr);
+
+    /* This a hack to work around EnableDisableFBAccess setting the pointer
+     * the real fix would be to replace pScrn->EnableDisableFBAccess hook
+     * and set the rootPixmap->devPrivate.ptr to something valid before that.
+     *
+     * But in its infinit visdome something uses either this some times before
+     * that, so our hook doesn't get called before the crash happens.
+     */
+    pScrn->pixmapPrivate.ptr = ptr;
+
     return TRUE;
 
 err_destroy:




More information about the mesa-commit mailing list