]> www.infradead.org Git - users/hch/configfs.git/commitdiff
drm/i915: pass dev_priv explicitly to PORT_HOTPLUG_STAT
authorJani Nikula <jani.nikula@intel.com>
Tue, 4 Jun 2024 15:25:32 +0000 (18:25 +0300)
committerJani Nikula <jani.nikula@intel.com>
Fri, 7 Jun 2024 08:13:17 +0000 (11:13 +0300)
Avoid the implicit dev_priv local variable use, and pass dev_priv
explicitly to the PORT_HOTPLUG_STAT register macro.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/9a47bba4ab8fa4b1a8e8ceea2ba5301bed54805d.1717514638.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/g4x_dp.c
drivers/gpu/drm/i915/display/intel_crt.c
drivers/gpu/drm/i915/display/intel_display_irq.c
drivers/gpu/drm/i915/display/intel_hotplug_irq.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/i915_reg.h

index 06ec04e667e32f7d56459912a033b4cecbd643db..40fee8380a81bea1d989489a8afd18a5d8f02de0 100644 (file)
@@ -1228,7 +1228,7 @@ static bool g4x_digital_port_connected(struct intel_encoder *encoder)
                return false;
        }
 
-       return intel_de_read(dev_priv, PORT_HOTPLUG_STAT) & bit;
+       return intel_de_read(dev_priv, PORT_HOTPLUG_STAT(dev_priv)) & bit;
 }
 
 static bool ilk_digital_port_connected(struct intel_encoder *encoder)
index b7eab52b64b6785c507c371fb1e8b3b74363defe..808fa8afb164756d6819815ce92ae16900fd85e0 100644 (file)
@@ -609,12 +609,13 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector)
                                    "timed out waiting for FORCE_DETECT to go off");
        }
 
-       stat = intel_de_read(dev_priv, PORT_HOTPLUG_STAT);
+       stat = intel_de_read(dev_priv, PORT_HOTPLUG_STAT(dev_priv));
        if ((stat & CRT_HOTPLUG_MONITOR_MASK) != CRT_HOTPLUG_MONITOR_NONE)
                ret = true;
 
        /* clear the interrupt we just generated, if any */
-       intel_de_write(dev_priv, PORT_HOTPLUG_STAT, CRT_HOTPLUG_INT_STATUS);
+       intel_de_write(dev_priv, PORT_HOTPLUG_STAT(dev_priv),
+                      CRT_HOTPLUG_INT_STATUS);
 
        i915_hotplug_interrupt_update(dev_priv, CRT_HOTPLUG_FORCE_DETECT, 0);
 
index d2d70b81aef99e758979cb456b616f402fb10825..bb57fa65c7bed1dde3d745ea215dc19214dcd661 100644 (file)
@@ -1378,7 +1378,7 @@ void vlv_display_irq_reset(struct drm_i915_private *dev_priv)
                intel_uncore_write(uncore, DPINVGTT, DPINVGTT_STATUS_MASK_VLV);
 
        i915_hotplug_interrupt_update_locked(dev_priv, 0xffffffff, 0);
-       intel_uncore_rmw(uncore, PORT_HOTPLUG_STAT, 0, 0);
+       intel_uncore_rmw(uncore, PORT_HOTPLUG_STAT(dev_priv), 0, 0);
 
        i9xx_pipestat_irq_reset(dev_priv);
 
index 90fe5f8538e17e40b6c33b886d6389a36977ed9f..a1f07ee69a8639ecd2f6fd5439386212c238f05e 100644 (file)
@@ -435,18 +435,21 @@ u32 i9xx_hpd_irq_ack(struct drm_i915_private *dev_priv)
         * bits can itself generate a new hotplug interrupt :(
         */
        for (i = 0; i < 10; i++) {
-               u32 tmp = intel_uncore_read(&dev_priv->uncore, PORT_HOTPLUG_STAT) & hotplug_status_mask;
+               u32 tmp = intel_uncore_read(&dev_priv->uncore,
+                                           PORT_HOTPLUG_STAT(dev_priv)) & hotplug_status_mask;
 
                if (tmp == 0)
                        return hotplug_status;
 
                hotplug_status |= tmp;
-               intel_uncore_write(&dev_priv->uncore, PORT_HOTPLUG_STAT, hotplug_status);
+               intel_uncore_write(&dev_priv->uncore,
+                                  PORT_HOTPLUG_STAT(dev_priv),
+                                  hotplug_status);
        }
 
        drm_WARN_ONCE(&dev_priv->drm, 1,
                      "PORT_HOTPLUG_STAT did not clear (0x%08x)\n",
-                     intel_uncore_read(&dev_priv->uncore, PORT_HOTPLUG_STAT));
+                     intel_uncore_read(&dev_priv->uncore, PORT_HOTPLUG_STAT(dev_priv)));
 
        return hotplug_status;
 }
index 678d632ed043ca96bdebd9bed6ba9770a8db4189..8059ac7e15fe270be77f93c2f33a7828004ce30f 100644 (file)
@@ -1040,7 +1040,8 @@ static void i915_irq_reset(struct drm_i915_private *dev_priv)
 
        if (I915_HAS_HOTPLUG(dev_priv)) {
                i915_hotplug_interrupt_update(dev_priv, 0xffffffff, 0);
-               intel_uncore_rmw(&dev_priv->uncore, PORT_HOTPLUG_STAT, 0, 0);
+               intel_uncore_rmw(&dev_priv->uncore,
+                                PORT_HOTPLUG_STAT(dev_priv), 0, 0);
        }
 
        i9xx_pipestat_irq_reset(dev_priv);
@@ -1149,7 +1150,7 @@ static void i965_irq_reset(struct drm_i915_private *dev_priv)
        struct intel_uncore *uncore = &dev_priv->uncore;
 
        i915_hotplug_interrupt_update(dev_priv, 0xffffffff, 0);
-       intel_uncore_rmw(uncore, PORT_HOTPLUG_STAT, 0, 0);
+       intel_uncore_rmw(uncore, PORT_HOTPLUG_STAT(dev_priv), 0, 0);
 
        i9xx_pipestat_irq_reset(dev_priv);
 
index 3b1fc58b95c2154762fef8a7ceafedb189effc62..710078a6bf3f8077de113efa26f2219d4ea307e3 100644 (file)
 #define CRT_HOTPLUG_DETECT_VOLTAGE_325MV       (0 << 2)
 #define CRT_HOTPLUG_DETECT_VOLTAGE_475MV       (1 << 2)
 
-#define PORT_HOTPLUG_STAT      _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x61114)
+#define PORT_HOTPLUG_STAT(dev_priv)    _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x61114)
 /* HDMI/DP bits are g4x+ */
 #define   PORTD_HOTPLUG_LIVE_STATUS_G4X                (1 << 27)
 #define   PORTC_HOTPLUG_LIVE_STATUS_G4X                (1 << 28)