diff options
author | Huang Rui <ray.huang@amd.com> | 2018-08-01 08:49:32 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-08-02 01:23:05 +0300 |
commit | dceb219fc60766006bfe8e53afa62816b94fcb11 (patch) | |
tree | 88b7f4c37efb8a70fdbee57f28b6cf0bdf623ef5 /include/drm/ttm | |
parent | fe710322b81343601ca1759a9f3d4b694ed72fca (diff) | |
download | linux-dceb219fc60766006bfe8e53afa62816b94fcb11.tar.xz |
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>
Diffstat (limited to 'include/drm/ttm')
-rw-r--r-- | include/drm/ttm/ttm_set_memory.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/drm/ttm/ttm_set_memory.h b/include/drm/ttm/ttm_set_memory.h index a70723cf208b..7c492b49e38c 100644 --- a/include/drm/ttm/ttm_set_memory.h +++ b/include/drm/ttm/ttm_set_memory.h @@ -57,6 +57,18 @@ static inline int ttm_set_pages_wb(struct page *page, int 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 */ #if IS_ENABLED(CONFIG_AGP) @@ -123,6 +135,16 @@ static inline int ttm_set_pages_wb(struct page *page, int numpages) #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 |