aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>2017-01-04 04:12:56 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-01-06 05:03:07 -0500
commit99c48e1e38f0aeaa107ad67c8d91f6c9d9d567a9 (patch)
tree35576adbd3b982d6cf0b4017b36b0973bec87d0a
parent82f42e4cc164ed486c9e2b1b74e65b176830d947 (diff)
drm: compile drm_vm.c only when needed
drm_vm.c functions are only need for DRM_LEGACY and DRM_NOUVEAU. Use a new DRM_VM to define when drm_vm.c in needed. stub drm_legacy_vma_flush() to avoid compilation issues version 4: - a "config DRM_VM" in Kconfig Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> [danvet: Fix conflict.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/Kconfig5
-rw-r--r--drivers/gpu/drm/Makefile3
-rw-r--r--drivers/gpu/drm/drm_legacy.h7
-rw-r--r--drivers/gpu/drm/nouveau/Kconfig1
4 files changed, 15 insertions, 1 deletions
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 29146fa83001..d56b85c03b7b 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -136,6 +136,10 @@ config DRM_KMS_CMA_HELPER
136 help 136 help
137 Choose this if you need the KMS CMA helper functions 137 Choose this if you need the KMS CMA helper functions
138 138
139config DRM_VM
140 bool
141 depends on DRM
142
139source "drivers/gpu/drm/i2c/Kconfig" 143source "drivers/gpu/drm/i2c/Kconfig"
140 144
141source "drivers/gpu/drm/arm/Kconfig" 145source "drivers/gpu/drm/arm/Kconfig"
@@ -264,6 +268,7 @@ source "drivers/gpu/drm/meson/Kconfig"
264menuconfig DRM_LEGACY 268menuconfig DRM_LEGACY
265 bool "Enable legacy drivers (DANGEROUS)" 269 bool "Enable legacy drivers (DANGEROUS)"
266 depends on DRM 270 depends on DRM
271 select DRM_VM
267 help 272 help
268 Enable legacy DRI1 drivers. Those drivers expose unsafe and dangerous 273 Enable legacy DRI1 drivers. Those drivers expose unsafe and dangerous
269 APIs to user-space, which can be used to circumvent access 274 APIs to user-space, which can be used to circumvent access
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index d00c389f24bf..92de3991fa56 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -5,7 +5,7 @@
5drm-y := drm_auth.o drm_bufs.o drm_cache.o \ 5drm-y := drm_auth.o drm_bufs.o drm_cache.o \
6 drm_context.o drm_dma.o \ 6 drm_context.o drm_dma.o \
7 drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o \ 7 drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o \
8 drm_lock.o drm_memory.o drm_drv.o drm_vm.o \ 8 drm_lock.o drm_memory.o drm_drv.o \
9 drm_scatter.o drm_pci.o \ 9 drm_scatter.o drm_pci.o \
10 drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o \ 10 drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o \
11 drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \ 11 drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \
@@ -19,6 +19,7 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \
19 drm_dumb_buffers.o drm_mode_config.o 19 drm_dumb_buffers.o drm_mode_config.o
20 20
21drm-$(CONFIG_DRM_LIB_RANDOM) += lib/drm_random.o 21drm-$(CONFIG_DRM_LIB_RANDOM) += lib/drm_random.o
22drm-$(CONFIG_DRM_VM) += drm_vm.o
22drm-$(CONFIG_COMPAT) += drm_ioc32.o 23drm-$(CONFIG_COMPAT) += drm_ioc32.o
23drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o 24drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o
24drm-$(CONFIG_PCI) += ati_pcigart.o 25drm-$(CONFIG_PCI) += ati_pcigart.o
diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
index c6f422e879dd..e4bb5ad747c8 100644
--- a/drivers/gpu/drm/drm_legacy.h
+++ b/drivers/gpu/drm/drm_legacy.h
@@ -74,7 +74,14 @@ int drm_legacy_freebufs(struct drm_device *d, void *v, struct drm_file *f);
74int drm_legacy_mapbufs(struct drm_device *d, void *v, struct drm_file *f); 74int drm_legacy_mapbufs(struct drm_device *d, void *v, struct drm_file *f);
75int drm_legacy_dma_ioctl(struct drm_device *d, void *v, struct drm_file *f); 75int drm_legacy_dma_ioctl(struct drm_device *d, void *v, struct drm_file *f);
76 76
77#ifdef CONFIG_DRM_VM
77void drm_legacy_vma_flush(struct drm_device *d); 78void drm_legacy_vma_flush(struct drm_device *d);
79#else
80static inline void drm_legacy_vma_flush(struct drm_device *d)
81{
82 /* do nothing */
83}
84#endif
78 85
79/* 86/*
80 * AGP Support 87 * AGP Support
diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index 2922a82cba8e..0f2f0afc8f67 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -16,6 +16,7 @@ config DRM_NOUVEAU
16 select INPUT if ACPI && X86 16 select INPUT if ACPI && X86
17 select THERMAL if ACPI && X86 17 select THERMAL if ACPI && X86
18 select ACPI_VIDEO if ACPI && X86 18 select ACPI_VIDEO if ACPI && X86
19 select DRM_VM
19 help 20 help
20 Choose this option for open-source NVIDIA support. 21 Choose this option for open-source NVIDIA support.
21 22