]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Fix FEC_READY write on DP LT
authorIlya Bakoulin <ilya.bakoulin@amd.com>
Wed, 17 Apr 2024 18:21:28 +0000 (14:21 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 30 Apr 2024 13:56:57 +0000 (09:56 -0400)
[Why/How]
We can miss writing FEC_READY in some cases before LT start, which
violates DP spec. Remove the condition guarding the DPCD write so that
the write happens unconditionally.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Ilya Bakoulin <ilya.bakoulin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c

index 5cbf5f93e584f8f3160345123be993a9b0d9d803..bafa52a0165a08039a7bf73fe4713495b9113779 100644 (file)
@@ -151,16 +151,14 @@ enum dc_status dp_set_fec_ready(struct dc_link *link, const struct link_resource
                return DC_NOT_SUPPORTED;
 
        if (ready && dp_should_enable_fec(link)) {
-               if (link->fec_state == dc_link_fec_not_ready) {
-                       fec_config = 1;
+               fec_config = 1;
 
-                       status = core_link_write_dpcd(link, DP_FEC_CONFIGURATION,
-                                       &fec_config, sizeof(fec_config));
+               status = core_link_write_dpcd(link, DP_FEC_CONFIGURATION,
+                               &fec_config, sizeof(fec_config));
 
-                       if (status == DC_OK) {
-                               link_enc->funcs->fec_set_ready(link_enc, true);
-                               link->fec_state = dc_link_fec_ready;
-                       }
+               if (status == DC_OK) {
+                       link_enc->funcs->fec_set_ready(link_enc, true);
+                       link->fec_state = dc_link_fec_ready;
                }
        } else {
                if (link->fec_state == dc_link_fec_ready) {