All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/3] drm/i915: nuke pch type :o
@ 2018-02-02 20:00 Jani Nikula
  2018-02-02 20:00 ` [RFC 1/3] drm/i915: introduce INTEL_PCH_ID() and use it Jani Nikula
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Jani Nikula @ 2018-02-02 20:00 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

I was wondering how to clean up intel_virt_detect_pch(), also in a more future
compatible manner, and came up with this idea.

Is the text size increase in patch 3/3 too bad, that is the question.

BR,
Jani.


Jani Nikula (3):
  drm/i915: introduce INTEL_PCH_ID() and use it
  drm/i915/debugfs: print PCH id instead of PCH type in i915
    capabilities
  drm/i915: obliterate PCH types in favour of direct PCH id use

 drivers/gpu/drm/i915/i915_debugfs.c |  2 +-
 drivers/gpu/drm/i915/i915_drv.c     | 46 +++++++----------------
 drivers/gpu/drm/i915/i915_drv.h     | 73 +++++++++++++++++++++----------------
 3 files changed, 57 insertions(+), 64 deletions(-)

-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [RFC 1/3] drm/i915: introduce INTEL_PCH_ID() and use it
  2018-02-02 20:00 [RFC 0/3] drm/i915: nuke pch type :o Jani Nikula
@ 2018-02-02 20:00 ` Jani Nikula
  2018-02-02 20:00 ` [RFC 2/3] drm/i915/debugfs: print PCH id instead of PCH type in i915 capabilities Jani Nikula
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2018-02-02 20:00 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Prepare for more widespread use of PCH id. No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 4e158aab36d6..a1454045629a 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2861,19 +2861,20 @@ intel_info(const struct drm_i915_private *dev_priv)
 #define INTEL_PCH_QEMU_DEVICE_ID_TYPE		0x2900 /* qemu q35 has 2918 */
 
 #define INTEL_PCH_TYPE(dev_priv) ((dev_priv)->pch_type)
+#define INTEL_PCH_ID(dev_priv) ((dev_priv)->pch_id)
 #define HAS_PCH_ICP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_ICP)
 #define HAS_PCH_CNP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_CNP)
 #define HAS_PCH_CNP_LP(dev_priv) \
-	((dev_priv)->pch_id == INTEL_PCH_CNP_LP_DEVICE_ID_TYPE)
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_CNP_LP_DEVICE_ID_TYPE)
 #define HAS_PCH_KBP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_KBP)
 #define HAS_PCH_SPT(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_SPT)
 #define HAS_PCH_LPT(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_LPT)
 #define HAS_PCH_LPT_LP(dev_priv) \
-	((dev_priv)->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE || \
-	 (dev_priv)->pch_id == INTEL_PCH_WPT_LP_DEVICE_ID_TYPE)
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE || \
+	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_WPT_LP_DEVICE_ID_TYPE)
 #define HAS_PCH_LPT_H(dev_priv) \
-	((dev_priv)->pch_id == INTEL_PCH_LPT_DEVICE_ID_TYPE || \
-	 (dev_priv)->pch_id == INTEL_PCH_WPT_DEVICE_ID_TYPE)
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_LPT_DEVICE_ID_TYPE || \
+	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_WPT_DEVICE_ID_TYPE)
 #define HAS_PCH_CPT(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_CPT)
 #define HAS_PCH_IBX(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_IBX)
 #define HAS_PCH_NOP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_NOP)
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC 2/3] drm/i915/debugfs: print PCH id instead of PCH type in i915 capabilities
  2018-02-02 20:00 [RFC 0/3] drm/i915: nuke pch type :o Jani Nikula
  2018-02-02 20:00 ` [RFC 1/3] drm/i915: introduce INTEL_PCH_ID() and use it Jani Nikula
@ 2018-02-02 20:00 ` Jani Nikula
  2018-02-02 20:01 ` [RFC 3/3] drm/i915: obliterate PCH types in favour of direct PCH id use Jani Nikula
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2018-02-02 20:00 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Preparation for future patches. Split this out to highlight the debugfs
change.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 3849ded354e3..1bc7d9db0ddf 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -45,7 +45,7 @@ static int i915_capabilities(struct seq_file *m, void *data)
 
 	seq_printf(m, "gen: %d\n", INTEL_GEN(dev_priv));
 	seq_printf(m, "platform: %s\n", intel_platform_name(info->platform));
