DC Patches Feb 6, 2017
Subsystems (3)
cover DC Patches Feb 6, 2017
* Fix for some MST issues with hubs and HP docks
* Fix for crash with modesetting driver
* bunch of pixel format work in base DC
Charlene Liu (2):
drm/amd/display: Fix YCbCr pixel format shows green issue drm/amd/display: HDMI YCbCr422 12bpc pixel format issue
Harry Wentland (1):
drm/amd/display: fix crash with modesetting driver
Hersen Wu (1):
drm/amd/display: Clear test pattern when enabling stream
Krzysztof Nowicki (1):
drm/amd/display: Fix MST physical ports always disconnected
Vitaly Prosyak (1):
drm/amd/display: Adding 10 bpcc video P010 format
Yongqiang Sun (1):
drm/amd/display: Fixed color temperature corruption.
.../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 8 ---- .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 4 ++ .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c | 5 +++ drivers/gpu/drm/amd/display/dc/core/dc_link.c | 12 ++++- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 52 ++++++++++++---------- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 5 ++- .../gpu/drm/amd/display/dc/dce/dce_clock_source.c | 29 ++++++------ drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 32 ++++++++++--- .../drm/amd/display/dc/dce/dce_stream_encoder.c | 16 ++++--- .../drm/amd/display/dc/dce110/dce110_resource.c | 3 ++ drivers/gpu/drm/amd/display/dc/inc/clock_source.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/opp.h | 1 + 13 files changed, 109 insertions(+), 62 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): 20170207001812.6099-1-harry.wentland-5C7GfCeVMHo@public.gmane.org
PATCH 1/7 drm/amd/display: Clear test pattern when enabling stream
From: Hersen Wu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +5 -0
@@ -1846,6 +1846,11 @@ void core_link_enable_stream(struct pipe_ctx *pipe_ctx)return ; } +/* turn off otg test pattern if enable */ + pipe_ctx->tg->funcs->set_test_pattern (pipe_ctx->tg, +CONTROLLER_DP_TEST_PATTERN_VIDEOMODE , +COLOR_DEPTH_UNDEFINED ); + core_dc->hwss.enable_stream (pipe_ctx);if (pipe_ctx->stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST )
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/7 drm/amd/display: Fix YCbCr pixel format shows green issue
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +10 -6
@@ -1300,19 +1300,23 @@ static void set_avi_info_frame( info_frame.avi_info_packet.info_packet_hdmi.bits.S0_S1 = scan_type;/* C0, C1 : Colorimetry */ -if (color_space ==COLOR_SPACE_YCBCR709 ) +if (color_space ==COLOR_SPACE_YCBCR709 || + color_space ==COLOR_SPACE_YCBCR709_LIMITED ) info_frame.avi_info_packet.info_packet_hdmi.bits.C0_C1 =COLORIMETRY_ITU709 ; -else if (color_space ==COLOR_SPACE_YCBCR601 ) +else if (color_space ==COLOR_SPACE_YCBCR601 || + color_space ==COLOR_SPACE_YCBCR601_LIMITED ) info_frame.avi_info_packet.info_packet_hdmi.bits.C0_C1 =COLORIMETRY_ITU601 ; -else +else { +if (stream->public.timing.pixel_encoding !=PIXEL_ENCODING_RGB ) +BREAK_TO_DEBUGGER (); info_frame.avi_info_packet.info_packet_hdmi.bits.C0_C1 =COLORIMETRY_NO_DATA ; - + }if (color_space ==COLOR_SPACE_2020_RGB_FULLRANGE || - color_space ==COLOR_SPACE_2020_RGB_LIMITEDRANGE || - color_space ==COLOR_SPACE_2020_YCBCR ) { + color_space ==COLOR_SPACE_2020_RGB_LIMITEDRANGE || + color_space ==COLOR_SPACE_2020_YCBCR ) { info_frame.avi_info_packet.info_packet_hdmi.bits.EC0_EC2 =COLORIMETRYEX_BT2020RGBYCBCR ; info_frame.avi_info_packet.info_packet_hdmi.bits.C0_C1 =
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/7 drm/amd/display: HDMI YCbCr422 12bpc pixel format issue
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 7 ++++- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 30 ++++++++++---------- .../gpu/drm/amd/display/dc/dce/dce_clock_source.c | 29 ++++++++++---------- drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 32 +++++++++++++++++----- .../drm/amd/display/dc/dce/dce_stream_encoder.c | 16 +++++++---- .../drm/amd/display/dc/dce110/dce110_resource.c | 3 ++ drivers/gpu/drm/amd/display/dc/inc/clock_source.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/opp.h | 1 + 8 files changed, 76 insertions(+), 44 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +6 -1
@@ -1267,6 +1267,7 @@ static void enable_link_hdmi(struct pipe_ctx *pipe_ctx) {struct core_stream *stream = pipe_ctx->stream;struct core_link *link = stream->sink->link; +enum dc_color_depth display_color_depth;if (dc_is_hdmi_signal (pipe_ctx->stream->signal)) dal_ddc_service_write_scdc_data(
@@ -1277,10 +1278,14 @@ static void enable_link_hdmi(struct pipe_ctx *pipe_ctx)memset (&stream->sink->link->public.cur_link_settings,0 ,sizeof (struct dc_link_settings )); + display_color_depth = stream->public.timing.display_color_depth; +if (stream->public.timing.pixel_encoding ==PIXEL_ENCODING_YCBCR422 ) + display_color_depth =COLOR_DEPTH_888 ; + link->link_enc->funcs->enable_tmds_output ( link->link_enc, pipe_ctx->clock_source->id, - stream->public.timing.display_color_depth, + display_color_depth, pipe_ctx->stream->signal ==SIGNAL_TYPE_HDMI_TYPE_A , pipe_ctx->stream->signal ==SIGNAL_TYPE_DVI_DUAL_LINK , stream->phy_pix_clk);
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +15 -15
@@ -1045,25 +1045,25 @@ static int get_norm_pix_clk(const struct dc_crtc_timing *timing)if (timing->pixel_encoding ==PIXEL_ENCODING_YCBCR420 ) pix_clk /=2 ; - -switch (timing->display_color_depth) { -case COLOR_DEPTH_888 : - normalized_pix_clk = pix_clk; -break ; -case COLOR_DEPTH_101010 : - normalized_pix_clk = (pix_clk *30 ) /24 ; +if (timing->pixel_encoding !=PIXEL_ENCODING_YCBCR422 ) { +switch (timing->display_color_depth) { +case COLOR_DEPTH_888 : + normalized_pix_clk = pix_clk; +break ; +case COLOR_DEPTH_101010 : + normalized_pix_clk = (pix_clk *30 ) /24 ; +break ; +case COLOR_DEPTH_121212 : + normalized_pix_clk = (pix_clk *36 ) /24 ;break ; -case COLOR_DEPTH_121212 : - normalized_pix_clk = (pix_clk *36 ) /24 ; +case COLOR_DEPTH_161616 : + normalized_pix_clk = (pix_clk *48 ) /24 ;break ; -case COLOR_DEPTH_161616 : - normalized_pix_clk = (pix_clk *48 ) /24 ; -break ; -default : -ASSERT (0 ); +default : +ASSERT (0 );break ; + } } -return normalized_pix_clk; }
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +14 -15
@@ -390,25 +390,24 @@ static bool pll_adjust_pix_clk(struct bp_adjust_pixel_clock_parameters bp_adjust_pixel_clock_params = {0 };enum bp_result bp_result; -switch (pix_clk_params->signal_type) {case SIGNAL_TYPE_HDMI_TYPE_A : { requested_clk_khz = pix_clk_params->requested_pix_clk; - -switch (pix_clk_params->color_depth) { -case COLOR_DEPTH_101010 : - requested_clk_khz = (requested_clk_khz *5 ) >>2 ; -break ;/* x1.25*/ -case COLOR_DEPTH_121212 : - requested_clk_khz = (requested_clk_khz *6 ) >>2 ; -break ;/* x1.5*/ -case COLOR_DEPTH_161616 : - requested_clk_khz = requested_clk_khz *2 ; -break ;/* x2.0*/ -default : -break ; +if (pix_clk_params->pixel_encoding !=PIXEL_ENCODING_YCBCR422 ) { +switch (pix_clk_params->color_depth) { +case COLOR_DEPTH_101010 : + requested_clk_khz = (requested_clk_khz *5 ) >>2 ; +break ;/* x1.25*/ +case COLOR_DEPTH_121212 : + requested_clk_khz = (requested_clk_khz *6 ) >>2 ; +break ;/* x1.5*/ +case COLOR_DEPTH_161616 : + requested_clk_khz = requested_clk_khz *2 ; +break ;/* x2.0*/ +default : +break ; + } } - actual_pix_clk_khz = requested_clk_khz; }break ;
drivers/gpu/drm/amd/display/dc/dce/dce_opp.c +25 -7
@@ -366,19 +366,37 @@ static void set_truncation(FMT_TRUNCATE_EN ,0 ,FMT_TRUNCATE_DEPTH ,0 , FMT_TRUNCATE_MODE, 0); -/* no 10bpc trunc on DCE11*/ + + +if (params->pixel_encoding ==PIXEL_ENCODING_YCBCR422 ) { +/* 8bpc trunc on YCbCr422*/ +if (params->flags.TRUNCATE_DEPTH ==1 ) +REG_UPDATE_3 (FMT_BIT_DEPTH_CONTROL , +FMT_TRUNCATE_EN ,1 , +FMT_TRUNCATE_DEPTH ,1 , +FMT_TRUNCATE_MODE ,0 ); +else if (params->flags.TRUNCATE_DEPTH ==2 ) +/* 10bpc trunc on YCbCr422*/ +REG_UPDATE_3 (FMT_BIT_DEPTH_CONTROL , +FMT_TRUNCATE_EN ,1 , +FMT_TRUNCATE_DEPTH ,2 , +FMT_TRUNCATE_MODE ,0 ); +return ; + } +/* on other format-to do */ if (params->flags.TRUNCATE_ENABLED ==0 || - params->flags.TRUNCATE_DEPTH ==2 ) + params->flags.TRUNCATE_DEPTH ==2 )return ; -/*Set truncation depth and Enable truncation*/ REG_UPDATE_3 (FMT_BIT_DEPTH_CONTROL , -FMT_TRUNCATE_EN ,1 , -FMT_TRUNCATE_DEPTH , params->flags.TRUNCATE_MODE, -FMT_TRUNCATE_MODE , params->flags.TRUNCATE_DEPTH); - +FMT_TRUNCATE_EN ,1 , +FMT_TRUNCATE_DEPTH , + params->flags.TRUNCATE_MODE, +FMT_TRUNCATE_MODE , + params->flags.TRUNCATE_DEPTH); } +/** * set_spatial_dither * 1) set spatial dithering mode: pattern of seed
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +11 -5
@@ -367,14 +367,20 @@ static void dce110_stream_encoder_hdmi_set_stream_attribute( HDMI_DEEP_COLOR_ENABLE, 1);break ;case COLOR_DEPTH_121212 : -REG_UPDATE_2 (HDMI_CONTROL , -HDMI_DEEP_COLOR_DEPTH ,2 , -HDMI_DEEP_COLOR_ENABLE ,1 ); +if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_YCBCR422 ) { +REG_UPDATE_2 (HDMI_CONTROL , +HDMI_DEEP_COLOR_DEPTH ,2 , +HDMI_DEEP_COLOR_ENABLE ,0 ); + }else { +REG_UPDATE_2 (HDMI_CONTROL , +HDMI_DEEP_COLOR_DEPTH ,2 , +HDMI_DEEP_COLOR_ENABLE ,1 ); + }break ;case COLOR_DEPTH_161616 :REG_UPDATE_2 (HDMI_CONTROL , -HDMI_DEEP_COLOR_DEPTH ,3 , -HDMI_DEEP_COLOR_ENABLE ,1 ); +HDMI_DEEP_COLOR_DEPTH ,3 , +HDMI_DEEP_COLOR_ENABLE ,1 );break ;default :break ;
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +3 -0
@@ -814,6 +814,9 @@ void dce110_resource_build_bit_depth_reduction_params( fmt_bit_depth->flags.HIGHPASS_RANDOM =1 ; fmt_bit_depth->flags.TRUNCATE_ENABLED =1 ; fmt_bit_depth->flags.TRUNCATE_DEPTH =2 ; + + fmt_bit_depth->pixel_encoding = + stream->public.timing.pixel_encoding; }return ;
drivers/gpu/drm/amd/display/dc/inc/clock_source.h +1 -1
@@ -94,7 +94,7 @@ struct pixel_clk_params {enum dc_color_depth color_depth;struct csdp_ref_clk_ds_params de_spread_params;/*> de-spread info, relevant only for on-the-fly tune-up pixel rate*/ - +enum dc_pixel_encoding pixel_encoding;struct pixel_clk_flags flags; };
drivers/gpu/drm/amd/display/dc/inc/hw/opp.h +1 -0
@@ -86,6 +86,7 @@ struct bit_depth_reduction_params {uint32_t r_seed_value;uint32_t b_seed_value;uint32_t g_seed_value; +enum dc_pixel_encoding pixel_encoding; };enum wide_gamut_regamma_mode {
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/7 drm/amd/display: Adding 10 bpcc video P010 format
In reply to a message not in the archiveFrom: Vitaly Prosyak <[email protected]>
--- drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c | 5 +++++ drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 6 ++++-- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +5 -0
@@ -2534,6 +2534,8 @@ static void populate_initial_data(case SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010 :case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010 :case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010_XR_BIAS : +case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCbCr: +case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCrCb: data->bytes_per_pixel[num_displays +4 ] =4 ;break ;case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 :
@@ -2621,6 +2623,7 @@ static void populate_initial_data( }switch (pipe[i].surface->public.format) {case SURFACE_PIXEL_FORMAT_VIDEO_420_YCbCr: +case SURFACE_PIXEL_FORMAT_VIDEO_420_YCrCb:case SURFACE_PIXEL_FORMAT_GRPH_ARGB1555 :case SURFACE_PIXEL_FORMAT_GRPH_RGB565 : data->bytes_per_pixel[num_displays +4 ] =2 ;
@@ -2630,6 +2633,8 @@ static void populate_initial_data(case SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010 :case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010 :case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010_XR_BIAS : +case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCbCr: +case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCrCb: data->bytes_per_pixel[num_displays +4 ] =4 ;break ;case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 :
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +4 -2
@@ -358,11 +358,13 @@ static enum pixel_format convert_pixel_format_to_dalsurface( dal_pixel_format =PIXEL_FORMAT_FP16 ;break ;case SURFACE_PIXEL_FORMAT_VIDEO_420_YCbCr: - dal_pixel_format =PIXEL_FORMAT_420BPP12 ; -break ;case SURFACE_PIXEL_FORMAT_VIDEO_420_YCrCb: dal_pixel_format =PIXEL_FORMAT_420BPP12 ;break ; +case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCbCr: +case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCrCb: + dal_pixel_format =PIXEL_FORMAT_420BPP15 ; +break ;case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 :default : dal_pixel_format =PIXEL_FORMAT_UNKNOWN ;
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +4 -1
@@ -195,6 +195,8 @@ enum surface_pixel_format { SURFACE_PIXEL_FORMAT_VIDEO_420_YCbCr =SURFACE_PIXEL_FORMAT_VIDEO_BEGIN , SURFACE_PIXEL_FORMAT_VIDEO_420_YCrCb, + SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCbCr, + SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCrCb,SURFACE_PIXEL_FORMAT_INVALID /*grow 444 video here if necessary */
@@ -212,13 +214,14 @@ enum pixel_format {PIXEL_FORMAT_FP16 ,/*video*/ PIXEL_FORMAT_420BPP12 , +PIXEL_FORMAT_420BPP15 ,/*end of pixel format definition*/ PIXEL_FORMAT_INVALID ,PIXEL_FORMAT_GRPH_BEGIN =PIXEL_FORMAT_INDEX8 ,PIXEL_FORMAT_GRPH_END =PIXEL_FORMAT_FP16 ,PIXEL_FORMAT_VIDEO_BEGIN =PIXEL_FORMAT_420BPP12 , -PIXEL_FORMAT_VIDEO_END =PIXEL_FORMAT_420BPP12 , +PIXEL_FORMAT_VIDEO_END =PIXEL_FORMAT_420BPP15 ,PIXEL_FORMAT_UNKNOWN };
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/7 drm/amd/display: Fixed color temperature corruption.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h +1 -1
@@ -65,7 +65,7 @@ struct pwl_result_data { };struct pwl_params { -struct gamma_curve arr_curve_points[16 ]; +struct gamma_curve arr_curve_points[34 ];struct curve_points arr_points[3 ];struct pwl_result_data rgb_resulted[256 +3 ];uint32_t hw_points_num;
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/7 drm/amd/display: fix crash with modesetting driver
In reply to a message not in the archiveThey might call commit with ACTION_NOTHING without a mode. We shouldn't crash but simply skip updating stream scaling settings since scaling obviously didn't change without a provided mode.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c +4 -0
@@ -644,6 +644,10 @@ static void update_stream_scaling_settings(struct rect src = {0 };/* viewport in composition space*/ struct rect dst = {0 };/* stream addressable area */ +/* no mode. nothing to be done */ +if (!mode) +return ; +/* Full screen scaling by default */ src.width = mode->hdisplay; src.height = mode->vdisplay;
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/7 drm/amd/display: Fix MST physical ports always disconnected
In reply to a message not in the archiveFrom: Krzysztof Nowicki <[email protected]>
Remove a false assumption that a cached EDID will be present whenever the connector is in a connected state as this will only be true for logical MST ports. For physical ports the EDID will never be cached, which will cause them to always appear as disconnected.
This reverts commit 4ff8a88888de271bfb7750b2a5c68163848e2bf1
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +0 -8
@@ -127,14 +127,6 @@ dm_dp_mst_detect(struct drm_connector *connector, bool force) &master->mst_mgr, aconnector->port); -/* -* we do not want to make this connector connected until we have edid on -* it -*/ -if (status == connector_status_connected && - !aconnector->port->cached_edid) - status = connector_status_disconnected; -return status; }
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx