[Intel-gfx] [RFC 13/28] drm/i915: Make Gen10 platform support optional

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Wed Apr 14 11:50:13 UTC 2021


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 drivers/gpu/drm/i915/Kconfig.platforms | 11 +++++++++++
 drivers/gpu/drm/i915/i915_drv.h        |  6 ++++--
 drivers/gpu/drm/i915/i915_pci.c        |  4 ++++
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/Kconfig.platforms b/drivers/gpu/drm/i915/Kconfig.platforms
index 5a7aeebee482..3d4d6deea0de 100644
--- a/drivers/gpu/drm/i915/Kconfig.platforms
+++ b/drivers/gpu/drm/i915/Kconfig.platforms
@@ -230,3 +230,14 @@ config DRM_I915_PLATFORM_INTEL_BROXTON
 	help
 	  Include support for Intel Coffeelake platforms.
 
+config DRM_I915_GEN10
+	bool
+
+config DRM_I915_PLATFORM_INTEL_CANNONLAKE
+	bool "Intel Cannonlake platform support"
+	default y
+	depends on DRM_I915
+	select DRM_I915_GEN10
+	help
+	  Include support for Intel Cannonlake platforms.
+
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 32b22b379a0c..90a83876b72d 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2611,7 +2611,7 @@ intel_info(const struct drm_i915_private *dev_priv)
 #define IS_KABYLAKE(dev_priv)	IS_OPT_PLATFORM(dev_priv, INTEL_KABYLAKE)
 #define IS_GEMINILAKE(dev_priv)	IS_OPT_PLATFORM(dev_priv, INTEL_GEMINILAKE)
 #define IS_COFFEELAKE(dev_priv)	IS_OPT_PLATFORM(dev_priv, INTEL_COFFEELAKE)
-#define IS_CANNONLAKE(dev_priv)	IS_PLATFORM(dev_priv, INTEL_CANNONLAKE)
+#define IS_CANNONLAKE(dev_priv)	IS_OPT_PLATFORM(dev_priv, INTEL_CANNONLAKE)
 #define IS_ICELAKE(dev_priv)	IS_PLATFORM(dev_priv, INTEL_ICELAKE)
 #define IS_MOBILE(dev_priv)	((dev_priv)->info.is_mobile)
 #define IS_HSW_EARLY_SDV(dev_priv) (IS_HASWELL(dev_priv) && \
@@ -2747,7 +2747,9 @@ intel_info(const struct drm_i915_private *dev_priv)
 #define IS_GEN9(dev_priv) \
 	(IS_ENABLED(CONFIG_DRM_I915_GEN9) && \
 	 ((dev_priv)->info.gen_mask & BIT(8)))
-#define IS_GEN10(dev_priv)	(!!((dev_priv)->info.gen_mask & BIT(9)))
+#define IS_GEN10(dev_priv) \
+	(IS_ENABLED(CONFIG_DRM_I915_GEN10) && \
+	 ((dev_priv)->info.gen_mask & BIT(9)))
 #define IS_GEN11(dev_priv)	(!!((dev_priv)->info.gen_mask & BIT(10)))
 
 #define IS_LP(dev_priv)	(INTEL_INFO(dev_priv)->is_lp)
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 49b0cbfcd76c..4d0d84dec9df 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -629,6 +629,7 @@ static const struct intel_device_info intel_coffeelake_gt3_info = {
 	.ddb_size = 1024, \
 	GLK_COLORS
 
+#ifdef CONFIG_DRM_I915_PLATFORM_INTEL_CANNONLAKE
 static const struct intel_device_info intel_cannonlake_info = {
 	GEN10_FEATURES,
 	.is_alpha_support = 1,
@@ -636,6 +637,7 @@ static const struct intel_device_info intel_cannonlake_info = {
 	.gen = 10,
 	.gt = 2,
 };
+#endif
 
 #define GEN11_FEATURES \
 	GEN10_FEATURES, \
@@ -759,7 +761,9 @@ static const struct pci_device_id pciidlist[] = {
 	INTEL_CFL_U_GT2_IDS(&intel_coffeelake_gt2_info),
 	INTEL_CFL_U_GT3_IDS(&intel_coffeelake_gt3_info),
 #endif
+#ifdef CONFIG_DRM_I915_PLATFORM_INTEL_CANNONLAKE
 	INTEL_CNL_IDS(&intel_cannonlake_info),
+#endif
 	{0, 0, 0}
 };
 MODULE_DEVICE_TABLE(pci, pciidlist);
-- 
2.27.0



More information about the Intel-gfx mailing list