diff options
author | Eric Anholt <[email protected]> | 2007-12-07 16:15:49 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2007-12-07 16:19:10 -0800 |
commit | e3a6e60040b7f6ea7965e52f8f9881ed31e0347c (patch) | |
tree | 6fadf576b904bb479936a355ed716ca305556848 /src/mesa/drivers/dri/i965/intel_blit.c | |
parent | 3ecdae82d751f9f404d10332f030e3280949ce4e (diff) |
[965] Convert the driver to dri_bufmgr interface and enable TTM.
This is currently believed to work but be a significant performance loss.
Performance recovery should be soon to follow.
The dri_bo_fake_disable_backing_store() call was added to allow backing store
disable like bufmgr_fake.c did, which is a significant performance win (though
it's missing the no-fence-subdata part).
This commit is a squash merge of the 965-ttm branch, which had some history
I wanted to avoid pulling due to noisiness and brokenness at many points
for git-bisecting.
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_blit.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_blit.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c index 374022e64af..dd9c8719024 100644 --- a/src/mesa/drivers/dri/i965/intel_blit.c +++ b/src/mesa/drivers/dri/i965/intel_blit.c @@ -41,7 +41,7 @@ #include "intel_regions.h" #include "intel_structs.h" -#include "bufmgr.h" +#include "dri_bufmgr.h" #define FILE_DEBUG_FLAG DEBUG_BLIT @@ -64,8 +64,13 @@ void intelCopyBuffer( __DRIdrawablePrivate *dPriv, intel = (struct intel_context *) dPriv->driContextPriv->driverPrivate; intelFlush( &intel->ctx ); - - bmFinishFenceLock(intel, intel->last_swap_fence); + if (intel->last_swap_fence) { + dri_fence_wait(intel->last_swap_fence); + dri_fence_unreference(intel->last_swap_fence); + intel->last_swap_fence = NULL; + } + intel->last_swap_fence = intel->first_swap_fence; + intel->first_swap_fence = NULL; /* The LOCK_HARDWARE is required for the cliprects. Buffer offsets * should work regardless. @@ -151,9 +156,12 @@ void intelCopyBuffer( __DRIdrawablePrivate *dPriv, } } - intel_batchbuffer_flush( intel->batch ); - intel->second_last_swap_fence = intel->last_swap_fence; - intel->last_swap_fence = bmSetFenceLock( intel ); + if (intel->first_swap_fence) + dri_fence_unreference(intel->first_swap_fence); + intel_batchbuffer_flush(intel->batch); + intel->first_swap_fence = intel->batch->last_fence; + if (intel->first_swap_fence != NULL) + dri_fence_reference(intel->first_swap_fence); UNLOCK_HARDWARE( intel ); if (!rect) @@ -176,7 +184,7 @@ void intelCopyBuffer( __DRIdrawablePrivate *dPriv, void intelEmitFillBlit( struct intel_context *intel, GLuint cpp, GLshort dst_pitch, - struct buffer *dst_buffer, + dri_bo *dst_buffer, GLuint dst_offset, GLboolean dst_tiled, GLshort x, GLshort y, @@ -247,11 +255,11 @@ static GLuint translate_raster_op(GLenum logicop) void intelEmitCopyBlit( struct intel_context *intel, GLuint cpp, GLshort src_pitch, - struct buffer *src_buffer, + dri_bo *src_buffer, GLuint src_offset, GLboolean src_tiled, GLshort dst_pitch, - struct buffer *dst_buffer, + dri_bo *dst_buffer, GLuint dst_offset, GLboolean dst_tiled, GLshort src_x, GLshort src_y, @@ -524,7 +532,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, GLubyte *src_bits, GLuint src_size, GLuint fg_color, GLshort dst_pitch, - struct buffer *dst_buffer, + dri_bo *dst_buffer, GLuint dst_offset, GLboolean dst_tiled, GLshort x, GLshort y, |