All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/i915: pch detection refactoring
@ 2018-02-05 17:31 Jani Nikula
  2018-02-05 17:31 ` [PATCH 1/4] drm/i915: abstract PCH type detection from PCH id Jani Nikula
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Jani Nikula @ 2018-02-05 17:31 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

This series supersedes https://patchwork.freedesktop.org/series/37581/

BR,
Jani.


Jani Nikula (4):
  drm/i915: abstract PCH type detection from PCH id
  drm/i915: abstract virtual PCH id detection
  drm/i915: have virtual PCH detection return a PCH id
  drm/i915: introduce INTEL_PCH_ID() and use it

 drivers/gpu/drm/i915/i915_drv.c | 231 +++++++++++++++++++++-------------------
 drivers/gpu/drm/i915/i915_drv.h |  11 +-
 2 files changed, 125 insertions(+), 117 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] 15+ messages in thread

* [PATCH 1/4] drm/i915: abstract PCH type detection from PCH id
  2018-02-05 17:31 [PATCH 0/4] drm/i915: pch detection refactoring Jani Nikula
@ 2018-02-05 17:31 ` Jani Nikula
  2018-02-05 22:21   ` Rodrigo Vivi
  2018-02-05 17:31 ` [PATCH 2/4] drm/i915: abstract virtual PCH id detection Jani Nikula
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Jani Nikula @ 2018-02-05 17:31 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Make the logic in intel_detect_pch() easier to follow, and make the PCH
id to type mapping reusable. No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 148 ++++++++++++++++++++--------------------
 1 file changed, 73 insertions(+), 75 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index e9f1daf258fe..08e97b6e976b 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -122,6 +122,75 @@ static bool i915_error_injected(struct drm_i915_private *dev_priv)
 		      i915_error_injected(dev_priv) ? KERN_DEBUG : KERN_ERR, \
 		      fmt, ##__VA_ARGS__)
 
+/* Map PCH device id to PCH type, or PCH_NONE if unknown. */
+static enum intel_pch
+intel_pch_type(const struct drm_i915_private *dev_priv, unsigned short id)
+{
+	switch (id) {
+	case INTEL_PCH_IBX_DEVICE_ID_TYPE:
+		DRM_DEBUG_KMS("Found Ibex Peak PCH\n");
+		WARN_ON(!IS_GEN5(dev_priv));
+		return PCH_IBX;
+	case INTEL_PCH_CPT_DEVICE_ID_TYPE:
+		DRM_DEBUG_KMS("Found CougarPoint PCH\n");
+		WARN_ON(!IS_GEN6(dev_priv) && !IS_IVYBRIDGE(dev_priv));
+		return PCH_CPT;
+	case INTEL_PCH_PPT_DEVICE_ID_TYPE:
+		DRM_DEBUG_KMS("Found PantherPoint PCH\n");
+		WARN_ON(!IS_GEN6(dev_priv) && !IS_IVYBRIDGE(dev_priv));
+		/* PantherPoint is CPT compatible */
+		return PCH_CPT;
+	case INTEL_PCH_LPT_DEVICE_ID_TYPE:
+		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));
+		return PCH_LPT;
+	case INTEL_PCH_LPT_LP_DEVICE_ID_TYPE:
+		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));
+		return PCH_LPT;
+	case INTEL_PCH_WPT_DEVICE_ID_TYPE:
+		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));
+		/* WildcatPoint is LPT compatible */
+		return PCH_LPT;
+	case INTEL_PCH_WPT_LP_DEVICE_ID_TYPE:
+		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));
+		/* WildcatPoint is LPT compatible */
+		return PCH_LPT;
+	case INTEL_PCH_SPT_DEVICE_ID_TYPE:
+		DRM_DEBUG_KMS("Found SunrisePoint PCH\n");
+		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
+		return PCH_SPT;
+	case INTEL_PCH_SPT_LP_DEVICE_ID_TYPE:
+		DRM_DEBUG_KMS("Found SunrisePoint LP PCH\n");
+		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
+		return PCH_SPT;
+	case INTEL_PCH_KBP_DEVICE_ID_TYPE:
+		DRM_DEBUG_KMS("Found Kaby Lake PCH (KBP)\n");
+		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv) &&
+			!IS_COFFEELAKE(dev_priv));
+		return PCH_KBP;
+	case INTEL_PCH_CNP_DEVICE_ID_TYPE:
+		DRM_DEBUG_KMS("Found Cannon Lake PCH (CNP)\n");
+		WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
+		return PCH_CNP;
+	case INTEL_PCH_CNP_LP_DEVICE_ID_TYPE:
+		DRM_DEBUG_KMS("Found Cannon Lake LP PCH (CNP-LP)\n");
+		WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
+		return PCH_CNP;
+	case INTEL_PCH_ICP_DEVICE_ID_TYPE:
+		DRM_DEBUG_KMS("Found Ice Lake PCH\n");
+		WARN_ON(!IS_ICELAKE(dev_priv));
+		return PCH_ICP;
+	default:
+		return PCH_NONE;
+	}
+}
 
 static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
 {
@@ -183,6 +252,7 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
 	 */
 	while ((pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, pch))) {
 		unsigned short id;
+		enum intel_pch pch_type;
 
 		if (pch->vendor != PCI_VENDOR_ID_INTEL)
 			continue;
@@ -191,81 +261,9 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
 
 		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));
+		pch_type = intel_pch_type(dev_priv, id);
+		if (pch_type != PCH_NONE) {
+			dev_priv->pch_type = pch_type;
 		} else if (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
 			   id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
 			   (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
-- 
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] 15+ messages in thread

* [PATCH 2/4] drm/i915: abstract virtual PCH id detection
  2018-02-05 17:31 [PATCH 0/4] drm/i915: pch detection refactoring Jani Nikula
  2018-02-05 17:31 ` [PATCH 1/4] drm/i915: abstract PCH type detection from PCH id Jani Nikula
@ 2018-02-05 17:31 ` Jani Nikula
  2018-02-05 22:22   ` Rodrigo Vivi
  2018-02-05 17:31 ` [PATCH 3/4] drm/i915: have virtual PCH detection return a PCH id Jani Nikula
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Jani Nikula @ 2018-02-05 17:31 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Make the code slightly more pleasant to look at. No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 08e97b6e976b..52666c6cbbcc 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -192,6 +192,16 @@ intel_pch_type(const struct drm_i915_private *dev_priv, unsigned short id)
 	}
 }
 
+static bool intel_is_virt_pch(unsigned short id,
+			      unsigned short svendor, unsigned short sdevice)
+{
+	return (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
+		id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
+		(id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
+		 svendor == PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
+		 sdevice == PCI_SUBDEVICE_ID_QEMU));
+}
+
 static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
 {
 	enum intel_pch ret = PCH_NOP;
@@ -264,13 +274,8 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
 		pch_type = intel_pch_type(dev_priv, id);
 		if (pch_type != PCH_NONE) {
 			dev_priv->pch_type = pch_type;
-		} else if (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
-			   id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
-			   (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
-			    pch->subsystem_vendor ==
-			    PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
-			    pch->subsystem_device ==
-			    PCI_SUBDEVICE_ID_QEMU)) {
+		} else if (intel_is_virt_pch(id, pch->subsystem_vendor,
+					     pch->subsystem_device)) {
 			dev_priv->pch_type = intel_virt_detect_pch(dev_priv);
 		} else {
 			continue;
-- 
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] 15+ messages in thread

* [PATCH 3/4] drm/i915: have virtual PCH detection return a PCH id
  2018-02-05 17:31 [PATCH 0/4] drm/i915: pch detection refactoring Jani Nikula
  2018-02-05 17:31 ` [PATCH 1/4] drm/i915: abstract PCH type detection from PCH id Jani Nikula
  2018-02-05 17:31 ` [PATCH 2/4] drm/i915: abstract virtual PCH id detection Jani Nikula
@ 2018-02-05 17:31 ` Jani Nikula
  2018-02-05 22:27   ` Rodrigo Vivi
  2018-02-05 17:31 ` [PATCH 4/4] drm/i915: introduce INTEL_PCH_ID() and use it Jani Nikula
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Jani Nikula @ 2018-02-05 17:31 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Simplify intel_virt_detect_pch() by making it return a PCH id rather
than returning the PCH type and setting PCH id for some PCHs. Map the
PCH id to PCH type using the shared routine. This gives us sanity check
on the supported combinations also in the virtualized setting.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 66 ++++++++++++++++++++++-------------------
 1 file changed, 35 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 52666c6cbbcc..f675fc41a1c8 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -202,9 +202,10 @@ static bool intel_is_virt_pch(unsigned short id,
 		 sdevice == PCI_SUBDEVICE_ID_QEMU));
 }
 
-static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
+static unsigned short
+intel_virt_detect_pch(const struct drm_i915_private *dev_priv)
 {
-	enum intel_pch ret = PCH_NOP;
+	unsigned short id = 0;
 
 	/*
 	 * In a virtualized passthrough environment we can be in a
@@ -213,28 +214,25 @@ static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
 	 * make an educated guess as to which PCH is really there.
 	 */
 
-	if (IS_GEN5(dev_priv)) {
-		ret = PCH_IBX;
-		DRM_DEBUG_KMS("Assuming Ibex Peak PCH\n");
-	} else if (IS_GEN6(dev_priv) || IS_IVYBRIDGE(dev_priv)) {
-		ret = PCH_CPT;
-		DRM_DEBUG_KMS("Assuming CougarPoint 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;
-		DRM_DEBUG_KMS("Assuming LynxPoint PCH\n");
-	} else if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
-		ret = PCH_SPT;
-		DRM_DEBUG_KMS("Assuming SunrisePoint PCH\n");
-	} else if (IS_COFFEELAKE(dev_priv) || IS_CANNONLAKE(dev_priv)) {
-		ret = PCH_CNP;
-		DRM_DEBUG_KMS("Assuming CannonPoint PCH\n");
-	}
+	if (IS_GEN5(dev_priv))
+		id = INTEL_PCH_IBX_DEVICE_ID_TYPE;
+	else if (IS_GEN6(dev_priv) || IS_IVYBRIDGE(dev_priv))
+		id = INTEL_PCH_CPT_DEVICE_ID_TYPE;
+	else if (IS_HSW_ULT(dev_priv) || IS_BDW_ULT(dev_priv))
+		id = INTEL_PCH_LPT_LP_DEVICE_ID_TYPE;
+	else if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
+		id = INTEL_PCH_LPT_DEVICE_ID_TYPE;
+	else if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
+		id = INTEL_PCH_SPT_DEVICE_ID_TYPE;
+	else if (IS_COFFEELAKE(dev_priv) || IS_CANNONLAKE(dev_priv))
+		id = INTEL_PCH_CNP_DEVICE_ID_TYPE;
+
+	if (id)
+		DRM_DEBUG_KMS("Assuming PCH ID %04x\n", id);
+	else
+		DRM_DEBUG_KMS("Assuming no PCH\n");
 
-	return ret;
+	return id;
 }
 
 static void intel_detect_pch(struct drm_i915_private *dev_priv)
@@ -269,19 +267,25 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
 
 		id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
 
-		dev_priv->pch_id = id;
-
 		pch_type = intel_pch_type(dev_priv, id);
 		if (pch_type != PCH_NONE) {
 			dev_priv->pch_type = pch_type;
+			dev_priv->pch_id = id;
+			break;
 		} else if (intel_is_virt_pch(id, pch->subsystem_vendor,
-					     pch->subsystem_device)) {
-			dev_priv->pch_type = intel_virt_detect_pch(dev_priv);
-		} else {
-			continue;
+					 pch->subsystem_device)) {
+			id = intel_virt_detect_pch(dev_priv);
+			if (id) {
+				pch_type = intel_pch_type(dev_priv, id);
+				if (WARN_ON(pch_type == PCH_NONE))
+					pch_type = PCH_NOP;
+			} else {
+				pch_type = PCH_NOP;
+			}
+			dev_priv->pch_type = pch_type;
+			dev_priv->pch_id = id;
+			break;
 		}
-
-		break;
 	}
 	if (!pch)
 		DRM_DEBUG_KMS("No PCH found.\n");
-- 
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] 15+ messages in thread

* [PATCH 4/4] drm/i915: introduce INTEL_PCH_ID() and use it
  2018-02-05 17:31 [PATCH 0/4] drm/i915: pch detection refactoring Jani Nikula
                   ` (2 preceding siblings ...)
  2018-02-05 17:31 ` [PATCH 3/4] drm/i915: have virtual PCH detection return a PCH id Jani Nikula
@ 2018-02-05 17:31 ` Jani Nikula
  2018-02-05 22:28   ` Rodrigo Vivi
  2018-02-05 18:20 ` ✓ Fi.CI.BAT: success for drm/i915: pch detection refactoring Patchwork
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Jani Nikula @ 2018-02-05 17:31 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Cleanup similar to INTEL_PCH_TYPE(). 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 d6b5ac2a563d..70b1e6be78bb 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2862,19 +2862,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] 15+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: pch detection refactoring
  2018-02-05 17:31 [PATCH 0/4] drm/i915: pch detection refactoring Jani Nikula
                   ` (3 preceding siblings ...)
  2018-02-05 17:31 ` [PATCH 4/4] drm/i915: introduce INTEL_PCH_ID() and use it Jani Nikula
