DC Patches April 5, 2021
cover DC Patches April 5, 2021
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* Firmware release 0.0.59
* Fixes on display experiences for 4k TVs, register mask missing, etc.
* Enhancements on MST, code cleaning and debug messages.
---
Anson Jacob (1):
drm/amd/display: Fix 32 bit compilation of dmub_srv.c
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.59
Aric Cyr (1):
drm/amd/display: 3.2.130
Aurabindo Pillai (1):
drm/amd/display: Add debugfs entry for LTTPR register status
David (Dingchen) Zhang (1):
drm/amd/display: use MST downstream AUX to dump DPRX CRCs
Harry VanZyllDeJong (1):
drm/amd/display: Fixed corruption on 4K tvs
Harry Wentland (2):
drm/amd/display: Add debug prints for SMU messages drm/amd/display: Add dc_debug flag to disable min fclk
Jake Wang (1):
drm/amd/display: Added dc_edp_id_count to dc_context
Leo Li (1):
drm/amd/display: Move vupdate keepout programming from DCN20 to DCN10
Mikita Lipski (4):
drm/amd/display: Set initial value to a divider drm/amd/display: Directly retrain link from debugfs drm/amd/display: Add MST capability to trigger_hotplug interface drm/amd/display: Determine synchronization edge based on master's
vsync
Nicholas Kazlauskas (1):
drm/amd/display: Cleanup DML DSC input bpc validation
Qingqing Zhuo (1):
drm/amd/display: Add missing mask for DCN3
Robin Singh (1):
drm/amd/display: add NULL check to avoid kernel crash in DC.
Victor Lu (1):
drm/amd/display: Add function and debugfs to dump DCC_EN bit
Wayne Lin (1):
drm/amd/display: Tweak the kernel doc for crc_rd_wrk
Wyatt Wood (2):
drm/amd/display: Retry getting PSR state if command times out drm/amd/display: Add delay in dmub_srv_send_gpint_command
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 21 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 2 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 207 +++++++++++++++++- .../display/dc/clk_mgr/dcn301/dcn301_smu.c | 29 ++- .../display/dc/clk_mgr/dcn301/vg_clk_mgr.c | 4 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 + drivers/gpu/drm/amd/display/dc/core/dc_link.c | 14 +- drivers/gpu/drm/amd/display/dc/dc.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_types.h | 4 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 29 ++- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 16 ++ .../amd/display/dc/dcn10/dcn10_hw_sequencer.h | 4 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 3 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 16 ++ .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 3 + .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 1 + .../gpu/drm/amd/display/dc/dcn20/dcn20_optc.c | 16 -- .../gpu/drm/amd/display/dc/dcn20/dcn20_optc.h | 3 - .../drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 3 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_hubp.h | 1 + .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c | 3 +- .../drm/amd/display/dc/dcn301/dcn301_init.c | 3 +- .../amd/display/dc/dcn301/dcn301_resource.c | 2 +- .../drm/amd/display/dc/dml/display_mode_lib.c | 2 +- .../amd/display/dc/dml/display_mode_structs.h | 4 +- .../drm/amd/display/dc/dml/display_mode_vba.c | 8 +- .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 2 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 17 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 4 +- .../amd/display/modules/freesync/freesync.c | 4 +- 32 files changed, 364 insertions(+), 71 deletions(-)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/21 drm/amd/display: Fix 32 bit compilation of dmub_srv.c
From: Anson Jacob <[email protected]>
[Why/How]
Fix cast from pointer to integer of different size error from dmub/src/dmub_srv.c
--- drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +1 -1
@@ -510,7 +510,7 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,dmub_memset (&outbox0_rb_params,0 ,sizeof (outbox0_rb_params)); outbox0_rb_params.ctx = dmub; - outbox0_rb_params.base_address = (void *)((uint64_t )(tracebuff_fb->cpu_addr) +TRACE_BUFFER_ENTRY_OFFSET ); + outbox0_rb_params.base_address = (void *)((uintptr_t )(tracebuff_fb->cpu_addr) +TRACE_BUFFER_ENTRY_OFFSET ); outbox0_rb_params.capacity = tracebuff_fb->size -dmub_align (TRACE_BUFFER_ENTRY_OFFSET ,64 );dmub_rb_init (&dmub->outbox0_rb, &outbox0_rb_params);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/21 drm/amd/display: Retry getting PSR state if command times out
In reply to Qingqing ZhuoFrom: Wyatt Wood <[email protected]>
[Why]
GPINT command to get PSR state from FW times out.
[How]
Add retry to get valid PSR state.
--- drivers/gpu/drm/amd/display/dc/dc_types.h | 3 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 29 ++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_types.h +2 -1
@@ -687,7 +687,8 @@ enum dc_psr_state {PSR_STATE5 , PSR_STATE5a, PSR_STATE5b, - PSR_STATE5c + PSR_STATE5c, +PSR_STATE_INVALID =0xFF }; struct psr_config {
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +18 -11
@@ -80,19 +80,26 @@ static enum dc_psr_state convert_psr_state(uint32_t raw_state)static void dmub_psr_get_state (struct dmub_psr *dmub,enum dc_psr_state *state) {struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub; -uint32_t raw_state; +uint32_t raw_state =0 ; +uint32_t retry_count =0 ;enum dmub_status status; -// Send gpint command and wait for ack - status =dmub_srv_send_gpint_command (srv,DMUB_GPINT__GET_PSR_STATE ,0 ,30 ); - -if (status ==DMUB_STATUS_OK ) { -// GPINT was executed, get response -dmub_srv_get_gpint_response (srv, &raw_state); - *state =convert_psr_state (raw_state); - }else -// Return invalid state when GPINT times out - *state =0xFF ; +do { +// Send gpint command and wait for ack + status =dmub_srv_send_gpint_command (srv,DMUB_GPINT__GET_PSR_STATE ,0 ,30 ); + +if (status ==DMUB_STATUS_OK ) { +// GPINT was executed, get response +dmub_srv_get_gpint_response (srv, &raw_state); + *state =convert_psr_state (raw_state); + }else +// Return invalid state when GPINT times out + *state =PSR_STATE_INVALID ; + +// Assert if max retry hit +if (retry_count >=1000 ) +ASSERT (0 ); + }while (++retry_count <=1000 && *state ==PSR_STATE_INVALID ); }/*
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/21 drm/amd/display: Add delay in dmub_srv_send_gpint_command
In reply to Qingqing ZhuoFrom: Wyatt Wood <[email protected]>
[Why]
Today a parameter is passed to dmub_srv_send_gpint_command which specifies the max amount of time to wait for the command to be acked.
This parameter instead specifies the number of times to check if the command was acked.
We wish to add a lower bound to the timeout, which can be accomplished by using a delay or a timestamp.
It has been decided to use udelay instead of a timestamp simply because we don't want to expose a high precision counter if it doesn't yield large benefits.
[How]
Add udelay(1) between each for loop iteration.
--- drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +2 -0
@@ -647,6 +647,8 @@ dmub_srv_send_gpint_command(struct dmub_srv *dmub, dmub->hw_funcs.set_gpint (dmub, reg);for (i =0 ; i < timeout_us; ++i) { +udelay (1 ); +if (dmub->hw_funcs.is_gpint_acked (dmub, reg))return DMUB_STATUS_OK ; }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/21 drm/amd/display: use MST downstream AUX to dump DPRX CRCs
In reply to Qingqing ZhuoFrom: "David (Dingchen) Zhang" <[email protected]>
[why]
In MST setup, we'd use MST downstream AUX to
dump the DPRX CRCs from sink device.
[how]
Assign the mst_port->aux to read DPCD registers.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +1 -1
@@ -307,7 +307,7 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name) goto cleanup; } - aux = &aconn->dm_dp_aux.aux; + aux = (aconn->port) ? &aconn->port->aux : &aconn->dm_dp_aux.aux;if (!aux) {DRM_DEBUG_DRIVER ("No dp aux for amd connector\n" );
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/21 drm/amd/display: add NULL check to avoid kernel crash in DC.
In reply to Qingqing ZhuoFrom: Robin Singh <[email protected]>
[why]
There is case when the userspace like IGT test updates the custom timings, i.e. the number of active lines CRTC property value, and without committing the change, followed by resetting the display, creating FB and plane to the pipe and committing. The NULL pointer of pipe_ctx->plane_state occurs and result in kernel crash. We need to avoid that.
[how]
add pointer check for the dc_plane_state of the pipe context in the call of committing planes for stream in DC component.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -0
@@ -2815,6 +2815,9 @@ static void commit_planes_for_stream(struct dc *dc,for (j =0 ; j < dc->res_pool->pipe_count; j++) {struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j]; +if (!pipe_ctx->plane_state) +continue ; +if (pipe_ctx->bottom_pipe || pipe_ctx->next_odm_pipe || !pipe_ctx->stream || pipe_ctx->stream != stream || !pipe_ctx->plane_state->update_flags.bits.addr_update)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/21 drm/amd/display: Move vupdate keepout programming from DCN20 to DCN10
In reply to Qingqing ZhuoFrom: Leo Li <[email protected]>
[Why]
The OTG_VUPDATE_KEEPOUT register and fields is available on DCN10, and named the same in DCN20.
[How]
Move register definition and programming function to dcn10 optc.
There is no functional change.
--- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 16 ++++++++++++++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 3 +++ .../gpu/drm/amd/display/dc/dcn20/dcn20_optc.c | 16 ---------------- .../gpu/drm/amd/display/dc/dcn20/dcn20_optc.h | 3 --- 4 files changed, 19 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +16 -0
@@ -131,6 +131,22 @@ void optc1_setup_vertical_interrupt2( OTG_VERTICAL_INTERRUPT2_LINE_START, start_line); } +/** +* Vupdate keepout can be set to a window to block the update lock for that pipe from changing. +* Start offset begins with vstartup and goes for x number of clocks, +* end offset starts from end of vupdate to x number of clocks. +*/ +void optc1_set_vupdate_keepout (struct timing_generator *optc, +struct vupdate_keepout_params *params) +{ +struct optc *optc1 =DCN10TG_FROM_TG (optc); + +REG_SET_3 (OTG_VUPDATE_KEEPOUT ,0 , +MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_START_OFFSET , params->start_offset, +MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_END_OFFSET , params->end_offset, +OTG_MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_EN , params->enable); +} +/** * program_timing_generator used by mode timing set * Program CRTC Timing Registers - OTG_H_*, OTG_V_*, Pixel repetition.
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +3 -0
@@ -194,6 +194,9 @@ struct dcn_optc_registers {SF (OTG0_OTG_DOUBLE_BUFFER_CONTROL ,OTG_UPDATE_PENDING , mask_sh),\SF (OTG0_OTG_DOUBLE_BUFFER_CONTROL ,OTG_BLANK_DATA_DOUBLE_BUFFER_EN , mask_sh),\SF (OTG0_OTG_DOUBLE_BUFFER_CONTROL ,OTG_RANGE_TIMING_DBUF_UPDATE_MODE , mask_sh),\ +SF (OTG0_OTG_VUPDATE_KEEPOUT ,OTG_MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_EN , mask_sh), \ +SF (OTG0_OTG_VUPDATE_KEEPOUT ,MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_START_OFFSET , mask_sh), \ +SF (OTG0_OTG_VUPDATE_KEEPOUT ,MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_END_OFFSET , mask_sh), \SF (OTG0_OTG_H_TOTAL ,OTG_H_TOTAL , mask_sh),\SF (OTG0_OTG_H_BLANK_START_END ,OTG_H_BLANK_START , mask_sh),\ SF(OTG0_OTG_H_BLANK_START_END, OTG_H_BLANK_END, mask_sh),\
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c +0 -16
@@ -134,22 +134,6 @@ void optc2_set_gsl_window(struct timing_generator *optc, OTG_GSL_WINDOW_END_Y, params->gsl_window_end_y); } -/** -* Vupdate keepout can be set to a window to block the update lock for that pipe from changing. -* Start offset begins with vstartup and goes for x number of clocks, -* end offset starts from end of vupdate to x number of clocks. -*/ -void optc2_set_vupdate_keepout (struct timing_generator *optc, -const struct vupdate_keepout_params *params) -{ -struct optc *optc1 =DCN10TG_FROM_TG (optc); - -REG_SET_3 (OTG_VUPDATE_KEEPOUT ,0 , -MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_START_OFFSET , params->start_offset, -MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_END_OFFSET , params->end_offset, -OTG_MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_EN , params->enable); -} - void optc2_set_gsl_source_select( struct timing_generator *optc, int group_idx,
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.h +0 -3
@@ -56,9 +56,6 @@SF (OTG0_OTG_GSL_WINDOW_X ,OTG_GSL_WINDOW_END_X , mask_sh), \SF (OTG0_OTG_GSL_WINDOW_Y ,OTG_GSL_WINDOW_START_Y , mask_sh),\SF (OTG0_OTG_GSL_WINDOW_Y ,OTG_GSL_WINDOW_END_Y , mask_sh),\ -SF (OTG0_OTG_VUPDATE_KEEPOUT ,OTG_MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_EN , mask_sh), \ -SF (OTG0_OTG_VUPDATE_KEEPOUT ,MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_START_OFFSET , mask_sh), \ -SF (OTG0_OTG_VUPDATE_KEEPOUT ,MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_END_OFFSET , mask_sh), \SF (OTG0_OTG_GSL_CONTROL ,OTG_GSL_MASTER_MODE , mask_sh), \SF (OTG0_OTG_GSL_CONTROL ,OTG_MASTER_UPDATE_LOCK_GSL_EN , mask_sh), \ SF(OTG0_OTG_DSC_START_POSITION, OTG_DSC_START_POSITION_X, mask_sh), \
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/21 drm/amd/display: Add debugfs entry for LTTPR register status
In reply to Qingqing ZhuoFrom: Aurabindo Pillai <[email protected]>
[Why]
Functionality of LTTPR is reporter through the DPCD register
[How]
Expose a interface in debugfs to read the current status of LTTPR as reported from the device's DPCD register
--- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +66 -0
@@ -400,6 +400,70 @@ static ssize_t dp_phy_settings_read(struct file *f, char __user *buf,return result; } +static int dp_lttpr_status_show (struct seq_file *m,void *d) +{ +char *data; +struct amdgpu_dm_connector *connector =file_inode (m->file)->i_private; +struct dc_link *link = connector->dc_link; +uint32_t read_size =1 ; +uint8_t repeater_count =0 ; + + data =kzalloc (read_size,GFP_KERNEL ); +if (!data) +return 0 ; + +dm_helpers_dp_read_dpcd (link->ctx, link,0xF0002 , data, read_size); + +switch ((uint8_t )*data) { +case 0x80 : + repeater_count =1 ; +break ; +case 0x40 : + repeater_count =2 ; +break ; +case 0x20 : + repeater_count =3 ; +break ; +case 0x10 : + repeater_count =4 ; +break ; +case 0x8 : + repeater_count =5 ; +break ; +case 0x4 : + repeater_count =6 ; +break ; +case 0x2 : + repeater_count =7 ; +break ; +case 0x1 : + repeater_count =8 ; +break ; +case 0x0 : + repeater_count =0 ; +break ; +default : + repeater_count = (uint8_t )*data; +break ; + } + +seq_printf (m,"phy repeater count: %d\n" , repeater_count); + +dm_helpers_dp_read_dpcd (link->ctx, link,0xF0003 , data, read_size); + +if ((uint8_t )*data ==0x55 ) +seq_printf (m,"phy repeater mode: transparent\n" ); +else if ((uint8_t )*data ==0xAA ) +seq_printf (m,"phy repeater mode: non-transparent\n" ); +else if ((uint8_t )*data ==0x00 ) +seq_printf (m,"phy repeater mode: non lttpr\n" ); +else +seq_printf (m,"phy repeater mode: read error\n" ); + +kfree (data); +return 0 ; +} +static ssize_t dp_phy_settings_write (struct file *f,const char __user *buf,size_t size,loff_t *pos) {
@@ -2301,6 +2365,7 @@ DEFINE_SHOW_ATTRIBUTE(dp_dsc_fec_support);DEFINE_SHOW_ATTRIBUTE (dmub_fw_state);DEFINE_SHOW_ATTRIBUTE (dmub_tracebuffer);DEFINE_SHOW_ATTRIBUTE (output_bpc); +DEFINE_SHOW_ATTRIBUTE (dp_lttpr_status);#ifdef CONFIG_DRM_AMD_DC_HDCP DEFINE_SHOW_ATTRIBUTE (hdcp_sink_capability);#endif
@@ -2421,6 +2486,7 @@ static const struct { } dp_debugfs_entries[] = { {"link_settings", &dp_link_settings_debugfs_fops}, {"phy_settings", &dp_phy_settings_debugfs_fop}, + {"lttpr_status", &dp_lttpr_status_fops}, {"test_pattern", &dp_phy_test_pattern_fops}, #ifdef CONFIG_DRM_AMD_DC_HDCP {"hdcp_sink_capability", &hdcp_sink_capability_fops},
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/21 drm/amd/display: Added dc_edp_id_count to dc_context
In reply to Qingqing ZhuoFrom: Jake Wang <[email protected]>
[Why]
We need to keep track of the number of eDP links to properly enumerate edp panel control instance.
[How]
Added dc_edp_id_count to dc_context to keep track of number of eDP links.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 10 +++------- drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +3 -7
@@ -1386,8 +1386,6 @@ static bool dc_link_construct(struct dc_link *link,struct dc_bios *bios = init_params->dc->ctx->dc_bios;const struct dc_vbios_funcs *bp_funcs = bios->funcs;struct bp_disp_connector_caps_info disp_connect_caps_info = {0 }; -struct dc_link *edp_links[MAX_NUM_EDP ]; -int edp_num;DC_LOGGER_INIT (dc_ctx->logger);
@@ -1513,14 +1511,12 @@ static bool dc_link_construct(struct dc_link *link, (link->link_id.id == CONNECTOR_ID_EDP || link->link_id.id == CONNECTOR_ID_LVDS)) { panel_cntl_init_data.ctx = dc_ctx; -get_edp_links (panel_cntl_init_data.ctx->dc, edp_links, &edp_num); -if ((edp_num >1 ) && (link->link_index > edp_links[0 ]->link_index)) - panel_cntl_init_data.inst =1 ; -else - panel_cntl_init_data.inst =0 ; + panel_cntl_init_data.inst = + panel_cntl_init_data.ctx->dc_edp_id_count; link->panel_cntl = link->dc->res_pool->funcs->panel_cntl_create ( &panel_cntl_init_data); + panel_cntl_init_data.ctx->dc_edp_id_count++;if (link->panel_cntl ==NULL ) {DC_ERROR ("Failed to create link panel_cntl!\n" );
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -0
@@ -113,6 +113,7 @@ struct dc_context {struct gpio_service *gpio_service;uint32_t dc_sink_id_count;uint32_t dc_stream_id_count; +uint32_t dc_edp_id_count;uint64_t fbc_gpu_addr;struct dc_dmub_srv *dmub_srv;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/21 drm/amd/display: Add debug prints for SMU messages
In reply to Qingqing ZhuoFrom: Harry Wentland <[email protected]>
[Why&How]
Add debug prints for SMU messages with regard to versions, clocks, and more.
--- .../display/dc/clk_mgr/dcn301/dcn301_smu.c | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/dcn301_smu.c +25 -4
@@ -113,10 +113,13 @@ int dcn301_smu_send_msg_with_param(int dcn301_smu_get_smu_version (struct clk_mgr_internal *clk_mgr) { -return dcn301_smu_send_msg_with_param ( - clk_mgr, - VBIOSSMC_MSG_GetSmuVersion, -0 ); +int smu_version =dcn301_smu_send_msg_with_param (clk_mgr, + VBIOSSMC_MSG_GetSmuVersion, +0 ); + +DC_LOG_DEBUG ("%s %x\n" , __func__, smu_version); + +return smu_version; }
@@ -124,6 +127,8 @@ int dcn301_smu_set_dispclk(struct clk_mgr_internal *clk_mgr, int requested_dispc {int actual_dispclk_set_mhz =-1 ; +DC_LOG_DEBUG ("%s(%d)\n" , __func__, requested_dispclk_khz); +/* Unit of SMU msg parameter is Mhz */ actual_dispclk_set_mhz = dcn301_smu_send_msg_with_param( clk_mgr,
@@ -137,6 +142,8 @@ int dcn301_smu_set_dprefclk(struct clk_mgr_internal *clk_mgr) {int actual_dprefclk_set_mhz =-1 ; +DC_LOG_DEBUG ("%s %d\n" , __func__, clk_mgr->base.dprefclk_khz /1000 ); + actual_dprefclk_set_mhz = dcn301_smu_send_msg_with_param( clk_mgr, VBIOSSMC_MSG_SetDprefclkFreq,
@@ -151,6 +158,8 @@ int dcn301_smu_set_hard_min_dcfclk(struct clk_mgr_internal *clk_mgr, int request {int actual_dcfclk_set_mhz =-1 ; +DC_LOG_DEBUG ("%s(%d)\n" , __func__, requested_dcfclk_khz); + actual_dcfclk_set_mhz = dcn301_smu_send_msg_with_param( clk_mgr, VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
@@ -163,6 +172,8 @@ int dcn301_smu_set_min_deep_sleep_dcfclk(struct clk_mgr_internal *clk_mgr, int r {int actual_min_ds_dcfclk_mhz =-1 ; +DC_LOG_DEBUG ("%s(%d)\n" , __func__, requested_min_ds_dcfclk_khz); + actual_min_ds_dcfclk_mhz = dcn301_smu_send_msg_with_param( clk_mgr, VBIOSSMC_MSG_SetMinDeepSleepDcfclk,
@@ -175,6 +186,8 @@ int dcn301_smu_set_dppclk(struct clk_mgr_internal *clk_mgr, int requested_dpp_kh {int actual_dppclk_set_mhz =-1 ; +DC_LOG_DEBUG ("%s(%d)\n" , __func__, requested_dpp_khz); + actual_dppclk_set_mhz = dcn301_smu_send_msg_with_param( clk_mgr, VBIOSSMC_MSG_SetDppclkFreq,
@@ -187,6 +200,8 @@ void dcn301_smu_set_display_idle_optimization(struct clk_mgr_internal *clk_mgr, {//TODO: Work with smu team to define optimization options. +DC_LOG_DEBUG ("%s(%x)\n" , __func__, idle_info); + dcn301_smu_send_msg_with_param( clk_mgr, VBIOSSMC_MSG_SetDisplayIdleOptimizations,
@@ -202,6 +217,8 @@ void dcn301_smu_enable_phy_refclk_pwrdwn(struct clk_mgr_internal *clk_mgr, bool idle_info.idle_info.phy_ref_clk_off =1 ; } +DC_LOG_DEBUG ("%s(%d)\n" , __func__, enable); + dcn301_smu_send_msg_with_param( clk_mgr, VBIOSSMC_MSG_SetDisplayIdleOptimizations,
@@ -218,12 +235,16 @@ void dcn301_smu_enable_pme_wa(struct clk_mgr_internal *clk_mgr)void dcn301_smu_set_dram_addr_high (struct clk_mgr_internal *clk_mgr,uint32_t addr_high) { +DC_LOG_DEBUG ("%s(%x)\n" , __func__, addr_high); +dcn301_smu_send_msg_with_param (clk_mgr, VBIOSSMC_MSG_SetVbiosDramAddrHigh, addr_high); }void dcn301_smu_set_dram_addr_low (struct clk_mgr_internal *clk_mgr,uint32_t addr_low) { +DC_LOG_DEBUG ("%s(%x)\n" , __func__, addr_low); +dcn301_smu_send_msg_with_param (clk_mgr, VBIOSSMC_MSG_SetVbiosDramAddrLow, addr_low); }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/21 drm/amd/display: Add dc_debug flag to disable min fclk
In reply to Qingqing ZhuoFrom: Harry Wentland <[email protected]>
[Why&How]
Add debug flag for an option to disable min fclk.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c +2 -2
@@ -136,13 +136,13 @@ void vg_update_clocks(struct clk_mgr *clk_mgr_base, } } -if (should_set_clock (safe_to_lower, new_clocks->dcfclk_khz, clk_mgr_base->clks.dcfclk_khz)) { +if (should_set_clock (safe_to_lower, new_clocks->dcfclk_khz, clk_mgr_base->clks.dcfclk_khz) && !dc->debug.disable_min_fclk) { clk_mgr_base->clks.dcfclk_khz = new_clocks->dcfclk_khz;dcn301_smu_set_hard_min_dcfclk (clk_mgr, clk_mgr_base->clks.dcfclk_khz); }if (should_set_clock (safe_to_lower, - new_clocks->dcfclk_deep_sleep_khz, clk_mgr_base->clks.dcfclk_deep_sleep_khz)) { + new_clocks->dcfclk_deep_sleep_khz, clk_mgr_base->clks.dcfclk_deep_sleep_khz) && !dc->debug.disable_min_fclk) { clk_mgr_base->clks.dcfclk_deep_sleep_khz = new_clocks->dcfclk_deep_sleep_khz;dcn301_smu_set_min_deep_sleep_dcfclk (clk_mgr, clk_mgr_base->clks.dcfclk_deep_sleep_khz); }
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -460,6 +460,7 @@ struct dc_debug_options {enum pipe_split_policy pipe_split_policy;bool force_single_disp_pipe_split;bool voltage_align_fclk; +bool disable_min_fclk;bool disable_dfs_bypass;bool disable_dpp_power_gate;
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +1 -1
@@ -1,5 +1,5 @@/* -* Copyright 2020 Advanced Micro Devices, Inc. +* Copyright 2019-2021 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"),
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/21 drm/amd/display: Add function and debugfs to dump DCC_EN bit
In reply to Qingqing ZhuoFrom: Victor Lu <[email protected]>
[why]
Currently to view the DCC_EN bit the entire DTN log must be dumped. A compact method to view the DCC_EN bit is desirable.
[how]
Introduce new debugfs interface that only dumps the DCC_EN bit.
Example usage:
cat /sys/kernel/debug/dri/0/amdgpu_dm_dcc_en
--- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 66 +++++++++++++++++++ .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 16 +++++ .../amd/display/dc/dcn10/dcn10_hw_sequencer.h | 4 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 3 +- .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 1 + .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 3 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c | 3 +- .../drm/amd/display/dc/dcn301/dcn301_init.c | 3 +- .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 2 + 9 files changed, 96 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +66 -0
@@ -3043,6 +3043,64 @@ DEFINE_SHOW_ATTRIBUTE(mst_topo);DEFINE_DEBUGFS_ATTRIBUTE (visual_confirm_fops, visual_confirm_get, visual_confirm_set,"%llu\n" ); +/* +* Dumps the DCC_EN bit for each pipe. +* Example usage: cat /sys/kernel/debug/dri/0/amdgpu_dm_dcc_en +*/ +static ssize_t dcc_en_bits_read ( +struct file *f, +char __user *buf, +size_t size, +loff_t *pos) +{ +struct amdgpu_device *adev =file_inode (f)->i_private; +struct dc *dc = adev->dm.dc; +char *rd_buf =NULL ; +const uint32_t rd_buf_size =32 ; +uint32_t result =0 ; +int offset =0 ; +int num_pipes = dc->res_pool->pipe_count; +int *dcc_en_bits; +int i, r; + + dcc_en_bits =kcalloc (num_pipes,sizeof (int ),GFP_KERNEL ); +if (!dcc_en_bits) +return -ENOMEM ; + +if (!dc->hwss.get_dcc_en_bits) { +kfree (dcc_en_bits); +return 0 ; + } + + dc->hwss.get_dcc_en_bits (dc, dcc_en_bits); + + rd_buf =kcalloc (rd_buf_size,sizeof (char ),GFP_KERNEL ); +if (!rd_buf) +return -ENOMEM ; + +for (i =0 ; i < num_pipes; i++) + offset +=snprintf (rd_buf + offset, rd_buf_size - offset, +"%d " , dcc_en_bits[i]); + rd_buf[strlen (rd_buf)] ='\n' ; + +kfree (dcc_en_bits); + +while (size) { +if (*pos >= rd_buf_size) +break ; + r =put_user (*(rd_buf + result), buf); +if (r) +return r;/* r = -EFAULT */ + buf +=1 ; + size -=1 ; + *pos +=1 ; + result +=1 ; + } + +kfree (rd_buf); +return result; +} +void dtn_debugfs_init (struct amdgpu_device *adev) {static const struct file_operations dtn_log_fops = {
@@ -3051,6 +3109,11 @@ void dtn_debugfs_init(struct amdgpu_device *adev) .write = dtn_log_write, .llseek = default_llseek }; +static const struct file_operations dcc_en_bits_fops = { + .owner =THIS_MODULE , + .read = dcc_en_bits_read, + .llseek = default_llseek + };struct drm_minor *minor =adev_to_drm (adev)->primary;struct dentry *root = minor->debugfs_root;
@@ -3078,4 +3141,7 @@ void dtn_debugfs_init(struct amdgpu_device *adev)debugfs_create_file_unsafe ("amdgpu_dm_dmcub_trace_event_en" ,0644 , root, adev, &dmcub_trace_event_state_fops); + +debugfs_create_file_unsafe ("amdgpu_dm_dcc_en" ,0644 , root, adev, + &dcc_en_bits_fops); }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +16 -0
@@ -3979,3 +3979,19 @@ void dcn10_get_clock(struct dc *dc, dc->clk_mgr->funcs->get_clock (dc->clk_mgr, context, clock_type, clock_cfg); } + +void dcn10_get_dcc_en_bits (struct dc *dc,int *dcc_en_bits) +{ +struct resource_pool *pool = dc->res_pool; +int i; + +for (i =0 ; i < pool->pipe_count; i++) { +struct hubp *hubp = pool->hubps[i]; +struct dcn_hubp_state *s = &(TO_DCN10_HUBP (hubp)->state); + + hubp->funcs->hubp_read_state (hubp); + +if (!s->blank_en) + dcc_en_bits[i] = s->dcc_en ?1 :0 ; + } +}
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +3 -1
@@ -1,5 +1,5 @@/* -* Copyright 2016 Advanced Micro Devices, Inc. +* Copyright 2016-2020 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"),
@@ -209,4 +209,6 @@ void dcn10_wait_for_pending_cleared(struct dc *dc,void dcn10_set_hdr_multiplier (struct pipe_ctx *pipe_ctx);void dcn10_verify_allow_pstate_change_high (struct dc *dc); +void dcn10_get_dcc_en_bits (struct dc *dc,int *dcc_en_bits); +#endif /* __DC_HWSS_DCN10_H__ */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_init.c +2 -1
@@ -1,5 +1,5 @@/* -* Copyright 2016 Advanced Micro Devices, Inc. +* Copyright 2016-2020 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"),
@@ -79,6 +79,7 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .set_backlight_level = dce110_set_backlight_level, .set_abm_immediate_disable = dce110_set_abm_immediate_disable, .set_pipe = dce110_set_pipe, + .get_dcc_en_bits = dcn10_get_dcc_en_bits, };static const struct hwseq_private_funcs dcn10_private_funcs = {
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c +1 -0
@@ -95,6 +95,7 @@ static const struct hw_sequencer_funcs dcn20_funcs = { .optimize_timing_for_fsft = dcn20_optimize_timing_for_fsft, #endif .set_disp_pattern_generator = dcn20_set_disp_pattern_generator, + .get_dcc_en_bits = dcn10_get_dcc_en_bits, }; static const struct hwseq_private_funcs dcn20_private_funcs = {
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c +2 -1
@@ -1,5 +1,5 @@/* -* Copyright 2016 Advanced Micro Devices, Inc. +* Copyright 2016-2020 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"),
@@ -99,6 +99,7 @@ static const struct hw_sequencer_funcs dcn21_funcs = {#endif .is_abm_supported = dcn21_is_abm_supported, .set_disp_pattern_generator = dcn20_set_disp_pattern_generator, + .get_dcc_en_bits = dcn10_get_dcc_en_bits, };static const struct hwseq_private_funcs dcn21_private_funcs = {
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_init.c +2 -1
@@ -1,5 +1,5 @@/* -* Copyright 2020 Advanced Micro Devices, Inc. +* Copyright 2016-2020 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"),
@@ -98,6 +98,7 @@ static const struct hw_sequencer_funcs dcn30_funcs = { .hardware_release = dcn30_hardware_release, .set_pipe = dcn21_set_pipe, .set_disp_pattern_generator = dcn30_set_disp_pattern_generator, + .get_dcc_en_bits = dcn10_get_dcc_en_bits, };static const struct hwseq_private_funcs dcn30_private_funcs = {
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c +2 -1
@@ -1,5 +1,5 @@/* -* Copyright 2020 Advanced Micro Devices, Inc. +* Copyright 2016-2020 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"),
@@ -98,6 +98,7 @@ static const struct hw_sequencer_funcs dcn301_funcs = { .set_abm_immediate_disable = dcn21_set_abm_immediate_disable, .set_pipe = dcn21_set_pipe, .set_disp_pattern_generator = dcn30_set_disp_pattern_generator, + .get_dcc_en_bits = dcn10_get_dcc_en_bits, };static const struct hwseq_private_funcs dcn301_private_funcs = {
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +2 -0
@@ -217,6 +217,8 @@ struct hw_sequencer_funcs {void (*set_pipe)(struct pipe_ctx *pipe_ctx); +void (*get_dcc_en_bits)(struct dc *dc,int *dcc_en_bits); +/* Idle Optimization Related */ bool (*apply_idle_power_optimizations)(struct dc *dc,bool enable);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/21 drm/amd/display: Set initial value to a divider
In reply to Qingqing ZhuoFrom: Mikita Lipski <[email protected]>
[why/how]
Due to compiler optimization the values would be passed to the division function uninitialized causing a div by zero. Initialize the numerator and denominator to 0 and 1 to prevent division by zero.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -2
@@ -2891,8 +2891,8 @@ static struct fixed31_32 get_pbn_per_slot(struct dc_stream_state *stream)static struct fixed31_32 get_pbn_from_bw_in_kbps (uint64_t kbps) {struct fixed31_32 peak_kbps; -uint32_t numerator; -uint32_t denominator; +uint32_t numerator =0 ; +uint32_t denominator =1 ;/* * margin 5300ppm + 300ppm ~ 0.6% as per spec, factor is 1.006
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/21 drm/amd/display: Tweak the kernel doc for crc_rd_wrk
In reply to Qingqing ZhuoFrom: Wayne Lin <[email protected]>
[Why]
Commit 04f6f5baec25ce76b8b6e1af63c54b6042c16716 ("drm/amd/display: Add kernel doc to crc_rd_wrk field") adds kernel doc for crc_rd_wrk field in amdgpu_dm.h but it's incorrectly formatted. Make htmldocs warns:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:398: warning:
Incorrect use of kernel-doc format: * @crc_rd_wrk
[How]
Tweak the kernel doc for crc_rd_wrk.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 -1
@@ -396,7 +396,7 @@ struct amdgpu_display_manager {#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY )/** -* @crc_rd_wrk +* @crc_rd_wrk: * * Work to be executed in a separate thread to communicate with PSP. */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/21 drm/amd/display: Add missing mask for DCN3
In reply to Qingqing Zhuo[Why]
DCN3 is not reusing DCN1 mask_sh_list, causingSURFACE_FLIP_INT_MASK missing in the mapping.
[How]
Add the corresponding entry to DCN3 list.
--- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.h +1 -0
@@ -134,6 +134,7 @@HUBP_SF (HUBPREQ0_DCSURF_SURFACE_CONTROL ,SECONDARY_SURFACE_DCC_EN , mask_sh),\HUBP_SF (HUBPREQ0_DCSURF_SURFACE_CONTROL ,SECONDARY_SURFACE_DCC_IND_BLK , mask_sh),\HUBP_SF (HUBPREQ0_DCSURF_SURFACE_CONTROL ,SECONDARY_SURFACE_DCC_IND_BLK_C , mask_sh),\ +HUBP_SF (HUBPREQ0_DCSURF_SURFACE_FLIP_INTERRUPT ,SURFACE_FLIP_INT_MASK , mask_sh),\HUBP_SF (HUBPRET0_HUBPRET_CONTROL ,DET_BUF_PLANE1_BASE_ADDRESS , mask_sh),\HUBP_SF (HUBPRET0_HUBPRET_CONTROL ,CROSSBAR_SRC_CB_B , mask_sh),\ HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CR_R, mask_sh),\
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/21 drm/amd/display: Directly retrain link from debugfs
In reply to Qingqing ZhuoFrom: Mikita Lipski <[email protected]>
[why/how]
Skip logic that sets preffered link settings and just retrain with new link_settings from Debugfs
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +2 -2
@@ -34,6 +34,7 @@#include "resource.h" #include "dsc.h" #include "dc_link_dp.h" +#include "link_hwss.h" #include "dc/dc_dmub_srv.h" struct dmub_debugfs_trace_header {
@@ -246,7 +247,6 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf, {struct amdgpu_dm_connector *connector =file_inode (f)->i_private;struct dc_link *link = connector->dc_link; -struct dc *dc = (struct dc *)link->dc;struct dc_link_settings prefer_link_settings;char *wr_buf =NULL ;const uint32_t wr_buf_size =40 ;
@@ -313,7 +313,7 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf, prefer_link_settings.lane_count = param[0 ]; prefer_link_settings.link_rate = param[1 ]; -dc_link_set_preferred_training_settings (dc, &prefer_link_settings,NULL , link, true); +dp_retrain_link_dp_test (link, &prefer_link_settings, false);kfree (wr_buf);return size;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 16/21 drm/amd/display: Add MST capability to trigger_hotplug interface
In reply to Qingqing ZhuoFrom: Mikita Lipski <[email protected]>
[Why]
Need to be able to trigger software hotplug for MST connectors
[How]
For unplug the driver calls to disable topologies manager that connector is attached to. For plugging in it does the whole rediscovery of all connectors in drm device and enbles their topologies if attached.
The interface for MST connectors works in the following way:
1. To disconnect all MST topologies currently connected:
echo 0 > /sys/kernel/debug/dri/0/amdgpu_dm_trigger_hpd_mst
2. To reconnect/rediscover all topologies that are physically connected to the card:
echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_trigger_hpd_mst
A related fix which has been merged with this patch Leo Ma(Hanghong Ma)'s work:
Set power states before disable MST topology [Why]
When we try to disable MST topology from the debugfs entry, some receiver will hang.
[How]
Set DPCD 600h power states to
2(power down mode)before disable MST topology.
--- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 71 ++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +70 -1
@@ -2980,7 +2980,73 @@ static int mst_topo_show(struct seq_file *m, void *unused) }/* -* Sets the force_timing_sync debug optino from the given string. +* Sets trigger hpd for MST topologies. +* All connected connectors will be rediscovered and re started as needed if val of 1 is sent. +* All topologies will be disconnected if val of 0 is set . +* Usage to enable topologies: echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_trigger_hpd_mst +* Usage to disable topologies: echo 0 > /sys/kernel/debug/dri/0/amdgpu_dm_trigger_hpd_mst +*/ +static int trigger_hpd_mst_set (void *data,u64 val) +{ +struct amdgpu_device *adev = data; +struct drm_device *dev =adev_to_drm (adev); +struct drm_connector_list_iter iter; +struct amdgpu_dm_connector *aconnector; +struct drm_connector *connector; +struct dc_link *link =NULL ; + +if (val ==1 ) { +drm_connector_list_iter_begin (dev, &iter); +drm_for_each_connector_iter (connector, &iter) { + aconnector =to_amdgpu_dm_connector (connector); +if (aconnector->dc_link->type == dc_connection_mst_branch && + aconnector->mst_mgr.aux) { +dc_link_detect (aconnector->dc_link,DETECT_REASON_HPD ); +drm_dp_mst_topology_mgr_set_mst (&aconnector->mst_mgr, true); + } + } + }else if (val ==0 ) { +drm_connector_list_iter_begin (dev, &iter); +drm_for_each_connector_iter (connector, &iter) { + aconnector =to_amdgpu_dm_connector (connector); +if (!aconnector->dc_link) +continue ; + +if (!(aconnector->port && &aconnector->mst_port->mst_mgr)) +continue ; + + link = aconnector->dc_link; +dp_receiver_power_ctrl (link, false); +drm_dp_mst_topology_mgr_set_mst (&aconnector->mst_port->mst_mgr, false); + link->mst_stream_alloc_table.stream_count =0 ; +memset (link->mst_stream_alloc_table.stream_allocations,0 , +sizeof (link->mst_stream_alloc_table.stream_allocations)); + } + }else { +return 0 ; + } +drm_kms_helper_hotplug_event (dev); + +return 0 ; +} + +/* +* The interface doesn't need get function, so it will return the +* value of zero +* Usage: cat /sys/kernel/debug/dri/0/amdgpu_dm_trigger_hpd_mst +*/ +static int trigger_hpd_mst_get (void *data,u64 *val) +{ + *val =0 ; +return 0 ; +} + +DEFINE_DEBUGFS_ATTRIBUTE (trigger_hpd_mst_ops, trigger_hpd_mst_get, + trigger_hpd_mst_set,"%llu\n" ); + + +/* +* Sets the force_timing_sync debug option from the given string. * All connected displays will be force synchronized immediately. * Usage: echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_force_timing_sync */
@@ -3142,6 +3208,9 @@ void dtn_debugfs_init(struct amdgpu_device *adev)debugfs_create_file_unsafe ("amdgpu_dm_dmcub_trace_event_en" ,0644 , root, adev, &dmcub_trace_event_state_fops); +debugfs_create_file_unsafe ("amdgpu_dm_trigger_hpd_mst" ,0644 , root, + adev, &trigger_hpd_mst_ops); +debugfs_create_file_unsafe ("amdgpu_dm_dcc_en" ,0644 , root, adev, &dcc_en_bits_fops); }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 17/21 drm/amd/display: Determine synchronization edge based on master's vsync
In reply to Qingqing ZhuoFrom: Mikita Lipski <[email protected]>
[Why&How]
The driver always wants to synchronize streams to the first edge of master's vsync pulse. In order to determine that we can read timing flags that are used to program vsync.
Master stream's vsync polarity - Multi Display Stream Synchronization edge:
Negative - Falling Edge
Positive - Rising Edge
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +18 -3
@@ -5394,9 +5394,14 @@ create_fake_sink(struct amdgpu_dm_connector *aconnector)static void set_multisync_trigger_params (struct dc_stream_state *stream) { +struct dc_stream_state *master =NULL ; +if (stream->triggered_crtc_reset.enabled) { - stream->triggered_crtc_reset.event =CRTC_EVENT_VSYNC_RISING ; - stream->triggered_crtc_reset.delay =TRIGGER_DELAY_NEXT_LINE ; + master = stream->triggered_crtc_reset.event_source; + stream->triggered_crtc_reset.event = + master->timing.flags.VSYNC_POSITIVE_POLARITY ? +CRTC_EVENT_VSYNC_RISING :CRTC_EVENT_VSYNC_FALLING ; + stream->triggered_crtc_reset.delay =TRIGGER_DELAY_NEXT_PIXEL ; } }
@@ -5426,6 +5431,7 @@ static void set_master_stream(struct dc_stream_state *stream_set[],static void dm_enable_per_frame_crtc_master_sync (struct dc_state *context) {int i =0 ; +struct dc_stream_state *stream;if (context->stream_count <2 )return ;
@@ -5437,9 +5443,18 @@ static void dm_enable_per_frame_crtc_master_sync(struct dc_state *context)* crtc_sync_master.multi_sync_enabled flag * For now it's set to false */ -set_multisync_trigger_params (context->streams[i]); } +set_master_stream (context->streams, context->stream_count); + +for (i =0 ; i < context->stream_count ; i++) { + stream = context->streams[i]; + +if (!stream) +continue ; + +set_multisync_trigger_params (stream); + } } static struct drm_display_mode *
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 18/21 drm/amd/display: Fixed corruption on 4K tvs
In reply to Qingqing ZhuoFrom: Harry VanZyllDeJong <[email protected]>
[WHY]
When on the desktop freesync is not enabled, doing a frame stretch causes the TV to display undesired output.
[HOW]
By changing the logic so that when ever fresync is supported the TV is notified we are in fressync instead on a non fresync state.
--- drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +2 -2
@@ -543,8 +543,8 @@ static void build_vrr_infopacket_data_v1(const struct mod_vrr_params *vrr, infopacket->sb[6 ] |=0x02 ;/* PB6 = [Bit 2 = FreeSync Active] */ -if (vrr->state ==VRR_STATE_ACTIVE_VARIABLE || - vrr->state ==VRR_STATE_ACTIVE_FIXED ) +if (vrr->state !=VRR_STATE_DISABLED && + vrr->state !=VRR_STATE_UNSUPPORTED ) infopacket->sb[6 ] |=0x04 ;// For v1 & 2 infoframes program nominal if non-fs mode, otherwise full range
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 19/21 drm/amd/display: Cleanup DML DSC input bpc validation
In reply to Qingqing ZhuoFrom: Nicholas Kazlauskas <[email protected]>
[Why & How]
Pipe input DSC bpc has a type mismatch with maximum DSC input bpc - align the maximum with the pipe input type, unsigned integer.
When checking the type we shoudl also check for an implicit value of 0 and align with what the spreadsheet does - default to max.
Rename output_bpc to dsc_input_bpc to reflect what the field is actually used for.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h | 4 ++-- drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 8 +++++++- 4 files changed, 11 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -1
@@ -2216,7 +2216,7 @@ int dcn20_populate_dml_pipes_from_context( pipes[pipe_cnt].dout.output_bpp = res_ctx->pipe_ctx[i].stream->timing.dsc_cfg.bits_per_pixel /16.0 ;/* todo: default max for now, until there is logic reflecting this in dc*/ - pipes[pipe_cnt].dout.output_bpc =12 ; + pipes[pipe_cnt].dout.dsc_input_bpc =12 ;/*fill up the audio sample rate (unit in kHz)*/ get_audio_check (&res_ctx->pipe_ctx[i].stream->audio_info, &aud_check); pipes[pipe_cnt].dout.max_audio_sample_rate = aud_check.max_audiosample_rate /1000 ;
drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.c +1 -1
@@ -226,7 +226,7 @@ void dml_log_pipe_params(dml_print ("DML PARAMS: PIPE [%d] DISPLAY OUTPUT PARAMS:\n" , i);dml_print ("DML PARAMS: output_type = %d\n" , dout->output_type);dml_print ("DML PARAMS: output_format = %d\n" , dout->output_format); -dml_print ("DML PARAMS: output_bpc = %d\n" , dout->output_bpc); +dml_print ("DML PARAMS: dsc_input_bpc = %d\n" , dout->dsc_input_bpc);dml_print ("DML PARAMS: output_bpp = %3.4f\n" , dout->output_bpp);dml_print ("DML PARAMS: dp_lanes = %d\n" , dout->dp_lanes);dml_print ("DML PARAMS: dsc_enable = %d\n" , dout->dsc_enable);
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +2 -2
@@ -164,7 +164,7 @@ struct _vcs_dpi_ip_params_st {double writeback_max_vscl_ratio;double writeback_min_hscl_ratio;double writeback_min_vscl_ratio; -double maximum_dsc_bits_per_component; +unsigned int maximum_dsc_bits_per_component;unsigned int writeback_max_hscl_taps;unsigned int writeback_max_vscl_taps;unsigned int writeback_line_buffer_luma_buffer_size;
@@ -292,10 +292,10 @@ struct writeback_st {struct _vcs_dpi_display_output_params_st {int dp_lanes;double output_bpp; +unsigned int dsc_input_bpc;int dsc_enable;int wb_enable;int num_active_wb; -int output_bpc;int output_type;int is_virtual;int output_format;
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +7 -1
@@ -471,7 +471,13 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib) mode_lib->vba.DSCEnable[mode_lib->vba.NumberOfActivePlanes] = dout->dsc_enable; mode_lib->vba.NumberOfDSCSlices[mode_lib->vba.NumberOfActivePlanes] = dout->dsc_slices; - mode_lib->vba.DSCInputBitPerComponent[mode_lib->vba.NumberOfActivePlanes] = dout->output_bpc; +if (!dout->dsc_input_bpc) { + mode_lib->vba.DSCInputBitPerComponent[mode_lib->vba.NumberOfActivePlanes] = + ip->maximum_dsc_bits_per_component; + }else { + mode_lib->vba.DSCInputBitPerComponent[mode_lib->vba.NumberOfActivePlanes] = + dout->dsc_input_bpc; + } mode_lib->vba.WritebackEnable[mode_lib->vba.NumberOfActivePlanes] = dout->wb_enable; mode_lib->vba.ActiveWritebacksPerPlane[mode_lib->vba.NumberOfActivePlanes] = dout->num_active_wb;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 20/21 drm/amd/display: [FW Promotion] Release 0.0.59
In reply to Qingqing ZhuoFrom: Anthony Koo <[email protected]>
[How&Why]
add params to send FEC status to firmware
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +15 -2
@@ -47,10 +47,10 @@/* Firmware versioning. */ #ifdef DMUB_EXPOSE_VERSION -#define DMUB_FW_VERSION_GIT_HASH 0x8bb402f5a +#define DMUB_FW_VERSION_GIT_HASH 0x7f2db1846#define DMUB_FW_VERSION_MAJOR 0#define DMUB_FW_VERSION_MINOR 0 -#define DMUB_FW_VERSION_REVISION 58 +#define DMUB_FW_VERSION_REVISION 59#define DMUB_FW_VERSION_TEST 0#define DMUB_FW_VERSION_VBIOS 0#define DMUB_FW_VERSION_HOTFIX 0
@@ -1229,6 +1229,19 @@ struct dmub_cmd_psr_copy_settings_data {* Length of each horizontal line in us. */ uint32_t line_time_in_us; +/** +* FEC enable status in driver +*/ +uint8_t fec_enable_status; +/** +* FEC re-enable delay when PSR exit. +* unit is 100us, range form 0~255(0xFF). +*/ +uint8_t fec_enable_delay_in100us; +/** +* Explicit padding to 4 byte boundary. +*/ +uint8_t pad3[2 ]; };/**
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 21/21 drm/amd/display: 3.2.130
In reply to Qingqing ZhuoFrom: Aric Cyr <[email protected]>
DC version 3.2.130 brings improvements in multiple areas. In summary, we highlight:
- Firmware release 0.0.59
- Fixes on display experiences for 4k TVs, register mask missing, etc.
- Enhancements on MST, code cleaning and debug messages.
--- 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
@@ -45,7 +45,7 @@/* forward declaration */ struct aux_payload ; -#define DC_VER "3.2.129" +#define DC_VER "3.2.130"#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
[AMD Public Use]
Hi all,
This week this patchset was tested on a HP Envy 360, with Ryzen 5 4500U, on the following display types (via usb-c to dp/dvi/hdmi/vga):
4k 60z, 1440p 144hz, 1680*1050 60hz, internal eDP 1080p 60hz
Tested on a Sapphire Pulse RX5700XT on the following display types (via DP):
4k60 60hz, 1440p 144hz, 1680x1050 60hz.
Also tested on a Reference AMD RX6800 on the following display types (via DP):
4k60 60hz, 1440p 144hz.
Tested using a MST hub at 2x 4k 30hz on all systems.
Tested by Dan Wheeler <[email protected]>
Thank you,
Dan Wheeler
Technologist | AMD
SW Display
O +(1) 905-882-2600 ext. 74665
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook | Twitter | amd.com
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Qingqing Zhuo
Sent: April 1, 2021 12:45 PM
To: [email protected]
Cc: Brol, Eryk <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Jacob, Anson <[email protected]>; Pillai, Aurabindo <[email protected]>; Lakha, Bhawanpreet <[email protected]>; R, Bindu <[email protected]>
Subject: [PATCH 00/21] DC Patches April 5, 2021
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* Firmware release 0.0.59
* Fixes on display experiences for 4k TVs, register mask missing, etc.
* Enhancements on MST, code cleaning and debug messages.
---
Anson Jacob (1):
drm/amd/display: Fix 32 bit compilation of dmub_srv.c
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.59
Aric Cyr (1):
drm/amd/display: 3.2.130
Aurabindo Pillai (1):
drm/amd/display: Add debugfs entry for LTTPR register status
David (Dingchen) Zhang (1):
drm/amd/display: use MST downstream AUX to dump DPRX CRCs
Harry VanZyllDeJong (1):
drm/amd/display: Fixed corruption on 4K tvs
Harry Wentland (2):
drm/amd/display: Add debug prints for SMU messages drm/amd/display: Add dc_debug flag to disable min fclk
Jake Wang (1):
drm/amd/display: Added dc_edp_id_count to dc_context
Leo Li (1):
drm/amd/display: Move vupdate keepout programming from DCN20 to DCN10
Mikita Lipski (4):
drm/amd/display: Set initial value to a divider drm/amd/display: Directly retrain link from debugfs drm/amd/display: Add MST capability to trigger_hotplug interface drm/amd/display: Determine synchronization edge based on master's
vsync
Nicholas Kazlauskas (1):
drm/amd/display: Cleanup DML DSC input bpc validation
Qingqing Zhuo (1):
drm/amd/display: Add missing mask for DCN3
Robin Singh (1):
drm/amd/display: add NULL check to avoid kernel crash in DC.
Victor Lu (1):
drm/amd/display: Add function and debugfs to dump DCC_EN bit
Wayne Lin (1):
drm/amd/display: Tweak the kernel doc for crc_rd_wrk
Wyatt Wood (2):
drm/amd/display: Retry getting PSR state if command times out drm/amd/display: Add delay in dmub_srv_send_gpint_command
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 21 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 2 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 207 +++++++++++++++++- .../display/dc/clk_mgr/dcn301/dcn301_smu.c | 29 ++- .../display/dc/clk_mgr/dcn301/vg_clk_mgr.c | 4 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 + drivers/gpu/drm/amd/display/dc/core/dc_link.c | 14 +- drivers/gpu/drm/amd/display/dc/dc.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_types.h | 4 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 29 ++- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 16 ++ .../amd/display/dc/dcn10/dcn10_hw_sequencer.h | 4 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 3 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 16 ++ .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 3 + .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 1 + .../gpu/drm/amd/display/dc/dcn20/dcn20_optc.c | 16 -- .../gpu/drm/amd/display/dc/dcn20/dcn20_optc.h | 3 - .../drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 3 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_hubp.h | 1 + .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c | 3 +- .../drm/amd/display/dc/dcn301/dcn301_init.c | 3 +- .../amd/display/dc/dcn301/dcn301_resource.c | 2 +- .../drm/amd/display/dc/dml/display_mode_lib.c | 2 +- .../amd/display/dc/dml/display_mode_structs.h | 4 +- .../drm/amd/display/dc/dml/display_mode_vba.c | 8 +- .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 2 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 17 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 4 +- .../amd/display/modules/freesync/freesync.c | 4 +- 32 files changed, 364 insertions(+), 71 deletions(-)
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cdaniel.wheeler%40amd.com%7C84c9e134049d4e1f021508d8f52da0a9%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637528923620041029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=4Sg%2Byv5%2BEdqOLHP0Rulb94nfeyZBvEeIlGZb0DjzaCY%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx