Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+19
+19
include/drm/drm_edid.h
··· 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 370 * drm_eld_sad_count - Get ELD SAD count. 352 371 * @eld: pointer to an eld memory structure with sad_count set 353 372 */