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

Commit c21c8c44 authored by Padmanabhan Komanduru's avatar Padmanabhan Komanduru Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm: add a helper function to return the EDID checksum



Display Port Link Compliance tests expect to return the checksum
of the last block of EDID data. Add a function that returns this
checksum.

Change-Id: I6f316967eecd71f7344a0bb142c641b4ccf6c35f
Signed-off-by: default avatarPadmanabhan Komanduru <pkomandu@codeaurora.org>
parent ef656faf
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -605,6 +605,30 @@ u32 sde_get_sink_bpc(void *input)
	}
}

u8 sde_get_edid_checksum(void *input)
{
	struct sde_edid_ctrl *edid_ctrl = (struct sde_edid_ctrl *)(input);
	struct edid *edid = NULL, *last_block = NULL;
	u8 *raw_edid = NULL;

	if (!edid_ctrl || !edid_ctrl->edid) {
		SDE_ERROR("invalid edid input\n");
		return 0;
	}

	edid = edid_ctrl->edid;

	raw_edid = (u8 *)edid;
	raw_edid += (edid->extensions * EDID_LENGTH);
	last_block = (struct edid *)raw_edid;

	if (last_block)
		return last_block->checksum;

	SDE_ERROR("Invalid block, no checksum\n");
	return 0;
}

bool sde_detect_hdmi_monitor(void *input)
{
	struct sde_edid_ctrl *edid_ctrl = (struct sde_edid_ctrl *)(input);
+8 −0
Original line number Diff line number Diff line
@@ -145,6 +145,14 @@ bool sde_detect_hdmi_monitor(void *edid_ctrl);
 */
u32 sde_get_sink_bpc(void *edid_ctrl);

/**
 * sde_get_edid_checksum() - return the checksum of last block of EDID.
 * @input:     Handle to the edid_ctrl structure.
 *
 * Return: checksum of the last EDID block.
 */
u8 sde_get_edid_checksum(void *input);

/**
 * _sde_edid_update_modes() - populate EDID modes.
 * @edid_ctrl:     Handle to the edid_ctrl structure.