i965: xdemos/glxthreads get: Assertion `block->fenced' failed (9201)
authorZou Nan hai <nanhai.zou@intel.com>
Wed, 13 Dec 2006 07:27:17 +0000 (15:27 +0800)
committerKeith Packard <keithp@neko.keithp.com>
Sat, 6 Jan 2007 23:18:23 +0000 (15:18 -0800)
Signed-off-by: Keith Packard <keithp@neko.keithp.com>
src/mesa/drivers/dri/i965/bufmgr.h
src/mesa/drivers/dri/i965/bufmgr_fake.c
src/mesa/drivers/dri/i965/intel_blit.c

index 6932522d3d30356554e84387fb25ba720c9688ba..e748c0d6d0b9a68709a27285a7364dbccfa16801 100644 (file)
@@ -199,9 +199,11 @@ void *bmFindVirtual( struct intel_context *intel,
  * For now they can stay, but will likely change/move before final:
  */
 unsigned bmSetFence( struct intel_context * );
+unsigned bmSetFenceLock( struct intel_context * );
 unsigned bmLockAndFence( struct intel_context *intel );
 int bmTestFence( struct intel_context *, unsigned fence );
 void bmFinishFence( struct intel_context *, unsigned fence );
+void bmFinishFenceLock( struct intel_context *, unsigned fence );
 
 void bm_fake_NotifyContendedLockTake( struct intel_context * );
 
index ed88ab3797af3757d0bb88a6e6f7c4d81ce6bd18..205dc722c0692266d30d2547658ae2fd852f1a2b 100644 (file)
@@ -338,7 +338,6 @@ static int evict_mru( struct intel_context *intel, GLuint *pool )
 }
 
 
-
 static int check_fenced( struct intel_context *intel )
 {
    struct bufmgr *bm = intel->bm;
@@ -1328,11 +1327,19 @@ unsigned bmSetFence( struct intel_context *intel )
    return intel->bm->last_fence;
 }
 
+unsigned bmSetFenceLock( struct intel_context *intel )
+{
+  LOCK(intel->bm);
+  bmSetFence(intel);
+  UNLOCK(intel->bm);
+}
 unsigned bmLockAndFence( struct intel_context *intel )
 {
    if (intel->bm->need_fence) {
       LOCK_HARDWARE(intel);
+      LOCK(intel->bm);
       bmSetFence(intel);
+      UNLOCK(intel->bm);
       UNLOCK_HARDWARE(intel);
    }
 
@@ -1350,7 +1357,12 @@ void bmFinishFence( struct intel_context *intel, unsigned fence )
    check_fenced(intel);
 }
 
-
+void bmFinishFenceLock( struct intel_context *intel, unsigned fence )
+{
+   LOCK(intel->bm);
+   bmFinishFence(intel, fence);
+   UNLOCK(intel->bm);
+}
 
 
 /* Specifically ignore texture memory sharing.
index c8c5bf93c95ee84e81168cbfd01f93264d6c3fd4..173d1d5b6c232f8a7491a2be5d4ac2272ccba011 100644 (file)
@@ -66,7 +66,7 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv,
    intelFlush( &intel->ctx );
 
 
-   bmFinishFence(intel, intel->last_swap_fence);
+   bmFinishFenceLock(intel, intel->last_swap_fence);
 
    /* The LOCK_HARDWARE is required for the cliprects.  Buffer offsets
     * should work regardless.
@@ -155,7 +155,7 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv,
 
    intel_batchbuffer_flush( intel->batch );
    intel->second_last_swap_fence = intel->last_swap_fence;
-   intel->last_swap_fence = bmSetFence( intel );
+   intel->last_swap_fence = bmSetFenceLock( intel );
    UNLOCK_HARDWARE( intel );
 
    if (!rect)