@ 2018-02-05 18:20 ` Patchwork
  2018-02-05 20:39 ` ✗ Fi.CI.IGT: warning " Patchwork
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2018-02-05 18:20 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: pch detection refactoring
URL   : https://patchwork.freedesktop.org/series/37673/
State : success

== Summary ==

Series 37673v1 drm/i915: pch detection refactoring
https://patchwork.freedesktop.org/api/1.0/series/37673/revisions/1/mbox/

Test kms_frontbuffer_tracking:
        Subgroup basic:
                fail       -> PASS       (fi-cnl-y3)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

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

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:418s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:420s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:378s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:480s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:284s
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:489s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:465s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:452s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:561s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:572s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:418s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:281s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:510s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:387s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:399s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:408s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:448s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:411s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:455s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:498s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:455s
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:581s
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:504s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:531s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:490s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:473s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:416s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:427s
fi-snb-2520m     total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:393s
Blacklisted hosts:
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:466s

3a4afd6dae3d932908ea929f18b935e709430846 drm-tip: 2018y-02m-05d-17h-02m-56s UTC integration manifest
88ad74690525 drm/i915: introduce INTEL_PCH_ID() and use it
e69f0930be8f drm/i915: have virtual PCH detection return a PCH id
4e3afb81b77b drm/i915: abstract virtual PCH id detection
5c676b97d401 drm/i915: abstract PCH type detection from PCH id

== Logs ==

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

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

* ✗ Fi.CI.IGT: warning for drm/i915: pch detection refactoring
  2018-02-05 17:31 [PATCH 0/4] drm/i915: pch detection refactoring Jani Nikula
                   ` (4 preceding siblings ...)
  2018-02-05 18:20 ` ✓ Fi.CI.BAT: success for drm/i915: pch detection refactoring Patchwork
@ 2018-02-05 20:39 ` Patchwork
  2018-02-06 11:06 ` ✗ Fi.CI.BAT: " Patchwork
  2018-02-07 12:43 ` ✓ Fi.CI.BAT: success " Patchwork
  7 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2018-02-05 20:39 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: pch detection refactoring
URL   : https://patchwork.freedesktop.org/series/37673/
State : warning

== Summary ==

Test drv_suspend:
        Subgroup fence-restore-untiled:
                skip       -> PASS       (shard-snb) fdo#102365
Test perf:
        Subgroup blocking:
                fail       -> PASS       (shard-hsw) fdo#102252
Test gem_eio:
        Subgroup in-flight-suspend:
                skip       -> PASS       (shard-snb) fdo#103375
        Subgroup in-flight-contexts:
                dmesg-fail -> PASS       (shard-snb) fdo#104058
Test kms_flip:
        Subgroup 2x-flip-vs-expired-vblank-interruptible:
                pass       -> FAIL       (shard-hsw) fdo#102887
Test kms_plane_multiple:
        Subgroup atomic-pipe-a-tiling-none:
                pass       -> SKIP       (shard-snb)
        Subgroup atomic-pipe-c-tiling-none:
                fail       -> PASS       (shard-apl) fdo#103166
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-pri-indfb-draw-mmap-gtt:
                fail       -> PASS       (shard-apl) fdo#101623

fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#104058 https://bugs.freedesktop.org/show_bug.cgi?id=104058
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623

shard-apl        total:3406 pass:1751 dwarn:1   dfail:0   fail:21  skip:1633 time:12420s
shard-hsw        total:3406 pass:1733 dwarn:1   dfail:0   fail:12  skip:1659 time:11647s
shard-snb        total:3406 pass:1327 dwarn:1   dfail:0   fail:11  skip:2067 time:6463s
Blacklisted hosts:
shard-kbl        total:3354 pass:1830 dwarn:11  dfail:0   fail:21  skip:1491 time:8796s

== Logs ==

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

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

* Re: [PATCH 1/4] drm/i915: abstract PCH type detection from PCH id
  2018-02-05 17:31 ` [PATCH 1/4] drm/i915: abstract PCH type detection from PCH id Jani Nikula
@ 2018-02-05 22:21   ` Rodrigo Vivi
  2018-02-13 15:35     ` Jani Nikula
  0 siblings, 1 reply; 15+ messages in thread
From: Rodrigo Vivi @ 2018-02-05 22:21 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Mon, Feb 05, 2018 at 05:31:36PM +0000, Jani Nikula wrote:
> Make the logic in intel_detect_pch() easier to follow, and make the PCH
> id to type mapping reusable. No functional changes.

I wondered here if we should change intel_pch from enum to array
{ pch_id, pch_type, supported_platforms, "name" }

but besides requiring a loop at this point supported_platforms would be tricky one.

so, never mind...

> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 148 ++++++++++++++++++++--------------------
>  1 file changed, 73 insertions(+), 75 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index e9f1daf258fe..08e97b6e976b 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -122,6 +122,75 @@ static bool i915_error_injected(struct drm_i915_private *dev_priv)
>  		      i915_error_injected(dev_priv) ? KERN_DEBUG : KERN_ERR, \
>  		      fmt, ##__VA_ARGS__)
>  
> +/* Map PCH device id to PCH type, or PCH_NONE if unknown. */
> +static enum intel_pch
> +intel_pch_type(const struct drm_i915_private *dev_priv, unsigned short id)
> +{
> +	switch (id) {
> +	case INTEL_PCH_IBX_DEVICE_ID_TYPE:
> +		DRM_DEBUG_KMS("Found Ibex Peak PCH\n");
> +		WARN_ON(!IS_GEN5(dev_priv));
> +		return PCH_IBX;
> +	case INTEL_PCH_CPT_DEVICE_ID_TYPE:
> +		DRM_DEBUG_KMS("Found CougarPoint PCH\n");
> +		WARN_ON(!IS_GEN6(dev_priv) && !IS_IVYBRIDGE(dev_priv));
> +		return PCH_CPT;
> +	case INTEL_PCH_PPT_DEVICE_ID_TYPE:
> +		DRM_DEBUG_KMS("Found PantherPoint PCH\n");
> +		WARN_ON(!IS_GEN6(dev_priv) && !IS_IVYBRIDGE(dev_priv));
> +		/* PantherPoint is CPT compatible */
> +		return PCH_CPT;
> +	case INTEL_PCH_LPT_DEVICE_ID_TYPE:
> +		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));
> +		return PCH_LPT;
> +	case INTEL_PCH_LPT_LP_DEVICE_ID_TYPE:
> +		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));
> +		return PCH_LPT;
> +	case INTEL_PCH_WPT_DEVICE_ID_TYPE:
> +		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));
> +		/* WildcatPoint is LPT compatible */
> +		return PCH_LPT;
> +	case INTEL_PCH_WPT_LP_DEVICE_ID_TYPE:
> +		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));
> +		/* WildcatPoint is LPT compatible */
> +		return PCH_LPT;
> +	case INTEL_PCH_SPT_DEVICE_ID_TYPE:
> +		DRM_DEBUG_KMS("Found SunrisePoint PCH\n");
> +		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
> +		return PCH_SPT;
> +	case INTEL_PCH_SPT_LP_DEVICE_ID_TYPE:
> +		DRM_DEBUG_KMS("Found SunrisePoint LP PCH\n");
> +		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
> +		return PCH_SPT;
> +	case INTEL_PCH_KBP_DEVICE_ID_TYPE:
> +		DRM_DEBUG_KMS("Found Kaby Lake PCH (KBP)\n");
> +		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv) &&
> +			!IS_COFFEELAKE(dev_priv));
> +		return PCH_KBP;
> +	case INTEL_PCH_CNP_DEVICE_ID_TYPE:
> +		DRM_DEBUG_KMS("Found Cannon Lake PCH (CNP)\n");
> +		WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
> +		return PCH_CNP;
> +	case INTEL_PCH_CNP_LP_DEVICE_ID_TYPE:
> +		DRM_DEBUG_KMS("Found Cannon Lake LP PCH (CNP-LP)\n");
> +		WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
> +		return PCH_CNP;
> +	case INTEL_PCH_ICP_DEVICE_ID_TYPE:
> +		DRM_DEBUG_KMS("Found Ice Lake PCH\n");
> +		WARN_ON(!IS_ICELAKE(dev_priv));
> +		return PCH_ICP;
> +	default:
> +		return PCH_NONE;
> +	}
> +}
>  
>  static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
>  {
> @@ -183,6 +252,7 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
>  	 */
>  	while ((pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, pch))) {
>  		unsigned short id;
> +		enum intel_pch pch_type;
>  
>  		if (pch->vendor != PCI_VENDOR_ID_INTEL)
>  			continue;
> @@ -191,81 +261,9 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
>  
>  		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));
> +		pch_type = intel_pch_type(dev_priv, id);
> +		if (pch_type != PCH_NONE) {
> +			dev_priv->pch_type = pch_type;
>  		} else if (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
>  			   id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
>  			   (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 2/4] drm/i915: abstract virtual PCH id detection
  2018-02-05 17:31 ` [PATCH 2/4] drm/i915: abstract virtual PCH id detection Jani Nikula
@ 2018-02-05 22:22   ` Rodrigo Vivi
  0 siblings, 0 replies; 15+ messages in thread
From: Rodrigo Vivi @ 2018-02-05 22:22 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Mon, Feb 05, 2018 at 05:31:37PM +0000, Jani Nikula wrote:
> Make the code slightly more pleasant to look at.

indeed

> No functional changes.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>


Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 19 ++++++++++++-------
>  1 file changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 08e97b6e976b..52666c6cbbcc 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -192,6 +192,16 @@ intel_pch_type(const struct drm_i915_private *dev_priv, unsigned short id)
>  	}
>  }
>  
> +static bool intel_is_virt_pch(unsigned short id,
> +			      unsigned short svendor, unsigned short sdevice)
> +{
> +	return (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
> +		id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
> +		(id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
> +		 svendor == PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
> +		 sdevice == PCI_SUBDEVICE_ID_QEMU));
> +}
> +
>  static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
>  {
>  	enum intel_pch ret = PCH_NOP;
> @@ -264,13 +274,8 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
>  		pch_type = intel_pch_type(dev_priv, id);
>  		if (pch_type != PCH_NONE) {
>  			dev_priv->pch_type = pch_type;
> -		} else if (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
> -			   id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
> -			   (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
> -			    pch->subsystem_vendor ==
> -			    PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
> -			    pch->subsystem_device ==
> -			    PCI_SUBDEVICE_ID_QEMU)) {
> +		} else if (intel_is_virt_pch(id, pch->subsystem_vendor,
> +					     pch->subsystem_device)) {
>  			dev_priv->pch_type = intel_virt_detect_pch(dev_priv);
>  		} else {
>  			continue;
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 3/4] drm/i915: have virtual PCH detection return a PCH id
  2018-02-05 17:31 ` [PATCH 3/4] drm/i915: have virtual PCH detection return a PCH id Jani Nikula
@ 2018-02-05 22:27   ` Rodrigo Vivi
  0 siblings, 0 replies; 15+ messages in thread
From: Rodrigo Vivi @ 2018-02-05 22:27 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Mon, Feb 05, 2018 at 05:31:38PM +0000, Jani Nikula wrote:
> Simplify intel_virt_detect_pch() by making it return a PCH id rather
> than returning the PCH type and setting PCH id for some PCHs. Map the
> PCH id to PCH type using the shared routine. This gives us sanity check
> on the supported combinations also in the virtualized setting.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 66 ++++++++++++++++++++++-------------------
>  1 file changed, 35 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 52666c6cbbcc..f675fc41a1c8 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -202,9 +202,10 @@ static bool intel_is_virt_pch(unsigned short id,
>  		 sdevice == PCI_SUBDEVICE_ID_QEMU));
>  }
>  
> -static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
> +static unsigned short
> +intel_virt_detect_pch(const struct drm_i915_private *dev_priv)
>  {
> -	enum intel_pch ret = PCH_NOP;
> +	unsigned short id = 0;
>  
>  	/*
>  	 * In a virtualized passthrough environment we can be in a
> @@ -213,28 +214,25 @@ static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
>  	 * make an educated guess as to which PCH is really there.
>  	 */
>  
> -	if (IS_GEN5(dev_priv)) {
> -		ret = PCH_IBX;
> -		DRM_DEBUG_KMS("Assuming Ibex Peak PCH\n");
> -	} else if (IS_GEN6(dev_priv) || IS_IVYBRIDGE(dev_priv)) {
> -		ret = PCH_CPT;
> -		DRM_DEBUG_KMS("Assuming CougarPoint 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;
> -		DRM_DEBUG_KMS("Assuming LynxPoint PCH\n");
> -	} else if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
> -		ret = PCH_SPT;
> -		DRM_DEBUG_KMS("Assuming SunrisePoint PCH\n");
> -	} else if (IS_COFFEELAKE(dev_priv) || IS_CANNONLAKE(dev_priv)) {
> -		ret = PCH_CNP;
> -		DRM_DEBUG_KMS("Assuming CannonPoint PCH\n");
> -	}
> +	if (IS_GEN5(dev_priv))
> +		id = INTEL_PCH_IBX_DEVICE_ID_TYPE;
> +	else if (IS_GEN6(dev_priv) || IS_IVYBRIDGE(dev_priv))
> +		id = INTEL_PCH_CPT_DEVICE_ID_TYPE;
> +	else if (IS_HSW_ULT(dev_priv) || IS_BDW_ULT(dev_priv))
> +		id = INTEL_PCH_LPT_LP_DEVICE_ID_TYPE;
> +	else if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
> +		id = INTEL_PCH_LPT_DEVICE_ID_TYPE;
> +	else if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
> +		id = INTEL_PCH_SPT_DEVICE_ID_TYPE;
> +	else if (IS_COFFEELAKE(dev_priv) || IS_CANNONLAKE(dev_priv))
> +		id = INTEL_PCH_CNP_DEVICE_ID_TYPE;
> +
> +	if (id)
> +		DRM_DEBUG_KMS("Assuming PCH ID %04x\n", id);
> +	else
> +		DRM_DEBUG_KMS("Assuming no PCH\n");
>  
> -	return ret;
> +	return id;
>  }
>  
>  static void intel_detect_pch(struct drm_i915_private *dev_priv)
> @@ -269,19 +267,25 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
>  
>  		id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
>  
> -		dev_priv->pch_id = id;
> -
>  		pch_type = intel_pch_type(dev_priv, id);
>  		if (pch_type != PCH_NONE) {
>  			dev_priv->pch_type = pch_type;
> +			dev_priv->pch_id = id;
> +			break;
>  		} else if (intel_is_virt_pch(id, pch->subsystem_vendor,
> -					     pch->subsystem_device)) {
> -			dev_priv->pch_type = intel_virt_detect_pch(dev_priv);
> -		} else {
> -			continue;
> +					 pch->subsystem_device)) {
> +			id = intel_virt_detect_pch(dev_priv);
> +			if (id) {
> +				pch_type = intel_pch_type(dev_priv, id);
> +				if (WARN_ON(pch_type == PCH_NONE))
> +					pch_type = PCH_NOP;
> +			} else {
> +				pch_type = PCH_NOP;
> +			}
> +			dev_priv->pch_type = pch_type;
> +			dev_priv->pch_id = id;
> +			break;
>  		}
> -
> -		break;
>  	}
>  	if (!pch)
>  		DRM_DEBUG_KMS("No PCH found.\n");
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 4/4] drm/i915: introduce INTEL_PCH_ID() and use it
  2018-02-05 17:31 ` [PATCH 4/4] drm/i915: introduce INTEL_PCH_ID() and use it Jani Nikula
@ 2018-02-05 22:28   ` Rodrigo Vivi
  0 siblings, 0 replies; 15+ messages in thread
From: Rodrigo Vivi @ 2018-02-05 22:28 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Mon, Feb 05, 2018 at 05:31:39PM +0000, Jani Nikula wrote:
> Cleanup similar to INTEL_PCH_TYPE(). No functional changes.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@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 d6b5ac2a563d..70b1e6be78bb 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2862,19 +2862,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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: warning for drm/i915: pch detection refactoring
  2018-02-05 17:31 [PATCH 0/4] drm/i915: pch detection refactoring Jani Nikula
                   ` (5 preceding siblings ...)
  2018-02-05 20:39 ` ✗ Fi.CI.IGT: warning " Patchwork
@ 2018-02-06 11:06 ` Patchwork
  2018-02-07 12:43 ` ✓ Fi.CI.BAT: success " Patchwork
  7 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2018-02-06 11:06 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: pch detection refactoring
URL   : https://patchwork.freedesktop.org/series/37673/
State : warning

== Summary ==

Series 37673v1 drm/i915: pch detection refactoring
https://patchwork.freedesktop.org/api/1.0/series/37673/revisions/1/mbox/

Test debugfs_test:
        Subgroup read_all_entries:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713
Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                fail       -> PASS       (fi-gdg-551) fdo#102575
Test gem_sync:
        Subgroup basic-all:
                pass       -> SKIP       (fi-blb-e6850)
        Subgroup basic-each:
                pass       -> SKIP       (fi-blb-e6850)
        Subgroup basic-many-each:
                pass       -> SKIP       (fi-blb-e6850)
        Subgroup basic-store-all:
                pass       -> SKIP       (fi-blb-e6850)
        Subgroup basic-store-each:
                pass       -> SKIP       (fi-blb-e6850)
