From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Subject: [PATCH] drm/xe: Simplify selecting caching mode
Date: Mon, 8 Jul 2024 14:05:50 +0200 [thread overview]
Message-ID: <20240708120550.131683-1-maarten.lankhorst@linux.intel.com> (raw)
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
next reply other threads:[~2024-07-08 12:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 12:05 Maarten Lankhorst [this message]
2024-07-08 12:11 ` ✓ CI.Patch_applied: success for drm/xe: Simplify selecting caching mode 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240708120550.131683-1-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox