[PATCH] drm/i915: Relax the need-mappable? flag for execbuffers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since we now can rewrite relocation pointers using the CPU domain, for
those cases we do not need to force a mappable GTT allocation.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 0a7b509..286c0e1 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -490,7 +490,7 @@ pin_and_fence_object(struct drm_i915_gem_object *obj,
 		entry->flags & EXEC_OBJECT_NEEDS_FENCE &&
 		obj->tiling_mode != I915_TILING_NONE;
 	need_mappable =
-		entry->relocation_count ? true : need_fence;
+		need_fence ?: entry->relocation_count && obj->base.write_domain != I915_GEM_DOMAIN_CPU;
 
 	ret = i915_gem_object_pin(obj, entry->alignment, need_mappable, false);
 	if (ret)
@@ -548,7 +548,7 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
 			entry->flags & EXEC_OBJECT_NEEDS_FENCE &&
 			obj->tiling_mode != I915_TILING_NONE;
 		need_mappable =
-			entry->relocation_count ? true : need_fence;
+			need_fence ?: entry->relocation_count && obj->base.write_domain != I915_GEM_DOMAIN_CPU;
 
 		if (need_mappable)
 			list_move(&obj->exec_list, &ordered_objects);
@@ -589,7 +589,7 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
 				entry->flags & EXEC_OBJECT_NEEDS_FENCE &&
 				obj->tiling_mode != I915_TILING_NONE;
 			need_mappable =
-				entry->relocation_count ? true : need_fence;
+				need_fence ?: entry->relocation_count && obj->base.write_domain != I915_GEM_DOMAIN_CPU;
 
 			if ((entry->alignment && obj->gtt_offset & (entry->alignment - 1)) ||
 			    (need_mappable && !obj->map_and_fenceable))
-- 
1.7.9.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux