xf86-video-intel: src/i830_batchbuffer.c

Chris Wilson ickle at kemper.freedesktop.org
Fri May 14 07:50:40 PDT 2010


 src/i830_batchbuffer.c |   34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

New commits:
commit 5bd022739511104e4978bdfd2f4a1f60b9206723
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri May 14 15:47:09 2010 +0100

    i830: Teardown batch entries on reset.
    
    By not cleaning up the batch entries when resetting the X server, we left
    the pointers in an inconsistent state and caused X to crash.

diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c
index 492472e..6481384 100644
--- a/src/i830_batchbuffer.c
+++ b/src/i830_batchbuffer.c
@@ -89,6 +89,40 @@ void intel_batch_teardown(ScrnInfoPtr scrn)
 		dri_bo_unreference(intel->last_batch_bo);
 		intel->last_batch_bo = NULL;
 	}
+
+	while (!list_is_empty(&intel->batch_pixmaps)) {
+		struct intel_pixmap *entry;
+
+		entry = list_first_entry(&intel->batch_pixmaps,
+					 struct intel_pixmap,
+					 batch);
+
+		entry->batch_read_domains = entry->batch_write_domain = 0;
+		list_del(&entry->batch);
+	}
+
+	while (!list_is_empty(&intel->flush_pixmaps)) {
+		struct intel_pixmap *entry;
+
+		entry = list_first_entry(&intel->flush_pixmaps,
+					 struct intel_pixmap,
+					 flush);
+
+		entry->flush_read_domains = entry->flush_write_domain = 0;
+		list_del(&entry->flush);
+	}
+
+	while (!list_is_empty(&intel->in_flight)) {
+		struct intel_pixmap *entry;
+
+		entry = list_first_entry(&intel->in_flight,
+					 struct intel_pixmap,
+					 in_flight);
+
+		dri_bo_unreference(entry->bo);
+		list_del(&entry->in_flight);
+		xfree(entry);
+	}
 }
 
 void intel_batch_emit_flush(ScrnInfoPtr scrn)


More information about the xorg-commit mailing list