diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-03-30 07:24:06 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-03-30 11:20:43 -0400 |
commit | e6bf6e5799f72f04bac61056804d6dd8dac98062 (patch) | |
tree | 5ded144cffb3afd4843b2956f9285febbb7c8377 | |
parent | 67535531b1b2bfcc707c8c37f35196cf4ede4252 (diff) |
drm/ttm: Remove TTM_HAS_AGP
It tries to do fancy things with excluding agp support if ttm is
built-in, but agp isn't. Instead just express this depency like drm
does and use CONFIG_AGP everywhere.
Also use the neat Makefile magic to make the entire ttm_agp_backend
file optional.
v2: Use IS_ENABLED(CONFIG_AGP) as suggested by Ville
v3: Review from Emil.
v4: Actually get it right as spotted by 0-day.
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1459337046-25882-1-git-send-email-daniel.vetter@ffwll.ch
-rw-r--r-- | drivers/gpu/drm/ttm/Makefile | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_agp_backend.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_page_alloc.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 8 | ||||
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 3 |
5 files changed, 11 insertions, 14 deletions
diff --git a/drivers/gpu/drm/ttm/Makefile b/drivers/gpu/drm/ttm/Makefile index b433b9f040c9..f92325800f8a 100644 --- a/drivers/gpu/drm/ttm/Makefile +++ b/drivers/gpu/drm/ttm/Makefile | |||
@@ -2,9 +2,10 @@ | |||
2 | # Makefile for the drm device driver. This driver provides support for the | 2 | # Makefile for the drm device driver. This driver provides support for the |
3 | 3 | ||
4 | ccflags-y := -Iinclude/drm | 4 | ccflags-y := -Iinclude/drm |
5 | ttm-y := ttm_agp_backend.o ttm_memory.o ttm_tt.o ttm_bo.o \ | 5 | ttm-y := ttm_memory.o ttm_tt.o ttm_bo.o \ |
6 | ttm_bo_util.o ttm_bo_vm.o ttm_module.o \ | 6 | ttm_bo_util.o ttm_bo_vm.o ttm_module.o \ |
7 | ttm_object.o ttm_lock.o ttm_execbuf_util.o ttm_page_alloc.o \ | 7 | ttm_object.o ttm_lock.o ttm_execbuf_util.o ttm_page_alloc.o \ |
8 | ttm_bo_manager.o ttm_page_alloc_dma.o | 8 | ttm_bo_manager.o ttm_page_alloc_dma.o |
9 | ttm-$(CONFIG_AGP) += ttm_agp_backend.o | ||
9 | 10 | ||
10 | obj-$(CONFIG_DRM_TTM) += ttm.o | 11 | obj-$(CONFIG_DRM_TTM) += ttm.o |
diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c index 764be36397fd..028ab6007873 100644 --- a/drivers/gpu/drm/ttm/ttm_agp_backend.c +++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <drm/ttm/ttm_module.h> | 34 | #include <drm/ttm/ttm_module.h> |
35 | #include <drm/ttm/ttm_bo_driver.h> | 35 | #include <drm/ttm/ttm_bo_driver.h> |
36 | #include <drm/ttm/ttm_page_alloc.h> | 36 | #include <drm/ttm/ttm_page_alloc.h> |
37 | #ifdef TTM_HAS_AGP | ||
38 | #include <drm/ttm/ttm_placement.h> | 37 | #include <drm/ttm/ttm_placement.h> |
39 | #include <linux/agp_backend.h> | 38 | #include <linux/agp_backend.h> |
40 | #include <linux/module.h> | 39 | #include <linux/module.h> |
@@ -148,5 +147,3 @@ void ttm_agp_tt_unpopulate(struct ttm_tt *ttm) | |||
148 | ttm_pool_unpopulate(ttm); | 147 | ttm_pool_unpopulate(ttm); |
149 | } | 148 | } |
150 | EXPORT_SYMBOL(ttm_agp_tt_unpopulate); | 149 | EXPORT_SYMBOL(ttm_agp_tt_unpopulate); |
151 | |||
152 | #endif | ||
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 025c429050c0..a37de5db5731 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c | |||
@@ -48,7 +48,7 @@ | |||
48 | #include <drm/ttm/ttm_bo_driver.h> | 48 | #include <drm/ttm/ttm_bo_driver.h> |
49 | #include <drm/ttm/ttm_page_alloc.h> | 49 | #include <drm/ttm/ttm_page_alloc.h> |
50 | 50 | ||
51 | #ifdef TTM_HAS_AGP | 51 | #if IS_ENABLED(CONFIG_AGP) |
52 | #include <asm/agp.h> | 52 | #include <asm/agp.h> |
53 | #endif | 53 | #endif |
54 | 54 | ||
@@ -219,7 +219,7 @@ static struct ttm_pool_manager *_manager; | |||
219 | #ifndef CONFIG_X86 | 219 | #ifndef CONFIG_X86 |
220 | static int set_pages_array_wb(struct page **pages, int addrinarray) | 220 | static int set_pages_array_wb(struct page **pages, int addrinarray) |
221 | { | 221 | { |
222 | #ifdef TTM_HAS_AGP | 222 | #if IS_ENABLED(CONFIG_AGP) |
223 | int i; | 223 | int i; |
224 | 224 | ||
225 | for (i = 0; i < addrinarray; i++) | 225 | for (i = 0; i < addrinarray; i++) |
@@ -230,7 +230,7 @@ static int set_pages_array_wb(struct page **pages, int addrinarray) | |||
230 | 230 | ||
231 | static int set_pages_array_wc(struct page **pages, int addrinarray) | 231 | static int set_pages_array_wc(struct page **pages, int addrinarray) |
232 | { | 232 | { |
233 | #ifdef TTM_HAS_AGP | 233 | #if IS_ENABLED(CONFIG_AGP) |
234 | int i; | 234 | int i; |
235 | 235 | ||
236 | for (i = 0; i < addrinarray; i++) | 236 | for (i = 0; i < addrinarray; i++) |
@@ -241,7 +241,7 @@ static int set_pages_array_wc(struct page **pages, int addrinarray) | |||
241 | 241 | ||
242 | static int set_pages_array_uc(struct page **pages, int addrinarray) | 242 | static int set_pages_array_uc(struct page **pages, int addrinarray) |
243 | { | 243 | { |
244 | #ifdef TTM_HAS_AGP | 244 | #if IS_ENABLED(CONFIG_AGP) |
245 | int i; | 245 | int i; |
246 | 246 | ||
247 | for (i = 0; i < addrinarray; i++) | 247 | for (i = 0; i < addrinarray; i++) |
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index 624d941aaad1..bef9f6feb635 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | |||
@@ -50,7 +50,7 @@ | |||
50 | #include <linux/kthread.h> | 50 | #include <linux/kthread.h> |
51 | #include <drm/ttm/ttm_bo_driver.h> | 51 | #include <drm/ttm/ttm_bo_driver.h> |
52 | #include <drm/ttm/ttm_page_alloc.h> | 52 | #include <drm/ttm/ttm_page_alloc.h> |
53 | #ifdef TTM_HAS_AGP | 53 | #if IS_ENABLED(CONFIG_AGP) |
54 | #include <asm/agp.h> | 54 | #include <asm/agp.h> |
55 | #endif | 55 | #endif |
56 | 56 | ||
@@ -271,7 +271,7 @@ static struct kobj_type ttm_pool_kobj_type = { | |||
271 | #ifndef CONFIG_X86 | 271 | #ifndef CONFIG_X86 |
272 | static int set_pages_array_wb(struct page **pages, int addrinarray) | 272 | static int set_pages_array_wb(struct page **pages, int addrinarray) |
273 | { | 273 | { |
274 | #ifdef TTM_HAS_AGP | 274 | #if IS_ENABLED(CONFIG_AGP) |
275 | int i; | 275 | int i; |
276 | 276 | ||
277 | for (i = 0; i < addrinarray; i++) | 277 | for (i = 0; i < addrinarray; i++) |
@@ -282,7 +282,7 @@ static int set_pages_array_wb(struct page **pages, int addrinarray) | |||
282 | 282 | ||
283 | static int set_pages_array_wc(struct page **pages, int addrinarray) | 283 | static int set_pages_array_wc(struct page **pages, int addrinarray) |
284 | { | 284 | { |
285 | #ifdef TTM_HAS_AGP | 285 | #if IS_ENABLED(CONFIG_AGP) |
286 | int i; | 286 | int i; |
287 | 287 | ||
288 | for (i = 0; i < addrinarray; i++) | 288 | for (i = 0; i < addrinarray; i++) |
@@ -293,7 +293,7 @@ static int set_pages_array_wc(struct page **pages, int addrinarray) | |||
293 | 293 | ||
294 | static int set_pages_array_uc(struct page **pages, int addrinarray) | 294 | static int set_pages_array_uc(struct page **pages, int addrinarray) |
295 | { | 295 | { |
296 | #ifdef TTM_HAS_AGP | 296 | #if IS_ENABLED(CONFIG_AGP) |
297 | int i; | 297 | int i; |
298 | 298 | ||
299 | for (i = 0; i < addrinarray; i++) | 299 | for (i = 0; i < addrinarray; i++) |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 3d4bf08aa21f..cb91f80c15b3 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -1030,8 +1030,7 @@ extern pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp); | |||
1030 | 1030 | ||
1031 | extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; | 1031 | extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; |
1032 | 1032 | ||
1033 | #if (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) | 1033 | #if IS_ENABLED(CONFIG_AGP) |
1034 | #define TTM_HAS_AGP | ||
1035 | #include <linux/agp_backend.h> | 1034 | #include <linux/agp_backend.h> |
1036 | 1035 | ||
1037 | /** | 1036 | /** |