mirror of
https://gitlab.freedesktop.org/emersion/libdisplay-info.git
synced 2024-11-16 19:48:30 +01:00
7a31791343
Signed-off-by: Simon Ser <contact@emersion.fr>
60 lines
1.3 KiB
C
60 lines
1.3 KiB
C
#ifndef EDID_H
|
|
#define EDID_H
|
|
|
|
/**
|
|
* Private header for the low-level EDID API.
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <libdisplay-info/edid.h>
|
|
|
|
/**
|
|
* The maximum number of EDID blocks (including the base block), defined in
|
|
* section 2.2.1.
|
|
*/
|
|
#define EDID_MAX_BLOCK_COUNT 256
|
|
/**
|
|
* The number of EDID byte descriptors, defined in section 3.10.
|
|
*/
|
|
#define EDID_BYTE_DESCRIPTOR_COUNT 4
|
|
|
|
struct di_edid {
|
|
struct di_edid_vendor_product vendor_product;
|
|
int version, revision;
|
|
/* NULL-terminated */
|
|
struct di_edid_display_descriptor *display_descriptors[EDID_BYTE_DESCRIPTOR_COUNT + 1];
|
|
size_t display_descriptors_len;
|
|
/* NULL-terminated, doesn't include the base block */
|
|
struct di_edid_ext *exts[EDID_MAX_BLOCK_COUNT];
|
|
size_t exts_len;
|
|
};
|
|
|
|
struct di_edid_display_descriptor {
|
|
enum di_edid_display_descriptor_tag tag;
|
|
/* Used for PRODUCT_SERIAL, DATA_STRING and PRODUCT_NAME,
|
|
* zero-terminated */
|
|
char str[14];
|
|
};
|
|
|
|
struct di_edid_ext {
|
|
enum di_edid_ext_tag tag;
|
|
};
|
|
|
|
/**
|
|
* Create an EDID data structure.
|
|
*
|
|
* Callers do not need to keep the provided data pointer valid after calling
|
|
* this function. Callers should destroy the returned pointer via
|
|
* di_edid_destroy().
|
|
*/
|
|
struct di_edid *
|
|
di_edid_parse(const void *data, size_t size);
|
|
|
|
/**
|
|
* Destroy an EDID data structure.
|
|
*/
|
|
void
|
|
di_edid_destroy(struct di_edid *edid);
|
|
|
|
#endif
|