xref: /openbmc/qemu/hw/vfio/vfio-display.h (revision 090c9641882da217e40936c98742749e4cc94130)
1aa173cb2SCédric Le Goater /*
2aa173cb2SCédric Le Goater  * VFIO display
3aa173cb2SCédric Le Goater  *
4aa173cb2SCédric Le Goater  * Copyright Red Hat, Inc. 2025
5aa173cb2SCédric Le Goater  *
6aa173cb2SCédric Le Goater  * SPDX-License-Identifier: GPL-2.0-or-later
7aa173cb2SCédric Le Goater  */
8aa173cb2SCédric Le Goater 
9aa173cb2SCédric Le Goater #ifndef HW_VFIO_VFIO_DISPLAY_H
10aa173cb2SCédric Le Goater #define HW_VFIO_VFIO_DISPLAY_H
11aa173cb2SCédric Le Goater 
12aa173cb2SCédric Le Goater #include "ui/console.h"
13aa173cb2SCédric Le Goater #include "hw/display/ramfb.h"
14*499e53ccSCédric Le Goater #include "hw/vfio/vfio-region.h"
15aa173cb2SCédric Le Goater 
16aa173cb2SCédric Le Goater typedef struct VFIODMABuf {
17aa173cb2SCédric Le Goater     QemuDmaBuf *buf;
18aa173cb2SCédric Le Goater     uint32_t pos_x, pos_y, pos_updates;
19aa173cb2SCédric Le Goater     uint32_t hot_x, hot_y, hot_updates;
20aa173cb2SCédric Le Goater     int dmabuf_id;
21aa173cb2SCédric Le Goater     QTAILQ_ENTRY(VFIODMABuf) next;
22aa173cb2SCédric Le Goater } VFIODMABuf;
23aa173cb2SCédric Le Goater 
24aa173cb2SCédric Le Goater typedef struct VFIODisplay {
25aa173cb2SCédric Le Goater     QemuConsole *con;
26aa173cb2SCédric Le Goater     RAMFBState *ramfb;
27aa173cb2SCédric Le Goater     struct vfio_region_info *edid_info;
28aa173cb2SCédric Le Goater     struct vfio_region_gfx_edid *edid_regs;
29aa173cb2SCédric Le Goater     uint8_t *edid_blob;
30aa173cb2SCédric Le Goater     QEMUTimer *edid_link_timer;
31aa173cb2SCédric Le Goater     struct {
32aa173cb2SCédric Le Goater         VFIORegion buffer;
33aa173cb2SCédric Le Goater         DisplaySurface *surface;
34aa173cb2SCédric Le Goater     } region;
35aa173cb2SCédric Le Goater     struct {
36aa173cb2SCédric Le Goater         QTAILQ_HEAD(, VFIODMABuf) bufs;
37aa173cb2SCédric Le Goater         VFIODMABuf *primary;
38aa173cb2SCédric Le Goater         VFIODMABuf *cursor;
39aa173cb2SCédric Le Goater     } dmabuf;
40aa173cb2SCédric Le Goater } VFIODisplay;
41aa173cb2SCédric Le Goater 
42aa173cb2SCédric Le Goater #endif /* HW_VFIO_VFIO_DISPLAY_H */
43