| 1 | #ifndef EDID_H |
| 2 | #define EDID_H |
| 3 | |
| 4 | #define EDID_NAME_MAX_LENGTH 12 |
| 5 | |
| 6 | typedef struct qemu_edid_info { |
| 7 | const char *vendor; /* http://www.uefi.org/pnp_id_list */ |
| 8 | const char *name; |
| 9 | const char *serial; |
| 10 | uint16_t width_mm; |
| 11 | uint16_t height_mm; |
| 12 | uint32_t prefx; |
| 13 | uint32_t prefy; |
| 14 | uint32_t maxx; |
| 15 | uint32_t maxy; |
| 16 | uint32_t refresh_rate; |
| 17 | } qemu_edid_info; |
| 18 | |
| 19 | void qemu_edid_generate(uint8_t *edid, size_t size, |
| 20 | qemu_edid_info *info); |
| 21 | size_t qemu_edid_size(uint8_t *edid); |
| 22 | void qemu_edid_region_io(MemoryRegion *region, Object *owner, |
| 23 | uint8_t *edid, size_t size); |
| 24 | |
| 25 | uint32_t qemu_edid_dpi_to_mm(uint32_t dpi, uint32_t res); |
| 26 | |
| 27 | #define DEFINE_EDID_PROPERTIES(_state, _edid_info) \ |
| 28 | DEFINE_PROP_UINT32("xres", _state, _edid_info.prefx, 0), \ |
| 29 | DEFINE_PROP_UINT32("yres", _state, _edid_info.prefy, 0), \ |
| 30 | DEFINE_PROP_UINT32("xmax", _state, _edid_info.maxx, 0), \ |
| 31 | DEFINE_PROP_UINT32("ymax", _state, _edid_info.maxy, 0), \ |
| 32 | DEFINE_PROP_UINT32("refresh_rate", _state, _edid_info.refresh_rate, 0) |
| 33 | |
| 34 | #endif /* EDID_H */ |