Commit dceb219f authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher

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: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent fe710322
...@@ -57,6 +57,18 @@ static inline int ttm_set_pages_wb(struct page *page, int numpages) ...@@ -57,6 +57,18 @@ static inline int ttm_set_pages_wb(struct page *page, int numpages)
return set_pages_wb(page, numpages); return set_pages_wb(page, numpages);
} }
static inline int ttm_set_pages_wc(struct page *page, int numpages)
{
unsigned long addr = (unsigned long)page_address(page);
return set_memory_wc(addr, numpages);
}
static inline int ttm_set_pages_uc(struct page *page, int numpages)
{
return set_pages_uc(page, numpages);
}
#else /* for CONFIG_X86 */ #else /* for CONFIG_X86 */
#if IS_ENABLED(CONFIG_AGP) #if IS_ENABLED(CONFIG_AGP)
...@@ -123,6 +135,16 @@ static inline int ttm_set_pages_wb(struct page *page, int numpages) ...@@ -123,6 +135,16 @@ static inline int ttm_set_pages_wb(struct page *page, int numpages)
#endif /* for CONFIG_AGP */ #endif /* for CONFIG_AGP */
static inline int ttm_set_pages_wc(struct page *page, int numpages)
{
return 0;
}
static inline int ttm_set_pages_uc(struct page *page, int numpages)
{
return 0;
}
#endif /* for CONFIG_X86 */ #endif /* for CONFIG_X86 */
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment