}
for (;;) {
+ /* The first section we encounter is the base section */
+ bool base_section = !iter->section;
+
iter->section = drm_find_displayid_extension(iter->drm_edid,
&iter->length,
&iter->idx,
return NULL;
}
+ /* Save the structure version and primary use case. */
+ if (base_section) {
+ const struct displayid_header *base;
+
+ base = displayid_get_header(iter->section, iter->length,
+ iter->idx);
+ if (!IS_ERR(base)) {
+ iter->version = base->rev;
+ iter->primary_use = base->prod_id;
+ }
+ }
+
iter->idx += sizeof(struct displayid_header);
block = displayid_iter_block(iter);
{
memset(iter, 0, sizeof(*iter));
}
+
+/* DisplayID Structure Version/Revision from the Base Section. */
+u8 displayid_version(const struct displayid_iter *iter)
+{
+ return iter->version;
+}
+
+/*
+ * DisplayID Primary Use Case (2.0+) or Product Type Identifier (1.0-1.3) from
+ * the Base Section.
+ */
+u8 displayid_primary_use(const struct displayid_iter *iter)
+{
+ return iter->primary_use;
+}
u8 mso;
} __packed;
-/* DisplayID iteration */
+/*
+ * DisplayID iteration.
+ *
+ * Do not access directly, this is private.
+ */
struct displayid_iter {
const struct drm_edid *drm_edid;
int length;
int idx;
int ext_index;
+
+ u8 version;
+ u8 primary_use;
};
void displayid_iter_edid_begin(const struct drm_edid *drm_edid,
while (((__block) = __displayid_iter_next(__iter)))
void displayid_iter_end(struct displayid_iter *iter);
+u8 displayid_version(const struct displayid_iter *iter);
+u8 displayid_primary_use(const struct displayid_iter *iter);
+
#endif