DC Patches Feb 22, 2017
Subsystems (3)
cover DC Patches Feb 22, 2017
* Bunch of color work on common code paths
* Update audio clocks
* Bunch of fixes
* Some minor cleanup
Amy Zhang (1):
drm/amd/display: Add bypass case for PQ transfer function
Charlene Liu (3):
drm/amd/display: audio bug fix part 1: Add missing audio ACR drm/amd/display: fix 12bpc truncate to 10bpc drm/amd/display: fix incorrect programming for YCbCr422 and YCbCr420
Harry Wentland (1):
drm/amd/display: Remove LINUX_VERSION_CODE check
Ken Chalmers (1):
drm/amd/display: fix dc_commit_surfaces_to_stream for dcc
Zeyu Fan (2):
drm/amd/display: Add query_ddc_data function drm/amd/display: Fix error where wrong payload size is given.
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 - drivers/gpu/drm/amd/display/dc/core/dc.c | 26 ++++++ drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dc.h | 13 ++- drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 8 +- drivers/gpu/drm/amd/display/dc/dce/dce_audio.h | 2 + .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 2 + drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 18 ++--- .../drm/amd/display/dc/dce/dce_stream_encoder.c | 93 +++++++++++++++------- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 53 +++++++++--- .../drm/amd/display/dc/dce110/dce110_resource.c | 4 + 12 files changed, 169 insertions(+), 56 deletions(-)
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): 20170223163343.7476-1-harry.wentland-5C7GfCeVMHo@public.gmane.org
PATCH 1/8 drm/amd/display: Remove LINUX_VERSION_CODE check
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
@@ -892,14 +892,12 @@ static void dm_handle_hpd_rx_irq(struct amdgpu_connector *aconnector) process_count++;DRM_DEBUG_KMS ("ESI %02x %02x %02x\n" , esi[0 ], esi[1 ], esi[2 ]); -#if LINUX_VERSION_CODE >=KERNEL_VERSION (4 ,3 ,0 )/* handle HPD short pulse irq */ if (aconnector->mst_mgr.mst_state)drm_dp_mst_hpd_irq ( &aconnector->mst_mgr, esi, &new_irq_handled); -#endif if (new_irq_handled) {/* ACK at DPCD to notify down stream */
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/8 drm/amd/display: fix dc_commit_surfaces_to_stream for dcc
In reply to a message not in the archiveFrom: Ken Chalmers <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
@@ -1246,6 +1246,7 @@ bool dc_commit_surfaces_to_stream( plane_info[i].stereo_format = new_surfaces[i]->stereo_format; plane_info[i].tiling_info = new_surfaces[i]->tiling_info; plane_info[i].visible = new_surfaces[i]->visible; + plane_info[i].dcc = new_surfaces[i]->dcc; scaling_info[i].scaling_quality = new_surfaces[i]->scaling_quality; scaling_info[i].src_rect = new_surfaces[i]->src_rect; scaling_info[i].dst_rect = new_surfaces[i]->dst_rect;
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/8 drm/amd/display: Add bypass case for PQ transfer function
In reply to a message not in the archiveFrom: Amy Zhang <[email protected]>
- Source and destination color space should be the same for app control case
- Bypass degamma, regamma, and gamut remap
- Add hdr supported check for info frame
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dc.h | 2 ++ drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
@@ -1675,7 +1675,7 @@ static void set_hdr_static_info_packet( hdr_metadata = surface->public.hdr_static_ctx; -if (!hdr_metadata.is_hdr) +if (!hdr_metadata.hdr_supported)return ;if (dc_is_hdmi_signal (signal)) {
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -186,6 +186,7 @@ enum { };struct dc_hdr_static_metadata { +bool hdr_supported;bool is_hdr;/* display chromaticities and white point in units of 0.00001 */
@@ -207,6 +208,7 @@ struct dc_hdr_static_metadata {enum dc_transfer_func_type {TF_TYPE_PREDEFINED ,TF_TYPE_DISTRIBUTED_POINTS , +TF_TYPE_BYPASS };struct dc_transfer_func_distributed_points {
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +4 -1
@@ -279,6 +279,8 @@ static bool dce110_set_input_transfer_func( result = false;break ; } + }else if (tf->public.type ==TF_TYPE_BYPASS ) { + ipp->funcs->ipp_set_degamma (ipp,IPP_DEGAMMA_MODE_BYPASS ); }else {/*TF_TYPE_DISTRIBUTED_POINTS - Not supported in DCE 11*/ result = false;
@@ -428,7 +430,8 @@ static bool dce110_translate_regamma_to_hw_format(const struct dc_transfer_funcint32_t segment_start, segment_end;uint32_t i, j, k, seg_distr[16 ], increment, start_index, hw_points; -if (output_tf ==NULL || regamma_params ==NULL ) +if (output_tf ==NULL || regamma_params ==NULL || + output_tf->type ==TF_TYPE_BYPASS )return false; arr_points = regamma_params->arr_points;
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/8 drm/amd/display: Add query_ddc_data function
In reply to a message not in the archiveFrom: Zeyu Fan <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 25 +++++++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 11 ++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +25 -0
@@ -1725,6 +1725,31 @@ bool dc_read_dpcd(return r ==DDC_RESULT_SUCESSFULL ; } +bool dc_query_ddc_data ( +struct dc *dc, +uint32_t link_index, +uint32_t address, +uint8_t *write_buf, +uint32_t write_size, +uint8_t *read_buf, +uint32_t read_size) { + +struct core_dc *core_dc =DC_TO_CORE (dc); + +struct core_link *link = core_dc->links[link_index]; + +bool result =dal_ddc_service_query_ddc_data ( + link->ddc, + address, + write_buf, + write_size, + read_buf, + read_size); + +return result; +} + + bool dc_write_dpcd( struct dc *dc, uint32_t link_index,
drivers/gpu/drm/amd/display/dc/dc.h +10 -1
@@ -720,7 +720,16 @@ bool dc_write_dpcd(uint32_t link_index, uint32_t address, const uint8_t *data, - uint32_t size); + uint32_t size); + +bool dc_query_ddc_data ( +struct dc *dc, +uint32_t link_index, +uint32_t address, +uint8_t *write_buf, +uint32_t write_size, +uint8_t *read_buf, +uint32_t read_size); bool dc_submit_i2c( struct dc *dc,
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/8 drm/amd/display: Fix error where wrong payload size is given.
In reply to a message not in the archiveFrom: Zeyu Fan <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +1 -1
@@ -198,7 +198,7 @@ struct aux_payloads *dal_ddc_aux_payloads_create(struct dc_context *ctx, uint32_return NULL ;if (dal_vector_construct ( - &payloads->payloads, ctx, count,sizeof (struct aux_payloads ))) + &payloads->payloads, ctx, count,sizeof (struct aux_payload )))return payloads;dm_free (payloads);
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/8 drm/amd/display: audio bug fix part 1: Add missing audio ACR
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 8 +-- drivers/gpu/drm/amd/display/dc/dce/dce_audio.h | 2 + .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 2 + .../drm/amd/display/dc/dce/dce_stream_encoder.c | 81 +++++++++++++++------- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 31 +++++++++ .../drm/amd/display/dc/dce110/dce110_resource.c | 1 + 6 files changed, 95 insertions(+), 30 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +3 -5
@@ -828,11 +828,9 @@ void dce_aud_wall_dto_setup(REG_UPDATE (DCCG_AUDIO_DTO1_PHASE ,DCCG_AUDIO_DTO1_PHASE , clock_info.audio_dto_phase); -/* DAL2 code separate DCCG_AUDIO_DTO_SEL and -DCCG_AUDIO_DTO2_USE_512FBR_DTO programming into two different -location. merge together should not hurt */ -/*value.bits.DCCG_AUDIO_DTO2_USE_512FBR_DTO = 1; -dal_write_reg(mmDCCG_AUDIO_DTO_SOURCE, value);*/ +REG_UPDATE (DCCG_AUDIO_DTO_SOURCE , +DCCG_AUDIO_DTO2_USE_512FBR_DTO ,1 ); + } }
drivers/gpu/drm/amd/display/dc/dce/dce_audio.h +2 -0
@@ -93,6 +93,7 @@ struct dce_audio_shift {uint8_t DCCG_AUDIO_DTO0_PHASE ;uint8_t DCCG_AUDIO_DTO1_MODULE ;uint8_t DCCG_AUDIO_DTO1_PHASE ; +uint8_t DCCG_AUDIO_DTO2_USE_512FBR_DTO ; };struct dce_aduio_mask {
@@ -109,6 +110,7 @@ struct dce_aduio_mask {uint32_t DCCG_AUDIO_DTO0_PHASE ;uint32_t DCCG_AUDIO_DTO1_MODULE ;uint32_t DCCG_AUDIO_DTO1_PHASE ; +uint32_t DCCG_AUDIO_DTO2_USE_512FBR_DTO ; };struct dce_audio {
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +2 -0
@@ -871,6 +871,8 @@ static bool dce110_link_encoder_validate_hdmi_output(if (max_deep_color < crtc_timing->display_color_depth)return false; +if (crtc_timing->display_color_depth <COLOR_DEPTH_888 ) +return false;if (adjusted_pix_clk_khz <TMDS_MIN_PIXEL_CLOCK )return false;
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +56 -25
106 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +31 -0
@@ -868,6 +868,37 @@ static void build_audio_output( audio_output->crtc_info.calculated_pixel_clock = pipe_ctx->pix_clk_params.requested_pix_clk; +/*for HDMI, audio ACR is with deep color ratio factor*/ +if (dc_is_hdmi_signal (pipe_ctx->stream->signal) && + audio_output->crtc_info.requested_pixel_clock == + stream->public.timing.pix_clk_khz) { +if (pipe_ctx->pix_clk_params.pixel_encoding ==PIXEL_ENCODING_YCBCR420 ) { + audio_output->crtc_info.requested_pixel_clock = + audio_output->crtc_info.requested_pixel_clock/2 ; + audio_output->crtc_info.calculated_pixel_clock = + pipe_ctx->pix_clk_params.requested_pix_clk/2 ; + } + +if (pipe_ctx->pix_clk_params.pixel_encoding !=PIXEL_ENCODING_YCBCR422 ) { +switch (pipe_ctx->pix_clk_params.color_depth) { +case COLOR_DEPTH_888 : +break ; +case COLOR_DEPTH_101010 : + audio_output->crtc_info.calculated_pixel_clock = (audio_output->crtc_info.calculated_pixel_clock *30 ) /24 ; +break ; +case COLOR_DEPTH_121212 : + audio_output->crtc_info.calculated_pixel_clock = (audio_output->crtc_info.calculated_pixel_clock *36 ) /24 ; +break ; +case COLOR_DEPTH_161616 : + audio_output->crtc_info.calculated_pixel_clock = (audio_output->crtc_info.calculated_pixel_clock *48 ) /24 ; +break ; +default : +ASSERT (0 ); +break ; + } + } + } +if (pipe_ctx->stream->signal ==SIGNAL_TYPE_DISPLAY_PORT || pipe_ctx->stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) { audio_output->pll_info.dp_dto_source_clock_in_khz =
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +1 -0
@@ -776,6 +776,7 @@ static void get_pixel_clock_parameters( pixel_clk_params->flags.DISPLAY_BLANKED =1 ; pixel_clk_params->flags.SUPPORT_YCBCR420 = (stream->public.timing.pixel_encoding ==PIXEL_ENCODING_YCBCR420 ); + pixel_clk_params->pixel_encoding = stream->public.timing.pixel_encoding; } void dce110_resource_build_bit_depth_reduction_params(
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/8 drm/amd/display: fix 12bpc truncate to 10bpc
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_opp.c +9 -9
@@ -710,32 +710,32 @@ void dce110_opp_set_dyn_expansion( enum signal_type signal) {struct dce110_opp *opp110 =TO_DCE110_OPP (opp); -bool enable_dyn_exp = false;REG_UPDATE_2 (FMT_DYNAMIC_EXP_CNTL ,FMT_DYNAMIC_EXP_EN ,0 ,FMT_DYNAMIC_EXP_MODE ,0 ); -/* From HW programming guide: -FMT_DYNAMIC_EXP_EN = 0 for limited RGB or YCbCr output -FMT_DYNAMIC_EXP_EN = 1 for RGB full range only*/ -if (color_sp ==COLOR_SPACE_SRGB ) - enable_dyn_exp = true;/*00 - 10-bit -> 12-bit dynamic expansion*/ /*01 - 8-bit -> 12-bit dynamic expansion*/ -if (signal ==SIGNAL_TYPE_HDMI_TYPE_A ) { +if (signal ==SIGNAL_TYPE_HDMI_TYPE_A || + signal ==SIGNAL_TYPE_DISPLAY_PORT || + signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) {switch (color_dpth) {case COLOR_DEPTH_888 :REG_UPDATE_2 (FMT_DYNAMIC_EXP_CNTL , -FMT_DYNAMIC_EXP_EN , enable_dyn_exp ?1 :0 , +FMT_DYNAMIC_EXP_EN ,1 ,FMT_DYNAMIC_EXP_MODE ,1 );break ;case COLOR_DEPTH_101010 :REG_UPDATE_2 (FMT_DYNAMIC_EXP_CNTL , -FMT_DYNAMIC_EXP_EN , enable_dyn_exp ?1 :0 , +FMT_DYNAMIC_EXP_EN ,1 ,FMT_DYNAMIC_EXP_MODE ,0 );break ;case COLOR_DEPTH_121212 : +REG_UPDATE_2 ( +FMT_DYNAMIC_EXP_CNTL , +FMT_DYNAMIC_EXP_EN ,1 ,/*otherwise last two bits are zero*/ +FMT_DYNAMIC_EXP_MODE ,0 );break ;default :break ;
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/8 drm/amd/display: fix incorrect programming for YCbCr422 and YCbCr420
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c | 12 +++++++++--- .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 17 +++++++++-------- drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 3 +++ 3 files changed, 21 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +9 -3
@@ -362,9 +362,15 @@ static void dce110_stream_encoder_hdmi_set_stream_attribute(REG_UPDATE (HDMI_CONTROL ,HDMI_DEEP_COLOR_DEPTH ,0 );break ;case COLOR_DEPTH_101010 : -REG_UPDATE_2 (HDMI_CONTROL , -HDMI_DEEP_COLOR_DEPTH ,1 , -HDMI_DEEP_COLOR_ENABLE ,1 ); +if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_YCBCR422 ) { +REG_UPDATE_2 (HDMI_CONTROL , +HDMI_DEEP_COLOR_DEPTH ,1 , +HDMI_DEEP_COLOR_ENABLE ,0 ); + }else { +REG_UPDATE_2 (HDMI_CONTROL , +HDMI_DEEP_COLOR_DEPTH ,1 , +HDMI_DEEP_COLOR_ENABLE ,1 ); + }break ;case COLOR_DEPTH_121212 :if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_YCBCR422 ) {
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +9 -8
@@ -861,10 +861,6 @@ static void build_audio_output( audio_output->crtc_info.requested_pixel_clock = pipe_ctx->pix_clk_params.requested_pix_clk; -/* -* TODO - Investigate why calculated pixel clk has to be -* requested pixel clk -*/ audio_output->crtc_info.calculated_pixel_clock = pipe_ctx->pix_clk_params.requested_pix_clk;
@@ -1044,15 +1040,14 @@ static enum dc_status apply_single_controller_ctx_to_hw( stream->public.timing.display_color_depth, pipe_ctx->stream->signal); +/* FPGA does not program backend */ +if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { pipe_ctx->opp->funcs->opp_program_fmt ( pipe_ctx->opp, &stream->bit_depth_params, &stream->clamping); - -/* FPGA does not program backend */ -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment))return DC_OK ; - + }/* TODO: move to stream encoder */ if (pipe_ctx->stream->signal !=SIGNAL_TYPE_VIRTUAL )if (DC_OK !=bios_parser_crtc_source_select (pipe_ctx)) {
@@ -1065,6 +1060,12 @@ static enum dc_status apply_single_controller_ctx_to_hw( stream->sink->link->link_enc, pipe_ctx->stream->signal); +/*vbios crtc_source_selection and encoder_setup will override fmt_C*/ + pipe_ctx->opp->funcs->opp_program_fmt ( + pipe_ctx->opp, + &stream->bit_depth_params, + &stream->clamping); +if (dc_is_dp_signal (pipe_ctx->stream->signal)) pipe_ctx->stream_enc->funcs->dp_set_stream_attribute( pipe_ctx->stream_enc,
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +3 -0
@@ -777,6 +777,9 @@ static void get_pixel_clock_parameters( pixel_clk_params->flags.SUPPORT_YCBCR420 = (stream->public.timing.pixel_encoding ==PIXEL_ENCODING_YCBCR420 ); pixel_clk_params->pixel_encoding = stream->public.timing.pixel_encoding; +if (stream->public.timing.pixel_encoding ==PIXEL_ENCODING_YCBCR422 ) { + pixel_clk_params->color_depth =COLOR_DEPTH_888 ; + } } void dce110_resource_build_bit_depth_reduction_params(
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx