All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915: Move hotplug inversion logic into separate helper
@ 2022-09-19 14:56 Gustavo Sousa
  2022-09-19 22:58 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Gustavo Sousa @ 2022-09-19 14:56 UTC (permalink / raw)
  To: intel-gfx

Make the code more readable, which will be more apparent as new
platforms with different hotplug inversion needs are added.

Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index de06f293e173..c53d21ae197f 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -3263,6 +3263,21 @@ static void cherryview_irq_reset(struct drm_i915_private *dev_priv)
 	spin_unlock_irq(&dev_priv->irq_lock);
 }
 
+static void setup_hotplug_inversion(struct drm_i915_private *dev_priv)
+{
+	u32 invert_bits;
+
+	if (HAS_PCH_DG1(dev_priv))
+		invert_bits = INVERT_DDIA_HPD |
+			      INVERT_DDIB_HPD |
+			      INVERT_DDIC_HPD |
+			      INVERT_DDID_HPD;
+	else
+		return;
+
+	intel_uncore_rmw(&dev_priv->uncore, SOUTH_CHICKEN1, 0, invert_bits);
+}
+
 static u32 ibx_hotplug_enables(struct drm_i915_private *i915,
 			       enum hpd_pin pin)
 {
@@ -3413,15 +3428,7 @@ static u32 gen11_hotplug_enables(struct drm_i915_private *i915,
 
 static void dg1_hpd_irq_setup(struct drm_i915_private *dev_priv)
 {
-	u32 val;
-
-	val = intel_uncore_read(&dev_priv->uncore, SOUTH_CHICKEN1);
-	val |= (INVERT_DDIA_HPD |
-		INVERT_DDIB_HPD |
-		INVERT_DDIC_HPD |
-		INVERT_DDID_HPD);
-	intel_uncore_write(&dev_priv->uncore, SOUTH_CHICKEN1, val);
-
+	setup_hotplug_inversion(dev_priv);
 	icp_hpd_irq_setup(dev_priv);
 }
 
-- 
2.37.3


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

end of thread, other threads:[~2022-09-22 10:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19 14:56 [Intel-gfx] [PATCH] drm/i915: Move hotplug inversion logic into separate helper Gustavo Sousa
2022-09-19 22:58 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-09-20  6:47 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-09-20  7:01 ` [Intel-gfx] [PATCH] " Lucas De Marchi
2022-09-20 16:27   ` Gustavo Sousa
2022-09-21  9:59     ` Jani Nikula
2022-09-20  7:19 ` Jani Nikula
2022-09-20 17:04   ` Gustavo Sousa
2022-09-20 17:56     ` Lucas De Marchi
2022-09-21 10:23       ` Jani Nikula
2022-09-21  8:21     ` Jani Nikula
2022-09-21 12:05       ` Gustavo Sousa
2022-09-22  8:17         ` Jani Nikula
2022-09-22 10:53           ` Gustavo Sousa

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.