Lines Matching +full:mc +full:- +full:sid
19 #include "ui/qemu-spice.h"
20 #include "qemu/error-report.h"
23 #include "qemu/main-loop.h"
29 #include "ui/spice-display.h"
35 return r->top == r->bottom || r->left == r->right; in qemu_spice_rect_is_empty()
49 dest->top = MIN(dest->top, r->top); in qemu_spice_rect_union()
50 dest->left = MIN(dest->left, r->left); in qemu_spice_rect_union()
51 dest->bottom = MAX(dest->bottom, r->bottom); in qemu_spice_rect_union()
52 dest->right = MAX(dest->right, r->right); in qemu_spice_rect_union()
60 cookie->type = type; in qxl_cookie_new()
61 cookie->io = io; in qxl_cookie_new()
68 trace_qemu_spice_add_memslot(ssd->qxl.id, memslot->slot_id, in qemu_spice_add_memslot()
69 memslot->virt_start, memslot->virt_end, in qemu_spice_add_memslot()
73 spice_qxl_add_memslot_async(&ssd->qxl, memslot, in qemu_spice_add_memslot()
77 spice_qxl_add_memslot(&ssd->qxl, memslot); in qemu_spice_add_memslot()
81 void qemu_spice_del_memslot(SimpleSpiceDisplay *ssd, uint32_t gid, uint32_t sid) in qemu_spice_del_memslot() argument
83 trace_qemu_spice_del_memslot(ssd->qxl.id, gid, sid); in qemu_spice_del_memslot()
84 spice_qxl_del_memslot(&ssd->qxl, gid, sid); in qemu_spice_del_memslot()
91 trace_qemu_spice_create_primary_surface(ssd->qxl.id, id, surface, async); in qemu_spice_create_primary_surface()
93 spice_qxl_create_primary_surface_async(&ssd->qxl, id, surface, in qemu_spice_create_primary_surface()
97 spice_qxl_create_primary_surface(&ssd->qxl, id, surface); in qemu_spice_create_primary_surface()
104 trace_qemu_spice_destroy_primary_surface(ssd->qxl.id, id, async); in qemu_spice_destroy_primary_surface()
106 spice_qxl_destroy_primary_surface_async(&ssd->qxl, id, in qemu_spice_destroy_primary_surface()
110 spice_qxl_destroy_primary_surface(&ssd->qxl, id); in qemu_spice_destroy_primary_surface()
116 trace_qemu_spice_wakeup(ssd->qxl.id); in qemu_spice_wakeup()
117 spice_qxl_wakeup(&ssd->qxl); in qemu_spice_wakeup()
132 rect->left, rect->right, in qemu_spice_create_one_update()
133 rect->top, rect->bottom); in qemu_spice_create_one_update()
136 drawable = &update->drawable; in qemu_spice_create_one_update()
137 image = &update->image; in qemu_spice_create_one_update()
138 cmd = &update->ext.cmd; in qemu_spice_create_one_update()
140 bw = rect->right - rect->left; in qemu_spice_create_one_update()
141 bh = rect->bottom - rect->top; in qemu_spice_create_one_update()
142 update->bitmap = g_malloc(bw * bh * 4); in qemu_spice_create_one_update()
144 drawable->bbox = *rect; in qemu_spice_create_one_update()
145 drawable->clip.type = SPICE_CLIP_TYPE_NONE; in qemu_spice_create_one_update()
146 drawable->effect = QXL_EFFECT_OPAQUE; in qemu_spice_create_one_update()
147 drawable->release_info.id = (uintptr_t)(&update->ext); in qemu_spice_create_one_update()
148 drawable->type = QXL_DRAW_COPY; in qemu_spice_create_one_update()
149 drawable->surfaces_dest[0] = -1; in qemu_spice_create_one_update()
150 drawable->surfaces_dest[1] = -1; in qemu_spice_create_one_update()
151 drawable->surfaces_dest[2] = -1; in qemu_spice_create_one_update()
154 drawable->mm_time = time_space.tv_sec * 1000 in qemu_spice_create_one_update()
157 drawable->u.copy.rop_descriptor = SPICE_ROPD_OP_PUT; in qemu_spice_create_one_update()
158 drawable->u.copy.src_bitmap = (uintptr_t)image; in qemu_spice_create_one_update()
159 drawable->u.copy.src_area.right = bw; in qemu_spice_create_one_update()
160 drawable->u.copy.src_area.bottom = bh; in qemu_spice_create_one_update()
162 QXL_SET_IMAGE_ID(image, QXL_IMAGE_GROUP_DEVICE, ssd->unique++); in qemu_spice_create_one_update()
163 image->descriptor.type = SPICE_IMAGE_TYPE_BITMAP; in qemu_spice_create_one_update()
164 image->bitmap.flags = QXL_BITMAP_DIRECT | QXL_BITMAP_TOP_DOWN; in qemu_spice_create_one_update()
165 image->bitmap.stride = bw * 4; in qemu_spice_create_one_update()
166 image->descriptor.width = image->bitmap.x = bw; in qemu_spice_create_one_update()
167 image->descriptor.height = image->bitmap.y = bh; in qemu_spice_create_one_update()
168 image->bitmap.data = (uintptr_t)(update->bitmap); in qemu_spice_create_one_update()
169 image->bitmap.palette = 0; in qemu_spice_create_one_update()
170 image->bitmap.format = SPICE_BITMAP_FMT_32BIT; in qemu_spice_create_one_update()
173 (void *)update->bitmap, bw * 4); in qemu_spice_create_one_update()
174 pixman_image_composite(PIXMAN_OP_SRC, ssd->surface, NULL, ssd->mirror, in qemu_spice_create_one_update()
175 rect->left, rect->top, 0, 0, in qemu_spice_create_one_update()
176 rect->left, rect->top, bw, bh); in qemu_spice_create_one_update()
177 pixman_image_composite(PIXMAN_OP_SRC, ssd->mirror, NULL, dest, in qemu_spice_create_one_update()
178 rect->left, rect->top, 0, 0, in qemu_spice_create_one_update()
182 cmd->type = QXL_CMD_DRAW; in qemu_spice_create_one_update()
183 cmd->data = (uintptr_t)drawable; in qemu_spice_create_one_update()
185 QTAILQ_INSERT_TAIL(&ssd->updates, update, next); in qemu_spice_create_one_update()
191 int blocks = DIV_ROUND_UP(surface_width(ssd->ds), blksize); in qemu_spice_create_update()
194 int bpp = surface_bytes_per_pixel(ssd->ds); in qemu_spice_create_update()
197 if (qemu_spice_rect_is_empty(&ssd->dirty)) { in qemu_spice_create_update()
203 dirty_top[blk] = -1; in qemu_spice_create_update()
206 guest = surface_data(ssd->ds); in qemu_spice_create_update()
207 mirror = (void *)pixman_image_get_data(ssd->mirror); in qemu_spice_create_update()
208 for (y = ssd->dirty.top; y < ssd->dirty.bottom; y++) { in qemu_spice_create_update()
209 yoff1 = y * surface_stride(ssd->ds); in qemu_spice_create_update()
210 yoff2 = y * pixman_image_get_stride(ssd->mirror); in qemu_spice_create_update()
211 for (x = ssd->dirty.left; x < ssd->dirty.right; x += blksize) { in qemu_spice_create_update()
214 bw = MIN(blksize, ssd->dirty.right - x); in qemu_spice_create_update()
218 if (dirty_top[blk] != -1) { in qemu_spice_create_update()
226 dirty_top[blk] = -1; in qemu_spice_create_update()
229 if (dirty_top[blk] == -1) { in qemu_spice_create_update()
236 for (x = ssd->dirty.left; x < ssd->dirty.right; x += blksize) { in qemu_spice_create_update()
238 bw = MIN(blksize, ssd->dirty.right - x); in qemu_spice_create_update()
239 if (dirty_top[blk] != -1) { in qemu_spice_create_update()
242 .bottom = ssd->dirty.bottom, in qemu_spice_create_update()
247 dirty_top[blk] = -1; in qemu_spice_create_update()
251 memset(&ssd->dirty, 0, sizeof(ssd->dirty)); in qemu_spice_create_update()
259 size_t size = c ? c->width * c->height * 4 : 0; in qemu_spice_create_cursor_update()
266 ccmd = &update->cmd; in qemu_spice_create_cursor_update()
267 cursor = &update->cursor; in qemu_spice_create_cursor_update()
268 cmd = &update->ext.cmd; in qemu_spice_create_cursor_update()
271 ccmd->type = QXL_CURSOR_SET; in qemu_spice_create_cursor_update()
272 ccmd->u.set.position.x = ssd->ptr_x + ssd->hot_x; in qemu_spice_create_cursor_update()
273 ccmd->u.set.position.y = ssd->ptr_y + ssd->hot_y; in qemu_spice_create_cursor_update()
274 ccmd->u.set.visible = true; in qemu_spice_create_cursor_update()
275 ccmd->u.set.shape = (uintptr_t)cursor; in qemu_spice_create_cursor_update()
276 cursor->header.unique = ssd->unique++; in qemu_spice_create_cursor_update()
277 cursor->header.type = SPICE_CURSOR_TYPE_ALPHA; in qemu_spice_create_cursor_update()
278 cursor->header.width = c->width; in qemu_spice_create_cursor_update()
279 cursor->header.height = c->height; in qemu_spice_create_cursor_update()
280 cursor->header.hot_spot_x = c->hot_x; in qemu_spice_create_cursor_update()
281 cursor->header.hot_spot_y = c->hot_y; in qemu_spice_create_cursor_update()
282 cursor->data_size = size; in qemu_spice_create_cursor_update()
283 cursor->chunk.data_size = size; in qemu_spice_create_cursor_update()
284 memcpy(cursor->chunk.data, c->data, size); in qemu_spice_create_cursor_update()
286 ccmd->type = QXL_CURSOR_HIDE; in qemu_spice_create_cursor_update()
288 ccmd->type = QXL_CURSOR_MOVE; in qemu_spice_create_cursor_update()
289 ccmd->u.position.x = ssd->ptr_x + ssd->hot_x; in qemu_spice_create_cursor_update()
290 ccmd->u.position.y = ssd->ptr_y + ssd->hot_y; in qemu_spice_create_cursor_update()
292 ccmd->release_info.id = (uintptr_t)(&update->ext); in qemu_spice_create_cursor_update()
294 cmd->type = QXL_CMD_CURSOR; in qemu_spice_create_cursor_update()
295 cmd->data = (uintptr_t)ccmd; in qemu_spice_create_cursor_update()
304 * - g_free (underlying glibc free is re-entrant).
308 g_free(update->bitmap); in qemu_spice_destroy_update()
329 surface_size = (uint64_t) surface_width(ssd->ds) * in qemu_spice_create_host_primary()
330 surface_height(ssd->ds) * 4; in qemu_spice_create_host_primary()
333 if (ssd->bufsize < surface_size) { in qemu_spice_create_host_primary()
334 ssd->bufsize = surface_size; in qemu_spice_create_host_primary()
335 g_free(ssd->buf); in qemu_spice_create_host_primary()
336 ssd->buf = g_malloc(ssd->bufsize); in qemu_spice_create_host_primary()
340 surface.width = surface_width(ssd->ds); in qemu_spice_create_host_primary()
341 surface.height = surface_height(ssd->ds); in qemu_spice_create_host_primary()
342 surface.stride = -surface.width * 4; in qemu_spice_create_host_primary()
346 surface.mem = (uintptr_t)ssd->buf; in qemu_spice_create_host_primary()
359 qemu_mutex_init(&ssd->lock); in qemu_spice_display_init_common()
360 QTAILQ_INIT(&ssd->updates); in qemu_spice_display_init_common()
361 ssd->mouse_x = -1; in qemu_spice_display_init_common()
362 ssd->mouse_y = -1; in qemu_spice_display_init_common()
363 if (ssd->num_surfaces == 0) { in qemu_spice_display_init_common()
364 ssd->num_surfaces = 1024; in qemu_spice_display_init_common()
375 trace_qemu_spice_display_update(ssd->qxl.id, x, y, w, h); in qemu_spice_display_update()
381 if (qemu_spice_rect_is_empty(&ssd->dirty)) { in qemu_spice_display_update()
382 ssd->notify++; in qemu_spice_display_update()
384 qemu_spice_rect_union(&ssd->dirty, &update_area); in qemu_spice_display_update()
393 if (ssd->surface && in qemu_spice_display_switch()
394 surface_width(surface) == pixman_image_get_width(ssd->surface) && in qemu_spice_display_switch()
395 surface_height(surface) == pixman_image_get_height(ssd->surface) && in qemu_spice_display_switch()
396 surface_format(surface) == pixman_image_get_format(ssd->surface)) { in qemu_spice_display_switch()
397 /* no-resize fast path: just swap backing store */ in qemu_spice_display_switch()
398 trace_qemu_spice_display_surface(ssd->qxl.id, in qemu_spice_display_switch()
402 qemu_mutex_lock(&ssd->lock); in qemu_spice_display_switch()
403 ssd->ds = surface; in qemu_spice_display_switch()
404 pixman_image_unref(ssd->surface); in qemu_spice_display_switch()
405 ssd->surface = pixman_image_ref(ssd->ds->image); in qemu_spice_display_switch()
406 qemu_mutex_unlock(&ssd->lock); in qemu_spice_display_switch()
414 trace_qemu_spice_display_surface(ssd->qxl.id, in qemu_spice_display_switch()
419 memset(&ssd->dirty, 0, sizeof(ssd->dirty)); in qemu_spice_display_switch()
420 if (ssd->surface) { in qemu_spice_display_switch()
421 pixman_image_unref(ssd->surface); in qemu_spice_display_switch()
422 ssd->surface = NULL; in qemu_spice_display_switch()
423 pixman_image_unref(ssd->mirror); in qemu_spice_display_switch()
424 ssd->mirror = NULL; in qemu_spice_display_switch()
427 qemu_mutex_lock(&ssd->lock); in qemu_spice_display_switch()
428 need_destroy = (ssd->ds != NULL); in qemu_spice_display_switch()
429 ssd->ds = surface; in qemu_spice_display_switch()
430 while ((update = QTAILQ_FIRST(&ssd->updates)) != NULL) { in qemu_spice_display_switch()
431 QTAILQ_REMOVE(&ssd->updates, update, next); in qemu_spice_display_switch()
434 qemu_mutex_unlock(&ssd->lock); in qemu_spice_display_switch()
438 if (ssd->ds) { in qemu_spice_display_switch()
439 ssd->surface = pixman_image_ref(ssd->ds->image); in qemu_spice_display_switch()
440 ssd->mirror = qemu_pixman_mirror_create(surface_format(ssd->ds), in qemu_spice_display_switch()
441 ssd->ds->image); in qemu_spice_display_switch()
445 memset(&ssd->dirty, 0, sizeof(ssd->dirty)); in qemu_spice_display_switch()
446 ssd->notify++; in qemu_spice_display_switch()
448 qemu_mutex_lock(&ssd->lock); in qemu_spice_display_switch()
449 if (ssd->cursor) { in qemu_spice_display_switch()
450 g_free(ssd->ptr_define); in qemu_spice_display_switch()
451 ssd->ptr_define = in qemu_spice_display_switch()
452 qemu_spice_create_cursor_update(ssd, ssd->cursor, false); in qemu_spice_display_switch()
454 qemu_mutex_unlock(&ssd->lock); in qemu_spice_display_switch()
461 qemu_mutex_lock(&ssd->lock); in qemu_spice_cursor_refresh_bh()
462 if (ssd->cursor) { in qemu_spice_cursor_refresh_bh()
463 QEMUCursor *c = ssd->cursor; in qemu_spice_cursor_refresh_bh()
464 assert(ssd->dcl.con); in qemu_spice_cursor_refresh_bh()
466 qemu_mutex_unlock(&ssd->lock); in qemu_spice_cursor_refresh_bh()
467 dpy_cursor_define(ssd->dcl.con, c); in qemu_spice_cursor_refresh_bh()
468 qemu_mutex_lock(&ssd->lock); in qemu_spice_cursor_refresh_bh()
472 if (ssd->mouse_x != -1 && ssd->mouse_y != -1) { in qemu_spice_cursor_refresh_bh()
474 assert(ssd->dcl.con); in qemu_spice_cursor_refresh_bh()
475 x = ssd->mouse_x; in qemu_spice_cursor_refresh_bh()
476 y = ssd->mouse_y; in qemu_spice_cursor_refresh_bh()
477 ssd->mouse_x = -1; in qemu_spice_cursor_refresh_bh()
478 ssd->mouse_y = -1; in qemu_spice_cursor_refresh_bh()
479 qemu_mutex_unlock(&ssd->lock); in qemu_spice_cursor_refresh_bh()
480 dpy_mouse_set(ssd->dcl.con, x, y, true); in qemu_spice_cursor_refresh_bh()
482 qemu_mutex_unlock(&ssd->lock); in qemu_spice_cursor_refresh_bh()
488 graphic_hw_update(ssd->dcl.con); in qemu_spice_display_refresh()
490 WITH_QEMU_LOCK_GUARD(&ssd->lock) { in qemu_spice_display_refresh()
491 if (QTAILQ_EMPTY(&ssd->updates) && ssd->ds) { in qemu_spice_display_refresh()
493 ssd->notify++; in qemu_spice_display_refresh()
497 trace_qemu_spice_display_refresh(ssd->qxl.id, ssd->notify); in qemu_spice_display_refresh()
498 if (ssd->notify) { in qemu_spice_display_refresh()
499 ssd->notify = 0; in qemu_spice_display_refresh()
527 info->memslot_gen_bits = MEMSLOT_GENERATION_BITS; in interface_get_init_info()
528 info->memslot_id_bits = MEMSLOT_SLOT_BITS; in interface_get_init_info()
529 info->num_memslots = NUM_MEMSLOTS; in interface_get_init_info()
530 info->num_memslots_groups = NUM_MEMSLOTS_GROUPS; in interface_get_init_info()
531 info->internal_groupslot_id = 0; in interface_get_init_info()
532 info->qxl_ram_size = 16 * 1024 * 1024; in interface_get_init_info()
533 info->n_surfaces = ssd->num_surfaces; in interface_get_init_info()
542 qemu_mutex_lock(&ssd->lock); in interface_get_command()
543 update = QTAILQ_FIRST(&ssd->updates); in interface_get_command()
545 QTAILQ_REMOVE(&ssd->updates, update, next); in interface_get_command()
546 *ext = update->ext; in interface_get_command()
549 qemu_mutex_unlock(&ssd->lock); in interface_get_command()
571 ext = (void *)(intptr_t)(rext.info->id); in interface_release_resource()
572 switch (ext->cmd.type) { in interface_release_resource()
591 QEMU_LOCK_GUARD(&ssd->lock); in interface_get_cursor_command()
592 if (ssd->ptr_define) { in interface_get_cursor_command()
593 *ext = ssd->ptr_define->ext; in interface_get_cursor_command()
594 ssd->ptr_define = NULL; in interface_get_cursor_command()
596 } else if (ssd->ptr_move) { in interface_get_cursor_command()
597 *ext = ssd->ptr_move->ext; in interface_get_cursor_command()
598 ssd->ptr_move = NULL; in interface_get_cursor_command()
638 switch (cookie->type) { in interface_async_complete()
643 qemu_bh_schedule(ssd->gl_unblock_bh); in interface_async_complete()
647 if (cookie->io == QXL_IO_MONITORS_CONFIG_ASYNC) { in interface_async_complete()
648 g_free(cookie->u.data); in interface_async_complete()
668 VDAgentMonitorsConfig *mc) in interface_client_monitors_config() argument
674 if (!dpy_ui_info_supported(ssd->dcl.con)) { in interface_client_monitors_config()
678 if (!mc) { in interface_client_monitors_config()
682 info = *dpy_get_ui_info(ssd->dcl.con); in interface_client_monitors_config()
684 head = qemu_console_get_index(ssd->dcl.con); in interface_client_monitors_config()
685 if (mc->num_of_monitors > head) { in interface_client_monitors_config()
686 info.width = mc->monitors[head].width; in interface_client_monitors_config()
687 info.height = mc->monitors[head].height; in interface_client_monitors_config()
689 if (mc->flags & VD_AGENT_CONFIG_MONITORS_FLAG_PHYSICAL_SIZE) { in interface_client_monitors_config()
690 VDAgentMonitorMM *mm = (void *)&mc->monitors[mc->num_of_monitors]; in interface_client_monitors_config()
697 trace_qemu_spice_ui_info(ssd->qxl.id, info.width, info.height); in interface_client_monitors_config()
698 dpy_set_ui_info(ssd->dcl.con, &info, false); in interface_client_monitors_config()
755 qemu_mutex_lock(&ssd->lock); in display_mouse_set()
756 ssd->ptr_x = x; in display_mouse_set()
757 ssd->ptr_y = y; in display_mouse_set()
758 g_free(ssd->ptr_move); in display_mouse_set()
759 ssd->ptr_move = qemu_spice_create_cursor_update(ssd, NULL, on); in display_mouse_set()
760 qemu_mutex_unlock(&ssd->lock); in display_mouse_set()
769 qemu_mutex_lock(&ssd->lock); in display_mouse_define()
771 cursor_unref(ssd->cursor); in display_mouse_define()
772 ssd->cursor = c; in display_mouse_define()
773 ssd->hot_x = c->hot_x; in display_mouse_define()
774 ssd->hot_y = c->hot_y; in display_mouse_define()
775 g_free(ssd->ptr_move); in display_mouse_define()
776 ssd->ptr_move = NULL; in display_mouse_define()
777 g_free(ssd->ptr_define); in display_mouse_define()
778 ssd->ptr_define = qemu_spice_create_cursor_update(ssd, c, false); in display_mouse_define()
779 qemu_mutex_unlock(&ssd->lock); in display_mouse_define()
802 config->count = 1; in qemu_spice_gl_monitor_config()
803 config->max_allowed = 1; in qemu_spice_gl_monitor_config()
804 config->heads[0].x = x; in qemu_spice_gl_monitor_config()
805 config->heads[0].y = y; in qemu_spice_gl_monitor_config()
806 config->heads[0].width = w; in qemu_spice_gl_monitor_config()
807 config->heads[0].height = h; in qemu_spice_gl_monitor_config()
810 cookie->u.data = config; in qemu_spice_gl_monitor_config()
812 spice_qxl_monitors_config_async(&ssd->qxl, in qemu_spice_gl_monitor_config()
825 timer_mod(ssd->gl_unblock_timer, timeout); in qemu_spice_gl_block()
827 timer_del(ssd->gl_unblock_timer); in qemu_spice_gl_block()
829 graphic_hw_gl_block(ssd->dcl.con, block); in qemu_spice_gl_block()
841 warn_report("spice: no gl-draw-done within one second"); in qemu_spice_gl_block_timer()
849 if (!ssd->ds || qemu_console_is_gl_blocked(ssd->dcl.con)) { in spice_gl_refresh()
853 graphic_hw_update(dcl->con); in spice_gl_refresh()
854 if (ssd->gl_updates && ssd->have_surface) { in spice_gl_refresh()
858 spice_qxl_gl_draw_async(&ssd->qxl, 0, 0, in spice_gl_refresh()
859 surface_width(ssd->ds), in spice_gl_refresh()
860 surface_height(ssd->ds), in spice_gl_refresh()
862 ssd->gl_updates = 0; in spice_gl_refresh()
871 surface_gl_update_texture(ssd->gls, ssd->ds, x, y, w, h); in spice_gl_update()
872 ssd->gl_updates++; in spice_gl_update()
882 if (ssd->ds) { in spice_gl_switch()
883 surface_gl_destroy_texture(ssd->gls, ssd->ds); in spice_gl_switch()
885 ssd->ds = new_surface; in spice_gl_switch()
886 if (ssd->ds) { in spice_gl_switch()
887 surface_gl_create_texture(ssd->gls, ssd->ds); in spice_gl_switch()
888 fd = egl_get_fd_for_texture(ssd->ds->texture, in spice_gl_switch()
892 surface_gl_destroy_texture(ssd->gls, ssd->ds); in spice_gl_switch()
896 trace_qemu_spice_gl_surface(ssd->qxl.id, in spice_gl_switch()
897 surface_width(ssd->ds), in spice_gl_switch()
898 surface_height(ssd->ds), in spice_gl_switch()
902 spice_qxl_gl_scanout(&ssd->qxl, fd, in spice_gl_switch()
903 surface_width(ssd->ds), in spice_gl_switch()
904 surface_height(ssd->ds), in spice_gl_switch()
906 ssd->have_surface = true; in spice_gl_switch()
907 ssd->have_scanout = false; in spice_gl_switch()
910 surface_width(ssd->ds), in spice_gl_switch()
911 surface_height(ssd->ds)); in spice_gl_switch()
927 trace_qemu_spice_gl_scanout_disable(ssd->qxl.id); in qemu_spice_gl_scanout_disable()
928 spice_qxl_gl_scanout(&ssd->qxl, -1, 0, 0, 0, 0, false); in qemu_spice_gl_scanout_disable()
930 ssd->have_surface = false; in qemu_spice_gl_scanout_disable()
931 ssd->have_scanout = false; in qemu_spice_gl_scanout_disable()
945 int fd = -1; in qemu_spice_gl_scanout_texture()
953 trace_qemu_spice_gl_scanout_texture(ssd->qxl.id, w, h, fourcc); in qemu_spice_gl_scanout_texture()
956 spice_qxl_gl_scanout(&ssd->qxl, fd, backing_width, backing_height, in qemu_spice_gl_scanout_texture()
959 ssd->have_surface = false; in qemu_spice_gl_scanout_texture()
960 ssd->have_scanout = true; in qemu_spice_gl_scanout_texture()
968 ssd->guest_dmabuf = dmabuf; in qemu_spice_gl_scanout_dmabuf()
969 ssd->guest_dmabuf_refresh = true; in qemu_spice_gl_scanout_dmabuf()
971 ssd->have_surface = false; in qemu_spice_gl_scanout_dmabuf()
972 ssd->have_scanout = true; in qemu_spice_gl_scanout_dmabuf()
982 ssd->have_hot = have_hot; in qemu_spice_gl_cursor_dmabuf()
983 ssd->hot_x = hot_x; in qemu_spice_gl_cursor_dmabuf()
984 ssd->hot_y = hot_y; in qemu_spice_gl_cursor_dmabuf()
986 trace_qemu_spice_gl_cursor(ssd->qxl.id, dmabuf != NULL, have_hot); in qemu_spice_gl_cursor_dmabuf()
995 egl_fb_setup_for_tex(&ssd->cursor_fb, width, height, texture, false); in qemu_spice_gl_cursor_dmabuf()
997 egl_fb_destroy(&ssd->cursor_fb); in qemu_spice_gl_cursor_dmabuf()
1006 qemu_mutex_lock(&ssd->lock); in qemu_spice_gl_cursor_position()
1007 ssd->ptr_x = pos_x; in qemu_spice_gl_cursor_position()
1008 ssd->ptr_y = pos_y; in qemu_spice_gl_cursor_position()
1009 qemu_mutex_unlock(&ssd->lock); in qemu_spice_gl_cursor_position()
1017 if (ssd->guest_dmabuf == dmabuf) { in qemu_spice_gl_release_dmabuf()
1018 ssd->guest_dmabuf = NULL; in qemu_spice_gl_release_dmabuf()
1019 ssd->guest_dmabuf_refresh = false; in qemu_spice_gl_release_dmabuf()
1035 if (!ssd->have_scanout) { in qemu_spice_gl_update()
1039 if (ssd->cursor_fb.texture) { in qemu_spice_gl_update()
1042 if (ssd->render_cursor != render_cursor) { in qemu_spice_gl_update()
1043 ssd->render_cursor = render_cursor; in qemu_spice_gl_update()
1044 ssd->guest_dmabuf_refresh = true; in qemu_spice_gl_update()
1045 egl_fb_destroy(&ssd->blit_fb); in qemu_spice_gl_update()
1048 if (ssd->guest_dmabuf_refresh) { in qemu_spice_gl_update()
1049 QemuDmaBuf *dmabuf = ssd->guest_dmabuf; in qemu_spice_gl_update()
1061 egl_fb_setup_for_tex(&ssd->guest_fb, width, height, in qemu_spice_gl_update()
1065 if (ssd->blit_fb.width != width || in qemu_spice_gl_update()
1066 ssd->blit_fb.height != height) { in qemu_spice_gl_update()
1067 trace_qemu_spice_gl_render_dmabuf(ssd->qxl.id, width, in qemu_spice_gl_update()
1069 egl_fb_destroy(&ssd->blit_fb); in qemu_spice_gl_update()
1070 egl_fb_setup_new_tex(&ssd->blit_fb, in qemu_spice_gl_update()
1072 fd = egl_get_fd_for_texture(ssd->blit_fb.texture, in qemu_spice_gl_update()
1074 spice_qxl_gl_scanout(&ssd->qxl, fd, width, height, in qemu_spice_gl_update()
1083 trace_qemu_spice_gl_forward_dmabuf(ssd->qxl.id, width, height); in qemu_spice_gl_update()
1085 spice_qxl_gl_scanout(&ssd->qxl, fd, width, height, in qemu_spice_gl_update()
1089 ssd->guest_dmabuf_refresh = false; in qemu_spice_gl_update()
1095 qemu_mutex_lock(&ssd->lock); in qemu_spice_gl_update()
1096 ptr_x = ssd->ptr_x; in qemu_spice_gl_update()
1097 ptr_y = ssd->ptr_y; in qemu_spice_gl_update()
1098 qemu_mutex_unlock(&ssd->lock); in qemu_spice_gl_update()
1099 egl_texture_blit(ssd->gls, &ssd->blit_fb, &ssd->guest_fb, in qemu_spice_gl_update()
1101 egl_texture_blend(ssd->gls, &ssd->blit_fb, &ssd->cursor_fb, in qemu_spice_gl_update()
1106 trace_qemu_spice_gl_update(ssd->qxl.id, w, h, x, y); in qemu_spice_gl_update()
1110 spice_qxl_gl_draw_async(&ssd->qxl, x, y, w, h, cookie); in qemu_spice_gl_update()
1114 .dpy_name = "spice-egl",
1135 return dcl->ops == &display_listener_gl_ops; in qemu_spice_is_compatible_dcl()
1153 ssd->dcl.ops = &display_listener_ops; in qemu_spice_display_init_one()
1156 ssd->dcl.ops = &display_listener_gl_ops; in qemu_spice_display_init_one()
1157 ssd->dgc.ops = &gl_ctx_ops; in qemu_spice_display_init_one()
1158 ssd->gl_unblock_bh = qemu_bh_new(qemu_spice_gl_unblock_bh, ssd); in qemu_spice_display_init_one()
1159 ssd->gl_unblock_timer = timer_new_ms(QEMU_CLOCK_REALTIME, in qemu_spice_display_init_one()
1161 ssd->gls = qemu_gl_init_shader(); in qemu_spice_display_init_one()
1162 ssd->have_surface = false; in qemu_spice_display_init_one()
1163 ssd->have_scanout = false; in qemu_spice_display_init_one()
1166 ssd->dcl.con = con; in qemu_spice_display_init_one()
1168 ssd->qxl.base.sif = &dpy_interface.base; in qemu_spice_display_init_one()
1169 qemu_spice_add_display_interface(&ssd->qxl, con); in qemu_spice_display_init_one()
1175 spice_qxl_set_device_info(&ssd->qxl, in qemu_spice_display_init_one()
1187 qemu_console_set_display_gl_ctx(con, &ssd->dgc); in qemu_spice_display_init_one()
1189 register_displaychangelistener(&ssd->dcl); in qemu_spice_display_init_one()
1195 QemuOpts *opts = QTAILQ_FIRST(&olist->head); in qemu_spice_display_init()