dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: dri-devel@lists.freedesktop.org,
	"Christian König" <deathsimple@vodafone.de>
Subject: [deathsimple/drm-next-3.16][2/4] drm/radeon/hdmi: DCE3: clean ACR control
Date: Wed, 14 May 2014 23:27:57 +0200	[thread overview]
Message-ID: <1400102879-3164-2-git-send-email-zajec5@gmail.com> (raw)
In-Reply-To: <1400102879-3164-1-git-send-email-zajec5@gmail.com>

What initially seemed to be a typo in fglrx (using register 0x740c
instead of 74dc) appeared to be a correct behavior. Without this
0x740c reg operation DCE 3 doesn't work and it seems we got code for
that already in place.
Recent RE effors allowed to finally understand this magic:
WREG32(HDMI0_AUDIO_CRC_CONTROL + offset, 0x1000);

This has been tested for possible regressions on DCE3 HD3470 (RV620).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
 drivers/gpu/drm/radeon/r600_hdmi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c
index b8b2efa..d4c13a0 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -332,6 +332,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod
 	u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE];
 	struct hdmi_avi_infoframe frame;
 	uint32_t offset;
+	uint32_t acr_ctl;
 	ssize_t err;
 
 	if (!dig || !dig->afmt)
@@ -351,15 +352,15 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod
 	WREG32(HDMI0_VBI_PACKET_CONTROL + offset,
 	       HDMI0_NULL_SEND); /* send null packets when required */
 
-	WREG32(HDMI0_AUDIO_CRC_CONTROL + offset, 0x1000);
-
 	WREG32(HDMI0_AUDIO_PACKET_CONTROL + offset,
 	       HDMI0_AUDIO_SAMPLE_SEND | /* send audio packets */
 	       HDMI0_AUDIO_DELAY_EN(1) | /* default audio delay */
 	       HDMI0_AUDIO_PACKETS_PER_LINE(3) | /* should be suffient for all audio modes and small enough for all hblanks */
 	       HDMI0_60958_CS_UPDATE); /* allow 60958 channel status fields to be updated */
 
-	WREG32(HDMI0_ACR_PACKET_CONTROL + offset,
+	/* DCE 3.0 uses register that's normally for CRC_CONTROL */
+	acr_ctl = ASIC_IS_DCE3(rdev) ? 0x740c : HDMI0_ACR_PACKET_CONTROL;
+	WREG32(acr_ctl + offset,
 	       HDMI0_ACR_SOURCE | /* select SW CTS value - XXX verify that hw CTS works on all families */
 	       HDMI0_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */
 
-- 
1.8.4.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2014-05-14 21:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14 21:27 [deathsimple/drm-next-3.16][1/4] drm/radeon/hdmi: use separated file for DCE 3.1/3.2 code Rafał Miłecki
2014-05-14 21:27 ` Rafał Miłecki [this message]
2014-05-15 16:26   ` [deathsimple/drm-next-3.16][2/4] drm/radeon/hdmi: DCE3: clean ACR control Alex Deucher
2014-05-14 21:27 ` [deathsimple/drm-next-3.16][3/4] drm/radeon/hdmi: DCE2: update setmode Rafał Miłecki
2014-05-15  7:24   ` [deathsimple/drm-next-3.16][PATCH V2 3/4] " Rafał Miłecki
2014-05-14 21:27 ` [deathsimple/drm-next-3.16][4/4] drm/radeon/hdmi: DCE2: simplify audio workaround Rafał Miłecki
2014-05-15  7:25   ` [deathsimple/drm-next-3.16][PATCH V2 4/4] " Rafał Miłecki

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=1400102879-3164-2-git-send-email-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=deathsimple@vodafone.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox