Skip to content

Commit cd98c3d

Browse files
IcenowyMingcongBai
authored andcommitted
FROMLIST: drm/ttm: add pgprot handling for RISC-V
The RISC-V Svpbmt privileged extension provides support for overriding page memory coherency attributes, and, along with vendor extensions like Xtheadmae, supports pgprot_{writecombine,noncached} on RISC-V. Adapt the codepath that maps ttm_write_combined to pgprot_writecombine and ttm_noncached to pgprot_noncached to RISC-V, to allow proper page access attributes. Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Tested-by: Han Gao <rabenda.cn@gmail.com> Link: https://lore.kernel.org/r/20250722112050.909616-1-uwu@icenowy.me Signed-off-by: Han Gao <rabenda.cn@gmail.com>
1 parent 855ac46 commit cd98c3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/ttm/ttm_module.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ pgprot_t ttm_prot_from_caching(enum ttm_caching caching, pgprot_t tmp)
7474
#endif /* CONFIG_UML */
7575
#endif /* __i386__ || __x86_64__ */
7676
#if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \
77-
defined(__powerpc__) || defined(__mips__) || defined(__loongarch__)
77+
defined(__powerpc__) || defined(__mips__) || defined(__loongarch__) || \
78+
defined(__riscv)
7879
if (caching == ttm_write_combined)
7980
tmp = pgprot_writecombine(tmp);
8081
else

0 commit comments

Comments
 (0)