-	seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(dev_priv));
+	seq_printf(m, "pch: %04x\n", INTEL_PCH_ID(dev_priv));
 
 	intel_device_info_dump_flags(info, &p);
 	intel_device_info_dump_runtime(info, &p);
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC 3/3] drm/i915: obliterate PCH types in favour of direct PCH id use
  2018-02-02 20:00 [RFC 0/3] drm/i915: nuke pch type :o Jani Nikula
  2018-02-02 20:00 ` [RFC 1/3] drm/i915: introduce INTEL_PCH_ID() and use it Jani Nikula
  2018-02-02 20:00 ` [RFC 2/3] drm/i915/debugfs: print PCH id instead of PCH type in i915 capabilities Jani Nikula
@ 2018-02-02 20:01 ` Jani Nikula
  2018-02-02 22:24   ` Chris Wilson
  2018-02-02 20:41 ` ✓ Fi.CI.BAT: success for drm/i915: nuke pch type :o Patchwork
  2018-02-03  6:22 ` ✓ Fi.CI.IGT: " Patchwork
  4 siblings, 1 reply; 8+ messages in thread
From: Jani Nikula @ 2018-02-02 20:01 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

The PCH type is an unnecessary level of abstraction that's an extra
maintenance burden. Switch to using PCH ids directly. This also
simplifies the virtual PCH detection.

The downside is code size increase for conditions that match several PCH
ids:

    text	   data	    bss	    dec	    hex	filename
-1709581	  68900	   4612	1783093	 1b3535	drivers/gpu/drm/i915/i915.ko
+1710634	  68900	   4612	1784146	 1b3952	drivers/gpu/drm/i915/i915.ko

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 46 +++++++++-------------------
 drivers/gpu/drm/i915/i915_drv.h | 68 +++++++++++++++++++++++------------------
 2 files changed, 53 insertions(+), 61 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index e9f1daf258fe..a027d753fb6a 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -123,9 +123,9 @@ static bool i915_error_injected(struct drm_i915_private *dev_priv)
 		      fmt, ##__VA_ARGS__)
 
 
-static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
+static unsigned int intel_virt_detect_pch(struct drm_i915_private *dev_priv)
 {
-	enum intel_pch ret = PCH_NOP;
+	unsigned int id = INTEL_PCH_NOP;
 
 	/*
 	 * In a virtualized passthrough environment we can be in a
@@ -135,27 +135,26 @@ static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
 	 */
 
 	if (IS_GEN5(dev_priv)) {
-		ret = PCH_IBX;
+		id = INTEL_PCH_IBX_DEVICE_ID_TYPE;
 		DRM_DEBUG_KMS("Assuming Ibex Peak PCH\n");
 	} else if (IS_GEN6(dev_priv) || IS_IVYBRIDGE(dev_priv)) {
-		ret = PCH_CPT;
+		id = INTEL_PCH_CPT_DEVICE_ID_TYPE;
 		DRM_DEBUG_KMS("Assuming CougarPoint PCH\n");
+	} else if (IS_HSW_ULT(dev_priv) || IS_BDW_ULT(dev_priv)) {
+		id = INTEL_PCH_LPT_LP_DEVICE_ID_TYPE;
+		DRM_DEBUG_KMS("Assuming LynxPoint LP PCH\n");
 	} else if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) {
-		ret = PCH_LPT;
-		if (IS_HSW_ULT(dev_priv) || IS_BDW_ULT(dev_priv))
-			dev_priv->pch_id = INTEL_PCH_LPT_LP_DEVICE_ID_TYPE;
-		else
-			dev_priv->pch_id = INTEL_PCH_LPT_DEVICE_ID_TYPE;
+		id = INTEL_PCH_LPT_DEVICE_ID_TYPE;
 		DRM_DEBUG_KMS("Assuming LynxPoint PCH\n");
 	} else if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
-		ret = PCH_SPT;
+		id = INTEL_PCH_SPT_DEVICE_ID_TYPE;
 		DRM_DEBUG_KMS("Assuming SunrisePoint PCH\n");
 	} else if (IS_COFFEELAKE(dev_priv) || IS_CANNONLAKE(dev_priv)) {
-		ret = PCH_CNP;
+		id = INTEL_PCH_CNP_DEVICE_ID_TYPE;
 		DRM_DEBUG_KMS("Assuming CannonPoint PCH\n");
 	}
 
