From a40a6ce77e2a6e9e388af7dca921254c52610954 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 11 Oct 2024 20:34:10 +0800 Subject: [PATCH] anolis: Close RADEON_GEM_GTT_WC if radeon bo is not created on VRAM ANBZ: #33993 Close RADEON_GEM_GTT_WC if radeon bo is not created on VRAM or WC is not supported by the architecture. Signed-off-by: user Signed-off-by: Juxin Gao --- drivers/gpu/drm/radeon/radeon_object.c | 2 +- include/drm/drm_cache.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 6f3c9a20a2de..a3a2310920d8 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -195,7 +195,7 @@ int radeon_bo_create(struct radeon_device *rdev, /* For architectures that don't support WC memory, * mask out the WC flag from the BO */ - if (!drm_arch_can_wc_memory()) + if (!drm_arch_can_wc_memory() || !(bo->initial_domain & RADEON_GEM_DOMAIN_VRAM)) bo->flags &= ~RADEON_GEM_GTT_WC; #endif diff --git a/include/drm/drm_cache.h b/include/drm/drm_cache.h index 667fb0368ef6..6b94c2185bca 100644 --- a/include/drm/drm_cache.h +++ b/include/drm/drm_cache.h @@ -45,6 +45,7 @@ bool drm_need_swiotlb(int dma_bits); static inline bool drm_arch_can_wc_memory(void) { + return true; #if defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE) return false; #elif defined(CONFIG_MIPS) && defined(CONFIG_CPU_LOONGSON64) -- Gitee