]>
git.proxmox.com Git - qemu.git/blob - hw/qxl.h
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 #define QXL_NUM_DIRTY_RECTS 64
23 typedef struct PCIQXLDevice
{
25 SimpleSpiceDisplay ssd
;
38 uint32_t current_async
;
47 } guest_slots
[NUM_MEMSLOTS
];
49 struct guest_primary
{
50 QXLSurfaceCreate surface
;
61 QXLPHYSICAL cmds
[NUM_SURFACES
];
65 QXLPHYSICAL guest_cursor
;
69 /* thread signaling */
76 uint32_t num_free_res
;
77 QXLReleaseInfo
*last_release
;
78 uint32_t last_release_offset
;
90 MemoryRegion vram_bar
;
95 /* user-friendly properties (in megabytes) */
97 uint32_t vram_size_mb
;
99 /* qxl_render_update state */
100 int render_update_cookie_num
;
102 QXLRect dirty
[QXL_NUM_DIRTY_RECTS
];
103 QEMUBH
*update_area_bh
;
106 #define PANIC_ON(x) if ((x)) { \
107 printf("%s: PANIC %s failed\n", __FUNCTION__, #x); \
111 #define dprint(_qxl, _level, _fmt, ...) \
113 if (_qxl->debug >= _level) { \
114 fprintf(stderr, "qxl-%d: ", _qxl->id); \
115 fprintf(stderr, _fmt, ## __VA_ARGS__); \
119 #define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V10
122 void *qxl_phys2virt(PCIQXLDevice
*qxl
, QXLPHYSICAL phys
, int group_id
);
123 void qxl_guest_bug(PCIQXLDevice
*qxl
, const char *msg
, ...);
125 void qxl_spice_update_area(PCIQXLDevice
*qxl
, uint32_t surface_id
,
126 struct QXLRect
*area
, struct QXLRect
*dirty_rects
,
127 uint32_t num_dirty_rects
,
128 uint32_t clear_dirty_region
,
129 qxl_async_io async
, QXLCookie
*cookie
);
130 void qxl_spice_loadvm_commands(PCIQXLDevice
*qxl
, struct QXLCommandExt
*ext
,
132 void qxl_spice_oom(PCIQXLDevice
*qxl
);
133 void qxl_spice_reset_memslots(PCIQXLDevice
*qxl
);
134 void qxl_spice_reset_image_cache(PCIQXLDevice
*qxl
);
135 void qxl_spice_reset_cursor(PCIQXLDevice
*qxl
);
138 void qxl_log_cmd_cursor(PCIQXLDevice
*qxl
, QXLCursorCmd
*cmd
, int group_id
);
139 void qxl_log_command(PCIQXLDevice
*qxl
, const char *ring
, QXLCommandExt
*ext
);
142 void qxl_render_resize(PCIQXLDevice
*qxl
);
143 void qxl_render_update(PCIQXLDevice
*qxl
);
144 void qxl_render_cursor(PCIQXLDevice
*qxl
, QXLCommandExt
*ext
);
145 void qxl_render_update_area_done(PCIQXLDevice
*qxl
, QXLCookie
*cookie
);
146 void qxl_render_update_area_bh(void *opaque
);