Test gem_tiled_blits:
        Subgroup basic:
                pass       -> SKIP       (fi-blb-e6850)
Test gem_tiled_fence_blits:
        Subgroup basic:
                pass       -> SKIP       (fi-blb-e6850)
Test gem_wait:
        Subgroup basic-busy-all:
                pass       -> SKIP       (fi-blb-e6850)
        Subgroup basic-wait-all:
                pass       -> SKIP       (fi-blb-e6850)
        Subgroup basic-await-all:
                pass       -> SKIP       (fi-blb-e6850)
Test kms_busy:
        Subgroup basic-flip-a:
                pass       -> SKIP       (fi-blb-e6850)
        Subgroup basic-flip-b:
                pass       -> SKIP       (fi-blb-e6850)
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                pass       -> SKIP       (fi-blb-e6850)

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

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:420s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:423s
fi-blb-e6850     total:288  pass:210  dwarn:1   dfail:0   fail:0   skip:77  time:345s
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:284s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:484s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:472s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:452s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:568s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:581s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:415s
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:509s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:389s
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:417s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:456s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:455s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:498s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:497s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:594s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:429s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:508s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:527s
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:503s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:417s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:429s
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:392s
Blacklisted hosts:
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:467s

5883e1383ed69b4bd7a537ceafeeabbc61cdf55e drm-tip: 2018y-02m-06d-09h-04m-49s UTC integration manifest
0cb9daaf071c drm/i915: introduce INTEL_PCH_ID() and use it
e12dfb9f47f7 drm/i915: have virtual PCH detection return a PCH id
9f397647e6d6 drm/i915: abstract virtual PCH id detection
6a567bbd2b9d drm/i915: abstract PCH type detection from PCH id

== Logs ==

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

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

* ✓ Fi.CI.BAT: success for drm/i915: pch detection refactoring
  2018-02-05 17:31 [PATCH 0/4] drm/i915: pch detection refactoring Jani Nikula
                   ` (6 preceding siblings ...)
  2018-02-06 11:06 ` ✗ Fi.CI.BAT: " Patchwork
@ 2018-02-07 12:43 ` Patchwork
  7 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2018-02-07 12:43 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: pch detection refactoring
URL   : https://patchwork.freedesktop.org/series/37673/
State : success

== Summary ==

Series 37673v1 drm/i915: pch detection refactoring
https://patchwork.freedesktop.org/api/1.0/series/37673/revisions/1/mbox/

Test gem_sync:
        Subgroup basic-all:
                skip       -> PASS       (fi-blb-e6850)
        Subgroup basic-each:
                skip       -> PASS       (fi-blb-e6850)
        Subgroup basic-many-each:
                skip       -> PASS       (fi-blb-e6850)
        Subgroup basic-store-all:
                skip       -> PASS       (fi-blb-e6850)
        Subgroup basic-store-each:
                skip       -> PASS       (fi-blb-e6850)
Test gem_tiled_blits:
        Subgroup basic:
                skip       -> PASS       (fi-blb-e6850)
Test gem_tiled_fence_blits:
        Subgroup basic:
                skip       -> PASS       (fi-blb-e6850)
Test gem_wait:
        Subgroup basic-busy-all:
                skip       -> PASS       (fi-blb-e6850)
        Subgroup basic-wait-all:
                skip       -> PASS       (fi-blb-e6850)
        Subgroup basic-await-all:
                skip       -> PASS       (fi-blb-e6850)
Test kms_busy:
        Subgroup basic-flip-a:
                skip       -> PASS       (fi-blb-e6850)
        Subgroup basic-flip-b:
                skip       -> PASS       (fi-blb-e6850)
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                skip       -> PASS       (fi-blb-e6850)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713
        Subgroup suspend-read-crc-pipe-c:
                dmesg-fail -> PASS       (fi-cnl-y3) fdo#104951

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:418s
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:373s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:489s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:286s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:482s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:467s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:459s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:567s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:575s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:414s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:285s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:509s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:391s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:411s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:456s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:453s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:497s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:501s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:600s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:429s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:504s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:522s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:487s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:477s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:415s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:429s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:521s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:396s
Blacklisted hosts:
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:470s

ec960e17a65bea9271b38df690b6f7a471ad7d5e drm-tip: 2018y-02m-07d-11h-43m-42s UTC integration manifest
b1273e471f20 drm/i915: introduce INTEL_PCH_ID() and use it
d3360e45b615 drm/i915: have virtual PCH detection return a PCH id
641539865552 drm/i915: abstract virtual PCH id detection
5e7c0dbf75c1 drm/i915: abstract PCH type detection from PCH id

== Logs ==

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

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

* Re: [PATCH 1/4] drm/i915: abstract PCH type detection from PCH id
  2018-02-05 22:21   ` Rodrigo Vivi
@ 2018-02-13 15:35     ` Jani Nikula
  2018-02-13 15:55       ` Ville Syrjälä
  0 siblings, 1 reply; 15+ messages in thread
From: Jani Nikula @ 2018-02-13 15:35 UTC (permalink / raw)
  To: Rodrigo Vivi; +Cc: intel-gfx

On Mon, 05 Feb 2018, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> On Mon, Feb 05, 2018 at 05:31:36PM +0000, Jani Nikula wrote:
>> Make the logic in intel_detect_pch() easier to follow, and make the PCH
>> id to type mapping reusable. No functional changes.
>
> I wondered here if we should change intel_pch from enum to array
> { pch_id, pch_type, supported_platforms, "name" }
>
> but besides requiring a loop at this point supported_platforms would
> be tricky one.

I think both Ville and I tried to figure out a handy way to express the
supported platforms statically, but didn't come up with anything.

Pushed the series, thanks for the review.

BR,
Jani.

