Commit c5c07cb5 authored by Eric Bernstein's avatar Eric Bernstein Committed by Alex Deucher

drm/amd/display: Refactor DIO stream encoder

* Pull duplicate audio_clock_info struct to stream_encoder.h
* Generalize sec_gsp7* to sec_gsp_pps*
* Expose enc1 and enc2 stream encoder audio funcs
Signed-off-by: default avatarEric Bernstein <eric.bernstein@amd.com>
Reviewed-by: default avatarCharlene Liu <Charlene.Liu@amd.com>
Reviewed-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ff1232a9
...@@ -1124,19 +1124,6 @@ union audio_cea_channels { ...@@ -1124,19 +1124,6 @@ union audio_cea_channels {
} channels; } channels;
}; };
struct audio_clock_info {
/* pixel clock frequency*/
uint32_t pixel_clock_in_10khz;
/* N - 32KHz audio */
uint32_t n_32khz;
/* CTS - 32KHz audio*/
uint32_t cts_32khz;
uint32_t n_44khz;
uint32_t cts_44khz;
uint32_t n_48khz;
uint32_t cts_48khz;
};
/* 25.2MHz/1.001*/ /* 25.2MHz/1.001*/
/* 25.2MHz/1.001*/ /* 25.2MHz/1.001*/
/* 25.2MHz*/ /* 25.2MHz*/
......
...@@ -472,7 +472,7 @@ void enc1_stream_encoder_dp_set_stream_attribute( ...@@ -472,7 +472,7 @@ void enc1_stream_encoder_dp_set_stream_attribute(
hw_crtc_timing.v_addressable + hw_crtc_timing.v_border_bottom); hw_crtc_timing.v_addressable + hw_crtc_timing.v_border_bottom);
} }
static void enc1_stream_encoder_set_stream_attribute_helper( void enc1_stream_encoder_set_stream_attribute_helper(
struct dcn10_stream_encoder *enc1, struct dcn10_stream_encoder *enc1,
struct dc_crtc_timing *crtc_timing) struct dc_crtc_timing *crtc_timing)
{ {
...@@ -1091,19 +1091,6 @@ union audio_cea_channels { ...@@ -1091,19 +1091,6 @@ union audio_cea_channels {
} channels; } channels;
}; };
struct audio_clock_info {
/* pixel clock frequency*/
uint32_t pixel_clock_in_10khz;
/* N - 32KHz audio */
uint32_t n_32khz;
/* CTS - 32KHz audio*/
uint32_t cts_32khz;
uint32_t n_44khz;
uint32_t cts_44khz;
uint32_t n_48khz;
uint32_t cts_48khz;
};
/* 25.2MHz/1.001*/ /* 25.2MHz/1.001*/
/* 25.2MHz/1.001*/ /* 25.2MHz/1.001*/
/* 25.2MHz*/ /* 25.2MHz*/
...@@ -1206,7 +1193,7 @@ static union audio_cea_channels speakers_to_channels( ...@@ -1206,7 +1193,7 @@ static union audio_cea_channels speakers_to_channels(
return cea_channels; return cea_channels;
} }
static void get_audio_clock_info( void get_audio_clock_info(
enum dc_color_depth color_depth, enum dc_color_depth color_depth,
uint32_t crtc_pixel_clock_in_khz, uint32_t crtc_pixel_clock_in_khz,
uint32_t actual_pixel_clock_in_khz, uint32_t actual_pixel_clock_in_khz,
...@@ -1410,7 +1397,7 @@ static void enc1_se_setup_dp_audio( ...@@ -1410,7 +1397,7 @@ static void enc1_se_setup_dp_audio(
REG_UPDATE(AFMT_60958_0, AFMT_60958_CS_CLOCK_ACCURACY, 0); REG_UPDATE(AFMT_60958_0, AFMT_60958_CS_CLOCK_ACCURACY, 0);
} }
static void enc1_se_enable_audio_clock( void enc1_se_enable_audio_clock(
struct stream_encoder *enc, struct stream_encoder *enc,
bool enable) bool enable)
{ {
...@@ -1432,7 +1419,7 @@ static void enc1_se_enable_audio_clock( ...@@ -1432,7 +1419,7 @@ static void enc1_se_enable_audio_clock(
*/ */
} }
static void enc1_se_enable_dp_audio( void enc1_se_enable_dp_audio(
struct stream_encoder *enc) struct stream_encoder *enc)
{ {
struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc); struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
......
...@@ -552,4 +552,21 @@ void enc1_dig_connect_to_otg( ...@@ -552,4 +552,21 @@ void enc1_dig_connect_to_otg(
struct stream_encoder *enc, struct stream_encoder *enc,
int tg_inst); int tg_inst);
void enc1_stream_encoder_set_stream_attribute_helper(
struct dcn10_stream_encoder *enc1,
struct dc_crtc_timing *crtc_timing);
void enc1_se_enable_audio_clock(
struct stream_encoder *enc,
bool enable);
void enc1_se_enable_dp_audio(
struct stream_encoder *enc);
void get_audio_clock_info(
enum dc_color_depth color_depth,
uint32_t crtc_pixel_clock_in_khz,
uint32_t actual_pixel_clock_in_khz,
struct audio_clock_info *audio_clock_info);
#endif /* __DC_STREAM_ENCODER_DCN10_H__ */ #endif /* __DC_STREAM_ENCODER_DCN10_H__ */
...@@ -52,6 +52,19 @@ enum dp_component_depth { ...@@ -52,6 +52,19 @@ enum dp_component_depth {
DP_COMPONENT_PIXEL_DEPTH_16BPC = 0x00000004 DP_COMPONENT_PIXEL_DEPTH_16BPC = 0x00000004
}; };
struct audio_clock_info {
/* pixel clock frequency*/
uint32_t pixel_clock_in_10khz;
/* N - 32KHz audio */
uint32_t n_32khz;
/* CTS - 32KHz audio*/
uint32_t cts_32khz;
uint32_t n_44khz;
uint32_t cts_44khz;
uint32_t n_48khz;
uint32_t cts_48khz;
};
struct encoder_info_frame { struct encoder_info_frame {
/* auxiliary video information */ /* auxiliary video information */
struct dc_info_packet avi; struct dc_info_packet avi;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment