diff mbox

[5/6] drm/radeon/evergreen: reorder HDMI setup

Message ID 1365895584-20999-6-git-send-email-zajec5@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rafał Miłecki April 13, 2013, 11:26 p.m. UTC
Driver fglrx setups audio and ACR packets after basic initialization,
which sounds sane, do the same.

Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
 drivers/gpu/drm/radeon/evergreen_hdmi.c |   27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

Comments

Paul Menzel April 14, 2013, 10:45 a.m. UTC | #1
Am Sonntag, den 14.04.2013, 01:26 +0200 schrieb Rafa? Mi?ecki:

Maybe use the following for a more descriptive summary:

drm/radeon/evergreen: Set up audio and ACR packets after basic init

> Driver fglrx setups audio and ACR packets after basic initialization,
> which sounds sane, do the same.

Could you also fix the typo?

»While doing so fix the typo suff*ic*ient in the comment (see below).«

Again, how should this be tested?

> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
> ---
>  drivers/gpu/drm/radeon/evergreen_hdmi.c |   27 +++++++++++++++------------
>  1 file changed, 15 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c
> index 6b25c1b..24d13ac 100644
> --- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
> +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
> @@ -111,17 +111,6 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
>  
>  	WREG32(AFMT_AUDIO_CRC_CONTROL + offset, 0x1000);
>  
> -	WREG32(HDMI_AUDIO_PACKET_CONTROL + offset,
> -	       HDMI_AUDIO_DELAY_EN(1) | /* set the default audio delay */
> -	       HDMI_AUDIO_PACKETS_PER_LINE(3)); /* should be suffient for all audio modes and small enough for all hblanks */
> -
> -	WREG32(AFMT_AUDIO_PACKET_CONTROL + offset,
> -	       AFMT_60958_CS_UPDATE); /* allow 60958 channel status fields to be updated */
> -
> -	WREG32(HDMI_ACR_PACKET_CONTROL + offset,
> -	       HDMI_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */
> -	       HDMI_ACR_SOURCE); /* select SW CTS value */
> -
>  	WREG32(HDMI_VBI_PACKET_CONTROL + offset,
>  	       HDMI_NULL_SEND | /* send null packets when required */
>  	       HDMI_GC_SEND | /* send general control packets */
> @@ -146,6 +135,21 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
>  	 * Is that something audio related?
>  	 */
>  
> +	WREG32(HDMI_AUDIO_PACKET_CONTROL + offset,
> +	       HDMI_AUDIO_DELAY_EN(1) | /* set the default audio delay */
> +	       HDMI_AUDIO_PACKETS_PER_LINE(3)); /* should be suffient for all audio modes and small enough for all hblanks */

sufficient

> +
> +	WREG32(AFMT_AUDIO_PACKET_CONTROL + offset,
> +	       AFMT_60958_CS_UPDATE); /* allow 60958 channel status fields to be updated */
> +
> +	/* fglrx clears sth in AFMT_AUDIO_PACKET_CONTROL2 here */
> +
> +	WREG32(HDMI_ACR_PACKET_CONTROL + offset,
> +	       HDMI_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */
> +	       HDMI_ACR_SOURCE); /* select SW CTS value */
> +
> +	evergreen_hdmi_update_ACR(encoder, mode->clock);
> +
>  	err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode);
>  	if (err < 0) {
>  		DRM_ERROR("failed to setup AVI infoframe: %zd\n", err);
> @@ -159,7 +163,6 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
>  	}
>  
>  	evergreen_hdmi_update_avi_infoframe(encoder, buffer, sizeof(buffer));
> -	evergreen_hdmi_update_ACR(encoder, mode->clock);
>  
>  	WREG32_OR(HDMI_INFOFRAME_CONTROL0 + offset,
>  		  HDMI_AVI_INFO_SEND | /* enable AVI info frames */


Thanks,

Paul
Rafał Miłecki April 14, 2013, 1:31 p.m. UTC | #2
2013/4/14 Paul Menzel <paulepanter@users.sourceforge.net>:
> Am Sonntag, den 14.04.2013, 01:26 +0200 schrieb Rafa? Mi?ecki:
>
> Maybe use the following for a more descriptive summary:
>
> drm/radeon/evergreen: Set up audio and ACR packets after basic init

That extra message you can see in my patch:
> Driver fglrx setups audio and ACR packets after basic initialization,
> which sounds sane, do the same.
isn't ignored by git and is also visible in "git log". So that should be fine.
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 6b25c1b..24d13ac 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -111,17 +111,6 @@  void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
 
 	WREG32(AFMT_AUDIO_CRC_CONTROL + offset, 0x1000);
 
-	WREG32(HDMI_AUDIO_PACKET_CONTROL + offset,
-	       HDMI_AUDIO_DELAY_EN(1) | /* set the default audio delay */
-	       HDMI_AUDIO_PACKETS_PER_LINE(3)); /* should be suffient for all audio modes and small enough for all hblanks */
-
-	WREG32(AFMT_AUDIO_PACKET_CONTROL + offset,
-	       AFMT_60958_CS_UPDATE); /* allow 60958 channel status fields to be updated */
-
-	WREG32(HDMI_ACR_PACKET_CONTROL + offset,
-	       HDMI_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */
-	       HDMI_ACR_SOURCE); /* select SW CTS value */
-
 	WREG32(HDMI_VBI_PACKET_CONTROL + offset,
 	       HDMI_NULL_SEND | /* send null packets when required */
 	       HDMI_GC_SEND | /* send general control packets */
@@ -146,6 +135,21 @@  void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
 	 * Is that something audio related?
 	 */
 
+	WREG32(HDMI_AUDIO_PACKET_CONTROL + offset,
+	       HDMI_AUDIO_DELAY_EN(1) | /* set the default audio delay */
+	       HDMI_AUDIO_PACKETS_PER_LINE(3)); /* should be suffient for all audio modes and small enough for all hblanks */
+
+	WREG32(AFMT_AUDIO_PACKET_CONTROL + offset,
+	       AFMT_60958_CS_UPDATE); /* allow 60958 channel status fields to be updated */
+
+	/* fglrx clears sth in AFMT_AUDIO_PACKET_CONTROL2 here */
+
+	WREG32(HDMI_ACR_PACKET_CONTROL + offset,
+	       HDMI_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */
+	       HDMI_ACR_SOURCE); /* select SW CTS value */
+
+	evergreen_hdmi_update_ACR(encoder, mode->clock);
+
 	err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode);
 	if (err < 0) {
 		DRM_ERROR("failed to setup AVI infoframe: %zd\n", err);
@@ -159,7 +163,6 @@  void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
 	}
 
 	evergreen_hdmi_update_avi_infoframe(encoder, buffer, sizeof(buffer));
-	evergreen_hdmi_update_ACR(encoder, mode->clock);
 
 	WREG32_OR(HDMI_INFOFRAME_CONTROL0 + offset,
 		  HDMI_AVI_INFO_SEND | /* enable AVI info frames */