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

Commit 41f0abea authored by Claudio Suarez's avatar Claudio Suarez Committed by Greg Kroah-Hartman
Browse files

drm/amdgpu: update drm_display_info correctly when the edid is read



[ Upstream commit 20543be93ca45968f344261c1a997177e51bd7e1 ]

drm_display_info is updated by drm_get_edid() or
drm_connector_update_edid_property(). In the amdgpu driver it is almost
always updated when the edid is read in amdgpu_connector_get_edid(),
but not always.  Change amdgpu_connector_get_edid() and
amdgpu_connector_free_edid() to keep drm_display_info updated.

Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarClaudio Suarez <cssk@net-c.es>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 602ad43c3cd8 ("drm/amdgpu: Partially revert "drm/amdgpu: update drm_display_info correctly when the edid is read"")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 787138e4
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -316,8 +316,10 @@ static void amdgpu_connector_get_edid(struct drm_connector *connector)
	if (!amdgpu_connector->edid) {
		/* some laptops provide a hardcoded edid in rom for LCDs */
		if (((connector->connector_type == DRM_MODE_CONNECTOR_LVDS) ||
		     (connector->connector_type == DRM_MODE_CONNECTOR_eDP)))
		     (connector->connector_type == DRM_MODE_CONNECTOR_eDP))) {
			amdgpu_connector->edid = amdgpu_connector_get_hardcoded_edid(adev);
			drm_connector_update_edid_property(connector, amdgpu_connector->edid);
		}
	}
}

@@ -327,6 +329,7 @@ static void amdgpu_connector_free_edid(struct drm_connector *connector)

	kfree(amdgpu_connector->edid);
	amdgpu_connector->edid = NULL;
	drm_connector_update_edid_property(connector, NULL);
}

static int amdgpu_connector_ddc_get_modes(struct drm_connector *connector)
+1 −2
Original line number Diff line number Diff line
@@ -1436,13 +1436,12 @@ amdgpu_dm_update_connector_after_detect(struct amdgpu_dm_connector *aconnector)
			aconnector->edid =
				(struct edid *)sink->dc_edid.raw_edid;

			drm_connector_update_edid_property(connector,
							   aconnector->edid);
			if (aconnector->dc_link->aux_mode)
				drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,
						    aconnector->edid);
		}

		drm_connector_update_edid_property(connector, aconnector->edid);
		amdgpu_dm_update_freesync_caps(connector, aconnector->edid);

	} else {