DC Patches March 10, 2022
cover DC Patches March 10, 2022
This DC patchset brings improvements in multiple areas. In summary:
* Fixes on lane status, zstate, engine ddc, debugfx entry.
* Enhancements for Pollock, EDID status.
* Amongst other.
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.108.0
Aric Cyr (1):
drm/amd/display: 3.2.177
Becle Lee (1):
drm/amd/display: Wait for hubp read line for Pollock
Charlene Liu (1):
drm/amd/display: Add save/restore PANEL_PWRSEQ_REF_DIV2
Dale Zhao (1):
drm/amd/display: Add new enum for EDID status
Eric Yang (1):
drm/amd/display: Block zstate when more than one plane enabled
JinZe.Xu (1):
drm/amd/display: Add I2C escape to support query device exist.
Jing Zhou (2):
drm/amd/display: Update engine ddc
drm/amd/display: Add null pointer filter
Leo (Hanghong) Ma (1):
drm/amd/display: Add function to get the pipe from the stream context
Wayne Lin (2):
drm/amd/display: Fix a few parts in debugfs entry drm/amd/display: Retry when fail reading lane status during LT
.../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 10 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 13 +++ drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 + .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 30 +++--- .../gpu/drm/amd/display/dc/core/dc_stream.c | 14 +++ drivers/gpu/drm/amd/display/dc/dc.h | 2 +- drivers/gpu/drm/amd/display/dc/dc_link.h | 5 + drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 + drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 1 + drivers/gpu/drm/amd/display/dc/dce/dce_i2c.c | 26 ++++++ drivers/gpu/drm/amd/display/dc/dce/dce_i2c.h | 6 ++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 15 +++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 4 + .../drm/amd/display/dc/dcn10/dcn10_resource.c | 15 +++ .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 10 ++ .../amd/display/dc/dcn31/dcn31_panel_cntl.c | 5 +- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 16 ++-- .../drm/amd/display/dc/gpio/gpio_service.c | 6 +- drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 1 + .../drm/amd/display/dc/inc/hw/panel_cntl.h | 1 + .../amd/display/dc/inc/hw_sequencer_private.h | 1 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 92 ++++++++++++++++++- 23 files changed, 253 insertions(+), 26 deletions(-)
Signature · 1 line
2.35.1
PATCH 1/12 drm/amd/display: Add I2C escape to support query device exist.
From: "JinZe.Xu" <[email protected]>
[How]
1. Search OEM I2C info from BIOS and compare with input parameter.
2. If BIOS doesn't record it, just try to read one byte.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 13 ++++++++++ drivers/gpu/drm/amd/display/dc/dc_link.h | 5 ++++ drivers/gpu/drm/amd/display/dc/dce/dce_i2c.c | 26 ++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dce/dce_i2c.h | 6 +++++ 4 files changed, 50 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +13 -0
@@ -3363,6 +3363,19 @@ bool dc_is_dmcu_initialized(struct dc *dc)return false; } +bool dc_is_oem_i2c_device_present ( +struct dc *dc, +size_t slave_address) +{ +if (dc->res_pool->oem_device) +return dce_i2c_oem_device_present ( + dc->res_pool, + dc->res_pool->oem_device, + slave_address); + +return false; +} + bool dc_submit_i2c( struct dc *dc, uint32_t link_index,
drivers/gpu/drm/amd/display/dc/dc_link.h +5 -0
@@ -466,6 +466,11 @@ const struct dc_link_settings *dc_link_get_link_cap(void dc_link_overwrite_extended_receiver_cap (struct dc_link *link); +bool dc_is_oem_i2c_device_present ( +struct dc *dc, +size_t slave_address +); + bool dc_submit_i2c( struct dc *dc, uint32_t link_index,
drivers/gpu/drm/amd/display/dc/dce/dce_i2c.c +26 -0
@@ -25,6 +25,32 @@#include "dce_i2c.h" #include "reg_helper.h" +bool dce_i2c_oem_device_present ( +struct resource_pool *pool, +struct ddc_service *ddc, +size_t slave_address +) +{ +struct dc *dc = ddc->ctx->dc; +struct dc_bios *dcb = dc->ctx->dc_bios; +struct graphics_object_id id = {0 }; +struct graphics_object_i2c_info i2c_info; + +if (!dc->ctx->dc_bios->fw_info.oem_i2c_present) +return false; + + id.id = dc->ctx->dc_bios->fw_info.oem_i2c_obj_id; + id.enum_id =0 ; + id.type =OBJECT_TYPE_GENERIC ; +if (dcb->funcs->get_i2c_info (dcb, id, &i2c_info) !=BP_RESULT_OK ) +return false; + +if (i2c_info.i2c_slave_address != slave_address) +return false; + +return true; +} + bool dce_i2c_submit_command( struct resource_pool *pool, struct ddc *ddc,
drivers/gpu/drm/amd/display/dc/dce/dce_i2c.h +6 -0
@@ -30,6 +30,12 @@#include "dce_i2c_hw.h" #include "dce_i2c_sw.h" +bool dce_i2c_oem_device_present ( +struct resource_pool *pool, +struct ddc_service *ddc, +size_t slave_address +); + bool dce_i2c_submit_command( struct resource_pool *pool, struct ddc *ddc,
Signature · 1 line
2.35.1
Re: [PATCH 01/12] drm/amd/display: Add I2C escape to support query device exist.
Dear Augustin,
Am 10.03.22 um 23:20 schrieb Agustin Gutierrez:
Quoted 1 line
From: "JinZe.Xu" <[email protected]>
Please remove the dot/period and use Jin Ze Xu.
Also please remove the dot/period at the end of the git commit message summary.
Quoted 3 lines
[How]
1. Search OEM I2C info from BIOS and compare with input parameter.
2. If BIOS doesn't record it, just try to read one byte.
Please describe the problem in more detail.
Quoted 3 lines
Reviewed-by Aric Cyr <[email protected]>Signed-off-by JinZe.Xu <[email protected]>
Ditto.
Quoted 101 lines
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 13 ++++++++++ drivers/gpu/drm/amd/display/dc/dc_link.h | 5 ++++ drivers/gpu/drm/amd/display/dc/dce/dce_i2c.c | 26 ++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dce/dce_i2c.h | 6 +++++ 4 files changed, 50 insertions(+)drivers/gpu/drm/amd/display/dc/core/dc.c +13
-0@@ -3363,6 +3363,19 @@ bool dc_is_dmcu_initialized(struct dc *dc)return false; } +bool dc_is_oem_i2c_device_present ( +struct dc *dc, +size_t slave_address) +{ +if (dc->res_pool->oem_device) +return dce_i2c_oem_device_present ( + dc->res_pool, + dc->res_pool->oem_device, + slave_address); + +return false; +} + bool dc_submit_i2c( struct dc *dc, uint32_t link_index,drivers/gpu/drm/amd/display/dc/dc_link.h +5
-0@@ -466,6 +466,11 @@ const struct dc_link_settings *dc_link_get_link_cap(void dc_link_overwrite_extended_receiver_cap (struct dc_link *link); +bool dc_is_oem_i2c_device_present ( +struct dc *dc, +size_t slave_address +); + bool dc_submit_i2c( struct dc *dc, uint32_t link_index,drivers/gpu/drm/amd/display/dc/dce/dce_i2c.c +26
-0@@ -25,6 +25,32 @@#include "dce_i2c.h" #include "reg_helper.h" +bool dce_i2c_oem_device_present ( +struct resource_pool *pool, +struct ddc_service *ddc, +size_t slave_address +) +{ +struct dc *dc = ddc->ctx->dc; +struct dc_bios *dcb = dc->ctx->dc_bios; +struct graphics_object_id id = {0 }; +struct graphics_object_i2c_info i2c_info; + +if (!dc->ctx->dc_bios->fw_info.oem_i2c_present) +return false; + + id.id = dc->ctx->dc_bios->fw_info.oem_i2c_obj_id; + id.enum_id =0 ; + id.type =OBJECT_TYPE_GENERIC ; +if (dcb->funcs->get_i2c_info (dcb, id, &i2c_info) !=BP_RESULT_OK ) +return false; + +if (i2c_info.i2c_slave_address != slave_address) +return false; + +return true; +} + bool dce_i2c_submit_command( struct resource_pool *pool, struct ddc *ddc,drivers/gpu/drm/amd/display/dc/dce/dce_i2c.h +6
-0@@ -30,6 +30,12 @@#include "dce_i2c_hw.h" #include "dce_i2c_sw.h" +bool dce_i2c_oem_device_present ( +struct resource_pool *pool, +struct ddc_service *ddc, +size_t slave_address +); + bool dce_i2c_submit_command( struct resource_pool *pool, struct ddc *ddc,
PATCH 2/12 drm/amd/display: Add function to get the pipe from the stream context
In reply to Agustin GutierrezFrom: "Leo (Hanghong) Ma" <[email protected]>
[Why]
We need a helper function in dc to grab the pipe from the stream context.
[How]
Add it.
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 14 ++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 ++ 2 files changed, 16 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +14 -0
@@ -718,6 +718,20 @@ enum dc_status dc_stream_add_dsc_to_resource(struct dc *dc, } } +struct pipe_ctx *dc_stream_get_pipe_ctx (struct dc_stream_state *stream) +{ +int i =0 ; + +for (i =0 ; i <MAX_PIPES ; i++) { +struct pipe_ctx *pipe = &stream->ctx->dc->current_state->res_ctx.pipe_ctx[i]; + +if (pipe->stream == stream) +return pipe; + } + +return NULL ; +} +void dc_stream_log (const struct dc *dc,const struct dc_stream_state *stream) { DC_LOG_DC(
drivers/gpu/drm/amd/display/dc/dc_stream.h +2 -0
@@ -524,4 +524,6 @@ bool dc_stream_get_crtc_position(struct dc *dc,unsigned int *v_pos, unsigned int *nom_v_pos); +struct pipe_ctx *dc_stream_get_pipe_ctx (struct dc_stream_state *stream); +#endif /* DC_STREAM_H_ */
Signature · 1 line
2.35.1
PATCH 3/12 drm/amd/display: Fix a few parts in debugfs entry
In reply to Agustin GutierrezFrom: Wayne Lin <[email protected]>
[Why & How]
1. To leverage and simplify the igt tool. Change the value of retrain when calling preferred training settings.
Now, writing value to link settings triggers link training immediately.
2. Add dc lock when triggering link training in edp_ilr_write()
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +9 -1
@@ -247,6 +247,7 @@ 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 amdgpu_device *adev =drm_to_adev (connector->base.dev);struct dc *dc = (struct dc *)link->dc;struct dc_link_settings prefer_link_settings;char *wr_buf =NULL ;
@@ -306,6 +307,9 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,if (!valid_input) {kfree (wr_buf);DRM_DEBUG_DRIVER ("Invalid Input value No HW will be programmed\n" ); +mutex_lock (&adev->dm.dc_lock); +dc_link_set_preferred_training_settings (dc,NULL ,NULL , link, false); +mutex_unlock (&adev->dm.dc_lock);return size; }
@@ -317,7 +321,9 @@ 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); +mutex_lock (&adev->dm.dc_lock); +dc_link_set_preferred_training_settings (dc, &prefer_link_settings,NULL , link, false); +mutex_unlock (&adev->dm.dc_lock);kfree (wr_buf);return size;
@@ -2887,7 +2893,9 @@ static ssize_t edp_ilr_write(struct file *f, const char __user *buf,kfree (wr_buf);DRM_DEBUG_DRIVER ("Invalid Input value. No HW will be programmed\n" ); prefer_link_settings.use_link_rate_set = false; +mutex_lock (&adev->dm.dc_lock);dc_link_set_preferred_training_settings (dc,NULL ,NULL , link, false); +mutex_unlock (&adev->dm.dc_lock);return size; }
Signature · 1 line
2.35.1
PATCH 4/12 drm/amd/display: Update engine ddc
In reply to Agustin GutierrezFrom: Jing Zhou <[email protected]>
[Why]
Crash caused by a ddc update failure
[How]
Update engine ddc before release engine.
--- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +1 -0
@@ -413,6 +413,7 @@ static bool acquire(return false;if (!acquire_engine (engine)) { + engine->ddc = ddc;release_engine (engine);return false; }
Signature · 1 line
2.35.1
Re: [PATCH 04/12] drm/amd/display: Update engine ddc
Dear Agustin,
Am 10.03.22 um 23:20 schrieb Agustin Gutierrez:
Quoted 4 lines
From: Jing Zhou <[email protected]>
[Why]
Crash caused by a ddc update failure
Please give more details. What setup is it? Did Linux crash or just print a stack trace?
Also *Update engine ddc* should be more concrete.
Quoted 2 lines
[How]
Update engine ddc before release engine.
Please add a Fixes tag.
Quoted 13 lines
Reviewed-by Wyatt Wood <[email protected]>Reviewed-by Aric Cyr <[email protected]>Signed-off-by Jing Zhou <[email protected]>--- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +0
-0
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c static bool acquire( · line 419
Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +1
-0@@ -413,6 +413,7 @@ static bool acquire(return false;if (!acquire_engine (engine)) { + engine->ddc = ddc;release_engine (engine);return false; }
Kind regards,
Paul
PATCH 5/12 drm/amd/display: Block zstate when more than one plane enabled
In reply to Agustin GutierrezFrom: Eric Yang <[email protected]>
[Why]
Currently Z10 save/restore only covers 1 plane case. If we enter Z10 with 2 planes enabled, 1 of the 2 planes will not be restored. causing black screen.
[How]
Disable Zstate when more than 1 plane is enabled. Right now Z9 enable but Z10 disable is not a supported config, so we disable both.
--- .../gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +10 -6
@@ -730,18 +730,22 @@ static enum dcn_zstate_support_state decide_zstate_support(struct dc *dc, struc }/* -* Zstate is allowed in following scenarios: -* 1. Single eDP with PSR enabled -* 2. 0 planes (No memory requests) -* 3. Single eDP without PSR but > 5ms stutter period +* Z9 and Z10 allowed cases: +* 1. 0 Planes enabled +* 2. single eDP, on link 0, 1 plane and stutter period > 5ms +* Z10 only cases: +* 1. single eDP, on link 0, 1 plane and stutter period >= 5ms +* Zstate not allowed cases: +* 1. Everything else */ if (plane_count ==0 )return DCN_ZSTATE_SUPPORT_ALLOW ;else if (context->stream_count ==1 && context->streams[0 ]->signal ==SIGNAL_TYPE_EDP ) {struct dc_link *link = context->streams[0 ]->sink->link; +struct dc_stream_status *stream_status = &context->stream_status[0 ]; -/* zstate only supported on PWRSEQ0 */ -if (link->link_index !=0 ) +/* zstate only supported on PWRSEQ0 and when there's <2 planes*/ +if (link->link_index !=0 || stream_status->plane_count >1 )return DCN_ZSTATE_SUPPORT_DISALLOW ;if (context->bw_ctx.dml.vba.StutterPeriod >5000.0 )
Signature · 1 line
2.35.1
PATCH 6/12 drm/amd/display: Add new enum for EDID status
In reply to Agustin GutierrezFrom: Dale Zhao <[email protected]>
[Why]
We must support a new type of partial edid return in the future
[How]
Add interface and case hander for partial edid
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 +++ drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +3 -0
@@ -1183,6 +1183,9 @@ static bool detect_link_and_local_sink(struct dc_link *link,case EDID_BAD_CHECKSUM :DC_LOG_ERROR ("EDID checksum invalid.\n" );break ; +case EDID_PARTIAL_VALID : +DC_LOG_ERROR ("Partial EDID valid, abandon invalid blocks.\n" ); +break ;case EDID_NO_RESPONSE :DC_LOG_ERROR ("No EDID read.\n" );/*
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -0
@@ -138,6 +138,7 @@ enum dc_edid_status {EDID_BAD_CHECKSUM ,EDID_THE_SAME ,EDID_FALL_BACK , + EDID_PARTIAL_VALID, }; enum act_return_status {
Signature · 1 line
2.35.1
Re: [PATCH 06/12] drm/amd/display: Add new enum for EDID status
Dear Agustin, dear Dale,
Am 10.03.22 um 23:20 schrieb Agustin Gutierrez:
Quoted 4 lines
From: Dale Zhao <[email protected]>
[Why]
We must support a new type of partial edid return in the future
What changed, that you need to support it now? The exact DisplayCore(?) version should be documented returning this.
Anyway, please elaborate, what “partial EDID return” is exactly.
Quoted 2 lines
[How]
Add interface and case hander for partial edid
hander?
Quoted 13 lines
Reviewed-by Charlene Liu <[email protected]>Signed-off-by Dale Zhao <[email protected]>--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 +++ drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + 2 files changed, 4 insertions(+)drivers/gpu/drm/amd/display/dc/core/dc_link.c +0
-0
drivers/gpu/drm/amd/display/dc/core/dc_link.c static bool detect_link_and_local_sink(struct dc_link *link, · line 1187
Quoted 5 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2
-0@@ -1183,6 +1183,9 @@ static bool detect_link_and_local_sink(struct dc_link *link,case EDID_BAD_CHECKSUM :DC_LOG_ERROR ("EDID checksum invalid.\n" );break ; +case EDID_PARTIAL_VALID : +DC_LOG_ERROR ("Partial EDID valid, abandon invalid blocks.\n" );
Is that an error of the monitor/display. Please add a big warning asking the user to contact the device manufacturer to fix it.
Kind regards,
Paul
Quoted 16 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1
-0+break ;case EDID_NO_RESPONSE :DC_LOG_ERROR ("No EDID read.\n" );/* drivers/gpu/drm/amd/display/dc/dc_types.h +1
-0@@ -138,6 +138,7 @@ enum dc_edid_status {EDID_BAD_CHECKSUM ,EDID_THE_SAME ,EDID_FALL_BACK , + EDID_PARTIAL_VALID, }; enum act_return_status {
PATCH 7/12 drm/amd/display: Retry when fail reading lane status during LT
In reply to Agustin GutierrezFrom: Wayne Lin <[email protected]>
[Why]
In dp_get_lane_status_and_lane_adjust(), we call core_link_read_dpcd() to get lane status but we ignore the return value of the function. If there is problem with AUX and we eventually can only get partial data from monitor, we might misuse the data to jude the link training result. Which could have us trapped in the dc_link_dp_perform_link_training() since we thought that we can still give a try on another link setting.
[How]
In dp_get_lane_status_and_lane_adjust(), take return value of core_link_read_dpcd() into account. If we fail to read all requested data, we treat lanes status as previous one and repeat LT steps again.
--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +19 -11
@@ -984,6 +984,14 @@ enum dc_status dp_get_lane_status_and_lane_adjust( (uint8_t *)(dpcd_buf), sizeof(dpcd_buf)); +if (status !=DC_OK ) { +DC_LOG_HW_LINK_TRAINING ("%s:\n Failed to read from address 0x%X," +" keep current lane status and lane adjust unchanged" , + __func__, + lane01_status_address); +return status; + } +for (lane =0 ; lane < (uint32_t )(link_training_setting->link_settings.lane_count); lane++) {
@@ -1124,6 +1132,9 @@ static bool perform_post_lt_adj_req_sequence(uint32_t adj_req_timer;bool req_drv_setting_changed;uint32_t lane; +union lane_status dpcd_lane_status[LANE_COUNT_DP_MAX ] = {0 }; +union lane_align_status_updated dpcd_lane_status_updated = {0 }; +union lane_adjust dpcd_lane_adjust[LANE_COUNT_DP_MAX ] = {0 }; req_drv_setting_changed = false; for (adj_req_count = 0; adj_req_count < POST_LT_ADJ_REQ_LIMIT;
@@ -1135,11 +1146,6 @@ static bool perform_post_lt_adj_req_sequence( adj_req_timer <POST_LT_ADJ_REQ_TIMEOUT ; adj_req_timer++) { -union lane_status dpcd_lane_status[LANE_COUNT_DP_MAX ]; -union lane_align_status_updated - dpcd_lane_status_updated; -union lane_adjust dpcd_lane_adjust[LANE_COUNT_DP_MAX ] = { { {0 } } }; - dp_get_lane_status_and_lane_adjust( link, lt_settings,
@@ -1366,6 +1372,10 @@ static enum link_training_result perform_clock_recovery_sequence( retries_cr =0 ; retry_count =0 ; +memset (&dpcd_lane_status,'\0' ,sizeof (dpcd_lane_status)); +memset (&dpcd_lane_status_updated,'\0' , +sizeof (dpcd_lane_status_updated)); +if (!link->ctx->dc->work_arounds.lt_early_cr_pattern)dp_set_hw_training_pattern (link, link_res, lt_settings->pattern_for_cr, offset);
@@ -1377,9 +1387,6 @@ static enum link_training_result perform_clock_recovery_sequence(while ((retries_cr <LINK_TRAINING_MAX_RETRY_COUNT ) && (retry_count <LINK_TRAINING_MAX_CR_RETRY )) { -memset (&dpcd_lane_status,'\0' ,sizeof (dpcd_lane_status)); -memset (&dpcd_lane_status_updated,'\0' , -sizeof (dpcd_lane_status_updated));/* 1. call HWSS to set lane settings*/ dp_set_hw_lane_settings(
@@ -2475,12 +2482,13 @@ static enum link_training_result dp_perform_fixed_vs_pe_training_sequence( retries_cr =0 ; retry_count =0 ; +memset (&dpcd_lane_status,'\0' ,sizeof (dpcd_lane_status)); +memset (&dpcd_lane_status_updated,'\0' , +sizeof (dpcd_lane_status_updated)); +while ((retries_cr <LINK_TRAINING_MAX_RETRY_COUNT ) && (retry_count <LINK_TRAINING_MAX_CR_RETRY )) { -memset (&dpcd_lane_status,'\0' ,sizeof (dpcd_lane_status)); -memset (&dpcd_lane_status_updated,'\0' , -sizeof (dpcd_lane_status_updated));/* 1. call HWSS to set lane settings */ dp_set_hw_lane_settings(
Signature · 1 line
2.35.1
PATCH 8/12 drm/amd/display: Add null pointer filter
In reply to Agustin GutierrezFrom: Jing Zhou <[email protected]>
[Why & How]
Add null pointer filter for logical integrity.
--- drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +4 -2
@@ -647,7 +647,9 @@ enum gpio_result dal_ddc_set_config(void dal_ddc_close (struct ddc *ddc) { -dal_gpio_close (ddc->pin_clock); -dal_gpio_close (ddc->pin_data); +if (ddc !=NULL ) { +dal_gpio_close (ddc->pin_clock); +dal_gpio_close (ddc->pin_data); + } }
Signature · 1 line
2.35.1
PATCH 9/12 drm/amd/display: Wait for hubp read line for Pollock
In reply to Agustin GutierrezFrom: Becle Lee <[email protected]>
[Why]
Underflow occurred while hubp ret pipe read is idle and the second pipe is powered up and added. Flickering and underflow are only observed on Pollock.
[How]
Check the hubp ret pipe read prior to unlock pipes.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 15 +++++++++++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 4 ++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 15 +++++++++++++++ .../gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 10 ++++++++++ drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 1 + .../drm/amd/display/dc/inc/hw_sequencer_private.h | 1 + 6 files changed, 46 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +15 -0
@@ -1311,6 +1311,20 @@ void hubp1_set_flip_int(struct hubp *hubp)return ; } +/** +* hubp1_wait_pipe_read_start - wait for hubp ret path starting read. +* +* @hubp: hubp struct reference. +*/ +void hubp1_wait_pipe_read_start (struct hubp *hubp) +{ +struct dcn10_hubp *hubp1 =TO_DCN10_HUBP (hubp); + +REG_WAIT (HUBPRET_READ_LINE_STATUS , +PIPE_READ_VBLANK ,0 , +1 ,1000 ); +} +void hubp1_init (struct hubp *hubp) {//do nothing
@@ -1345,6 +1359,7 @@ static const struct hubp_funcs dcn10_hubp_funcs = { .hubp_soft_reset = hubp1_soft_reset, .hubp_in_blank = hubp1_in_blank, .hubp_set_flip_int = hubp1_set_flip_int, + .hubp_wait_pipe_read_start = hubp1_wait_pipe_read_start, };/*****************************************/
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h +4 -0
@@ -76,6 +76,7 @@SRI (DCSURF_SURFACE_CONTROL ,HUBPREQ , id),\SRI (DCSURF_SURFACE_FLIP_INTERRUPT ,HUBPREQ , id),\SRI (HUBPRET_CONTROL ,HUBPRET , id),\ +SRI (HUBPRET_READ_LINE_STATUS ,HUBPRET , id),\SRI (DCN_EXPANSION_MODE ,HUBPREQ , id),\SRI (DCHUBP_REQ_SIZE_CONFIG ,HUBP , id),\ SRI(DCHUBP_REQ_SIZE_CONFIG_C, HUBP, id),\
@@ -186,6 +187,7 @@uint32_t DCSURF_SURFACE_CONTROL ; \uint32_t DCSURF_SURFACE_FLIP_INTERRUPT ; \uint32_t HUBPRET_CONTROL ; \ +uint32_t HUBPRET_READ_LINE_STATUS ; \uint32_t DCN_EXPANSION_MODE ; \uint32_t DCHUBP_REQ_SIZE_CONFIG ; \uint32_t DCHUBP_REQ_SIZE_CONFIG_C ; \
@@ -338,6 +340,7 @@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),\ +HUBP_SF (HUBPRET0_HUBPRET_READ_LINE_STATUS ,PIPE_READ_VBLANK , mask_sh),\HUBP_SF (HUBPREQ0_DCN_EXPANSION_MODE ,DRQ_EXPANSION_MODE , mask_sh),\HUBP_SF (HUBPREQ0_DCN_EXPANSION_MODE ,PRQ_EXPANSION_MODE , mask_sh),\ HUBP_SF(HUBPREQ0_DCN_EXPANSION_MODE, MRQ_EXPANSION_MODE, mask_sh),\
@@ -538,6 +541,7 @@type DET_BUF_PLANE1_BASE_ADDRESS ;\type CROSSBAR_SRC_CB_B ;\type CROSSBAR_SRC_CR_R ;\ +type PIPE_READ_VBLANK ;\type DRQ_EXPANSION_MODE ;\type PRQ_EXPANSION_MODE ;\type MRQ_EXPANSION_MODE ;\
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +15 -0
@@ -863,6 +863,21 @@ static struct dce_hwseq *dcn10_hwseq_create( hws->wa.DEGVIDCN10_253 = true; hws->wa.false_optc_underflow = true; hws->wa.DEGVIDCN10_254 = true; + +if ((ctx->asic_id.chip_family ==FAMILY_RV ) && +ASICREV_IS_RAVEN2 (ctx->asic_id.hw_internal_rev)) +switch (ctx->asic_id.pci_revision_id) { +case PRID_POLLOCK_94 : +case PRID_POLLOCK_95 : +case PRID_POLLOCK_E9 : +case PRID_POLLOCK_EA : +case PRID_POLLOCK_EB : + hws->wa.wait_hubpret_read_start_during_mpo_transition = true; +break ; +default : + hws->wa.wait_hubpret_read_start_during_mpo_transition = false; +break ; + } }return hws; }
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +10 -0
@@ -1739,6 +1739,16 @@ void dcn20_program_front_end_for_ctx( || pipe->stream->update_flags.raw) && hws->funcs.program_all_writeback_pipes_in_tree) hws->funcs.program_all_writeback_pipes_in_tree (dc, pipe->stream, context); + +/* Avoid underflow by check of pipe line read when adding 2nd plane. */ +if (hws->wa.wait_hubpret_read_start_during_mpo_transition && + !pipe->top_pipe && + pipe->stream && + pipe->plane_res.hubp->funcs->hubp_wait_pipe_read_start && + dc->current_state->stream_status[0 ].plane_count ==1 && + context->stream_status[0 ].plane_count >1 ) { + pipe->plane_res.hubp->funcs->hubp_wait_pipe_read_start (pipe->plane_res.hubp); + } } }
drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h +1 -0
@@ -195,6 +195,7 @@ struct hubp_funcs {void (*hubp_set_flip_int)(struct hubp *hubp); + void (*hubp_wait_pipe_read_start)(struct hubp *hubp); };#endif
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h +1 -0
@@ -42,6 +42,7 @@ struct dce_hwseq_wa {bool DEGVIDCN21 ;bool disallow_self_refresh_during_multi_plane_transition;bool dp_hpo_and_otg_sequence; +bool wait_hubpret_read_start_during_mpo_transition; };struct hwseq_wa_state {
Signature · 1 line
2.35.1
PATCH 10/12 drm/amd/display: Add save/restore PANEL_PWRSEQ_REF_DIV2
In reply to Agustin GutierrezFrom: Charlene Liu <[email protected]>
[why]
DCN31 has this in zstate save/restore sequence.
need for non_zstate supported ASIC
[how]
add this PANEL_PWRSEQ_REF_DIV2 to existing panel_cntl_hw_init structure.
--- .../amd/display/dc/dcn31/dcn31_panel_cntl.c | 5 +- .../drm/amd/display/dc/inc/hw/panel_cntl.h | 1 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 88 ++++++++++++++++++- 3 files changed, 91 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c +4 -1
@@ -83,7 +83,8 @@ static uint32_t dcn31_panel_cntl_hw_init(struct panel_cntl *panel_cntl) cmd.panel_cntl.data.bl_pwm_period_cntl = panel_cntl->stored_backlight_registers.BL_PWM_PERIOD_CNTL; cmd.panel_cntl.data.bl_pwm_ref_div1 = panel_cntl->stored_backlight_registers.LVTMA_PWRSEQ_REF_DIV_BL_PWM_REF_DIV; - + cmd.panel_cntl.data.bl_pwm_ref_div2 = + panel_cntl->stored_backlight_registers.PANEL_PWRSEQ_REF_DIV2;if (!dc_dmub_srv_cmd_with_reply_data (dc_dmub_srv, &cmd))return 0 ;
@@ -92,6 +93,8 @@ static uint32_t dcn31_panel_cntl_hw_init(struct panel_cntl *panel_cntl) panel_cntl->stored_backlight_registers.BL_PWM_PERIOD_CNTL = cmd.panel_cntl.data.bl_pwm_period_cntl; panel_cntl->stored_backlight_registers.LVTMA_PWRSEQ_REF_DIV_BL_PWM_REF_DIV = cmd.panel_cntl.data.bl_pwm_ref_div1; + panel_cntl->stored_backlight_registers.PANEL_PWRSEQ_REF_DIV2 = + cmd.panel_cntl.data.bl_pwm_ref_div2;return cmd.panel_cntl.data.current_backlight; }
drivers/gpu/drm/amd/display/dc/inc/hw/panel_cntl.h +1 -0
@@ -39,6 +39,7 @@ struct panel_cntl_backlight_registers {unsigned int BL_PWM_CNTL2 ;unsigned int BL_PWM_PERIOD_CNTL ;unsigned int LVTMA_PWRSEQ_REF_DIV_BL_PWM_REF_DIV ; +unsigned int PANEL_PWRSEQ_REF_DIV2 ; };struct panel_cntl_funcs {
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +86 -2
107 lines not on this page · raw message
Signature · 1 line
2.35.1
PATCH 11/12 drm/amd/display: [FW Promotion] Release 0.0.108.0
In reply to Agustin GutierrezFrom: Anthony Koo <[email protected]>
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +2 -2
@@ -46,10 +46,10 @@/* Firmware versioning. */ #ifdef DMUB_EXPOSE_VERSION -#define DMUB_FW_VERSION_GIT_HASH 0xb6b77696 +#define DMUB_FW_VERSION_GIT_HASH 0x929554ba#define DMUB_FW_VERSION_MAJOR 0#define DMUB_FW_VERSION_MINOR 0 -#define DMUB_FW_VERSION_REVISION 107 +#define DMUB_FW_VERSION_REVISION 108#define DMUB_FW_VERSION_TEST 0#define DMUB_FW_VERSION_VBIOS 0#define DMUB_FW_VERSION_HOTFIX 0
Signature · 1 line
2.35.1
PATCH 12/12 drm/amd/display: 3.2.177
In reply to Agustin GutierrezFrom: Aric Cyr <[email protected]>
This version brings along following fixes:
- Added I2C escape to support query exist
- Functionality to get pipe from stream context
- debugfs entry fixes
- Block zstate when more than one plane enabled
- Update to engine ddc
- Reading lante status during LT fixes
- Null point filters
- [FW Promotion] Release 0.0.108.0
--- 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
@@ -47,7 +47,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.176" +#define DC_VER "3.2.177"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.35.1
Re: [PATCH 12/12] drm/amd/display: 3.2.177
Dear Agustin, dear Aric,
Am 10.03.22 um 23:20 schrieb Agustin Gutierrez:
Quoted 1 line
From: Aric Cyr <[email protected]>
It’d be great if you could make the git commit message summary a statement. Maybe:
Quoted 4 lines
drm/amd/display: Increment DC version from 3.2.176 to 3.2.177
This version brings along following fixes:
- Added I2C escape to support query exist
Use imperative mood: Add I2C escape to support query device exist
(Though reading that summary, I do not understand it.)
Quoted 1 line
- Functionality to get pipe from stream context
Maybe:
Quoted 6 lines
Add functionality …
- debugfs entry fixes
- Block zstate when more than one plane enabled
- Update to engine ddc
- Reading lante status during LT fixes
lane?
Quoted 1 line
- Null point filters
Maybe update all items to use the commit message summaries.
Quoted 1 line
- [FW Promotion] Release 0.0.108.0
Please remove the indentation from the whole block. (It looks like copied from git show output, which should not be used.)
Kind regards,
Paul
Quoted 19 lines
Signed-off-by Aric Cyr <[email protected]>--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/dc.h +1
-1@@ -47,7 +47,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.176" +#define DC_VER "3.2.177"#define MAX_SURFACES 3#define MAX_PLANES 6
[Public]
Hi all,
This week this patchset was tested on the following systems:
HP Envy 360, with Ryzen 5 4500U, with the following display types: eDP 1080p 60hz, 4k 60hz (via USB-C to DP/HDMI), 1440p 144hz (via USB-C to DP/HDMI), 1680*1050 60hz (via USB-C to DP and then DP to DVI/VGA)
Lenovo Thinkpad T14s Gen2 with AMD Ryzen 5 5650U, with the following display types: eDP 1080p 60hz, 4k 60hz (via USB-C to DP/HDMI), 1440p 144hz (via USB-C to DP/HDMI), 1680*1050 60hz (via USB-C to DP and then DP to DVI/VGA)
Sapphire Pulse RX5700XT with the following display types:
4k 60hz (via DP/HDMI), 1440p 144hz (via DP/HDMI), 1680*1050 60hz (via DP to DVI/VGA)
Reference AMD RX6800 with the following display types:
4k 60hz (via DP/HDMI and USB-C to DP/HDMI), 1440p 144hz (via USB-C to DP/HDMI and USB-C to DP/HDMI), 1680*1050 60hz (via DP to DVI/VGA)
Included testing using a Startech DP 1.4 MST hub at 2x 4k 60hz, and 3x 1080p 60hz on all systems. Also tested DSC via USB-C to DP DSC Hub with 3x 4k 60hz on Ryzen 9 5900h and Ryzen 5 4500u.
Tested on Ubuntu 20.04.3 with Kernel Version 5.16
Thank you,
Dan Wheeler
Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook | Twitter | amd.com
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Agustin Gutierrez
Sent: March 10, 2022 5:21 PM
To: [email protected]
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: [PATCH 00/12] DC Patches March 10, 2022
This DC patchset brings improvements in multiple areas. In summary:
* Fixes on lane status, zstate, engine ddc, debugfx entry.
* Enhancements for Pollock, EDID status.
* Amongst other.
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.108.0
Aric Cyr (1):
drm/amd/display: 3.2.177
Becle Lee (1):
drm/amd/display: Wait for hubp read line for Pollock
Charlene Liu (1):
drm/amd/display: Add save/restore PANEL_PWRSEQ_REF_DIV2
Dale Zhao (1):
drm/amd/display: Add new enum for EDID status
Eric Yang (1):
drm/amd/display: Block zstate when more than one plane enabled
JinZe.Xu (1):
drm/amd/display: Add I2C escape to support query device exist.
Jing Zhou (2):
drm/amd/display: Update engine ddc
drm/amd/display: Add null pointer filter
Leo (Hanghong) Ma (1):
drm/amd/display: Add function to get the pipe from the stream context
Wayne Lin (2):
drm/amd/display: Fix a few parts in debugfs entry drm/amd/display: Retry when fail reading lane status during LT
.../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 10 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 13 +++ drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 + .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 30 +++--- .../gpu/drm/amd/display/dc/core/dc_stream.c | 14 +++ drivers/gpu/drm/amd/display/dc/dc.h | 2 +- drivers/gpu/drm/amd/display/dc/dc_link.h | 5 + drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 + drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 1 + drivers/gpu/drm/amd/display/dc/dce/dce_i2c.c | 26 ++++++ drivers/gpu/drm/amd/display/dc/dce/dce_i2c.h | 6 ++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 15 +++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 4 + .../drm/amd/display/dc/dcn10/dcn10_resource.c | 15 +++ .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 10 ++ .../amd/display/dc/dcn31/dcn31_panel_cntl.c | 5 +- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 16 ++-- .../drm/amd/display/dc/gpio/gpio_service.c | 6 +- drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 1 + .../drm/amd/display/dc/inc/hw/panel_cntl.h | 1 + .../amd/display/dc/inc/hw_sequencer_private.h | 1 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 92 ++++++++++++++++++- 23 files changed, 253 insertions(+), 26 deletions(-)
--
2.35.1