Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ttm: Add ttm_set_pages_wc and ttm_set_pages_uc helper

These two helpers will be used on set page caching.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Huang Rui and committed by
Alex Deucher
dceb219f fe710322

+22
+22
include/drm/ttm/ttm_set_memory.h
··· 57 57 return set_pages_wb(page, numpages); 58 58 } 59 59 60 + static inline int ttm_set_pages_wc(struct page *page, int numpages) 61 + { 62 + unsigned long addr = (unsigned long)page_address(page); 63 + 64 + return set_memory_wc(addr, numpages); 65 + } 66 + 67 + static inline int ttm_set_pages_uc(struct page *page, int numpages) 68 + { 69 + return set_pages_uc(page, numpages); 70 + } 71 + 60 72 #else /* for CONFIG_X86 */ 61 73 62 74 #if IS_ENABLED(CONFIG_AGP) ··· 134 122 } 135 123 136 124 #endif /* for CONFIG_AGP */ 125 + 126 + static inline int ttm_set_pages_wc(struct page *page, int numpages) 127 + { 128 + return 0; 129 + } 130 + 131 + static inline int ttm_set_pages_uc(struct page *page, int numpages) 132 + { 133 + return 0; 134 + } 137 135 138 136 #endif /* for CONFIG_X86 */ 139 137