diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-19 10:57:46 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-24 09:33:37 +0100 |
commit | 2b050f330f78d02e7f476e55be29d760271ac61c (patch) | |
tree | 7bbaf0b6aa581373e4a212498f11e949aa86d612 /src/i915_3d.h | |
parent | dcef703a7cdcf360f12312a338361697acffc3e9 (diff) |
Use pwrite to upload the batch buffer
By using pwrite() instead of dri_bo_map() we can write to the batch buffer
through the GTT and not be forced to map it back into the CPU domain and
out again, eliminating a double clflush.
Measing x11perf text performance on PineView:
Before:
16000000 trep @ 0.0020 msec (511000.0/sec): Char in 80-char aa line (Charter 10)
16000000 trep @ 0.0021 msec (480000.0/sec): Char in 80-char rgb line (Charter 10)
After:
16000000 trep @ 0.0019 msec (532000.0/sec): Char in 80-char aa line (Charter 10)
16000000 trep @ 0.0020 msec (496000.0/sec): Char in 80-char rgb line (Charter 10)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/i915_3d.h')
-rw-r--r-- | src/i915_3d.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/i915_3d.h b/src/i915_3d.h index ab4fbb57..043a6d56 100644 --- a/src/i915_3d.h +++ b/src/i915_3d.h @@ -423,8 +423,7 @@ do { \ #define FS_BEGIN() \ do { \ - _shader_offset = intel->batch_used; \ - intel->batch_used += 4; \ + _shader_offset = intel->batch_used++; \ } while (0) #define FS_OUT(_shaderop) \ @@ -436,7 +435,7 @@ do { \ #define FS_END() \ do { \ - *(uint32_t *)(intel->batch_ptr + _shader_offset) = \ - (_3DSTATE_PIXEL_SHADER_PROGRAM | \ - ((intel->batch_used - _shader_offset) / 4 - 2)); \ + intel->batch_ptr[_shader_offset] = \ + _3DSTATE_PIXEL_SHADER_PROGRAM | \ + (intel->batch_used - _shader_offset - 2); \ } while (0); |