DC Patches Sept 23, 2024
cover DC Patches Sept 23, 2024
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* Improve brightness control
* Add support for UHBR10 eDP
* OPTC required only for DTBCLK_P for dcn401
* Fix TBT monitor resume issue
* Code cleanup
Alex Hung (3):
drm/amd/display: Remove always-false branches drm/amd/display: Eliminate recursive header inclusion drm/amd/display: Removed unused assignments and variables
Aric Cyr (1):
drm/amd/display: 3.2.303
Dillon Varone (1):
drm/amd/display: Configure DTBCLK_P with OPTC only for dcn401
Liu Xi (Alex) (1):
drm/amd/display: add more support for UHBR10 eDP
Muyuan Yang (2):
drm/amd/display: Change Brightness Control Priority drm/amd/display: Introduce New ABC Framework for Brightness Control
Ovidiu Bunea (1):
drm/amd/display: Add IPS residency capture helpers to dc_dmub_srv
Paul Hsieh (1):
drm/amd/display: Add logs to record register read/write
Ryan Seto (1):
drm/amd/display: Adjust PHY FSM transition to TX_EN-to-PLL_ON for TMDS
Taimur Hassan (1):
drm/amd/display: [FW Promotion] Release 0.0.236.0
Tom Chung (1):
drm/amd/display: Fix system hang while resume with TBT monitor
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 48 +---- drivers/gpu/drm/amd/display/dc/dc.h | 4 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 78 ++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 39 ++++ drivers/gpu/drm/amd/display/dc/dc_plane.h | 1 - drivers/gpu/drm/amd/display/dc/dc_state.h | 1 - drivers/gpu/drm/amd/display/dc/dc_types.h | 6 + .../amd/display/dc/dccg/dcn401/dcn401_dccg.c | 84 -------- .../dc/dml/dcn30/display_mode_vba_30.c | 9 - .../display/dc/dml/dml1_display_rq_dlg_calc.c | 3 +- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 187 +++++++++++++++++- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.h | 11 ++ .../amd/display/dc/hwss/dcn401/dcn401_init.c | 6 +- .../link/protocols/link_edp_panel_control.c | 43 ++-- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 8 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 157 ++++++++++++++- .../drm/amd/display/include/logger_types.h | 4 +- 18 files changed, 521 insertions(+), 177 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/13 drm/amd/display: Adjust PHY FSM transition to TX_EN-to-PLL_ON for TMDS
From: Ryan Seto <[email protected]>
[Why]
If two monitors with TMDS signals were timing synced and one was disconnected, the stream would go out of sync too early due to the PLL turning off and the system could hang
[How]
On link disable output, change PHY FSM transition from TX_EN-to-PHY_OFF to TX_EN-to-PLL_ON for TMDS
--- .../amd/display/dc/dccg/dcn401/dcn401_dccg.c | 81 ------------------- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 52 ++++++++++++ .../amd/display/dc/hwss/dcn401/dcn401_hwseq.h | 4 + .../amd/display/dc/hwss/dcn401/dcn401_init.c | 2 +- 4 files changed, 57 insertions(+), 82 deletions(-)
drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c +0 -81
@@ -805,33 +805,6 @@ static void dccg401_enable_symclk_se(struct dccg *dccg, uint32_t stream_enc_inst {struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg); -switch (link_enc_inst) { -case 0 : -REG_UPDATE (SYMCLKA_CLOCK_ENABLE , -SYMCLKA_CLOCK_ENABLE ,1 ); -if (dccg->ctx->dc->debug.root_clock_optimization.bits.symclk32_se) -REG_UPDATE (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKA_ROOT_GATE_DISABLE ,1 ); -break ; -case 1 : -REG_UPDATE (SYMCLKB_CLOCK_ENABLE , -SYMCLKB_CLOCK_ENABLE ,1 ); -if (dccg->ctx->dc->debug.root_clock_optimization.bits.symclk32_se) -REG_UPDATE (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKB_ROOT_GATE_DISABLE ,1 ); -break ; -case 2 : -REG_UPDATE (SYMCLKC_CLOCK_ENABLE , -SYMCLKC_CLOCK_ENABLE ,1 ); -if (dccg->ctx->dc->debug.root_clock_optimization.bits.symclk32_se) -REG_UPDATE (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKC_ROOT_GATE_DISABLE ,1 ); -break ; -case 3 : -REG_UPDATE (SYMCLKD_CLOCK_ENABLE , -SYMCLKD_CLOCK_ENABLE ,1 ); -if (dccg->ctx->dc->debug.root_clock_optimization.bits.symclk32_se) -REG_UPDATE (DCCG_GATE_DISABLE_CNTL5 ,SYMCLKD_ROOT_GATE_DISABLE ,1 ); -break ; - } -switch (stream_enc_inst) {case 0 : REG_UPDATE_2(SYMCLKA_CLOCK_ENABLE,
@@ -864,37 +837,8 @@ static void dccg401_enable_symclk_se(struct dccg *dccg, uint32_t stream_enc_inst } } -/*get other front end connected to this backend*/ -static uint8_t dccg401_get_number_enabled_symclk_fe_connected_to_be (struct dccg *dccg,uint32_t link_enc_inst) -{ -uint8_t num_enabled_symclk_fe =0 ; -uint32_t fe_clk_en[4 ] = {0 }, be_clk_sel[4 ] = {0 }; -struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg); -uint8_t i; - -REG_GET_2 (SYMCLKA_CLOCK_ENABLE ,SYMCLKA_FE_EN , &fe_clk_en[0 ], -SYMCLKA_FE_SRC_SEL , &be_clk_sel[0 ]); - -REG_GET_2 (SYMCLKB_CLOCK_ENABLE ,SYMCLKB_FE_EN , &fe_clk_en[1 ], -SYMCLKB_FE_SRC_SEL , &be_clk_sel[1 ]); - -REG_GET_2 (SYMCLKC_CLOCK_ENABLE ,SYMCLKC_FE_EN , &fe_clk_en[2 ], -SYMCLKC_FE_SRC_SEL , &be_clk_sel[2 ]); - -REG_GET_2 (SYMCLKD_CLOCK_ENABLE ,SYMCLKD_FE_EN , &fe_clk_en[3 ], -SYMCLKD_FE_SRC_SEL , &be_clk_sel[3 ]); - -for (i =0 ; i <ARRAY_SIZE (fe_clk_en); i++) { -if (fe_clk_en[i] && be_clk_sel[i] == link_enc_inst) - num_enabled_symclk_fe++; - } - -return num_enabled_symclk_fe; -} -static void dccg401_disable_symclk_se (struct dccg *dccg,uint32_t stream_enc_inst,uint32_t link_enc_inst) { -uint8_t num_enabled_symclk_fe =0 ;struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg);switch (stream_enc_inst) {
@@ -919,31 +863,6 @@ static void dccg401_disable_symclk_se(struct dccg *dccg, uint32_t stream_enc_ins SYMCLKD_FE_SRC_SEL, 0);break ; } - -/*check other enabled symclk fe connected to this be */ - num_enabled_symclk_fe =dccg401_get_number_enabled_symclk_fe_connected_to_be (dccg, link_enc_inst); -/*only turn off backend clk if other front ends attached to this backend are all off, -for mst, only turn off the backend if this is the last front end*/ -if (num_enabled_symclk_fe ==0 ) { -switch (link_enc_inst) { -case 0 : -REG_UPDATE (SYMCLKA_CLOCK_ENABLE , -SYMCLKA_CLOCK_ENABLE ,0 ); -break ; -case 1 : -REG_UPDATE (SYMCLKB_CLOCK_ENABLE , -SYMCLKB_CLOCK_ENABLE ,0 ); -break ; -case 2 : -REG_UPDATE (SYMCLKC_CLOCK_ENABLE , -SYMCLKC_CLOCK_ENABLE ,0 ); -break ; -case 3 : -REG_UPDATE (SYMCLKD_CLOCK_ENABLE , -SYMCLKD_CLOCK_ENABLE ,0 ); -break ; - } - } }static const struct dccg_funcs dccg401_funcs = {
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +52 -0
58 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.h +4 -0
@@ -55,6 +55,10 @@ void dcn401_populate_mcm_luts(struct dc *dc, bool lut_bank_a);void dcn401_setup_hpo_hw_control (const struct dce_hwseq *hws,bool enable); +void dcn401_disable_link_output (struct dc_link *link, +const struct link_resource *link_res, +enum signal_type signal); +void dcn401_set_cursor_position (struct pipe_ctx *pipe_ctx);bool dcn401_apply_idle_power_optimizations (struct dc *dc,bool enable);
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_init.c +1 -1
@@ -84,7 +84,7 @@ static const struct hw_sequencer_funcs dcn401_funcs = { .enable_lvds_link_output = dce110_enable_lvds_link_output, .enable_tmds_link_output = dce110_enable_tmds_link_output, .enable_dp_link_output = dce110_enable_dp_link_output, - .disable_link_output = dcn32_disable_link_output, + .disable_link_output = dcn401_disable_link_output, .set_disp_pattern_generator = dcn30_set_disp_pattern_generator, .get_dcc_en_bits = dcn10_get_dcc_en_bits, .enable_phantom_streams = dcn32_enable_phantom_streams,
Signature · 1 line
2.34.1
PATCH 2/13 drm/amd/display: Fix system hang while resume with TBT monitor
In reply to Fangzhi ZuoFrom: Tom Chung <[email protected]>
[Why]
Connected with a Thunderbolt monitor and do the suspend and the system may hang while resume.
The TBT monitor HPD will be triggered during the resume procedure and call the drm_client_modeset_probe() while
struct drm_connector connector->dev->master is NULL.
It will mess up the pipe topology after resume.
[How]
Skip the TBT monitor HPD during the resume procedure because we currently will probe the connectors after resume by default.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +6 -0
@@ -770,6 +770,12 @@ static void dmub_hpd_callback(struct amdgpu_device *adev,return ; } +/* Skip DMUB HPD IRQ in suspend/resume. We will probe them later. */ +if (notify->type ==DMUB_NOTIFICATION_HPD && adev->in_suspend) { +DRM_INFO ("Skip DMUB HPD IRQ callback in suspend/resume\n" ); +return ; + } + link_index = notify->link_index; link = adev->dm.dc->links[link_index]; dev = adev->dm.ddev;
Signature · 1 line
2.34.1
PATCH 3/13 drm/amd/display: Add logs to record register read/write
In reply to Fangzhi ZuoFrom: Paul Hsieh <[email protected]>
[Why]
There are some issues which customer only can provide full dump for analyze, without register history, it's hard to debug HW status.
[How]
1. Put register read/write into WPP log so we can trace the logs from full memory dump.
2. MALL doesn't add into WPP, add it.
--- drivers/gpu/drm/amd/display/include/logger_types.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/include/logger_types.h +3 -1
@@ -61,11 +61,13 @@#define DC_LOG_ALL_TF_CHANNELS (...) pr_debug("[GAMMA]:"__VA_ARGS__)#define DC_LOG_DSC (...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__)#define DC_LOG_SMU (...) pr_debug("[SMU_MSG]:"__VA_ARGS__) -#define DC_LOG_MALL (...) pr_debug("[MALL]:"__VA_ARGS__)#define DC_LOG_DWB (...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__)#define DC_LOG_DP2 (...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__)#define DC_LOG_AUTO_DPM_TEST (...) pr_debug("[AutoDPMTest]: "__VA_ARGS__)#define DC_LOG_IPS (...) pr_debug("[IPS]: "__VA_ARGS__) +#define DC_LOG_MALL (...) pr_debug("[MALL]:"__VA_ARGS__) +#define DC_LOG_REGISTER_READ (...) pr_debug("[REGISTER_READ]: "__VA_ARGS__) +#define DC_LOG_REGISTER_WRITE (...) pr_debug("[REGISTER_WRITE]: "__VA_ARGS__)struct dc_log_buffer_ctx {char *buf;
Signature · 1 line
2.34.1
PATCH 4/13 drm/amd/display: add more support for UHBR10 eDP
In reply to Fangzhi ZuoFrom: "Liu Xi (Alex)" <[email protected]>
[Why and how]
The current UHBR10 eDP panel has new security feature update. Add support for the new FW
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 - .../drm/amd/display/dc/link/protocols/link_edp_panel_control.c | 3 --- 2 files changed, 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +0 -1
@@ -1771,7 +1771,6 @@ struct dc_link {bool dongle_mode_timing_override;bool blank_stream_on_ocs_change;bool read_dpcd204h_on_irq_hpd; -bool disable_assr_for_uhbr; } wa_flags;struct link_mst_stream_allocation_table mst_stream_alloc_table;
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +0 -3
@@ -1168,9 +1168,6 @@ static void edp_set_assr_enable(const struct dc *pDC, struct dc_link *link, link_enc_index = link->link_enc->transmitter -TRANSMITTER_UNIPHY_A ;if (link_res->hpo_dp_link_enc) { -if (link->wa_flags.disable_assr_for_uhbr) -return ; - link_enc_index = link_res->hpo_dp_link_enc->inst; use_hpo_dp_link_enc = true; }
Signature · 1 line
2.34.1
PATCH 5/13 drm/amd/display: Change Brightness Control Priority
In reply to Fangzhi ZuoFrom: Muyuan Yang <[email protected]>
Prioritize Aux-based over PWM-based brightness control for more types of panels and introduce a new structure to store and manage the type of brightness control used.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dc_types.h | 6 ++++++ 2 files changed, 7 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1786,6 +1786,7 @@ struct dc_link {// BW ALLOCATON USB4 ONLY struct dc_dpia_bw_alloc dpia_bw_alloc_config;bool skip_implict_edp_power_control; +enum backlight_control_type backlight_control_type; };/* Return an enumerated dc_link.
drivers/gpu/drm/amd/display/dc/dc_types.h +6 -0
@@ -923,6 +923,12 @@ struct display_endpoint_id {enum display_endpoint_type ep_type; }; +enum backlight_control_type { +BACKLIGHT_CONTROL_PWM =0 , +BACKLIGHT_CONTROL_VESA_AUX =1 , +BACKLIGHT_CONTROL_AMD_AUX =2 , +}; + #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) struct otg_phy_mux { uint8_t phy_output_num;
Signature · 1 line
2.34.1
PATCH 6/13 drm/amd/display: Introduce New ABC Framework for Brightness Control
In reply to Fangzhi ZuoFrom: Muyuan Yang <[email protected]>
Adjust the existing brightness control functions to use the new ABC Framework and prioritize Aux-based brightness control.
--- .../link/protocols/link_edp_panel_control.c | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +19 -21
@@ -157,31 +157,11 @@ bool edp_set_backlight_level_nits(struct dc_link *link, uint32_t backlight_millinits, uint32_t transition_time_in_ms) { -struct dpcd_source_backlight_set dpcd_backlight_set; -uint8_t backlight_control = isHDR ?1 :0 ; -if (!link || (link->connector_signal !=SIGNAL_TYPE_EDP && link->connector_signal !=SIGNAL_TYPE_DISPLAY_PORT ))return false; -// OLEDs have no PWM, they can only use AUX -if (link->dpcd_sink_ext_caps.bits.oled ==1 ) - backlight_control =1 ; - - *(uint32_t *)&dpcd_backlight_set.backlight_level_millinits = backlight_millinits; - *(uint16_t *)&dpcd_backlight_set.backlight_transition_time_ms = (uint16_t )transition_time_in_ms; - - -if (!link->dpcd_caps.panel_luminance_control) { -if (core_link_write_dpcd (link,DP_SOURCE_BACKLIGHT_LEVEL , - (uint8_t *)(&dpcd_backlight_set), -sizeof (dpcd_backlight_set)) !=DC_OK ) -return false; - -if (core_link_write_dpcd (link,DP_SOURCE_BACKLIGHT_CONTROL , - &backlight_control,1 ) !=DC_OK ) -return false; - }else { +if (link->backlight_control_type ==BACKLIGHT_CONTROL_VESA_AUX ) {uint8_t backlight_enable =0 ;struct target_luminance_value *target_luminance =NULL ;
@@ -205,6 +185,24 @@ bool edp_set_backlight_level_nits(struct dc_link *link, (uint8_t *)(target_luminance), sizeof(struct target_luminance_value)) != DC_OK)return false; + }else { +struct dpcd_source_backlight_set dpcd_backlight_set; + *(uint32_t *)&dpcd_backlight_set.backlight_level_millinits = backlight_millinits; + *(uint16_t *)&dpcd_backlight_set.backlight_transition_time_ms = (uint16_t )transition_time_in_ms; + +uint8_t backlight_control = isHDR ?1 :0 ; +// OLEDs have no PWM, they can only use AUX +if (link->dpcd_sink_ext_caps.bits.oled ==1 ) + backlight_control =1 ; + +if (core_link_write_dpcd (link,DP_SOURCE_BACKLIGHT_LEVEL , + (uint8_t *)(&dpcd_backlight_set), +sizeof (dpcd_backlight_set)) !=DC_OK ) +return false; + +if (core_link_write_dpcd (link,DP_SOURCE_BACKLIGHT_CONTROL , + &backlight_control,1 ) !=DC_OK ) +return false; }return true;
Signature · 1 line
2.34.1
PATCH 7/13 drm/amd/display: Remove always-false branches
In reply to Fangzhi ZuoFrom: Alex Hung <[email protected]>
[WHAT & HOW]
MacroTileSizeBytes is set to either 256 or 65535 and it is never 4096. Its branch is not taken, and should be removed. Similarly, mode_422 is always 0 and thus ppe will always be 1. The ternary operator should be removed.
This fixes 2 DEADCODE issues reported by Coverity.
--- .../drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c | 9 --------- .../drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 3 +-- 2 files changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c +0 -9
@@ -1775,15 +1775,6 @@ static unsigned int CalculateVMAndRowBytes( *PixelPTEReqWidth =32768.0 / BytePerPixel; *PTERequestSize =64 ; FractionOfPTEReturnDrop =0 ; - }else if (MacroTileSizeBytes ==4096 ) { - PixelPTEReqHeightPTEs =1 ; - *PixelPTEReqHeight = MacroTileHeight; - *PixelPTEReqWidth =8 * *MacroTileWidth; - *PTERequestSize =64 ; -if (ScanDirection != dm_vert) - FractionOfPTEReturnDrop =0 ; -else - FractionOfPTEReturnDrop =7.0 /8 ; }else if (GPUVMMinPageSize ==4 && MacroTileSizeBytes >4096 ) { PixelPTEReqHeightPTEs =16 ; *PixelPTEReqHeight =16 * BlockHeight256Bytes;
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c +1 -2
@@ -559,12 +559,11 @@ static void get_surf_rq_param(const struct _vcs_dpi_display_pipe_source_params_st *pipe_src_param, bool is_chroma) { - bool mode_422 = 0; unsigned int vp_width = 0;unsigned int vp_height =0 ;unsigned int data_pitch =0 ;unsigned int meta_pitch =0 ; -unsigned int ppe = mode_422 ?2 :1 ; +unsigned int ppe =1 ;bool surf_linear;bool surf_vert;unsigned int bytes_per_element;
Signature · 1 line
2.34.1
PATCH 8/13 drm/amd/display: Eliminate recursive header inclusion
In reply to Fangzhi ZuoFrom: Alex Hung <[email protected]>
[WHAT & HOW]
This removes recursive inclusion like dc.h -> dc_state.h -> dc.h and dc.h -> dc_plane.h -> dc.h
This fixes 4 PW.INCLUDE_RECURSION issues reported by Coverity.
--- drivers/gpu/drm/amd/display/dc/dc_plane.h | 1 - drivers/gpu/drm/amd/display/dc/dc_state.h | 1 - 2 files changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_plane.h +0 -1
@@ -26,7 +26,6 @@#ifndef _DC_PLANE_H_#define _DC_PLANE_H_ -#include "dc.h" #include "dc_hw_types.h" struct dc_plane_state *dc_create_plane_state (const struct dc *dc);
drivers/gpu/drm/amd/display/dc/dc_state.h +0 -1
@@ -26,7 +26,6 @@#ifndef _DC_STATE_H_#define _DC_STATE_H_ -#include "dc.h" #include "inc/core_status.h" struct dc_state *dc_state_create (struct dc *dc,struct dc_state_create_params *params);
Signature · 1 line
2.34.1
PATCH 9/13 drm/amd/display: Removed unused assignments and variables
In reply to Fangzhi ZuoFrom: Alex Hung <[email protected]>
[WHAT]
A number of values are assigned to variables but the stored values are not used afterwards.
[HOW]
The assignments are removed. If the variables are not used, they are removed as well.
This fixes 9 UNUSED_VALUE issues reported by Coverity.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 -- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 48 ++++--------------- 2 files changed, 8 insertions(+), 43 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -3
@@ -12214,9 +12214,6 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, }else if (edid && sink->sink_signal ==SIGNAL_TYPE_HDMI_TYPE_A ) { i =parse_hdmi_amd_vsdb (amdgpu_dm_connector, edid, &vsdb_info);if (i >=0 && vsdb_info.freesync_supported) { - timing = &edid->detailed_timings[i]; - data = &timing->data.other_data; - amdgpu_dm_connector->min_vfreq = vsdb_info.min_refresh_rate_hz; amdgpu_dm_connector->max_vfreq = vsdb_info.max_refresh_rate_hz;if (amdgpu_dm_connector->max_vfreq - amdgpu_dm_connector->min_vfreq >10 )
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +8 -40
208 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 10/13 drm/amd/display: Add IPS residency capture helpers to dc_dmub_srv
In reply to Fangzhi ZuoFrom: Ovidiu Bunea <[email protected]>
This enables starting and stopping IPS residency measurements and querying the IPS residency information consisting of residency percent, entry counter, total time active & inactive, and histograms for the specified IPS mode.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 78 +++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 39 ++++++++ drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 8 ++ .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 95 +++++++++++++++++++ 4 files changed, 220 insertions(+)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +78 -0
@@ -1862,3 +1862,81 @@ void dc_dmub_srv_fams2_passthrough_flip(dm_execute_dmub_cmd_list (dc->ctx, num_cmds, cmds,DM_DMUB_WAIT_TYPE_WAIT ); } } + +bool dc_dmub_srv_ips_residency_cntl (struct dc_dmub_srv *dc_dmub_srv,bool start_measurement) +{ +bool result; + +if (!dc_dmub_srv || !dc_dmub_srv->dmub) +return false; + + result =dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__IPS_RESIDENCY , + start_measurement,NULL ,DM_DMUB_WAIT_TYPE_WAIT ); + +return result; +} + +void dc_dmub_srv_ips_query_residency_info (struct dc_dmub_srv *dc_dmub_srv,struct ips_residency_info *output) +{ +uint32_t i; +enum dmub_gpint_command command_code; + +if (!dc_dmub_srv || !dc_dmub_srv->dmub) +return ; + +switch (output->ips_mode) { +case DMUB_IPS_MODE_IPS1_MAX : + command_code =DMUB_GPINT__GET_IPS1_HISTOGRAM_COUNTER ; +break ; +case DMUB_IPS_MODE_IPS2 : + command_code =DMUB_GPINT__GET_IPS2_HISTOGRAM_COUNTER ; +break ; +case DMUB_IPS_MODE_IPS1_RCG : + command_code =DMUB_GPINT__GET_IPS1_RCG_HISTOGRAM_COUNTER ; +break ; +case DMUB_IPS_MODE_IPS1_ONO2_ON : + command_code =DMUB_GPINT__GET_IPS1_ONO2_ON_HISTOGRAM_COUNTER ; +break ; +default : + command_code =DMUB_GPINT__INVALID_COMMAND ; +break ; + } + +if (command_code ==DMUB_GPINT__INVALID_COMMAND ) +return ; + +// send gpint commands and wait for ack +if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_RESIDENCY_PERCENT , + (uint16_t )(output->ips_mode), + &output->residency_percent,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) + output->residency_percent =0 ; + +if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_RESIDENCY_ENTRY_COUNTER , + (uint16_t )(output->ips_mode), + &output->entry_counter,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) + output->entry_counter =0 ; + +if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_RESIDENCY_DURATION_US_LO , + (uint16_t )(output->ips_mode), + &output->total_active_time_us[0 ],DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) + output->total_active_time_us[0 ] =0 ; +if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_RESIDENCY_DURATION_US_HI , + (uint16_t )(output->ips_mode), + &output->total_active_time_us[1 ],DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) + output->total_active_time_us[1 ] =0 ; + +if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_INACTIVE_RESIDENCY_DURATION_US_LO , + (uint16_t )(output->ips_mode), + &output->total_inactive_time_us[0 ],DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) + output->total_inactive_time_us[0 ] =0 ; +if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__GET_IPS_INACTIVE_RESIDENCY_DURATION_US_HI , + (uint16_t )(output->ips_mode), + &output->total_inactive_time_us[1 ],DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) + output->total_inactive_time_us[1 ] =0 ; + +// NUM_IPS_HISTOGRAM_BUCKETS = 16 +for (i =0 ; i <16 ; i++) +if (!dc_wake_and_execute_gpint (dc_dmub_srv->ctx, command_code, i, &output->histogram[i], +DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) + output->histogram[i] =0 ; +}
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +39 -0
@@ -209,4 +209,43 @@ void dc_dmub_srv_fams2_passthrough_flip(struct dc_stream_state *stream, struct dc_surface_update *srf_updates, int surface_count); + +/** +* struct ips_residency_info - struct containing info from dmub_ips_residency_stats +* +* @ips_mode: The mode of IPS that the follow stats appertain to +* @residency_percent: The percentage of time spent in given IPS mode in millipercent +* @entry_counter: The number of entries made in to this IPS state +* @total_active_time_us: uint32_t array of length 2 representing time in the given IPS mode +* in microseconds. Index 0 is lower 32 bits, index 1 is upper 32 bits. +* @total_inactive_time_us: uint32_t array of length 2 representing time outside the given IPS mode +* in microseconds. Index 0 is lower 32 bits, index 1 is upper 32 bits. +* @histogram: Histogram of given IPS state durations - bucket definitions in dmub_ips.c +*/ +struct ips_residency_info { +enum dmub_ips_mode ips_mode; +unsigned int residency_percent; +unsigned int entry_counter; +unsigned int total_active_time_us[2 ]; +unsigned int total_inactive_time_us[2 ]; +unsigned int histogram[16 ]; +}; + +/** +* bool dc_dmub_srv_ips_residency_cntl() - Controls IPS residency measurement status +* +* @dc_dmub_srv: The DC DMUB service pointer +* @start_measurement: Describes whether to start or stop measurement +* +* Return: true if GPINT was sent successfully, false otherwise +*/ +bool dc_dmub_srv_ips_residency_cntl (struct dc_dmub_srv *dc_dmub_srv,bool start_measurement); + +/** +* bool dc_dmub_srv_ips_query_residency_info() - Queries DMCUB for residency info +* +* @dc_dmub_srv: The DC DMUB service pointer +* @output: Output struct to copy the the residency info to +*/ +void dc_dmub_srv_ips_query_residency_info (struct dc_dmub_srv *dc_dmub_srv,struct ips_residency_info *output);#endif /* _DMUB_DC_SRV_H_ */
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +8 -0
@@ -570,6 +570,14 @@ struct dmub_notification { }; }; +/* enum dmub_ips_mode - IPS mode identifier */ +enum dmub_ips_mode { +DMUB_IPS_MODE_IPS1_MAX =0 , +DMUB_IPS_MODE_IPS2 , +DMUB_IPS_MODE_IPS1_RCG , +DMUB_IPS_MODE_IPS1_ONO2_ON +}; +/** * DMUB firmware version helper macro - useful for checking if the version * of a firmware to know if feature or functionality is supported or present.
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +95 -0
107 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 11/13 drm/amd/display: Configure DTBCLK_P with OPTC only for dcn401
In reply to Fangzhi ZuoFrom: Dillon Varone <[email protected]>
[WHY]DTBCLK_P is used to generate virtual pixel clock, and to drive the HPO stream encoder clock. Programming the required clock when enabling/disabling both components can cause issues.
For example, if HPO is being disabled and clock source is changed to REFCLK, virtual pixel rate will then be wrong, causing issues in CRTC.
[HOW]
Only program the DTBCLK_P when programming CRTC, as its expected it will be enabled prior to HPO, and disabled after HPO in all valid cases.
--- .../amd/display/dc/dccg/dcn401/dcn401_dccg.c | 3 - .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 135 +++++++++++++++++- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.h | 7 + .../amd/display/dc/hwss/dcn401/dcn401_init.c | 4 +- 4 files changed, 142 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c +0 -3
@@ -580,9 +580,6 @@ static void dccg401_set_dpstreamclk( int otg_inst, int dp_hpo_inst) { -/* set the dtbclk_p source */ -dccg401_set_dtbclk_p_src (dccg ,src ,otg_inst ); -/* enabled to select one of the DTBCLKs for pipe */ if (src ==REFCLK )dccg401_disable_dpstreamclk (dccg, dp_hpo_inst);
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +133 -2
150 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.h +7 -0
@@ -88,4 +88,11 @@ void adjust_hotspot_between_slices_for_2x_magnify(uint32_t cursor_width, structvoid dcn401_wait_for_det_buffer_update_under_otg_master (struct dc *dc,struct dc_state *context,struct pipe_ctx *otg_master);void dcn401_interdependent_update_lock (struct dc *dc,struct dc_state *context,bool lock);void dcn401_program_outstanding_updates (struct dc *dc,struct dc_state *context); +void dcn401_reset_back_end_for_pipe ( +struct dc *dc, +struct pipe_ctx *pipe_ctx, +struct dc_state *context); +void dcn401_reset_hw_ctx_wrap ( +struct dc *dc, +struct dc_state *context);#endif /* __DC_HWSS_DCN401_H__ */
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_init.c +2 -2
@@ -112,7 +112,7 @@ static const struct hwseq_private_funcs dcn401_private_funcs = { .power_down = dce110_power_down, .enable_display_power_gating = dcn10_dummy_display_power_gating, .blank_pixel_data = dcn20_blank_pixel_data, - .reset_hw_ctx_wrap = dcn20_reset_hw_ctx_wrap, + .reset_hw_ctx_wrap = dcn401_reset_hw_ctx_wrap, .enable_stream_timing = dcn401_enable_stream_timing, .edp_backlight_control = dce110_edp_backlight_control, .setup_vupdate_interrupt = dcn20_setup_vupdate_interrupt,
@@ -137,7 +137,7 @@ static const struct hwseq_private_funcs dcn401_private_funcs = { .update_mall_sel = dcn32_update_mall_sel, .calculate_dccg_k1_k2_values = NULL, .apply_single_controller_ctx_to_hw = dce110_apply_single_controller_ctx_to_hw, - .reset_back_end_for_pipe = dcn20_reset_back_end_for_pipe, + .reset_back_end_for_pipe = dcn401_reset_back_end_for_pipe, .populate_mcm_luts = NULL, };
Signature · 1 line
2.34.1
PATCH 12/13 drm/amd/display: [FW Promotion] Release 0.0.236.0
In reply to Fangzhi ZuoFrom: Taimur Hassan <[email protected]>
--- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 62 +++++++++++++++++-- 1 file changed, 57 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +57 -5
@@ -1401,9 +1401,10 @@ enum dmub_out_cmd_type {/* DMUB_CMD__DPIA command sub-types. */ enum dmub_cmd_dpia_type {DMUB_CMD__DPIA_DIG1_DPIA_CONTROL =0 , -DMUB_CMD__DPIA_SET_CONFIG_ACCESS =1 , +DMUB_CMD__DPIA_SET_CONFIG_ACCESS =1 ,// will be replaced by DPIA_SET_CONFIG_REQUEST DMUB_CMD__DPIA_MST_ALLOC_SLOTS =2 ,DMUB_CMD__DPIA_SET_TPS_NOTIFICATION =3 , +DMUB_CMD__DPIA_SET_CONFIG_REQUEST =4 , };/* DMUB_OUT_CMD__DPIA_NOTIFICATION command types. */
@@ -2192,7 +2193,7 @@ struct dmub_rb_cmd_dig1_dpia_control { };/** -* SET_CONFIG Command Payload +* SET_CONFIG Command Payload (deprecated) */ struct set_config_cmd_payload {uint8_t msg_type;/* set config message type */
@@ -2200,7 +2201,7 @@ struct set_config_cmd_payload { };/** -* Data passed from driver to FW in a DMUB_CMD__DPIA_SET_CONFIG_ACCESS command. +* Data passed from driver to FW in a DMUB_CMD__DPIA_SET_CONFIG_ACCESS command. (deprecated) */ struct dmub_cmd_set_config_control_data {struct set_config_cmd_payload cmd_pkt;
@@ -2208,6 +2209,17 @@ struct dmub_cmd_set_config_control_data {uint8_t immed_status;/* Immediate status returned in case of error */ }; +/** +* SET_CONFIG Request Command Payload +*/ +struct set_config_request_cmd_payload { +uint8_t instance;/* DPIA instance */ +uint8_t immed_status;/* Immediate status returned in case of error */ +uint8_t msg_type;/* set config message type */ +uint8_t reserved; +uint32_t msg_data;/* set config message data */ +}; +/** * DMUB command structure for SET_CONFIG command. */
@@ -2216,6 +2228,14 @@ struct dmub_rb_cmd_set_config_access {struct dmub_cmd_set_config_control_data set_config_control;/* set config data */ }; +/** +* DMUB command structure for SET_CONFIG request command. +*/ +struct dmub_rb_cmd_set_config_request { +struct dmub_cmd_header header;/* header */ +struct set_config_request_cmd_payload payload;/* set config request payload */ +}; +/** * Data passed from driver to FW in a DMUB_CMD__DPIA_MST_ALLOC_SLOTS command. */
@@ -4410,10 +4430,38 @@ struct dmub_cmd_abm_set_backlight_data {*/ uint8_t panel_mask; +/** +* Backlight control type. +* Value 0 is PWM backlight control. +* Value 1 is VAUX backlight control. +* Value 2 is AMD DPCD AUX backlight control. +*/ +uint8_t backlight_control_type; +/** * Explicit padding to 4 byte boundary. */ -uint8_t pad[2 ]; +uint8_t pad[1 ]; + +/** +* Minimum luminance in nits. +*/ +uint32_t min_luminance; + +/** +* Maximum luminance in nits. +*/ +uint32_t max_luminance; + +/** +* Minimum backlight in pwm. +*/ +uint32_t min_backlight_pwm; + +/** +* Maximum backlight in pwm. +*/ +uint32_t max_backlight_pwm; };/**
@@ -5413,7 +5461,11 @@ union dmub_rb_cmd {/** * Definition of a DMUB_CMD__DPIA_SET_CONFIG_ACCESS command. */ -struct dmub_rb_cmd_set_config_access set_config_access; +struct dmub_rb_cmd_set_config_access set_config_access;// (deprecated) +/** +* Definition of a DMUB_CMD__DPIA_SET_CONFIG_ACCESS command. +*/ +struct dmub_rb_cmd_set_config_request set_config_request;/** * Definition of a DMUB_CMD__DPIA_MST_ALLOC_SLOTS command. */
Signature · 1 line
2.34.1
PATCH 13/13 drm/amd/display: 3.2.303
In reply to Fangzhi ZuoFrom: Aric Cyr <[email protected]>
DC 3.2.303 contains some improvements as summarized below:
* Improve brightness control
* Add support for UHBR10 eDP
* OPTC required only for DTBCLK_P for dcn401
* Fix TBT monitor resume issue
* Code cleanup
--- 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
@@ -55,7 +55,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.302" +#define DC_VER "3.2.303"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.34.1
[Public]
Hi all,
This week this patchset was tested on 4 systems, two dGPU and two APU based, and tested across multiple display and connection types.
APU
* Single Display eDP -> 1080p 60hz, 2560x1600 120hz, 1920x1200 165hz
* Single Display DP -> 4k144hz, 4k240hz
* Multi display -> eDP + DP/HDMI/USB-C -> 1080p 60hz eDP + 4k 144hz, 4k 240hz (Includes USB-C to DP/HDMI adapters)
* Thunderbolt -> LG Ultrafine 5k
* DSC -> Cable Matters 101075 (DP to 3x DP) with 3x 4k60hz displays, HP Hook G2 with 2x 4k60hz displays
* USB 4 -> HP Hook G4, Lenovo Thunderbolt Dock, both with 1x 4k60hz DP and 1x 4k60hz HDMI displays
* PCON -> Club3D CAC-1085 + 1x 4k 144hz
DGPU
* Single Display DP -> 4k144hz, 4k240hz
* Multiple Display DP -> 4k240hz + 4k144hz
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60hz displays)
* DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60hz displays)
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to)
* Changing display configurations and settings
* Video/Audio playback
* Benchmark testing
* Suspend/Resume testing
* Feature testing (Freesync, HDCP, etc.)
Automated testing includes (but is not limited to)
* Script testing (scripts to automate some of the manual checks)
* IGT testing
The testing is mainly tested on the following displays, but occasionally there are tests with other displays
* Samsung G8 Neo 4k240hz
* Samsung QN55QN95B 4k 120hz
* Acer XV322QKKV 4k144hz
* HP U27 4k Wireless 4k60hz
* LG 27UD58B 4k60hz
* LG 32UN650WA 4k60hz
* LG Ultrafine 5k 5k60hz
* AU Optronics B140HAN01.1 1080p 60hz eDP
* AU Optronics B160UAN01.J 1920x1200 165hz eDP
* AU Optronics B160QAN02.L 2560x1600 120hz eDP
The patchset consists of the amd-staging-drm-next branch (Head commit - 3a15ba63cd49d7957196a0759a81a7c289c5fafb -> drm/amd/display: 3.2.302) with new patches added on top of it.
Tested on Ubuntu 24.04.1, on Wayland and X11, using KDE Plasma and Gnome.
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook | Twitter | amd.com
-----Original Message-----
From: Fangzhi Zuo <[email protected]>
Sent: Friday, September 27, 2024 1:01 PM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Mahfooz, Hamza <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Chiu, Solomon <[email protected]>; Wheeler, Daniel <[email protected]>; Zuo, Jerry <[email protected]>
Subject: [PATCH 00/13] DC Patches Sept 23, 2024
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* Improve brightness control
* Add support for UHBR10 eDP
* OPTC required only for DTBCLK_P for dcn401
* Fix TBT monitor resume issue
* Code cleanup
Alex Hung (3):
drm/amd/display: Remove always-false branches drm/amd/display: Eliminate recursive header inclusion drm/amd/display: Removed unused assignments and variables
Aric Cyr (1):
drm/amd/display: 3.2.303
Dillon Varone (1):
drm/amd/display: Configure DTBCLK_P with OPTC only for dcn401
Liu Xi (Alex) (1):
drm/amd/display: add more support for UHBR10 eDP
Muyuan Yang (2):
drm/amd/display: Change Brightness Control Priority drm/amd/display: Introduce New ABC Framework for Brightness Control
Ovidiu Bunea (1):
drm/amd/display: Add IPS residency capture helpers to dc_dmub_srv
Paul Hsieh (1):
drm/amd/display: Add logs to record register read/write
Ryan Seto (1):
drm/amd/display: Adjust PHY FSM transition to TX_EN-to-PLL_ON for TMDS
Taimur Hassan (1):
drm/amd/display: [FW Promotion] Release 0.0.236.0
Tom Chung (1):
drm/amd/display: Fix system hang while resume with TBT monitor
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 48 +---- drivers/gpu/drm/amd/display/dc/dc.h | 4 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 78 ++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 39 ++++ drivers/gpu/drm/amd/display/dc/dc_plane.h | 1 - drivers/gpu/drm/amd/display/dc/dc_state.h | 1 - drivers/gpu/drm/amd/display/dc/dc_types.h | 6 + .../amd/display/dc/dccg/dcn401/dcn401_dccg.c | 84 -------- .../dc/dml/dcn30/display_mode_vba_30.c | 9 - .../display/dc/dml/dml1_display_rq_dlg_calc.c | 3 +- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 187 +++++++++++++++++- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.h | 11 ++ .../amd/display/dc/hwss/dcn401/dcn401_init.c | 6 +- .../link/protocols/link_edp_panel_control.c | 43 ++-- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 8 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 157 ++++++++++++++- .../drm/amd/display/include/logger_types.h | 4 +- 18 files changed, 521 insertions(+), 177 deletions(-)
--
2.34.1