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
;
94 #define PANIC_ON(x) if ((x)) { \
95 printf("%s: PANIC %s failed\n", __FUNCTION__, #x); \
99 #define dprint(_qxl, _level, _fmt, ...) \
101 if (_qxl->debug >= _level) { \
102 fprintf(stderr, "qxl-%d: ", _qxl->id); \
103 fprintf(stderr, _fmt, ## __VA_ARGS__); \
107 #if SPICE_INTERFACE_QXL_MINOR >= 1
108 #define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V10
110 #define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V06
114 void *qxl_phys2virt(PCIQXLDevice
*qxl
, QXLPHYSICAL phys
, int group_id
);
115 void qxl_guest_bug(PCIQXLDevice
*qxl
, const char *msg
, ...);
117 void qxl_spice_update_area(PCIQXLDevice
*qxl
, uint32_t surface_id
,
118 struct QXLRect
*area
, struct QXLRect
*dirty_rects
,
119 uint32_t num_dirty_rects
,
120 uint32_t clear_dirty_region
,
122 void qxl_spice_loadvm_commands(PCIQXLDevice
*qxl
, struct QXLCommandExt
*ext
,
124 void qxl_spice_oom(PCIQXLDevice
*qxl
);
125 void qxl_spice_reset_memslots(PCIQXLDevice
*qxl
);
126 void qxl_spice_reset_image_cache(PCIQXLDevice
*qxl
);
127 void qxl_spice_reset_cursor(PCIQXLDevice
*qxl
);
130 void qxl_log_cmd_cursor(PCIQXLDevice
*qxl
, QXLCursorCmd
*cmd
, int group_id
);
131 void qxl_log_command(PCIQXLDevice
*qxl
, const char *ring
, QXLCommandExt
*ext
);
134 void qxl_render_resize(PCIQXLDevice
*qxl
);
135 void qxl_render_update(PCIQXLDevice
*qxl
);
136 void qxl_render_cursor(PCIQXLDevice
*qxl
, QXLCommandExt
*ext
);
137 #if SPICE_INTERFACE_QXL_MINOR >= 1
138 void qxl_spice_update_area_async(PCIQXLDevice
*qxl
, uint32_t surface_id
,
139 struct QXLRect
*area
,
140 uint32_t clear_dirty_region
,