All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH] radeon: add option so DVI always respect HPD over DDC
Date: Mon,  2 Sep 2019 13:09:15 +1000	[thread overview]
Message-ID: <20190902030915.20116-1-airlied@gmail.com> (raw)

From: Dave Airlie <airlied@redhat.com>

Purelink FX-D120 (DVI over fibre extendeders) drive the HPD line
low on the GPU side when the monitor side device is unplugged
or loses the connection. However the GPU side device seems to cache
EDID in this case. Per DVI spec the HPD line must be driven in order
for EDID to be done, but we've met enough broken devices (mainly
VGA->DVI convertors) that do the wrong thing with HPD that we ignore
it if a DDC probe succeeds.

This patch adds an option to the radeon driver to always respect HPD
on DVI connectors such that if the HPD line isn't driven then EDID
isn't probed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/radeon/radeon.h            | 1 +
 drivers/gpu/drm/radeon/radeon_connectors.c | 7 +++++++
 drivers/gpu/drm/radeon/radeon_drv.c        | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 32808e50be12..d572e8ded9b9 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -117,6 +117,7 @@ extern int radeon_uvd;
 extern int radeon_vce;
 extern int radeon_si_support;
 extern int radeon_cik_support;
+extern int radeon_respect_hpd;
 
 /*
  * Copy from radeon_drv.h so we don't have to include both and have conflicting
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index c60d1a44d22a..e9b3924df06e 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -1265,6 +1265,13 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
 		goto exit;
 	}
 
+	if (radeon_respect_hpd && radeon_connector->hpd.hpd != RADEON_HPD_NONE) {
+		if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) {
+			ret = connector_status_disconnected;
+			goto exit;
+		}
+	}
+
 	if (radeon_connector->ddc_bus) {
 		dret = radeon_ddc_probe(radeon_connector, false);
 
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index a6cbe11f79c6..556ae381ea86 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -207,6 +207,7 @@ int radeon_auxch = -1;
 int radeon_mst = 0;
 int radeon_uvd = 1;
 int radeon_vce = 1;
+int radeon_respect_hpd = 0;
 
 MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
 module_param_named(no_wb, radeon_no_wb, int, 0444);
@@ -312,6 +313,9 @@ int radeon_cik_support = 1;
 MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)");
 module_param_named(cik_support, radeon_cik_support, int, 0444);
 
+MODULE_PARM_DESC(respect_hpd, "For DVI always believe HPD");
+module_param_named(respect_hpd, radeon_respect_hpd, int, 0644);
+
 static struct pci_device_id pciidlist[] = {
 	radeon_PCI_IDS
 };
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

             reply	other threads:[~2019-09-02  3:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02  3:09 Dave Airlie [this message]
     [not found] ` <20190902030915.20116-1-airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-09-08 22:52   ` [PATCH] radeon: add option so DVI always respect HPD over DDC Deucher, Alexander
     [not found]     ` <BN6PR12MB1809BC6D87E3E4C564CB0CB8F7B40-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-09-18  9:59       ` Dave Airlie
  -- strict thread matches above, loose matches on Subject: below --
2019-08-18  0:14 Dave Airlie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190902030915.20116-1-airlied@gmail.com \
    --to=airlied-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.