Use correct mask in dce_v8_0_afmt_setmode() and fix comment typos.
Subsystems (2)
PATCH 1/1 Use correct mask in dce_v8_0_afmt_setmode() and fix comment typos.
We were using the same mask twice. Looking at radeon, it seems we should be using HDMI_AVI_INFO_CONT instead as the second mask.
Being there, fix typos in comments and improved readability.
I haven't looked at other DCEs, the mask may also be wrong for them.
--- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +4 -3
@@ -1693,6 +1693,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,/* Silent, r600_hdmi_enable will raise WARN for us */ if (!dig->afmt->enabled)return ; + offset = dig->afmt->offset;/* hdmi deep color mode general control packets setup, if bpc > 8 */
@@ -1817,7 +1818,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,WREG32_OR (mmHDMI_INFOFRAME_CONTROL0 + offset,HDMI_INFOFRAME_CONTROL0__HDMI_AVI_INFO_SEND_MASK |/* enable AVI info frames */ -HDMI_INFOFRAME_CONTROL0__HDMI_AVI_INFO_SEND_MASK );/* required for audio info values to be updated */ +HDMI_INFOFRAME_CONTROL0__HDMI_AVI_INFO_CONT_MASK );/* required for audio info values to be updated */ WREG32_P(mmHDMI_INFOFRAME_CONTROL1 + offset, (2 << HDMI_INFOFRAME_CONTROL1__HDMI_AVI_INFO_LINE__SHIFT), /* anything other than 0 */
@@ -1826,13 +1827,13 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,WREG32_OR (mmAFMT_AUDIO_PACKET_CONTROL + offset,AFMT_AUDIO_PACKET_CONTROL__AFMT_AUDIO_SAMPLE_SEND_MASK );/* send audio packets */ -/* it's unknown what these bits do excatly, but it's indeed quite useful for debugging */ +/* it's unknown what these bits do exactly, but it's indeed quite useful for debugging */ WREG32 (mmAFMT_RAMP_CONTROL0 + offset,0x00FFFFFF );WREG32 (mmAFMT_RAMP_CONTROL1 + offset,0x007FFFFF );WREG32 (mmAFMT_RAMP_CONTROL2 + offset,0x00000001 );WREG32 (mmAFMT_RAMP_CONTROL3 + offset,0x00000001 ); -/* enable audio after to setting up hw */ +/* enable audio after setting up hw */ dce_v8_0_audio_enable (adev, dig->afmt->pin, true); }
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20160822003841.16476-1-alexandre.f.demers-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Edward O'Callaghan
Reviewed-byQuoted 8 lines · Alexandre Demers
We were using the same mask twice. Looking at radeon, it seems we should be using
HDMI_AVI_INFO_CONTinstead as the second mask.Being there, fix typos in comments and improved readability.
I haven't looked at other DCEs, the mask may also be wrong for them.
Signed-off-by Alexandre Demers <[email protected]>
Quoted 32 lines
--- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +3
-2@@ -1693,6 +1693,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,/* Silent, r600_hdmi_enable will raise WARN for us */ if (!dig->afmt->enabled)return ; + offset = dig->afmt->offset;/* hdmi deep color mode general control packets setup, if bpc > 8 */ @@ -1817,7 +1818,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,WREG32_OR (mmHDMI_INFOFRAME_CONTROL0 + offset,HDMI_INFOFRAME_CONTROL0__HDMI_AVI_INFO_SEND_MASK |/* enable AVI info frames */ -HDMI_INFOFRAME_CONTROL0__HDMI_AVI_INFO_SEND_MASK );/* required for audio info values to be updated */ +HDMI_INFOFRAME_CONTROL0__HDMI_AVI_INFO_CONT_MASK );/* required for audio info values to be updated */ WREG32_P(mmHDMI_INFOFRAME_CONTROL1 + offset, (2 << HDMI_INFOFRAME_CONTROL1__HDMI_AVI_INFO_LINE__SHIFT), /* anything other than 0 */@@ -1826,13 +1827,13 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,WREG32_OR (mmAFMT_AUDIO_PACKET_CONTROL + offset,AFMT_AUDIO_PACKET_CONTROL__AFMT_AUDIO_SAMPLE_SEND_MASK );/* send audio packets */ -/* it's unknown what these bits do excatly, but it's indeed quite useful for debugging */ +/* it's unknown what these bits do exactly, but it's indeed quite useful for debugging */
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder, · line 1839
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +1
-1WREG32 (mmAFMT_RAMP_CONTROL0 + offset,0x00FFFFFF );WREG32 (mmAFMT_RAMP_CONTROL1 + offset,0x007FFFFF );WREG32 (mmAFMT_RAMP_CONTROL2 + offset,0x00000001 );WREG32 (mmAFMT_RAMP_CONTROL3 + offset,0x00000001 ); -/* enable audio after to setting up hw */ +/* enable audio after setting up hw */ dce_v8_0_audio_enable (adev, dig->afmt->pin, true); }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 73e7bbfa-45a7-1f1e-ae19-52a6461f4a9f-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org
Am 22.08.2016 um 02:41 schrieb Edward O'Callaghan:
Quoted 35 lines · Alexandre Demers
Quoted 8 lines
We were using the same mask twice. Looking at radeon, it seems we should be using
HDMI_AVI_INFO_CONTinstead as the second mask.Being there, fix typos in comments and improved readability.
I haven't looked at other DCEs, the mask may also be wrong for them.
Signed-off-by Alexandre Demers <[email protected]>Reviewed-by Edward O'Callaghan <[email protected]>Quoted 23 lines
--- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +2
-1@@ -1693,6 +1693,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,/* Silent, r600_hdmi_enable will raise WARN for us */ if (!dig->afmt->enabled)return ; + offset = dig->afmt->offset;/* hdmi deep color mode general control packets setup, if bpc > 8 */ @@ -1817,7 +1818,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,WREG32_OR (mmHDMI_INFOFRAME_CONTROL0 + offset,HDMI_INFOFRAME_CONTROL0__HDMI_AVI_INFO_SEND_MASK |/* enable AVI info frames */ -HDMI_INFOFRAME_CONTROL0__HDMI_AVI_INFO_SEND_MASK );/* required for audio info values to be updated */ +HDMI_INFOFRAME_CONTROL0__HDMI_AVI_INFO_CONT_MASK );/* required for audio info values to be updated */
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder, · line 1830
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +1
-1WREG32_P(mmHDMI_INFOFRAME_CONTROL1 + offset, (2 << HDMI_INFOFRAME_CONTROL1__HDMI_AVI_INFO_LINE__SHIFT), /* anything other than 0 */@@ -1826,13 +1827,13 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,WREG32_OR (mmAFMT_AUDIO_PACKET_CONTROL + offset,AFMT_AUDIO_PACKET_CONTROL__AFMT_AUDIO_SAMPLE_SEND_MASK );/* send audio packets */ -/* it's unknown what these bits do excatly, but it's indeed quite useful for debugging */ +/* it's unknown what these bits do exactly, but it's indeed quite useful for debugging */
You can actually completely drop this comment now. I added it when I originally reverse engineered the hardware to figure out how HDMI audio works.
With that fixed the patch is Reviewed-by: Christian König <[email protected]>.
Regards,
Christian.
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +0
-0WREG32 (mmAFMT_RAMP_CONTROL0 + offset,0x00FFFFFF );WREG32 (mmAFMT_RAMP_CONTROL1 + offset,0x007FFFFF );WREG32 (mmAFMT_RAMP_CONTROL2 + offset,0x00000001 );WREG32 (mmAFMT_RAMP_CONTROL3 + offset,0x00000001 );
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder, · line 1839
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +1
-1-/* enable audio after to setting up hw */ +/* enable audio after setting up hw */ dce_v8_0_audio_enable (adev, dig->afmt->pin, true); }_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx