summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i915/intel_batchbuffer.c11
-rw-r--r--src/mesa/drivers/dri/i915/intel_blit.c9
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c1
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.h1
4 files changed, 21 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/src/mesa/drivers/dri/i915/intel_batchbuffer.c
index 2fefdd4ee7a..9f875c6b345 100644
--- a/src/mesa/drivers/dri/i915/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.c
@@ -175,6 +175,17 @@ static void do_flush_locked( struct intel_batchbuffer *batch,
allow_unlock);
#endif
batch->last_fence = bmFenceBufferList(batch->bm, batch->list);
+ if (!batch->intel->last_swap_fence_retired) {
+ int retired;
+ drmFence dFence = {0,batch->intel->last_swap_fence};
+
+ /*FIXME: Temporary fix for fence ageing
+ *
+ */
+ if (!drmTestFence(batch->intel->driFd, dFence, 0, &retired)) {
+ batch->intel->last_swap_fence_retired = retired;
+ }
+ }
}
diff --git a/src/mesa/drivers/dri/i915/intel_blit.c b/src/mesa/drivers/dri/i915/intel_blit.c
index aefc3b39187..6c0c666f559 100644
--- a/src/mesa/drivers/dri/i915/intel_blit.c
+++ b/src/mesa/drivers/dri/i915/intel_blit.c
@@ -67,7 +67,13 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv )
}
intel = (struct intel_context *) ctx;
- bmFinishFence(intel->bm, intel->last_swap_fence);
+ /* FIXME: Temporary fix for fence ageing.
+ *
+ */
+
+ if (!intel->last_swap_fence_retired) {
+ bmFinishFence(intel->bm, intel->last_swap_fence);
+ }
/* The LOCK_HARDWARE is required for the cliprects. Buffer offsets
* should work regardless.
@@ -138,6 +144,7 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv )
}
intel->last_swap_fence = intel_batchbuffer_flush( intel->batch );
+ intel->last_swap_fence_retired = GL_FALSE;
}
UNLOCK_HARDWARE( intel );
}
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index 4e7e5b82ebb..c699e6a8fb8 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -422,6 +422,7 @@ GLboolean intelInitContext( struct intel_context *intel,
intelScreen->height);
intel->batch = intel_batchbuffer_alloc( intel );
+ intel->last_swap_fence_retired = GL_TRUE;
intel->last_swap_fence = bmInitFence(intel->bm);
intel_bufferobj_init( intel );
intel_fbo_init( intel );
diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h
index ce6d9fa360d..df44db83d46 100644
--- a/src/mesa/drivers/dri/i915/intel_context.h
+++ b/src/mesa/drivers/dri/i915/intel_context.h
@@ -172,6 +172,7 @@ struct intel_context
GLuint last_fence;
GLuint last_swap_fence;
+ GLboolean last_swap_fence_retired;
struct intel_batchbuffer *batch;