#include "qemu/osdep.h"
#include "ui/qemu-spice.h"
#include "qemu/timer.h"
+#include "qemu/lockable.h"
+#include "qemu/main-loop.h"
#include "qemu/option.h"
#include "qemu/queue.h"
#include "ui/console.h"
-#include "sysemu/sysemu.h"
#include "trace.h"
#include "ui/spice-display.h"
{
graphic_hw_update(ssd->dcl.con);
- qemu_mutex_lock(&ssd->lock);
- if (QTAILQ_EMPTY(&ssd->updates) && ssd->ds) {
- qemu_spice_create_update(ssd);
- ssd->notify++;
+ WITH_QEMU_LOCK_GUARD(&ssd->lock) {
+ if (QTAILQ_EMPTY(&ssd->updates) && ssd->ds) {
+ qemu_spice_create_update(ssd);
+ ssd->notify++;
+ }
}
- qemu_mutex_unlock(&ssd->lock);
trace_qemu_spice_display_refresh(ssd->qxl.id, ssd->notify);
if (ssd->notify) {
SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl);
int ret;
- qemu_mutex_lock(&ssd->lock);
+ QEMU_LOCK_GUARD(&ssd->lock);
if (ssd->ptr_define) {
*ext = ssd->ptr_define->ext;
ssd->ptr_define = NULL;
} else {
ret = false;
}
- qemu_mutex_unlock(&ssd->lock);
return ret;
}
if (ssd->ds) {
surface_gl_create_texture(ssd->gls, ssd->ds);
fd = egl_get_fd_for_texture(ssd->ds->texture,
- &stride, &fourcc);
+ &stride, &fourcc,
+ NULL);
if (fd < 0) {
surface_gl_destroy_texture(ssd->gls, ssd->ds);
return;
int fd = -1;
assert(tex_id);
- fd = egl_get_fd_for_texture(tex_id, &stride, &fourcc);
+ fd = egl_get_fd_for_texture(tex_id, &stride, &fourcc, NULL);
if (fd < 0) {
fprintf(stderr, "%s: failed to get fd for texture\n", __func__);
return;
egl_fb_setup_new_tex(&ssd->blit_fb,
dmabuf->width, dmabuf->height);
fd = egl_get_fd_for_texture(ssd->blit_fb.texture,
- &stride, &fourcc);
+ &stride, &fourcc, NULL);
spice_qxl_gl_scanout(&ssd->qxl, fd,
dmabuf->width, dmabuf->height,
stride, fourcc, false);
ssd->qxl.base.sif = &dpy_interface.base;
qemu_spice_add_display_interface(&ssd->qxl, con);
+
+#if SPICE_SERVER_VERSION >= 0x000e02 /* release 0.14.2 */
+ char device_address[256] = "";
+ if (qemu_spice_fill_device_address(con, device_address, 256)) {
+ spice_qxl_set_device_info(&ssd->qxl,
+ device_address,
+ qemu_console_get_head(con),
+ 1);
+ }
+#endif
+
qemu_spice_create_host_memslot(ssd);
register_displaychangelistener(&ssd->dcl);