]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
drm/radeon/evergreen: setup HDMI before enabling it
authorRafał Miłecki <zajec5@gmail.com>
Thu, 18 Apr 2013 13:23:12 +0000 (09:23 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 22 Apr 2013 14:39:12 +0000 (10:39 -0400)
Closed source driver fglrx seems to enable infoframes and audio packets
at the end, which makes sense, do the same.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/evergreen_hdmi.c
drivers/gpu/drm/radeon/evergreend.h

index 4fdecc2b40402345a4db04c1dae7eb89d2626897..0879355815d9af49964542200448c589ef9e2820 100644 (file)
@@ -116,7 +116,6 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
               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_AUDIO_SAMPLE_SEND | /* send audio packets */
               AFMT_60958_CS_UPDATE); /* allow 60958 channel status fields to be updated */
 
        WREG32(HDMI_ACR_PACKET_CONTROL + offset,
@@ -129,8 +128,6 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
               HDMI_GC_CONT); /* send general control packets every frame */
 
        WREG32(HDMI_INFOFRAME_CONTROL0 + offset,
-              HDMI_AVI_INFO_SEND | /* enable AVI info frames */
-              HDMI_AVI_INFO_CONT | /* send AVI info frames every frame/field */
               HDMI_AUDIO_INFO_SEND | /* enable audio info frames (frames won't be set until audio is enabled) */
               HDMI_AUDIO_INFO_CONT); /* required for audio info values to be updated */
 
@@ -138,7 +135,6 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
               AFMT_AUDIO_INFO_UPDATE); /* required for audio info values to be updated */
 
        WREG32(HDMI_INFOFRAME_CONTROL1 + offset,
-              HDMI_AVI_INFO_LINE(2) | /* anything other than 0 */
               HDMI_AUDIO_INFO_LINE(2)); /* anything other than 0 */
 
        WREG32(HDMI_GC + offset, 0); /* unset HDMI_GC_AVMUTE */
@@ -158,6 +154,17 @@ 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 */
+                 HDMI_AVI_INFO_CONT); /* required for audio info values to be updated */
+
+       WREG32_P(HDMI_INFOFRAME_CONTROL1 + offset,
+                HDMI_AVI_INFO_LINE(2), /* anything other than 0 */
+                ~HDMI_AVI_INFO_LINE_MASK);
+
+       WREG32_OR(AFMT_AUDIO_PACKET_CONTROL + offset,
+                 AFMT_AUDIO_SAMPLE_SEND); /* send audio packets */
+
        /* it's unknown what these bits do excatly, but it's indeed quite useful for debugging */
        WREG32(AFMT_RAMP_CONTROL0 + offset, 0x00FFFFFF);
        WREG32(AFMT_RAMP_CONTROL1 + offset, 0x007FFFFF);
index eabf92af84e504bd84d540ba454367445ecdf5a9..d9a005431087037aabe65515e84084e657be460d 100644 (file)
 #       define HDMI_MPEG_INFO_CONT           (1 << 9)
 #define HDMI_INFOFRAME_CONTROL1              0x7048
 #       define HDMI_AVI_INFO_LINE(x)         (((x) & 0x3f) << 0)
+#       define HDMI_AVI_INFO_LINE_MASK       (0x3f << 0)
 #       define HDMI_AUDIO_INFO_LINE(x)       (((x) & 0x3f) << 8)
 #       define HDMI_MPEG_INFO_LINE(x)        (((x) & 0x3f) << 16)
 #define HDMI_GENERIC_PACKET_CONTROL          0x704c