“08dd6a422a0e586c9192eecd6d5bcd1257d55d99”上不存在“...sun/tools/git@gitcode.net:openanolis/dragonwell8_jdk.git”
提交 baf72b3e 编写于 作者: H Huacai Chen 提交者: Hongchen Zhang

LoongArch: Add writecombine support for drm

mainline inclusion
from mainline-v5.19-rc1
commit 439057ec
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5OHOB
CVE: NA

--------------------------------

LoongArch maintains cache coherency in hardware, but its WUC attribute
(Weak-ordered UnCached, which is similar to WC) is out of the scope of
cache coherency machanism. This means WUC can only used for write-only
memory regions.

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: NWANG Xuerui <git@xen0n.name>
Reviewed-by: NJiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: NHuacai Chen <chenhuacai@loongson.cn>
上级 c3e886d5
...@@ -74,7 +74,7 @@ static pgprot_t drm_io_prot(struct drm_local_map *map, ...@@ -74,7 +74,7 @@ static pgprot_t drm_io_prot(struct drm_local_map *map,
tmp = pgprot_decrypted(tmp); tmp = pgprot_decrypted(tmp);
#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || \ #if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || \
defined(__mips__) defined(__mips__) || defined(__loongarch__)
if (map->type == _DRM_REGISTERS && !(map->flags & _DRM_WRITE_COMBINING)) if (map->type == _DRM_REGISTERS && !(map->flags & _DRM_WRITE_COMBINING))
tmp = pgprot_noncached(tmp); tmp = pgprot_noncached(tmp);
else else
......
...@@ -397,7 +397,7 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp) ...@@ -397,7 +397,7 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp)
tmp = pgprot_noncached(tmp); tmp = pgprot_noncached(tmp);
#endif #endif
#if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \ #if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \
defined(__powerpc__) || defined(__mips__) defined(__powerpc__) || defined(__mips__) || defined(__loongarch__)
if (caching_flags & TTM_PL_FLAG_WC) if (caching_flags & TTM_PL_FLAG_WC)
tmp = pgprot_writecombine(tmp); tmp = pgprot_writecombine(tmp);
else else
......
...@@ -65,6 +65,14 @@ static inline bool drm_arch_can_wc_memory(void) ...@@ -65,6 +65,14 @@ static inline bool drm_arch_can_wc_memory(void)
* optimization entirely for ARM and arm64. * optimization entirely for ARM and arm64.
*/ */
return false; return false;
#elif defined(CONFIG_LOONGARCH)
/*
* LoongArch maintains cache coherency in hardware, but its WUC attribute
* (Weak-ordered UnCached, which is similar to WC) is out of the scope of
* cache coherency machanism. This means WUC can only used for write-only
* memory regions.
*/
return false;
#else #else
return true; return true;
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册