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

Commit baa90756 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

drm/edid: add checksum to connector



Add checksum of an associated EDID block to the connector.
The calculated value of checksum may be useful in cases of
a corrupted EDID where the checksum value in 128th byte is
not correct and a correct value is needed by the client.
For example, DP 1.4a CTS 4.2.2.6 test needs the correct
EDID checksum to be updated to the TE (Test Equipment).

Change-Id: If1a2931be9103f45b5044d637362f34ce60a7ba0
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent e56fe938
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1566,6 +1566,9 @@ static void connector_bad_edid(struct drm_connector *connector,
			       u8 *edid, int num_blocks)
{
	int i;
	u32 csum = 0x100 | drm_edid_block_checksum(edid);

	connector->checksum = 0x100 - (csum - edid[EDID_LENGTH - 1]);

	if (connector->bad_edid_counter++ && !(drm_debug & DRM_UT_KMS))
		return;
@@ -1663,6 +1666,8 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
	u8 *edid, *new;
	struct edid *override;

	connector->checksum = 0;

	override = drm_get_override_edid(connector);
	if (override)
		return override;
+7 −0
Original line number Diff line number Diff line
@@ -1177,6 +1177,13 @@ struct drm_connector {
	 * Can find the panel which connected to drm_connector.
	 */
	struct drm_panel *panel;

	/**
	 * @checksum:
	 *
	 * The calculated checksum value of first 127 bytes of associated EDID.
	 */
	u8 checksum;
};

#define obj_to_connector(x) container_of(x, struct drm_connector, base)