From patchwork Tue Jun 14 06:13:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Airlie X-Patchwork-Id: 877872 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5E6FKAS003846 for ; Tue, 14 Jun 2011 06:15:40 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 31CCA9F5F0 for ; Mon, 13 Jun 2011 23:15:20 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id 843619E70A for ; Mon, 13 Jun 2011 23:14:01 -0700 (PDT) Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5E6E1QD007744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 Jun 2011 02:14:01 -0400 Received: from clockmaker-el6.bne.redhat.com (dhcp-0-222.bne.redhat.com [10.64.0.222]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p5E6DvLv008542 for ; Tue, 14 Jun 2011 02:14:00 -0400 From: Dave Airlie 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 Message-Id: <1308032036-23115-3-git-send-email-airlied@gmail.com> In-Reply-To: <1308032036-23115-1-git-send-email-airlied@gmail.com> References: <1308032036-23115-1-git-send-email-airlied@gmail.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 14 Jun 2011 06:15:40 +0000 (UTC) From: Dave Airlie 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 --- 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");