Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Simplify selecting caching mode
@ 2024-07-08 12:05 Maarten Lankhorst
  2024-07-08 12:11 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Maarten Lankhorst @ 2024-07-08 12:05 UTC (permalink / raw)
  To: intel-xe; +Cc: Maarten Lankhorst

The switch is slightly overkill, with the default already set to cached
since previous commit.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/xe/xe_bo.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 31192d983d9e..d3511dd4a488 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -364,15 +364,6 @@ static struct ttm_tt *xe_ttm_tt_create(struct ttm_buffer_object *ttm_bo,
 	 * CPU.
 	 */
 	if (!IS_DGFX(xe)) {
-		switch (bo->cpu_caching) {
-		case DRM_XE_GEM_CPU_CACHING_WC:
-			caching = ttm_write_combined;
-			break;
-		default:
-			caching = ttm_cached;
-			break;
-		}
-
 		WARN_ON((bo->flags & XE_BO_FLAG_USER) && !bo->cpu_caching);
 
 		/*
@@ -381,7 +372,8 @@ static struct ttm_tt *xe_ttm_tt_create(struct ttm_buffer_object *ttm_bo,
 		 * For Xe_LPG and beyond, PPGTT PTE lookups are also
 		 * non-coherent and require a CPU:WC mapping.
 		 */
-		if ((!bo->cpu_caching && bo->flags & XE_BO_FLAG_SCANOUT) ||
+		if (bo->cpu_caching == DRM_XE_GEM_CPU_CACHING_WC ||
+		    (!bo->cpu_caching && bo->flags & XE_BO_FLAG_SCANOUT) ||
 		    (xe->info.graphics_verx100 >= 1270 &&
 		     bo->flags & XE_BO_FLAG_PAGETABLE))
 			caching = ttm_write_combined;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-07-08 17:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-08 12:05 [PATCH] drm/xe: Simplify selecting caching mode Maarten Lankhorst
2024-07-08 12:11 ` ✓ CI.Patch_applied: success for " Patchwork
2024-07-08 12:11 ` ✓ CI.checkpatch: " Patchwork
2024-07-08 12:12 ` ✓ CI.KUnit: " Patchwork
2024-07-08 12:24 ` ✓ CI.Build: " Patchwork
2024-07-08 12:26 ` ✓ CI.Hooks: " Patchwork
2024-07-08 12:28 ` ✓ CI.checksparse: " Patchwork
2024-07-08 12:48 ` ✓ CI.BAT: " Patchwork
2024-07-08 15:35 ` ✓ CI.FULL: " Patchwork
2024-07-08 17:33 ` [PATCH] " Matthew Brost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox