| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#if SD_BOOT |
| 5 |
# include "efi-string.h" |
| 6 |
# include "util.h" |
| 7 |
#else |
| 8 |
# include <stddef.h> |
| 9 |
# include <stdint.h> |
| 10 |
# include <uchar.h> |
| 11 |
#endif |
| 12 |
|
| 13 |
#include "macro.h" |
| 14 |
|
| 15 |
/* EDID structure, version 1.4 */ |
| 16 |
typedef struct EdidHeader { |
| 17 |
uint8_t pattern[8]; /* fixed pattern */ |
| 18 |
uint16_t manufacturer_id; /* big-endian 3-letter code */ |
| 19 |
uint16_t manufacturer_product_code; /* little-endian */ |
| 20 |
uint32_t serial_number; /* little-endian */ |
| 21 |
uint8_t week_of_manufacture; /* week or model year flag (0xFF) */ |
| 22 |
uint8_t year_of_manufacture; /* year or model if flag is set (0 is 1990) */ |
| 23 |
uint8_t edid_version; /* 0x01 for 1.3 and 1.4 */ |
| 24 |
uint8_t edid_revision; /* 0x03 for 1.3, 0x04 for 1.4 */ |
| 25 |
} _packed_ EdidHeader; |
| 26 |
|
| 27 |
int edid_parse_blob(const void *blob, size_t blob_size, EdidHeader *ret_header); |
| 28 |
int edid_get_panel_id(const EdidHeader *edid_header, char16_t ret_panel[static 8]); |