>
> so, never mind...
>
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
>> ---
>>  drivers/gpu/drm/i915/i915_drv.c | 148 ++++++++++++++++++++--------------------
>>  1 file changed, 73 insertions(+), 75 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
>> index e9f1daf258fe..08e97b6e976b 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.c
>> +++ b/drivers/gpu/drm/i915/i915_drv.c
>> @@ -122,6 +122,75 @@ static bool i915_error_injected(struct drm_i915_private *dev_priv)
>>  		      i915_error_injected(dev_priv) ? KERN_DEBUG : KERN_ERR, \
>>  		      fmt, ##__VA_ARGS__)
>>  
>> +/* Map PCH device id to PCH type, or PCH_NONE if unknown. */
>> +static enum intel_pch
>> +intel_pch_type(const struct drm_i915_private *dev_priv, unsigned short id)
>> +{
>> +	switch (id) {
>> +	case INTEL_PCH_IBX_DEVICE_ID_TYPE:
>> +		DRM_DEBUG_KMS("Found Ibex Peak PCH\n");
>> +		WARN_ON(!IS_GEN5(dev_priv));
>> +		return PCH_IBX;
>> +	case INTEL_PCH_CPT_DEVICE_ID_TYPE:
>> +		DRM_DEBUG_KMS("Found CougarPoint PCH\n");
>> +		WARN_ON(!IS_GEN6(dev_priv) && !IS_IVYBRIDGE(dev_priv));
>> +		return PCH_CPT;
>> +	case INTEL_PCH_PPT_DEVICE_ID_TYPE:
>> +		DRM_DEBUG_KMS("Found PantherPoint PCH\n");
>> +		WARN_ON(!IS_GEN6(dev_priv) && !IS_IVYBRIDGE(dev_priv));
>> +		/* PantherPoint is CPT compatible */
>> +		return PCH_CPT;
>> +	case INTEL_PCH_LPT_DEVICE_ID_TYPE:
>> +		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));
>> +		return PCH_LPT;
>> +	case INTEL_PCH_LPT_LP_DEVICE_ID_TYPE:
>> +		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));
>> +		return PCH_LPT;
>> +	case INTEL_PCH_WPT_DEVICE_ID_TYPE:
>> +		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));
>> +		/* WildcatPoint is LPT compatible */
>> +		return PCH_LPT;
>> +	case INTEL_PCH_WPT_LP_DEVICE_ID_TYPE:
>> +		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));
>> +		/* WildcatPoint is LPT compatible */
>> +		return PCH_LPT;
>> +	case INTEL_PCH_SPT_DEVICE_ID_TYPE:
>> +		DRM_DEBUG_KMS("Found SunrisePoint PCH\n");
>> +		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
>> +		return PCH_SPT;
>> +	case INTEL_PCH_SPT_LP_DEVICE_ID_TYPE:
>> +		DRM_DEBUG_KMS("Found SunrisePoint LP PCH\n");
>> +		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
>> +		return PCH_SPT;
>> +	case INTEL_PCH_KBP_DEVICE_ID_TYPE:
>> +		DRM_DEBUG_KMS("Found Kaby Lake PCH (KBP)\n");
>> +		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv) &&
>> +			!IS_COFFEELAKE(dev_priv));
>> +		return PCH_KBP;
>> +	case INTEL_PCH_CNP_DEVICE_ID_TYPE:
>> +		DRM_DEBUG_KMS("Found Cannon Lake PCH (CNP)\n");
>> +		WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
>> +		return PCH_CNP;
>> +	case INTEL_PCH_CNP_LP_DEVICE_ID_TYPE:
>> +		DRM_DEBUG_KMS("Found Cannon Lake LP PCH (CNP-LP)\n");
>> +		WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
>> +		return PCH_CNP;
>> +	case INTEL_PCH_ICP_DEVICE_ID_TYPE:
>> +		DRM_DEBUG_KMS("Found Ice Lake PCH\n");
>> +		WARN_ON(!IS_ICELAKE(dev_priv));
>> +		return PCH_ICP;
>> +	default:
>> +		return PCH_NONE;
>> +	}
>> +}
>>  
>>  static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
>>  {
>> @@ -183,6 +252,7 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
>>  	 */
>>  	while ((pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, pch))) {
>>  		unsigned short id;
>> +		enum intel_pch pch_type;
>>  
>>  		if (pch->vendor != PCI_VENDOR_ID_INTEL)
>>  			continue;
>> @@ -191,81 +261,9 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
>>  
>>  		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));
>> +		pch_type = intel_pch_type(dev_priv, id);
>> +		if (pch_type != PCH_NONE) {
>> +			dev_priv->pch_type = pch_type;
>>  		} else if (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
>>  			   id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
>>  			   (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
>> -- 
>> 2.11.0
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
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] 15+ messages in thread

* Re: [PATCH 1/4] drm/i915: abstract PCH type detection from PCH id
  2018-02-13 15:35     ` Jani Nikula
@ 2018-02-13 15:55       ` Ville Syrjälä
  0 siblings, 0 replies; 15+ messages in thread
From: Ville Syrjälä @ 2018-02-13 15:55 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, Rodrigo Vivi

On Tue, Feb 13, 2018 at 05:35:58PM +0200, Jani Nikula wrote:
> On Mon, 05 Feb 2018, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> > On Mon, Feb 05, 2018 at 05:31:36PM +0000, Jani Nikula wrote:
> >> Make the logic in intel_detect_pch() easier to follow, and make the PCH
> >> id to type mapping reusable. No functional changes.
> >
> > I wondered here if we should change intel_pch from enum to array
> > { pch_id, pch_type, supported_platforms, "name" }
> >
> > but besides requiring a loop at this point supported_platforms would
> > be tricky one.
> 
> I think both Ville and I tried to figure out a handy way to express the
> supported platforms statically, but didn't come up with anything.

I think a function pointer was the best I could come up with back then.

The ult stuff is what kills it I think because that isn't part of the
platform enum. I guess we could consider including that information
there too, or we could have something else in the device info to
identify ult/ulx devices. Maybe.

> 
> Pushed the series, thanks for the review.
> 
> BR,
> Jani.
> 
> >
> > so, never mind...
> >
> >> 
> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >
> > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> >
> >> ---
> >>  drivers/gpu/drm/i915/i915_drv.c | 148 ++++++++++++++++++++--------------------
> >>  1 file changed, 73 insertions(+), 75 deletions(-)
> >> 
> >> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> >> index e9f1daf258fe..08e97b6e976b 100644
> >> --- a/drivers/gpu/drm/i915/i915_drv.c
> >> +++ b/drivers/gpu/drm/i915/i915_drv.c
> >> @@ -122,6 +122,75 @@ static bool i915_error_injected(struct drm_i915_private *dev_priv)
> >>  		      i915_error_injected(dev_priv) ? KERN_DEBUG : KERN_ERR, \
> >>  		      fmt, ##__VA_ARGS__)
> >>  
> >> +/* Map PCH device id to PCH type, or PCH_NONE if unknown. */
> >> +static enum intel_pch
> >> +intel_pch_type(const struct drm_i915_private *dev_priv, unsigned short id)
> >> +{
> >> +	switch (id) {
> >> +	case INTEL_PCH_IBX_DEVICE_ID_TYPE:
> >> +		DRM_DEBUG_KMS("Found Ibex Peak PCH\n");
> >> +		WARN_ON(!IS_GEN5(dev_priv));
> >> +		return PCH_IBX;
> >> +	case INTEL_PCH_CPT_DEVICE_ID_TYPE:
> >> +		DRM_DEBUG_KMS("Found CougarPoint PCH\n");
> >> +		WARN_ON(!IS_GEN6(dev_priv) && !IS_IVYBRIDGE(dev_priv));
> >> +		return PCH_CPT;
> >> +	case INTEL_PCH_PPT_DEVICE_ID_TYPE:
> >> +		DRM_DEBUG_KMS("Found PantherPoint PCH\n");
> >> +		WARN_ON(!IS_GEN6(dev_priv) && !IS_IVYBRIDGE(dev_priv));
> >> +		/* PantherPoint is CPT compatible */
> >> +		return PCH_CPT;
> >> +	case INTEL_PCH_LPT_DEVICE_ID_TYPE:
> >> +		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));
> >> +		return PCH_LPT;
> >> +	case INTEL_PCH_LPT_LP_DEVICE_ID_TYPE:
> >> +		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));
> >> +		return PCH_LPT;
> >> +	case INTEL_PCH_WPT_DEVICE_ID_TYPE:
> >> +		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));
> >> +		/* WildcatPoint is LPT compatible */
> >> +		return PCH_LPT;
> >> +	case INTEL_PCH_WPT_LP_DEVICE_ID_TYPE:
> >> +		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));
> >> +		/* WildcatPoint is LPT compatible */
> >> +		return PCH_LPT;
> >> +	case INTEL_PCH_SPT_DEVICE_ID_TYPE:
> >> +		DRM_DEBUG_KMS("Found SunrisePoint PCH\n");
> >> +		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
> >> +		return PCH_SPT;
> >> +	case INTEL_PCH_SPT_LP_DEVICE_ID_TYPE:
> >> +		DRM_DEBUG_KMS("Found SunrisePoint LP PCH\n");
> >> +		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
> >> +		return PCH_SPT;
> >> +	case INTEL_PCH_KBP_DEVICE_ID_TYPE:
> >> +		DRM_DEBUG_KMS("Found Kaby Lake PCH (KBP)\n");
> >> +		WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv) &&
> >> +			!IS_COFFEELAKE(dev_priv));
> >> +		return PCH_KBP;
> >> +	case INTEL_PCH_CNP_DEVICE_ID_TYPE:
> >> +		DRM_DEBUG_KMS("Found Cannon Lake PCH (CNP)\n");
> >> +		WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
> >> +		return PCH_CNP;
> >> +	case INTEL_PCH_CNP_LP_DEVICE_ID_TYPE:
> >> +		DRM_DEBUG_KMS("Found Cannon Lake LP PCH (CNP-LP)\n");
> >> +		WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
> >> +		return PCH_CNP;
> >> +	case INTEL_PCH_ICP_DEVICE_ID_TYPE:
> >> +		DRM_DEBUG_KMS("Found Ice Lake PCH\n");
> >> +		WARN_ON(!IS_ICELAKE(dev_priv));
> >> +		return PCH_ICP;
> >> +	default:
> >> +		return PCH_NONE;
> >> +	}
> >> +}
> >>  
> >>  static enum intel_pch intel_virt_detect_pch(struct drm_i915_private *dev_priv)
> >>  {
> >> @@ -183,6 +252,7 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
> >>  	 */
> >>  	while ((pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, pch))) {
> >>  		unsigned short id;
> >> +		enum intel_pch pch_type;
> >>  
> >>  		if (pch->vendor != PCI_VENDOR_ID_INTEL)
> >>  			continue;
> >> @@ -191,81 +261,9 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
> >>  
> >>  		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));
> >> +		pch_type = intel_pch_type(dev_priv, id);
> >> +		if (pch_type != PCH_NONE) {
> >> +			dev_priv->pch_type = pch_type;
> >>  		} else if (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
> >>  			   id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
> >>  			   (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
> >> -- 
> >> 2.11.0
> >> 
> >> _______________________________________________
> >> Intel-gfx mailing list
> >> Intel-gfx@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2018-02-13 15:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-05 17:31 [PATCH 0/4] drm/i915: pch detection refactoring Jani Nikula
2018-02-05 17:31 ` [PATCH 1/4] drm/i915: abstract PCH type detection from PCH id Jani Nikula
2018-02-05 22:21   ` Rodrigo Vivi
2018-02-13 15:35     ` Jani Nikula
2018-02-13 15:55       ` Ville Syrjälä
2018-02-05 17:31 ` [PATCH 2/4] drm/i915: abstract virtual PCH id detection Jani Nikula
2018-02-05 22:22   ` Rodrigo Vivi
2018-02-05 17:31 ` [PATCH 3/4] drm/i915: have virtual PCH detection return a PCH id Jani Nikula
2018-02-05 22:27   ` Rodrigo Vivi
2018-02-05 17:31 ` [PATCH 4/4] drm/i915: introduce INTEL_PCH_ID() and use it Jani Nikula
2018-02-05 22:28   ` Rodrigo Vivi
2018-02-05 18:20 ` ✓ Fi.CI.BAT: success for drm/i915: pch detection refactoring Patchwork
2018-02-05 20:39 ` ✗ Fi.CI.IGT: warning " Patchwork
2018-02-06 11:06 ` ✗ Fi.CI.BAT: " Patchwork
2018-02-07 12:43 ` ✓ Fi.CI.BAT: success " 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.