-	return ret;
+	return id;
 }
 
 static void intel_detect_pch(struct drm_i915_private *dev_priv)
@@ -166,7 +165,7 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
 	 * (which really amounts to a PCH but no South Display).
 	 */
 	if (INTEL_INFO(dev_priv)->num_pipes == 0) {
-		dev_priv->pch_type = PCH_NOP;
+		dev_priv->pch_id = INTEL_PCH_NOP;
 		return;
 	}
 
@@ -189,81 +188,63 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
 
 		id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
 
-		dev_priv->pch_id = id;
-
 		if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) {
-			dev_priv->pch_type = PCH_IBX;
 			DRM_DEBUG_KMS("Found Ibex Peak PCH\n");
 			WARN_ON(!IS_GEN5(dev_priv));
 		} else if (id == INTEL_PCH_CPT_DEVICE_ID_TYPE) {
-			dev_priv->pch_type = PCH_CPT;
 			DRM_DEBUG_KMS("Found CougarPoint PCH\n");
 			WARN_ON(!IS_GEN6(dev_priv) &&
 				!IS_IVYBRIDGE(dev_priv));
 		} else if (id == INTEL_PCH_PPT_DEVICE_ID_TYPE) {
-			/* PantherPoint is CPT compatible */
-			dev_priv->pch_type = PCH_CPT;
 			DRM_DEBUG_KMS("Found PantherPoint PCH\n");
 			WARN_ON(!IS_GEN6(dev_priv) &&
 				!IS_IVYBRIDGE(dev_priv));
 		} else if (id == INTEL_PCH_LPT_DEVICE_ID_TYPE) {
-			dev_priv->pch_type = PCH_LPT;
 			DRM_DEBUG_KMS("Found LynxPoint PCH\n");
 			WARN_ON(!IS_HASWELL(dev_priv) &&
 				!IS_BROADWELL(dev_priv));
 			WARN_ON(IS_HSW_ULT(dev_priv) ||
 				IS_BDW_ULT(dev_priv));
 		} else if (id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) {
-			dev_priv->pch_type = PCH_LPT;
 			DRM_DEBUG_KMS("Found LynxPoint LP PCH\n");
 			WARN_ON(!IS_HASWELL(dev_priv) &&
 				!IS_BROADWELL(dev_priv));
 			WARN_ON(!IS_HSW_ULT(dev_priv) &&
 				!IS_BDW_ULT(dev_priv));
 		} else if (id == INTEL_PCH_WPT_DEVICE_ID_TYPE) {
-			/* WildcatPoint is LPT compatible */
-			dev_priv->pch_type = PCH_LPT;
 			DRM_DEBUG_KMS("Found WildcatPoint PCH\n");
 			WARN_ON(!IS_HASWELL(dev_priv) &&
 				!IS_BROADWELL(dev_priv));
 			WARN_ON(IS_HSW_ULT(dev_priv) ||
 				IS_BDW_ULT(dev_priv));
 		} else if (id == INTEL_PCH_WPT_LP_DEVICE_ID_TYPE) {
-			/* WildcatPoint is LPT compatible */
-			dev_priv->pch_type = PCH_LPT;
 			DRM_DEBUG_KMS("Found WildcatPoint LP PCH\n");
 			WARN_ON(!IS_HASWELL(dev_priv) &&
 				!IS_BROADWELL(dev_priv));
 			WARN_ON(!IS_HSW_ULT(dev_priv) &&
 				!IS_BDW_ULT(dev_priv));
 		} else if (id == INTEL_PCH_SPT_DEVICE_ID_TYPE) {
-			dev_priv->pch_type = PCH_SPT;
 			DRM_DEBUG_KMS("Found SunrisePoint PCH\n");
 			WARN_ON(!IS_SKYLAKE(dev_priv) &&
 				!IS_KABYLAKE(dev_priv));
 		} else if (id == INTEL_PCH_SPT_LP_DEVICE_ID_TYPE) {
-			dev_priv->pch_type = PCH_SPT;
 			DRM_DEBUG_KMS("Found SunrisePoint LP PCH\n");
 			WARN_ON(!IS_SKYLAKE(dev_priv) &&
 				!IS_KABYLAKE(dev_priv));
 		} else if (id == INTEL_PCH_KBP_DEVICE_ID_TYPE) {
-			dev_priv->pch_type = PCH_KBP;
 			DRM_DEBUG_KMS("Found Kaby Lake PCH (KBP)\n");
 			WARN_ON(!IS_SKYLAKE(dev_priv) &&
 				!IS_KABYLAKE(dev_priv) &&
 				!IS_COFFEELAKE(dev_priv));
 		} else if (id == INTEL_PCH_CNP_DEVICE_ID_TYPE) {
-			dev_priv->pch_type = PCH_CNP;
 			DRM_DEBUG_KMS("Found Cannon Lake PCH (CNP)\n");
 			WARN_ON(!IS_CANNONLAKE(dev_priv) &&
 				!IS_COFFEELAKE(dev_priv));
 		} else if (id == INTEL_PCH_CNP_LP_DEVICE_ID_TYPE) {
-			dev_priv->pch_type = PCH_CNP;
 			DRM_DEBUG_KMS("Found Cannon Lake LP PCH (CNP-LP)\n");
 			WARN_ON(!IS_CANNONLAKE(dev_priv) &&
 				!IS_COFFEELAKE(dev_priv));
 		} else if (id == INTEL_PCH_ICP_DEVICE_ID_TYPE) {
-			dev_priv->pch_type = PCH_ICP;
 			DRM_DEBUG_KMS("Found Ice Lake PCH\n");
 			WARN_ON(!IS_ICELAKE(dev_priv));
 		} else if (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
@@ -273,11 +254,12 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
 			    PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
 			    pch->subsystem_device ==
 			    PCI_SUBDEVICE_ID_QEMU)) {
-			dev_priv->pch_type = intel_virt_detect_pch(dev_priv);
+			id = intel_virt_detect_pch(dev_priv);
 		} else {
 			continue;
 		}
 
+		dev_priv->pch_id = id;
 		break;
 	}
 	if (!pch)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index a1454045629a..0e178735be47 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -778,18 +778,6 @@ struct i915_psr {
 	void (*setup_vsc)(struct intel_dp *, const struct intel_crtc_state *);
 };
 
-enum intel_pch {
-	PCH_NONE = 0,	/* No PCH present */
-	PCH_IBX,	/* Ibexpeak PCH */
-	PCH_CPT,	/* Cougarpoint/Pantherpoint PCH */
-	PCH_LPT,	/* Lynxpoint/Wildcatpoint PCH */
-	PCH_SPT,        /* Sunrisepoint PCH */
-	PCH_KBP,        /* Kaby Lake PCH */
-	PCH_CNP,        /* Cannon Lake PCH */
-	PCH_ICP,	/* Ice Lake PCH */
-	PCH_NOP,
-};
-
 enum intel_sbi_destination {
 	SBI_ICLK,
 	SBI_MPHY,
@@ -1973,8 +1961,7 @@ struct drm_i915_private {
 	/* Display functions */
 	struct drm_i915_display_funcs display;
 
-	/* PCH chipset type */
-	enum intel_pch pch_type;
+	/* PCH chipset id */
 	unsigned short pch_id;
 
 	unsigned long quirks;
@@ -2842,6 +2829,9 @@ intel_info(const struct drm_i915_private *dev_priv)
 
 #define HAS_POOLED_EU(dev_priv)	((dev_priv)->info.has_pooled_eu)
 
+#define INTEL_PCH_NONE				0x0000
+#define INTEL_PCH_NOP				0xffff
+
 #define INTEL_PCH_DEVICE_ID_MASK		0xff80
 #define INTEL_PCH_IBX_DEVICE_ID_TYPE		0x3b00
 #define INTEL_PCH_CPT_DEVICE_ID_TYPE		0x1c00
@@ -2860,25 +2850,45 @@ intel_info(const struct drm_i915_private *dev_priv)
 #define INTEL_PCH_P3X_DEVICE_ID_TYPE		0x7000
 #define INTEL_PCH_QEMU_DEVICE_ID_TYPE		0x2900 /* qemu q35 has 2918 */
 
-#define INTEL_PCH_TYPE(dev_priv) ((dev_priv)->pch_type)
 #define INTEL_PCH_ID(dev_priv) ((dev_priv)->pch_id)
-#define HAS_PCH_ICP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_ICP)
-#define HAS_PCH_CNP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_CNP)
-#define HAS_PCH_CNP_LP(dev_priv) \
-	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_CNP_LP_DEVICE_ID_TYPE)
-#define HAS_PCH_KBP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_KBP)
-#define HAS_PCH_SPT(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_SPT)
-#define HAS_PCH_LPT(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_LPT)
+
+#define HAS_PCH_NOP(dev_priv) \
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_NOP)
+#define HAS_PCH_SPLIT(dev_priv) \
+	(INTEL_PCH_ID(dev_priv) != INTEL_PCH_NONE)
+
+/* IbexPeak PCH */
+#define HAS_PCH_IBX(dev_priv) \
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_IBX_DEVICE_ID_TYPE)
+/* CougarPoint/PantherPoint PCH */
+#define HAS_PCH_CPT(dev_priv)					   \
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_CPT_DEVICE_ID_TYPE || \
+	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_PPT_DEVICE_ID_TYPE)
+/* LynxPoint/WildcatPoint PCH */
+#define HAS_PCH_LPT_H(dev_priv)					   \
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_LPT_DEVICE_ID_TYPE || \
+	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_WPT_DEVICE_ID_TYPE)
 #define HAS_PCH_LPT_LP(dev_priv) \
 	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE || \
 	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_WPT_LP_DEVICE_ID_TYPE)
-#define HAS_PCH_LPT_H(dev_priv) \
-	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_LPT_DEVICE_ID_TYPE || \
-	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_WPT_DEVICE_ID_TYPE)
-#define HAS_PCH_CPT(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_CPT)
-#define HAS_PCH_IBX(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_IBX)
-#define HAS_PCH_NOP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_NOP)
-#define HAS_PCH_SPLIT(dev_priv) (INTEL_PCH_TYPE(dev_priv) != PCH_NONE)
+#define HAS_PCH_LPT(dev_priv) \
+	(HAS_PCH_LPT_H(dev_priv) || HAS_PCH_LPT_LP(dev_priv))
+/* SunrisePoint PCH */
+#define HAS_PCH_SPT(dev_priv)					   \
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_SPT_DEVICE_ID_TYPE || \
+	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_SPT_LP_DEVICE_ID_TYPE)
+/* KabyLake PCH */
+#define HAS_PCH_KBP(dev_priv)						\
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_KBP_DEVICE_ID_TYPE)
+/* CannonLake PCH */
+#define HAS_PCH_CNP(dev_priv)					   \
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_CNP_DEVICE_ID_TYPE || \
+	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_CNP_LP_DEVICE_ID_TYPE)
+#define HAS_PCH_CNP_LP(dev_priv) \
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_CNP_LP_DEVICE_ID_TYPE)
+/* IceLake PCH */
+#define HAS_PCH_ICP(dev_priv)						\
+	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_ICP_DEVICE_ID_TYPE)
 
 #define HAS_GMCH_DISPLAY(dev_priv) ((dev_priv)->info.has_gmch_display)
 
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: nuke pch type :o
  2018-02-02 20:00 [RFC 0/3] drm/i915: nuke pch type :o Jani Nikula
                   ` (2 preceding siblings ...)
  2018-02-02 20:01 ` [RFC 3/3] drm/i915: obliterate PCH types in favour of direct PCH id use Jani Nikula
@ 2018-02-02 20:41 ` Patchwork
  2018-02-03  6:22 ` ✓ Fi.CI.IGT: " Patchwork
  4 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2018-02-02 20:41 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: nuke pch type :o
URL   : https://patchwork.freedesktop.org/series/37581/
State : success

== Summary ==

Series 37581v1 drm/i915: nuke pch type :o
https://patchwork.freedesktop.org/api/1.0/series/37581/revisions/1/mbox/

Test debugfs_test:
        Subgroup read_all_entries:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713
Test gem_exec_suspend:
        Subgroup basic-s4-devices:
                pass       -> INCOMPLETE (fi-bdw-5557u) fdo#104162
Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                fail       -> PASS       (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                fail       -> PASS       (fi-skl-guc) fdo#103191

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#104162 https://bugs.freedesktop.org/show_bug.cgi?id=104162
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191

fi-bdw-5557u     total:109  pass:105  dwarn:0   dfail:0   fail:0   skip:3  
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:423s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:370s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:487s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:281s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:483s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:479s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:464s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:458s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:570s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:413s
fi-gdg-551       total:288  pass:180  dwarn:0   dfail:0   fail:0   skip:108 time:280s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:508s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:393s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:397s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:412s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:458s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:413s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:459s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:496s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:452s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:499s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:587s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:427s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:507s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:526s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:484s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:487s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:414s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:428s
fi-snb-2520m     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:391s
Blacklisted hosts:
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:467s

c051d09ed8f4b307b8d00076380e657759bd8eb5 drm-tip: 2018y-02m-02d-19h-34m-35s UTC integration manifest
c9640917d438 drm/i915: obliterate PCH types in favour of direct PCH id use
a42e9060d5a8 drm/i915/debugfs: print PCH id instead of PCH type in i915 capabilities
9d855e64b20d drm/i915: introduce INTEL_PCH_ID() and use it

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7869/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC 3/3] drm/i915: obliterate PCH types in favour of direct PCH id use
  2018-02-02 20:01 ` [RFC 3/3] drm/i915: obliterate PCH types in favour of direct PCH id use Jani Nikula
@ 2018-02-02 22:24   ` Chris Wilson
  2018-02-05  9:49     ` Jani Nikula
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2018-02-02 22:24 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Quoting Jani Nikula (2018-02-02 20:01:00)
> The PCH type is an unnecessary level of abstraction that's an extra
> maintenance burden. Switch to using PCH ids directly. This also
> simplifies the virtual PCH detection.

But you are still using the PCH type, just computing it from the id
inside the conditionals. Not sure if that's a good idea, remember the
long chains of devid == X || devid == Y || ... we used to have?

I guess a convincing argument that the abstraction is ill-conceived
would be when it bloats the code, as that shows the abstraction's
semantics do not match and are a hindrance to use. Maybe there's another
transformation that improves usage?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915: nuke pch type :o
  2018-02-02 20:00 [RFC 0/3] drm/i915: nuke pch type :o Jani Nikula
                   ` (3 preceding siblings ...)
  2018-02-02 20:41 ` ✓ Fi.CI.BAT: success for drm/i915: nuke pch type :o Patchwork
@ 2018-02-03  6:22 ` Patchwork
  4 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2018-02-03  6:22 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: nuke pch type :o
URL   : https://patchwork.freedesktop.org/series/37581/
State : success

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7869/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC 3/3] drm/i915: obliterate PCH types in favour of direct PCH id use
  2018-02-02 22:24   ` Chris Wilson
@ 2018-02-05  9:49     ` Jani Nikula
  0 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2018-02-05  9:49 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On Fri, 02 Feb 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Jani Nikula (2018-02-02 20:01:00)
>> The PCH type is an unnecessary level of abstraction that's an extra
>> maintenance burden. Switch to using PCH ids directly. This also
>> simplifies the virtual PCH detection.
>
> But you are still using the PCH type, just computing it from the id
> inside the conditionals. Not sure if that's a good idea, remember the
> long chains of devid == X || devid == Y || ... we used to have?

I've forgotten, maybe I didn't learn from history... but you're right
I'm still using the "pch type". But the current code is using the devids
in addition to the types too.

> I guess a convincing argument that the abstraction is ill-conceived
> would be when it bloats the code, as that shows the abstraction's
> semantics do not match and are a hindrance to use. Maybe there's another
> transformation that improves usage?

To be honest, I wasn't happy with the end result either, but decided to
post the patches as RFC as I had them written, to provoke discussion.

BR,
Jani.

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-02-05  9:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-02 20:00 [RFC 0/3] drm/i915: nuke pch type :o Jani Nikula
2018-02-02 20:00 ` [RFC 1/3] drm/i915: introduce INTEL_PCH_ID() and use it Jani Nikula
2018-02-02 20:00 ` [RFC 2/3] drm/i915/debugfs: print PCH id instead of PCH type in i915 capabilities Jani Nikula
2018-02-02 20:01 ` [RFC 3/3] drm/i915: obliterate PCH types in favour of direct PCH id use Jani Nikula
2018-02-02 22:24   ` Chris Wilson
2018-02-05  9:49     ` Jani Nikula
2018-02-02 20:41 ` ✓ Fi.CI.BAT: success for drm/i915: nuke pch type :o Patchwork
2018-02-03  6:22 ` ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.