Commit 90d239cc authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/amd/display: Fix DCE LVDS handling

LVDS does not use an HPD pin so it may be invalid.  Handle
this case correctly in link encoder creation.

Fixes: 7c8fb3b8 ("drm/amd/display: Add hpd_source index check for DCE60/80/100/110/112/120 link encoders")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/5012


Cc: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Cc: Roman Li <roman.li@amd.com>
Reviewed-by: default avatarRoman Li <roman.li@amd.com>
Reviewed-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3b5620f7)
Cc: stable@vger.kernel.org
parent 4e9597f2
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -650,9 +650,6 @@ static struct link_encoder *dce100_link_encoder_create(
		return &enc110->base;
	}

	if (enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs))
		return NULL;

	link_regs_id =
		map_transmitter_id_to_phy_instance(enc_init_data->transmitter);

@@ -661,7 +658,8 @@ static struct link_encoder *dce100_link_encoder_create(
				      &link_enc_feature,
				      &link_enc_regs[link_regs_id],
				      &link_enc_aux_regs[enc_init_data->channel - 1],
				      &link_enc_hpd_regs[enc_init_data->hpd_source]);
				      enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs) ?
				      NULL : &link_enc_hpd_regs[enc_init_data->hpd_source]);
	return &enc110->base;
}

+3 −2
Original line number Diff line number Diff line
@@ -671,7 +671,7 @@ static struct link_encoder *dce110_link_encoder_create(
		kzalloc_obj(struct dce110_link_encoder);
	int link_regs_id;

	if (!enc110 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs))
	if (!enc110)
		return NULL;

	link_regs_id =
@@ -682,7 +682,8 @@ static struct link_encoder *dce110_link_encoder_create(
				      &link_enc_feature,
				      &link_enc_regs[link_regs_id],
				      &link_enc_aux_regs[enc_init_data->channel - 1],
				      &link_enc_hpd_regs[enc_init_data->hpd_source]);
				      enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs) ?
				      NULL : &link_enc_hpd_regs[enc_init_data->hpd_source]);
	return &enc110->base;
}

+3 −2
Original line number Diff line number Diff line
@@ -632,7 +632,7 @@ static struct link_encoder *dce112_link_encoder_create(
		kzalloc_obj(struct dce110_link_encoder);
	int link_regs_id;

	if (!enc110 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs))
	if (!enc110)
		return NULL;

	link_regs_id =
@@ -643,7 +643,8 @@ static struct link_encoder *dce112_link_encoder_create(
				      &link_enc_feature,
				      &link_enc_regs[link_regs_id],
				      &link_enc_aux_regs[enc_init_data->channel - 1],
				      &link_enc_hpd_regs[enc_init_data->hpd_source]);
				      enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs) ?
				      NULL : &link_enc_hpd_regs[enc_init_data->hpd_source]);
	return &enc110->base;
}

+3 −2
Original line number Diff line number Diff line
@@ -716,7 +716,7 @@ static struct link_encoder *dce120_link_encoder_create(
		kzalloc_obj(struct dce110_link_encoder);
	int link_regs_id;

	if (!enc110 || enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs))
	if (!enc110)
		return NULL;

	link_regs_id =
@@ -727,7 +727,8 @@ static struct link_encoder *dce120_link_encoder_create(
				      &link_enc_feature,
				      &link_enc_regs[link_regs_id],
				      &link_enc_aux_regs[enc_init_data->channel - 1],
				      &link_enc_hpd_regs[enc_init_data->hpd_source]);
				      enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs) ?
				      NULL : &link_enc_hpd_regs[enc_init_data->hpd_source]);

	return &enc110->base;
}
+6 −8
Original line number Diff line number Diff line
@@ -746,9 +746,6 @@ static struct link_encoder *dce60_link_encoder_create(
		return &enc110->base;
	}

	if (enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs))
		return NULL;

	link_regs_id =
		map_transmitter_id_to_phy_instance(enc_init_data->transmitter);

@@ -757,7 +754,8 @@ static struct link_encoder *dce60_link_encoder_create(
				     &link_enc_feature,
				     &link_enc_regs[link_regs_id],
				     &link_enc_aux_regs[enc_init_data->channel - 1],
				      &link_enc_hpd_regs[enc_init_data->hpd_source]);
				     enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs) ?
				     NULL : &link_enc_hpd_regs[enc_init_data->hpd_source]);
	return &enc110->base;
}

Loading