diff mbox series

[v2,12/19] drm/i915: Relocate intel_hpd_{enabled, hotplug}_irqs()

Message ID 20201023133420.12039-13-ville.syrjala@linux.intel.com
State New, archived
Headers show
Series drm/i915: Futher cleanup around hpd pins and port identfiers | expand

Commit Message

Ville Syrjälä Oct. 23, 2020, 1:34 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Move intel_hpd_{enabled,hotplug}_irqs() closes to the beginning of
the file so we can use them in more places. No functional changes.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 50 ++++++++++++++++-----------------
 1 file changed, 25 insertions(+), 25 deletions(-)

Comments

Lucas De Marchi Oct. 23, 2020, 7:21 p.m. UTC | #1
On Fri, Oct 23, 2020 at 04:34:13PM +0300, Ville Syrjälä wrote:
>From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
>Move intel_hpd_{enabled,hotplug}_irqs() closes to the beginning of
>the file so we can use them in more places. No functional changes.
>
>Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>


Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

Lucas De Marchi

>---
> drivers/gpu/drm/i915/i915_irq.c | 50 ++++++++++++++++-----------------
> 1 file changed, 25 insertions(+), 25 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
>index ff695ff23ce5..68e9d2813d32 100644
>--- a/drivers/gpu/drm/i915/i915_irq.c
>+++ b/drivers/gpu/drm/i915/i915_irq.c
>@@ -1193,6 +1193,31 @@ static void intel_get_hpd_pins(struct drm_i915_private *dev_priv,
>
> }
>
>+static u32 intel_hpd_enabled_irqs(struct drm_i915_private *dev_priv,
>+				  const u32 hpd[HPD_NUM_PINS])
>+{
>+	struct intel_encoder *encoder;
>+	u32 enabled_irqs = 0;
>+
>+	for_each_intel_encoder(&dev_priv->drm, encoder)
>+		if (dev_priv->hotplug.stats[encoder->hpd_pin].state == HPD_ENABLED)
>+			enabled_irqs |= hpd[encoder->hpd_pin];
>+
>+	return enabled_irqs;
>+}
>+
>+static u32 intel_hpd_hotplug_irqs(struct drm_i915_private *dev_priv,
>+				  const u32 hpd[HPD_NUM_PINS])
>+{
>+	struct intel_encoder *encoder;
>+	u32 hotplug_irqs = 0;
>+
>+	for_each_intel_encoder(&dev_priv->drm, encoder)
>+		hotplug_irqs |= hpd[encoder->hpd_pin];
>+
>+	return hotplug_irqs;
>+}
>+
> static void gmbus_irq_handler(struct drm_i915_private *dev_priv)
> {
> 	wake_up_all(&dev_priv->gmbus_wait_queue);
>@@ -3130,31 +3155,6 @@ static void cherryview_irq_reset(struct drm_i915_private *dev_priv)
> 	spin_unlock_irq(&dev_priv->irq_lock);
> }
>
>-static u32 intel_hpd_enabled_irqs(struct drm_i915_private *dev_priv,
>-				  const u32 hpd[HPD_NUM_PINS])
>-{
>-	struct intel_encoder *encoder;
>-	u32 enabled_irqs = 0;
>-
>-	for_each_intel_encoder(&dev_priv->drm, encoder)
>-		if (dev_priv->hotplug.stats[encoder->hpd_pin].state == HPD_ENABLED)
>-			enabled_irqs |= hpd[encoder->hpd_pin];
>-
>-	return enabled_irqs;
>-}
>-
>-static u32 intel_hpd_hotplug_irqs(struct drm_i915_private *dev_priv,
>-				  const u32 hpd[HPD_NUM_PINS])
>-{
>-	struct intel_encoder *encoder;
>-	u32 hotplug_irqs = 0;
>-
>-	for_each_intel_encoder(&dev_priv->drm, encoder)
>-		hotplug_irqs |= hpd[encoder->hpd_pin];
>-
>-	return hotplug_irqs;
>-}
>-
> static void ibx_hpd_detection_setup(struct drm_i915_private *dev_priv)
> {
> 	u32 hotplug;
>-- 
>2.26.2
>
>_______________________________________________
>Intel-gfx mailing list
>Intel-gfx@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index ff695ff23ce5..68e9d2813d32 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1193,6 +1193,31 @@  static void intel_get_hpd_pins(struct drm_i915_private *dev_priv,
 
 }
 
+static u32 intel_hpd_enabled_irqs(struct drm_i915_private *dev_priv,
+				  const u32 hpd[HPD_NUM_PINS])
+{
+	struct intel_encoder *encoder;
+	u32 enabled_irqs = 0;
+
+	for_each_intel_encoder(&dev_priv->drm, encoder)
+		if (dev_priv->hotplug.stats[encoder->hpd_pin].state == HPD_ENABLED)
+			enabled_irqs |= hpd[encoder->hpd_pin];
+
+	return enabled_irqs;
+}
+
+static u32 intel_hpd_hotplug_irqs(struct drm_i915_private *dev_priv,
+				  const u32 hpd[HPD_NUM_PINS])
+{
+	struct intel_encoder *encoder;
+	u32 hotplug_irqs = 0;
+
+	for_each_intel_encoder(&dev_priv->drm, encoder)
+		hotplug_irqs |= hpd[encoder->hpd_pin];
+
+	return hotplug_irqs;
+}
+
 static void gmbus_irq_handler(struct drm_i915_private *dev_priv)
 {
 	wake_up_all(&dev_priv->gmbus_wait_queue);
@@ -3130,31 +3155,6 @@  static void cherryview_irq_reset(struct drm_i915_private *dev_priv)
 	spin_unlock_irq(&dev_priv->irq_lock);
 }
 
-static u32 intel_hpd_enabled_irqs(struct drm_i915_private *dev_priv,
-				  const u32 hpd[HPD_NUM_PINS])
-{
-	struct intel_encoder *encoder;
-	u32 enabled_irqs = 0;
-
-	for_each_intel_encoder(&dev_priv->drm, encoder)
-		if (dev_priv->hotplug.stats[encoder->hpd_pin].state == HPD_ENABLED)
-			enabled_irqs |= hpd[encoder->hpd_pin];
-
-	return enabled_irqs;
-}
-
-static u32 intel_hpd_hotplug_irqs(struct drm_i915_private *dev_priv,
-				  const u32 hpd[HPD_NUM_PINS])
-{
-	struct intel_encoder *encoder;
-	u32 hotplug_irqs = 0;
-
-	for_each_intel_encoder(&dev_priv->drm, encoder)
-		hotplug_irqs |= hpd[encoder->hpd_pin];
-
-	return hotplug_irqs;
-}
-
 static void ibx_hpd_detection_setup(struct drm_i915_private *dev_priv)
 {
 	u32 hotplug;