summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h
diff options
context:
space:
mode:
authorJimmy Kizito <Jimmy.Kizito@amd.com>2021-09-02 17:01:02 +0300
committerAlex Deucher <alexander.deucher@amd.com>2021-09-23 22:17:30 +0300
commit0d4b4253ad6d9faacdc52fd30ae056ef167c4f94 (patch)
tree1364f5f6dbe8eb1c7b2aa25d1fefe46b707b3f03 /drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h
parentb3492ed160768ad60ad6753269099213b6772a70 (diff)
downloadlinux-0d4b4253ad6d9faacdc52fd30ae056ef167c4f94.tar.xz
drm/amd/display: Fix dynamic encoder reassignment
[Why] Incorrect encoder assignments were being used while applying a new state to hardware. (1) When committing a new state to hardware requires resetting the back-end, the encoder assignments of the current or old state should be used when disabling the back-end; and the encoder assignments for the next or new state should be used when re-enabling the back-end. (2) Link training on hot plug could take over an encoder already in use by another stream without first disabling it. [How] (1) Introduce a resource context 'link_enc_cfg_context' which includes: - a mode to indicate when transitioning from current to next state. - transient encoder assignments to use during this state transition. Update the encoder configuration interface to respond to queries about encoder assignment based on the mode of operation. (2) Check if an encoder is already in use before attempting to perform link training on hot plug. Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Jimmy Kizito <Jimmy.Kizito@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h')
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h b/drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h
index 23af9640c544..bb0e91756ddd 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h
@@ -215,6 +215,11 @@ struct link_enc_assignment {
struct dc_stream_state *stream;
};
+enum link_enc_cfg_mode {
+ LINK_ENC_CFG_STEADY, /* Normal operation - use current_state. */
+ LINK_ENC_CFG_TRANSIENT /* During commit state - use state to be committed. */
+};
+
#if defined(CONFIG_DRM_AMD_DC_DCN)
enum dp2_link_mode {
DP2_LINK_TRAINING_TPS1,