All of lore.kernel.org
 help / color / mirror / Atom feed
From: Egbert Eich <eich@suse.de>
To: dri-devel@lists.freedesktop.org
Cc: Egbert Eich <eich@suse.de>
Subject: [PATCH 2/3] DRM/Radeon: Add Handling for R200 to TV DAC Load Detection.
Date: Mon, 29 Oct 2012 13:43:51 +0100	[thread overview]
Message-ID: <1351514632-16656-3-git-send-email-eich@suse.de> (raw)
In-Reply-To: <1351514632-16656-1-git-send-email-eich@suse.de>

Signed-off-by: Egbert Eich <eich@suse.de>
---
 drivers/gpu/drm/radeon/radeon_legacy_encoders.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index a1409e9..ef18569 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -679,6 +679,9 @@ static enum drm_connector_status radeon_legacy_primary_dac_detect(struct drm_enc
 	if (RREG32(RADEON_DAC_CNTL) & RADEON_DAC_CMP_OUTPUT)
 		found = connector_status_connected;
 
+	DRM_DEBUG_KMS("[%s]: Load detected: %s\n", drm_get_encoder_name(encoder),
+		      (found == connector_status_connected) ? "yes" : "no");
+
 	/* restore the regs we used */
 	WREG32(RADEON_DAC_CNTL, dac_cntl);
 	WREG32(RADEON_DAC_MACRO_CNTL, dac_macro_cntl);
@@ -1420,7 +1423,7 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder
 	struct radeon_device *rdev = dev->dev_private;
 	uint32_t crtc2_gen_cntl, tv_dac_cntl, dac_cntl2, dac_ext_cntl;
 	uint32_t gpiopad_a = 0, pixclks_cntl, tmp;
-	uint32_t disp_output_cntl = 0, disp_hw_debug = 0;
+	uint32_t disp_output_cntl = 0, disp_hw_debug = 0, fp2_gen_cntl = 0;
 	enum drm_connector_status found = connector_status_disconnected;
 	struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
 	struct radeon_encoder_tv_dac *tv_dac = radeon_encoder->enc_priv;
@@ -1462,6 +1465,8 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder
 	if (ASIC_IS_R300(rdev)) {
 		gpiopad_a = RREG32(RADEON_GPIOPAD_A);
 		disp_output_cntl = RREG32(RADEON_DISP_OUTPUT_CNTL);
+	} else 	if (rdev->family == CHIP_R200) {
+		fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL);
 	} else {
 		disp_hw_debug = RREG32(RADEON_DISP_HW_DEBUG);
 	}
@@ -1484,6 +1489,11 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder
 		tmp = disp_output_cntl & ~RADEON_DISP_TVDAC_SOURCE_MASK;
 		tmp |= RADEON_DISP_TVDAC_SOURCE_CRTC2;
 		WREG32(RADEON_DISP_OUTPUT_CNTL, tmp);
+	} else 	if (rdev->family == CHIP_R200) {
+		tmp = fp2_gen_cntl & ~(R200_FP2_SOURCE_SEL_MASK |
+				       RADEON_FP2_DVO_RATE_SEL_SDR);
+		tmp |= RADEON_DISP_TV_PATH_SRC_CRTC2;
+		WREG32(RADEON_FP2_GEN_CNTL, tmp);
 	} else {
 		tmp = disp_hw_debug & ~RADEON_CRT2_DISP1_SEL;
 		WREG32(RADEON_DISP_HW_DEBUG, tmp);
@@ -1524,6 +1534,9 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder
 			found = connector_status_connected;
 	}
 
+	DRM_DEBUG_KMS("[%s]: Load detected: %s\n", drm_get_encoder_name(encoder),
+		      (found == connector_status_connected) ? "yes" : "no");
+
 	/* restore regs we used */
 	WREG32(RADEON_DAC_CNTL2, dac_cntl2);
 	WREG32(RADEON_DAC_EXT_CNTL, dac_ext_cntl);
@@ -1533,6 +1546,8 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder
 	if (ASIC_IS_R300(rdev)) {
 		WREG32(RADEON_DISP_OUTPUT_CNTL, disp_output_cntl);
 		WREG32_P(RADEON_GPIOPAD_A, gpiopad_a, ~1);
+	} else 	if (rdev->family == CHIP_R200) {
+		WREG32(RADEON_FP2_GEN_CNTL, fp2_gen_cntl);
 	} else {
 		WREG32(RADEON_DISP_HW_DEBUG, disp_hw_debug);
 	}
-- 
1.7.6.3

  parent reply	other threads:[~2012-10-29 12:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24 16:28 [PATCH] DRM/Radeon: Fix TV DAC Load Detection for single CRTC chips Egbert Eich
2012-10-24 16:51 ` Alex Deucher
2012-10-29 12:43 ` [PATCH 0/3] DRM/radeon: Clean up and fix Load Detection on the TV DAC for single CRTC GPUs Egbert Eich
2012-10-29 12:43   ` [PATCH 1/3] DRM/Radeon: Clean up code in TV DAC load detection Egbert Eich
2012-10-29 12:43   ` Egbert Eich [this message]
2012-10-29 13:17     ` [PATCH 2/3] DRM/Radeon: Add Handling for R200 to TV DAC Load Detection Alex Deucher
2012-10-29 12:43   ` [PATCH 3/3] DRM/Radeon: Fix TV DAC Load Detection for single CRTC chips Egbert Eich

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=1351514632-16656-3-git-send-email-eich@suse.de \
    --to=eich@suse.de \
    --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.