Commit e9be2850 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: s/int i/enum hpd_pin pin/

Use the enum hpd_pin type when talking about HPD pins, and rename the
variable from a very nondescript 'i' to 'pin', a name we already
use in other parts of the code.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180705164357.28512-6-ville.syrjala@linux.intel.comReviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent b6ca3eee
...@@ -1712,20 +1712,20 @@ static void intel_get_hpd_pins(struct drm_i915_private *dev_priv, ...@@ -1712,20 +1712,20 @@ static void intel_get_hpd_pins(struct drm_i915_private *dev_priv,
bool long_pulse_detect(enum port port, u32 val)) bool long_pulse_detect(enum port port, u32 val))
{ {
enum port port; enum port port;
int i; enum hpd_pin pin;
for_each_hpd_pin(i) { for_each_hpd_pin(pin) {
if ((hpd[i] & hotplug_trigger) == 0) if ((hpd[pin] & hotplug_trigger) == 0)
continue; continue;
*pin_mask |= BIT(i); *pin_mask |= BIT(pin);
port = intel_hpd_pin_to_port(dev_priv, i); port = intel_hpd_pin_to_port(dev_priv, pin);
if (port == PORT_NONE) if (port == PORT_NONE)
continue; continue;
if (long_pulse_detect(port, dig_hotplug_reg)) if (long_pulse_detect(port, dig_hotplug_reg))
*long_mask |= BIT(i); *long_mask |= BIT(pin);
} }
DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x, dig 0x%08x, pins 0x%08x\n", DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x, dig 0x%08x, pins 0x%08x\n",
......
...@@ -241,25 +241,25 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work) ...@@ -241,25 +241,25 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
container_of(work, typeof(*dev_priv), container_of(work, typeof(*dev_priv),
hotplug.reenable_work.work); hotplug.reenable_work.work);
struct drm_device *dev = &dev_priv->drm; struct drm_device *dev = &dev_priv->drm;
int i; enum hpd_pin pin;
intel_runtime_pm_get(dev_priv); intel_runtime_pm_get(dev_priv);
spin_lock_irq(&dev_priv->irq_lock); spin_lock_irq(&dev_priv->irq_lock);
for_each_hpd_pin(i) { for_each_hpd_pin(pin) {
struct drm_connector *connector; struct drm_connector *connector;
struct drm_connector_list_iter conn_iter; struct drm_connector_list_iter conn_iter;
if (dev_priv->hotplug.stats[i].state != HPD_DISABLED) if (dev_priv->hotplug.stats[pin].state != HPD_DISABLED)
continue; continue;
dev_priv->hotplug.stats[i].state = HPD_ENABLED; dev_priv->hotplug.stats[pin].state = HPD_ENABLED;
drm_connector_list_iter_begin(dev, &conn_iter); drm_connector_list_iter_begin(dev, &conn_iter);
drm_for_each_connector_iter(connector, &conn_iter) { drm_for_each_connector_iter(connector, &conn_iter) {
struct intel_connector *intel_connector = to_intel_connector(connector); struct intel_connector *intel_connector = to_intel_connector(connector);
if (intel_connector->encoder->hpd_pin == i) { if (intel_connector->encoder->hpd_pin == pin) {
if (connector->polled != intel_connector->polled) if (connector->polled != intel_connector->polled)
DRM_DEBUG_DRIVER("Reenabling HPD on connector %s\n", DRM_DEBUG_DRIVER("Reenabling HPD on connector %s\n",
connector->name); connector->name);
...@@ -432,14 +432,14 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv, ...@@ -432,14 +432,14 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
spin_lock(&dev_priv->irq_lock); spin_lock(&dev_priv->irq_lock);
for_each_intel_encoder(&dev_priv->drm, encoder) { for_each_intel_encoder(&dev_priv->drm, encoder) {
enum hpd_pin i = encoder->hpd_pin; enum hpd_pin pin = encoder->hpd_pin;
bool has_hpd_pulse = intel_encoder_has_hpd_pulse(encoder); bool has_hpd_pulse = intel_encoder_has_hpd_pulse(encoder);
if (!(BIT(i) & pin_mask)) if (!(BIT(pin) & pin_mask))
continue; continue;
if (has_hpd_pulse) { if (has_hpd_pulse) {
bool long_hpd = long_mask & BIT(i); bool long_hpd = long_mask & BIT(pin);
enum port port = encoder->port; enum port port = encoder->port;
DRM_DEBUG_DRIVER("digital hpd port %c - %s\n", port_name(port), DRM_DEBUG_DRIVER("digital hpd port %c - %s\n", port_name(port),
...@@ -458,7 +458,7 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv, ...@@ -458,7 +458,7 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
} }
} }
if (dev_priv->hotplug.stats[i].state == HPD_DISABLED) { if (dev_priv->hotplug.stats[pin].state == HPD_DISABLED) {
/* /*
* On GMCH platforms the interrupt mask bits only * On GMCH platforms the interrupt mask bits only
* prevent irq generation, not the setting of the * prevent irq generation, not the setting of the
...@@ -466,20 +466,20 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv, ...@@ -466,20 +466,20 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
* interrupts on saner platforms. * interrupts on saner platforms.
*/ */
WARN_ONCE(!HAS_GMCH_DISPLAY(dev_priv), WARN_ONCE(!HAS_GMCH_DISPLAY(dev_priv),
"Received HPD interrupt on pin %d although disabled\n", i); "Received HPD interrupt on pin %d although disabled\n", pin);
continue; continue;
} }
if (dev_priv->hotplug.stats[i].state != HPD_ENABLED) if (dev_priv->hotplug.stats[pin].state != HPD_ENABLED)
continue; continue;
if (!has_hpd_pulse) { if (!has_hpd_pulse) {
dev_priv->hotplug.event_bits |= BIT(i); dev_priv->hotplug.event_bits |= BIT(pin);
queue_hp = true; queue_hp = true;
} }
if (intel_hpd_irq_storm_detect(dev_priv, i)) { if (intel_hpd_irq_storm_detect(dev_priv, pin)) {
dev_priv->hotplug.event_bits &= ~BIT(i); dev_priv->hotplug.event_bits &= ~BIT(pin);
storm_detected = true; storm_detected = true;
} }
} }
......
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