[Intel-gfx] [PATCH 1/2] drm/i915: Provide a config option to select a target platform

Damien Lespiau damien.lespiau at intel.com
Fri Jul 11 19:34:13 CEST 2014


It'd be nice to be able to target a single platform to reduce the size
for the i915 driver.

Start low-fi and coarse grained: it's easy to split the (S)DVO code out,
the API surface is reduced to two init functions.

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 drivers/gpu/drm/i915/Kconfig     | 25 +++++++++++++++++++++++++
 drivers/gpu/drm/i915/Makefile    | 18 +++++++++---------
 drivers/gpu/drm/i915/intel_drv.h | 12 ++++++++++++
 3 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index 437e182..b92a999 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -34,6 +34,31 @@ config DRM_I915
 	  i810 driver instead, and the Atom z5xx series has an entirely
 	  different implementation.
 
+config DRM_I915_DVO
+	bool
+
+choice
+	prompt "Platform support"
+	default DRM_I915_PLATFORM_ALL
+	help
+	  The i915 driver can be compiled for a single chip to reduce its .text
+	  size. The driver can only be compiled that way for a subset of the
+	  supported platforms.
+
+	  If in doubt, choose "Multi-platform".
+
+config DRM_I915_PLATFORM_ALL
+	bool "Multi-platform"
+	select DRM_I915_DVO
+
+config DRM_I915_PLATFORM_HASWELL
+	bool "Haswell"
+
+config DRM_I915_PLATFORM_BROADWELL
+	bool "Broadwell"
+
+endchoice
+
 config DRM_I915_KMS
 	bool "Enable modesetting on intel by default"
 	depends on DRM_I915
diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index cad1683..346c3c1 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -50,25 +50,25 @@ i915-$(CONFIG_ACPI)		+= intel_acpi.o intel_opregion.o
 i915-$(CONFIG_DRM_I915_FBDEV)	+= intel_fbdev.o
 
 # modesetting output/encoder code
-i915-y += dvo_ch7017.o \
-	  dvo_ch7xxx.o \
-	  dvo_ivch.o \
-	  dvo_ns2501.o \
-	  dvo_sil164.o \
-	  dvo_tfp410.o \
-	  intel_crt.o \
+i915-$(CONFIG_DRM_I915_DVO) += dvo_ch7017.o \
+			       dvo_ch7xxx.o \
+			       dvo_ivch.o \
+			       dvo_ns2501.o \
+			       dvo_sil164.o \
+			       dvo_tfp410.o \
+			       intel_dvo.o \
+			       intel_sdvo.o
+i915-y += intel_crt.o \
 	  intel_ddi.o \
 	  intel_dp.o \
 	  intel_dsi_cmd.o \
 	  intel_dsi.o \
 	  intel_dsi_pll.o \
 	  intel_dsi_panel_vbt.o \
-	  intel_dvo.o \
 	  intel_hdmi.o \
 	  intel_i2c.o \
 	  intel_lvds.o \
 	  intel_panel.o \
-	  intel_sdvo.o \
 	  intel_tv.o
 
 # legacy horrors
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 81451e9..dd38095 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -871,7 +871,11 @@ void intel_dsi_init(struct drm_device *dev);
 
 
 /* intel_dvo.c */
+#ifdef CONFIG_DRM_I915_DVO
 void intel_dvo_init(struct drm_device *dev);
+#else
+static inline void intel_dvo_init(struct drm_device *dev) {}
+#endif
 
 
 /* legacy fbdev emulation in intel_fbdev.c */
@@ -1010,7 +1014,15 @@ void ilk_wm_get_hw_state(struct drm_device *dev);
 
 
 /* intel_sdvo.c */
+#ifdef CONFIG_DRM_I915_DVO
 bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob);
+#else
+static inline bool
+intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob)
+{
+	return false;
+}
+#endif
 
 
 /* intel_sprite.c */
-- 
1.8.3.1




More information about the Intel-gfx mailing list