Skip to content

Commit 056801d

Browse files
committed
drm/i915/hpd: Track short/long HPD pins instead of ports
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com>
1 parent ca9d01b commit 056801d

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

drivers/gpu/drm/i915/display/intel_display_core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ struct intel_hotplug {
169169
u32 retry_bits;
170170
struct delayed_work reenable_work;
171171

172-
u32 long_port_mask;
173-
u32 short_port_mask;
172+
u32 long_hpd_mask;
173+
u32 short_hpd_mask;
174174
struct work_struct dig_port_work;
175175

176176
struct work_struct poll_init_work;

drivers/gpu/drm/i915/display/intel_hotplug.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -353,28 +353,28 @@ static void i915_digport_work_func(struct work_struct *work)
353353
{
354354
struct drm_i915_private *dev_priv =
355355
container_of(work, struct drm_i915_private, display.hotplug.dig_port_work);
356-
u32 long_port_mask, short_port_mask;
356+
u32 long_hpd_mask, short_hpd_mask;
357357
struct intel_encoder *encoder;
358358
u32 old_bits = 0;
359359

360360
spin_lock_irq(&dev_priv->irq_lock);
361-
long_port_mask = dev_priv->display.hotplug.long_port_mask;
362-
dev_priv->display.hotplug.long_port_mask = 0;
363-
short_port_mask = dev_priv->display.hotplug.short_port_mask;
364-
dev_priv->display.hotplug.short_port_mask = 0;
361+
long_hpd_mask = dev_priv->display.hotplug.long_hpd_mask;
362+
dev_priv->display.hotplug.long_hpd_mask = 0;
363+
short_hpd_mask = dev_priv->display.hotplug.short_hpd_mask;
364+
dev_priv->display.hotplug.short_hpd_mask = 0;
365365
spin_unlock_irq(&dev_priv->irq_lock);
366366

367367
for_each_intel_encoder(&dev_priv->drm, encoder) {
368368
struct intel_digital_port *dig_port;
369-
enum port port = encoder->port;
369+
enum hpd_pin pin = encoder->hpd_pin;
370370
bool long_hpd, short_hpd;
371371
enum irqreturn ret;
372372

373373
if (!intel_encoder_has_hpd_pulse(encoder))
374374
continue;
375375

376-
long_hpd = long_port_mask & BIT(port);
377-
short_hpd = short_port_mask & BIT(port);
376+
long_hpd = long_hpd_mask & BIT(pin);
377+
short_hpd = short_hpd_mask & BIT(pin);
378378

379379
if (!long_hpd && !short_hpd)
380380
continue;
@@ -384,7 +384,7 @@ static void i915_digport_work_func(struct work_struct *work)
384384
ret = dig_port->hpd_pulse(dig_port, long_hpd);
385385
if (ret == IRQ_NONE) {
386386
/* fall back to old school hpd */
387-
old_bits |= BIT(encoder->hpd_pin);
387+
old_bits |= BIT(pin);
388388
}
389389
}
390390

@@ -407,9 +407,10 @@ static void i915_digport_work_func(struct work_struct *work)
407407
void intel_hpd_trigger_irq(struct intel_digital_port *dig_port)
408408
{
409409
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
410+
struct intel_encoder *encoder = &dig_port->base;
410411

411412
spin_lock_irq(&i915->irq_lock);
412-
i915->display.hotplug.short_port_mask |= BIT(dig_port->base.port);
413+
i915->display.hotplug.short_hpd_mask |= BIT(encoder->hpd_pin);
413414
spin_unlock_irq(&i915->irq_lock);
414415

415416
queue_work(i915->display.hotplug.dp_wq, &i915->display.hotplug.dig_port_work);
@@ -557,7 +558,6 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
557558
* only the one of them (DP) will have ->hpd_pulse().
558559
*/
559560
for_each_intel_encoder(&dev_priv->drm, encoder) {
560-
enum port port = encoder->port;
561561
bool long_hpd;
562562

563563
pin = encoder->hpd_pin;
@@ -577,10 +577,10 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
577577

578578
if (long_hpd) {
579579
long_hpd_pulse_mask |= BIT(pin);
580-
dev_priv->display.hotplug.long_port_mask |= BIT(port);
580+
dev_priv->display.hotplug.long_hpd_mask |= BIT(pin);
581581
} else {
582582
short_hpd_pulse_mask |= BIT(pin);
583-
dev_priv->display.hotplug.short_port_mask |= BIT(port);
583+
dev_priv->display.hotplug.short_hpd_mask |= BIT(pin);
584584
}
585585
}
586586

@@ -920,8 +920,8 @@ void intel_hpd_cancel_work(struct drm_i915_private *dev_priv)
920920

921921
spin_lock_irq(&dev_priv->irq_lock);
922922

923-
dev_priv->display.hotplug.long_port_mask = 0;
924-
dev_priv->display.hotplug.short_port_mask = 0;
923+
dev_priv->display.hotplug.long_hpd_mask = 0;
924+
dev_priv->display.hotplug.short_hpd_mask = 0;
925925
dev_priv->display.hotplug.event_bits = 0;
926926
dev_priv->display.hotplug.retry_bits = 0;
927927

0 commit comments

Comments
 (0)