DC Patches March 16th, 2020
Subsystems (3)
cover DC Patches March 16th, 2020
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* Updates on MST;
* Improvements in HMDI;
* Add fallback to DMCUB for PSR.
Charlene Liu (1):
drm/amd/display: guard DPPHY_Internal_ctrl
Dmytro Laktyushkin (2):
drm/amd/display: fix split threshold w/a to work with mpo drm/amd/display: add on demand pipe merge logic for dcn2+
Hersen Wu (1):
drm/amd/display: update connector->display_info after read edid
Isabel Zhang (1):
drm/amd/display: Remove redundant hdcp display state
Jerry (Fangzhi) Zuo (1):
drm/amd/display: Fix test pattern color space inconsistency for Linux
Martin Tsai (1):
drm/amd/display: differentiate vsc sdp colorimetry use criteria
between MST and SST
Nicholas Kazlauskas (2):
drm/amd/display: Pass triplebuffer surface flip flags down to plane
state
drm/amd/display: Explicitly disable triplebuffer flips
Nikola Cornij (1):
drm/amd/display: Remove connect DIG FE to its BE during timing
programming
Roman Li (1):
drm/amd/display: Remove PSR dependency on swizzle mode
Sung Lee (1):
drm/amd/display: Program self refresh control register on boot
Wenjing Liu (1):
drm/amd/display: remove magic numbers in hdcp_ddc
Wyatt Wood (3):
drm/amd/display: Set disable_dmcu flag properly per asic drm/amd/display: Fallback to dmcub for psr when dmcu is disabled drm/amd/display: Allocate scratch space for DMUB CW7
Yongqiang Sun (3):
drm/amd/display: workaround for HDMI hotplug in DPMSOFF state drm/amd/display: combine watermark change and clock change for update
clocks.
drm/amd/display: DPP DTO isn't update properly.
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 36 ++++--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 + .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 14 +++ .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 5 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 15 +-- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 11 +-- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 9 +- .../drm/amd/display/dc/core/dc_link_hwss.c | 2 +- .../gpu/drm/amd/display/dc/core/dc_resource.c | 7 +- drivers/gpu/drm/amd/display/dc/dc.h | 5 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 7 +- .../amd/display/dc/dcn10/dcn10_link_encoder.h | 2 +- .../drm/amd/display/dc/dcn10/dcn10_resource.c | 4 +- .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.c | 2 + .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 10 +- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 99 ++++++++++++------- .../drm/amd/display/dc/dcn20/dcn20_resource.h | 9 +- .../drm/amd/display/dc/dcn21/dcn21_hwseq.c | 22 +++++ .../drm/amd/display/dc/dcn21/dcn21_hwseq.h | 3 + .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 1 + .../drm/amd/display/dc/dcn21/dcn21_resource.c | 6 +- .../gpu/drm/amd/display/dc/inc/dc_link_dp.h | 1 - drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 3 +- .../amd/display/dc/inc/hw_sequencer_private.h | 2 + .../gpu/drm/amd/display/dmub/inc/dmub_srv.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 17 +++- .../gpu/drm/amd/display/modules/hdcp/hdcp.c | 5 +- .../gpu/drm/amd/display/modules/hdcp/hdcp.h | 28 ++---- .../display/modules/hdcp/hdcp1_execution.c | 2 +- .../display/modules/hdcp/hdcp2_execution.c | 2 +- .../drm/amd/display/modules/hdcp/hdcp_ddc.c | 12 +-- .../drm/amd/display/modules/hdcp/hdcp_psp.c | 37 +++---- .../drm/amd/display/modules/inc/mod_hdcp.h | 1 - .../amd/display/modules/inc/mod_info_packet.h | 3 +- .../display/modules/info_packet/info_packet.c | 20 +--- 35 files changed, 234 insertions(+), 174 deletions(-)
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/19 drm/amd/display: update connector->display_info after read edid
From: Hersen Wu <[email protected]>
[Why]drm_connector->display_info is not passed to amdgpu_dm right way after read edid.
[How]display_info is parsed from edid and saved into drm_connector by drm_connector_update_edid_proerty which is called within amdgpu_dm_update_connector_after_detect. call this function after read edid to update drm_connector->display_info
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++----- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 +++ .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -5
@@ -132,9 +132,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev);/* removes and deallocates the drm structures, created by the above function */ static void amdgpu_dm_destroy_drm_device (struct amdgpu_display_manager *dm); -static void -amdgpu_dm_update_connector_after_detect (struct amdgpu_dm_connector *aconnector); - static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, struct drm_plane *plane, unsigned long possible_crtcs,
@@ -1896,8 +1893,8 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector) caps->aux_min_input_signal = min; } -static void -amdgpu_dm_update_connector_after_detect (struct amdgpu_dm_connector *aconnector) +void amdgpu_dm_update_connector_after_detect ( +struct amdgpu_dm_connector *aconnector) {struct drm_connector *connector = &aconnector->base;struct drm_device *dev = connector->dev;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +3 -0
@@ -484,6 +484,9 @@ int amdgpu_dm_update_crtc_color_mgmt(struct dm_crtc_state *crtc);int amdgpu_dm_update_plane_color_mgmt (struct dm_crtc_state *crtc,struct dc_plane_state *dc_plane_state); +void amdgpu_dm_update_connector_after_detect ( +struct amdgpu_dm_connector *aconnector); +extern const struct drm_encoder_helper_funcs amdgpu_dm_encoder_helper_funcs;#endif /* __AMDGPU_DM_H__ */
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +14 -0
@@ -580,6 +580,20 @@ enum dc_edid_status dm_helpers_read_local_edid(/* We don't need the original edid anymore */ kfree (edid); +/* connector->display_info will be parsed from EDID and saved +* into drm_connector->display_info from edid by call stack +* below: +* drm_parse_ycbcr420_deep_color_info +* drm_parse_hdmi_forum_vsdb +* drm_parse_cea_ext +* drm_add_display_info +* drm_connector_update_edid_property +* +* drm_connector->display_info will be used by amdgpu_dm funcs, +* like fill_stream_properties_from_drm_display_mode +*/ +amdgpu_dm_update_connector_after_detect (aconnector); + edid_status = dm_helpers_parse_edid_caps( ctx, &sink->dc_edid,
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/19 drm/amd/display: Fix test pattern color space inconsistency for Linux
In reply to Rodrigo SiqueiraFrom: "Jerry (Fangzhi) Zuo" <[email protected]>
[why]
When reprogram MSA with updated color space, the test color space shows inconsistency. Linux has separate routine to set up test pattern color space, but it fails to configure RGB.
[How]
Add RGB to test pattern.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +6 -3
@@ -2674,9 +2674,12 @@ static void dp_test_send_link_test_pattern(struct dc_link *link)break ; } - test_pattern_color_space = dpcd_test_params.bits.YCBCR_COEFS ? -DP_TEST_PATTERN_COLOR_SPACE_YCBCR709 : -DP_TEST_PATTERN_COLOR_SPACE_YCBCR601 ; +if (dpcd_test_params.bits.CLR_FORMAT ==0 ) + test_pattern_color_space =DP_TEST_PATTERN_COLOR_SPACE_RGB ; +else + test_pattern_color_space = dpcd_test_params.bits.YCBCR_COEFS ? +DP_TEST_PATTERN_COLOR_SPACE_YCBCR709 : +DP_TEST_PATTERN_COLOR_SPACE_YCBCR601 ; dc_link_dp_set_test_pattern( link,
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/19 drm/amd/display: Remove redundant hdcp display state
In reply to Rodrigo SiqueiraFrom: Isabel Zhang <[email protected]>
[Why]
Due to previous code changes displays which are in active state immediately transition to the active and added state. This makes the two states redundant and unnecessary.
[How]
Instead of updating the device state to active and added after successful addition, change state to inactive if addition failed. Also, change references to active and added state to just added state.
--- .../gpu/drm/amd/display/modules/hdcp/hdcp.c | 5 ++- .../gpu/drm/amd/display/modules/hdcp/hdcp.h | 28 +++----------- .../display/modules/hdcp/hdcp1_execution.c | 2 +- .../display/modules/hdcp/hdcp2_execution.c | 2 +- .../drm/amd/display/modules/hdcp/hdcp_psp.c | 37 ++++++++----------- .../drm/amd/display/modules/inc/mod_hdcp.h | 1 - 6 files changed, 27 insertions(+), 48 deletions(-)
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c +3 -2
@@ -328,7 +328,8 @@ enum mod_hdcp_status mod_hdcp_add_display(struct mod_hdcp *hdcp,/* add display to connection */ hdcp->connection.link = *link; *display_container = *display; - status =mod_hdcp_add_display_to_topology (hdcp, display->index); + status =mod_hdcp_add_display_to_topology (hdcp, display_container); +if (status !=MOD_HDCP_STATUS_SUCCESS ) goto out;
@@ -374,7 +375,7 @@ enum mod_hdcp_status mod_hdcp_remove_display(struct mod_hdcp *hdcp, status =mod_hdcp_remove_display_from_topology (hdcp, index);if (status !=MOD_HDCP_STATUS_SUCCESS ) goto out; - display->state =MOD_HDCP_DISPLAY_INACTIVE ; +memset (display,0 ,sizeof (struct mod_hdcp_display ));/* request authentication when connection is not reset */ if (current_state (hdcp) !=HDCP_UNINITIALIZED )
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h +6 -22
@@ -328,7 +328,7 @@ void mod_hdcp_dump_binary_message(uint8_t *msg, uint32_t msg_size,/* psp functions */ enum mod_hdcp_status mod_hdcp_add_display_to_topology ( -struct mod_hdcp *hdcp,uint8_t index); +struct mod_hdcp *hdcp,struct mod_hdcp_display *display);enum mod_hdcp_status mod_hdcp_remove_display_from_topology (struct mod_hdcp *hdcp,uint8_t index);enum mod_hdcp_status mod_hdcp_hdcp1_create_session (struct mod_hdcp *hdcp);
@@ -503,11 +503,6 @@ static inline uint8_t is_display_active(struct mod_hdcp_display *display)return display->state >=MOD_HDCP_DISPLAY_ACTIVE ; } -static inline uint8_t is_display_added (struct mod_hdcp_display *display) -{ -return display->state >=MOD_HDCP_DISPLAY_ACTIVE_AND_ADDED ; -} -static inline uint8_t is_display_encryption_enabled (struct mod_hdcp_display *display) {return display->state >=MOD_HDCP_DISPLAY_ENCRYPTION_ENABLED ;
@@ -515,34 +510,23 @@ static inline uint8_t is_display_encryption_enabled(struct mod_hdcp_display *disstatic inline uint8_t get_active_display_count (struct mod_hdcp *hdcp) { -uint8_t added_count =0 ; +uint8_t active_count =0 ;uint8_t i;for (i =0 ; i <MAX_NUM_OF_DISPLAYS ; i++)if (is_display_active (&hdcp->displays[i])) - added_count++; -return added_count; -} - -static inline uint8_t get_added_display_count (struct mod_hdcp *hdcp) -{ -uint8_t added_count =0 ; -uint8_t i; - -for (i =0 ; i <MAX_NUM_OF_DISPLAYS ; i++) -if (is_display_added (&hdcp->displays[i])) - added_count++; -return added_count; + active_count++; +return active_count; } -static inline struct mod_hdcp_display *get_first_added_display ( +static inline struct mod_hdcp_display *get_first_active_display (struct mod_hdcp *hdcp) {uint8_t i;struct mod_hdcp_display *display =NULL ;for (i =0 ; i <MAX_NUM_OF_DISPLAYS ; i++) -if (is_display_added (&hdcp->displays[i])) { +if (is_display_active (&hdcp->displays[i])) { display = &hdcp->displays[i];break ; }
drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c +1 -1
@@ -129,7 +129,7 @@ static inline uint8_t get_device_count(struct mod_hdcp *hdcp)static inline enum mod_hdcp_status check_device_count (struct mod_hdcp *hdcp) {/* device count must be greater than or equal to tracked hdcp displays */ -return (get_device_count (hdcp) <get_added_display_count (hdcp)) ? +return (get_device_count (hdcp) <get_active_display_count (hdcp)) ?MOD_HDCP_STATUS_HDCP1_DEVICE_COUNT_MISMATCH_FAILURE :MOD_HDCP_STATUS_SUCCESS ; }
drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c +1 -1
@@ -208,7 +208,7 @@ static inline uint8_t get_device_count(struct mod_hdcp *hdcp)static enum mod_hdcp_status check_device_count (struct mod_hdcp *hdcp) {/* device count must be greater than or equal to tracked hdcp displays */ -return (get_device_count (hdcp) <get_added_display_count (hdcp)) ? +return (get_device_count (hdcp) <get_active_display_count (hdcp)) ?MOD_HDCP_STATUS_HDCP2_DEVICE_COUNT_MISMATCH_FAILURE :MOD_HDCP_STATUS_SUCCESS ; }
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c +16 -21
@@ -54,7 +54,7 @@ enum mod_hdcp_status mod_hdcp_remove_display_from_topology( dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.dtm_shared_buf; -if (!display || !is_display_added (display)) +if (!display || !is_display_active (display))return MOD_HDCP_STATUS_DISPLAY_NOT_FOUND ;memset (dtm_cmd,0 ,sizeof (struct ta_dtm_shared_memory ));
@@ -76,22 +76,18 @@ enum mod_hdcp_status mod_hdcp_remove_display_from_topology( }enum mod_hdcp_status mod_hdcp_add_display_to_topology ( -struct mod_hdcp *hdcp,uint8_t index) +struct mod_hdcp *hdcp,struct mod_hdcp_display *display) {struct psp_context *psp = hdcp->config.psp.handle;struct ta_dtm_shared_memory *dtm_cmd; -struct mod_hdcp_display *display = -get_active_display_at_index (hdcp, index);struct mod_hdcp_link *link = &hdcp->connection.link;if (!psp->dtm_context.dtm_initialized) {DRM_ERROR ("Failed to add display topology, DTM TA is not initialized." ); + display->state =MOD_HDCP_DISPLAY_INACTIVE ;return MOD_HDCP_STATUS_FAILURE ; } -if (!display ||is_display_added (display)) -return MOD_HDCP_STATUS_UPDATE_TOPOLOGY_FAILURE ; - dtm_cmd = (struct ta_dtm_shared_memory *)psp->dtm_context.dtm_shared_buf;memset (dtm_cmd,0 ,sizeof (struct ta_dtm_shared_memory ));
@@ -113,20 +109,21 @@ enum mod_hdcp_status mod_hdcp_add_display_to_topology(psp_dtm_invoke (psp, dtm_cmd->cmd_id); -if (dtm_cmd->dtm_status !=TA_DTM_STATUS__SUCCESS ) +if (dtm_cmd->dtm_status !=TA_DTM_STATUS__SUCCESS ) { + display->state =MOD_HDCP_DISPLAY_INACTIVE ;return MOD_HDCP_STATUS_UPDATE_TOPOLOGY_FAILURE ; + } - display->state =MOD_HDCP_DISPLAY_ACTIVE_AND_ADDED ;HDCP_TOP_ADD_DISPLAY_TRACE (hdcp, display->index); - -return MOD_HDCP_STATUS_SUCCESS ; + +return MOD_HDCP_STATUS_SUCCESS ; }enum mod_hdcp_status mod_hdcp_hdcp1_create_session (struct mod_hdcp *hdcp) {struct psp_context *psp = hdcp->config.psp.handle; -struct mod_hdcp_display *display =get_first_added_display (hdcp); +struct mod_hdcp_display *display =get_first_active_display (hdcp);struct ta_hdcp_shared_memory *hdcp_cmd;if (!psp->hdcp_context.hdcp_initialized) {
@@ -179,7 +176,7 @@ enum mod_hdcp_status mod_hdcp_hdcp1_destroy_session(struct mod_hdcp *hdcp)if (is_display_encryption_enabled ( &hdcp->displays[i])) { hdcp->displays[i].state = -MOD_HDCP_DISPLAY_ACTIVE_AND_ADDED ; +MOD_HDCP_DISPLAY_ACTIVE ;HDCP_HDCP1_DISABLED_TRACE (hdcp, hdcp->displays[i].index); }
@@ -231,7 +228,7 @@ enum mod_hdcp_status mod_hdcp_hdcp1_enable_encryption(struct mod_hdcp *hdcp) {struct psp_context *psp = hdcp->config.psp.handle;struct ta_hdcp_shared_memory *hdcp_cmd; -struct mod_hdcp_display *display =get_first_added_display (hdcp); +struct mod_hdcp_display *display =get_first_active_display (hdcp); hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf;memset (hdcp_cmd,0 ,sizeof (struct ta_hdcp_shared_memory ));
@@ -301,8 +298,7 @@ enum mod_hdcp_status mod_hdcp_hdcp1_enable_dp_stream_encryption(struct mod_hdcpfor (i =0 ; i <MAX_NUM_OF_DISPLAYS ; i++) { -if (hdcp->displays[i].state !=MOD_HDCP_DISPLAY_ACTIVE_AND_ADDED || - hdcp->displays[i].adjust.disable) +if (hdcp->displays[i].adjust.disable)continue ;memset (hdcp_cmd,0 ,sizeof (struct ta_hdcp_shared_memory ));
@@ -364,7 +360,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_create_session(struct mod_hdcp *hdcp) {struct psp_context *psp = hdcp->config.psp.handle;struct ta_hdcp_shared_memory *hdcp_cmd; -struct mod_hdcp_display *display =get_first_added_display (hdcp); +struct mod_hdcp_display *display =get_first_active_display (hdcp);if (!psp->hdcp_context.hdcp_initialized) {DRM_ERROR ("Failed to create hdcp session, HDCP TA is not initialized" );
@@ -423,7 +419,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_destroy_session(struct mod_hdcp *hdcp)if (is_display_encryption_enabled ( &hdcp->displays[i])) { hdcp->displays[i].state = -MOD_HDCP_DISPLAY_ACTIVE_AND_ADDED ; +MOD_HDCP_DISPLAY_ACTIVE ;HDCP_HDCP2_DISABLED_TRACE (hdcp, hdcp->displays[i].index); }
@@ -662,7 +658,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_enable_encryption(struct mod_hdcp *hdcp) {struct psp_context *psp = hdcp->config.psp.handle;struct ta_hdcp_shared_memory *hdcp_cmd; -struct mod_hdcp_display *display =get_first_added_display (hdcp); +struct mod_hdcp_display *display =get_first_active_display (hdcp); hdcp_cmd = (struct ta_hdcp_shared_memory *)psp->hdcp_context.hdcp_shared_buf;memset (hdcp_cmd,0 ,sizeof (struct ta_hdcp_shared_memory ));
@@ -747,8 +743,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_enable_dp_stream_encryption(struct mod_hdcpfor (i =0 ; i <MAX_NUM_OF_DISPLAYS ; i++) { -if (hdcp->displays[i].state !=MOD_HDCP_DISPLAY_ACTIVE_AND_ADDED || - hdcp->displays[i].adjust.disable) +if (hdcp->displays[i].adjust.disable)continue ; hdcp_cmd->in_msg.hdcp2_enable_dp_stream_encryption.display_handle = hdcp->displays[i].index; hdcp_cmd->in_msg.hdcp2_enable_dp_stream_encryption.session_handle = hdcp->auth.id;
drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h +0 -1
@@ -117,7 +117,6 @@ enum mod_hdcp_operation_mode {enum mod_hdcp_display_state {MOD_HDCP_DISPLAY_INACTIVE =0 ,MOD_HDCP_DISPLAY_ACTIVE , -MOD_HDCP_DISPLAY_ACTIVE_AND_ADDED ,MOD_HDCP_DISPLAY_ENCRYPTION_ENABLED };
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/19 drm/amd/display: workaround for HDMI hotplug in DPMSOFF state
In reply to Rodrigo SiqueiraFrom: Yongqiang Sun <[email protected]>
[Why]
When hotplug a HDMI monitor during entering S0i3 or DPMSOFF state due to entering infinite loop when calling vbios to program pixel clocks. In this scenario, pll is enabled but phy is not, and there is not a programing guide for this case.
[How]
Before we having the proper programing guide, before disable pll, doing a phy enable and disable to avoid the issue.
--- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 3 +++ .../drm/amd/display/dc/dcn21/dcn21_hwseq.c | 22 +++++++++++++++++++ .../drm/amd/display/dc/dcn21/dcn21_hwseq.h | 3 +++ .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 1 + .../amd/display/dc/inc/hw_sequencer_private.h | 2 ++ 5 files changed, 31 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +3 -0
@@ -654,6 +654,9 @@ enum dc_status dcn20_enable_stream_timing(return DC_ERROR_UNEXPECTED ; } +if (dc->hwseq->funcs.PLAT_58856_wa && (!dc_is_dp_signal (stream->signal))) + dc->hwseq->funcs.PLAT_58856_wa (context, pipe_ctx); + pipe_ctx->stream_res.tg->funcs->program_timing( pipe_ctx->stream_res.tg, &stream->timing,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +22 -0
@@ -112,3 +112,25 @@ void dcn21_optimize_pwr_state( true); } +/* If user hotplug a HDMI monitor while in monitor off, +* OS will do a mode set (with output timing) but keep output off. +* In this case DAL will ask vbios to power up the pll in the PHY. +* If user unplug the monitor (while we are on monitor off) or +* system attempt to enter modern standby (which we will disable PLL), +* PHY will hang on the next mode set attempt. +* if enable PLL follow by disable PLL (without executing lane enable/disable), +* RDPCS_PHY_DP_MPLLB_STATE remains 1, +* which indicate that PLL disable attempt actually didn�t go through. +* As a workaround, insert PHY lane enable/disable before PLL disable. +*/ +void dcn21_PLAT_58856_wa (struct dc_state *context,struct pipe_ctx *pipe_ctx) +{ +if (!pipe_ctx->stream->dpms_off) +return ; + + pipe_ctx->stream->dpms_off = false; +core_link_enable_stream (context, pipe_ctx); +core_link_disable_stream (pipe_ctx); + pipe_ctx->stream->dpms_off = true; +} +
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.h +3 -0
@@ -44,4 +44,7 @@ void dcn21_optimize_pwr_state(const struct dc *dc, struct dc_state *context); +void dcn21_PLAT_58856_wa (struct dc_state *context, +struct pipe_ctx *pipe_ctx); +#endif /* __DC_HWSS_DCN21_H__ */
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c +1 -0
@@ -130,6 +130,7 @@ static const struct hwseq_private_funcs dcn21_private_funcs = { .dccg_init = dcn20_dccg_init, .set_blend_lut = dcn20_set_blend_lut, .set_shaper_3dlut = dcn20_set_shaper_3dlut, + .PLAT_58856_wa = dcn21_PLAT_58856_wa, };void dcn21_hw_sequencer_construct (struct dc *dc)
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h +2 -0
@@ -145,6 +145,8 @@ struct hwseq_private_funcs { const struct dc_plane_state *plane_state);bool (*set_shaper_3dlut)(struct pipe_ctx *pipe_ctx,const struct dc_plane_state *plane_state); +void (*PLAT_58856_wa)(struct dc_state *context, +struct pipe_ctx *pipe_ctx); };struct dce_hwseq {
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/19 drm/amd/display: fix split threshold w/a to work with mpo
In reply to Rodrigo SiqueiraFrom: Dmytro Laktyushkin <[email protected]>
Right now only stream count is used to avoid split. This change updates the W/A to check plane count instead.
--- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 39 +++++++------------ 1 file changed, 13 insertions(+), 26 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +13 -26
@@ -2568,38 +2568,25 @@ int dcn20_validate_apply_pipe_split_flags( bool *split) {int i, pipe_idx, vlevel_split; +int plane_count =0 ;bool force_split = false; -bool avoid_split = dc->debug.pipe_split_policy !=MPC_SPLIT_DYNAMIC ; +bool avoid_split = dc->debug.pipe_split_policy ==MPC_SPLIT_AVOID ; -/* Single display loop, exits if there is more than one display */ +if (context->stream_count >1 ) { +if (dc->debug.pipe_split_policy ==MPC_SPLIT_AVOID_MULT_DISP ) + avoid_split = true; + }else if (dc->debug.force_single_disp_pipe_split) + force_split = true; + +/* TODO: fix dc bugs and remove this split threshold thing */ for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; -bool exit_loop = false; - -if (!pipe->stream || pipe->top_pipe) -continue ; -if (dc->debug.force_single_disp_pipe_split) { -if (!force_split) - force_split = true; -else { - force_split = false; - exit_loop = true; - } - } -if (dc->debug.pipe_split_policy ==MPC_SPLIT_AVOID_MULT_DISP ) { -if (avoid_split) - avoid_split = false; -else { - avoid_split = true; - exit_loop = true; - } - } -if (exit_loop) -break ; +if (pipe->stream && !pipe->prev_odm_pipe && + (!pipe->top_pipe || pipe->top_pipe->plane_state != pipe->plane_state)) + ++plane_count; } -/* TODO: fix dc bugs and remove this split threshold thing */ -if (context->stream_count > dc->res_pool->pipe_count /2 ) +if (plane_count > dc->res_pool->pipe_count /2 ) avoid_split = true;/* Avoid split loop looks for lowest voltage level that allows most unsplit pipes possible */
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/19 drm/amd/display: Pass triplebuffer surface flip flags down to plane state
In reply to Rodrigo SiqueiraFrom: Nicholas Kazlauskas <[email protected]>
[Why]
A "dcn20_program_front_end_for_ctx" warning is observed on Renoir.
Since the resource definition doesn't explicitly disable triplebuffer flips like Navi10 DC actually attempts to go and setup triplebuffering even when we pass in false to the plane state.
If we hit a full update after triplebuffering has been setup we see the assertion since we don't expect full updates while performing triplebuffer flips.
Normally this would get reset back to false whne we pass in the new plane state, but since we never actually copy the flag when doing surface updates this doesn't happen.
[How]
Copy the flag onto the plane update based on the requested surface update state.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + 2 files changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -0
@@ -1871,6 +1871,8 @@ static void copy_surface_update_to_plane( surface->time.index++;if (surface->time.index >=DC_PLANE_UPDATE_TIMES_MAX ) surface->time.index =0 ; + + surface->triplebuffer_flips = srf_update->flip_addr->triplebuffer_flips; }if (srf_update->scaling_info) {
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -872,6 +872,7 @@ struct dc_flip_addrs {unsigned int flip_timestamp_in_us;bool flip_immediate;/* TODO: add flip duration for FreeSync */ +bool triplebuffer_flips; }; bool dc_post_update_surfaces_to_stream(
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/19 drm/amd/display: Explicitly disable triplebuffer flips
In reply to Rodrigo SiqueiraFrom: Nicholas Kazlauskas <[email protected]>
[Why]
This is enabled by default on Renoir but there's userspace/API support to actually make use of this.
Since we're not passing this down through surface updates, let's explicitly disable this for now.
This fixes "dcn20_program_front_end_for_ctx" warnings associated with incorrect/unexpected programming sequences performed while this is enabled.
[How]
Disable it at the topmost level in DM in case anyone tries to flip this to enabled for any of the other ASICs like Navi10/14.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
@@ -3021,6 +3021,9 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)if (adev->asic_type !=CHIP_CARRIZO && adev->asic_type !=CHIP_STONEY ) dm->dc->debug.disable_stutter = amdgpu_pp_feature_mask &PP_STUTTER_MODE ? false : true; +/* No userspace support. */ + dm->dc->debug.disable_tri_buf = true; +return 0 ; fail:kfree (aencoder);
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/19 drm/amd/display: Remove PSR dependency on swizzle mode
In reply to Rodrigo SiqueiraFrom: Roman Li <[email protected]>
[Why]
The PSR enablement was dependent on swizzle as a workaround for non-pageflipping fb console. It's no longer required.
[How]
Remove PSR-enable dependency on swizzle mode.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -6
@@ -6639,7 +6639,6 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,uint32_t target_vblank, last_flip_vblank;bool vrr_active =amdgpu_dm_vrr_active (acrtc_state);bool pflip_present = false; -bool swizzle = true;struct {struct dc_surface_update surface_updates[MAX_SURFACES ];struct dc_plane_info plane_infos[MAX_SURFACES ];
@@ -6685,9 +6684,6 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, dc_plane = dm_new_plane_state->dc_state; -if (dc_plane && !dc_plane->tiling_info.gfx9.swizzle) - swizzle = false; - bundle->surface_updates[planes_count].surface = dc_plane;if (new_pcrtc_state->color_mgmt_changed) { bundle->surface_updates[planes_count].gamma = dc_plane->gamma_correction;
@@ -6898,8 +6894,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,amdgpu_dm_link_setup_psr (acrtc_state->stream); else if ((acrtc_state->update_type == UPDATE_TYPE_FAST) && acrtc_state->stream->link->psr_feature_enabled && - !acrtc_state->stream->link->psr_allow_active && - swizzle) { + !acrtc_state->stream->link->psr_allow_active) {amdgpu_dm_psr_enable (acrtc_state->stream); }
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/19 drm/amd/display: Set disable_dmcu flag properly per asic
In reply to Rodrigo SiqueiraFrom: Wyatt Wood <[email protected]>
[Why]
The default value for disable_dmcu is true, even for asics that require dmcu.
[How]
Set flag properly per asic.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +2 -2
@@ -570,7 +570,7 @@ static const struct dc_plane_cap plane_cap = {static const struct dc_debug_options debug_defaults_drv = { .sanity_checks = true, - .disable_dmcu = true, + .disable_dmcu = false, .force_abm_enable = false, .timing_trace = false, .clock_trace = true,
@@ -598,7 +598,7 @@ static const struct dc_debug_options debug_defaults_drv = { };static const struct dc_debug_options debug_defaults_diags = { - .disable_dmcu = true, + .disable_dmcu = false, .force_abm_enable = false, .timing_trace = true, .clock_trace = true,
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +2 -2
@@ -1041,7 +1041,7 @@ static const struct resource_caps res_cap_nv14 = { };static const struct dc_debug_options debug_defaults_drv = { - .disable_dmcu = true, + .disable_dmcu = false, .force_abm_enable = false, .timing_trace = false, .clock_trace = true,
@@ -1060,7 +1060,7 @@ static const struct dc_debug_options debug_defaults_drv = { };static const struct dc_debug_options debug_defaults_diags = { - .disable_dmcu = true, + .disable_dmcu = false, .force_abm_enable = false, .timing_trace = true, .clock_trace = true,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +2 -2
@@ -855,7 +855,7 @@ static const struct dc_plane_cap plane_cap = { };static const struct dc_debug_options debug_defaults_drv = { - .disable_dmcu = true, + .disable_dmcu = false, .force_abm_enable = false, .timing_trace = false, .clock_trace = true,
@@ -876,7 +876,7 @@ static const struct dc_debug_options debug_defaults_drv = { };static const struct dc_debug_options debug_defaults_diags = { - .disable_dmcu = true, + .disable_dmcu = false, .force_abm_enable = false, .timing_trace = true, .clock_trace = true,
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/19 drm/amd/display: Fallback to dmcub for psr when dmcu is disabled
In reply to Rodrigo SiqueiraFrom: Wyatt Wood <[email protected]>
[Why]
We want to be able to enable/disable psr on dmcub and fallback to dmcu when necessary.
[How]
Use dc config option to do so.
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1 -1
@@ -1864,7 +1864,7 @@ static bool dcn21_resource_construct( goto create_fail; } -if (dc->config.psr_on_dmub) { +if (dc->debug.disable_dmcu) { pool->base.psr =dmub_psr_create (ctx);if (pool->base.psr ==NULL ) {
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/19 drm/amd/display: remove magic numbers in hdcp_ddc
In reply to Rodrigo SiqueiraFrom: Wenjing Liu <[email protected]>
[why]
DP doesn't have message id as the first byte of an hdcp message, current hdcp psp unifies HDMI and DP message so that it is required when reading DP HDCP messages in hdcp_ddc, a message id needs to be added as the first byte of the HDCP message.
The id is currently assigned as a magic number which is not a good coding practice.
[how]
Replace magic numbers with macro defined in hdcp headers.
--- drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c +6 -6
@@ -408,7 +408,7 @@ enum mod_hdcp_status mod_hdcp_read_ake_cert(struct mod_hdcp *hdcp)enum mod_hdcp_status status;if (is_dp_hdcp (hdcp)) { - hdcp->auth.msg.hdcp2.ake_cert[0 ] =3 ; + hdcp->auth.msg.hdcp2.ake_cert[0 ] =HDCP_2_2_AKE_SEND_CERT ; status =read (hdcp,MOD_HDCP_MESSAGE_ID_READ_AKE_SEND_CERT , hdcp->auth.msg.hdcp2.ake_cert+1 ,sizeof (hdcp->auth.msg.hdcp2.ake_cert)-1 );
@@ -426,7 +426,7 @@ enum mod_hdcp_status mod_hdcp_read_h_prime(struct mod_hdcp *hdcp)enum mod_hdcp_status status;if (is_dp_hdcp (hdcp)) { - hdcp->auth.msg.hdcp2.ake_h_prime[0 ] =7 ; + hdcp->auth.msg.hdcp2.ake_h_prime[0 ] =HDCP_2_2_AKE_SEND_HPRIME ; status =read (hdcp,MOD_HDCP_MESSAGE_ID_READ_AKE_SEND_H_PRIME , hdcp->auth.msg.hdcp2.ake_h_prime+1 ,sizeof (hdcp->auth.msg.hdcp2.ake_h_prime)-1 );
@@ -444,7 +444,7 @@ enum mod_hdcp_status mod_hdcp_read_pairing_info(struct mod_hdcp *hdcp)enum mod_hdcp_status status;if (is_dp_hdcp (hdcp)) { - hdcp->auth.msg.hdcp2.ake_pairing_info[0 ] =8 ; + hdcp->auth.msg.hdcp2.ake_pairing_info[0 ] =HDCP_2_2_AKE_SEND_PAIRING_INFO ; status =read (hdcp,MOD_HDCP_MESSAGE_ID_READ_AKE_SEND_PAIRING_INFO , hdcp->auth.msg.hdcp2.ake_pairing_info+1 ,sizeof (hdcp->auth.msg.hdcp2.ake_pairing_info)-1 );
@@ -462,7 +462,7 @@ enum mod_hdcp_status mod_hdcp_read_l_prime(struct mod_hdcp *hdcp)enum mod_hdcp_status status;if (is_dp_hdcp (hdcp)) { - hdcp->auth.msg.hdcp2.lc_l_prime[0 ] =10 ; + hdcp->auth.msg.hdcp2.lc_l_prime[0 ] =HDCP_2_2_LC_SEND_LPRIME ; status =read (hdcp,MOD_HDCP_MESSAGE_ID_READ_LC_SEND_L_PRIME , hdcp->auth.msg.hdcp2.lc_l_prime+1 ,sizeof (hdcp->auth.msg.hdcp2.lc_l_prime)-1 );
@@ -484,7 +484,7 @@ enum mod_hdcp_status mod_hdcp_read_rx_id_list(struct mod_hdcp *hdcp)uint32_t rx_id_list_size =0 ;uint32_t bytes_read =0 ; - hdcp->auth.msg.hdcp2.rx_id_list[0 ] =12 ; + hdcp->auth.msg.hdcp2.rx_id_list[0 ] =HDCP_2_2_REP_SEND_RECVID_LIST ; status =read (hdcp,MOD_HDCP_MESSAGE_ID_READ_REPEATER_AUTH_SEND_RECEIVERID_LIST , hdcp->auth.msg.hdcp2.rx_id_list+1 ,HDCP_MAX_AUX_TRANSACTION_SIZE );
@@ -511,7 +511,7 @@ enum mod_hdcp_status mod_hdcp_read_stream_ready(struct mod_hdcp *hdcp)enum mod_hdcp_status status;if (is_dp_hdcp (hdcp)) { - hdcp->auth.msg.hdcp2.repeater_auth_stream_ready[0 ] =17 ; + hdcp->auth.msg.hdcp2.repeater_auth_stream_ready[0 ] =HDCP_2_2_REP_STREAM_READY ; status =read (hdcp,MOD_HDCP_MESSAGE_ID_READ_REPEATER_AUTH_STREAM_READY , hdcp->auth.msg.hdcp2.repeater_auth_stream_ready+1 ,sizeof (hdcp->auth.msg.hdcp2.repeater_auth_stream_ready)-1 );
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/19 drm/amd/display: Program self refresh control register on boot
In reply to Rodrigo SiqueiraFrom: Sung Lee <[email protected]>
[WHY]
In headless boot cases, self refresh control registers are not programmed on boot. In certain hybrid graphics cases this may cause cstate entering to get blocked causing a hang.
[HOW]
Program self refresh control register on boot.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +3 -0
@@ -1356,6 +1356,9 @@ void dcn10_init_hw(struct dc *dc)*/ if (dcb->funcs->is_accelerated_mode (dcb) || dc->config.power_down_display_on_boot) { hws->funcs.init_pipes (dc, dc->current_state); +if (dc->res_pool->hubbub->funcs->allow_self_refresh_control) + dc->res_pool->hubbub->funcs->allow_self_refresh_control (dc->res_pool->hubbub, + !dc->res_pool->hubbub->ctx->dc->debug.disable_stutter); }for (i =0 ; i < res_pool->audio_count; i++) {
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/19 drm/amd/display: differentiate vsc sdp colorimetry use criteria between MST and SST
In reply to Rodrigo SiqueiraFrom: Martin Tsai <[email protected]>
[Why]
We should check MST BU support capability on output port before building vsc info packet.
[How]
Add a new definition for port and sink capability check.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 19 +++++++++++++++--- drivers/gpu/drm/amd/display/dc/dc.h | 2 ++ .../amd/display/modules/inc/mod_info_packet.h | 3 +-- .../display/modules/info_packet/info_packet.c | 20 +++---------------- 4 files changed, 22 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +16 -3
@@ -4397,9 +4397,22 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,struct dmcu *dmcu = core_dc->res_pool->dmcu; stream->psr_version = dmcu->dmcu_version.psr_version; -mod_build_vsc_infopacket (stream, - &stream->vsc_infopacket, - &stream->use_vsc_sdp_for_colorimetry); + +// +// should decide stream support vsc sdp colorimetry capability +// before building vsc info packet +// + stream->use_vsc_sdp_for_colorimetry = false; +if (aconnector->dc_sink->sink_signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) { + stream->use_vsc_sdp_for_colorimetry = + aconnector->dc_sink->is_vsc_sdp_colorimetry_supported; + }else { +if (stream->link->dpcd_caps.dpcd_rev.raw >=0x14 && + stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED) { + stream->use_vsc_sdp_for_colorimetry = true; + } + } +mod_build_vsc_infopacket (stream, &stream->vsc_infopacket); } } finish:
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -1047,6 +1047,8 @@ struct dc_sink {struct dc_sink_dsc_caps dsc_caps;struct dc_sink_fec_caps fec_caps; +bool is_vsc_sdp_colorimetry_supported; +/* private to DC core */ struct dc_link *link;struct dc_context *ctx;
drivers/gpu/drm/amd/display/modules/inc/mod_info_packet.h +1 -2
@@ -34,8 +34,7 @@ struct dc_info_packet;struct mod_vrr_params ;void mod_build_vsc_infopacket (const struct dc_stream_state *stream, -struct dc_info_packet *info_packet, -bool *use_vsc_sdp_for_colorimetry); +struct dc_info_packet *info_packet);void mod_build_hf_vsif_infopacket (const struct dc_stream_state *stream,struct dc_info_packet *info_packet,int ALLMEnabled,int ALLMValue);
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +3 -17
@@ -130,8 +130,7 @@ enum ColorimetryYCCDP { };void mod_build_vsc_infopacket (const struct dc_stream_state *stream, -struct dc_info_packet *info_packet, -bool *use_vsc_sdp_for_colorimetry) +struct dc_info_packet *info_packet) {unsigned int vsc_packet_revision = vsc_packet_undefined;unsigned int i;
@@ -139,11 +138,6 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream,unsigned int colorimetryFormat =0 ;bool stereo3dSupport = false; -/* Initialize first, later if infopacket is valid determine if VSC SDP -* should be used to signal colorimetry format and pixel encoding. -*/ - *use_vsc_sdp_for_colorimetry = false; -if (stream->timing.timing_3d_format !=TIMING_3D_FORMAT_NONE && stream->view_format !=VIEW_3D_FORMAT_NONE ) { vsc_packet_revision = vsc_packet_rev1; stereo3dSupport = true;
@@ -153,9 +147,8 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream,if (stream->psr_version !=0 ) vsc_packet_revision = vsc_packet_rev2; -/* Update to revision 5 for extended colorimetry support for DPCD 1.4+ */ -if (stream->link->dpcd_caps.dpcd_rev.raw >=0x14 && - stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED) +/* Update to revision 5 for extended colorimetry support */ +if (stream->use_vsc_sdp_for_colorimetry) vsc_packet_revision = vsc_packet_rev5;/* VSC packet not needed based on the features
@@ -269,13 +262,6 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream, info_packet->valid = true; -/* If we are using VSC SDP revision 05h, use this to signal for -* colorimetry format and pixel encoding. HW should later be -* programmed to set MSA MISC1 bit 6 to indicate ignore -* colorimetry format and pixel encoding in the MSA. -*/ - *use_vsc_sdp_for_colorimetry = true; -/* Set VSC SDP fields for pixel encoding and colorimetry format from DP 1.3 specs * Data Bytes DB 18~16 * Bits 3:0 (Colorimetry Format) | Bits 7:4 (Pixel Encoding)
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/19 drm/amd/display: guard DPPHY_Internal_ctrl
In reply to Rodrigo SiqueiraFrom: Charlene Liu <[email protected]>
[why]
this register not exist in some asic, based on request remove this from dc.
[how]
add guard for sanization.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.h +1 -1
@@ -62,11 +62,11 @@SRI (DP_DPHY_FAST_TRAINING ,DP , id), \SRI (DP_SEC_CNTL1 ,DP , id), \SRI (DP_DPHY_BS_SR_SWAP_CNTL ,DP , id), \ -SRI (DP_DPHY_INTERNAL_CTRL ,DP , id), \ SRI(DP_DPHY_HBR2_PATTERN_CONTROL, DP, id)#define LE_DCN10_REG_LIST (id)\ + SRI(DP_DPHY_INTERNAL_CTRL, DP, id), \ LE_DCN_COMMON_REG_LIST(id) struct dcn10_link_enc_aux_registers {
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/19 drm/amd/display: combine watermark change and clock change for update clocks.
In reply to Rodrigo SiqueiraFrom: Yongqiang Sun <[email protected]>
[Why]
underflow happened when playing video on 1366x768 + 4K clone mode due to incorrect handle watermark change flag and lower down clocks to early.
[How]
Check watermark change flag when decide doing optimized, and check optimized required flag to do clock update.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 13 +++++++------ drivers/gpu/drm/amd/display/dc/dc.h | 2 +- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +7 -6
@@ -1365,7 +1365,7 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)int i;struct dc_state *context = dc->current_state; -if ((!dc->clk_optimized_required && !dc->wm_optimized_required) || dc->optimize_seamless_boot_streams >0 ) +if ((!dc->optimized_required) || dc->optimize_seamless_boot_streams >0 )return true;post_surface_trace (dc);
@@ -1379,7 +1379,7 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc) dc->hwss.optimize_bandwidth (dc, context); - dc->clk_optimized_required = false; + dc->optimized_required = false; dc->wm_optimized_required = false;return true;
@@ -1828,11 +1828,12 @@ enum surface_update_type dc_check_update_surfaces_for_stream(// If there's an available clock comparator, we use that. if (dc->clk_mgr->funcs->are_clock_states_equal) {if (!dc->clk_mgr->funcs->are_clock_states_equal (&dc->clk_mgr->clks, &dc->current_state->bw_ctx.bw.dcn.clk)) - dc->clk_optimized_required = true; + dc->optimized_required = true;// Else we fallback to mem compare. }else if (memcmp (&dc->current_state->bw_ctx.bw.dcn.clk, &dc->clk_mgr->clks, offsetof(struct dc_clocks , prev_p_state_change_support)) !=0 ) { - dc->clk_optimized_required = true; - } + dc->optimized_required = true; + }else if (dc->wm_optimized_required) + dc->optimized_required = true; }return type;
@@ -2204,7 +2205,7 @@ static void commit_planes_for_stream(struct dc *dc, dc->optimize_seamless_boot_streams--;if (dc->optimize_seamless_boot_streams ==0 ) - dc->clk_optimized_required = true; + dc->optimized_required = true; } }
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -521,7 +521,7 @@ struct dc {struct dce_hwseq *hwseq;/* Require to optimize clocks and bandwidth for added/removed planes */ -bool clk_optimized_required; +bool optimized_required;bool wm_optimized_required;/* Require to maintain clocks and bandwidth for UEFI enabled HW */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +2 -2
@@ -1048,7 +1048,7 @@ void dcn10_plane_atomic_disconnect(struct dc *dc, struct pipe_ctx *pipe_ctx)if (opp !=NULL ) opp->mpcc_disconnect_pending[pipe_ctx->plane_res.mpcc_inst] = true; - dc->clk_optimized_required = true; + dc->optimized_required = true;if (hubp->funcs->hubp_disconnect) hubp->funcs->hubp_disconnect (hubp);
@@ -1099,7 +1099,7 @@ void dcn10_plane_atomic_disable(struct dc *dc, struct pipe_ctx *pipe_ctx) false); hubp->power_gated = true; - dc->clk_optimized_required = false;/* We're powering off, no need to optimize */ + dc->optimized_required = false;/* We're powering off, no need to optimize */ hws->funcs.plane_atomic_power_down(dc, pipe_ctx->plane_res.dpp,
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 16/19 drm/amd/display: Remove connect DIG FE to its BE during timing programming
In reply to Rodrigo SiqueiraFrom: Nikola Cornij <[email protected]>
[why]
Causes regression with MST DSC displays not lighting up after DPMS
[how]
Revert commit 3ee07fdc908c40f570f8ce25f12b5ad6463b87ad "dc: Program DSC during timing programming"
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 11 +++-------- drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 7 ------- drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h | 1 - 4 files changed, 4 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +3 -8
@@ -3069,14 +3069,9 @@ void core_link_enable_stream(if (pipe_ctx->stream->timing.flags.DSC) {if (dc_is_dp_signal (pipe_ctx->stream->signal) || -dc_is_virtual_signal (pipe_ctx->stream->signal)) { -/* Here we only need to enable DSC on RX. DSC HW programming -* was done earlier, as part of timing programming. -*/ -dp_set_dsc_on_rx (pipe_ctx, true); - } +dc_is_virtual_signal (pipe_ctx->stream->signal)) +dp_set_dsc_enable (pipe_ctx, true); } - dc->hwss.enable_stream (pipe_ctx);/* Set DPS PPS SDP (AKA "info frames") */
@@ -3103,7 +3098,7 @@ void core_link_enable_stream( }else {// if (IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment)) if (dc_is_dp_signal (pipe_ctx->stream->signal) ||dc_is_virtual_signal (pipe_ctx->stream->signal)) -dp_set_dsc_on_rx (pipe_ctx, true); +dp_set_dsc_enable (pipe_ctx, true); } }
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +1 -1
@@ -394,7 +394,7 @@ static void dsc_optc_config_log(struct display_stream_compressor *dsc,DC_LOG_DSC ("\tslice_width %d" , config->slice_width); } -bool dp_set_dsc_on_rx (struct pipe_ctx *pipe_ctx,bool enable) +static bool dp_set_dsc_on_rx (struct pipe_ctx *pipe_ctx,bool enable) {struct dc *dc = pipe_ctx->stream->ctx->dc;struct dc_stream_state *stream = pipe_ctx->stream;
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +0 -7
@@ -623,13 +623,6 @@ enum dc_status dcn20_enable_stream_timing(/* TODO check if timing_changed, disable stream if timing changed */ -/* Have to setup DSC here to make sure the bandwidth sent to DIG BE won't be bigger than -* what the link and/or DIG BE can handle. VBID[6]/CompressedStream_flag will be automatically -* set at a later time when the video is enabled (DP_VID_STREAM_EN = 1). -*/ -if (pipe_ctx->stream->timing.flags.DSC) -dp_set_dsc_on_stream (pipe_ctx, true); -for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) { opp_inst[opp_cnt] = odm_pipe->stream_res.opp->inst; opp_cnt++;
drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h +0 -1
@@ -85,7 +85,6 @@ void dp_set_fec_enable(struct dc_link *link, bool enable);bool dp_set_dsc_enable (struct pipe_ctx *pipe_ctx,bool enable);bool dp_set_dsc_pps_sdp (struct pipe_ctx *pipe_ctx,bool enable);void dp_set_dsc_on_stream (struct pipe_ctx *pipe_ctx,bool enable); -bool dp_set_dsc_on_rx (struct pipe_ctx *pipe_ctx,bool enable);bool dp_update_dsc_config (struct pipe_ctx *pipe_ctx);#endif /* __DC_LINK_DP_H__ */
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 17/19 drm/amd/display: DPP DTO isn't update properly.
In reply to Rodrigo SiqueiraFrom: Yongqiang Sun <[email protected]>
[Why]
before update dpp DTO, we check dppclks in context to determine it is changed or not, but dppclks in context will be updated anyways after flip is done, so compare dppclks in context will always get an equal result.
[How]
Add pipe dpp clks in dccg and compare values between dccg and context.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 5 ++--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.c | 2 ++ drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c +2 -3
@@ -115,12 +115,11 @@ void dcn20_update_clocks_update_dpp_dto(struct clk_mgr_internal *clk_mgr, dpp_inst = i; dppclk_khz = context->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz; - prev_dppclk_khz = clk_mgr->base.ctx->dc->current_state->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz; + prev_dppclk_khz = clk_mgr->dccg->pipe_dppclk_khz[i]; -if (safe_to_lower || prev_dppclk_khz < dppclk_khz) { +if (safe_to_lower || prev_dppclk_khz < dppclk_khz) clk_mgr->dccg->funcs->update_dpp_dto ( clk_mgr->dccg, dpp_inst, dppclk_khz); - } } }
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.c +2 -0
@@ -70,6 +70,8 @@ void dccg2_update_dpp_dto(struct dccg *dccg, int dpp_inst, int req_dppclk)REG_UPDATE (DPPCLK_DTO_CTRL ,DPPCLK_DTO_ENABLE [dpp_inst],0 ); } + + dccg->pipe_dppclk_khz[dpp_inst] = req_dppclk; } void dccg2_get_dccg_ref_freq(struct dccg *dccg,
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h +2 -1
@@ -27,11 +27,12 @@#define __DAL_DCCG_H__#include "dc_types.h" +#include "hw_shared.h" struct dccg {struct dc_context *ctx;const struct dccg_funcs *funcs; - +int pipe_dppclk_khz[MAX_PIPES ];int ref_dppclk; };
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 18/19 drm/amd/display: Allocate scratch space for DMUB CW7
In reply to Rodrigo SiqueiraFrom: Wyatt Wood <[email protected]>
[Why]
The scratch space can be used to pass data between x86 and DMCUB. DMCUB will manage the actually mapping of CW7 internally, driver does not program the window.
[How]
Allocate extra space within the DMUB service's framebuffer for this scratch space and expose them from the service for use in DC.
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_srv.h | 3 ++- drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_srv.h +2 -1
@@ -104,7 +104,7 @@ enum dmub_window_id {DMUB_WINDOW_4_MAILBOX ,DMUB_WINDOW_5_TRACEBUFF ,DMUB_WINDOW_6_FW_STATE , -DMUB_WINDOW_7_RESERVED , +DMUB_WINDOW_7_SCRATCH_MEM , DMUB_WINDOW_TOTAL, };
@@ -316,6 +316,7 @@ struct dmub_srv {enum dmub_asic asic;void *user_ctx;bool is_virtual; +struct dmub_fb scratch_mem_fb;volatile const struct dmub_fw_state *fw_state;/* private: internal use only */
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +14 -3
@@ -52,8 +52,11 @@/* Default tracebuffer size if meta is absent. */ #define DMUB_TRACE_BUFFER_SIZE (1024) +/* Default scratch mem size. */ +#define DMUB_SCRATCH_MEM_SIZE (256) +/* Number of windows in use. */ -#define DMUB_NUM_WINDOWS (DMUB_WINDOW_6_FW_STATE + 1) +#define DMUB_NUM_WINDOWS (DMUB_WINDOW_TOTAL)/* Base addresses. */ #define DMUB_CW0_BASE (0x60000000)
@@ -211,9 +214,11 @@ dmub_srv_calc_region_info(struct dmub_srv *dmub,struct dmub_region *mail = &out->regions[DMUB_WINDOW_4_MAILBOX ];struct dmub_region *trace_buff = &out->regions[DMUB_WINDOW_5_TRACEBUFF ];struct dmub_region *fw_state = &out->regions[DMUB_WINDOW_6_FW_STATE ]; +struct dmub_region *scratch_mem = &out->regions[DMUB_WINDOW_7_SCRATCH_MEM ];const struct dmub_fw_meta_info *fw_info;uint32_t fw_state_size =DMUB_FW_STATE_SIZE ;uint32_t trace_buffer_size =DMUB_TRACE_BUFFER_SIZE ; +uint32_t scratch_mem_size =DMUB_SCRATCH_MEM_SIZE ;if (!dmub->sw_init)return DMUB_STATUS_INVALID ;
@@ -256,7 +261,10 @@ dmub_srv_calc_region_info(struct dmub_srv *dmub, fw_state->base =dmub_align (trace_buff->top,256 ); fw_state->top = fw_state->base +dmub_align (fw_state_size,64 ); - out->fb_size =dmub_align (fw_state->top,4096 ); + scratch_mem->base =dmub_align (fw_state->top,256 ); + scratch_mem->top = scratch_mem->base +dmub_align (scratch_mem_size,64 ); + + out->fb_size =dmub_align (scratch_mem->top,4096 );return DMUB_STATUS_OK ; }
@@ -334,6 +342,7 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,struct dmub_fb *mail_fb = params->fb[DMUB_WINDOW_4_MAILBOX ];struct dmub_fb *tracebuff_fb = params->fb[DMUB_WINDOW_5_TRACEBUFF ];struct dmub_fb *fw_state_fb = params->fb[DMUB_WINDOW_6_FW_STATE ]; +struct dmub_fb *scratch_mem_fb = params->fb[DMUB_WINDOW_7_SCRATCH_MEM ];struct dmub_rb_init_params rb_params;struct dmub_window cw0, cw1, cw2, cw3, cw4, cw5, cw6;
@@ -370,7 +379,7 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub, dmub->hw_funcs.reset (dmub);if (inst_fb && data_fb && bios_fb && mail_fb && tracebuff_fb && - fw_state_fb) { + fw_state_fb && scratch_mem_fb) { cw2.offset.quad_part = data_fb->gpu_addr; cw2.region.base =DMUB_CW0_BASE + inst_fb->size; cw2.region.top = cw2.region.base + data_fb->size;
@@ -396,6 +405,8 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub, dmub->fw_state = fw_state_fb->cpu_addr; + dmub->scratch_mem_fb = *scratch_mem_fb; +if (dmub->hw_funcs.setup_windows) dmub->hw_funcs.setup_windows (dmub, &cw2, &cw3, &cw4, &cw5, &cw6);
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 19/19 drm/amd/display: add on demand pipe merge logic for dcn2+
In reply to Rodrigo SiqueiraFrom: Dmytro Laktyushkin <[email protected]>
Adds logic that will determine if pipes need merging during validation.
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 7 ++- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 56 +++++++++++++++---- .../drm/amd/display/dc/dcn20/dcn20_resource.h | 9 +-- 3 files changed, 56 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +5 -2
@@ -893,6 +893,7 @@ static void calculate_inits_and_adj_vp(struct pipe_ctx *pipe_ctx)int vpc_div = (data->format ==PIXEL_FORMAT_420BPP8 || data->format ==PIXEL_FORMAT_420BPP10 ) ?2 :1 ;bool orthogonal_rotation, flip_vert_scan_dir, flip_horz_scan_dir; +int odm_idx =0 ;/* * Need to calculate the scan direction for viewport to make adjustments
@@ -924,11 +925,13 @@ static void calculate_inits_and_adj_vp(struct pipe_ctx *pipe_ctx) * stream->dst.width / stream->src.width - src.x * plane_state->dst_rect.width / src.width * stream->dst.width / stream->src.width); -/*modified recout_skip_h calculation due to odm having no recout offset caused by split*/ +/*modified recout_skip_h calculation due to odm having no recout offset*/ while (odm_pipe) { - recout_skip_h += odm_pipe->plane_res.scl_data.recout.width + odm_pipe->plane_res.scl_data.recout.x; + odm_idx++; odm_pipe = odm_pipe->prev_odm_pipe; } +if (odm_idx) + recout_skip_h += odm_idx * data->recout.width; recout_skip_v = data->recout.y - (stream->dst.y + (plane_state->dst_rect.y - stream->src.y) * stream->dst.height / stream->src.height -
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +46 -10
109 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.h +5 -4
@@ -119,14 +119,15 @@ void dcn20_set_mcif_arb_params(display_e2e_pipe_params_st *pipes, int pipe_cnt);bool dcn20_validate_bandwidth (struct dc *dc,struct dc_state *context,bool fast_validate); -void dcn20_merge_pipes_for_validate ( -struct dc *dc, -struct dc_state *context);int dcn20_validate_apply_pipe_split_flags (struct dc *dc,struct dc_state *context,int vlevel, -bool *split); +bool *split, +bool *merge); +void dcn20_release_dsc (struct resource_context *res_ctx, +const struct resource_pool *pool, +struct display_stream_compressor **dsc);bool dcn20_validate_dsc (struct dc *dc,struct dc_state *new_ctx); void dcn20_split_stream_for_mpc( struct resource_context *res_ctx,
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx