1 #include "qemu-common.h"
7 #include "qemu-thread.h"
9 #include "ui/qemu-spice.h"
10 #include "ui/spice-display.h"
15 QXL_MODE_COMPAT
, /* spice 0.4.x */
19 #define QXL_UNDEFINED_IO UINT32_MAX
21 typedef struct PCIQXLDevice
{
23 SimpleSpiceDisplay ssd
;
36 uint32_t current_async
;
45 } guest_slots
[NUM_MEMSLOTS
];
47 struct guest_primary
{
48 QXLSurfaceCreate surface
;
55 uint8_t *data
, *flipped
;
59 QXLPHYSICAL cmds
[NUM_SURFACES
];
63 QXLPHYSICAL guest_cursor
;
67 /* thread signaling */
74 uint32_t num_free_res
;
75 QXLReleaseInfo
*last_release
;
76 uint32_t last_release_offset
;
88 MemoryRegion vram_bar
;
93 /* user-friendly properties (in megabytes) */
95 uint32_t vram_size_mb
;
98 #define PANIC_ON(x) if ((x)) { \
99 printf("%s: PANIC %s failed\n", __FUNCTION__, #x); \
103 #define dprint(_qxl, _level, _fmt, ...) \
105 if (_qxl->debug >= _level) { \
106 fprintf(stderr, "qxl-%d: ", _qxl->id); \
107 fprintf(stderr, _fmt, ## __VA_ARGS__); \
111 #if SPICE_INTERFACE_QXL_MINOR >= 1
112 #define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V10
114 #define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V06
118 void *qxl_phys2virt(PCIQXLDevice
*qxl
, QXLPHYSICAL phys
, int group_id
);
119 void qxl_guest_bug(PCIQXLDevice
*qxl
, const char *msg
, ...);
121 void qxl_spice_update_area(PCIQXLDevice
*qxl
, uint32_t surface_id
,
122 struct QXLRect
*area
, struct QXLRect
*dirty_rects
,
123 uint32_t num_dirty_rects
,
124 uint32_t clear_dirty_region
,
126 void qxl_spice_loadvm_commands(PCIQXLDevice
*qxl
, struct QXLCommandExt
*ext
,
128 void qxl_spice_oom(PCIQXLDevice
*qxl
);
129 void qxl_spice_reset_memslots(PCIQXLDevice
*qxl
);
130 void qxl_spice_reset_image_cache(PCIQXLDevice
*qxl
);
131 void qxl_spice_reset_cursor(PCIQXLDevice
*qxl
);
134 void qxl_log_cmd_cursor(PCIQXLDevice
*qxl
, QXLCursorCmd
*cmd
, int group_id
);
135 void qxl_log_command(PCIQXLDevice
*qxl
, const char *ring
, QXLCommandExt
*ext
);
138 void qxl_render_resize(PCIQXLDevice
*qxl
);
139 void qxl_render_update(PCIQXLDevice
*qxl
);
140 void qxl_render_cursor(PCIQXLDevice
*qxl
, QXLCommandExt
*ext
);
141 #if SPICE_INTERFACE_QXL_MINOR >= 1
142 void qxl_spice_update_area_async(PCIQXLDevice
*qxl
, uint32_t surface_id
,
143 struct QXLRect
*area
,
144 uint32_t clear_dirty_region
,