diff mbox

[v12,1/6] drm/edid: add function to help find SADs

Message ID 61f4eab5f21cc5eea1b74858852c4569dd839ac8.1431083916.git.moinejf@free.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Jean-Francois Moine May 8, 2015, 7:39 a.m. UTC
From: Russell King - ARM Linux <linux@arm.linux.org.uk>

Add a function to find the start of the SADs in the ELD.  This
complements the helper to retrieve the SAD count.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
---
 include/drm/drm_edid.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Russell King - ARM Linux May 8, 2015, 11:33 a.m. UTC | #1
On Fri, May 08, 2015 at 09:39:33AM +0200, Jean-Francois Moine wrote:
> From: Russell King - ARM Linux <linux@arm.linux.org.uk>
> 
> Add a function to find the start of the SADs in the ELD.  This
> complements the helper to retrieve the SAD count.
> 
> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>

NAK.  Where's my sign-off gone?  This is unacceptable behaviour.
diff mbox

Patch

diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 7990501..53c53c4 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -348,6 +348,25 @@  static inline int drm_eld_mnl(const uint8_t *eld)
 }
 
 /**
+ * drm_eld_sad - Get ELD SAD structures.
+ * @eld: pointer to an eld memory structure with sad_count set
+ */
+static inline const uint8_t *drm_eld_sad(const uint8_t *eld)
+{
+	unsigned int ver, mnl;
+
+	ver = (eld[DRM_ELD_VER] & DRM_ELD_VER_MASK) >> DRM_ELD_VER_SHIFT;
+	if (ver != 2 && ver != 31)
+		return NULL;
+
+	mnl = drm_eld_mnl(eld);
+	if (mnl > 16)
+		return NULL;
+
+	return eld + DRM_ELD_CEA_SAD(mnl, 0);
+}
+
+/**
  * drm_eld_sad_count - Get ELD SAD count.
  * @eld: pointer to an eld memory structure with sad_count set
  */