summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Wajdeczko <michal.wajdeczko@intel.com>2024-06-18 12:49:47 +0200
committerMichal Wajdeczko <michal.wajdeczko@intel.com>2024-06-19 13:45:16 +0200
commit8e7455dd0dedf88332f249f8b1e50bc554e4c1e3 (patch)
tree6408f51c060fa86031a13f0c1faecbdeca76d6fc
parentcffd77865f476994680892601e09bc2164179907 (diff)
downloadlinux-stable-8e7455dd0dedf88332f249f8b1e50bc554e4c1e3.tar.gz
linux-stable-8e7455dd0dedf88332f249f8b1e50bc554e4c1e3.tar.bz2
linux-stable-8e7455dd0dedf88332f249f8b1e50bc554e4c1e3.zip
drm/xe: Use ttm_uncached for BO with NEEDS_UC flag
We should honor requested uncached mode also at the TTM layer. Otherwise, we risk losing updates to the memory based interrupts source or status vectors, as those require uncached memory. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Acked-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240618104947.729-1-michal.wajdeczko@intel.com
-rw-r--r--drivers/gpu/drm/xe/xe_bo.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 74294f1b05bc..65c696966e96 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -378,6 +378,15 @@ static struct ttm_tt *xe_ttm_tt_create(struct ttm_buffer_object *ttm_bo,
(xe->info.graphics_verx100 >= 1270 && bo->flags & XE_BO_FLAG_PAGETABLE))
caching = ttm_write_combined;
+ if (bo->flags & XE_BO_FLAG_NEEDS_UC) {
+ /*
+ * Valid only for internally-created buffers only, for
+ * which cpu_caching is never initialized.
+ */
+ xe_assert(xe, bo->cpu_caching == 0);
+ caching = ttm_uncached;
+ }
+
err = ttm_tt_init(&tt->ttm, &bo->ttm, page_flags, caching, extra_pages);
if (err) {
kfree(tt);