DC Patches Jul 12, 2018
Subsystems (3)
cover DC Patches Jul 12, 2018
From: "Leo (Sunpeng) Li" <[email protected]>
Summary of change:
* HDR debugging features
* Small bug fixes and minor cleanups
Gloria Li (1):
drm/amd/display: add HDR visual confirm
Harry Wentland (2):
drm/amd/display: dal 3.1.56
drm/amd/display: Fix some checkpatch.pl errors and warnings in
dc_link_dp.c
Jun Lei (1):
drm/amd/display: add new dc debug structure to track debug data
Krunoslav Kovac (3):
drm/amd/display: Refactor SDR cursor boosting in HDR mode drm/amd/display: Handle HDR meta update as fast update drm/amd/display: Null ptr check for set_sdr_white_level
Nikola Cornij (1):
drm/amd/display: Add hook for MST root branch info
Tony Cheng (1):
drm/amd/display: Move address tracking out of HUBP
Vitaly Prosyak (1):
drm/amd/display: Add headers for hardcoded 1d luts.
.../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 ++ drivers/gpu/drm/amd/display/dc/core/dc.c | 14 +-- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 + drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 38 +++++---- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 + drivers/gpu/drm/amd/display/dc/dc.h | 18 +++- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 5 ++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 + drivers/gpu/drm/amd/display/dc/dce/dce_transform.c | 2 +- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 2 +- .../drm/amd/display/dc/dce110/dce110_transform_v.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 13 +++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 14 ++- .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 7 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 19 ----- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 12 +-- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 99 ++++++++++++++++++++-- drivers/gpu/drm/amd/display/dc/dm_helpers.h | 8 ++ drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 3 + drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 1 - drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 1 + .../gpu/drm/amd/display/modules/color/luts_1d.h | 51 +++++++++++ 22 files changed, 251 insertions(+), 71 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/modules/color/luts_1d.h
Signature · 6 lines
2.7.4 _______________________________________________ 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): 1531419460-2912-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org
PATCH 1/10 drm/amd/display: Add headers for hardcoded 1d luts.
From: Vitaly Prosyak <[email protected]>
Hard-coded luts are needed since complex algorithms are used for color and tone mapping. Add the headers for future use.
--- .../gpu/drm/amd/display/modules/color/luts_1d.h | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 drivers/gpu/drm/amd/display/modules/color/luts_1d.h
drivers/gpu/drm/amd/display/modules/color/luts_1d.h new file +51 -0
@@ -0,0 +1,51 @@ +/* +* Copyright 2016 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Authors: AMD +* +*/ +#ifndef LUTS_1D_H +#define LUTS_1D_H + +#include "hw_shared.h" + +struct point_config { +uint32_t custom_float_x; +uint32_t custom_float_y; +uint32_t custom_float_slope; +}; + +struct lut_point { +uint32_t red; +uint32_t green; +uint32_t blue; +uint32_t delta_red; +uint32_t delta_green; +uint32_t delta_blue; +}; + +struct pwl_1dlut_parameter { +struct gamma_curve arr_curve_points[34 ]; +struct point_config arr_points[2 ]; +struct lut_point rgb_resulted[256 ]; +uint32_t hw_points_num; +}; +#endif // LUTS_1D_H
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/10 drm/amd/display: Refactor SDR cursor boosting in HDR mode
In reply to a message not in the archiveFrom: Krunoslav Kovac <[email protected]>
[Why]
Cursor boosting is done via CNVC_CUR register which is DPP, not HUBP Previous commit was implementing it in HUBP functions, and also breaking diags tests.
[How]
1. Undo original commit as well as Eric's diags test fix, almost completely
2. Move programming to DPP and call via new dc_stream function
3. Also removing cur_rom_en from dpp_cursor_attributes and programming as part of normal cursor attributes as it depends on cursor color format
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 1 + drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 5 ++++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 ++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 13 ++++++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 14 ++++++++-- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 15 ----------- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 12 +++------ .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 30 +++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 3 +++ drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 1 + 10 files changed, 70 insertions(+), 26 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +1 -0
@@ -214,6 +214,7 @@ bool dc_stream_set_cursor_attributes( } core_dc->hwss.set_cursor_attribute (pipe_ctx); + core_dc->hwss.set_cursor_sdr_white_level (pipe_ctx); }if (pipe_to_program)
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +5 -0
@@ -500,6 +500,11 @@ struct dc_cursor_attributes {union dc_cursor_attribute_flags attribute_flags; }; +struct dpp_cursor_attributes { +int bias; +int scale; +}; +/* OPP */ enum dc_color_space {
drivers/gpu/drm/amd/display/dc/dc_stream.h +2 -0
@@ -107,6 +107,7 @@ struct dc_stream_state {struct dc_cursor_attributes cursor_attributes;struct dc_cursor_position cursor_position; +uint32_t sdr_white_level;// for boosting (SDR) cursor in HDR mode /* from stream struct */ struct kref refcount;
@@ -267,6 +268,7 @@ bool dc_stream_set_cursor_position(struct dc_stream_state *stream, const struct dc_cursor_position *position); +bool dc_stream_adjust_vmin_vmax (struct dc *dc,struct dc_stream_state *stream,struct dc_crtc_timing_adjust *adjust);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +13 -0
@@ -459,6 +459,18 @@ void dpp1_set_cursor_position( } +void dpp1_cnv_set_optional_cursor_attributes ( +struct dpp *dpp_base, +struct dpp_cursor_attributes *attr) +{ +struct dcn10_dpp *dpp =TO_DCN10_DPP (dpp_base); + +if (attr) { +REG_UPDATE (CURSOR0_FP_SCALE_BIAS ,CUR0_FP_BIAS , attr->bias); +REG_UPDATE (CURSOR0_FP_SCALE_BIAS ,CUR0_FP_SCALE , attr->scale); + } +} + void dpp1_dppclk_control( struct dpp *dpp_base, bool dppclk_div,
@@ -499,6 +511,7 @@ static const struct dpp_funcs dcn10_dpp_funcs = { .dpp_full_bypass = dpp1_full_bypass, .set_cursor_attributes = dpp1_set_cursor_attributes, .set_cursor_position = dpp1_set_cursor_position, + .set_optional_cursor_attributes = dpp1_cnv_set_optional_cursor_attributes, .dpp_dppclk_control = dpp1_dppclk_control, .dpp_set_hdr_multiplier = dpp1_set_hdr_multiplier, };
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +12 -2
@@ -119,6 +119,7 @@SRI (CURSOR0_CONTROL ,CNVC_CUR , id), \SRI (CURSOR0_COLOR0 ,CNVC_CUR , id), \SRI (CURSOR0_COLOR1 ,CNVC_CUR , id), \ +SRI (CURSOR0_FP_SCALE_BIAS ,CNVC_CUR , id), \SRI (DPP_CONTROL ,DPP_TOP , id), \SRI (CM_HDR_MULT_COEF ,CM , id)
@@ -324,6 +325,8 @@TF_SF (CNVC_CUR0_CURSOR0_CONTROL ,CUR0_ENABLE , mask_sh), \TF_SF (CNVC_CUR0_CURSOR0_COLOR0 ,CUR0_COLOR0 , mask_sh), \TF_SF (CNVC_CUR0_CURSOR0_COLOR1 ,CUR0_COLOR1 , mask_sh), \ +TF_SF (CNVC_CUR0_CURSOR0_FP_SCALE_BIAS ,CUR0_FP_BIAS , mask_sh), \ +TF_SF (CNVC_CUR0_CURSOR0_FP_SCALE_BIAS ,CUR0_FP_SCALE , mask_sh), \TF_SF (DPP_TOP0_DPP_CONTROL ,DPP_CLOCK_ENABLE , mask_sh), \TF_SF (CM0_CM_HDR_MULT_COEF ,CM_HDR_MULT_COEF , mask_sh)
@@ -1076,7 +1079,9 @@type CUR0_COLOR1 ; \type DPPCLK_RATE_CONTROL ; \type DPP_CLOCK_ENABLE ; \ -type CM_HDR_MULT_COEF ; +type CM_HDR_MULT_COEF ; \ +type CUR0_FP_BIAS ; \ +type CUR0_FP_SCALE ;struct dcn_dpp_shift {TF_REG_FIELD_LIST (uint8_t )
@@ -1329,7 +1334,8 @@ struct dcn_dpp_mask {uint32_t CURSOR0_COLOR0 ; \uint32_t CURSOR0_COLOR1 ; \uint32_t DPP_CONTROL ; \ -uint32_t CM_HDR_MULT_COEF ; +uint32_t CM_HDR_MULT_COEF ; \ +uint32_t CURSOR0_FP_SCALE_BIAS ;struct dcn_dpp_registers {DPP_COMMON_REG_VARIABLE_LIST
@@ -1370,6 +1376,10 @@ void dpp1_set_cursor_position(const struct dc_cursor_mi_param *param, uint32_t width); +void dpp1_cnv_set_optional_cursor_attributes ( +struct dpp *dpp_base, +struct dpp_cursor_attributes *attr); + bool dpp1_dscl_is_lb_conf_valid( int ceil_vratio, int num_partitions,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +0 -15
@@ -27,7 +27,6 @@#include "reg_helper.h" #include "basics/conversion.h" #include "dcn10_hubp.h" -#include "custom_float.h" #define REG (reg)\ hubp1->hubp_regs->reg
@@ -1053,18 +1052,6 @@ void hubp1_cursor_set_attributes(enum cursor_pitch hw_pitch =hubp1_get_cursor_pitch (attr->pitch);enum cursor_lines_per_chunk lpc =hubp1_get_lines_per_chunk ( attr->width, attr->color_format); -struct fixed31_32 multiplier; -uint32_t hw_mult =0x3c00 ;// 1.0 default multiplier -struct custom_float_format fmt; - - fmt.exponenta_bits =5 ; - fmt.mantissa_bits =10 ; - fmt.sign = true; - -if (attr->sdr_white_level >80 ) { - multiplier =dc_fixpt_from_fraction (attr->sdr_white_level,80 ); -convert_to_custom_float_format (multiplier, &fmt, &hw_mult); - } hubp->curs_attr = *attr;
@@ -1087,8 +1074,6 @@ void hubp1_cursor_set_attributes(CURSOR0_DST_Y_OFFSET ,0 ,/* used to shift the cursor chunk request deadline */ CURSOR0_CHUNK_HDL_ADJUST, 3); - -REG_UPDATE (CURSOR0_FP_SCALE_BIAS ,CUR0_FP_SCALE , hw_mult); } void hubp1_cursor_set_position(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h +4 -8
@@ -133,8 +133,7 @@SRI (CURSOR_CONTROL ,CURSOR , id), \SRI (CURSOR_POSITION ,CURSOR , id), \SRI (CURSOR_HOT_SPOT ,CURSOR , id), \ -SRI (CURSOR_DST_OFFSET ,CURSOR , id), \ - SRI(CURSOR0_FP_SCALE_BIAS, CNVC_CUR, id) + SRI(CURSOR_DST_OFFSET, CURSOR, id)#define HUBP_COMMON_REG_VARIABLE_LIST \ uint32_t DCHUBP_CNTL; \
@@ -242,8 +241,7 @@uint32_t CURSOR_POSITION ; \uint32_t CURSOR_HOT_SPOT ; \uint32_t CURSOR_DST_OFFSET ; \ -uint32_t HUBP_CLK_CNTL ; \ - uint32_t CURSOR0_FP_SCALE_BIAS + uint32_t HUBP_CLK_CNTL#define HUBP_SF (reg_name, field_name, post_fix)\ .field_name = reg_name ## __ ## field_name ## post_fix
@@ -428,8 +426,7 @@HUBP_SF (CURSOR0_CURSOR_POSITION ,CURSOR_Y_POSITION , mask_sh), \HUBP_SF (CURSOR0_CURSOR_HOT_SPOT ,CURSOR_HOT_SPOT_X , mask_sh), \HUBP_SF (CURSOR0_CURSOR_HOT_SPOT ,CURSOR_HOT_SPOT_Y , mask_sh), \ -HUBP_SF (CURSOR0_CURSOR_DST_OFFSET ,CURSOR_DST_X_OFFSET , mask_sh), \ - HUBP_SF(CNVC_CUR0_CURSOR0_FP_SCALE_BIAS, CUR0_FP_SCALE, mask_sh) + HUBP_SF(CURSOR0_CURSOR_DST_OFFSET, CURSOR_DST_X_OFFSET, mask_sh)#define DCN_HUBP_REG_FIELD_LIST (type) \ type HUBP_BLANK_EN;\
@@ -622,8 +619,7 @@type CURSOR_HOT_SPOT_X ; \type CURSOR_HOT_SPOT_Y ; \type CURSOR_DST_X_OFFSET ; \ -type OUTPUT_FP ; \ - type CUR0_FP_SCALE + type OUTPUT_FP struct dcn_mi_registers {HUBP_COMMON_REG_VARIABLE_LIST ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +29 -1
@@ -2578,6 +2578,33 @@ static void dcn10_set_cursor_attribute(struct pipe_ctx *pipe_ctx) pipe_ctx->plane_res.dpp, attributes->color_format); } +static void dcn10_set_cursor_sdr_white_level (struct pipe_ctx *pipe_ctx) +{ +uint32_t sdr_white_level = pipe_ctx->stream->cursor_attributes.sdr_white_level; +struct fixed31_32 multiplier; +struct dpp_cursor_attributes opt_attr = {0 }; +uint32_t hw_scale =0x3c00 ;// 1.0 default multiplier +struct custom_float_format fmt; + +if (!pipe_ctx->plane_res.dpp->funcs->set_optional_cursor_attributes) +return ; + + fmt.exponenta_bits =5 ; + fmt.mantissa_bits =10 ; + fmt.sign = true; + +if (sdr_white_level >80 ) { + multiplier =dc_fixpt_from_fraction (sdr_white_level,80 ); +convert_to_custom_float_format (multiplier, &fmt, &hw_scale); + } + + opt_attr.scale = hw_scale; + opt_attr.bias =0 ; + + pipe_ctx->plane_res.dpp->funcs->set_optional_cursor_attributes ( + pipe_ctx->plane_res.dpp, &opt_attr); +} +static const struct hw_sequencer_funcs dcn10_funcs = { .program_gamut_remap = program_gamut_remap, .program_csc_matrix = program_csc_matrix,
@@ -2625,7 +2652,8 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .edp_power_control = hwss_edp_power_control, .edp_wait_for_hpd_ready = hwss_edp_wait_for_hpd_ready, .set_cursor_position = dcn10_set_cursor_position, - .set_cursor_attribute = dcn10_set_cursor_attribute + .set_cursor_attribute = dcn10_set_cursor_attribute, + .set_cursor_sdr_white_level = dcn10_set_cursor_sdr_white_level };
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +3 -0
@@ -151,6 +151,9 @@ struct dpp_funcs {void (*dpp_set_hdr_multiplier)(struct dpp *dpp_base,uint32_t multiplier); +void (*set_optional_cursor_attributes)( +struct dpp *dpp_base, +struct dpp_cursor_attributes *attr); void (*dpp_dppclk_control)( struct dpp *dpp_base,
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +1 -0
@@ -223,6 +223,7 @@ struct hw_sequencer_funcs {void (*set_cursor_position)(struct pipe_ctx *pipe);void (*set_cursor_attribute)(struct pipe_ctx *pipe); +void (*set_cursor_sdr_white_level)(struct pipe_ctx *pipe); };
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/10 drm/amd/display: Handle HDR meta update as fast update
In reply to a message not in the archiveFrom: Krunoslav Kovac <[email protected]>
[Why]
Vesa DPMS tool sends different HDR meta in OS flips without changing output parameters. We don't properly update HDR info frame:
- we label HDR meta update as fast update
- when updating HW info frame, we only do it if full update
[How]
It should still be fast update, so when doing HW infoframe update, do it always no matter the update type.
Also, don't request passive flip for HDR meta update only without output transfer function or color space changed.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +7 -7
@@ -1345,6 +1345,13 @@ static void commit_planes_do_stream_update(struct dc *dc, pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing, pipe_ctx->stream->periodic_fn_vsync_delta); +if (stream_update->hdr_static_metadata || + stream_update->vrr_infopacket || + stream_update->vsc_infopacket) { +resource_build_info_frame (pipe_ctx); + dc->hwss.update_info_frame (pipe_ctx); + } +/* Full fe update*/ if (update_type ==UPDATE_TYPE_FAST )continue ;
@@ -1371,13 +1378,6 @@ static void commit_planes_do_stream_update(struct dc *dc, pipe_ctx->stream_res.abm->funcs->set_abm_level ( pipe_ctx->stream_res.abm, stream->abm_level); } - -if (stream_update->hdr_static_metadata || - stream_update->vrr_infopacket || - stream_update->vsc_infopacket) { -resource_build_info_frame (pipe_ctx); - dc->hwss.update_info_frame (pipe_ctx); - } } } }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/10 drm/amd/display: add HDR visual confirm
In reply to a message not in the archiveFrom: Gloria Li <[email protected]>
[Why]
Testing team wants a way to tell if HDR is on or not
[How]
Program the overscan color to visually indicate the HDR state of the top-most plane
--- drivers/gpu/drm/amd/display/dc/dc.h | 11 ++++- drivers/gpu/drm/amd/display/dc/dce/dce_transform.c | 2 +- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 2 +- .../drm/amd/display/dc/dce110/dce110_transform_v.c | 2 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 7 ++- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 50 ++++++++++++++++++++-- 6 files changed, 63 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +9 -2
@@ -169,6 +169,12 @@ struct dc_config {bool disable_disp_pll_sharing; }; +enum visual_confirm { +VISUAL_CONFIRM_DISABLE =0 , +VISUAL_CONFIRM_SURFACE =1 , +VISUAL_CONFIRM_HDR =2 , +}; +enum dcc_option {DCC_ENABLE =0 ,DCC_DISABLE =1 ,
@@ -202,7 +208,7 @@ struct dc_clocks { };struct dc_debug { -bool surface_visual_confirm; +enum visual_confirm visual_confirm;bool sanity_checks;bool max_disp_clk;bool surface_trace;
@@ -387,7 +393,8 @@ enum dc_transfer_func_predefined {TRANSFER_FUNCTION_LINEAR ,TRANSFER_FUNCTION_UNITY ,TRANSFER_FUNCTION_HLG , -TRANSFER_FUNCTION_HLG12 +TRANSFER_FUNCTION_HLG12 , +TRANSFER_FUNCTION_GAMMA22 }; struct dc_transfer_func {
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +1 -1
@@ -155,7 +155,7 @@ static void program_overscan(int overscan_bottom = data->v_active - data->recout.y - data->recout.height; -if (xfm_dce->base.ctx->dc->debug.surface_visual_confirm) { +if (xfm_dce->base.ctx->dc->debug.visual_confirm !=VISUAL_CONFIRM_DISABLE ) { overscan_bottom +=2 ; overscan_right +=2 ; }
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -1
@@ -1256,7 +1256,7 @@ static void program_scaler(const struct dc *dc,return ;#endif -if (dc->debug.surface_visual_confirm) +if (dc->debug.visual_confirm ==VISUAL_CONFIRM_SURFACE )get_surface_visual_confirm_color (pipe_ctx, &color);else color_space_to_black_color(dc,
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +1 -1
@@ -235,7 +235,7 @@ static void program_overscan(int overscan_right = data->h_active - data->recout.x - data->recout.width;int overscan_bottom = data->v_active - data->recout.y - data->recout.height; -if (xfm_dce->base.ctx->dc->debug.surface_visual_confirm) { +if (xfm_dce->base.ctx->dc->debug.visual_confirm !=VISUAL_CONFIRM_DISABLE ) { overscan_bottom +=2 ; overscan_right +=2 ; }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +5 -2
@@ -621,6 +621,10 @@ static void dpp1_dscl_set_manual_ratio_init(static void dpp1_dscl_set_recout (struct dcn10_dpp *dpp,const struct rect *recout) { +int visual_confirm_on =0 ; +if (dpp->base.ctx->dc->debug.visual_confirm !=VISUAL_CONFIRM_DISABLE ) + visual_confirm_on =1 ; + REG_SET_2(RECOUT_START, 0, /* First pixel of RECOUT */ RECOUT_START_X, recout->x,
@@ -632,8 +636,7 @@ static void dpp1_dscl_set_recout(RECOUT_WIDTH , recout->width,/* Number of RECOUT vertical lines */ RECOUT_HEIGHT , recout->height - - dpp->base.ctx->dc->debug.surface_visual_confirm *4 * - (dpp->base.inst + 1)); + - visual_confirm_on * 4 * (dpp->base.inst + 1)); }/* Main function to program scaler and line buffer in manual scaling mode */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +46 -4
71 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/10 drm/amd/display: Add hook for MST root branch info
In reply to a message not in the archiveFrom: Nikola Cornij <[email protected]>
This allows DM to do any necessary updates before MST discovery starts.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 +++++ drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++++ drivers/gpu/drm/amd/display/dc/dm_helpers.h | 8 ++++++++ 3 files changed, 17 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +5 -0
@@ -169,6 +169,11 @@ static void get_payload_table(mutex_unlock (&mst_mgr->payload_lock); } +void dm_helpers_dp_update_branch_info ( +struct dc_context *ctx, +const struct dc_link *link) +{} +/* * Writes payload allocation table in immediate downstream device. */
drivers/gpu/drm/amd/display/dc/core/dc_link.c +4 -0
@@ -529,6 +529,10 @@ static bool detect_dp(if (reason ==DETECT_REASON_BOOT ) boot = true; +dm_helpers_dp_update_branch_info ( + link->ctx, + link); +if (!dm_helpers_dp_mst_start_top_mgr ( link->ctx, link, boot)) {
drivers/gpu/drm/amd/display/dc/dm_helpers.h +8 -0
@@ -40,6 +40,14 @@ enum dc_edid_status dm_helpers_parse_edid_caps(const struct dc_edid *edid, struct dc_edid_caps *edid_caps); + +/* +* Update DP branch info +*/ +void dm_helpers_dp_update_branch_info ( +struct dc_context *ctx, +const struct dc_link *link); +/* * Writes payload allocation table in immediate downstream device. */
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/10 drm/amd/display: Move address tracking out of HUBP
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
[Why]
We sometime require remapping of FB address space to UMA
[How]
Move address tracking up a layer before we apply address translation
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 4 ---- .../gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 19 +++++++++++++++---- drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 1 - 3 files changed, 15 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +0 -4
@@ -471,9 +471,6 @@ bool hubp1_program_surface_flip_and_addr( hubp->request_address = *address; -if (flip_immediate) - hubp->current_address = *address; -return true; }
@@ -709,7 +706,6 @@ bool hubp1_is_flip_pending(struct hubp *hubp)if (earliest_inuse_address.grph.addr.quad_part != hubp->request_address.grph.addr.quad_part)return true; - hubp->current_address = hubp->request_address;return false; }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +15 -4
@@ -1172,12 +1172,19 @@ static void dcn10_update_plane_addr(const struct dc *dc, struct pipe_ctx *pipe_cif (plane_state ==NULL )return ; + addr_patched =patch_address_for_sbs_tb_stereo (pipe_ctx, &addr); + pipe_ctx->plane_res.hubp->funcs->hubp_program_surface_flip_and_addr ( pipe_ctx->plane_res.hubp, &plane_state->address, plane_state->flip_immediate); + plane_state->status.requested_address = plane_state->address; + +if (plane_state->flip_immediate) + plane_state->status.current_address = plane_state->address; +if (addr_patched) pipe_ctx->plane_state->address.grph_stereo.left_addr = addr; }
@@ -2556,16 +2563,20 @@ static void dcn10_update_pending_status(struct pipe_ctx *pipe_ctx) {struct dc_plane_state *plane_state = pipe_ctx->plane_state;struct timing_generator *tg = pipe_ctx->stream_res.tg; +bool flip_pending;if (plane_state ==NULL )return ; - plane_state->status.is_flip_pending = - pipe_ctx->plane_res.hubp->funcs->hubp_is_flip_pending ( + flip_pending = pipe_ctx->plane_res.hubp->funcs->hubp_is_flip_pending ( pipe_ctx->plane_res.hubp); - plane_state->status.current_address = pipe_ctx->plane_res.hubp->current_address; -if (pipe_ctx->plane_res.hubp->current_address.type ==PLN_ADDR_TYPE_GRPH_STEREO && + plane_state->status.is_flip_pending = flip_pending; + +if (!flip_pending) + plane_state->status.current_address = plane_state->status.requested_address; + +if (plane_state->status.current_address.type ==PLN_ADDR_TYPE_GRPH_STEREO && tg->funcs->is_stereo_left_eye) { plane_state->status.is_right_eye = !tg->funcs->is_stereo_left_eye (pipe_ctx->stream_res.tg);
drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h +0 -1
@@ -46,7 +46,6 @@ struct hubp {const struct hubp_funcs *funcs;struct dc_context *ctx;struct dc_plane_address request_address; -struct dc_plane_address current_address;int inst;/* run time states */
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/10 drm/amd/display: add new dc debug structure to track debug data
In reply to a message not in the archiveFrom: Jun Lei <[email protected]>
[why]
Some DTN tests still failing @ 2% Need to reduce.
[how]
add instrumentation code to driver so we can get more information from failed runs.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 3 +++ drivers/gpu/drm/amd/display/dc/dc.h | 5 +++++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +3 -0
@@ -1028,6 +1028,9 @@ enum link_training_result dc_link_dp_perform_link_training( lt_settings.lane_settings[0 ].VOLTAGE_SWING, lt_settings.lane_settings[0].PRE_EMPHASIS); +if (status !=LINK_TRAINING_SUCCESS ) + link->ctx->dc->debug.debug_data.ltFailCount++; +return status; }
drivers/gpu/drm/amd/display/dc/dc.h +5 -0
@@ -259,6 +259,11 @@ struct dc_debug {bool scl_reset_length10;bool hdmi20_disable; +struct { +uint32_t ltFailCount; +uint32_t i2cErrorCount; +uint32_t auxErrorCount; + } debug_data; };struct dc_state ;struct resource_pool ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/10 drm/amd/display: dal 3.1.56
In reply to a message not in the archiveFrom: Harry Wentland <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.55" +#define DC_VER "3.1.56"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/10 drm/amd/display: Null ptr check for set_sdr_white_level
In reply to a message not in the archiveFrom: Krunoslav Kovac <[email protected]>
[Why&How]
Cursor boosting can only be done on DCN+
Check for nullptr since DCE doesn't implement it.
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +2 -1
@@ -214,7 +214,8 @@ bool dc_stream_set_cursor_attributes( } core_dc->hwss.set_cursor_attribute (pipe_ctx); - core_dc->hwss.set_cursor_sdr_white_level (pipe_ctx); +if (core_dc->hwss.set_cursor_sdr_white_level) + core_dc->hwss.set_cursor_sdr_white_level (pipe_ctx); }if (pipe_to_program)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/10 drm/amd/display: Fix some checkpatch.pl errors and warnings in dc_link_dp.c
In reply to a message not in the archiveFrom: Harry Wentland <[email protected]>
[Why]
Any Linux kernel code should pass checkpatch.pl with no errors and little, if any, warning.
[How]
Fixing some spacing errors and warnings.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 35 ++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +18 -17
@@ -39,7 +39,7 @@ static bool decide_fallback_link_setting(struct dc_link_settings initial_link_settings, struct dc_link_settings *current_link_setting, enum link_training_result training_result); -static struct dc_link_settings get_common_supported_link_settings ( +static struct dc_link_settings get_common_supported_link_settings (struct dc_link_settings link_setting_a,struct dc_link_settings link_setting_b);
@@ -94,8 +94,8 @@ static void dpcd_set_link_settings(uint8_t rate = (uint8_t ) (lt_settings->link_settings.link_rate); -union down_spread_ctrl downspread = {{0 }}; -union lane_count_set lane_count_set = {{0 }}; +union down_spread_ctrl downspread = { {0 } }; +union lane_count_set lane_count_set = { {0 } };uint8_t link_set_buffer[2 ]; downspread.raw = (uint8_t)
@@ -165,11 +165,11 @@ static void dpcd_set_lt_pattern_and_lane_settings(const struct link_training_settings *lt_settings, enum hw_dp_training_pattern pattern) { - union dpcd_training_lane dpcd_lane[LANE_COUNT_DP_MAX] = {{{0}}}; + union dpcd_training_lane dpcd_lane[LANE_COUNT_DP_MAX] = { { {0} } };const uint32_t dpcd_base_lt_offset =DP_TRAINING_PATTERN_SET ;uint8_t dpcd_lt_buffer[5 ] = {0 }; -union dpcd_training_pattern dpcd_pattern = {{0 }}; +union dpcd_training_pattern dpcd_pattern = { {0 } };uint32_t lane;uint32_t size_in_bytes;bool edp_workaround = false;/* TODO link_prop.INTERNAL */
@@ -233,7 +233,7 @@ static void dpcd_set_lt_pattern_and_lane_settings( link,DP_TRAINING_PATTERN_SET , &dpcd_pattern.raw, - sizeof(dpcd_pattern.raw) ); + sizeof(dpcd_pattern.raw)); core_link_write_dpcd( link,
@@ -247,7 +247,7 @@ static void dpcd_set_lt_pattern_and_lane_settings( link, dpcd_base_lt_offset, dpcd_lt_buffer, - size_in_bytes + sizeof(dpcd_pattern.raw) ); + size_in_bytes + sizeof(dpcd_pattern.raw)); link->cur_lane_setting = lt_settings->lane_settings[0 ]; }
@@ -429,8 +429,8 @@ static void get_lane_status_and_drive_settings( struct link_training_settings *req_settings) {uint8_t dpcd_buf[6 ] = {0 }; -union lane_adjust dpcd_lane_adjust[LANE_COUNT_DP_MAX ] = {{{0 }}}; -struct link_training_settings request_settings = {{0 }}; +union lane_adjust dpcd_lane_adjust[LANE_COUNT_DP_MAX ] = { { {0 } } }; +struct link_training_settings request_settings = { {0 } };uint32_t lane;memset (req_settings,'\0' ,sizeof (struct link_training_settings ));
@@ -652,7 +652,7 @@ static bool perform_post_lt_adj_req_sequence(if (req_drv_setting_changed) {update_drive_settings ( - lt_settings,req_settings); + lt_settings, req_settings);dc_link_dp_set_drive_settings (link, lt_settings);
@@ -725,8 +725,8 @@ static enum link_training_result perform_channel_equalization_sequence(enum hw_dp_training_pattern hw_tr_pattern;uint32_t retries_ch_eq;enum dc_lane_count lane_count = lt_settings->link_settings.lane_count; -union lane_align_status_updated dpcd_lane_status_updated = {{0 }}; -union lane_status dpcd_lane_status[LANE_COUNT_DP_MAX ] = {{{0 }}}; +union lane_align_status_updated dpcd_lane_status_updated = { {0 } }; +union lane_status dpcd_lane_status[LANE_COUNT_DP_MAX ] = { { {0 } } }; hw_tr_pattern =get_supported_tp (link);
@@ -1186,7 +1186,7 @@ bool dp_hbr_verify_link_cap(return success; } -static struct dc_link_settings get_common_supported_link_settings ( +static struct dc_link_settings get_common_supported_link_settings (struct dc_link_settings link_setting_a,struct dc_link_settings link_setting_b) {
@@ -1432,6 +1432,7 @@ static uint32_t bandwidth_in_kbps_from_link_settings(uint32_t lane_count = link_setting->lane_count;uint32_t kbps = link_rate_in_kbps; + kbps *= lane_count; kbps *=8 ;/* 8 bits per byte*/
@@ -1449,9 +1450,9 @@ bool dp_validate_mode_timing(const struct dc_link_settings *link_setting;/*always DP fail safe mode*/ -if (timing->pix_clk_khz == (uint32_t )25175 && - timing->h_addressable == (uint32_t )640 && - timing->v_addressable == (uint32_t )480 ) +if (timing->pix_clk_khz == (uint32_t )25175 && + timing->h_addressable == (uint32_t )640 && + timing->v_addressable == (uint32_t )480 )return true;/* We always use verified link settings */
@@ -2001,7 +2002,7 @@ static void handle_automated_test(struct dc_link *link)bool dc_link_handle_hpd_rx_irq (struct dc_link *link,union hpd_irq_data *out_hpd_irq_dpcd_data,bool *out_link_loss) { -union hpd_irq_data hpd_irq_dpcd_data = {{{{0 }}}}; +union hpd_irq_data hpd_irq_dpcd_data = { { { {0 } } } };union device_service_irq device_service_clear = { {0 } };enum dc_status result;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx