summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellström <thomas@tungstengraphics.com>2006-03-27 13:55:45 +0000
committerThomas Hellström <thomas@tungstengraphics.com>2006-03-27 13:55:45 +0000
commitcd41c2744625acb33d136a3f5c0d527c22a8ccd5 (patch)
tree72e6ec52d95c44c5b83d11c13cf4853b3ca1ac9d
parentaf6a48011776eeb0c08f3a9a845736f298a6d34b (diff)
zero-valued fences are not considered retired for a system that has been
running for a day or so. Initialize to a better value.
-rw-r--r--src/mesa/drivers/dri/i915/intel_batchbuffer.c1
-rw-r--r--src/mesa/drivers/dri/i915/intel_bufmgr.c11
-rw-r--r--src/mesa/drivers/dri/i915/intel_bufmgr.h2
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c1
-rw-r--r--src/mesa/drivers/dri/i915/intel_pixel_draw.c2
-rw-r--r--src/mesa/drivers/dri/i915/intel_pixel_read.c2
6 files changed, 15 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/src/mesa/drivers/dri/i915/intel_batchbuffer.c
index b974c8c940..2fefdd4ee7 100644
--- a/src/mesa/drivers/dri/i915/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.c
@@ -118,6 +118,7 @@ struct intel_batchbuffer *intel_batchbuffer_alloc( struct intel_context *intel )
batch->bm = intel->bm;
bmGenBuffers(intel->bm, 1, &batch->buffer, BM_BATCHBUFFER);
+ batch->last_fence = bmInitFence(batch->bm);
intel_batchbuffer_reset( batch );
return batch;
}
diff --git a/src/mesa/drivers/dri/i915/intel_bufmgr.c b/src/mesa/drivers/dri/i915/intel_bufmgr.c
index 46631555dc..907e170ef3 100644
--- a/src/mesa/drivers/dri/i915/intel_bufmgr.c
+++ b/src/mesa/drivers/dri/i915/intel_bufmgr.c
@@ -58,7 +58,7 @@ static struct bufmgr
unsigned buf_nr; /* for generating ids */
drmMMPool batchPool;
-
+ drmFence initFence;
} bufmgr_pool[BM_MAX];
static int nr_bms;
@@ -126,6 +126,8 @@ bm_intel_Attach(struct intel_context *intel)
BM_BATCHBUFFER, 1024 * 1024, 4096,
&bm->batchPool));
+
+ BM_CKFATAL(drmEmitFence(bm->driFd, 0, &bm->initFence));
drmUnlock(bm->driFd, intel->hHWContext);
return bm;
}
@@ -441,4 +443,11 @@ bmFinishFence(struct bufmgr *bm, unsigned fence)
dFence.fenceType = 0;
dFence.fenceSeq = fence;
BM_CKFATAL(drmWaitFence(bm->driFd, dFence));
+ bm->initFence = dFence;
+}
+
+unsigned
+bmInitFence(struct bufmgr *bm)
+{
+ return bm->initFence.fenceSeq;
}
diff --git a/src/mesa/drivers/dri/i915/intel_bufmgr.h b/src/mesa/drivers/dri/i915/intel_bufmgr.h
index f323611c48..1c69cf6cbf 100644
--- a/src/mesa/drivers/dri/i915/intel_bufmgr.h
+++ b/src/mesa/drivers/dri/i915/intel_bufmgr.h
@@ -119,7 +119,7 @@ int bmScanBufferList(struct bufmgr *bm,
unsigned bmSetFence(struct bufmgr *);
int bmTestFence(struct bufmgr *, unsigned fence);
void bmFinishFence(struct bufmgr *, unsigned fence);
-
+unsigned bmInitFence(struct bufmgr *bm);
void bmSetShared(struct bufmgr *bm, unsigned buffer,
unsigned flags, unsigned long offset, void *virtual);
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index 1d47e2ff24..3061f72996 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 = bmInitFence(intel->bm);
intel_bufferobj_init( intel );
intel_fbo_init( intel );
diff --git a/src/mesa/drivers/dri/i915/intel_pixel_draw.c b/src/mesa/drivers/dri/i915/intel_pixel_draw.c
index 71e251c66d..8e8ba8744b 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel_draw.c
@@ -218,7 +218,7 @@ static GLboolean do_blit_drawpixels( GLcontext *ctx,
struct intel_buffer_object *src = intel_buffer_object(unpack->BufferObj);
GLuint src_offset;
GLuint rowLength;
- GLuint fence = 0;
+ GLuint fence = bmInitFence(intel->bm);
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s\n", __FUNCTION__);
diff --git a/src/mesa/drivers/dri/i915/intel_pixel_read.c b/src/mesa/drivers/dri/i915/intel_pixel_read.c
index 68dd6ea376..e19679b1f0 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel_read.c
@@ -181,7 +181,7 @@ static GLboolean do_blit_readpixels( GLcontext *ctx,
struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj);
GLuint dst_offset;
GLuint rowLength;
- GLuint fence = 0;
+ GLuint fence = bmInitFence(intel->bm);
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s\n", __FUNCTION__);