aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-11 10:41:04 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-08-23 20:03:33 -0400
commit86a1ee26bb60e1ab8984e92f0e9186c354670aed (patch)
treed8eb2c95987bdf4c1fa6ef3998615eeee88ced08 /drivers/gpu/drm/i915/intel_ringbuffer.c
parent53621860c38caff37fff99ba5f0b817511907bc4 (diff)
drm/i915: Only pwrite through the GTT if there is space in the aperture
Avoid stalling and waiting for the GPU by checking to see if there is sufficient inactive space in the aperture for us to bind the buffer prior to writing through the GTT. If there is inadequate space we will have to stall waiting for the GPU, and incur overheads moving objects about. Instead, only incur the clflush overhead on the target object by writing through shmem. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index c828169c73ae..ac93643731aa 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -391,7 +391,7 @@ init_pipe_control(struct intel_ring_buffer *ring)
391 391
392 i915_gem_object_set_cache_level(obj, I915_CACHE_LLC); 392 i915_gem_object_set_cache_level(obj, I915_CACHE_LLC);
393 393
394 ret = i915_gem_object_pin(obj, 4096, true); 394 ret = i915_gem_object_pin(obj, 4096, true, false);
395 if (ret) 395 if (ret)
396 goto err_unref; 396 goto err_unref;
397 397
@@ -979,7 +979,7 @@ static int init_status_page(struct intel_ring_buffer *ring)
979 979
980 i915_gem_object_set_cache_level(obj, I915_CACHE_LLC); 980 i915_gem_object_set_cache_level(obj, I915_CACHE_LLC);
981 981
982 ret = i915_gem_object_pin(obj, 4096, true); 982 ret = i915_gem_object_pin(obj, 4096, true, false);
983 if (ret != 0) { 983 if (ret != 0) {
984 goto err_unref; 984 goto err_unref;
985 } 985 }
@@ -1036,7 +1036,7 @@ static int intel_init_ring_buffer(struct drm_device *dev,
1036 1036
1037 ring->obj = obj; 1037 ring->obj = obj;
1038 1038
1039 ret = i915_gem_object_pin(obj, PAGE_SIZE, true); 1039 ret = i915_gem_object_pin(obj, PAGE_SIZE, true, false);
1040 if (ret) 1040 if (ret)
1041 goto err_unref; 1041 goto err_unref;
1042 1042