All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 3/3] drm/radeon/kms: fix dac detect stealing in-use encoder.
Date: Tue, 14 Jun 2011 16:13:56 +1000	[thread overview]
Message-ID: <1308032036-23115-3-git-send-email-airlied@gmail.com> (raw)
In-Reply-To: <1308032036-23115-1-git-send-email-airlied@gmail.com>

From: Dave Airlie <airlied@linux.ie>

On my RS690 the VGA and TV-out share the same DAC, so when xrandr
is called, tv-out steals the encoder and tries to load detect on it,
however this causes flicker on the VGA.

This blocks this by testing if the encoder is connected to anything
and if so whether its connected to the probing connector.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/radeon/radeon_encoders.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
index 03f124d..eb07e74 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -1971,6 +1971,18 @@ radeon_atom_dac_detect(struct drm_encoder *encoder, struct drm_connector *connec
 	struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
 	struct radeon_connector *radeon_connector = to_radeon_connector(connector);
 	uint32_t bios_0_scratch;
+	struct drm_connector *test_connector;
+
+	/*
+	 * if we are passed a connector and it doesn't match what the encoder
+	 * is connected to do, don't do load detect as it might cause flicker.
+	 */
+	 list_for_each_entry(test_connector, &dev->mode_config.connector_list, head) {
+                if ((test_connector->encoder == encoder) && (test_connector != connector)) {
+			DRM_DEBUG_KMS("load detect failed: encoder in use\n");
+			return connector_status_disconnected;
+		}
+	}
 
 	if (!atombios_dac_load_detect(encoder, connector)) {
 		DRM_DEBUG_KMS("detect returned false \n");
-- 
1.7.5.2

  parent reply	other threads:[~2011-06-14  6:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-14  6:13 [PATCH 1/3] drm: make debug levels match in edid failure code Dave Airlie
2011-06-14  6:13 ` [PATCH 2/3] drm/radeon: workaround a hw bug on some radeon chipsets with all-0 EDIDs Dave Airlie
2011-06-14  6:31   ` Alex Deucher
2011-06-14  6:13 ` Dave Airlie [this message]
2011-06-14  6:39   ` [PATCH 3/3] drm/radeon/kms: fix dac detect stealing in-use encoder Alex Deucher
2011-06-14  6:28 ` [PATCH 1/3] drm: make debug levels match in edid failure code Alex Deucher
2011-06-17 19:38 ` Tormod Volden

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=1308032036-23115-3-git-send-email-airlied@gmail.com \
    --to=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.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.