Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33c2de6b authored by Alex Deucher's avatar Alex Deucher Committed by Sasha Levin
Browse files

drm/radeon: retry dcpd fetch

[ Upstream commit 0f28d1281b6c54cc98746ae61e44e7f540758ed4 ]

Retry the dpcd fetch several times.  Some eDP panels
fail several times before the fetch is successful.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=73530



Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent b772265d
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -405,11 +405,12 @@ bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector)
{
	struct radeon_connector_atom_dig *dig_connector = radeon_connector->con_priv;
	u8 msg[DP_DPCD_SIZE];
	int ret;
	int ret, i;

	for (i = 0; i < 7; i++) {
		ret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_DPCD_REV, msg,
				       DP_DPCD_SIZE);
	if (ret > 0) {
		if (ret == DP_DPCD_SIZE) {
			memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE);

			DRM_DEBUG_KMS("DPCD: %*ph\n", (int)sizeof(dig_connector->dpcd),
@@ -419,6 +420,7 @@ bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector)

			return true;
		}
	}
	dig_connector->dpcd[0] = 0;
	return false;
}