diff options
Diffstat (limited to 'include/drm/drm_displayid.h')
-rw-r--r-- | include/drm/drm_displayid.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/include/drm/drm_displayid.h b/include/drm/drm_displayid.h index 77941efb5426..ec64d141f578 100644 --- a/include/drm/drm_displayid.h +++ b/include/drm/drm_displayid.h @@ -22,6 +22,10 @@ #ifndef DRM_DISPLAYID_H #define DRM_DISPLAYID_H +#include <linux/types.h> + +struct edid; + #define DATA_BLOCK_PRODUCT_ID 0x00 #define DATA_BLOCK_DISPLAY_PARAMETERS 0x01 #define DATA_BLOCK_COLOR_CHARACTERISTICS 0x02 @@ -52,7 +56,7 @@ #define PRODUCT_TYPE_REPEATER 5 #define PRODUCT_TYPE_DIRECT_DRIVE 6 -struct displayid_hdr { +struct displayid_header { u8 rev; u8 bytes; u8 prod_id; @@ -92,12 +96,22 @@ struct displayid_detailed_timing_block { struct displayid_detailed_timings_1 timings[]; }; -#define for_each_displayid_db(displayid, block, idx, length) \ - for ((block) = (struct displayid_block *)&(displayid)[idx]; \ - (idx) + sizeof(struct displayid_block) <= (length) && \ - (idx) + sizeof(struct displayid_block) + (block)->num_bytes <= (length) && \ - (block)->num_bytes > 0; \ - (idx) += sizeof(struct displayid_block) + (block)->num_bytes, \ - (block) = (struct displayid_block *)&(displayid)[idx]) +/* DisplayID iteration */ +struct displayid_iter { + const struct edid *edid; + + const u8 *section; + int length; + int idx; + int ext_index; +}; + +void displayid_iter_edid_begin(const struct edid *edid, + struct displayid_iter *iter); +const struct displayid_block * +__displayid_iter_next(struct displayid_iter *iter); +#define displayid_iter_for_each(__block, __iter) \ + while (((__block) = __displayid_iter_next(__iter))) +void displayid_iter_end(struct displayid_iter *iter); #endif |