diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-03-28 14:13:52 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-08-18 06:27:13 -0400 |
commit | 627563d1696b8978b550ed192acc1bc8fc461da5 (patch) | |
tree | 2285f18e4cb8ecbfdffc4307ecef0f064c128922 | |
parent | 9203dd016a5d8ffb2eb6acdca60cd0b5dfe38c2b (diff) |
drm/edid: add function to help find SADs
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: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | include/drm/drm_edid.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 799050198323..53c53c459b15 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) | |||
348 | } | 348 | } |
349 | 349 | ||
350 | /** | 350 | /** |
351 | * drm_eld_sad - Get ELD SAD structures. | ||
352 | * @eld: pointer to an eld memory structure with sad_count set | ||
353 | */ | ||
354 | static inline const uint8_t *drm_eld_sad(const uint8_t *eld) | ||
355 | { | ||
356 | unsigned int ver, mnl; | ||
357 | |||
358 | ver = (eld[DRM_ELD_VER] & DRM_ELD_VER_MASK) >> DRM_ELD_VER_SHIFT; | ||
359 | if (ver != 2 && ver != 31) | ||
360 | return NULL; | ||
361 | |||
362 | mnl = drm_eld_mnl(eld); | ||
363 | if (mnl > 16) | ||
364 | return NULL; | ||
365 | |||
366 | return eld + DRM_ELD_CEA_SAD(mnl, 0); | ||
367 | } | ||
368 | |||
369 | /** | ||
351 | * drm_eld_sad_count - Get ELD SAD count. | 370 | * drm_eld_sad_count - Get ELD SAD count. |
352 | * @eld: pointer to an eld memory structure with sad_count set | 371 | * @eld: pointer to an eld memory structure with sad_count set |
353 | */ | 372 | */ |