DC Patches June 8, 2020
cover DC Patches June 8, 2020
This DC patchset brings changes in multiple areas. In summary, we highlight:
* Bug fixes in bandwidth calculation, DSC calculation, etc.
* Improvements in DP
* Code refactoring and cleanup
* FW promotion
Anthony Koo (3):
drm/amd/display: [FW Promotion] Release 1.0.13
drm/amd/display: [FW Promotion] Release 1.0.14
drm/amd/display: [FW Promotion] Release 1.0.15
Aric Cyr (3):
drm/amd/display: 3.2.88
drm/amd/display: Improve DisplayPort monitor interop drm/amd/display: 3.2.89
Aurabindo Pillai (1):
drm/amd/display: Enable use of dmub iff dmcu is disabled
Charlene Liu (2):
drm/amd/display: correct alpha_en programming for new pixel format drm/amd/display: update audio wall clock programming
Dale Zhao (1):
drm/amd/display: Disable pipe split for modes with borders
Dmytro Laktyushkin (2):
drm/amd/display: remove unnecessary mpcc updates drm/amd/display: make calculate watermarks a function pointer
Hugo Hu (1):
drm/amd/display: Revert "enable plane if plane_status changed"
Jun Lei (1):
drm/amd/display: add support for per-state dummy-pstate latency
Lewis Huang (1):
drm/amd/display: change global buffer to local buffer
Martin Tsai (1):
drm/amd/display: Force delay after DP receive power up
Michael Strauss (1):
drm/amd/display: Fix incorrect dcn1 bandwidth calculations
Nicholas Kazlauskas (2):
drm/amd/display: Use u16 for drm_bpp in DSC calculations drm/amd/display: Fix VBA chroma calculation for pipe splitting
Rodrigo Siqueira (2):
drm/amd/display: Rework dsc to isolate FPU operations drm/amd/display: Add helper to convert DC status
Roman Li (1):
drm/amd/display: Remove unused macro from dcn21
Wenjing Liu (1):
drm/amd/display: Revert "DP link layer test 4.2.1.1 fix due to specs
update"
Wesley Chalmers (1):
drm/amd/display: Move call to disable DPG
Yongqiang Sun (3):
drm/amd/display: runtime select dmub emulatior.
drm/amd/display: not reset dmub in driver.
drm/amd/display: Not doing bios data pack.
po-tchen (1):
drm/amd/display: Passing initial SDP deadline to dmub
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 +- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 10 +- .../drm/amd/display/dc/bios/bios_parser2.c | 5 + .../drm/amd/display/dc/calcs/dcn_calc_auto.c | 6 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- .../gpu/drm/amd/display/dc/core/dc_debug.c | 59 +++++++ drivers/gpu/drm/amd/display/dc/core/dc_link.c | 8 +- .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 13 +- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 75 +++++---- .../drm/amd/display/dc/core/dc_link_hwss.c | 2 +- drivers/gpu/drm/amd/display/dc/dc.h | 4 +- drivers/gpu/drm/amd/display/dc/dc_link.h | 1 - .../gpu/drm/amd/display/dc/dce/dce_audio.c | 4 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 1 + .../display/dc/dce110/dce110_hw_sequencer.c | 15 +- .../gpu/drm/amd/display/dc/dcn20/dcn20_dpp.c | 4 + .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 22 +-- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 17 ++ .../drm/amd/display/dc/dcn21/dcn21_resource.c | 5 +- .../drm/amd/display/dc/dml/display_mode_vba.c | 4 +- drivers/gpu/drm/amd/display/dc/dsc/Makefile | 2 - drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 18 +-- drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c | 151 +++++++++++++++++- drivers/gpu/drm/amd/display/dc/dsc/rc_calc.h | 5 +- .../gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c | 27 +--- .../gpu/drm/amd/display/dc/inc/core_status.h | 2 + .../gpu/drm/amd/display/dc/inc/core_types.h | 6 +- .../gpu/drm/amd/display/dc/inc/dc_link_ddc.h | 2 +- .../gpu/drm/amd/display/dc/inc/dc_link_dp.h | 2 +- .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 6 + drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 4 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 70 +++++++- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 6 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 16 +- .../drm/amd/display/modules/color/Makefile | 4 + .../amd/display/modules/color/color_gamma.c | 115 ++++++------- .../amd/display/modules/color/color_gamma.h | 18 ++- .../amd/display/modules/color/color_table.c | 48 ++++++ .../amd/display/modules/color/color_table.h | 47 ++++++ 39 files changed, 612 insertions(+), 207 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/modules/color/color_table.c create mode 100644 drivers/gpu/drm/amd/display/modules/color/color_table.h
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/28 drm/amd/display: correct alpha_en programming for new pixel format
From: Charlene Liu <[email protected]>
[why]
for following new format, no alpha
SURFACE_PIXEL_FORMAT_GRPH_RGB111110_FLOAT/_FIX:
SURFACE_PIXEL_FORMAT_GRPH_BGR101111_FLOAT/_FIX
same as case SURFACE_PIXEL_FORMAT_GRPH_ARGB1555:--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dpp.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dpp.c +4 -0
@@ -181,9 +181,11 @@ static void dpp2_cnv_setup (break ;case SURFACE_PIXEL_FORMAT_GRPH_RGB111110_FIX : pixel_format =112 ; + alpha_en =0 ;break ;case SURFACE_PIXEL_FORMAT_GRPH_BGR101111_FIX : pixel_format =113 ; + alpha_en =0 ;break ;case SURFACE_PIXEL_FORMAT_VIDEO_ACrYCb2101010: pixel_format =114 ;
@@ -199,9 +201,11 @@ static void dpp2_cnv_setup (break ;case SURFACE_PIXEL_FORMAT_GRPH_RGB111110_FLOAT : pixel_format =118 ; + alpha_en =0 ;break ;case SURFACE_PIXEL_FORMAT_GRPH_BGR101111_FLOAT : pixel_format =119 ; + alpha_en =0 ;break ;default :break ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/28 drm/amd/display: Rework dsc to isolate FPU operations
In reply to Qingqing ZhuoFrom: Rodrigo Siqueira <[email protected]>
When we want to use float point operation on Linux we need to use within special kernel protection (kernel_fpu_{begin,end}().), otherwise the kernel can clobber userspace FPU register state. For detecting these issues we use a tool named objtool (with -Ffa flags) to highlight the FPU problems, all warnings can be summed up as follows:
./tools/objtool/objtool check -Ffa drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.o
[..] dc/dsc/rc_calc.o: warning: objtool: get_qp_set()+0x2f8:
FPU instruction outside of kernel_fpu_{begin,end}()
[..] dc/dsc/rc_calc.o: warning: objtool: dsc_roundf()+0x5:
FPU instruction outside of kernel_fpu_{begin,end}()
[..] dc/dsc/rc_calc.o: warning: objtool: dsc_ceil()+0x5:
FPU instruction outside of kernel_fpu_{begin,end}()
[..] dc/dsc/rc_calc.o: warning: objtool: get_ofs_set()+0x3eb:
FPU instruction outside of kernel_fpu_{begin,end}()
[..] dc/dsc/rc_calc.o: warning: objtool: calc_rc_params()+0x3c:
FPU instruction outside of kernel_fpu_{begin,end}()
[..] dc/dsc/dc_dsc.o: warning: objtool:
get_dsc_bandwidth_range.isra.0()+0x8d:
FPU instruction outside of kernel_fpu_{begin,end}()
[..] dc/dsc/dc_dsc.o: warning: objtool: setup_dsc_config()+0x2ef:
FPU instruction outside of kernel_fpu_{begin,end}()
[..] dc/dsc/rc_calc_dpi.o: warning: objtool:copy_pps_fields()+0xbb:
FPU instruction outside of kernel_fpu_{begin,end}()
[..] dc/dsc/rc_calc_dpi.o: warning: objtool:
dscc_compute_dsc_parameters()+0x7b:
FPU instruction outside of kernel_fpu_{begin,end}()
This commit fixes the above issues by rework DSC as described:
1. Isolate all FPU operations in a single file;
2. Use FPU flags only in the file that handles FPU operations;
3. Isolate all functions that require float point operation in static functions;
4. Add a mid-layer function that does not use any float point operation, and that could be safely invoked in other parts of the code.
5. Keep float point operation under DC_FP_{START/END} macro.
--- drivers/gpu/drm/amd/display/dc/dsc/Makefile | 2 - drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 18 +-- drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c | 151 +++++++++++++++++- drivers/gpu/drm/amd/display/dc/dsc/rc_calc.h | 5 +- .../gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c | 27 +--- 5 files changed, 153 insertions(+), 50 deletions(-)
drivers/gpu/drm/amd/display/dc/dsc/Makefile +0 -2
@@ -28,8 +28,6 @@ endif endif CFLAGS_$(AMDDALPATH)/dc/dsc/rc_calc.o := $(dsc_ccflags) -CFLAGS_$(AMDDALPATH)/dc/dsc/rc_calc_dpi.o := $(dsc_ccflags) -CFLAGS_$(AMDDALPATH)/dc/dsc/dc_dsc.o := $(dsc_ccflags) DSC = dc_dsc.o rc_calc.o rc_calc_dpi.o
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +2 -16
@@ -22,10 +22,12 @@* Author: AMD */ +#include <drm/drm_dsc.h> #include "dc_hw_types.h" #include "dsc.h" #include <drm/drm_dp_helper.h> #include "dc.h" +#include "rc_calc.h" /* This module's internal functions */
@@ -304,22 +306,6 @@ static inline uint32_t dsc_div_by_10_round_up(uint32_t value)return (value +9 ) /10 ; } -static inline uint32_t calc_dsc_bpp_x16 (uint32_t stream_bandwidth_kbps,uint32_t pix_clk_100hz,uint32_t bpp_increment_div) -{ -uint32_t dsc_target_bpp_x16; -float f_dsc_target_bpp; -float f_stream_bandwidth_100bps = stream_bandwidth_kbps *10.0f ; -uint32_t precision = bpp_increment_div;// bpp_increment_div is actually precision - - f_dsc_target_bpp = f_stream_bandwidth_100bps / pix_clk_100hz; - -// Round down to the nearest precision stop to bring it into DSC spec range - dsc_target_bpp_x16 = (uint32_t )(f_dsc_target_bpp * precision); - dsc_target_bpp_x16 = (dsc_target_bpp_x16 *16 ) / precision; - -return dsc_target_bpp_x16; -} -/* Get DSC bandwidth range based on [min_bpp, max_bpp] target bitrate range, and timing's pixel clock * and uncompressed bandwidth. */
drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c +145 -6
202 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dsc/rc_calc.h +4 -1
@@ -77,7 +77,10 @@ struct qp_entry {typedef struct qp_entry qp_table []; -void calc_rc_params (struct rc_params *rc,enum colour_mode cm,enum bits_per_comp bpc,float bpp,int slice_width,int slice_height,int minor_version); +void calc_rc_params (struct rc_params *rc,const struct drm_dsc_config *pps); +u32 calc_dsc_bytes_per_pixel (const struct drm_dsc_config *pps); +u32 calc_dsc_bpp_x16 (u32 stream_bandwidth_kbps,u32 pix_clk_100hz, +u32 bpp_increment_div);#endif
drivers/gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c +2 -25
@@ -27,8 +27,6 @@#include "dscc_types.h" #include "rc_calc.h" -double dsc_ceil (double num); -static void copy_pps_fields (struct drm_dsc_config *to,const struct drm_dsc_config *from) { to->line_buf_depth = from->line_buf_depth;
@@ -100,34 +98,13 @@ static void copy_rc_to_cfg(struct drm_dsc_config *dsc_cfg, const struct rc_paramint dscc_compute_dsc_parameters (const struct drm_dsc_config *pps,struct dsc_parameters *dsc_params) { -enum colour_mode mode = pps->convert_rgb ?CM_RGB : - (pps->simple_422 ?CM_444 : - (pps->native_422 ?CM_422 : - pps->native_420 ?CM_420 :CM_444 )); -enum bits_per_comp bpc = (pps->bits_per_component ==8 ) ?BPC_8 : - (pps->bits_per_component ==10 ) ?BPC_10 :BPC_12 ; -float bpp = ((float ) pps->bits_per_pixel /16.0 ); -int slice_width = pps->slice_width; -int slice_height = pps->slice_height;int ret;struct rc_params rc;struct drm_dsc_config dsc_cfg; -double d_bytes_per_pixel =dsc_ceil (bpp * slice_width /8.0 ) / slice_width; - -// TODO: Make sure the formula for calculating this is precise (ceiling vs. floor, and at what point they should be applied) -if (pps->native_422 || pps->native_420) - d_bytes_per_pixel /=2 ; - - dsc_params->bytes_per_pixel = (uint32_t )dsc_ceil (d_bytes_per_pixel *0x10000000 ); - -/* in native_422 or native_420 modes, the bits_per_pixel is double the target bpp -* (the latter is what calc_rc_params expects) -*/ -if (pps->native_422 || pps->native_420) - bpp /=2.0 ; + dsc_params->bytes_per_pixel =calc_dsc_bytes_per_pixel (pps); -calc_rc_params (&rc, mode, bpc, bpp, slice_width, slice_height, pps->dsc_version_minor); +calc_rc_params (&rc, pps); dsc_params->pps = *pps; dsc_params->pps.initial_scale_value =8 * rc.rc_model_size / (rc.rc_model_size - rc.initial_fullness_offset);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 02/28] drm/amd/display: Rework dsc to isolate FPU operations
Am 08.06.20 um 06:59 schrieb Qingqing Zhuo:
Quoted 315 lines
From: Rodrigo Siqueira <[email protected]>
When we want to use float point operation on Linux we need to use within special kernel protection (
kernel_fpu_{begin,end}().), otherwise the kernel can clobber userspace FPU register state. For detecting these issues we use a tool named objtool (with -Ffa flags) to highlight the FPU problems, all warnings can be summed up as follows:
./tools/objtool/objtoolcheck -Ffadrivers/gpu/drm/amd/display/dc/dml/dml_common_defs.o[..]
dc/dsc/rc_calc.o: warning: objtool: get_qp_set()+0x2f8:
FPU instruction outside of kernel_fpu_{begin,end}()
[..]dc/dsc/rc_calc.o: warning: objtool: dsc_roundf()+0x5:
FPU instruction outside of kernel_fpu_{begin,end}()
[..]dc/dsc/rc_calc.o: warning: objtool: dsc_ceil()+0x5:
FPU instruction outside of kernel_fpu_{begin,end}()
[..]dc/dsc/rc_calc.o: warning: objtool: get_ofs_set()+0x3eb:
FPU instruction outside of kernel_fpu_{begin,end}()
[..]dc/dsc/rc_calc.o: warning: objtool: calc_rc_params()+0x3c:
FPU instruction outside of kernel_fpu_{begin,end}()
[..]dc/dsc/dc_dsc.o: warning: objtool:
get_dsc_bandwidth_range.isra.0()+0x8d:
FPU instruction outside of kernel_fpu_{begin,end}()
[..]dc/dsc/dc_dsc.o: warning: objtool: setup_dsc_config()+0x2ef:
FPU instruction outside of kernel_fpu_{begin,end}()
[..]dc/dsc/rc_calc_dpi.o: warning: objtool:copy_pps_fields()+0xbb:
FPU instruction outside of kernel_fpu_{begin,end}()
[..]dc/dsc/rc_calc_dpi.o: warning: objtool:
dscc_compute_dsc_parameters()+0x7b:
FPU instruction outside of kernel_fpu_{begin,end}()This commit fixes the above issues by rework DSC as described:
1. Isolate all FPU operations in a single file;
2. Use FPU flags only in the file that handles FPU operations;
3. Isolate all functions that require float point operation in staticfunctions;4. Add a mid-layer function that does not use any float point operation, and that could be safely invoked in other parts of the code.
5. Keep float point operation under DC_FP_{START/END} macro.CC Christian König <[email protected]>CC Alexander Deucher <[email protected]>CC Peter Zijlstra <[email protected]>CC Tony Cheng <[email protected]>CC Harry Wentland <[email protected]>Signed-off-by Rodrigo Siqueira <[email protected]>Reviewed-by Mikita Lipski <[email protected]>Acked-by Qingqing Zhuo <[email protected]>--- drivers/gpu/drm/amd/display/dc/dsc/Makefile | 2 - drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 18 +-- drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c | 151 +++++++++++++++++- drivers/gpu/drm/amd/display/dc/dsc/rc_calc.h | 5 +- .../gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c | 27 +--- 5 files changed, 153 insertions(+), 50 deletions(-)drivers/gpu/drm/amd/display/dc/dsc/Makefile +0
-2@@ -28,8 +28,6 @@ endif endif CFLAGS_$(AMDDALPATH)/dc/dsc/rc_calc.o := $(dsc_ccflags) -CFLAGS_$(AMDDALPATH)/dc/dsc/rc_calc_dpi.o := $(dsc_ccflags) -CFLAGS_$(AMDDALPATH)/dc/dsc/dc_dsc.o := $(dsc_ccflags) DSC = dc_dsc.o rc_calc.o rc_calc_dpi.odrivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +2
-16@@ -22,10 +22,12 @@* Author: AMD */ +#include <drm/drm_dsc.h> #include "dc_hw_types.h" #include "dsc.h" #include <drm/drm_dp_helper.h> #include "dc.h" +#include "rc_calc.h" /* This module's internal functions */ @@ -304,22 +306,6 @@ static inline uint32_t dsc_div_by_10_round_up(uint32_t value)return (value +9 ) /10 ; } -static inline uint32_t calc_dsc_bpp_x16 (uint32_t stream_bandwidth_kbps,uint32_t pix_clk_100hz,uint32_t bpp_increment_div) -{ -uint32_t dsc_target_bpp_x16; -float f_dsc_target_bpp; -float f_stream_bandwidth_100bps = stream_bandwidth_kbps *10.0f ; -uint32_t precision = bpp_increment_div;// bpp_increment_div is actually precision - - f_dsc_target_bpp = f_stream_bandwidth_100bps / pix_clk_100hz; - -// Round down to the nearest precision stop to bring it into DSC spec range - dsc_target_bpp_x16 = (uint32_t )(f_dsc_target_bpp * precision); - dsc_target_bpp_x16 = (dsc_target_bpp_x16 *16 ) / precision; - -return dsc_target_bpp_x16; -} -/* Get DSC bandwidth range based on [min_bpp, max_bpp] target bitrate range, and timing's pixel clock * and uncompressed bandwidth. */ drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c +133
-6@@ -23,6 +23,7 @@* Authors: AMD * */ +#include <drm/drm_dsc.h> #include "os_types.h" #include "rc_calc.h" @@ -40,7 +41,8 @@ break -void get_qp_set (qp_set qps,enum colour_mode cm,enum bits_per_comp bpc,enum max_min max_min,float bpp) +static void get_qp_set (qp_set qps,enum colour_mode cm,enum bits_per_comp bpc, +enum max_min max_min,float bpp) {int mode =MODE_SELECT (444 ,422 ,420 );int sel =table_hash (mode, bpc, max_min);@@ -85,7 +87,7 @@ void get_qp_set(qp_set qps, enum colour_mode cm, enum bits_per_comp bpc, enum mamemcpy (qps, table[index].qps,sizeof (qp_set)); } -double dsc_roundf (double num) +static double dsc_roundf (double num) {if (num <0.0 ) num = num -0.5 ;@@ -95,7 +97,7 @@ double dsc_roundf(double num)return (int )(num); } -double dsc_ceil (double num) +static double dsc_ceil (double num) {double retval = (int )num;@@ -105,7 +107,7 @@ double dsc_ceil(double num)return (int )retval; } -void get_ofs_set (qp_set ofs,enum colour_mode mode,float bpp) +static void get_ofs_set (qp_set ofs,enum colour_mode mode,float bpp) {int *p = ofs;@@ -160,7 +162,7 @@ void get_ofs_set(qp_set ofs, enum colour_mode mode, float bpp) } } -int median3 (int a,int b,int c) +static int median3 (int a,int b,int c) {if (a > b)swap (a, b);@@ -172,13 +174,25 @@ int median3(int a, int b, int c)return b; } -void calc_rc_params (struct rc_params *rc,enum colour_mode cm,enum bits_per_comp bpc,float bpp,int slice_width,int slice_height,int minor_version) +static void _do_calc_rc_params (struct rc_params *rc,enum colour_mode cm, +enum bits_per_comp bpc,u8 drm_bpp, +bool is_navite_422_or_420, +int slice_width,int slice_height, +int minor_version) { +float bpp;float bpp_group;float initial_xmit_delay_factor;int padding_pixels;int i; + bpp = ((float )drm_bpp /16.0 ); +/* in native_422 or native_420 modes, the bits_per_pixel is double the +* target bpp (the latter is what calc_rc_params expects) +*/ +if (is_navite_422_or_420) + bpp /=2.0 ; + rc->rc_quant_incr_limit0 = ((bpc ==BPC_8 ) ?11 : (bpc ==BPC_10 ?15 :19 )) - ((minor_version ==1 && cm ==CM_444 ) ?1 :0 ); rc->rc_quant_incr_limit1 = ((bpc ==BPC_8 ) ?11 : (bpc ==BPC_10 ?15 :19 )) - ((minor_version ==1 && cm ==CM_444 ) ?1 :0 );@@ -251,3 +265,128 @@ void calc_rc_params(struct rc_params *rc, enum colour_mode cm, enum bits_per_com rc->rc_buf_thresh[13 ] =8064 ; } +static u32 _do_bytes_per_pixel_calc (int slice_width,u8 drm_bpp, +bool is_navite_422_or_420) +{ +float bpp; +u32 bytes_per_pixel; +double d_bytes_per_pixel; + + bpp = ((float )drm_bpp /16.0 ); + d_bytes_per_pixel =dsc_ceil (bpp * slice_width /8.0 ) / slice_width; +// TODO: Make sure the formula for calculating this is precise (ceiling +// vs. floor, and at what point they should be applied) +if (is_navite_422_or_420) + d_bytes_per_pixel /=2 ; + + bytes_per_pixel = (u32 )dsc_ceil (d_bytes_per_pixel *0x10000000 ); + +return bytes_per_pixel; +} + +static u32 _do_calc_dsc_bpp_x16 (u32 stream_bandwidth_kbps,u32 pix_clk_100hz, +u32 bpp_increment_div) +{ +u32 dsc_target_bpp_x16; +float f_dsc_target_bpp; +float f_stream_bandwidth_100bps; +// bpp_increment_div is actually precision +u32 precision = bpp_increment_div; + + f_stream_bandwidth_100bps = stream_bandwidth_kbps *10.0f ; + f_dsc_target_bpp = f_stream_bandwidth_100bps / pix_clk_100hz; + +// Round down to the nearest precision stop to bring it into DSC spec +// range + dsc_target_bpp_x16 = (u32)(f_dsc_target_bpp * precision); + dsc_target_bpp_x16 = (dsc_target_bpp_x16 *16 ) / precision; + +return dsc_target_bpp_x16; +} + +/** +* calc_rc_params - reads the user's cmdline mode +* @rc: DC internal DSC parameters +* @pps: DRM struct with all required DSC values +* +* This function expects a drm_dsc_config data struct with all the required DSC +* values previously filled out by our driver and based on this information it +* computes some of the DSC values. +* +* @note This calculation requires float point operation, most of it executes +* under kernel_fpu_{begin,end}. +*/ +void calc_rc_params (struct rc_params *rc,const struct drm_dsc_config *pps) +{ +enum colour_mode mode; +enum bits_per_comp bpc; +bool is_navite_422_or_420; +u8 drm_bpp = pps->bits_per_pixel; +int slice_width = pps->slice_width; +int slice_height = pps->slice_height; + + mode = pps->convert_rgb ?CM_RGB : (pps->simple_422 ?CM_444 : + (pps->native_422 ?CM_422 : + pps->native_420 ?CM_420 :CM_444 )); + bpc = (pps->bits_per_component ==8 ) ?BPC_8 : (pps->bits_per_component ==10 ) + ?BPC_10 :BPC_12 ; + + is_navite_422_or_420 = pps->native_422 || pps->native_420; + +DC_FP_START (); +_do_calc_rc_params (rc, mode, bpc, drm_bpp, is_navite_422_or_420, + slice_width, slice_height, + pps->dsc_version_minor); +DC_FP_END (); +} + +/** +* calc_dsc_bytes_per_pixel - calculate bytes per pixel +* @pps: DRM struct with all required DSC values +* +* Based on the information inside drm_dsc_config, this function calculates the +* total of bytes per pixel. +* +* @note This calculation requires float point operation, most of it executes +* under kernel_fpu_{begin,end}. +* +* Return: +* Return the number of bytes per pixel +*/ +u32 calc_dsc_bytes_per_pixel (const struct drm_dsc_config *pps) + +{ +u32 ret; +u8 drm_bpp = pps->bits_per_pixel; +int slice_width = pps->slice_width; +bool is_navite_422_or_420 = pps->native_422 || pps->native_420; + +DC_FP_START (); + ret =_do_bytes_per_pixel_calc (slice_width, drm_bpp, + is_navite_422_or_420); +DC_FP_END (); +return ret; +} + +/** +* calc_dsc_bpp_x16 - retrieve the dsc bits per pixel +* @stream_bandwidth_kbps: +* @pix_clk_100hz: +* @bpp_increment_div: +* +* Calculate the total of bits per pixel for DSC configuration. +* +* @note This calculation requires float point operation, most of it executes +* under kernel_fpu_{begin,end}.
drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c void calc_rc_params(struct rc_params *rc, enum colour_mode cm, enum bits_per_com · line 390
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c +10
-0+*/ +u32 calc_dsc_bpp_x16 (u32 stream_bandwidth_kbps,u32 pix_clk_100hz, +u32 bpp_increment_div) +{ +u32 dsc_bpp; + +DC_FP_START (); + dsc_bpp =_do_calc_dsc_bpp_x16 (stream_bandwidth_kbps, pix_clk_100hz, + bpp_increment_div); +DC_FP_END ();
The calls to DC_FP_START(); and DC_FP_END() are still in the wrong file.
The compiler can potentially inline the functions and illegally optimize stuff outside of the protected region.
Regards,
Christian.
Quoted 58 lines
drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c +2
-0+return dsc_bpp; +}drivers/gpu/drm/amd/display/dc/dsc/rc_calc.h +4
-1@@ -77,7 +77,10 @@ struct qp_entry {typedef struct qp_entry qp_table []; -void calc_rc_params (struct rc_params *rc,enum colour_mode cm,enum bits_per_comp bpc,float bpp,int slice_width,int slice_height,int minor_version); +void calc_rc_params (struct rc_params *rc,const struct drm_dsc_config *pps); +u32 calc_dsc_bytes_per_pixel (const struct drm_dsc_config *pps); +u32 calc_dsc_bpp_x16 (u32 stream_bandwidth_kbps,u32 pix_clk_100hz, +u32 bpp_increment_div);#endif drivers/gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c +0
-21@@ -27,8 +27,6 @@#include "dscc_types.h" #include "rc_calc.h" -double dsc_ceil (double num); -static void copy_pps_fields (struct drm_dsc_config *to,const struct drm_dsc_config *from) { to->line_buf_depth = from->line_buf_depth;@@ -100,34 +98,13 @@ static void copy_rc_to_cfg(struct drm_dsc_config *dsc_cfg, const struct rc_paramint dscc_compute_dsc_parameters (const struct drm_dsc_config *pps,struct dsc_parameters *dsc_params) { -enum colour_mode mode = pps->convert_rgb ?CM_RGB : - (pps->simple_422 ?CM_444 : - (pps->native_422 ?CM_422 : - pps->native_420 ?CM_420 :CM_444 )); -enum bits_per_comp bpc = (pps->bits_per_component ==8 ) ?BPC_8 : - (pps->bits_per_component ==10 ) ?BPC_10 :BPC_12 ; -float bpp = ((float ) pps->bits_per_pixel /16.0 ); -int slice_width = pps->slice_width; -int slice_height = pps->slice_height;int ret;struct rc_params rc;struct drm_dsc_config dsc_cfg; -double d_bytes_per_pixel =dsc_ceil (bpp * slice_width /8.0 ) / slice_width; - -// TODO: Make sure the formula for calculating this is precise (ceiling vs. floor, and at what point they should be applied) -if (pps->native_422 || pps->native_420) - d_bytes_per_pixel /=2 ; - - dsc_params->bytes_per_pixel = (uint32_t )dsc_ceil (d_bytes_per_pixel *0x10000000 ); - -/* in native_422 or native_420 modes, the bits_per_pixel is double the target bpp -* (the latter is what calc_rc_params expects)
drivers/gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c static void copy_rc_to_cfg(struct drm_dsc_config *dsc_cfg, const struct rc_param · line 110
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c +2
-4-*/ -if (pps->native_422 || pps->native_420) - bpp /=2.0 ; + dsc_params->bytes_per_pixel =calc_dsc_bytes_per_pixel (pps); -calc_rc_params (&rc, mode, bpc, bpp, slice_width, slice_height, pps->dsc_version_minor); +calc_rc_params (&rc, pps); dsc_params->pps = *pps; dsc_params->pps.initial_scale_value =8 * rc.rc_model_size / (rc.rc_model_size - rc.initial_fullness_offset);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/28 drm/amd/display: Fix incorrect dcn1 bandwidth calculations
In reply to Qingqing ZhuoFrom: Michael Strauss <[email protected]>
[WHY]
Typos cause bandwidth calculation errors, one
of which can cause infinite loop on dcn1 with eDP
--- drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.c +3 -3
@@ -805,7 +805,7 @@ void mode_support_and_system_configuration(struct dcn_bw_internal_vars *v)if (v->pte_enable == dcn_bw_yes && v->dcc_enable[k] == dcn_bw_yes) { v->time_for_meta_pte_without_immediate_flip =dcn_bw_max3 ( - v->meta_pte_bytes_frame[k] / v->prefetch_bandwidth[k], + v->meta_pte_bytes_frame[k] / v->prefetch_bw[k], v->extra_latency, v->htotal[k] / v->pixel_clock[k] /4.0 ); }else {
@@ -814,7 +814,7 @@ void mode_support_and_system_configuration(struct dcn_bw_internal_vars *v)if (v->pte_enable == dcn_bw_yes || v->dcc_enable[k] == dcn_bw_yes) { v->time_for_meta_and_dpte_row_without_immediate_flip =dcn_bw_max3 (( - v->meta_row_bytes[k] + v->dpte_bytes_per_row[k]) / v->prefetch_bandwidth[k], + v->meta_row_bytes[k] + v->dpte_bytes_per_row[k]) / v->prefetch_bw[k], v->htotal[k] / v->pixel_clock[k] - v->time_for_meta_pte_without_immediate_flip, v->extra_latency); }else {
@@ -827,7 +827,7 @@ void mode_support_and_system_configuration(struct dcn_bw_internal_vars *v) v->lines_for_meta_and_dpte_row_without_immediate_flip[k] =dcn_bw_floor2 (4.0 * (v->time_for_meta_and_dpte_row_without_immediate_flip / (v->htotal[k] / v->pixel_clock[k]) +0.125 ),1.0 ) /4 ; v->maximum_vstartup = v->maximum_vstartup -1 ; -if (v->lines_for_meta_pte_without_immediate_flip[k] <8.0 && v->lines_for_meta_and_dpte_row_without_immediate_flip[k] <16.0 ) +if (v->lines_for_meta_pte_without_immediate_flip[k] <32.0 && v->lines_for_meta_and_dpte_row_without_immediate_flip[k] <16.0 )break ; }while (1 );
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/28 drm/amd/display: [FW Promotion] Release 1.0.13
In reply to Qingqing ZhuoFrom: Anthony Koo <[email protected]>
[Header Changes]
- Version bump to 1.0.13
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +2 -2
@@ -36,10 +36,10 @@/* Firmware versioning. */ #ifdef DMUB_EXPOSE_VERSION -#define DMUB_FW_VERSION_GIT_HASH 0x718f63a96 +#define DMUB_FW_VERSION_GIT_HASH 0x3353119e1#define DMUB_FW_VERSION_MAJOR 1#define DMUB_FW_VERSION_MINOR 0 -#define DMUB_FW_VERSION_REVISION 12 +#define DMUB_FW_VERSION_REVISION 13#define DMUB_FW_VERSION_UCODE ((DMUB_FW_VERSION_MAJOR << 24) | (DMUB_FW_VERSION_MINOR << 16) | DMUB_FW_VERSION_REVISION)#endif
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/28 drm/amd/display: Move call to disable DPG
In reply to Qingqing ZhuoFrom: Wesley Chalmers <[email protected]>
[WHY]
Disabling DPG should happen after setting watermarks and clocks
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -1
@@ -1248,7 +1248,6 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *cint i, k, l;struct dc_stream_state *dc_streams[MAX_STREAMS ] = {0 }; -disable_dangling_plane (dc, context);for (i =0 ; i < context->stream_count; i++) dc_streams[i] = context->streams[i];
@@ -1264,6 +1263,7 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *cif (dc->optimize_seamless_boot_streams ==0 ) dc->hwss.prepare_bandwidth (dc, context); +disable_dangling_plane (dc, context);/* re-program planes for existing stream, in case we need to * free up plane resource for later use */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/28 drm/amd/display: Use u16 for drm_bpp in DSC calculations
In reply to Qingqing ZhuoFrom: Nicholas Kazlauskas <[email protected]>
[Why]
DSC calculations fail because the u16 bits_per_pixel from the DRM struct is being casted to the u8 drm_bpp parameters and locals. Integer wraparound is happening because this value is greater than 255.
[How]
Use u16 to match what's in the structure instead of u8.
--- drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c +4 -4
@@ -175,7 +175,7 @@ static int median3(int a, int b, int c) }static void _do_calc_rc_params (struct rc_params *rc,enum colour_mode cm, -enum bits_per_comp bpc,u8 drm_bpp, +enum bits_per_comp bpc,u16 drm_bpp,bool is_navite_422_or_420,int slice_width,int slice_height,int minor_version)
@@ -265,7 +265,7 @@ static void _do_calc_rc_params(struct rc_params *rc, enum colour_mode cm, rc->rc_buf_thresh[13 ] =8064 ; } -static u32 _do_bytes_per_pixel_calc (int slice_width,u8 drm_bpp, +static u32 _do_bytes_per_pixel_calc (int slice_width,u16 drm_bpp,bool is_navite_422_or_420) {float bpp;
@@ -321,7 +321,7 @@ void calc_rc_params(struct rc_params *rc, const struct drm_dsc_config *pps)enum colour_mode mode;enum bits_per_comp bpc;bool is_navite_422_or_420; -u8 drm_bpp = pps->bits_per_pixel; +u16 drm_bpp = pps->bits_per_pixel;int slice_width = pps->slice_width;int slice_height = pps->slice_height;
@@ -357,7 +357,7 @@ u32 calc_dsc_bytes_per_pixel(const struct drm_dsc_config *pps) {u32 ret; -u8 drm_bpp = pps->bits_per_pixel; +u16 drm_bpp = pps->bits_per_pixel;int slice_width = pps->slice_width;bool is_navite_422_or_420 = pps->native_422 || pps->native_420;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/28 drm/amd/display: Remove unused macro from dcn21
In reply to Qingqing ZhuoFrom: Roman Li <[email protected]>
[Why]SOC_BOUNDING_BOX_VALID is unused and not required for dcn21.
[How]
Remove it.
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +0 -1
@@ -88,7 +88,6 @@#include "dce/dmub_psr.h" #include "dce/dmub_abm.h" -#define SOC_BOUNDING_BOX_VALID false#define DC_LOGGER_INIT (logger)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/28 drm/amd/display: Revert "enable plane if plane_status changed"
In reply to Qingqing ZhuoFrom: Hugo Hu <[email protected]>
revert commit 77dcea7a0b133b362b2ebbf494eb13ee3e946836.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +1 -8
@@ -1209,20 +1209,13 @@ void dcn20_pipe_control_lock(static void dcn20_detect_pipe_changes (struct pipe_ctx *old_pipe,struct pipe_ctx *new_pipe) { -bool plane_state_update = false; new_pipe->update_flags.raw =0 ;/* Exit on unchanged, unused pipe */ if (!old_pipe->plane_state && !new_pipe->plane_state)return ; - -/* Detect plane state update */ -if (old_pipe->plane_state && new_pipe->plane_state - && (old_pipe->plane_state != new_pipe->plane_state)) { - plane_state_update = true; - }/* Detect pipe enable/disable */ -if ((!old_pipe->plane_state && new_pipe->plane_state) || plane_state_update) { +if (!old_pipe->plane_state && new_pipe->plane_state) { new_pipe->update_flags.bits.enable =1 ; new_pipe->update_flags.bits.mpcc =1 ; new_pipe->update_flags.bits.dppclk =1 ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/28 drm/amd/display: Fix VBA chroma calculation for pipe splitting
In reply to Qingqing ZhuoFrom: Nicholas Kazlauskas <[email protected]>
[Why]
DML failures occur for 420 modes with dynamic pipe splitting enabled because the ChromaViewport exceeds the ChromaSurfaceWidth.
This is caused by adding the viewport_width instead of the viewport_width_c.
This similarly occurs for rotated modes due to the use of viewport_height instead of viewport_height_c.
[How]
Correct the calculations.
--- drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +2 -2
@@ -623,14 +623,14 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib) mode_lib->vba.ViewportWidth[mode_lib->vba.NumberOfActivePlanes] += src_k->viewport_width; mode_lib->vba.ViewportWidthChroma[mode_lib->vba.NumberOfActivePlanes] += - src_k->viewport_width; + src_k->viewport_width_c; mode_lib->vba.ScalerRecoutWidth[mode_lib->vba.NumberOfActivePlanes] += dst_k->recout_width; }else { mode_lib->vba.ViewportHeight[mode_lib->vba.NumberOfActivePlanes] += src_k->viewport_height; mode_lib->vba.ViewportHeightChroma[mode_lib->vba.NumberOfActivePlanes] += - src_k->viewport_height; + src_k->viewport_height_c; } mode_lib->vba.NumberOfDSCSlices[mode_lib->vba.NumberOfActivePlanes] += dout_k->dsc_slices;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/28 drm/amd/display: update audio wall clock programming
In reply to Qingqing ZhuoFrom: Charlene Liu <[email protected]>
[why]
for audio on real TV issue.
[how]
-add wall clock programming for DPREF based when
Pixel clock is done by DP DTO.
--- drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 4 +++- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +3 -1
@@ -140,6 +140,8 @@ static void check_audio_bandwidth_hdmi(bool limit_freq_to_88_2_khz = false;bool limit_freq_to_96_khz = false;bool limit_freq_to_174_4_khz = false; +if (!crtc_info) +return ;/* For two channels supported return whatever sink support,unmodified*/ if (channel_count >2 ) {
@@ -784,7 +786,7 @@ void dce_aud_wall_dto_setup(struct azalia_clock_info clock_info = {0 }; -if (dc_is_hdmi_signal (signal)) { +if (dc_is_hdmi_tmds_signal (signal)) {uint32_t src_sel;/*DTO0 Programming goal:
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -3
@@ -1148,7 +1148,7 @@ static void build_audio_output( pipe_ctx->stream_res.pix_clk_params.requested_pix_clk_100hz;/*for HDMI, audio ACR is with deep color ratio factor*/ -if (dc_is_hdmi_signal (pipe_ctx->stream->signal) && +if (dc_is_hdmi_tmds_signal (pipe_ctx->stream->signal) && audio_output->crtc_info.requested_pixel_clock_100Hz == (stream->timing.pix_clk_100hz)) {if (pipe_ctx->stream_res.pix_clk_params.pixel_encoding ==PIXEL_ENCODING_YCBCR420 ) {
@@ -1963,10 +1963,8 @@ static void dce110_setup_audio_dto(if (pipe_ctx->top_pipe)continue ; -if (pipe_ctx->stream->signal !=SIGNAL_TYPE_HDMI_TYPE_A )continue ; -if (pipe_ctx->stream_res.audio !=NULL ) {struct audio_output audio_output;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/28 drm/amd/display: [FW Promotion] Release 1.0.14
In reply to Qingqing ZhuoFrom: Anthony Koo <[email protected]>
[Header Changes]
- Add SDP transmission deadline for PSR config cmd
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +4 -2
@@ -36,10 +36,10 @@/* Firmware versioning. */ #ifdef DMUB_EXPOSE_VERSION -#define DMUB_FW_VERSION_GIT_HASH 0x3353119e1 +#define DMUB_FW_VERSION_GIT_HASH 0x5470fd231#define DMUB_FW_VERSION_MAJOR 1#define DMUB_FW_VERSION_MINOR 0 -#define DMUB_FW_VERSION_REVISION 13 +#define DMUB_FW_VERSION_REVISION 14#define DMUB_FW_VERSION_UCODE ((DMUB_FW_VERSION_MAJOR << 24) | (DMUB_FW_VERSION_MINOR << 16) | DMUB_FW_VERSION_REVISION)#endif
@@ -421,6 +421,8 @@ struct dmub_cmd_psr_copy_settings_data {uint8_t frame_delay;uint8_t frame_cap_ind;uint8_t pad[3 ]; +uint16_t init_sdp_deadline; +uint16_t pad2; };struct dmub_rb_cmd_psr_copy_settings {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/28 drm/amd/display: 3.2.88
In reply to Qingqing ZhuoFrom: Aric Cyr <[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
@@ -42,7 +42,7 @@#include "inc/hw/dmcu.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.2.87" +#define DC_VER "3.2.88"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/28 drm/amd/display: Force delay after DP receive power up
In reply to Qingqing ZhuoFrom: Martin Tsai <[email protected]>
[Why]
Some sprcified monitor scalar cannot recognize timing change on demand. Once the link phy disable and enable during a short period then the Sink protection mechanism could keep the screen in blank and cannot be recoverred.
[How]
To add 100ms delay between enable link phy and link training.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 7 ++++--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +4 -3
@@ -1559,9 +1559,10 @@ bool perform_link_training_with_retries( pipe_ctx->clock_source->id, link_setting); -if (stream->sink_patches.dppowerup_delay >0 ) { -int delay_dp_power_up_in_ms = stream->sink_patches.dppowerup_delay; - +if ((link && link->dc->debug.dppowerup_delay >0 ) || stream->sink_patches.dppowerup_delay >0 ) { +int delay_dp_power_up_in_ms = + (link->dc->debug.dppowerup_delay >= stream->sink_patches.dppowerup_delay) ? + link->dc->debug.dppowerup_delay : stream->sink_patches.dppowerup_delay;msleep (delay_dp_power_up_in_ms); }
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -498,6 +498,7 @@ struct dc_debug_options {bool usbc_combo_phy_reset_wa;bool disable_dsc;bool enable_dram_clock_change_one_display_vactive; +unsigned int dppowerup_delay; };struct dc_debug_data {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/28 drm/amd/display: Passing initial SDP deadline to dmub
In reply to Qingqing ZhuoFrom: po-tchen <[email protected]>
[Why]
The SDP deadline indicate the vertical time to send CRC infopacket in PSR.
--- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +1 -0
@@ -233,6 +233,7 @@ static bool dmub_psr_copy_settings(struct dmub_psr *dmub, copy_settings_data->frame_cap_ind = psr_context->psrFrameCaptureIndicationReq; copy_settings_data->debug.bitfields.visual_confirm = dc->dc->debug.visual_confirm ==VISUAL_CONFIRM_PSR ? true : false; + copy_settings_data->init_sdp_deadline = psr_context->sdpTransmitLineNumDeadline;dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd);dc_dmub_srv_cmd_execute (dc->dmub_srv);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/28 drm/amd/display: runtime select dmub emulatior.
In reply to Qingqing ZhuoFrom: Yongqiang Sun <[email protected]>
[Why & How]
Add emul specific hw function to dmub, in case of emulator is created, we can runtime switch between dmub emulator or dmub uC via is_virtual flag in dmub.
--- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 4 ++++ drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +4 -0
@@ -256,6 +256,10 @@ struct dmub_srv_hw_funcs {void (*set_inbox1_wptr)(struct dmub_srv *dmub,uint32_t wptr_offset); +uint32_t (*emul_get_inbox1_rptr)(struct dmub_srv *dmub); + +void (*emul_set_inbox1_wptr)(struct dmub_srv *dmub,uint32_t wptr_offset); +bool (*is_supported)(struct dmub_srv *dmub);bool (*is_hw_init)(struct dmub_srv *dmub);
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +8 -8
@@ -199,13 +199,13 @@ enum dmub_status dmub_srv_create(struct dmub_srv *dmub,/* Override (some) hardware funcs based on user params. */ if (params->hw_funcs) { -if (params->hw_funcs->get_inbox1_rptr) - dmub->hw_funcs.get_inbox1_rptr = - params->hw_funcs->get_inbox1_rptr; +if (params->hw_funcs->emul_get_inbox1_rptr) + dmub->hw_funcs.emul_get_inbox1_rptr = + params->hw_funcs->emul_get_inbox1_rptr; -if (params->hw_funcs->set_inbox1_wptr) - dmub->hw_funcs.set_inbox1_wptr = - params->hw_funcs->set_inbox1_wptr; +if (params->hw_funcs->emul_set_inbox1_wptr) + dmub->hw_funcs.emul_set_inbox1_wptr = + params->hw_funcs->emul_set_inbox1_wptr;if (params->hw_funcs->is_supported) dmub->hw_funcs.is_supported =
@@ -502,7 +502,7 @@ enum dmub_status dmub_srv_cmd_execute(struct dmub_srv *dmub)*/ dmub_rb_flush_pending (&dmub->inbox1_rb); - dmub->hw_funcs.set_inbox1_wptr (dmub, dmub->inbox1_rb.wrpt); + dmub->hw_funcs.set_inbox1_wptr (dmub, dmub->inbox1_rb.wrpt);return DMUB_STATUS_OK ; }
@@ -557,7 +557,7 @@ enum dmub_status dmub_srv_wait_for_idle(struct dmub_srv *dmub,return DMUB_STATUS_INVALID ;for (i =0 ; i <= timeout_us; ++i) { - dmub->inbox1_rb.rptr = dmub->hw_funcs.get_inbox1_rptr (dmub); + dmub->inbox1_rb.rptr = dmub->hw_funcs.get_inbox1_rptr (dmub);if (dmub_rb_empty (&dmub->inbox1_rb))return DMUB_STATUS_OK ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 16/28 drm/amd/display: remove unnecessary mpcc updates
In reply to Qingqing ZhuoFrom: Dmytro Laktyushkin <[email protected]>
We were updating mpcc if there were tree changes which is unnecessary since any mpcc being added or removed will automatically update the tree.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +6 -7
@@ -1265,14 +1265,13 @@ static void dcn20_detect_pipe_changes(struct pipe_ctx *old_pipe, struct pipe_ctxif (old_pipe->stream_res.tg != new_pipe->stream_res.tg) new_pipe->update_flags.bits.tg_changed =1 ; -/* Detect mpcc blending changes, only dpp inst and bot matter here */ +/* +* Detect mpcc blending changes, only dpp inst and opp matter here, +* mpccs getting removed/inserted update connected ones during their own +* programming +*/ if (old_pipe->plane_res.dpp != new_pipe->plane_res.dpp - || old_pipe->stream_res.opp != new_pipe->stream_res.opp - || (!old_pipe->bottom_pipe && new_pipe->bottom_pipe) - || (old_pipe->bottom_pipe && !new_pipe->bottom_pipe) - || (old_pipe->bottom_pipe && new_pipe->bottom_pipe - && old_pipe->bottom_pipe->plane_res.mpcc_inst - != new_pipe->bottom_pipe->plane_res.mpcc_inst)) + || old_pipe->stream_res.opp != new_pipe->stream_res.opp) new_pipe->update_flags.bits.mpcc =1 ;/* Detect dppclk change */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 17/28 drm/amd/display: Revert "DP link layer test 4.2.1.1 fix due to specs update"
In reply to Qingqing ZhuoFrom: Wenjing Liu <[email protected]>
[why]
The change causes some regression in a common use case. Will need more investigation before fixing the original issue.
[how]
This reverts commit ad418864c63a1718f9e283207b3fac96fbc148c2.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +- .../gpu/drm/amd/display/dc/core/dc_link_ddc.c | 13 ++-- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 59 ++++++++++--------- .../drm/amd/display/dc/core/dc_link_hwss.c | 2 +- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- drivers/gpu/drm/amd/display/dc/dc_link.h | 1 - .../drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- .../gpu/drm/amd/display/dc/inc/dc_link_ddc.h | 2 +- .../gpu/drm/amd/display/dc/inc/dc_link_dp.h | 2 +- 9 files changed, 42 insertions(+), 45 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -3
@@ -690,11 +690,9 @@ static bool detect_dp(struct dc_link *link,if (sink_caps->transaction_type ==DDC_TRANSACTION_TYPE_I2C_OVER_AUX ) { sink_caps->signal =SIGNAL_TYPE_DISPLAY_PORT ; - +dpcd_set_source_specific_data (link);if (!detect_dp_sink_caps (link))return false; -dpcd_set_source_specific_data (link); -if (is_mst_supported (link)) { sink_caps->signal =SIGNAL_TYPE_DISPLAY_PORT_MST ; link->type = dc_connection_mst_branch;
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +6 -7
@@ -648,17 +648,16 @@ bool dc_link_aux_transfer_with_retries(struct ddc_service *ddc, } -bool dc_link_aux_try_to_configure_timeout (struct ddc_service *ddc, +uint32_t dc_link_aux_configure_timeout (struct ddc_service *ddc,uint32_t timeout) { -bool result = false; +uint32_t prev_timeout =0 ;struct ddc *ddc_pin = ddc->ddc_pin; -if (ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en]->funcs->configure_timeout) { - ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en]->funcs->configure_timeout (ddc, timeout); - result = true; - } -return result; +if (ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en]->funcs->configure_timeout) + prev_timeout = + ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en]->funcs->configure_timeout (ddc, timeout); +return prev_timeout; }/*test only function*/
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +30 -29
128 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +1 -1
@@ -281,7 +281,7 @@ void dp_set_hw_lane_settings( {struct link_encoder *encoder = link->link_enc; -if (link->lttpr_non_transparent_mode && !is_immediate_downstream (link, offset)) +if (!link->is_lttpr_mode_transparent && !is_immediate_downstream (link, offset))return ;/* call Encoder to set lane settings */
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -283,7 +283,7 @@ struct dc_config {bool edp_not_connected;bool force_enum_edp;bool forced_clocks; -bool allow_lttpr_non_transparent_mode; +bool disable_extended_timeout_support;// Used to disable extended timeout and lttpr feature as well bool multi_mon_pp_mclk_switch;bool disable_dmcu;bool enable_4to1MPC;
drivers/gpu/drm/amd/display/dc/dc_link.h +0 -1
@@ -101,7 +101,6 @@ struct dc_link {bool aux_access_disabled;bool sync_lt_in_progress;bool is_lttpr_mode_transparent; -bool lttpr_non_transparent_mode;/* caps is the same as reported_link_cap. link_traing use * reported_link_cap. Will clean up. TODO
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1 -1
@@ -1806,7 +1806,7 @@ static bool dcn21_resource_construct( dc->caps.max_slave_planes =1 ; dc->caps.post_blend_color_processing = true; dc->caps.force_dp_tps4_for_cp2520 = true; - dc->caps.extended_aux_timeout_support = true; + dc->caps.extended_aux_timeout_support = false; dc->caps.dmcub_support = true; dc->caps.is_apu = true;
drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h +1 -1
@@ -105,7 +105,7 @@ int dc_link_aux_transfer_raw(struct ddc_service *ddc,bool dc_link_aux_transfer_with_retries (struct ddc_service *ddc,struct aux_payload *payload); -bool dc_link_aux_try_to_configure_timeout (struct ddc_service *ddc, +uint32_t dc_link_aux_configure_timeout (struct ddc_service *ddc,uint32_t timeout); void dal_ddc_service_write_scdc_data(
drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h +1 -1
@@ -28,7 +28,7 @@#define LINK_TRAINING_ATTEMPTS 4#define LINK_TRAINING_RETRY_DELAY 50/* ms */ -#define LINK_AUX_DEFAULT_LTTPR_TIMEOUT_PERIOD 3200/*us*/ +#define LINK_AUX_DEFAULT_EXTENDED_TIMEOUT_PERIOD 3200/*us*/ #define LINK_AUX_DEFAULT_TIMEOUT_PERIOD 552/*us*/ struct dc_link ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 18/28 drm/amd/display: add support for per-state dummy-pstate latency
In reply to Qingqing ZhuoFrom: Jun Lei <[email protected]>
[why]
Dummy pstate latency actually varies between different UCLK frequencies, when calculating watermark C, if DAL always assumes worst case, then it can lead to dummy pstate not supported scenarios.
[how]
Rather than statically calculating dummy pstate using worst case, we store the entire table of UCLK to dummy pstate relationships. On a per mode basis, we calculate the actual UCLK lower limit, and use the dynamic worst case dummy pstate latency. This prevents the situation where we don't support full p-state (which will force high DPM), but still use low DPM dummy pstate latency.
--- drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h +6 -0
@@ -198,11 +198,17 @@ struct wm_table {#endif }; +struct dummy_pstate_entry { +unsigned int dram_speed_mts; +unsigned int dummy_pstate_latency_us; +}; +struct clk_bw_params {unsigned int vram_type;unsigned int num_channels;struct clk_limit_table clk_table;struct wm_table wm_table; +struct dummy_pstate_entry dummy_pstate_table[4 ]; };/* Public interfaces */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 19/28 drm/amd/display: Add helper to convert DC status
In reply to Qingqing ZhuoFrom: Rodrigo Siqueira <[email protected]>
During the debugging process related to a hot-plug problem with 4k display, we realized that we had some issues related to the global state validation. This problem was not explicitly highlighted in the dmesg log, for this reason, this commit adds a function that converts enum dc_status to a human-readable string and appends the proper warning message in case of failure.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 ++-- .../gpu/drm/amd/display/dc/core/dc_debug.c | 59 +++++++++++++++++++ .../gpu/drm/amd/display/dc/inc/core_status.h | 2 + 3 files changed, 69 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8 -5
@@ -5152,11 +5152,12 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector, dc_result =dc_validate_stream (adev->dm.dc, stream);if (dc_result !=DC_OK ) { -DRM_DEBUG_KMS ("Mode %dx%d (clk %d) failed DC validation with error %d\n" , +DRM_DEBUG_KMS ("Mode %dx%d (clk %d) failed DC validation with error %d (%s)\n" , drm_mode->hdisplay, drm_mode->vdisplay, drm_mode->clock, - dc_result); + dc_result, +dc_status_to_str (dc_result));dc_stream_release (stream); stream =NULL ;
@@ -8593,7 +8594,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,struct drm_plane_state *old_plane_state, *new_plane_state;enum surface_update_type update_type =UPDATE_TYPE_FAST ;enum surface_update_type overall_update_type =UPDATE_TYPE_FAST ; - +enum dc_status status;int ret, i;/*
@@ -8805,8 +8806,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, ret =drm_dp_mst_atomic_check (state);if (ret) goto fail; - -if (dc_validate_global_state (dc, dm_state->context, false) !=DC_OK ) { + status =dc_validate_global_state (dc, dm_state->context, false); +if (status !=DC_OK ) { +DC_LOG_WARNING ("DC global validation failure: %s (%d)" , +dc_status_to_str (status), status); ret = -EINVAL ; goto fail; }
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +59 -0
62 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/core_status.h +2 -0
@@ -53,4 +53,6 @@ enum dc_status {DC_ERROR_UNEXPECTED =-1 }; +char *dc_status_to_str (enum dc_status status); +#endif /* _CORE_STATUS_H_ */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 20/28 drm/amd/display: make calculate watermarks a function pointer
In reply to Qingqing ZhuoFrom: Dmytro Laktyushkin <[email protected]>
To allow code reuse with minimal duplication watermark calculation needs to be function pointer.
--- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/inc/core_types.h +5 -1
@@ -101,7 +101,11 @@ struct resource_funcs {struct dc *dc, struct dc_state *context, bool fast_validate); - +void (*calculate_wm)( +struct dc *dc,struct dc_state *context, +display_e2e_pipe_params_st *pipes, +int pipe_cnt, +int vlevel); int (*populate_dml_pipes)( struct dc *dc, struct dc_state *context,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 21/28 drm/amd/display: Enable use of dmub iff dmcu is disabled
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
[Why & How]
DMUB command table should be allowed to be used
only if dmcu is explicitly disabled.
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +2 -0
@@ -1906,6 +1906,8 @@ static bool dcn21_resource_construct(BREAK_TO_DEBUGGER (); goto create_fail; } + + dc->debug.dmub_command_table = false; }if (dc->config.disable_dmcu) {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 22/28 drm/amd/display: Improve DisplayPort monitor interop
In reply to Qingqing ZhuoFrom: Aric Cyr <[email protected]>
[Why]
DC is very fast at link training and stream enablement which causes issues such as blackscreens for non-compliant monitors.
[How]
After debugging with scaler vendors we implement the minimum delays at the necessary locations to ensure the monitor does not hang. Delays are generic due to lack of IEEE OUI information on the failing displays.
Also reverts commit b9976bd920a19d509de09b6dc727fcaae60fbb32.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +++- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 23 +++++++++++-------- drivers/gpu/drm/amd/display/dc/dc.h | 1 - .../display/dc/dce110/dce110_hw_sequencer.c | 11 ++++++++- 4 files changed, 26 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +3 -1
@@ -3309,9 +3309,11 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx)write_i2c_redriver_setting (pipe_ctx, false); } } - dc->hwss.disable_stream (pipe_ctx);disable_link (pipe_ctx->stream->link, pipe_ctx->stream->signal); + + dc->hwss.disable_stream (pipe_ctx); +if (pipe_ctx->stream->timing.flags.DSC) {if (dc_is_dp_signal (pipe_ctx->stream->signal))dp_set_dsc_enable (pipe_ctx, false);
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +13 -10
@@ -1102,6 +1102,10 @@ static inline enum link_training_result perform_link_training_int( dpcd_pattern.v1_4.TRAINING_PATTERN_SET =DPCD_TRAINING_PATTERN_VIDEOIDLE ;dpcd_set_training_pattern (link, dpcd_pattern); +/* delay 5ms after notifying sink of idle pattern before switching output */ +if (link->connector_signal !=SIGNAL_TYPE_EDP ) +msleep (5 ); +/* 4. mainlink output idle pattern*/ dp_set_hw_test_pattern (link,DP_TEST_PATTERN_VIDEO_MODE ,NULL ,0 );
@@ -1551,6 +1555,12 @@ bool perform_link_training_with_retries(struct dc_link *link = stream->link;enum dp_panel_mode panel_mode =dp_get_panel_mode (link); +/* We need to do this before the link training to ensure the idle pattern in SST +* mode will be sent right after the link training +*/ + link->link_enc->funcs->connect_dig_be_to_fe (link->link_enc, + pipe_ctx->stream_res.stream_enc->id, true); +for (j =0 ; j < attempts; ++j) { dp_enable_link_phy(
@@ -1559,21 +1569,14 @@ bool perform_link_training_with_retries( pipe_ctx->clock_source->id, link_setting); -if ((link && link->dc->debug.dppowerup_delay >0 ) || stream->sink_patches.dppowerup_delay >0 ) { -int delay_dp_power_up_in_ms = - (link->dc->debug.dppowerup_delay >= stream->sink_patches.dppowerup_delay) ? - link->dc->debug.dppowerup_delay : stream->sink_patches.dppowerup_delay; +if (stream->sink_patches.dppowerup_delay >0 ) { +int delay_dp_power_up_in_ms = stream->sink_patches.dppowerup_delay; +msleep (delay_dp_power_up_in_ms); }dp_set_panel_mode (link, panel_mode); -/* We need to do this before the link training to ensure the idle pattern in SST -* mode will be sent right after the link training -*/ - link->link_enc->funcs->connect_dig_be_to_fe (link->link_enc, - pipe_ctx->stream_res.stream_enc->id, true); -if (link->aux_access_disabled) {dc_link_dp_perform_link_training_skip_aux (link, link_setting);return true;
drivers/gpu/drm/amd/display/dc/dc.h +0 -1
@@ -498,7 +498,6 @@ struct dc_debug_options {bool usbc_combo_phy_reset_wa;bool disable_dsc;bool enable_dram_clock_change_one_display_vactive; -unsigned int dppowerup_delay; };struct dc_debug_data {
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +10 -1
@@ -1069,8 +1069,17 @@ void dce110_blank_stream(struct pipe_ctx *pipe_ctx) link->dc->hwss.set_abm_immediate_disable (pipe_ctx); } -if (dc_is_dp_signal (pipe_ctx->stream->signal)) +if (dc_is_dp_signal (pipe_ctx->stream->signal)) { pipe_ctx->stream_res.stream_enc->funcs->dp_blank (pipe_ctx->stream_res.stream_enc); + +/* +* After output is idle pattern some sinks need time to recognize the stream +* has changed or they enter protection state and hang. +*/ +if (!dc_is_embedded_signal (pipe_ctx->stream->signal)) +msleep (60 ); + } + }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 23/28 drm/amd/display: change global buffer to local buffer
In reply to Qingqing ZhuoFrom: Lewis Huang <[email protected]>
[Why]
Multi-adapter calculate regamma table at the same time. Two thread used the same global variable cause race condition.
[How]
Change global buffer to local buffer
--- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 10 +- .../drm/amd/display/modules/color/Makefile | 4 + .../amd/display/modules/color/color_gamma.c | 115 ++++++++++-------- .../amd/display/modules/color/color_gamma.h | 18 ++- .../amd/display/modules/color/color_table.c | 48 ++++++++ .../amd/display/modules/color/color_table.h | 47 +++++++ 6 files changed, 183 insertions(+), 59 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/modules/color/color_table.c create mode 100644 drivers/gpu/drm/amd/display/modules/color/color_table.h
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +8 -2
@@ -195,10 +195,13 @@ static int __set_legacy_tf(struct dc_transfer_func *func, bool has_rom) {struct dc_gamma *gamma =NULL ; +struct calculate_buffer cal_buffer = {0 };bool res;ASSERT (lut && lut_size ==MAX_COLOR_LEGACY_LUT_ENTRIES ); + cal_buffer.buffer_index =-1 ; + gamma =dc_create_gamma ();if (!gamma)return -ENOMEM ;
@@ -208,7 +211,7 @@ static int __set_legacy_tf(struct dc_transfer_func *func,__drm_lut_to_dc_gamma (lut, gamma, true); res =mod_color_calculate_regamma_params (func, gamma, true, has_rom, -NULL ); +NULL , &cal_buffer);dc_gamma_release (&gamma);
@@ -221,10 +224,13 @@ static int __set_output_tf(struct dc_transfer_func *func, bool has_rom) {struct dc_gamma *gamma =NULL ; +struct calculate_buffer cal_buffer = {0 };bool res;ASSERT (lut && lut_size ==MAX_COLOR_LUT_ENTRIES ); + cal_buffer.buffer_index =-1 ; + gamma =dc_create_gamma ();if (!gamma)return -ENOMEM ;
@@ -248,7 +254,7 @@ static int __set_output_tf(struct dc_transfer_func *func,*/ gamma->type =GAMMA_CS_TFM_1D ; res =mod_color_calculate_regamma_params (func, gamma, false, - has_rom,NULL ); + has_rom,NULL , &cal_buffer); }dc_gamma_release (&gamma);
drivers/gpu/drm/amd/display/modules/color/Makefile +4 -0
@@ -25,6 +25,10 @@ MOD_COLOR = color_gamma.o +ifdef CONFIG_DRM_AMD_DC_DCN +MOD_COLOR += color_table.o +endif + AMD_DAL_MOD_COLOR = $(addprefix $(AMDDALPATH)/modules/color/,$(MOD_COLOR)) #$(info ************ DAL COLOR MODULE MAKEFILE ************)
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +61 -54
326 lines not on this page · raw message
drivers/gpu/drm/amd/display/modules/color/color_gamma.h +15 -3
@@ -26,6 +26,8 @@#ifndef COLOR_MOD_COLOR_GAMMA_H_ #define COLOR_MOD_COLOR_GAMMA_H_ +#include "color_table.h" +struct dc_transfer_func ;struct dc_gamma ;struct dc_transfer_func_distributed_points ;
@@ -83,6 +85,12 @@ struct freesync_hdr_tf_params {unsigned int skip_tm;// skip tm }; +struct calculate_buffer { +int buffer_index; +struct fixed31_32 buffer[NUM_PTS_IN_REGION ]; +struct fixed31_32 gamma_of_2; +}; +struct translate_from_linear_space_args {struct fixed31_32 arg;struct fixed31_32 a0;
@@ -90,6 +98,7 @@ struct translate_from_linear_space_args {struct fixed31_32 a2;struct fixed31_32 a3;struct fixed31_32 gamma; +struct calculate_buffer *cal_buffer; };void setup_x_points_distribution (void );
@@ -99,7 +108,8 @@ void precompute_de_pq(void);bool mod_color_calculate_regamma_params (struct dc_transfer_func *output_tf,const struct dc_gamma *ramp,bool mapUserRamp,bool canRomBeUsed, -const struct freesync_hdr_tf_params *fs_params); +const struct freesync_hdr_tf_params *fs_params, +struct calculate_buffer *cal_buffer); bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps, struct dc_transfer_func *output_tf,
@@ -109,10 +119,12 @@ bool mod_color_calculate_degamma_curve(enum dc_transfer_func_predefined trans, struct dc_transfer_func_distributed_points *points);bool calculate_user_regamma_coeff (struct dc_transfer_func *output_tf, -const struct regamma_lut *regamma); +const struct regamma_lut *regamma, +struct calculate_buffer *cal_buffer);bool calculate_user_regamma_ramp (struct dc_transfer_func *output_tf, -const struct regamma_lut *regamma); +const struct regamma_lut *regamma, +struct calculate_buffer *cal_buffer);#endif /* COLOR_MOD_COLOR_GAMMA_H_ */
drivers/gpu/drm/amd/display/modules/color/color_table.c new file +48 -0
48 lines not on this page · raw message
drivers/gpu/drm/amd/display/modules/color/color_table.h new file +47 -0
47 lines not on this page · raw message
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 24/28 drm/amd/display: Disable pipe split for modes with borders
In reply to Qingqing ZhuoFrom: Dale Zhao <[email protected]>
[Why]
For some special timing with border, like DMT 640*480 72Hz, pipe split can't handle well. Thus, it will be black screen for these special timing.
[How]
Disable pipe split for these timing with borders as W/A.
--- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +17 -0
@@ -2666,6 +2666,23 @@ int dcn20_validate_apply_pipe_split_flags(if (plane_count > dc->res_pool->pipe_count /2 ) avoid_split = true; +/* W/A: Mode timing with borders may not work well with pipe split, avoid for this corner case */ +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; +struct dc_crtc_timing timing; + +if (!pipe->stream) +continue ; +else { + timing = pipe->stream->timing; +if (timing.h_border_left + timing.h_border_right + + timing.v_border_top + timing.v_border_bottom >0 ) { + avoid_split = true; +break ; + } + } + } +/* Avoid split loop looks for lowest voltage level that allows most unsplit pipes possible */ if (avoid_split) {for (i =0 , pipe_idx =0 ; i < dc->res_pool->pipe_count; i++) {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 25/28 drm/amd/display: not reset dmub in driver.
In reply to Qingqing ZhuoFrom: Yongqiang Sun <[email protected]>
[Why]
during S0i3, set power state is toggled a few times, and dmub uC will restart with current reset/hw_init.
[How]
Remove reset in set power state, and before doing hw_init, check if dmub is enabled, and doing FW autoload check only if dmub is already enabled.
--- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c +5 -1
@@ -275,7 +275,11 @@ void dmub_dcn20_set_inbox1_wptr(struct dmub_srv *dmub, uint32_t wptr_offset)bool dmub_dcn20_is_hw_init (struct dmub_srv *dmub) { -return REG_READ (DMCUB_REGION3_CW2_BASE_ADDRESS ) !=0 ; +uint32_t is_hw_init; + +REG_GET (DMCUB_CNTL ,DMCUB_ENABLE , &is_hw_init); + +return is_hw_init !=0 ; }bool dmub_dcn20_is_supported (struct dmub_srv *dmub)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 26/28 drm/amd/display: Not doing bios data pack.
In reply to Qingqing ZhuoFrom: Yongqiang Sun <[email protected]>
[Why]
dmub FW running abnormal after resume from S0i3 due to data aliagnment issue.
[How]
Before having a solution for this issue, temparory not doing data pack.
--- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +5 -0
@@ -1880,10 +1880,12 @@ static enum bp_result bios_get_board_layout_info(return BP_RESULT_OK ; } +static uint16_t bios_parser_pack_data_tables (struct dc_bios *dcb,void *dst) { +#ifdef PACK_BIOS_DATA struct bios_parser *bp =BP_FROM_DCB (dcb);struct atom_rom_header_v2_2 *rom_header =NULL ;struct atom_rom_header_v2_2 *packed_rom_header =NULL ;
@@ -1975,6 +1977,9 @@ static uint16_t bios_parser_pack_data_tables( } }return packed_data_tbl_offset; +#endif +// TODO: There is data bytes alignment issue, disable it for now. +return 0 ; }static const struct dc_vbios_funcs vbios_funcs = {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 27/28 drm/amd/display: [FW Promotion] Release 1.0.15
In reply to Qingqing ZhuoFrom: Anthony Koo <[email protected]>
[Header Changes]
- Add new initialization bits for driver to check
firmware status
- Add command for HW locking via DMUB
--- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 68 ++++++++++++++++++- 1 file changed, 65 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +65 -3
@@ -36,10 +36,10 @@/* Firmware versioning. */ #ifdef DMUB_EXPOSE_VERSION -#define DMUB_FW_VERSION_GIT_HASH 0x5470fd231 +#define DMUB_FW_VERSION_GIT_HASH 0xee850bb2f#define DMUB_FW_VERSION_MAJOR 1#define DMUB_FW_VERSION_MINOR 0 -#define DMUB_FW_VERSION_REVISION 14 +#define DMUB_FW_VERSION_REVISION 15#define DMUB_FW_VERSION_UCODE ((DMUB_FW_VERSION_MAJOR << 24) | (DMUB_FW_VERSION_MINOR << 16) | DMUB_FW_VERSION_REVISION)#endif
@@ -137,8 +137,31 @@ union dmub_fw_meta { };#pragma pack(pop) + +//============================================================================== +//< DMUB_STATUS>================================================================ +//============================================================================== + +/** +* DMCUB scratch registers can be used to determine firmware status. +* Current scratch register usage is as follows: +* +* SCRATCH0: Legacy status register +* SCRATCH1: Firmware version +* SCRATCH2: Firmware status bits defined by dmub_fw_status_bit +* SCRATCH3: Reserved firmware status bits +*/ + +/** +* DMCUB firmware status bits for SCRATCH2. +*/ +enum dmub_fw_status_bit { +DMUB_FW_STATUS_BIT_DAL_FIRMWARE = (1 <<0 ), +DMUB_FW_STATUS_BIT_COMMAND_TABLE_READY = (1 <<1 ), +}; +//============================================================================== -//</DMUB_META>================================================================== +//</DMUB_STATUS>================================================================ //============================================================================== //< DMUB_VBIOS>================================================================= //==============================================================================
@@ -230,6 +253,7 @@ enum dmub_cmd_type {DMUB_CMD__PLAT_54186_WA =5 ,DMUB_CMD__PSR =64 ,DMUB_CMD__ABM =66 , +DMUB_CMD__HW_LOCK =69 , DMUB_CMD__VBIOS = 128, };
@@ -453,6 +477,44 @@ struct dmub_rb_cmd_psr_set_version {struct dmub_cmd_psr_set_version_data psr_set_version_data; }; +union dmub_hw_lock_flags { +struct { +uint8_t lock_pipe :1 ; +uint8_t lock_cursor :1 ; +uint8_t lock_dig :1 ; +uint8_t triple_buffer_lock :1 ; + } bits; + +uint8_t u8All; +}; + +struct dmub_hw_lock_inst_flags { +uint8_t otg_inst; +uint8_t opp_inst; +uint8_t dig_inst; +uint8_t pad; +}; + +enum hw_lock_client { +HW_LOCK_CLIENT_DRIVER =0 , +HW_LOCK_CLIENT_FW , +HW_LOCK_CLIENT_INVALID =0xFFFFFFFF , +}; + +struct dmub_cmd_lock_hw_data { +enum hw_lock_client client; +struct dmub_hw_lock_inst_flags inst_flags; +union dmub_hw_lock_flags hw_locks; +uint8_t lock; +uint8_t should_release; +uint8_t pad; +}; + +struct dmub_rb_cmd_lock_hw { +struct dmub_cmd_header header; +struct dmub_cmd_lock_hw_data lock_hw_data; +}; +enum dmub_cmd_abm_type {DMUB_CMD__ABM_INIT_CONFIG =0 ,DMUB_CMD__ABM_SET_PIPE =1 ,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 28/28 drm/amd/display: 3.2.89
In reply to Qingqing ZhuoFrom: Aric Cyr <[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
@@ -42,7 +42,7 @@#include "inc/hw/dmcu.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.2.88" +#define DC_VER "3.2.89"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx