[2/3] drm/ttm: Add ttm_set_pages_wc and ttm_set_pages_uc helper

Submitted by Huang, Ray on Aug. 1, 2018, 5:49 a.m.

Details

Message ID 1533102573-15365-2-git-send-email-ray.huang@amd.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

Huang, Ray Aug. 1, 2018, 5:49 a.m.
These two helpers will be used on set page caching.

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 include/drm/ttm/ttm_set_memory.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Patch hide | download patch | download mbox

diff --git a/include/drm/ttm/ttm_set_memory.h b/include/drm/ttm/ttm_set_memory.h
index a70723c..7c492b4 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