#include "ui/console.h"
#include "sysemu/sysemu.h"
+#if defined(CONFIG_OPENGL_DMABUF)
+# if SPICE_SERVER_VERSION >= 0x000d01 /* release 0.13.1 */
+# define HAVE_SPICE_GL 1
+# include "ui/egl-helpers.h"
+# include "ui/egl-context.h"
+# endif
+#endif
+
#define NUM_MEMSLOTS 8
#define MEMSLOT_GENERATION_BITS 8
#define MEMSLOT_SLOT_BITS 8
QXL_COOKIE_TYPE_IO,
QXL_COOKIE_TYPE_RENDER_UPDATE_AREA,
QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG,
+ QXL_COOKIE_TYPE_GL_DRAW_DONE,
};
typedef struct QXLCookie {
QXLRect area;
int redraw;
} render;
+ void *data;
} u;
} QXLCookie;
typedef struct SimpleSpiceDisplay SimpleSpiceDisplay;
typedef struct SimpleSpiceUpdate SimpleSpiceUpdate;
+typedef struct SimpleSpiceCursor SimpleSpiceCursor;
struct SimpleSpiceDisplay {
- DisplayState *ds;
+ DisplaySurface *ds;
+ DisplayChangeListener dcl;
void *buf;
int bufsize;
QXLWorker *worker;
*/
QemuMutex lock;
QTAILQ_HEAD(, SimpleSpiceUpdate) updates;
+
+ /* cursor (without qxl): displaychangelistener -> spice server */
+ SimpleSpiceCursor *ptr_define;
+ SimpleSpiceCursor *ptr_move;
+ int16_t ptr_x, ptr_y;
+ int16_t hot_x, hot_y;
+
+ /* cursor (with qxl): qxl local renderer -> displaychangelistener */
QEMUCursor *cursor;
int mouse_x, mouse_y;
+ QEMUBH *cursor_bh;
+
+#ifdef HAVE_SPICE_GL
+ /* opengl rendering */
+ QEMUBH *gl_unblock_bh;
+ QEMUTimer *gl_unblock_timer;
+ ConsoleGLState *gls;
+ int gl_updates;
+ bool have_scanout;
+ bool have_surface;
+#endif
};
struct SimpleSpiceUpdate {
QTAILQ_ENTRY(SimpleSpiceUpdate) next;
};
+struct SimpleSpiceCursor {
+ QXLCursorCmd cmd;
+ QXLCommandExt ext;
+ QXLCursor cursor;
+};
+
int qemu_spice_rect_is_empty(const QXLRect* r);
void qemu_spice_rect_union(QXLRect *dest, const QXLRect *r);
void qemu_spice_create_host_memslot(SimpleSpiceDisplay *ssd);
void qemu_spice_create_host_primary(SimpleSpiceDisplay *ssd);
void qemu_spice_destroy_host_primary(SimpleSpiceDisplay *ssd);
-void qemu_spice_vm_change_state_handler(void *opaque, int running,
- RunState state);
-void qemu_spice_display_init_common(SimpleSpiceDisplay *ssd, DisplayState *ds);
+void qemu_spice_display_init_common(SimpleSpiceDisplay *ssd);
void qemu_spice_display_update(SimpleSpiceDisplay *ssd,
int x, int y, int w, int h);
-void qemu_spice_display_resize(SimpleSpiceDisplay *ssd);
+void qemu_spice_display_switch(SimpleSpiceDisplay *ssd,
+ DisplaySurface *surface);
void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd);
-void qemu_spice_cursor_refresh_unlocked(SimpleSpiceDisplay *ssd);
+void qemu_spice_cursor_refresh_bh(void *opaque);
void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot,
qxl_async_io async);