summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-26 21:05:27 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-26 21:07:46 +0100
commit73111cf2a212ee5cc2e03af1c600867df0c55b39 (patch)
tree09c069d5424e4e39ce34a728bc119d12c2b865ce
parenta6fb6aa5f9c1c81b8b81b9d1138a526ffbbd5ad3 (diff)
Decouple non-reusuable pixmaps from batch lists on unref.
==7596== Invalid write of size 4 ==7596== at 0x491ACA8: intel_batch_teardown (i830_batchbuffer.c:118) ==7596== by 0x491C9D6: I830CloseScreen (i830_driver.c:1419) ==7596== by 0x8103A9C: RRCloseScreen (randr.c:105) ==7596== by 0x80DE794: xf86CrtcCloseScreen (xf86Crtc.c:759) ==7596== by 0x80BEBA3: DGACloseScreen (xf86DGA.c:268) ==7596== by 0x80D044B: DPMSClose (xf86DPMS.c:134) ==7596== by 0x488B050: XvCloseScreen (xvmain.c:320) ==7596== by 0x81841B1: VidModeClose (xf86VidMode.c:110) ==7596== by 0x80EB12F: CursorCloseScreen (cursor.c:191) ==7596== by 0x810CA17: AnimCurCloseScreen (animcur.c:108) ==7596== by 0x816937E: compCloseScreen (compinit.c:86) ==7596== by 0x48D39B9: glxCloseScreen (glxscreens.c:221) ==7596== Address 0x49c1a50 is 24 bytes inside a block of size 52 free'd ==7596== at 0x4024866: free (vg_replace_malloc.c:325) ==7596== by 0x80B023C: Xfree (utils.c:1096) ==7596== by 0x4927CFD: i830_set_pixmap_bo (i830_uxa.c:647) ==7596== by 0x491C9B4: I830CloseScreen (i830_driver.c:1413) ==7596== by 0x8103A9C: RRCloseScreen (randr.c:105) ==7596== by 0x80DE794: xf86CrtcCloseScreen (xf86Crtc.c:759) ==7596== by 0x80BEBA3: DGACloseScreen (xf86DGA.c:268) ==7596== by 0x80D044B: DPMSClose (xf86DPMS.c:134) ==7596== by 0x488B050: XvCloseScreen (xvmain.c:320) ==7596== by 0x81841B1: VidModeClose (xf86VidMode.c:110) ==7596== by 0x80EB12F: CursorCloseScreen (cursor.c:191) ==7596== by 0x810CA17: AnimCurCloseScreen (animcur.c:108) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/i830_uxa.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/i830_uxa.c b/src/i830_uxa.c
index 172afe55..b063d0fa 100644
--- a/src/i830_uxa.c
+++ b/src/i830_uxa.c
@@ -609,9 +609,12 @@ void i830_set_pixmap_bo(PixmapPtr pixmap, dri_bo * bo)
if (priv->bo == bo)
return;
- if (list_is_empty(&priv->batch) ||
- !drm_intel_bo_is_reusable(priv->bo)) {
+ if (list_is_empty(&priv->batch)) {
dri_bo_unreference(priv->bo);
+ } else if (!drm_intel_bo_is_reusable(priv->bo)) {
+ dri_bo_unreference(priv->bo);
+ list_del(&priv->batch);
+ list_del(&priv->flush);
} else {
list_add(&priv->in_flight, &intel->in_flight);
priv = NULL;