drm/nouveau/disp: add conn method to query HPD pin status
authorBen Skeggs <bskeggs@redhat.com>
Wed, 1 Jun 2022 10:46:30 +0000 (20:46 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 26 Jul 2022 23:05:48 +0000 (09:05 +1000)
commit32dd9236698bcd2ffdb69954b167a851fd50182a
treed38d227102d70265588af953452b2c86419aca57
parent95983aea80038539ebc70e41e73e9bb4eabd1a92
drm/nouveau/disp: add conn method to query HPD pin status

And use it to bail early in DP detection and avoid futile AUX transactions.

This could be used on other connector types too in theory, but it's not
something we've ever done before and I'd rather not risk breaking working
systems without looking into it more closely.

It's safe for DP though.  We already do this by checking an AUX register
that contains HPD status and aborting the transaction.  However, this is
much deeper in the stack - after taking various mutexes, poking HW for no
good reason, and making a mess in debug logs.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/nouveau/include/nvif/conn.h
drivers/gpu/drm/nouveau/include/nvif/if0011.h
drivers/gpu/drm/nouveau/nouveau_dp.c
drivers/gpu/drm/nouveau/nvif/conn.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c