drm/i915: Avoid moving from CPU domain during pwrite

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Tuesday, June 1, 2010 - 2:59 pm

Gitweb:     http://git.kernel.org/linus/9b8c4a0b215e603497daebe8ecbc9b1f0f035808
Commit:     9b8c4a0b215e603497daebe8ecbc9b1f0f035808
Parent:     68f95ba9e260516411411524c45263b5d53f393c
Author:     Chris Wilson <chris@chris-wilson.co.uk>
AuthorDate: Thu May 27 14:21:01 2010 +0100
Committer:  Eric Anholt <eric@anholt.net>
CommitDate: Fri May 28 11:02:00 2010 -0700

    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>
---
 drivers/gpu/drm/i915/i915_gem.c |    3 ++-
 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 42866c0..4590c78 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,
 	if (obj_priv->phys_obj)
 		ret = i915_gem_phys_pwrite(dev, obj, args, file_priv);
 	else if (obj_priv->tiling_mode == I915_TILING_NONE &&
-		 dev->gtt_total != 0) {
+		 dev->gtt_total != 0 &&
+		 obj->write_domain != I915_GEM_DOMAIN_CPU) {
 		ret = i915_gem_gtt_pwrite_fast(dev, obj, args, file_priv);
 		if (ret == -EFAULT) {
 			ret = i915_gem_gtt_pwrite_slow(dev, obj, args,
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
drm/i915: Avoid moving from CPU domain during pwrite, Linux Kernel Mailing ..., (Tue Jun 1, 2:59 pm)