aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-27 09:21:01 -0400
committerEric Anholt <eric@anholt.net>2010-05-28 14:02:00 -0400
commit9b8c4a0b215e603497daebe8ecbc9b1f0f035808 (patch)
tree50aa5824d31631d4b4ec21d5fd23a581d715c092 /drivers/gpu/drm/i915/i915_gem.c
parent68f95ba9e260516411411524c45263b5d53f393c (diff)
drm/i915: Avoid moving from CPU domain during pwrite
We can avoid an early clflush when pwriting if we use the current CPU write domain rather than moving the object to the GTT domain for the purposes of the pwrite. This has the advantage of not flushing the presumably hot data that we want to upload into the bo, and of ascribing the clflush to the execution when profiling. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 42866c01540d..4590c78f4283 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -971,7 +971,8 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
971 if (obj_priv->phys_obj) 971 if (obj_priv->phys_obj)
972 ret = i915_gem_phys_pwrite(dev, obj, args, file_priv); 972 ret = i915_gem_phys_pwrite(dev, obj, args, file_priv);
973 else if (obj_priv->tiling_mode == I915_TILING_NONE && 973 else if (obj_priv->tiling_mode == I915_TILING_NONE &&
974 dev->gtt_total != 0) { 974 dev->gtt_total != 0 &&
975 obj->write_domain != I915_GEM_DOMAIN_CPU) {
975 ret = i915_gem_gtt_pwrite_fast(dev, obj, args, file_priv); 976 ret = i915_gem_gtt_pwrite_fast(dev, obj, args, file_priv);
976 if (ret == -EFAULT) { 977 if (ret == -EFAULT) {
977 ret = i915_gem_gtt_pwrite_slow(dev, obj, args, 978 ret = i915_gem_gtt_pwrite_slow(dev, obj, args,