aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorCharlene Liu <charlene.liu@amd.com>2017-02-16 22:28:46 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:15:30 -0400
commit87b58768eccd311fdc7694c09966754d5ce90538 (patch)
treee9b67ecdd12a275e907012d667cb2c6ad2771661 /drivers/gpu/drm
parent185189dc51a5c968ce35b0e1f2b529736e789c9c (diff)
drm/amd/display: audio bug fix part 1: Add missing audio ACR
Signed-off-by: Charlene Liu <charlene.liu@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce/dce_audio.c8
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce/dce_audio.h2
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c2
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c81
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c31
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c1
6 files changed, 95 insertions, 30 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 2749c8fa4f1f..596e039ee315 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c
@@ -828,11 +828,9 @@ void dce_aud_wall_dto_setup(
828 REG_UPDATE(DCCG_AUDIO_DTO1_PHASE, 828 REG_UPDATE(DCCG_AUDIO_DTO1_PHASE,
829 DCCG_AUDIO_DTO1_PHASE, clock_info.audio_dto_phase); 829 DCCG_AUDIO_DTO1_PHASE, clock_info.audio_dto_phase);
830 830
831 /* DAL2 code separate DCCG_AUDIO_DTO_SEL and 831 REG_UPDATE(DCCG_AUDIO_DTO_SOURCE,
832 DCCG_AUDIO_DTO2_USE_512FBR_DTO programming into two different 832 DCCG_AUDIO_DTO2_USE_512FBR_DTO, 1);
833 location. merge together should not hurt */ 833
834 /*value.bits.DCCG_AUDIO_DTO2_USE_512FBR_DTO = 1;
835 dal_write_reg(mmDCCG_AUDIO_DTO_SOURCE, value);*/
836 } 834 }
837} 835}
838 836
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_audio.h b/drivers/gpu/drm/amd/display/dc/dce/dce_audio.h
index c244887ba15e..b98ee2d2a9c7 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_audio.h
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_audio.h
@@ -93,6 +93,7 @@ struct dce_audio_shift {
93 uint8_t DCCG_AUDIO_DTO0_PHASE; 93 uint8_t DCCG_AUDIO_DTO0_PHASE;
94 uint8_t DCCG_AUDIO_DTO1_MODULE; 94 uint8_t DCCG_AUDIO_DTO1_MODULE;
95 uint8_t DCCG_AUDIO_DTO1_PHASE; 95 uint8_t DCCG_AUDIO_DTO1_PHASE;
96 uint8_t DCCG_AUDIO_DTO2_USE_512FBR_DTO;
96}; 97};
97 98
98struct dce_aduio_mask { 99struct dce_aduio_mask {
@@ -109,6 +110,7 @@ struct dce_aduio_mask {
109 uint32_t DCCG_AUDIO_DTO0_PHASE; 110 uint32_t DCCG_AUDIO_DTO0_PHASE;
110 uint32_t DCCG_AUDIO_DTO1_MODULE; 111 uint32_t DCCG_AUDIO_DTO1_MODULE;
111 uint32_t DCCG_AUDIO_DTO1_PHASE; 112 uint32_t DCCG_AUDIO_DTO1_PHASE;
113 uint32_t DCCG_AUDIO_DTO2_USE_512FBR_DTO;
112}; 114};
113 115
114struct dce_audio { 116struct dce_audio {
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
index 60fdf58fc5cc..305a9d86a5d2 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
@@ -871,6 +871,8 @@ static bool dce110_link_encoder_validate_hdmi_output(
871 if (max_deep_color < crtc_timing->display_color_depth) 871 if (max_deep_color < crtc_timing->display_color_depth)
872 return false; 872 return false;
873 873
874 if (crtc_timing->display_color_depth < COLOR_DEPTH_888)
875 return false;
874 if (adjusted_pix_clk_khz < TMDS_MIN_PIXEL_CLOCK) 876 if (adjusted_pix_clk_khz < TMDS_MIN_PIXEL_CLOCK)
875 return false; 877 return false;
876 878
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c
index a28d9c7ba17e..aba392ff5095 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c
@@ -848,7 +848,7 @@ struct audio_clock_info {
848/* 148.5MHz/1.001*/ 848/* 148.5MHz/1.001*/
849/* 148.5MHz*/ 849/* 148.5MHz*/
850 850
851static const struct audio_clock_info audio_clock_info_table[12] = { 851static const struct audio_clock_info audio_clock_info_table[16] = {
852 {2517, 4576, 28125, 7007, 31250, 6864, 28125}, 852 {2517, 4576, 28125, 7007, 31250, 6864, 28125},
853 {2518, 4576, 28125, 7007, 31250, 6864, 28125}, 853 {2518, 4576, 28125, 7007, 31250, 6864, 28125},
854 {2520, 4096, 25200, 6272, 28000, 6144, 25200}, 854 {2520, 4096, 25200, 6272, 28000, 6144, 25200},
@@ -860,37 +860,63 @@ static const struct audio_clock_info audio_clock_info_table[12] = {
860 {7417, 11648, 210937, 17836, 234375, 11648, 140625}, 860 {7417, 11648, 210937, 17836, 234375, 11648, 140625},
861 {7425, 4096, 74250, 6272, 82500, 6144, 74250}, 861 {7425, 4096, 74250, 6272, 82500, 6144, 74250},
862 {14835, 11648, 421875, 8918, 234375, 5824, 140625}, 862 {14835, 11648, 421875, 8918, 234375, 5824, 140625},
863 {14850, 4096, 148500, 6272, 165000, 6144, 148500} 863 {14850, 4096, 148500, 6272, 165000, 6144, 148500},
864 {29670, 5824, 421875, 4459, 234375, 5824, 281250},
865 {29700, 3072, 222750, 4704, 247500, 5120, 247500},
866 {59340, 5824, 843750, 8918, 937500, 5824, 562500},
867 {59400, 3072, 445500, 9408, 990000, 6144, 594000}
864}; 868};
865 869
866static const struct audio_clock_info audio_clock_info_table_36bpc[12] = { 870static const struct audio_clock_info audio_clock_info_table_30bpc[14] = {
867 {2517, 9152, 84375, 7007, 48875, 9152, 56250}, 871 {2517, 9152, 70312, 14014, 78125, 9152, 46875},
868 {2518, 9152, 84375, 7007, 48875, 9152, 56250}, 872 {2518, 9152, 70312, 14014, 78125, 9152, 46875},
869 {2520, 4096, 37800, 6272, 42000, 6144, 37800}, 873 {2520, 4096, 31500, 6272, 35000, 6144, 31500},
870 {2700, 4096, 40500, 6272, 45000, 6144, 40500}, 874 {2700, 4096, 33750, 6272, 37500, 6144, 33750},
871 {2702, 8192, 81081, 6272, 45045, 8192, 54054}, 875 {2702, 8192, 67567, 12544, 75075, 8192, 45045},
872 {2703, 8192, 81081, 6272, 45045, 8192, 54054}, 876 {2703, 8192, 67567, 12544, 75075, 8192, 45045},
873 {5400, 4096, 81000, 6272, 90000, 6144, 81000}, 877 {5400, 4096, 67500, 6272, 75000, 6144, 67500},
874 {5405, 4096, 81081, 6272, 90090, 6144, 81081}, 878 {5405, 8192, 135135, 6272, 75075, 8192, 90090},
879 {7417, 11648, 263672, 17836, 292969, 11648, 175181},
880 {7425, 8192, 185625, 6272, 103125, 12288, 185625},
881 {14835, 11648, 527344, 17836, 585938, 11648, 351563},
882 {14850, 4096, 185625, 6272, 206250, 6144, 185625},
883 {29670, 11648, 527344, 17836, 585938, 11648, 703125},
884 {29700, 6144, 556875, 4704, 309375, 5120, 309375}
885};
886static const struct audio_clock_info audio_clock_info_table_36bpc[14] = {
887 {2517, 9152, 84375, 7007, 48875, 9152, 56250},
888 {2518, 9152, 84375, 7007, 48875, 9152, 56250},
889 {2520, 4096, 37800, 6272, 42000, 6144, 37800},
890 {2700, 4096, 40500, 6272, 45000, 6144, 40500},
891 {2702, 8192, 81081, 6272, 45045, 8192, 54054},
892 {2703, 8192, 81081, 6272, 45045, 8192, 54054},
893 {5400, 4096, 81000, 6272, 90000, 6144, 81000},
894 {5405, 4096, 81081, 6272, 90090, 6144, 81081},
875 {7417, 11648, 316406, 17836, 351562, 11648, 210937}, 895 {7417, 11648, 316406, 17836, 351562, 11648, 210937},
876 {7425, 4096, 111375, 6272, 123750, 6144, 111375}, 896 {7425, 4096, 111375, 6272, 123750, 6144, 111375},
877 {14835, 11648, 632812, 17836, 703125, 11648, 421875}, 897 {14835, 11648, 632812, 17836, 703125, 11648, 421875},
878 {14850, 4096, 222750, 6272, 247500, 6144, 222750} 898 {14850, 4096, 222750, 6272, 247500, 6144, 222750},
899 {29670, 5824, 632812, 8918, 703125, 5824, 421875},
900 {29700, 4096, 445500, 4704, 371250, 5120, 371250}
879}; 901};
880 902
881static const struct audio_clock_info audio_clock_info_table_48bpc[12] = { 903static const struct audio_clock_info audio_clock_info_table_48bpc[14] = {
882 {2517, 4576, 56250, 7007, 62500, 6864, 56250}, 904 {2517, 4576, 56250, 7007, 62500, 6864, 56250},
883 {2518, 4576, 56250, 7007, 62500, 6864, 56250}, 905 {2518, 4576, 56250, 7007, 62500, 6864, 56250},
884 {2520, 4096, 50400, 6272, 56000, 6144, 50400}, 906 {2520, 4096, 50400, 6272, 56000, 6144, 50400},
885 {2700, 4096, 54000, 6272, 60000, 6144, 54000}, 907 {2700, 4096, 54000, 6272, 60000, 6144, 54000},
886 {2702, 4096, 54054, 6267, 60060, 8192, 54054}, 908 {2702, 4096, 54054, 6267, 60060, 8192, 54054},
887 {2703, 4096, 54054, 6272, 60060, 8192, 54054}, 909 {2703, 4096, 54054, 6272, 60060, 8192, 54054},
888 {5400, 4096, 108000, 6272, 120000, 6144, 108000}, 910 {5400, 4096, 108000, 6272, 120000, 6144, 108000},
889 {5405, 4096, 108108, 6272, 120120, 6144, 108108}, 911 {5405, 4096, 108108, 6272, 120120, 6144, 108108},
890 {7417, 11648, 421875, 17836, 468750, 11648, 281250}, 912 {7417, 11648, 421875, 17836, 468750, 11648, 281250},
891 {7425, 4096, 148500, 6272, 165000, 6144, 148500}, 913 {7425, 4096, 148500, 6272, 165000, 6144, 148500},
892 {14835, 11648, 843750, 8918, 468750, 11648, 281250}, 914 {14835, 11648, 843750, 8918, 468750, 11648, 281250},
893 {14850, 4096, 297000, 6272, 330000, 6144, 297000} 915 {14850, 4096, 297000, 6272, 330000, 6144, 297000},
916 {29670, 5824, 843750, 4459, 468750, 5824, 562500},
917 {29700, 3072, 445500, 4704, 495000, 5120, 495000}
918
919
894}; 920};
895 921
896union audio_cea_channels speakers_to_channels( 922union audio_cea_channels speakers_to_channels(
@@ -973,6 +999,11 @@ bool get_audio_clock_info(
973 audio_array_size = ARRAY_SIZE( 999 audio_array_size = ARRAY_SIZE(
974 audio_clock_info_table_36bpc); 1000 audio_clock_info_table_36bpc);
975 break; 1001 break;
1002 case COLOR_DEPTH_101010:
1003 clock_info = audio_clock_info_table_30bpc;
1004 audio_array_size = ARRAY_SIZE(
1005 audio_clock_info_table_30bpc);
1006 break;
976 default: 1007 default:
977 clock_info = audio_clock_info_table; 1008 clock_info = audio_clock_info_table;
978 audio_array_size = ARRAY_SIZE( 1009 audio_array_size = ARRAY_SIZE(
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index 9c9183f96e04..76a397d90adc 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -868,6 +868,37 @@ static void build_audio_output(
868 audio_output->crtc_info.calculated_pixel_clock = 868 audio_output->crtc_info.calculated_pixel_clock =
869 pipe_ctx->pix_clk_params.requested_pix_clk; 869 pipe_ctx->pix_clk_params.requested_pix_clk;
870 870
871/*for HDMI, audio ACR is with deep color ratio factor*/
872 if (dc_is_hdmi_signal(pipe_ctx->stream->signal) &&
873 audio_output->crtc_info.requested_pixel_clock ==
874 stream->public.timing.pix_clk_khz) {
875 if (pipe_ctx->pix_clk_params.pixel_encoding == PIXEL_ENCODING_YCBCR420) {
876 audio_output->crtc_info.requested_pixel_clock =
877 audio_output->crtc_info.requested_pixel_clock/2;
878 audio_output->crtc_info.calculated_pixel_clock =
879 pipe_ctx->pix_clk_params.requested_pix_clk/2;
880 }
881
882 if (pipe_ctx->pix_clk_params.pixel_encoding != PIXEL_ENCODING_YCBCR422) {
883 switch (pipe_ctx->pix_clk_params.color_depth) {
884 case COLOR_DEPTH_888:
885 break;
886 case COLOR_DEPTH_101010:
887 audio_output->crtc_info.calculated_pixel_clock = (audio_output->crtc_info.calculated_pixel_clock * 30) / 24;
888 break;
889 case COLOR_DEPTH_121212:
890 audio_output->crtc_info.calculated_pixel_clock = (audio_output->crtc_info.calculated_pixel_clock * 36) / 24;
891 break;
892 case COLOR_DEPTH_161616:
893 audio_output->crtc_info.calculated_pixel_clock = (audio_output->crtc_info.calculated_pixel_clock * 48) / 24;
894 break;
895 default:
896 ASSERT(0);
897 break;
898 }
899 }
900 }
901
871 if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT || 902 if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT ||
872 pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) { 903 pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
873 audio_output->pll_info.dp_dto_source_clock_in_khz = 904 audio_output->pll_info.dp_dto_source_clock_in_khz =
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
index f6e546addbd3..074fb978e076 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
@@ -776,6 +776,7 @@ static void get_pixel_clock_parameters(
776 pixel_clk_params->flags.DISPLAY_BLANKED = 1; 776 pixel_clk_params->flags.DISPLAY_BLANKED = 1;
777 pixel_clk_params->flags.SUPPORT_YCBCR420 = (stream->public.timing.pixel_encoding == 777 pixel_clk_params->flags.SUPPORT_YCBCR420 = (stream->public.timing.pixel_encoding ==
778 PIXEL_ENCODING_YCBCR420); 778 PIXEL_ENCODING_YCBCR420);
779 pixel_clk_params->pixel_encoding = stream->public.timing.pixel_encoding;
779} 780}
780 781
781void dce110_resource_build_bit_depth_reduction_params( 782void dce110_resource_build_bit_depth_reduction_params(