Commit 201008c4 authored by Jani Nikula's avatar Jani Nikula

drm/i915: pass dev_priv explicitly to PORT_HOTPLUG_STAT

Avoid the implicit dev_priv local variable use, and pass dev_priv
explicitly to the PORT_HOTPLUG_STAT register macro.
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/9a47bba4ab8fa4b1a8e8ceea2ba5301bed54805d.1717514638.git.jani.nikula@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 8232a3bf
...@@ -1228,7 +1228,7 @@ static bool g4x_digital_port_connected(struct intel_encoder *encoder) ...@@ -1228,7 +1228,7 @@ static bool g4x_digital_port_connected(struct intel_encoder *encoder)
return false; 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) static bool ilk_digital_port_connected(struct intel_encoder *encoder)
......
...@@ -609,12 +609,13 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) ...@@ -609,12 +609,13 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector)
"timed out waiting for FORCE_DETECT to go off"); "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) if ((stat & CRT_HOTPLUG_MONITOR_MASK) != CRT_HOTPLUG_MONITOR_NONE)
ret = true; ret = true;
/* clear the interrupt we just generated, if any */ /* 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); i915_hotplug_interrupt_update(dev_priv, CRT_HOTPLUG_FORCE_DETECT, 0);
......
...@@ -1378,7 +1378,7 @@ void vlv_display_irq_reset(struct drm_i915_private *dev_priv) ...@@ -1378,7 +1378,7 @@ void vlv_display_irq_reset(struct drm_i915_private *dev_priv)
intel_uncore_write(uncore, DPINVGTT, DPINVGTT_STATUS_MASK_VLV); intel_uncore_write(uncore, DPINVGTT, DPINVGTT_STATUS_MASK_VLV);
i915_hotplug_interrupt_update_locked(dev_priv, 0xffffffff, 0); 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); i9xx_pipestat_irq_reset(dev_priv);
......
...@@ -435,18 +435,21 @@ u32 i9xx_hpd_irq_ack(struct drm_i915_private *dev_priv) ...@@ -435,18 +435,21 @@ u32 i9xx_hpd_irq_ack(struct drm_i915_private *dev_priv)
* bits can itself generate a new hotplug interrupt :( * bits can itself generate a new hotplug interrupt :(
*/ */
for (i = 0; i < 10; i++) { 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) if (tmp == 0)
return hotplug_status; return hotplug_status;
hotplug_status |= tmp; 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, drm_WARN_ONCE(&dev_priv->drm, 1,
"PORT_HOTPLUG_STAT did not clear (0x%08x)\n", "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; return hotplug_status;
} }
......
...@@ -1040,7 +1040,8 @@ static void i915_irq_reset(struct drm_i915_private *dev_priv) ...@@ -1040,7 +1040,8 @@ static void i915_irq_reset(struct drm_i915_private *dev_priv)
if (I915_HAS_HOTPLUG(dev_priv)) { if (I915_HAS_HOTPLUG(dev_priv)) {
i915_hotplug_interrupt_update(dev_priv, 0xffffffff, 0); 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); i9xx_pipestat_irq_reset(dev_priv);
...@@ -1149,7 +1150,7 @@ static void i965_irq_reset(struct drm_i915_private *dev_priv) ...@@ -1149,7 +1150,7 @@ static void i965_irq_reset(struct drm_i915_private *dev_priv)
struct intel_uncore *uncore = &dev_priv->uncore; struct intel_uncore *uncore = &dev_priv->uncore;
i915_hotplug_interrupt_update(dev_priv, 0xffffffff, 0); 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); i9xx_pipestat_irq_reset(dev_priv);
......
...@@ -1327,7 +1327,7 @@ ...@@ -1327,7 +1327,7 @@
#define CRT_HOTPLUG_DETECT_VOLTAGE_325MV (0 << 2) #define CRT_HOTPLUG_DETECT_VOLTAGE_325MV (0 << 2)
#define CRT_HOTPLUG_DETECT_VOLTAGE_475MV (1 << 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+ */ /* HDMI/DP bits are g4x+ */
#define PORTD_HOTPLUG_LIVE_STATUS_G4X (1 << 27) #define PORTD_HOTPLUG_LIVE_STATUS_G4X (1 << 27)
#define PORTC_HOTPLUG_LIVE_STATUS_G4X (1 << 28) #define PORTC_HOTPLUG_LIVE_STATUS_G4X (1 << 28)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment