diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2022-06-01 20:46:34 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2022-11-09 10:43:10 +1000 |
commit | 016dacb60e6d4b301c5941a0dedb49d337926832 (patch) | |
tree | e1ba6b0ad9521ebea08b39bb1a85d0c7d7b87288 /drivers/gpu/drm/nouveau/nouveau_display.c | |
parent | d62f8e982cb857f451a9055d8cc446b1212a6500 (diff) | |
download | linux-016dacb60e6d4b301c5941a0dedb49d337926832.tar.bz2 |
drm/nouveau/kms: pass event mask to hpd handler
Will be moving the DP link status check / re-train here so it's safe
from racing with modeset routing changes.
MST message handling etc. will remain where it is.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_display.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index fb22ebed5424..a21dc2a0f92b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -488,14 +488,28 @@ nouveau_display_hpd_work(struct work_struct *work) drm_connector_list_iter_begin(dev, &conn_iter); nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) { + struct nouveau_connector *nv_connector = nouveau_connector(connector); enum drm_connector_status old_status = connector->status; - u64 old_epoch_counter = connector->epoch_counter; + u64 bits, old_epoch_counter = connector->epoch_counter; if (!(pending & drm_connector_mask(connector))) continue; - connector->status = drm_helper_probe_detect(connector, NULL, - false); + spin_lock_irq(&drm->hpd_lock); + bits = nv_connector->hpd_pending; + nv_connector->hpd_pending = 0; + spin_unlock_irq(&drm->hpd_lock); + + drm_dbg_kms(dev, "[CONNECTOR:%d:%s] plug:%d unplug:%d irq:%d\n", + connector->base.id, connector->name, + !!(bits & NVIF_NOTIFY_CONN_V0_PLUG), + !!(bits & NVIF_NOTIFY_CONN_V0_UNPLUG), + !!(bits & NVIF_NOTIFY_CONN_V0_IRQ)); + + if (bits & NVIF_NOTIFY_CONN_V0_IRQ) + continue; + + connector->status = drm_helper_probe_detect(connector, NULL, false); if (old_epoch_counter == connector->epoch_counter) continue; |