DC Patches 20 April 2020
cover DC Patches 20 April 2020
This DC patchset brings improvements in multiple areas. In summary, we hightlight:
* DC version 3.2.83.1
* Enhancements and refactoring in DMUB
* Improvments for DCN2, backlight and others
__
Anthony Koo (1):
drm/amd/display: clean up some header paths
Aric Cyr (4):
drm/amd/display: 3.2.82
drm/amd/display: Use cursor locking to prevent flip delays drm/amd/display: 3.2.83
drm/amd/display: 3.2.83.1
Dmytro Laktyushkin (2):
drm/amd/display: check if REFCLK_CNTL register is present drm/amd/display: fix rn soc bb update
Joshua Aberback (2):
drm/amd/display: Add DML variable for future asics drm/amd/display: Add dummy p-state latency bounding box override
Krunoslav Kovac (1):
drm/amd/display: Internal refactoring to abstract color caps
Nicholas Kazlauskas (3):
drm/amd/display: Fix DMUB meta offset for new load method drm/amd/display: Defer cursor update around VUPDATE for all ASIC drm/amd/display: Pass command instead of header into DMUB service
Sung Lee (4):
drm/amd/display: Do not disable pipe split if mode is not supported drm/amd/display: Fail validation if building scaling params fails drm/amd/display: Change viewport limit to 12 for DCN2 drm/amd/display: Update downspread percent to match spreadsheet for
DCN2.1
Yongqiang Sun (2):
drm/amd/display: Add panel cntl id for set backlight level. drm/amd/display: Add set backlight to hw sequencer.
.../amd/display/amdgpu_dm/amdgpu_dm_color.c | 7 +- .../drm/amd/display/dc/bios/command_table2.c | 62 ++++++---- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 36 ++---- .../gpu/drm/amd/display/dc/core/dc_resource.c | 4 +- .../gpu/drm/amd/display/dc/core/dc_stream.c | 40 +------ drivers/gpu/drm/amd/display/dc/dc.h | 48 +++++++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 5 +- drivers/gpu/drm/amd/display/dc/dc_helper.c | 6 +- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 15 ++- drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 28 +++-- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 12 +- .../display/dc/dce110/dce110_hw_sequencer.c | 35 +++++- .../display/dc/dce110/dce110_hw_sequencer.h | 4 + .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 19 ++- .../amd/display/dc/dcn10/dcn10_hw_sequencer.h | 1 + .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 2 + .../gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c | 15 +++ .../gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h | 20 +++- .../drm/amd/display/dc/dcn10/dcn10_resource.c | 48 +++++++- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 12 +- .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 2 + .../gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c | 1 + .../gpu/drm/amd/display/dc/dcn20/dcn20_mpc.h | 3 +- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 71 +++++++++-- .../drm/amd/display/dc/dcn20/dcn20_resource.h | 2 +- .../gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c | 33 ++++-- .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 2 + .../drm/amd/display/dc/dcn21/dcn21_resource.c | 112 +++++++++++------- .../amd/display/dc/dml/display_mode_structs.h | 1 + .../drm/amd/display/dc/dml/display_mode_vba.c | 1 + .../drm/amd/display/dc/dml/display_mode_vba.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 5 +- drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h | 16 +++ .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 5 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 6 +- .../gpu/drm/amd/display/dmub/inc/dmub_rb.h | 6 +- .../gpu/drm/amd/display/dmub/inc/dmub_srv.h | 3 +- .../gpu/drm/amd/display/dmub/inc/dmub_types.h | 11 ++ .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 10 +- .../amd/display/modules/color/color_gamma.c | 31 ++++- .../amd/display/modules/color/color_gamma.h | 4 +- 43 files changed, 523 insertions(+), 228 deletions(-)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/19 drm/amd/display: 3.2.82
From: 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.81" +#define DC_VER "3.2.82"#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 2/19 drm/amd/display: Do not disable pipe split if mode is not supported
In reply to Aurabindo PillaiFrom: Sung Lee <[email protected]>
[WHY]
If mode is not supported, pipe split should not be disabled. This may cause more modes to fail.
[HOW]
Check for mode support before disabling pipe split.
This commit was previously reverted as it was thought to have problems, but those issues have been resolved.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +7 -2
@@ -2623,19 +2623,24 @@ int dcn20_validate_apply_pipe_split_flags(/* Avoid split loop looks for lowest voltage level that allows most unsplit pipes possible */ if (avoid_split) { +int max_mpc_comb = context->bw_ctx.dml.vba.maxMpcComb; +for (i =0 , pipe_idx =0 ; i < dc->res_pool->pipe_count; i++) {if (!context->res_ctx.pipe_ctx[i].stream)continue ;for (vlevel_split = vlevel; vlevel <= context->bw_ctx.dml.soc.num_states; vlevel++) -if (context->bw_ctx.dml.vba.NoOfDPP[vlevel][0 ][pipe_idx] ==1 ) +if (context->bw_ctx.dml.vba.NoOfDPP[vlevel][0 ][pipe_idx] ==1 && + context->bw_ctx.dml.vba.ModeSupport[vlevel][0 ])break ;/* Impossible to not split this pipe */ if (vlevel > context->bw_ctx.dml.soc.num_states) vlevel = vlevel_split; +else + max_mpc_comb =0 ; pipe_idx++; } - context->bw_ctx.dml.vba.maxMpcComb =0 ; + context->bw_ctx.dml.vba.maxMpcComb = max_mpc_comb; }/* Split loop sets which pipe should be split based on dml outputs and dc flags */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/19 drm/amd/display: Fix DMUB meta offset for new load method
In reply to Aurabindo PillaiFrom: Nicholas Kazlauskas <[email protected]>
[Why]
The new metadata offset is located at the end of the firmware binary without any additional padding.
Firmware state is currently larger than 1024 bytes so new firmware state will hang when trying to access any data above 1024 bytes.
[How]
Specify the correct offset based on legacy vs new loading method.
--- drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +5 -3
@@ -96,25 +96,27 @@ dmub_get_fw_meta_info(const struct dmub_srv_region_params *params)const union dmub_fw_meta *meta;const uint8_t *blob =NULL ;uint32_t blob_size =0 ; +uint32_t meta_offset =0 ;if (params->fw_bss_data) {/* Legacy metadata region. */ blob = params->fw_bss_data; blob_size = params->bss_data_size; + meta_offset =DMUB_FW_META_OFFSET ; }else if (params->fw_inst_const) {/* Combined metadata region. */ blob = params->fw_inst_const; blob_size = params->inst_const_size; + meta_offset =0 ; }if (!blob || !blob_size)return NULL ; -if (blob_size <sizeof (union dmub_fw_meta ) +DMUB_FW_META_OFFSET ) +if (blob_size <sizeof (union dmub_fw_meta ) + meta_offset)return NULL ; - meta = (const union dmub_fw_meta *)(blob + blob_size - -DMUB_FW_META_OFFSET - + meta = (const union dmub_fw_meta *)(blob + blob_size - meta_offset -sizeof (union dmub_fw_meta ));if (meta->info.magic_value !=DMUB_FW_META_MAGIC )
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/19 drm/amd/display: clean up some header paths
In reply to Aurabindo PillaiFrom: Anthony Koo <[email protected]>
[Why]
Some include paths don't need to have relative paths And some types missing
[How]
make some changes to headers and modify include path
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 2 +- drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 4 ++-- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 5 ----- drivers/gpu/drm/amd/display/dmub/inc/dmub_types.h | 11 +++++++++++ 5 files changed, 15 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +1 -1
@@ -27,7 +27,7 @@#define _DMUB_DC_SRV_H_#include "os_types.h" -#include "../dmub/inc/dmub_cmd.h" +#include "dmub/inc/dmub_cmd.h" struct dmub_srv ;struct dmub_cmd_header ;
drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c +1 -1
@@ -27,7 +27,7 @@#include "dce_abm.h" #include "dc.h" #include "dc_dmub_srv.h" -#include "../../dmub/inc/dmub_srv.h" +#include "dmub/inc/dmub_srv.h" #include "core_types.h" #include "dm_services.h" #include "reg_helper.h"
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +2 -2
@@ -26,8 +26,8 @@#include "dmub_psr.h" #include "dc.h" #include "dc_dmub_srv.h" -#include "../../dmub/inc/dmub_srv.h" -#include "../../dmub/inc/dmub_gpint_cmd.h" +#include "dmub/inc/dmub_srv.h" +#include "dmub/inc/dmub_gpint_cmd.h" #include "core_types.h" #define MAX_PIPES 6
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +0 -5
@@ -215,11 +215,6 @@ struct dmub_rb_cmd_dpphy_init {uint8_t reserved[60 ]; }; -struct dmub_psr_debug_flags { -uint8_t visual_confirm :1 ; -uint8_t reserved :7 ; -}; -struct dmub_cmd_psr_copy_settings_data {uint16_t psr_level;uint8_t dpp_inst;
drivers/gpu/drm/amd/display/dmub/inc/dmub_types.h +11 -0
@@ -49,6 +49,12 @@ extern "C" {#define dmub_udelay (microseconds) udelay(microseconds)#endif +/* Maximum number of streams on any ASIC. */ +#define DMUB_MAX_STREAMS 6 + +/* Maximum number of planes on any ASIC. */ +#define DMUB_MAX_PLANES 6 + union dmub_addr { struct { uint32_t low_part;
@@ -57,6 +63,11 @@ union dmub_addr {uint64_t quad_part; }; +struct dmub_psr_debug_flags { +uint8_t visual_confirm :1 ; +uint8_t reserved :7 ; +}; +#if defined(__cplusplus) }#endif
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/19 drm/amd/display: Add DML variable for future asics
In reply to Aurabindo PillaiFrom: Joshua Aberback <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h | 1 + drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 1 + drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h | 1 + 3 files changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +1 -0
@@ -121,6 +121,7 @@ struct _vcs_dpi_soc_bounding_box_st { };struct _vcs_dpi_ip_params_st { +bool use_min_dcfclk;bool gpuvm_enable;bool hostvm_enable;unsigned int gpuvm_max_page_table_levels;
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +1 -0
@@ -280,6 +280,7 @@ static void fetch_ip_params(struct display_mode_lib *mode_lib)ip_params_st *ip = &mode_lib->vba.ip;// IP Parameters + mode_lib->vba.UseMinimumRequiredDCFCLK = ip->use_min_dcfclk; mode_lib->vba.MaxNumDPP = ip->max_num_dpp; mode_lib->vba.MaxNumOTG = ip->max_num_otg; mode_lib->vba.MaxNumHDMIFRLOutputs = ip->max_num_hdmi_frl_outputs;
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h +1 -0
@@ -898,6 +898,7 @@ struct vba_vars_st {bool dummystring[DC__NUM_DPP__MAX ];double BPP ;enum odm_combine_policy ODMCombinePolicy; +bool UseMinimumRequiredDCFCLK; }; bool CalculateMinAndMaxPrefetchMode(
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/19 drm/amd/display: check if REFCLK_CNTL register is present
In reply to Aurabindo PillaiFrom: Dmytro Laktyushkin <[email protected]>
Check before programming the register since it isn't present on all IPs using this code.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +2 -1
@@ -2304,7 +2304,8 @@ void dcn20_fpga_init_hw(struct dc *dc)REG_UPDATE (DCHUBBUB_GLOBAL_TIMER_CNTL ,DCHUBBUB_GLOBAL_TIMER_REFDIV ,2 );REG_UPDATE (DCHUBBUB_GLOBAL_TIMER_CNTL ,DCHUBBUB_GLOBAL_TIMER_ENABLE ,1 ); -REG_WRITE (REFCLK_CNTL ,0 ); +if (REG (REFCLK_CNTL )) +REG_WRITE (REFCLK_CNTL ,0 );//
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/19 drm/amd/display: fix rn soc bb update
In reply to Aurabindo PillaiFrom: Dmytro Laktyushkin <[email protected]>
Currently RN SOC bounding box update assumes we will get at least 2 clock states from SMU. This isn't always true and because of special casing on first clock state we end up with low disp, dpp, dsc and phy clocks.
This change removes the special casing allowing the first state to acquire correct clocks.
--- .../drm/amd/display/dc/dcn21/dcn21_resource.c | 71 ++++++++----------- 1 file changed, 28 insertions(+), 43 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +28 -43
@@ -1379,64 +1379,49 @@ static void update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param {struct dcn21_resource_pool *pool =TO_DCN21_RES_POOL (dc->res_pool);struct clk_limit_table *clk_table = &bw_params->clk_table; -unsigned int i, j, k; -int closest_clk_lvl; +struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES ]; +unsigned int i, j, closest_clk_lvl;// Default clock levels are used for diags, which may lead to overclocking. -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) && !IS_DIAG_DC (dc->ctx->dce_environment)) { +if (!IS_DIAG_DC (dc->ctx->dce_environment)) { dcn2_1_ip.max_num_otg = pool->base.res_cap->num_timing_generator; dcn2_1_ip.max_num_dpp = pool->base.pipe_count; dcn2_1_soc.num_chans = bw_params->num_channels; -/* Vmin: leave lowest DCN clocks, override with dcfclk, fclk, memclk from fuse */ - dcn2_1_soc.clock_limits[0 ].state =0 ; - dcn2_1_soc.clock_limits[0 ].dcfclk_mhz = clk_table->entries[0 ].dcfclk_mhz; - dcn2_1_soc.clock_limits[0 ].fabricclk_mhz = clk_table->entries[0 ].fclk_mhz; - dcn2_1_soc.clock_limits[0 ].socclk_mhz = clk_table->entries[0 ].socclk_mhz; - dcn2_1_soc.clock_limits[0 ].dram_speed_mts = clk_table->entries[0 ].memclk_mhz *2 ; - -/* -* Other levels: find closest DCN clocks that fit the given clock limit using dcfclk -* as indicator -*/ - - closest_clk_lvl =-1 ; -/* index currently being filled */ - k =1 ; -for (i =1 ; i < clk_table->num_entries; i++) { -/* loop backwards, skip duplicate state*/ -for (j = dcn2_1_soc.num_states -1 ; j >= k; j--) { +ASSERT (clk_table->num_entries); +for (i =0 ; i < clk_table->num_entries; i++) { +/* loop backwards*/ +for (closest_clk_lvl =0 , j = dcn2_1_soc.num_states -1 ; j >=0 ; j--) {if ((unsigned int ) dcn2_1_soc.clock_limits[j].dcfclk_mhz <= clk_table->entries[i].dcfclk_mhz) { closest_clk_lvl = j;break ; } } -/* if found a lvl that fits, use the DCN clks from it, if not, go to next clk limit*/ -if (closest_clk_lvl !=-1 ) { - dcn2_1_soc.clock_limits[k].state = i; - dcn2_1_soc.clock_limits[k].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; - dcn2_1_soc.clock_limits[k].fabricclk_mhz = clk_table->entries[i].fclk_mhz; - dcn2_1_soc.clock_limits[k].socclk_mhz = clk_table->entries[i].socclk_mhz; - dcn2_1_soc.clock_limits[k].dram_speed_mts = clk_table->entries[i].memclk_mhz *2 ; - - dcn2_1_soc.clock_limits[k].dispclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dispclk_mhz; - dcn2_1_soc.clock_limits[k].dppclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dppclk_mhz; - dcn2_1_soc.clock_limits[k].dram_bw_per_chan_gbps = dcn2_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps; - dcn2_1_soc.clock_limits[k].dscclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz; - dcn2_1_soc.clock_limits[k].dtbclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz; - dcn2_1_soc.clock_limits[k].phyclk_d18_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; - dcn2_1_soc.clock_limits[k].phyclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz; - k++; - } + clock_limits[i].state = i; + clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; + clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz; + clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz; + clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz *2 ; + + clock_limits[i].dispclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dispclk_mhz; + clock_limits[i].dppclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dppclk_mhz; + clock_limits[i].dram_bw_per_chan_gbps = dcn2_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps; + clock_limits[i].dscclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz; + clock_limits[i].dtbclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz; + clock_limits[i].phyclk_d18_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; + clock_limits[i].phyclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz; + } +for (i =0 ; i < clk_table->num_entries; i++) + dcn2_1_soc.clock_limits[i] = clock_limits[i]; +if (clk_table->num_entries) { + dcn2_1_soc.num_states = clk_table->num_entries; +/* duplicate last level */ + dcn2_1_soc.clock_limits[dcn2_1_soc.num_states] = dcn2_1_soc.clock_limits[dcn2_1_soc.num_states -1 ]; + dcn2_1_soc.clock_limits[dcn2_1_soc.num_states].state = dcn2_1_soc.num_states; } - dcn2_1_soc.num_states = k; } -/* duplicate last level */ - dcn2_1_soc.clock_limits[dcn2_1_soc.num_states] = dcn2_1_soc.clock_limits[dcn2_1_soc.num_states -1 ]; - dcn2_1_soc.clock_limits[dcn2_1_soc.num_states].state = dcn2_1_soc.num_states; -dml_init_instance (&dc->dml, &dcn2_1_soc, &dcn2_1_ip,DML_PROJECT_DCN21 ); }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/19 drm/amd/display: Fail validation if building scaling params fails
In reply to Aurabindo PillaiFrom: Sung Lee <[email protected]>
[WHY & HOW]
If building scaling parameters fails, validation
should also fail.
--- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 16 ++++++++++------ .../drm/amd/display/dc/dcn20/dcn20_resource.h | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +10 -6
@@ -1936,7 +1936,7 @@ bool dcn20_split_stream_for_odm(return true; } -void dcn20_split_stream_for_mpc( +bool dcn20_split_stream_for_mpc( struct resource_context *res_ctx, const struct resource_pool *pool, struct pipe_ctx *primary_pipe,
@@ -1965,8 +1965,11 @@ void dcn20_split_stream_for_mpc( secondary_pipe->top_pipe = primary_pipe;ASSERT (primary_pipe->plane_state); -resource_build_scaling_params (primary_pipe); -resource_build_scaling_params (secondary_pipe); +if (!resource_build_scaling_params (primary_pipe) || + !resource_build_scaling_params (secondary_pipe)) +return false; + +return true; } void dcn20_populate_dml_writeback_from_context(
@@ -2796,9 +2799,10 @@ bool dcn20_fast_validate_bw( goto validate_fail;dcn20_build_mapped_resource (dc, context, pipe->stream); }else -dcn20_split_stream_for_mpc ( - &context->res_ctx, dc->res_pool, - pipe, hsplit_pipe); +if (!dcn20_split_stream_for_mpc ( + &context->res_ctx, dc->res_pool, + pipe, hsplit_pipe)) + goto validate_fail; pipe_split_from[hsplit_pipe->pipe_idx] = pipe_idx; } }else if (hsplit_pipe && hsplit_pipe->plane_state == pipe->plane_state) {
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.h +1 -1
@@ -129,7 +129,7 @@ void dcn20_release_dsc(struct resource_context *res_ctx,const struct resource_pool *pool, struct display_stream_compressor **dsc);bool dcn20_validate_dsc (struct dc *dc,struct dc_state *new_ctx); -void dcn20_split_stream_for_mpc( +bool dcn20_split_stream_for_mpc( struct resource_context *res_ctx, const struct resource_pool *pool, struct pipe_ctx *primary_pipe,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/19 drm/amd/display: Change viewport limit to 12 for DCN2
In reply to Aurabindo PillaiFrom: Sung Lee <[email protected]>
[WHY & HOW]
Viewport limit was set to 16 pixels due to an issue with MPO on small viewports. This restriction does not apply and the viewport limit can now be lowered.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -2
@@ -1064,8 +1064,8 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)calculate_viewport (pipe_ctx); -if (pipe_ctx->plane_res.scl_data.viewport.height <16 || - pipe_ctx->plane_res.scl_data.viewport.width <16 ) { +if (pipe_ctx->plane_res.scl_data.viewport.height <12 || + pipe_ctx->plane_res.scl_data.viewport.width <12 ) {if (store_h_border_left) {restore_border_left_from_dst (pipe_ctx, store_h_border_left);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/19 drm/amd/display: Defer cursor update around VUPDATE for all ASIC
In reply to Aurabindo PillaiFrom: Nicholas Kazlauskas <[email protected]>
[Why]
Fixes the following scenario:
- Flip has been prepared sometime during the frame, update pending
- Cursor update happens right when VUPDATE would happen
- OPTC lock acquired, VUPDATE is blocked until next frame
- Flip is delayed potentially infinitely
With the igt@kms_cursor_legacy cursor-vs-flip-legacy test we can observe nearly *13* frames of delay for some flips on Navi.
[How]
Apply the Raven workaround generically. When close enough to VUPDATE block cursor updates from occurring from the dc_stream_set_cursor_* helpers.
This could perhaps be a little smarter by checking if there were pending updates or flips earlier in the frame on the HUBP side before applying the delay, but this should be fine for now.
This fixes the kms_cursor_legacy test.
--- .../gpu/drm/amd/display/dc/core/dc_stream.c | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +14 -14
@@ -239,24 +239,24 @@ static void delay_cursor_until_vupdate(struct pipe_ctx *pipe_ctx, struct dc *dc)struct dc_stream_state *stream = pipe_ctx->stream;unsigned int us_per_line; -if (stream->ctx->asic_id.chip_family ==FAMILY_RV && -ASICREV_IS_RAVEN (stream->ctx->asic_id.hw_internal_rev)) { +if (!dc->hwss.get_vupdate_offset_from_vsync) +return ; - vupdate_line = dc->hwss.get_vupdate_offset_from_vsync (pipe_ctx); -if (!dc_stream_get_crtc_position (dc, &stream,1 , &vpos, &nvpos)) -return ; + vupdate_line = dc->hwss.get_vupdate_offset_from_vsync (pipe_ctx); +if (!dc_stream_get_crtc_position (dc, &stream,1 , &vpos, &nvpos)) +return ; -if (vpos >= vupdate_line) -return ; +if (vpos >= vupdate_line) +return ; - us_per_line = stream->timing.h_total *10000 / stream->timing.pix_clk_100hz; - lines_to_vupdate = vupdate_line - vpos; - us_to_vupdate = lines_to_vupdate * us_per_line; + us_per_line = + stream->timing.h_total *10000 / stream->timing.pix_clk_100hz; + lines_to_vupdate = vupdate_line - vpos; + us_to_vupdate = lines_to_vupdate * us_per_line; -/* 70 us is a conservative estimate of cursor update time*/ -if (us_to_vupdate <70 ) -udelay (us_to_vupdate); - } +/* 70 us is a conservative estimate of cursor update time*/ +if (us_to_vupdate <70 ) +udelay (us_to_vupdate);#endif }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/19 drm/amd/display: Update downspread percent to match spreadsheet for DCN2.1
In reply to Aurabindo PillaiFrom: Sung Lee <[email protected]>
[WHY]
The downspread percentage was copied over from a previous version of the display_mode_lib spreadsheet. This value has been updated, and the previous value is too high to allow for such modes as 4K120hz. The new value is sufficient for such modes.
[HOW]
Update the value in dcn21_resource to match the spreadsheet.
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1 -1
@@ -286,7 +286,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn2_1_soc = { .dram_channel_width_bytes = 4, .fabric_datapath_to_dcn_data_return_bytes = 32, .dcn_downspread_percent = 0.5, - .downspread_percent = 0.5, + .downspread_percent = 0.38, .dram_page_open_time_ns = 50.0, .dram_rw_turnaround_time_ns = 17.5, .dram_return_buffer_per_channel_bytes = 8192,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/19 drm/amd/display: Pass command instead of header into DMUB service
In reply to Aurabindo PillaiFrom: Nicholas Kazlauskas <[email protected]>
[Why]
We read memory that we shouldn't be touching if the struct isn't a full union dmub_rb_cmd.
[How]
Fix up all the callers and functions that take in the dmub_cmd_header to use the dmub_rb_cmd instead.
--- .../drm/amd/display/dc/bios/command_table2.c | 62 +++++++++++++------ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_helper.c | 6 +- drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 10 +-- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 8 +-- .../gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c | 33 ++++++---- .../gpu/drm/amd/display/dmub/inc/dmub_rb.h | 6 +- .../gpu/drm/amd/display/dmub/inc/dmub_srv.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 +- 10 files changed, 80 insertions(+), 55 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/command_table2.c +42 -20
@@ -113,13 +113,19 @@ static void encoder_control_dmcub(struct dc_dmub_srv *dmcub, struct dig_encoder_stream_setup_parameters_v1_5 *dig) { - struct dmub_rb_cmd_digx_encoder_control encoder_control = { 0 }; + union dmub_rb_cmd cmd; - encoder_control.header.type =DMUB_CMD__VBIOS ; - encoder_control.header.sub_type =DMUB_CMD__VBIOS_DIGX_ENCODER_CONTROL ; - encoder_control.encoder_control.dig.stream_param = *dig; +memset (&cmd,0 ,sizeof (cmd)); -dc_dmub_srv_cmd_queue (dmcub, &encoder_control.header); + cmd.digx_encoder_control.header.type =DMUB_CMD__VBIOS ; + cmd.digx_encoder_control.header.sub_type = +DMUB_CMD__VBIOS_DIGX_ENCODER_CONTROL ; + cmd.digx_encoder_control.header.payload_bytes = +sizeof (cmd.digx_encoder_control) - +sizeof (cmd.digx_encoder_control.header); + cmd.digx_encoder_control.encoder_control.dig.stream_param = *dig; + +dc_dmub_srv_cmd_queue (dmcub, &cmd);dc_dmub_srv_cmd_execute (dmcub);dc_dmub_srv_wait_idle (dmcub); }
@@ -238,14 +244,19 @@ static void transmitter_control_dmcub(struct dc_dmub_srv *dmcub, struct dig_transmitter_control_parameters_v1_6 *dig) { - struct dmub_rb_cmd_dig1_transmitter_control transmitter_control; + union dmub_rb_cmd cmd; + +memset (&cmd,0 ,sizeof (cmd)); - transmitter_control.header.type =DMUB_CMD__VBIOS ; - transmitter_control.header.sub_type = + cmd.dig1_transmitter_control.header.type =DMUB_CMD__VBIOS ; + cmd.dig1_transmitter_control.header.sub_type =DMUB_CMD__VBIOS_DIG1_TRANSMITTER_CONTROL ; - transmitter_control.transmitter_control.dig = *dig; + cmd.dig1_transmitter_control.header.payload_bytes = +sizeof (cmd.dig1_transmitter_control) - +sizeof (cmd.dig1_transmitter_control.header); + cmd.dig1_transmitter_control.transmitter_control.dig = *dig; -dc_dmub_srv_cmd_queue (dmcub, &transmitter_control.header); +dc_dmub_srv_cmd_queue (dmcub, &cmd);dc_dmub_srv_cmd_execute (dmcub);dc_dmub_srv_wait_idle (dmcub); }
@@ -339,13 +350,18 @@ static void set_pixel_clock_dmcub(struct dc_dmub_srv *dmcub, struct set_pixel_clock_parameter_v1_7 *clk) { - struct dmub_rb_cmd_set_pixel_clock pixel_clock = { 0 }; + union dmub_rb_cmd cmd; - pixel_clock.header.type =DMUB_CMD__VBIOS ; - pixel_clock.header.sub_type =DMUB_CMD__VBIOS_SET_PIXEL_CLOCK ; - pixel_clock.pixel_clock.clk = *clk; +memset (&cmd,0 ,sizeof (cmd)); -dc_dmub_srv_cmd_queue (dmcub, &pixel_clock.header); + cmd.set_pixel_clock.header.type =DMUB_CMD__VBIOS ; + cmd.set_pixel_clock.header.sub_type =DMUB_CMD__VBIOS_SET_PIXEL_CLOCK ; + cmd.set_pixel_clock.header.payload_bytes = +sizeof (cmd.set_pixel_clock) - +sizeof (cmd.set_pixel_clock.header); + cmd.set_pixel_clock.pixel_clock.clk = *clk; + +dc_dmub_srv_cmd_queue (dmcub, &cmd);dc_dmub_srv_cmd_execute (dmcub);dc_dmub_srv_wait_idle (dmcub); }
@@ -705,13 +721,19 @@ static void enable_disp_power_gating_dmcub(struct dc_dmub_srv *dmcub, struct enable_disp_power_gating_parameters_v2_1 *pwr) { - struct dmub_rb_cmd_enable_disp_power_gating power_gating; + union dmub_rb_cmd cmd; + +memset (&cmd,0 ,sizeof (cmd)); - power_gating.header.type =DMUB_CMD__VBIOS ; - power_gating.header.sub_type =DMUB_CMD__VBIOS_ENABLE_DISP_POWER_GATING ; - power_gating.power_gating.pwr = *pwr; + cmd.enable_disp_power_gating.header.type =DMUB_CMD__VBIOS ; + cmd.enable_disp_power_gating.header.sub_type = +DMUB_CMD__VBIOS_ENABLE_DISP_POWER_GATING ; + cmd.enable_disp_power_gating.header.payload_bytes = +sizeof (cmd.enable_disp_power_gating) - +sizeof (cmd.enable_disp_power_gating.header); + cmd.enable_disp_power_gating.power_gating.pwr = *pwr; -dc_dmub_srv_cmd_queue (dmcub, &power_gating.header); +dc_dmub_srv_cmd_queue (dmcub, &cmd);dc_dmub_srv_cmd_execute (dmcub);dc_dmub_srv_wait_idle (dmcub); }
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +1 -1
@@ -58,7 +58,7 @@ void dc_dmub_srv_destroy(struct dc_dmub_srv **dmub_srv) }void dc_dmub_srv_cmd_queue (struct dc_dmub_srv *dc_dmub_srv, -struct dmub_cmd_header *cmd) +union dmub_rb_cmd *cmd) {struct dmub_srv *dmub = dc_dmub_srv->dmub;struct dc_context *dc_ctx = dc_dmub_srv->ctx;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +1 -2
@@ -30,7 +30,6 @@#include "dmub/inc/dmub_cmd.h" struct dmub_srv ; -struct dmub_cmd_header ;struct dc_reg_helper_state {bool gather_in_progress;
@@ -49,7 +48,7 @@ struct dc_dmub_srv { };void dc_dmub_srv_cmd_queue (struct dc_dmub_srv *dc_dmub_srv, -struct dmub_cmd_header *cmd); +union dmub_rb_cmd *cmd);void dc_dmub_srv_cmd_execute (struct dc_dmub_srv *dc_dmub_srv);
drivers/gpu/drm/amd/display/dc/dc_helper.c +3 -3
@@ -50,7 +50,7 @@ static inline void submit_dmub_read_modify_write( gather = ctx->dmub_srv->reg_helper_offload.gather_in_progress; ctx->dmub_srv->reg_helper_offload.gather_in_progress = false; -dc_dmub_srv_cmd_queue (ctx->dmub_srv, &cmd_buf->header); +dc_dmub_srv_cmd_queue (ctx->dmub_srv, &offload->cmd_data); ctx->dmub_srv->reg_helper_offload.gather_in_progress = gather;
@@ -73,7 +73,7 @@ static inline void submit_dmub_burst_write( gather = ctx->dmub_srv->reg_helper_offload.gather_in_progress; ctx->dmub_srv->reg_helper_offload.gather_in_progress = false; -dc_dmub_srv_cmd_queue (ctx->dmub_srv, &cmd_buf->header); +dc_dmub_srv_cmd_queue (ctx->dmub_srv, &offload->cmd_data); ctx->dmub_srv->reg_helper_offload.gather_in_progress = gather;
@@ -92,7 +92,7 @@ static inline void submit_dmub_reg_wait( gather = ctx->dmub_srv->reg_helper_offload.gather_in_progress; ctx->dmub_srv->reg_helper_offload.gather_in_progress = false; -dc_dmub_srv_cmd_queue (ctx->dmub_srv, &cmd_buf->header); +dc_dmub_srv_cmd_queue (ctx->dmub_srv, &offload->cmd_data);memset (cmd_buf,0 ,sizeof (*cmd_buf)); offload->reg_seq_count =0 ;
drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c +5 -5
@@ -62,7 +62,7 @@ static bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst) cmd.abm_set_pipe.abm_set_pipe_data.ramping_boundary = ramping_boundary; cmd.abm_set_pipe.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_pipe_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd.abm_set_pipe.header); +dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd);dc_dmub_srv_cmd_execute (dc->dmub_srv);dc_dmub_srv_wait_idle (dc->dmub_srv);
@@ -146,7 +146,7 @@ static void dmcub_set_backlight_level( cmd.abm_set_backlight.abm_set_backlight_data.frame_ramp = frame_ramp; cmd.abm_set_backlight.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_backlight_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd.abm_set_backlight.header); +dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd);dc_dmub_srv_cmd_execute (dc->dmub_srv);dc_dmub_srv_wait_idle (dc->dmub_srv);
@@ -171,7 +171,7 @@ static void dmub_abm_enable_fractional_pwm(struct dc_context *dc) cmd.abm_set_pwm_frac.abm_set_pwm_frac_data.fractional_pwm = fractional_pwm; cmd.abm_set_pwm_frac.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_pwm_frac_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd.abm_set_pwm_frac.header); +dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd);dc_dmub_srv_cmd_execute (dc->dmub_srv);dc_dmub_srv_wait_idle (dc->dmub_srv); }
@@ -250,7 +250,7 @@ static bool dmub_abm_set_level(struct abm *abm, uint32_t level) cmd.abm_set_level.abm_set_level_data.level = level; cmd.abm_set_level.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_level_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd.abm_set_level.header); +dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd);dc_dmub_srv_cmd_execute (dc->dmub_srv);dc_dmub_srv_wait_idle (dc->dmub_srv);
@@ -370,7 +370,7 @@ static bool dmub_abm_init_config(struct abm *abm, cmd.abm_init_config.abm_init_config_data.bytes = bytes; cmd.abm_init_config.header.payload_bytes =sizeof (struct dmub_cmd_abm_init_config_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd.abm_init_config.header); +dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd);dc_dmub_srv_cmd_execute (dc->dmub_srv);dc_dmub_srv_wait_idle (dc->dmub_srv);
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +4 -4
@@ -102,7 +102,7 @@ static bool dmub_psr_set_version(struct dmub_psr *dmub, struct dc_stream_state * cmd.psr_set_version.psr_set_version_data.version = stream->link->psr_settings.psr_version; cmd.psr_set_version.header.payload_bytes =sizeof (struct dmub_cmd_psr_set_version_data ); -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd.psr_set_version.header); +dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd);dc_dmub_srv_cmd_execute (dc->dmub_srv);dc_dmub_srv_wait_idle (dc->dmub_srv);
@@ -126,7 +126,7 @@ static void dmub_psr_enable(struct dmub_psr *dmub, bool enable) cmd.psr_enable.header.payload_bytes =0 ;// Send header only -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd.psr_enable.header); +dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd);dc_dmub_srv_cmd_execute (dc->dmub_srv);dc_dmub_srv_wait_idle (dc->dmub_srv); }
@@ -150,7 +150,7 @@ static void dmub_psr_set_level(struct dmub_psr *dmub, uint16_t psr_level) cmd.psr_set_level.header.payload_bytes =sizeof (struct dmub_cmd_psr_set_level_data ); cmd.psr_set_level.psr_set_level_data.psr_level = psr_level; -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd.psr_set_level.header); +dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd);dc_dmub_srv_cmd_execute (dc->dmub_srv);dc_dmub_srv_wait_idle (dc->dmub_srv); }
@@ -227,7 +227,7 @@ static bool dmub_psr_copy_settings(struct dmub_psr *dmub, copy_settings_data->debug.visual_confirm = dc->dc->debug.visual_confirm ==VISUAL_CONFIRM_PSR ? true : false; -dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd.psr_copy_settings.header); +dc_dmub_srv_cmd_queue (dc->dmub_srv, &cmd);dc_dmub_srv_cmd_execute (dc->dmub_srv);dc_dmub_srv_wait_idle (dc->dmub_srv);
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c +20 -13
@@ -778,21 +778,28 @@ void dmcub_PLAT_54186_wa(struct hubp *hubp, struct surface_flip_registers *flip_ {struct dc_dmub_srv *dmcub = hubp->ctx->dmub_srv;struct dcn21_hubp *hubp21 =TO_DCN21_HUBP (hubp); -struct dmub_rb_cmd_PLAT_54186_wa PLAT_54186_wa = {0 }; - - PLAT_54186_wa.header.type =DMUB_CMD__PLAT_54186_WA ; - PLAT_54186_wa.flip.DCSURF_PRIMARY_SURFACE_ADDRESS = flip_regs->DCSURF_PRIMARY_SURFACE_ADDRESS; - PLAT_54186_wa.flip.DCSURF_PRIMARY_SURFACE_ADDRESS_C = flip_regs->DCSURF_PRIMARY_SURFACE_ADDRESS_C; - PLAT_54186_wa.flip.DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH = flip_regs->DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH; - PLAT_54186_wa.flip.DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH_C = flip_regs->DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH_C; - PLAT_54186_wa.flip.flip_params.grph_stereo = flip_regs->grph_stereo; - PLAT_54186_wa.flip.flip_params.hubp_inst = hubp->inst; - PLAT_54186_wa.flip.flip_params.immediate = flip_regs->immediate; - PLAT_54186_wa.flip.flip_params.tmz_surface = flip_regs->tmz_surface; - PLAT_54186_wa.flip.flip_params.vmid = flip_regs->vmid; +union dmub_rb_cmd cmd; + +memset (&cmd,0 ,sizeof (cmd)); + + cmd.PLAT_54186_wa.header.type =DMUB_CMD__PLAT_54186_WA ; + cmd.PLAT_54186_wa.header.payload_bytes =sizeof (cmd.PLAT_54186_wa.flip); + cmd.PLAT_54186_wa.flip.DCSURF_PRIMARY_SURFACE_ADDRESS = + flip_regs->DCSURF_PRIMARY_SURFACE_ADDRESS; + cmd.PLAT_54186_wa.flip.DCSURF_PRIMARY_SURFACE_ADDRESS_C = + flip_regs->DCSURF_PRIMARY_SURFACE_ADDRESS_C; + cmd.PLAT_54186_wa.flip.DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH = + flip_regs->DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH; + cmd.PLAT_54186_wa.flip.DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH_C = + flip_regs->DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH_C; + cmd.PLAT_54186_wa.flip.flip_params.grph_stereo = flip_regs->grph_stereo; + cmd.PLAT_54186_wa.flip.flip_params.hubp_inst = hubp->inst; + cmd.PLAT_54186_wa.flip.flip_params.immediate = flip_regs->immediate; + cmd.PLAT_54186_wa.flip.flip_params.tmz_surface = flip_regs->tmz_surface; + cmd.PLAT_54186_wa.flip.flip_params.vmid = flip_regs->vmid;PERF_TRACE ();// TODO: remove after performance is stable. -dc_dmub_srv_cmd_queue (dmcub, &PLAT_54186_wa.header); +dc_dmub_srv_cmd_queue (dmcub, &cmd);PERF_TRACE ();// TODO: remove after performance is stable. dc_dmub_srv_cmd_execute (dmcub);PERF_TRACE ();// TODO: remove after performance is stable.
drivers/gpu/drm/amd/display/dmub/inc/dmub_rb.h +2 -4
@@ -33,8 +33,6 @@extern "C" {#endif -struct dmub_cmd_header ; -struct dmub_rb_init_params {void *ctx;void *base_address;
@@ -71,7 +69,7 @@ static inline bool dmub_rb_full(struct dmub_rb *rb) }static inline bool dmub_rb_push_front (struct dmub_rb *rb, -const struct dmub_cmd_header *cmd) +const union dmub_rb_cmd *cmd) {uint64_t volatile *dst = (uint64_t volatile *)(rb->base_address) + rb->wrpt /sizeof (uint64_t );const uint64_t *src = (const uint64_t *)cmd;
@@ -93,7 +91,7 @@ static inline bool dmub_rb_push_front(struct dmub_rb *rb, }static inline bool dmub_rb_front (struct dmub_rb *rb, -struct dmub_cmd_header *cmd) +union dmub_rb_cmd *cmd) {uint8_t *rd_ptr = (uint8_t *)rb->base_address + rb->rptr;
drivers/gpu/drm/amd/display/dmub/inc/dmub_srv.h +1 -2
@@ -75,7 +75,6 @@ extern "C" {/* Forward declarations */ struct dmub_srv ; -struct dmub_cmd_header ;struct dmub_srv_common_regs ;/* enum dmub_status - return code for dmcub functions */
@@ -458,7 +457,7 @@ enum dmub_status dmub_srv_hw_reset(struct dmub_srv *dmub);* DMUB_STATUS_INVALID - unspecified error */ enum dmub_status dmub_srv_cmd_queue (struct dmub_srv *dmub, -const struct dmub_cmd_header *cmd); +const union dmub_rb_cmd *cmd);/** * dmub_srv_cmd_execute() - Executes a queued sequence to the dmub
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +1 -1
@@ -462,7 +462,7 @@ enum dmub_status dmub_srv_hw_reset(struct dmub_srv *dmub) }enum dmub_status dmub_srv_cmd_queue (struct dmub_srv *dmub, -const struct dmub_cmd_header *cmd) +const union dmub_rb_cmd *cmd) {if (!dmub->hw_init)return DMUB_STATUS_INVALID ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/19 drm/amd/display: Add panel cntl id for set backlight level.
In reply to Aurabindo PillaiFrom: Yongqiang Sun <[email protected]>
[Why & How]
Add panel cntl instance when calling set backlight.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +++- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 ++- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 15 +++++++++------ drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 16 ++++++++++------ .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 9 ++++++--- .../gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 9 ++++++--- drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 5 +++-- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 1 + 8 files changed, 40 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -1
@@ -2210,7 +2210,9 @@ static void commit_planes_do_stream_update(struct dc *dc,if (should_program_abm) {if (*stream_update->abm_level ==ABM_LEVEL_IMMEDIATE_DISABLE ) { - pipe_ctx->stream_res.abm->funcs->set_abm_immediate_disable (pipe_ctx->stream_res.abm); + pipe_ctx->stream_res.abm->funcs->set_abm_immediate_disable ( + pipe_ctx->stream_res.abm, + pipe_ctx->stream->link->panel_cntl->inst); }else { pipe_ctx->stream_res.abm->funcs->set_abm_level ( pipe_ctx->stream_res.abm, stream->abm_level);
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -1
@@ -2552,6 +2552,7 @@ bool dc_link_set_backlight_level(const struct dc_link *link, backlight_pwm_u16_16, frame_ramp, controller_id, + link->panel_cntl->inst, fw_set_brightness); }
@@ -2564,7 +2565,7 @@ bool dc_link_set_abm_disable(const struct dc_link *link)bool success = false;if (abm) - success = abm->funcs->set_abm_immediate_disable (abm); + success = abm->funcs->set_abm_immediate_disable (abm, link->panel_cntl->inst);return success; }
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +9 -6
@@ -55,7 +55,7 @@#define MCP_DISABLE_ABM_IMMEDIATELY 255 -static bool dce_abm_set_pipe (struct abm *abm,uint32_t controller_id) +static bool dce_abm_set_pipe (struct abm *abm,uint32_t controller_id,uint32_t panel_inst) {struct dce_abm *abm_dce =TO_DCE_ABM (abm);uint32_t rampingBoundary =0xFFFF ;
@@ -201,7 +201,8 @@ static void dmcu_set_backlight_level(struct dce_abm *abm_dce, uint32_t backlight_pwm_u16_16, uint32_t frame_ramp, - uint32_t controller_id) + uint32_t controller_id, + uint32_t panel_id) { unsigned int backlight_8_bit = 0;uint32_t s2;
@@ -213,7 +214,7 @@ static void dmcu_set_backlight_level(// Take MSB of fractional part since backlight is not max backlight_8_bit = (backlight_pwm_u16_16 >>8 ) &0xFF ; -dce_abm_set_pipe (&abm_dce->base, controller_id); +dce_abm_set_pipe (&abm_dce->base, controller_id, panel_id);/* waitDMCUReadyForCmd */ REG_WAIT(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT,
@@ -331,14 +332,14 @@ static bool dce_abm_set_level(struct abm *abm, uint32_t level)return true; } -static bool dce_abm_immediate_disable (struct abm *abm) +static bool dce_abm_immediate_disable (struct abm *abm,uint32_t panel_inst) {struct dce_abm *abm_dce =TO_DCE_ABM (abm);if (abm->dmcu_is_running == false)return true; -dce_abm_set_pipe (abm,MCP_DISABLE_ABM_IMMEDIATELY ); +dce_abm_set_pipe (abm,MCP_DISABLE_ABM_IMMEDIATELY , panel_inst); abm->stored_backlight_registers.BL_PWM_CNTL =REG_READ (BL_PWM_CNTL );
@@ -420,6 +421,7 @@ static bool dce_abm_set_backlight_level_pwm(unsigned int backlight_pwm_u16_16, unsigned int frame_ramp, unsigned int controller_id, + unsigned int panel_inst, bool fw_set_brightness) { struct dce_abm *abm_dce = TO_DCE_ABM(abm);
@@ -432,7 +434,8 @@ static bool dce_abm_set_backlight_level_pwm(dmcu_set_backlight_level (abm_dce, backlight_pwm_u16_16, frame_ramp, - controller_id); + controller_id, + panel_inst); elsedriver_set_backlight_level (abm_dce ,backlight_pwm_u16_16 );
drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c +10 -6
@@ -50,7 +50,7 @@#define DISABLE_ABM_IMMEDIATELY 255 -static bool dmub_abm_set_pipe (struct abm *abm,uint32_t otg_inst) +static bool dmub_abm_set_pipe (struct abm *abm,uint32_t otg_inst,uint32_t panel_inst) {union dmub_rb_cmd cmd;struct dc_context *dc = abm->ctx;
@@ -59,6 +59,7 @@ static bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst) cmd.abm_set_pipe.header.type =DMUB_CMD__ABM ; cmd.abm_set_pipe.header.sub_type =DMUB_CMD__ABM_SET_PIPE ; cmd.abm_set_pipe.abm_set_pipe_data.otg_inst = otg_inst; + cmd.abm_set_pipe.abm_set_pipe_data.panel_inst = panel_inst; cmd.abm_set_pipe.abm_set_pipe_data.ramping_boundary = ramping_boundary; cmd.abm_set_pipe.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_pipe_data );
@@ -120,7 +121,8 @@ static void dmcub_set_backlight_level(struct dce_abm *dce_abm, uint32_t backlight_pwm_u16_16, uint32_t frame_ramp, - uint32_t otg_inst) + uint32_t otg_inst, + uint32_t panel_inst) { union dmub_rb_cmd cmd;struct dc_context *dc = dce_abm->base.ctx;
@@ -134,7 +136,7 @@ static void dmcub_set_backlight_level(// Take MSB of fractional part since backlight is not max backlight_8_bit = (backlight_pwm_u16_16 >>8 ) &0xFF ; -dmub_abm_set_pipe (&dce_abm->base, otg_inst); +dmub_abm_set_pipe (&dce_abm->base, otg_inst, panel_inst);REG_UPDATE (BL1_PWM_USER_LEVEL ,BL1_PWM_USER_LEVEL , backlight_pwm_u16_16);
@@ -257,11 +259,11 @@ static bool dmub_abm_set_level(struct abm *abm, uint32_t level)return true; } -static bool dmub_abm_immediate_disable (struct abm *abm) +static bool dmub_abm_immediate_disable (struct abm *abm,uint32_t panel_inst) {struct dce_abm *dce_abm =TO_DMUB_ABM (abm); -dmub_abm_set_pipe (abm,DISABLE_ABM_IMMEDIATELY ); +dmub_abm_set_pipe (abm,DISABLE_ABM_IMMEDIATELY , panel_inst); abm->stored_backlight_registers.BL_PWM_CNTL =REG_READ (BL_PWM_CNTL );
@@ -338,6 +340,7 @@ static bool dmub_abm_set_backlight_level_pwm(unsigned int backlight_pwm_u16_16, unsigned int frame_ramp, unsigned int otg_inst, + uint32_t panel_inst, bool fw_set_brightness) { struct dce_abm *dce_abm = TO_DMUB_ABM(abm);
@@ -345,7 +348,8 @@ static bool dmub_abm_set_backlight_level_pwm(dmcub_set_backlight_level (dce_abm, backlight_pwm_u16_16, frame_ramp, - otg_inst); + otg_inst, + panel_inst);return true; }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +6 -3
@@ -903,7 +903,8 @@ static void dcn10_reset_back_end_for_pipe(if (pipe_ctx->top_pipe ==NULL ) {if (pipe_ctx->stream_res.abm) - pipe_ctx->stream_res.abm->funcs->set_abm_immediate_disable (pipe_ctx->stream_res.abm); + pipe_ctx->stream_res.abm->funcs->set_abm_immediate_disable (pipe_ctx->stream_res.abm, + pipe_ctx->stream->link->panel_cntl->inst); pipe_ctx->stream_res.tg->funcs->disable_crtc (pipe_ctx->stream_res.tg);
@@ -2474,12 +2475,14 @@ void dcn10_blank_pixel_data(if (stream_res->tg->funcs->set_blank) stream_res->tg->funcs->set_blank (stream_res->tg, blank);if (stream_res->abm) { - stream_res->abm->funcs->set_pipe (stream_res->abm, stream_res->tg->inst +1 ); + stream_res->abm->funcs->set_pipe (stream_res->abm, stream_res->tg->inst +1 , + stream->link->panel_cntl->inst); stream_res->abm->funcs->set_abm_level (stream_res->abm, stream->abm_level); } }else if (blank) {if (stream_res->abm) - stream_res->abm->funcs->set_abm_immediate_disable (stream_res->abm); + stream_res->abm->funcs->set_abm_immediate_disable (stream_res->abm, + stream->link->panel_cntl->inst);if (stream_res->tg->funcs->set_blank) stream_res->tg->funcs->set_blank (stream_res->tg, blank); }
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +6 -3
@@ -962,7 +962,8 @@ void dcn20_blank_pixel_data(if (blank) {if (stream_res->abm) - stream_res->abm->funcs->set_abm_immediate_disable (stream_res->abm); + stream_res->abm->funcs->set_abm_immediate_disable (stream_res->abm, + stream->link->panel_cntl->inst);if (dc->debug.visual_confirm !=VISUAL_CONFIRM_DISABLE ) { test_pattern =CONTROLLER_DP_TEST_PATTERN_COLORSQUARES ;
@@ -997,7 +998,8 @@ void dcn20_blank_pixel_data(if (!blank)if (stream_res->abm) { - stream_res->abm->funcs->set_pipe (stream_res->abm, stream_res->tg->inst +1 ); + stream_res->abm->funcs->set_pipe (stream_res->abm, stream_res->tg->inst +1 , + stream->link->panel_cntl->inst); stream_res->abm->funcs->set_abm_level (stream_res->abm, stream->abm_level); } }
@@ -2041,7 +2043,8 @@ static void dcn20_reset_back_end_for_pipe(if (pipe_ctx->top_pipe ==NULL ) {if (pipe_ctx->stream_res.abm) - pipe_ctx->stream_res.abm->funcs->set_abm_immediate_disable (pipe_ctx->stream_res.abm); + pipe_ctx->stream_res.abm->funcs->set_abm_immediate_disable (pipe_ctx->stream_res.abm, + pipe_ctx->stream->link->panel_cntl->inst); pipe_ctx->stream_res.tg->funcs->disable_crtc (pipe_ctx->stream_res.tg);
drivers/gpu/drm/amd/display/dc/inc/hw/abm.h +3 -2
@@ -45,8 +45,8 @@ struct abm {struct abm_funcs {void (*abm_init)(struct abm *abm);bool (*set_abm_level)(struct abm *abm,unsigned int abm_level); -bool (*set_abm_immediate_disable)(struct abm *abm); -bool (*set_pipe)(struct abm *abm,unsigned int controller_id); +bool (*set_abm_immediate_disable)(struct abm *abm,unsigned int panel_inst); +bool (*set_pipe)(struct abm *abm,unsigned int controller_id,unsigned int panel_inst);bool (*init_backlight)(struct abm *abm);/* backlight_pwm_u16_16 is unsigned 32 bit,
@@ -56,6 +56,7 @@ struct abm_funcs {unsigned int backlight_pwm_u16_16, unsigned int frame_ramp, unsigned int controller_id, + unsigned int panel_inst, bool fw_set_brightness);unsigned int (*get_current_backlight)(struct abm *abm);
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +1 -0
@@ -261,6 +261,7 @@ struct dmub_rb_cmd_psr_set_version {struct dmub_cmd_abm_set_pipe_data {uint32_t ramping_boundary;uint32_t otg_inst; +uint32_t panel_inst; };struct dmub_rb_cmd_abm_set_pipe {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/19 drm/amd/display: Add dummy p-state latency bounding box override
In reply to Aurabindo PillaiFrom: Joshua Aberback <[email protected]>
[Why]
For debugging, it can be useful to be able to modify the dummy p-state latency, this will make it easier to do so.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 7 +++++++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -478,6 +478,7 @@ struct dc_bounding_box_overrides {int urgent_latency_ns;int percent_of_ideal_drambw;int dram_clock_change_latency_ns; +int dummy_clock_change_latency_ns;/* This forces a hard min on the DCFCLK we use * for DML. Unlike the debug option for forcing * DCFCLK, this override affects watermark calculations
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +7 -0
@@ -3467,6 +3467,13 @@ void dcn20_patch_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_st bb->dram_clock_change_latency_us = dc->bb_overrides.dram_clock_change_latency_ns /1000.0 ; } + +if ((int )(bb->dummy_pstate_latency_us *1000 ) + != dc->bb_overrides.dummy_clock_change_latency_ns + && dc->bb_overrides.dummy_clock_change_latency_ns) { + bb->dummy_pstate_latency_us = + dc->bb_overrides.dummy_clock_change_latency_ns /1000.0 ; + } } static struct _vcs_dpi_soc_bounding_box_st *get_asic_rev_soc_bb(
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/19 drm/amd/display: Add set backlight to hw sequencer.
In reply to Aurabindo PillaiFrom: Yongqiang Sun <[email protected]>
[Why & How]
Add set backlight to hw sequencer, dmu communication will be handled in hw sequencer for new asics.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 35 ++++++------------- .../display/dc/dce110/dce110_hw_sequencer.c | 34 +++++++++++++++++- .../display/dc/dce110/dce110_hw_sequencer.h | 4 +++ .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 1 + .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 1 + .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 1 + .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 4 +++ 7 files changed, 55 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +11 -24
@@ -2509,35 +2509,21 @@ bool dc_link_set_backlight_level(const struct dc_link *link, uint32_t frame_ramp) {struct dc *dc = link->ctx->dc; -struct abm *abm =get_abm_from_stream_res (link); -struct dmcu *dmcu = dc->res_pool->dmcu; -unsigned int controller_id =0 ; -bool fw_set_brightness = true;int i; -DC_LOGGER_INIT (link->ctx->logger); - -if (abm ==NULL || (abm->funcs->set_backlight_level_pwm ==NULL )) -return false; - -if (dmcu) - fw_set_brightness = dmcu->funcs->is_dmcu_initialized (dmcu); +DC_LOGGER_INIT (link->ctx->logger);DC_LOG_BACKLIGHT ("New Backlight level: %d (0x%X)\n" , backlight_pwm_u16_16, backlight_pwm_u16_16);if (dc_is_embedded_signal (link->connector_signal)) { +struct pipe_ctx *pipe_ctx =NULL ; +for (i =0 ; i <MAX_PIPES ; i++) {if (dc->current_state->res_ctx.pipe_ctx[i].stream) {if (dc->current_state->res_ctx. pipe_ctx[i].stream->link == link) { -/* DMCU -1 for all controller id values, -* therefore +1 here -*/ - controller_id = - dc->current_state-> - res_ctx.pipe_ctx[i].stream_res.tg->inst + -1 ; + pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i];/* Disable brightness ramping when the display is blanked * as it can hang the DMCU
@@ -2547,13 +2533,14 @@ bool dc_link_set_backlight_level(const struct dc_link *link, } } } - abm->funcs->set_backlight_level_pwm ( - abm, + +if (pipe_ctx ==NULL ) +ASSERT (false); + + dc->hwss.set_backlight_level ( + pipe_ctx, backlight_pwm_u16_16, - frame_ramp, - controller_id, - link->panel_cntl->inst, - fw_set_brightness); + frame_ramp); }return true;
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +33 -1
@@ -2714,6 +2714,37 @@ void dce110_set_cursor_attribute(struct pipe_ctx *pipe_ctx) pipe_ctx->plane_res.xfm, attributes); } +bool dce110_set_backlight_level (struct pipe_ctx *pipe_ctx, +uint32_t backlight_pwm_u16_16, +uint32_t frame_ramp) +{ +struct dc_link *link = pipe_ctx->stream->link; +struct dc *dc = link->ctx->dc; +struct abm *abm = pipe_ctx->stream_res.abm; +struct dmcu *dmcu = dc->res_pool->dmcu; +bool fw_set_brightness = true; +/* DMCU -1 for all controller id values, +* therefore +1 here +*/ +uint32_t controller_id = pipe_ctx->stream_res.tg->inst +1 ; + +if (abm ==NULL || (abm->funcs->set_backlight_level_pwm ==NULL )) +return false; + +if (dmcu) + fw_set_brightness = dmcu->funcs->is_dmcu_initialized (dmcu); + + abm->funcs->set_backlight_level_pwm ( + abm, + backlight_pwm_u16_16, + frame_ramp, + controller_id, + link->panel_cntl->inst, + fw_set_brightness); + +return true; +} +static const struct hw_sequencer_funcs dce110_funcs = { .program_gamut_remap = program_gamut_remap, .program_output_csc = program_output_csc,
@@ -2747,7 +2778,8 @@ static const struct hw_sequencer_funcs dce110_funcs = { .edp_power_control = dce110_edp_power_control, .edp_wait_for_hpd_ready = dce110_edp_wait_for_hpd_ready, .set_cursor_position = dce110_set_cursor_position, - .set_cursor_attribute = dce110_set_cursor_attribute + .set_cursor_attribute = dce110_set_cursor_attribute, + .set_backlight_level = dce110_set_backlight_level, };static const struct hwseq_private_funcs dce110_private_funcs = {
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +4 -0
@@ -85,5 +85,9 @@ void dce110_edp_wait_for_hpd_ready(struct dc_link *link, bool power_up); +bool dce110_set_backlight_level (struct pipe_ctx *pipe_ctx, +uint32_t backlight_pwm_u16_16, +uint32_t frame_ramp); +#endif /* __DC_HWSS_DCE110_H__ */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_init.c +1 -0
@@ -71,6 +71,7 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .set_clock = dcn10_set_clock, .get_clock = dcn10_get_clock, .get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync, + .set_backlight_level = dce110_set_backlight_level, };static const struct hwseq_private_funcs dcn10_private_funcs = {
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c +1 -0
@@ -82,6 +82,7 @@ static const struct hw_sequencer_funcs dcn20_funcs = { .init_vm_ctx = dcn20_init_vm_ctx, .set_flip_control_gsl = dcn20_set_flip_control_gsl, .get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync, + .set_backlight_level = dce110_set_backlight_level, };static const struct hwseq_private_funcs dcn20_private_funcs = {
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c +1 -0
@@ -91,6 +91,7 @@ static const struct hw_sequencer_funcs dcn21_funcs = { .optimize_pwr_state = dcn21_optimize_pwr_state, .exit_optimized_pwr_state = dcn21_exit_optimized_pwr_state, .power_down = dce110_power_down, + .set_backlight_level = dce110_set_backlight_level, };static const struct hwseq_private_funcs dcn21_private_funcs = {
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +4 -0
@@ -191,6 +191,10 @@ struct hw_sequencer_funcs { unsigned int bufSize, unsigned int mask);void (*clear_status_bits)(struct dc *dc,unsigned int mask); +bool (*set_backlight_level)(struct pipe_ctx *pipe_ctx, +uint32_t backlight_pwm_u16_16, +uint32_t frame_ramp); + };
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 16/19 drm/amd/display: Internal refactoring to abstract color caps
In reply to Aurabindo PillaiFrom: Krunoslav Kovac <[email protected]>
[Why&How]
modules/color calculates various colour operations which are translated to abstracted HW. DCE 5-12 had almost no important changes, but starting with DCN1, every new generation comes with fairly major differences in color pipeline.
We would hack it with some DCN checks, but a better approach is to abstract color pipe capabilities so modules/DM can decide mapping to HW block based on logical capabilities,
--- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 7 +-- drivers/gpu/drm/amd/display/dc/dc.h | 45 ++++++++++++++++++- .../drm/amd/display/dc/dcn10/dcn10_resource.c | 34 ++++++++++++++ .../drm/amd/display/dc/dcn20/dcn20_resource.c | 35 ++++++++++++++- .../drm/amd/display/dc/dcn21/dcn21_resource.c | 35 ++++++++++++++- .../amd/display/modules/color/color_gamma.c | 31 ++++++++++--- .../amd/display/modules/color/color_gamma.h | 4 +- 7 files changed, 178 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +4 -3
@@ -239,7 +239,8 @@ static int __set_output_tf(struct dc_transfer_func *func,* instead to simulate this. */ gamma->type =GAMMA_CUSTOM ; - res =mod_color_calculate_degamma_params (func, gamma, true); + res =mod_color_calculate_degamma_params (NULL , func, + gamma, true); }else {/* * Assume sRGB. The actual mapping will depend on whether the
@@ -271,7 +272,7 @@ static int __set_input_tf(struct dc_transfer_func *func,__drm_lut_to_dc_gamma (lut, gamma, false); - res =mod_color_calculate_degamma_params (func, gamma, true); + res =mod_color_calculate_degamma_params (NULL , func, gamma, true);dc_gamma_release (&gamma);return res ?0 : -ENOMEM ;
@@ -485,7 +486,7 @@ int amdgpu_dm_update_plane_color_mgmt(struct dm_crtc_state *crtc, dc_plane_state->in_transfer_func->tf = tf;if (tf !=TRANSFER_FUNCTION_SRGB && - !mod_color_calculate_degamma_params ( + !mod_color_calculate_degamma_params (NULL , dc_plane_state->in_transfer_func,NULL , false))return -ENOMEM ; }else {
drivers/gpu/drm/amd/display/dc/dc.h +44 -1
59 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +34 -0
@@ -1384,6 +1384,40 @@ static bool dcn10_resource_construct(/* Raven DP PHY HBR2 eye diagram pattern is not stable. Use TP4 */ dc->caps.force_dp_tps4_for_cp2520 = true; +/* Color pipeline capabilities */ + dc->caps.color.dpp.dcn_arch =1 ; + dc->caps.color.dpp.input_lut_shared =1 ; + dc->caps.color.dpp.icsc =1 ; + dc->caps.color.dpp.dgam_ram =1 ; + dc->caps.color.dpp.dgam_rom_caps.srgb =1 ; + dc->caps.color.dpp.dgam_rom_caps.bt2020 =1 ; + dc->caps.color.dpp.dgam_rom_caps.gamma2_2 =0 ; + dc->caps.color.dpp.dgam_rom_caps.pq =0 ; + dc->caps.color.dpp.dgam_rom_caps.hlg =0 ; + dc->caps.color.dpp.post_csc =0 ; + dc->caps.color.dpp.gamma_corr =0 ; + + dc->caps.color.dpp.hw_3d_lut =0 ; + dc->caps.color.dpp.ogam_ram =1 ;// RGAM on DCN1 + dc->caps.color.dpp.ogam_rom_caps.srgb =1 ; + dc->caps.color.dpp.ogam_rom_caps.bt2020 =1 ; + dc->caps.color.dpp.ogam_rom_caps.gamma2_2 =0 ; + dc->caps.color.dpp.ogam_rom_caps.pq =0 ; + dc->caps.color.dpp.ogam_rom_caps.hlg =0 ; + dc->caps.color.dpp.ocsc =1 ; + +/* no post-blend color operations */ + dc->caps.color.mpc.gamut_remap =0 ; + dc->caps.color.mpc.num_3dluts =0 ; + dc->caps.color.mpc.shared_3d_lut =0 ; + dc->caps.color.mpc.ogam_ram =0 ; + dc->caps.color.mpc.ogam_rom_caps.srgb =0 ; + dc->caps.color.mpc.ogam_rom_caps.bt2020 =0 ; + dc->caps.color.mpc.ogam_rom_caps.gamma2_2 =0 ; + dc->caps.color.mpc.ogam_rom_caps.pq =0 ; + dc->caps.color.mpc.ogam_rom_caps.hlg =0 ; + dc->caps.color.mpc.ocsc =0 ; +if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv;else
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +34 -1
@@ -3709,9 +3709,42 @@ static bool dcn20_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.hw_3d_lut = true; dc->caps.extended_aux_timeout_support = true; +/* Color pipeline capabilities */ + dc->caps.color.dpp.dcn_arch =1 ; + dc->caps.color.dpp.input_lut_shared =0 ; + dc->caps.color.dpp.icsc =1 ; + dc->caps.color.dpp.dgam_ram =1 ; + dc->caps.color.dpp.dgam_rom_caps.srgb =1 ; + dc->caps.color.dpp.dgam_rom_caps.bt2020 =1 ; + dc->caps.color.dpp.dgam_rom_caps.gamma2_2 =0 ; + dc->caps.color.dpp.dgam_rom_caps.pq =0 ; + dc->caps.color.dpp.dgam_rom_caps.hlg =0 ; + dc->caps.color.dpp.post_csc =0 ; + dc->caps.color.dpp.gamma_corr =0 ; + + dc->caps.color.dpp.hw_3d_lut =1 ; + dc->caps.color.dpp.ogam_ram =1 ; +// no OGAM ROM on DCN2, only MPC ROM + dc->caps.color.dpp.ogam_rom_caps.srgb =0 ; + dc->caps.color.dpp.ogam_rom_caps.bt2020 =0 ; + dc->caps.color.dpp.ogam_rom_caps.gamma2_2 =0 ; + dc->caps.color.dpp.ogam_rom_caps.pq =0 ; + dc->caps.color.dpp.ogam_rom_caps.hlg =0 ; + dc->caps.color.dpp.ocsc =0 ; + + dc->caps.color.mpc.gamut_remap =0 ; + dc->caps.color.mpc.num_3dluts =0 ; + dc->caps.color.mpc.shared_3d_lut =0 ; + dc->caps.color.mpc.ogam_ram =1 ; + dc->caps.color.mpc.ogam_rom_caps.srgb =0 ; + dc->caps.color.mpc.ogam_rom_caps.bt2020 =0 ; + dc->caps.color.mpc.ogam_rom_caps.gamma2_2 =0 ; + dc->caps.color.mpc.ogam_rom_caps.pq =0 ; + dc->caps.color.mpc.ogam_rom_caps.hlg =0 ; + dc->caps.color.mpc.ocsc =1 ; +if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) { dc->debug = debug_defaults_drv; }else if (dc->ctx->dce_environment ==DCE_ENV_FPGA_MAXIMUS ) {
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +34 -1
@@ -1798,7 +1798,6 @@ static bool dcn21_resource_construct( dc->caps.i2c_speed_in_khz =100 ; dc->caps.max_cursor_size =256 ; dc->caps.dmdata_alloc_size =2048 ; - dc->caps.hw_3d_lut = true; dc->caps.max_slave_planes =1 ; dc->caps.post_blend_color_processing = true;
@@ -1807,6 +1806,40 @@ static bool dcn21_resource_construct( dc->caps.dmcub_support = true; dc->caps.is_apu = true; +/* Color pipeline capabilities */ + dc->caps.color.dpp.dcn_arch =1 ; + dc->caps.color.dpp.input_lut_shared =0 ; + dc->caps.color.dpp.icsc =1 ; + dc->caps.color.dpp.dgam_ram =1 ; + dc->caps.color.dpp.dgam_rom_caps.srgb =1 ; + dc->caps.color.dpp.dgam_rom_caps.bt2020 =1 ; + dc->caps.color.dpp.dgam_rom_caps.gamma2_2 =0 ; + dc->caps.color.dpp.dgam_rom_caps.pq =0 ; + dc->caps.color.dpp.dgam_rom_caps.hlg =0 ; + dc->caps.color.dpp.post_csc =0 ; + dc->caps.color.dpp.gamma_corr =0 ; + + dc->caps.color.dpp.hw_3d_lut =1 ; + dc->caps.color.dpp.ogam_ram =1 ; +// no OGAM ROM on DCN2 + dc->caps.color.dpp.ogam_rom_caps.srgb =0 ; + dc->caps.color.dpp.ogam_rom_caps.bt2020 =0 ; + dc->caps.color.dpp.ogam_rom_caps.gamma2_2 =0 ; + dc->caps.color.dpp.ogam_rom_caps.pq =0 ; + dc->caps.color.dpp.ogam_rom_caps.hlg =0 ; + dc->caps.color.dpp.ocsc =0 ; + + dc->caps.color.mpc.gamut_remap =0 ; + dc->caps.color.mpc.num_3dluts =0 ; + dc->caps.color.mpc.shared_3d_lut =0 ; + dc->caps.color.mpc.ogam_ram =1 ; + dc->caps.color.mpc.ogam_rom_caps.srgb =0 ; + dc->caps.color.mpc.ogam_rom_caps.bt2020 =0 ; + dc->caps.color.mpc.ogam_rom_caps.gamma2_2 =0 ; + dc->caps.color.mpc.ogam_rom_caps.pq =0 ; + dc->caps.color.mpc.ogam_rom_caps.hlg =0 ; + dc->caps.color.mpc.ocsc =1 ; +if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv;else if (dc->ctx->dce_environment ==DCE_ENV_FPGA_MAXIMUS ) {
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +25 -6
@@ -1782,7 +1782,8 @@ bool calculate_user_regamma_ramp(struct dc_transfer_func *output_tf,return ret; } -bool mod_color_calculate_degamma_params (struct dc_transfer_func *input_tf, +bool mod_color_calculate_degamma_params (struct dc_color_caps *dc_caps, +struct dc_transfer_func *input_tf,const struct dc_gamma *ramp,bool mapUserRamp) {struct dc_transfer_func_distributed_points *tf_pts = &input_tf->tf_pts;
@@ -1801,11 +1802,29 @@ bool mod_color_calculate_degamma_params(struct dc_transfer_func *input_tf,/* we can use hardcoded curve for plain SRGB TF * If linear, it's bypass if on user ramp */ -if (input_tf->type ==TF_TYPE_PREDEFINED && - (input_tf->tf ==TRANSFER_FUNCTION_SRGB || - input_tf->tf ==TRANSFER_FUNCTION_LINEAR ) && - !mapUserRamp) -return true; +if (input_tf->type ==TF_TYPE_PREDEFINED ) { +if ((input_tf->tf ==TRANSFER_FUNCTION_SRGB || + input_tf->tf ==TRANSFER_FUNCTION_LINEAR ) && + !mapUserRamp) +return true; + +if (dc_caps !=NULL && + dc_caps->dpp.dcn_arch ==1 ) { + +if (input_tf->tf ==TRANSFER_FUNCTION_PQ && + dc_caps->dpp.dgam_rom_caps.pq ==1 ) +return true; + +if (input_tf->tf ==TRANSFER_FUNCTION_GAMMA22 && + dc_caps->dpp.dgam_rom_caps.gamma2_2 ==1 ) +return true; + +// HLG OOTF not accounted for +if (input_tf->tf ==TRANSFER_FUNCTION_HLG && + dc_caps->dpp.dgam_rom_caps.hlg ==1 ) +return true; + } + } input_tf->type =TF_TYPE_DISTRIBUTED_POINTS ;
drivers/gpu/drm/amd/display/modules/color/color_gamma.h +3 -1
@@ -30,6 +30,7 @@ struct dc_transfer_func;struct dc_gamma ;struct dc_transfer_func_distributed_points ;struct dc_rgb_fixed ; +struct dc_color_caps ;enum dc_transfer_func_predefined ;/* For SetRegamma ADL interface support
@@ -100,7 +101,8 @@ 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); -bool mod_color_calculate_degamma_params (struct dc_transfer_func *output_tf, +bool mod_color_calculate_degamma_params (struct dc_color_caps *dc_caps, +struct dc_transfer_func *output_tf,const struct dc_gamma *ramp,bool mapUserRamp); bool mod_color_calculate_degamma_curve(enum dc_transfer_func_predefined trans,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 17/19 drm/amd/display: Use cursor locking to prevent flip delays
In reply to Aurabindo PillaiFrom: Aric Cyr <[email protected]>
[Why]
Current locking scheme for cursor can result in a flip missing its vsync, deferring it for one or more vsyncs. Result is a potential for stuttering when cursor is moved.
[How]
Use cursor update lock so that flips are not blocked while cursor is being programmed.
--- .../gpu/drm/amd/display/dc/core/dc_stream.c | 40 ++----------------- .../display/dc/dce110/dce110_hw_sequencer.c | 1 + .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 10 +++++ .../amd/display/dc/dcn10/dcn10_hw_sequencer.h | 1 + .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 1 + .../gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c | 15 +++++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h | 20 +++++++--- .../drm/amd/display/dc/dcn10/dcn10_resource.c | 14 ++++++- .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 1 + .../gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c | 1 + .../gpu/drm/amd/display/dc/dcn20/dcn20_mpc.h | 3 +- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 4 ++ .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 1 + .../drm/amd/display/dc/dcn21/dcn21_resource.c | 4 ++ drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h | 16 ++++++++ .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 1 + 16 files changed, 88 insertions(+), 45 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +4 -36
@@ -231,34 +231,6 @@ struct dc_stream_status *dc_stream_get_status(return dc_stream_get_status_from_state (dc->current_state, stream); } -static void delay_cursor_until_vupdate (struct pipe_ctx *pipe_ctx,struct dc *dc) -{ -#if defined(CONFIG_DRM_AMD_DC_DCN ) -unsigned int vupdate_line; -unsigned int lines_to_vupdate, us_to_vupdate, vpos, nvpos; -struct dc_stream_state *stream = pipe_ctx->stream; -unsigned int us_per_line; - -if (!dc->hwss.get_vupdate_offset_from_vsync) -return ; - - vupdate_line = dc->hwss.get_vupdate_offset_from_vsync (pipe_ctx); -if (!dc_stream_get_crtc_position (dc, &stream,1 , &vpos, &nvpos)) -return ; - -if (vpos >= vupdate_line) -return ; - - us_per_line = - stream->timing.h_total *10000 / stream->timing.pix_clk_100hz; - lines_to_vupdate = vupdate_line - vpos; - us_to_vupdate = lines_to_vupdate * us_per_line; - -/* 70 us is a conservative estimate of cursor update time*/ -if (us_to_vupdate <70 ) -udelay (us_to_vupdate); -#endif -}/** * dc_stream_set_cursor_attributes() - Update cursor attributes and set cursor surface address
@@ -298,9 +270,7 @@ bool dc_stream_set_cursor_attributes(if (!pipe_to_program) { pipe_to_program = pipe_ctx; - -delay_cursor_until_vupdate (pipe_ctx, dc); - dc->hwss.pipe_control_lock (dc, pipe_to_program, true); + dc->hwss.cursor_lock (dc, pipe_to_program, true); } dc->hwss.set_cursor_attribute (pipe_ctx);
@@ -309,7 +279,7 @@ bool dc_stream_set_cursor_attributes( }if (pipe_to_program) - dc->hwss.pipe_control_lock (dc, pipe_to_program, false); + dc->hwss.cursor_lock (dc, pipe_to_program, false);return true; }
@@ -349,16 +319,14 @@ bool dc_stream_set_cursor_position(if (!pipe_to_program) { pipe_to_program = pipe_ctx; - -delay_cursor_until_vupdate (pipe_ctx, dc); - dc->hwss.pipe_control_lock (dc, pipe_to_program, true); + dc->hwss.cursor_lock (dc, pipe_to_program, true); } dc->hwss.set_cursor_position (pipe_ctx); }if (pipe_to_program) - dc->hwss.pipe_control_lock (dc, pipe_to_program, false); + dc->hwss.cursor_lock (dc, pipe_to_program, false);return true; }
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -0
@@ -2767,6 +2767,7 @@ static const struct hw_sequencer_funcs dce110_funcs = { .disable_plane = dce110_power_down_fe, .pipe_control_lock = dce_pipe_control_lock, .interdependent_update_lock = NULL, + .cursor_lock = dce_pipe_control_lock, .prepare_bandwidth = dce110_prepare_bandwidth, .optimize_bandwidth = dce110_optimize_bandwidth, .set_drr = set_drr,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +10 -0
@@ -1669,6 +1669,16 @@ void dcn10_pipe_control_lock( hws->funcs.verify_allow_pstate_change_high (dc); } +void dcn10_cursor_lock (struct dc *dc,struct pipe_ctx *pipe,bool lock) +{ +/* cursor lock is per MPCC tree, so only need to lock one pipe per stream */ +if (!pipe || pipe->top_pipe) +return ; + + dc->res_pool->mpc->funcs->cursor_lock (dc->res_pool->mpc, + pipe->stream_res.opp->inst, lock); +} +static bool wait_for_reset_trigger_to_occur (struct dc_context *dc_ctx,struct timing_generator *tg)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +1 -0
@@ -49,6 +49,7 @@ void dcn10_pipe_control_lock(struct dc *dc, struct pipe_ctx *pipe, bool lock); +void dcn10_cursor_lock (struct dc *dc,struct pipe_ctx *pipe,bool lock); void dcn10_blank_pixel_data( struct dc *dc, struct pipe_ctx *pipe_ctx,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_init.c +1 -0
@@ -50,6 +50,7 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .disable_audio_stream = dce110_disable_audio_stream, .disable_plane = dcn10_disable_plane, .pipe_control_lock = dcn10_pipe_control_lock, + .cursor_lock = dcn10_cursor_lock, .interdependent_update_lock = dcn10_lock_all_pipes, .prepare_bandwidth = dcn10_prepare_bandwidth, .optimize_bandwidth = dcn10_optimize_bandwidth,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +15 -0
@@ -223,6 +223,9 @@ struct mpcc *mpc1_insert_plane(REG_SET (MPCC_TOP_SEL [mpcc_id],0 ,MPCC_TOP_SEL , dpp_id);REG_SET (MPCC_OPP_ID [mpcc_id],0 ,MPCC_OPP_ID , tree->opp_id); +/* Configure VUPDATE lock set for this MPCC to map to the OPP */ +REG_SET (MPCC_UPDATE_LOCK_SEL [mpcc_id],0 ,MPCC_UPDATE_LOCK_SEL , tree->opp_id); +/* update mpc tree mux setting */ if (tree->opp_list == insert_above_mpcc) {/* insert the toppest mpcc */
@@ -318,6 +321,7 @@ void mpc1_remove_mpcc(REG_SET (MPCC_TOP_SEL [mpcc_id],0 ,MPCC_TOP_SEL ,0xf );REG_SET (MPCC_BOT_SEL [mpcc_id],0 ,MPCC_BOT_SEL ,0xf );REG_SET (MPCC_OPP_ID [mpcc_id],0 ,MPCC_OPP_ID ,0xf ); +REG_SET (MPCC_UPDATE_LOCK_SEL [mpcc_id],0 ,MPCC_UPDATE_LOCK_SEL ,0xf );/* mark this mpcc as not in use */ mpc10->mpcc_in_use_mask &= ~(1 << mpcc_id);
@@ -328,6 +332,7 @@ void mpc1_remove_mpcc(REG_SET (MPCC_TOP_SEL [mpcc_id],0 ,MPCC_TOP_SEL ,0xf );REG_SET (MPCC_BOT_SEL [mpcc_id],0 ,MPCC_BOT_SEL ,0xf );REG_SET (MPCC_OPP_ID [mpcc_id],0 ,MPCC_OPP_ID ,0xf ); +REG_SET (MPCC_UPDATE_LOCK_SEL [mpcc_id],0 ,MPCC_UPDATE_LOCK_SEL ,0xf ); } }
@@ -361,6 +366,7 @@ void mpc1_mpc_init(struct mpc *mpc)REG_SET (MPCC_TOP_SEL [mpcc_id],0 ,MPCC_TOP_SEL ,0xf );REG_SET (MPCC_BOT_SEL [mpcc_id],0 ,MPCC_BOT_SEL ,0xf );REG_SET (MPCC_OPP_ID [mpcc_id],0 ,MPCC_OPP_ID ,0xf ); +REG_SET (MPCC_UPDATE_LOCK_SEL [mpcc_id],0 ,MPCC_UPDATE_LOCK_SEL ,0xf );mpc1_init_mpcc (&(mpc->mpcc_array[mpcc_id]), mpcc_id); }
@@ -381,6 +387,7 @@ void mpc1_mpc_init_single_inst(struct mpc *mpc, unsigned int mpcc_id)REG_SET (MPCC_TOP_SEL [mpcc_id],0 ,MPCC_TOP_SEL ,0xf );REG_SET (MPCC_BOT_SEL [mpcc_id],0 ,MPCC_BOT_SEL ,0xf );REG_SET (MPCC_OPP_ID [mpcc_id],0 ,MPCC_OPP_ID ,0xf ); +REG_SET (MPCC_UPDATE_LOCK_SEL [mpcc_id],0 ,MPCC_UPDATE_LOCK_SEL ,0xf );mpc1_init_mpcc (&(mpc->mpcc_array[mpcc_id]), mpcc_id);
@@ -453,6 +460,13 @@ void mpc1_read_mpcc_state( MPCC_BUSY, &s->busy); } +void mpc1_cursor_lock (struct mpc *mpc,int opp_id,bool lock) +{ +struct dcn10_mpc *mpc10 =TO_DCN10_MPC (mpc); + +REG_SET (CUR [opp_id],0 ,CUR_VUPDATE_LOCK_SET , lock ?1 :0 ); +} +static const struct mpc_funcs dcn10_mpc_funcs = { .read_mpcc_state = mpc1_read_mpcc_state, .insert_plane = mpc1_insert_plane,
@@ -464,6 +478,7 @@ static const struct mpc_funcs dcn10_mpc_funcs = { .assert_mpcc_idle_before_connect = mpc1_assert_mpcc_idle_before_connect, .init_mpcc_list_from_hw = mpc1_init_mpcc_list_from_hw, .update_blending = mpc1_update_blending, + .cursor_lock = mpc1_cursor_lock, .set_denorm = NULL, .set_denorm_clamp = NULL, .set_output_csc = NULL,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h +14 -6
@@ -39,11 +39,12 @@SRII (MPCC_BG_G_Y ,MPCC , inst),\SRII (MPCC_BG_R_CR ,MPCC , inst),\SRII (MPCC_BG_B_CB ,MPCC , inst),\ -SRII (MPCC_BG_B_CB ,MPCC , inst),\ - SRII(MPCC_SM_CONTROL, MPCC, inst) +SRII (MPCC_SM_CONTROL ,MPCC , inst),\ + SRII(MPCC_UPDATE_LOCK_SEL, MPCC, inst)#define MPC_OUT_MUX_COMMON_REG_LIST_DCN1_0 (inst) \ - SRII(MUX, MPC_OUT, inst) + SRII(MUX, MPC_OUT, inst),\ + VUPDATE_SRII(CUR, VUPDATE_LOCK_SET, inst)#define MPC_COMMON_REG_VARIABLE_LIST \ uint32_t MPCC_TOP_SEL[MAX_MPCC]; \
@@ -55,7 +56,9 @@uint32_t MPCC_BG_R_CR [MAX_MPCC ]; \uint32_t MPCC_BG_B_CB [MAX_MPCC ]; \uint32_t MPCC_SM_CONTROL [MAX_MPCC ]; \ -uint32_t MUX [MAX_OPP ]; +uint32_t MUX [MAX_OPP ]; \ +uint32_t MPCC_UPDATE_LOCK_SEL [MAX_MPCC ]; \ +uint32_t CUR [MAX_OPP ];#define MPC_COMMON_MASK_SH_LIST_DCN1_0 (mask_sh)\ SF(MPCC0_MPCC_TOP_SEL, MPCC_TOP_SEL, mask_sh),\
@@ -78,7 +81,8 @@SF (MPCC0_MPCC_SM_CONTROL ,MPCC_SM_FIELD_ALT , mask_sh),\SF (MPCC0_MPCC_SM_CONTROL ,MPCC_SM_FORCE_NEXT_FRAME_POL , mask_sh),\SF (MPCC0_MPCC_SM_CONTROL ,MPCC_SM_FORCE_NEXT_TOP_POL , mask_sh),\ - SF(MPC_OUT0_MUX, MPC_OUT_MUX, mask_sh) +SF (MPC_OUT0_MUX ,MPC_OUT_MUX , mask_sh),\ + SF(MPCC0_MPCC_UPDATE_LOCK_SEL, MPCC_UPDATE_LOCK_SEL, mask_sh)#define MPC_REG_FIELD_LIST (type) \ type MPCC_TOP_SEL;\
@@ -101,7 +105,9 @@type MPCC_SM_FIELD_ALT ;\type MPCC_SM_FORCE_NEXT_FRAME_POL ;\type MPCC_SM_FORCE_NEXT_TOP_POL ;\ -type MPC_OUT_MUX ; +type MPC_OUT_MUX ;\ +type MPCC_UPDATE_LOCK_SEL ;\ +type CUR_VUPDATE_LOCK_SET ;struct dcn_mpc_registers {MPC_COMMON_REG_VARIABLE_LIST
@@ -192,4 +198,6 @@ void mpc1_read_mpcc_state(int mpcc_inst, struct mpcc_state *s); +void mpc1_cursor_lock (struct mpc *mpc,int opp_id,bool lock); +#endif
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +12 -2
@@ -182,6 +182,14 @@ enum dcn10_clk_src_array_id { .reg_name[id] = BASE(mm ## block ## id ## _ ## reg_name ## _BASE_IDX) + \ mm ## block ## id ## _ ## reg_name +#define VUPDATE_SRII (reg_name, block, id)\ + .reg_name[id] = BASE(mm ## reg_name ## 0 ## _ ## block ## id ## _BASE_IDX) + \ + mm ## reg_name ## 0 ## _ ## block ## id + +/* set field/register/bitfield name */ +#define SFRB (field_name, reg_name, bitfield, post_fix)\ + .field_name = reg_name ## __ ## bitfield ## post_fix +/* NBIO */ #define NBIO_BASE_INNER (seg) \ NBIF_BASE__INST0_SEG ## seg
@@ -432,11 +440,13 @@ static const struct dcn_mpc_registers mpc_regs = { };static const struct dcn_mpc_shift mpc_shift = { -MPC_COMMON_MASK_SH_LIST_DCN1_0 (__SHIFT) +MPC_COMMON_MASK_SH_LIST_DCN1_0 (__SHIFT),\ +SFRB (CUR_VUPDATE_LOCK_SET ,CUR0_VUPDATE_LOCK_SET0 ,CUR0_VUPDATE_LOCK_SET , __SHIFT) };static const struct dcn_mpc_mask mpc_mask = { -MPC_COMMON_MASK_SH_LIST_DCN1_0 (_MASK), +MPC_COMMON_MASK_SH_LIST_DCN1_0 (_MASK),\ +SFRB (CUR_VUPDATE_LOCK_SET ,CUR0_VUPDATE_LOCK_SET0 ,CUR0_VUPDATE_LOCK_SET , _MASK) };#define tg_regs (id)\
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c +1 -0
@@ -52,6 +52,7 @@ static const struct hw_sequencer_funcs dcn20_funcs = { .disable_plane = dcn20_disable_plane, .pipe_control_lock = dcn20_pipe_control_lock, .interdependent_update_lock = dcn10_lock_all_pipes, + .cursor_lock = dcn10_cursor_lock, .prepare_bandwidth = dcn20_prepare_bandwidth, .optimize_bandwidth = dcn20_optimize_bandwidth, .update_bandwidth = dcn20_update_bandwidth,
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c +1 -0
@@ -545,6 +545,7 @@ const struct mpc_funcs dcn20_mpc_funcs = { .mpc_init = mpc1_mpc_init, .mpc_init_single_inst = mpc1_mpc_init_single_inst, .update_blending = mpc2_update_blending, + .cursor_lock = mpc1_cursor_lock, .get_mpcc_for_dpp = mpc2_get_mpcc_for_dpp, .wait_for_idle = mpc2_assert_idle_mpcc, .assert_mpcc_idle_before_connect = mpc2_assert_mpcc_idle_before_connect,
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.h +2 -1
@@ -179,7 +179,8 @@SF (MPC_OUT0_DENORM_CLAMP_G_Y ,MPC_OUT_DENORM_CLAMP_MAX_G_Y , mask_sh),\SF (MPC_OUT0_DENORM_CLAMP_G_Y ,MPC_OUT_DENORM_CLAMP_MIN_G_Y , mask_sh),\SF (MPC_OUT0_DENORM_CLAMP_B_CB ,MPC_OUT_DENORM_CLAMP_MAX_B_CB , mask_sh),\ -SF (MPC_OUT0_DENORM_CLAMP_B_CB ,MPC_OUT_DENORM_CLAMP_MIN_B_CB , mask_sh) +SF (MPC_OUT0_DENORM_CLAMP_B_CB ,MPC_OUT_DENORM_CLAMP_MIN_B_CB , mask_sh),\ +SF (CUR_VUPDATE_LOCK_SET0 ,CUR_VUPDATE_LOCK_SET , mask_sh)/* * DCN2 MPC_OCSC debug status register:
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +4 -0
@@ -509,6 +509,10 @@ enum dcn20_clk_src_array_id { .block ## _ ## reg_name[id] = BASE(mm ## block ## id ## _ ## reg_name ## _BASE_IDX) + \ mm ## block ## id ## _ ## reg_name +#define VUPDATE_SRII (reg_name, block, id)\ + .reg_name[id] = BASE(mm ## reg_name ## _ ## block ## id ## _BASE_IDX) + \ + mm ## reg_name ## _ ## block ## id +/* NBIO */ #define NBIO_BASE_INNER (seg) \ NBIO_BASE__INST0_SEG ## seg
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c +1 -0
@@ -53,6 +53,7 @@ static const struct hw_sequencer_funcs dcn21_funcs = { .disable_plane = dcn20_disable_plane, .pipe_control_lock = dcn20_pipe_control_lock, .interdependent_update_lock = dcn10_lock_all_pipes, + .cursor_lock = dcn10_cursor_lock, .prepare_bandwidth = dcn20_prepare_bandwidth, .optimize_bandwidth = dcn20_optimize_bandwidth, .update_bandwidth = dcn20_update_bandwidth,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +4 -0
@@ -342,6 +342,10 @@ struct _vcs_dpi_soc_bounding_box_st dcn2_1_soc = { .block ## _ ## reg_name[id] = BASE(mm ## block ## id ## _ ## reg_name ## _BASE_IDX) + \ mm ## block ## id ## _ ## reg_name +#define VUPDATE_SRII (reg_name, block, id)\ + .reg_name[id] = BASE(mm ## reg_name ## _ ## block ## id ## _BASE_IDX) + \ + mm ## reg_name ## _ ## block ## id +/* NBIO */ #define NBIO_BASE_INNER (seg) \ NBIF0_BASE__INST0_SEG ## seg
drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h +16 -0
@@ -210,6 +210,22 @@ struct mpc_funcs {struct mpcc_blnd_cfg *blnd_cfg, int mpcc_id); +/* +* Lock cursor updates for the specified OPP. +* OPP defines the set of MPCC that are locked together for cursor. +* +* Parameters: +* [in] mpc - MPC context. +* [in] opp_id - The OPP to lock cursor updates on +* [in] lock - lock/unlock the OPP +* +* Return: void +*/ +void (*cursor_lock)( +struct mpc *mpc, +int opp_id, +bool lock); +struct mpcc * (*get_mpcc_for_dpp)(struct mpc_tree *tree,int dpp_id);
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +1 -0
@@ -90,6 +90,7 @@ struct hw_sequencer_funcs { struct dc_state *context, bool lock);void (*set_flip_control_gsl)(struct pipe_ctx *pipe_ctx,bool flip_immediate); +void (*cursor_lock)(struct dc *dc,struct pipe_ctx *pipe,bool lock);/* Timing Related */ void (*get_position)(struct pipe_ctx **pipe_ctx, int num_pipes,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 18/19 drm/amd/display: 3.2.83
In reply to Aurabindo PillaiFrom: 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.82" +#define DC_VER "3.2.83"#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 19/19 drm/amd/display: 3.2.83.1
In reply to Aurabindo PillaiFrom: Aric Cyr <[email protected]>
Update firmware blobs
--- 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.83" +#define DC_VER "3.2.83.1"#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