Skip to content

Commit dceb219

Browse files
huangruialexdeucher
authored andcommitted
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>
1 parent fe71032 commit dceb219

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎include/drm/ttm/ttm_set_memory.h‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ static inline int ttm_set_pages_wb(struct page *page, int numpages)
5757
return set_pages_wb(page, numpages);
5858
}
5959

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+
6072
#else /* for CONFIG_X86 */
6173

6274
#if IS_ENABLED(CONFIG_AGP)
@@ -123,6 +135,16 @@ static inline int ttm_set_pages_wb(struct page *page, int numpages)
123135

124136
#endif /* for CONFIG_AGP */
125137

138+
static inline int ttm_set_pages_wc(struct page *page, int numpages)
139+
{
140+
return 0;
141+
}
142+
143+
static inline int ttm_set_pages_uc(struct page *page, int numpages)
144+
{
145+
return 0;
146+
}
147+
126148
#endif /* for CONFIG_X86 */
127149

128150
#endif

0 commit comments

Comments
 (0)