Skip to content

Commit 0fbcf57

Browse files
fei-yangAndi Shyti
authored andcommitted
drm/i915/mtl: end support for set caching ioctl
The design is to keep Buffer Object's caching policy immutable through out its life cycle. This patch ends the support for set caching ioctl from MTL onward. While doing that we also set BO's to be 1-way coherent at creation time because GPU is no longer automatically snooping CPU cache. For userspace components needing to fine tune the caching policy for BO's, a follow up patch will extend the GEM_CREATE uAPI to allow them specify caching mode at BO creation time. Signed-off-by: Fei Yang <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Reviewed-by: Andrzej Hajda <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 906bd0f commit 0fbcf57

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

drivers/gpu/drm/i915/gem/i915_gem_domain.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
350350
if (IS_DGFX(i915))
351351
return -ENODEV;
352352

353+
if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 70))
354+
return -EOPNOTSUPP;
355+
353356
switch (args->caching) {
354357
case I915_CACHING_NONE:
355358
level = I915_CACHE_NONE;

drivers/gpu/drm/i915/gem/i915_gem_shmem.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,14 @@ static int shmem_object_init(struct intel_memory_region *mem,
601601
obj->write_domain = I915_GEM_DOMAIN_CPU;
602602
obj->read_domains = I915_GEM_DOMAIN_CPU;
603603

604-
if (HAS_LLC(i915))
604+
/*
605+
* MTL doesn't snoop CPU cache by default for GPU access (namely
606+
* 1-way coherency). However some UMD's are currently depending on
607+
* that. Make 1-way coherent the default setting for MTL. A follow
608+
* up patch will extend the GEM_CREATE uAPI to allow UMD's specify
609+
* caching mode at BO creation time
610+
*/
611+
if (HAS_LLC(i915) || (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 70)))
605612
/* On some devices, we can have the GPU use the LLC (the CPU
606613
* cache) for about a 10% performance improvement
607614
* compared to uncached. Graphics requests other than

0 commit comments

Comments
 (0)