aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvif
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2022-06-01 20:46:30 +1000
committerDave Airlie <airlied@redhat.com>2022-07-27 09:05:48 +1000
commit32dd9236698bcd2ffdb69954b167a851fd50182a (patch)
treed38d227102d70265588af953452b2c86419aca57 /drivers/gpu/drm/nouveau/nvif
parentdrm/nouveau/disp: add connector class (diff)
downloadlinux-dev-32dd9236698bcd2ffdb69954b167a851fd50182a.tar.xz
linux-dev-32dd9236698bcd2ffdb69954b167a851fd50182a.zip
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>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvif')
-rw-r--r--drivers/gpu/drm/nouveau/nvif/conn.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvif/conn.c b/drivers/gpu/drm/nouveau/nvif/conn.c
index a83b8a4a57e6..4ce935d58c90 100644
--- a/drivers/gpu/drm/nouveau/nvif/conn.c
+++ b/drivers/gpu/drm/nouveau/nvif/conn.c
@@ -26,6 +26,20 @@
#include <nvif/class.h>
#include <nvif/if0011.h>
+int
+nvif_conn_hpd_status(struct nvif_conn *conn)
+{
+ struct nvif_conn_hpd_status_v0 args;
+ int ret;
+
+ args.version = 0;
+
+ ret = nvif_mthd(&conn->object, NVIF_CONN_V0_HPD_STATUS, &args, sizeof(args));
+ NVIF_ERRON(ret, &conn->object, "[HPD_STATUS] support:%d present:%d",
+ args.support, args.present);
+ return ret ? ret : !!args.support + !!args.present;
+}
+
void
nvif_conn_dtor(struct nvif_conn *conn)
{