[RFC 09/10] drm/i915: Lift the user PAT restriction from use_cpu_reloc

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Fri Aug 4 13:36:32 UTC 2023


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Now that i915 understands the caching modes behind PAT indices, we can
refine the check in use_cpu_reloc() to not reject the uncached PAT if it
was set by userspace.

Instead it can decide based on the presence of full coherency which
should be functionally equivalent on legacy platforms. We can ignore WT
since it is only used by the display, and we can ignore Meteorlake since
it will fail on the existing "has_llc" condition before the object cache
mode check.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Fei Yang <fei.yang at intel.com>
Cc: Matt Roper <matthew.d.roper at intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 1bc7e7fcf139..f72755a1ea11 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -646,8 +646,7 @@ static inline int use_cpu_reloc(const struct reloc_cache *cache,
 	 */
 	return (cache->has_llc ||
 		obj->cache_dirty ||
-		(!obj->pat_set_by_user &&
-		 !i915_gem_object_has_cache_mode(obj, I915_CACHE_MODE_UC)));
+		!i915_gem_object_has_cache_mode(obj, I915_CACHE_MODE_UC));
 }
 
 static int eb_reserve_vma(struct i915_execbuffer *eb,
-- 
2.39.2



More information about the Intel-gfx-trybot mailing list