[PATCH 01/17] drm/amd/display: Add link enc null ptr check for cable ID (#2597)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Shen, George" <George.Shen@xxxxxxx>

[Why]
Certain configurations will result in link encoder
to not be assigned to the link at the time we apply
cable ID logic. We should skip it in those cases.

[How]
Check if link_enc is not null before applying
cable ID.

Reviewed-by: Wenjing Liu <Wenjing.Liu@xxxxxxx>
Acked-by: Stylon Wang <stylon.wang@xxxxxxx>
Signed-off-by: George Shen <george.shen@xxxxxxx>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 8cfc9a8197df..117183b5ab44 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -6327,7 +6327,12 @@ void dpcd_set_source_specific_data(struct dc_link *link)
 
 void dpcd_update_cable_id(struct dc_link *link)
 {
-	if (!link->link_enc->features.flags.bits.IS_UHBR10_CAPABLE ||
+	struct link_encoder *link_enc = NULL;
+
+	link_enc = link_enc_cfg_get_link_enc(link);
+
+	if (!link_enc ||
+			!link_enc->features.flags.bits.IS_UHBR10_CAPABLE ||
 			link->dprx_status.cable_id_updated)
 		return;
 
-- 
2.34.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux