diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-14 15:47:09 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-14 15:50:05 +0100 |
commit | 5bd022739511104e4978bdfd2f4a1f60b9206723 (patch) | |
tree | 995327fb8beea9e64fd300aacbdb6dd939bb964f /src/i830_batchbuffer.c | |
parent | 0d2392d44aae95d6b571d98f7ec323cf672a687f (diff) |
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.
Diffstat (limited to 'src/i830_batchbuffer.c')
-rw-r--r-- | src/i830_batchbuffer.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c index 492472e7..6481384e 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) |