[Intel-gfx] [PATCH 1/2] Hold reference to video binding table until all rects are painted.

Carl Worth cworth at cworth.org
Wed May 6 18:46:58 CEST 2009


The optimization of unreferencing the binding table when the relocation is
posted causes the object to be dereferenced for each box in the clip list,
causing general chaos in the buffer manager. It's easier to just hold a
reference to the object until all of the boxes are painted and then drop it.

Signed-off-by: Keith Packard <keithp at keithp.com>
(cherry picked from commit 11a853bd8e5d907fe7f5bd907453bcdac9032861)

Conflicts:

	src/i965_video.c
---
 src/i965_video.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/i965_video.c b/src/i965_video.c
index f6020d4..c0a69fd 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -795,7 +795,6 @@ i965_emit_video_setup(ScrnInfoPtr pScrn, drm_intel_bo *bind_bo, int n_src_surf)
     OUT_BATCH(0); /* sf */
     /* Only the PS uses the binding table */
     OUT_RELOC(bind_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0);
-    drm_intel_bo_unreference(bind_bo);
 
     /* Blend constant color (magenta is fun) */
     OUT_BATCH(BRW_3DSTATE_CONSTANT_COLOR | 3);
@@ -1161,6 +1160,10 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
     }
 
     i830MarkSync(pScrn);
+
+    /* release reference once we're finished */
+    drm_intel_bo_unreference(bind_bo);
+
 #if WATCH_STATS
     i830_dump_error_state(pScrn);
 #endif
-- 
1.6.2.4




More information about the Intel-gfx mailing list