summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorCharlene Liu <charlene.liu@amd.com>2024-01-18 18:25:23 -0500
committerAlex Deucher <alexander.deucher@amd.com>2024-01-29 15:46:07 -0500
commit2ba36e18566b2c5b77bbdf06bd7e77f994fa0ff5 (patch)
tree9fd15512f86f68a721282e1d0944b265bd148195 /drivers/gpu
parent5024ae7fa88c1236b12607a84116af37245c0e59 (diff)
drm/amd/display: fix DP audio settings
[why] Audio channel layout for 5.1ch is not correct [how] Add the audio layout for 5.1ch (channel_count = 6). Add divided by zero check. Reviewed-by: Zhan Liu <zhan.liu@amd.com> Acked-by: Tom Chung <chiahsuan.chung@amd.com> Signed-off-by: Charlene Liu <charlene.liu@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce/dce_audio.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c b/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c
index 07b507150c51..12f3c35b3a34 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c
@@ -282,7 +282,7 @@ static void get_audio_layout_config(
output->layouts_per_sample_denom = 4;
output->symbols_per_layout = 40;
output->max_layouts_per_audio_sdp = 1;
- } else if (channel_count == 8) {
+ } else if (channel_count == 8 || channel_count == 6) {
output->layouts_per_sample_denom = 1;
output->symbols_per_layout = 40;
output->max_layouts_per_audio_sdp = 1;
@@ -292,7 +292,7 @@ static void get_audio_layout_config(
output->layouts_per_sample_denom = 4;
output->symbols_per_layout = 10;
output->max_layouts_per_audio_sdp = 1;
- } else if (channel_count == 8) {
+ } else if (channel_count == 8 || channel_count == 6) {
output->layouts_per_sample_denom = 1;
output->symbols_per_layout = 10;
output->max_layouts_per_audio_sdp = 1;
@@ -489,6 +489,11 @@ static void check_audio_bandwidth_dp(
get_audio_layout_config(
channel_count, dp_link_info->encoding, &layout_config);
+ if (layout_config.max_layouts_per_audio_sdp == 0 ||
+ layout_config.symbols_per_layout == 0 ||
+ layout_config.layouts_per_sample_denom == 0) {
+ return;
+ }
if (available_hblank_bw < calculate_required_audio_bw_in_symbols(
crtc_info, &layout_config, channel_count, 192000,
av_stream_map_lane_count, audio_sdp_overhead))