diff options
author | Huang Rui <ray.huang@amd.com> | 2018-08-01 01:49:33 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-08-01 18:23:56 -0400 |
commit | df36b2fb8390d98453fff1aae3927095fe9ff36c (patch) | |
tree | 83447a2d5704343d43f40d3e953d0cdd56f2c627 | |
parent | dceb219fc60766006bfe8e53afa62816b94fcb11 (diff) |
drm/ttm: clean up non-x86 definitions on ttm_tt
All non-x86 definitions are moved to ttm_set_memory header, so remove it from
ttm_tt.c.
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>
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_tt.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index a1e543972ca7..e3a0691582ff 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c | |||
@@ -38,9 +38,7 @@ | |||
38 | #include <drm/drm_cache.h> | 38 | #include <drm/drm_cache.h> |
39 | #include <drm/ttm/ttm_bo_driver.h> | 39 | #include <drm/ttm/ttm_bo_driver.h> |
40 | #include <drm/ttm/ttm_page_alloc.h> | 40 | #include <drm/ttm/ttm_page_alloc.h> |
41 | #ifdef CONFIG_X86 | 41 | #include <drm/ttm/ttm_set_memory.h> |
42 | #include <asm/set_memory.h> | ||
43 | #endif | ||
44 | 42 | ||
45 | /** | 43 | /** |
46 | * Allocates a ttm structure for the given BO. | 44 | * Allocates a ttm structure for the given BO. |
@@ -115,10 +113,9 @@ static int ttm_sg_tt_alloc_page_directory(struct ttm_dma_tt *ttm) | |||
115 | return 0; | 113 | return 0; |
116 | } | 114 | } |
117 | 115 | ||
118 | #ifdef CONFIG_X86 | 116 | static int ttm_tt_set_page_caching(struct page *p, |
119 | static inline int ttm_tt_set_page_caching(struct page *p, | 117 | enum ttm_caching_state c_old, |
120 | enum ttm_caching_state c_old, | 118 | enum ttm_caching_state c_new) |
121 | enum ttm_caching_state c_new) | ||
122 | { | 119 | { |
123 | int ret = 0; | 120 | int ret = 0; |
124 | 121 | ||
@@ -129,26 +126,18 @@ static inline int ttm_tt_set_page_caching(struct page *p, | |||
129 | /* p isn't in the default caching state, set it to | 126 | /* p isn't in the default caching state, set it to |
130 | * writeback first to free its current memtype. */ | 127 | * writeback first to free its current memtype. */ |
131 | 128 | ||
132 | ret = set_pages_wb(p, 1); | 129 | ret = ttm_set_pages_wb(p, 1); |
133 | if (ret) | 130 | if (ret) |
134 | return ret; | 131 | return ret; |
135 | } | 132 | } |
136 | 133 | ||
137 | if (c_new == tt_wc) | 134 | if (c_new == tt_wc) |
138 | ret = set_memory_wc((unsigned long) page_address(p), 1); | 135 | ret = ttm_set_pages_wc(p, 1); |
139 | else if (c_new == tt_uncached) | 136 | else if (c_new == tt_uncached) |
140 | ret = set_pages_uc(p, 1); | 137 | ret = ttm_set_pages_uc(p, 1); |
141 | 138 | ||
142 | return ret; | 139 | return ret; |
143 | } | 140 | } |
144 | #else /* CONFIG_X86 */ | ||
145 | static inline int ttm_tt_set_page_caching(struct page *p, | ||
146 | enum ttm_caching_state c_old, | ||
147 | enum ttm_caching_state c_new) | ||
148 | { | ||
149 | return 0; | ||
150 | } | ||
151 | #endif /* CONFIG_X86 */ | ||
152 | 141 | ||
153 | /* | 142 | /* |
154 | * Change caching policy for the linear kernel map | 143 | * Change caching policy for the linear kernel map |