1 #include "qemu-common.h"
8 #include "ui/qemu-spice.h"
9 #include "ui/spice-display.h"
14 QXL_MODE_COMPAT, /* spice 0.4.x */
18 #define QXL_UNDEFINED_IO UINT32_MAX
20 typedef struct PCIQXLDevice {
22 SimpleSpiceDisplay ssd;
35 uint32_t current_async;
44 } guest_slots[NUM_MEMSLOTS];
46 struct guest_primary {
47 QXLSurfaceCreate surface;
53 uint8_t *data, *flipped;
57 QXLPHYSICAL cmds[NUM_SURFACES];
61 QXLPHYSICAL guest_cursor;
65 /* thread signaling */
72 uint32_t num_free_res;
73 QXLReleaseInfo *last_release;
74 uint32_t last_release_offset;
86 MemoryRegion vram_bar;
92 #define PANIC_ON(x) if ((x)) { \
93 printf("%s: PANIC %s failed\n", __FUNCTION__, #x); \
97 #define dprint(_qxl, _level, _fmt, ...) \
99 if (_qxl->debug >= _level) { \
100 fprintf(stderr, "qxl-%d: ", _qxl->id); \
101 fprintf(stderr, _fmt, ## __VA_ARGS__); \
105 #if SPICE_INTERFACE_QXL_MINOR >= 1
106 #define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V10
108 #define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V06
112 void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id);
113 void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg, ...);
115 void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t surface_id,
116 struct QXLRect *area, struct QXLRect *dirty_rects,
117 uint32_t num_dirty_rects,
118 uint32_t clear_dirty_region,
120 void qxl_spice_loadvm_commands(PCIQXLDevice *qxl, struct QXLCommandExt *ext,
122 void qxl_spice_oom(PCIQXLDevice *qxl);
123 void qxl_spice_reset_memslots(PCIQXLDevice *qxl);
124 void qxl_spice_reset_image_cache(PCIQXLDevice *qxl);
125 void qxl_spice_reset_cursor(PCIQXLDevice *qxl);
128 void qxl_log_cmd_cursor(PCIQXLDevice *qxl, QXLCursorCmd *cmd, int group_id);
129 void qxl_log_command(PCIQXLDevice *qxl, const char *ring, QXLCommandExt *ext);
132 void qxl_render_resize(PCIQXLDevice *qxl);
133 void qxl_render_update(PCIQXLDevice *qxl);
134 void qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt *ext);
135 #if SPICE_INTERFACE_QXL_MINOR >= 1
136 void qxl_spice_update_area_async(PCIQXLDevice *qxl, uint32_t surface_id,
137 struct QXLRect *area,
138 uint32_t clear_dirty_region,