Lines Matching +full:device +full:- +full:width

27 #include "hw/qdev-core.h"
29 #include "qapi/qapi-commands-ui.h"
32 #include "qemu/error-report.h"
33 #include "qemu/main-loop.h"
42 #include "console-priv.h"
49 Object *device; member
89 ds->refreshing = true; in gui_update()
91 ds->refreshing = false; in gui_update()
93 QLIST_FOREACH(dcl, &ds->listeners, next) { in gui_update()
94 dcl_interval = dcl->update_interval ? in gui_update()
95 dcl->update_interval : GUI_REFRESH_INTERVAL_DEFAULT; in gui_update()
100 if (ds->update_interval != interval) { in gui_update()
101 ds->update_interval = interval; in gui_update()
104 ds->last_update = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); in gui_update()
105 timer_mod(ds->gui_timer, ds->last_update + interval); in gui_update()
113 QLIST_FOREACH(dcl, &ds->listeners, next) { in gui_setup_refresh()
114 if (dcl->ops->dpy_refresh != NULL) { in gui_setup_refresh()
119 if (need_timer && ds->gui_timer == NULL) { in gui_setup_refresh()
120 ds->gui_timer = timer_new_ms(QEMU_CLOCK_REALTIME, gui_update, ds); in gui_setup_refresh()
121 timer_mod(ds->gui_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME)); in gui_setup_refresh()
123 if (!need_timer && ds->gui_timer != NULL) { in gui_setup_refresh()
124 timer_free(ds->gui_timer); in gui_setup_refresh()
125 ds->gui_timer = NULL; in gui_setup_refresh()
132 qemu_co_enter_all(&con->dump_queue, NULL); in graphic_hw_update_done()
142 if (con->hw_ops->gfx_update) { in graphic_hw_update()
143 con->hw_ops->gfx_update(con->hw); in graphic_hw_update()
144 async = con->hw_ops->gfx_update_async; in graphic_hw_update()
158 if (qemu_co_queue_empty(&con->dump_queue)) { in qemu_console_co_wait_update()
163 qemu_co_queue_wait(&con->dump_queue, NULL); in qemu_console_co_wait_update()
169 warn_report("console: no gl-unblock within one second"); in graphic_hw_gl_unblock_timer()
178 con->gl_block++; in graphic_hw_gl_block()
180 con->gl_block--; in graphic_hw_gl_block()
182 assert(con->gl_block >= 0); in graphic_hw_gl_block()
183 if (!con->hw_ops->gl_block) { in graphic_hw_gl_block()
186 if ((block && con->gl_block != 1) || (!block && con->gl_block != 0)) { in graphic_hw_gl_block()
189 con->hw_ops->gl_block(con->hw, block); in graphic_hw_gl_block()
194 timer_mod(con->gl_unblock_timer, timeout); in graphic_hw_gl_block()
196 timer_del(con->gl_unblock_timer); in graphic_hw_gl_block()
202 return con->window_id; in qemu_console_get_window_id()
207 con->window_id = window_id; in qemu_console_set_window_id()
212 if (con && con->hw_ops->invalidate) { in graphic_hw_invalidate()
213 con->hw_ops->invalidate(con->hw); in graphic_hw_invalidate()
219 if (con && con->hw_ops->text_update) { in graphic_hw_text_update()
220 con->hw_ops->text_update(con->hw, chardata); in graphic_hw_text_update()
228 if (dcl->ops->dpy_gfx_switch) { in displaychangelistener_gfx_switch()
229 dcl->ops->dpy_gfx_switch(dcl, new_surface); in displaychangelistener_gfx_switch()
232 if (update && dcl->ops->dpy_gfx_update) { in displaychangelistener_gfx_switch()
233 dcl->ops->dpy_gfx_update(dcl, 0, 0, in displaychangelistener_gfx_switch()
241 if (con->gl && con->gl->ops->dpy_gl_ctx_create_texture) { in dpy_gfx_create_texture()
242 con->gl->ops->dpy_gl_ctx_create_texture(con->gl, surface); in dpy_gfx_create_texture()
248 if (con->gl && con->gl->ops->dpy_gl_ctx_destroy_texture) { in dpy_gfx_destroy_texture()
249 con->gl->ops->dpy_gl_ctx_destroy_texture(con->gl, surface); in dpy_gfx_destroy_texture()
256 if (con->gl && con->gl->ops->dpy_gl_ctx_update_texture) { in dpy_gfx_update_texture()
257 con->gl->ops->dpy_gl_ctx_update_texture(con->gl, surface, x, y, w, h); in dpy_gfx_update_texture()
265 "This VM has no graphic display device."; in displaychangelistener_display_console()
267 QemuConsole *con = dcl->con; in displaychangelistener_display_console()
280 dpy_gfx_create_texture(con, con->surface); in displaychangelistener_display_console()
281 displaychangelistener_gfx_switch(dcl, con->surface, in displaychangelistener_display_console()
282 con->scanout.kind == SCANOUT_SURFACE); in displaychangelistener_display_console()
284 if (con->scanout.kind == SCANOUT_DMABUF && in displaychangelistener_display_console()
286 dcl->ops->dpy_gl_scanout_dmabuf(dcl, con->scanout.dmabuf); in displaychangelistener_display_console()
287 } else if (con->scanout.kind == SCANOUT_TEXTURE && in displaychangelistener_display_console()
288 dcl->ops->dpy_gl_scanout_texture) { in displaychangelistener_display_console()
289 dcl->ops->dpy_gl_scanout_texture(dcl, in displaychangelistener_display_console()
290 con->scanout.texture.backing_id, in displaychangelistener_display_console()
291 con->scanout.texture.backing_y_0_top, in displaychangelistener_display_console()
292 con->scanout.texture.backing_width, in displaychangelistener_display_console()
293 con->scanout.texture.backing_height, in displaychangelistener_display_console()
294 con->scanout.texture.x, in displaychangelistener_display_console()
295 con->scanout.texture.y, in displaychangelistener_display_console()
296 con->scanout.texture.width, in displaychangelistener_display_console()
297 con->scanout.texture.height, in displaychangelistener_display_console()
298 con->scanout.texture.d3d_tex2d); in displaychangelistener_display_console()
359 c->index = 0; in qemu_console_register()
363 c->index = last->index + 1; in qemu_console_register()
369 * Only do that for coldplugged devices. After initial device in qemu_console_register()
379 c->index = it->index + 1; in qemu_console_register()
382 c->index = it->index; in qemu_console_register()
385 for (i = c->index + 1; it != NULL; it = QTAILQ_NEXT(it, next), i++) { in qemu_console_register()
386 it->index = i; in qemu_console_register()
398 g_clear_pointer(&c->surface, qemu_free_displaysurface); in qemu_console_finalize()
399 g_clear_pointer(&c->gl_unblock_timer, timer_free); in qemu_console_finalize()
400 g_clear_pointer(&c->ui_timer, timer_free); in qemu_console_finalize()
414 qemu_co_queue_init(&c->dump_queue); in qemu_console_init()
415 c->ds = ds; in qemu_console_init()
416 c->window_id = -1; in qemu_console_init()
417 c->ui_timer = timer_new_ms(QEMU_CLOCK_REALTIME, in qemu_console_init()
427 g_clear_pointer(&c->device, object_unref); in qemu_graphic_console_finalize()
436 visit_type_uint32(v, name, &c->head, errp); in qemu_graphic_console_prop_get_head()
442 object_class_property_add_link(oc, "device", TYPE_DEVICE, in qemu_graphic_console_class_init()
443 offsetof(QemuGraphicConsole, device), in qemu_graphic_console_class_init()
460 assert(surface->share_handle == SHAREABLE_NONE); in qemu_displaysurface_set_share_handle()
462 surface->share_handle = handle; in qemu_displaysurface_set_share_handle()
463 surface->share_handle_offset = offset; in qemu_displaysurface_set_share_handle()
467 DisplaySurface *qemu_create_displaysurface(int width, int height) in qemu_create_displaysurface() argument
469 trace_displaysurface_create(width, height); in qemu_create_displaysurface()
472 width, height, in qemu_create_displaysurface()
474 width * 4, NULL in qemu_create_displaysurface()
478 DisplaySurface *qemu_create_displaysurface_from(int width, int height, in qemu_create_displaysurface_from() argument
484 trace_displaysurface_create_from(surface, width, height, format); in qemu_create_displaysurface_from()
485 surface->share_handle = SHAREABLE_NONE; in qemu_create_displaysurface_from()
488 surface->image = pixman_image_create_bits(format, in qemu_create_displaysurface_from()
489 width, height, in qemu_create_displaysurface_from()
492 qemu_pixman_image_new_shareable(&surface->image, in qemu_create_displaysurface_from()
493 &surface->share_handle, in qemu_create_displaysurface_from()
496 width, in qemu_create_displaysurface_from()
500 surface->flags = QEMU_ALLOCATED_FLAG; in qemu_create_displaysurface_from()
503 assert(surface->image != NULL); in qemu_create_displaysurface_from()
512 surface->share_handle = SHAREABLE_NONE; in qemu_create_displaysurface_pixman()
513 surface->image = pixman_image_ref(image); in qemu_create_displaysurface_pixman()
529 x = (w / FONT_WIDTH - len) / 2; in qemu_create_placeholder_surface()
530 y = (h / FONT_HEIGHT - 1) / 2; in qemu_create_placeholder_surface()
533 qemu_pixman_glyph_render(glyph, surface->image, &fg, &bg, in qemu_create_placeholder_surface()
538 surface->flags |= QEMU_PLACEHOLDER_FLAG; in qemu_create_placeholder_surface()
548 qemu_pixman_image_unref(surface->image); in qemu_free_displaysurface()
554 return con->gl != NULL; in console_has_gl()
559 if (dcl->ops->dpy_has_dmabuf) { in displaychangelistener_has_dmabuf()
560 return dcl->ops->dpy_has_dmabuf(dcl); in displaychangelistener_has_dmabuf()
563 if (dcl->ops->dpy_gl_scanout_dmabuf) { in displaychangelistener_has_dmabuf()
575 flags = con->hw_ops->get_flags ? con->hw_ops->get_flags(con->hw) : 0; in console_compatible_with()
578 !con->gl->ops->dpy_gl_ctx_is_compatible_dcl(con->gl, dcl)) { in console_compatible_with()
580 dcl->ops->dpy_name); in console_compatible_with()
603 int width, int height, in console_handle_touch_event() argument
621 slot->x = x; in console_handle_touch_event()
622 slot->y = y; in console_handle_touch_event()
625 slot->tracking_id = num_slot; in console_handle_touch_event()
637 if (slot->tracking_id == -1) { in console_handle_touch_event()
642 slot->tracking_id = -1; in console_handle_touch_event()
643 qemu_input_queue_mtt(con, update, i, slot->tracking_id); in console_handle_touch_event()
646 qemu_input_queue_mtt(con, update, i, slot->tracking_id); in console_handle_touch_event()
649 INPUT_AXIS_X, (int) slot->x, in console_handle_touch_event()
650 0, width, in console_handle_touch_event()
651 i, slot->tracking_id); in console_handle_touch_event()
653 INPUT_AXIS_Y, (int) slot->y, in console_handle_touch_event()
655 i, slot->tracking_id); in console_handle_touch_event()
669 if (con->gl) { in qemu_console_set_display_gl_ctx()
673 con->gl = gl; in qemu_console_set_display_gl_ctx()
679 if (con && con->cursor && dcl->ops->dpy_cursor_define) { in dcl_set_graphic_cursor()
680 dcl->ops->dpy_cursor_define(dcl, con->cursor); in dcl_set_graphic_cursor()
682 if (con && dcl->ops->dpy_mouse_set) { in dcl_set_graphic_cursor()
683 dcl->ops->dpy_mouse_set(dcl, con->cursor_x, con->cursor_y, con->cursor_on); in dcl_set_graphic_cursor()
689 assert(!dcl->ds); in register_displaychangelistener()
691 trace_displaychangelistener_register(dcl, dcl->ops->dpy_name); in register_displaychangelistener()
692 dcl->ds = get_alloc_displaystate(); in register_displaychangelistener()
693 QLIST_INSERT_HEAD(&dcl->ds->listeners, dcl, next); in register_displaychangelistener()
694 gui_setup_refresh(dcl->ds); in register_displaychangelistener()
695 if (dcl->con) { in register_displaychangelistener()
696 dcl->con->dcls++; in register_displaychangelistener()
699 if (QEMU_IS_GRAPHIC_CONSOLE(dcl->con)) { in register_displaychangelistener()
700 dcl_set_graphic_cursor(dcl, QEMU_GRAPHIC_CONSOLE(dcl->con)); in register_displaychangelistener()
701 } else if (QEMU_IS_TEXT_CONSOLE(dcl->con)) { in register_displaychangelistener()
702 qemu_text_console_update_size(QEMU_TEXT_CONSOLE(dcl->con)); in register_displaychangelistener()
710 DisplayState *ds = dcl->ds; in update_displaychangelistener()
712 dcl->update_interval = interval; in update_displaychangelistener()
713 if (!ds->refreshing && ds->update_interval > interval) { in update_displaychangelistener()
714 timer_mod(ds->gui_timer, ds->last_update + interval); in update_displaychangelistener()
720 DisplayState *ds = dcl->ds; in unregister_displaychangelistener()
721 trace_displaychangelistener_unregister(dcl, dcl->ops->dpy_name); in unregister_displaychangelistener()
722 if (dcl->con) { in unregister_displaychangelistener()
723 dcl->con->dcls--; in unregister_displaychangelistener()
726 dcl->ds = NULL; in unregister_displaychangelistener()
735 con->hw_ops->ui_info(con->hw, head, &con->ui_info); in dpy_set_ui_info_timer()
744 return con->hw_ops->ui_info != NULL; in dpy_ui_info_supported()
751 return &con->ui_info; in dpy_get_ui_info()
757 return -1; in dpy_set_ui_info()
759 if (memcmp(&con->ui_info, info, sizeof(con->ui_info)) == 0) { in dpy_set_ui_info()
760 /* nothing changed -- ignore */ in dpy_set_ui_info()
769 con->ui_info = *info; in dpy_set_ui_info()
770 timer_mod(con->ui_timer, in dpy_set_ui_info()
777 DisplayState *s = con->ds; in dpy_gfx_update()
779 int width = qemu_console_get_width(con, x + w); in dpy_gfx_update() local
784 x = MIN(x, width); in dpy_gfx_update()
786 w = MIN(w, width - x); in dpy_gfx_update()
787 h = MIN(h, height - y); in dpy_gfx_update()
792 dpy_gfx_update_texture(con, con->surface, x, y, w, h); in dpy_gfx_update()
793 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_gfx_update()
794 if (con != dcl->con) { in dpy_gfx_update()
797 if (dcl->ops->dpy_gfx_update) { in dpy_gfx_update()
798 dcl->ops->dpy_gfx_update(dcl, x, y, w, h); in dpy_gfx_update()
815 DisplayState *s = con->ds; in dpy_gfx_replace_surface()
816 DisplaySurface *old_surface = con->surface; in dpy_gfx_replace_surface()
819 int width; in dpy_gfx_replace_surface() local
824 width = surface_width(old_surface); in dpy_gfx_replace_surface()
827 width = 640; in dpy_gfx_replace_surface()
831 new_surface = qemu_create_placeholder_surface(width, height, placeholder_msg); in dpy_gfx_replace_surface()
836 con->scanout.kind = SCANOUT_SURFACE; in dpy_gfx_replace_surface()
837 con->surface = new_surface; in dpy_gfx_replace_surface()
839 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_gfx_replace_surface()
840 if (con != dcl->con) { in dpy_gfx_replace_surface()
853 DisplayState *s = con->ds; in dpy_gfx_check_format()
855 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_gfx_check_format()
856 if (dcl->con && dcl->con != con) { in dpy_gfx_check_format()
857 /* dcl bound to another console -> skip */ in dpy_gfx_check_format()
860 if (dcl->ops->dpy_gfx_check_format) { in dpy_gfx_check_format()
861 if (!dcl->ops->dpy_gfx_check_format(dcl, format)) { in dpy_gfx_check_format()
878 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_refresh()
879 if (dcl->ops->dpy_refresh) { in dpy_refresh()
880 dcl->ops->dpy_refresh(dcl); in dpy_refresh()
887 DisplayState *s = con->ds; in dpy_text_cursor()
893 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_text_cursor()
894 if (con != dcl->con) { in dpy_text_cursor()
897 if (dcl->ops->dpy_text_cursor) { in dpy_text_cursor()
898 dcl->ops->dpy_text_cursor(dcl, x, y); in dpy_text_cursor()
905 DisplayState *s = con->ds; in dpy_text_update()
911 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_text_update()
912 if (con != dcl->con) { in dpy_text_update()
915 if (dcl->ops->dpy_text_update) { in dpy_text_update()
916 dcl->ops->dpy_text_update(dcl, x, y, w, h); in dpy_text_update()
923 DisplayState *s = con->ds; in dpy_text_resize()
929 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_text_resize()
930 if (con != dcl->con) { in dpy_text_resize()
933 if (dcl->ops->dpy_text_resize) { in dpy_text_resize()
934 dcl->ops->dpy_text_resize(dcl, w, h); in dpy_text_resize()
942 DisplayState *s = c->ds; in dpy_mouse_set()
945 con->cursor_x = x; in dpy_mouse_set()
946 con->cursor_y = y; in dpy_mouse_set()
947 con->cursor_on = on; in dpy_mouse_set()
951 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_mouse_set()
952 if (c != dcl->con) { in dpy_mouse_set()
955 if (dcl->ops->dpy_mouse_set) { in dpy_mouse_set()
956 dcl->ops->dpy_mouse_set(dcl, x, y, on); in dpy_mouse_set()
964 DisplayState *s = c->ds; in dpy_cursor_define()
967 cursor_unref(con->cursor); in dpy_cursor_define()
968 con->cursor = cursor_ref(cursor); in dpy_cursor_define()
972 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_cursor_define()
973 if (c != dcl->con) { in dpy_cursor_define()
976 if (dcl->ops->dpy_cursor_define) { in dpy_cursor_define()
977 dcl->ops->dpy_cursor_define(dcl, cursor); in dpy_cursor_define()
985 assert(con->gl); in dpy_gl_ctx_create()
986 return con->gl->ops->dpy_gl_ctx_create(con->gl, qparams); in dpy_gl_ctx_create()
991 assert(con->gl); in dpy_gl_ctx_destroy()
992 con->gl->ops->dpy_gl_ctx_destroy(con->gl, ctx); in dpy_gl_ctx_destroy()
997 assert(con->gl); in dpy_gl_ctx_make_current()
998 return con->gl->ops->dpy_gl_ctx_make_current(con->gl, ctx); in dpy_gl_ctx_make_current()
1003 DisplayState *s = con->ds; in dpy_gl_scanout_disable()
1006 if (con->scanout.kind != SCANOUT_SURFACE) { in dpy_gl_scanout_disable()
1007 con->scanout.kind = SCANOUT_NONE; in dpy_gl_scanout_disable()
1009 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_gl_scanout_disable()
1010 if (con != dcl->con) { in dpy_gl_scanout_disable()
1013 if (dcl->ops->dpy_gl_scanout_disable) { in dpy_gl_scanout_disable()
1014 dcl->ops->dpy_gl_scanout_disable(dcl); in dpy_gl_scanout_disable()
1025 uint32_t width, uint32_t height, in dpy_gl_scanout_texture() argument
1028 DisplayState *s = con->ds; in dpy_gl_scanout_texture()
1031 con->scanout.kind = SCANOUT_TEXTURE; in dpy_gl_scanout_texture()
1032 con->scanout.texture = (ScanoutTexture) { in dpy_gl_scanout_texture()
1034 x, y, width, height, d3d_tex2d, in dpy_gl_scanout_texture()
1036 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_gl_scanout_texture()
1037 if (con != dcl->con) { in dpy_gl_scanout_texture()
1040 if (dcl->ops->dpy_gl_scanout_texture) { in dpy_gl_scanout_texture()
1041 dcl->ops->dpy_gl_scanout_texture(dcl, backing_id, in dpy_gl_scanout_texture()
1044 x, y, width, height, in dpy_gl_scanout_texture()
1053 DisplayState *s = con->ds; in dpy_gl_scanout_dmabuf()
1056 con->scanout.kind = SCANOUT_DMABUF; in dpy_gl_scanout_dmabuf()
1057 con->scanout.dmabuf = dmabuf; in dpy_gl_scanout_dmabuf()
1058 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_gl_scanout_dmabuf()
1059 if (con != dcl->con) { in dpy_gl_scanout_dmabuf()
1062 if (dcl->ops->dpy_gl_scanout_dmabuf) { in dpy_gl_scanout_dmabuf()
1063 dcl->ops->dpy_gl_scanout_dmabuf(dcl, dmabuf); in dpy_gl_scanout_dmabuf()
1071 DisplayState *s = con->ds; in dpy_gl_cursor_dmabuf()
1074 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_gl_cursor_dmabuf()
1075 if (con != dcl->con) { in dpy_gl_cursor_dmabuf()
1078 if (dcl->ops->dpy_gl_cursor_dmabuf) { in dpy_gl_cursor_dmabuf()
1079 dcl->ops->dpy_gl_cursor_dmabuf(dcl, dmabuf, in dpy_gl_cursor_dmabuf()
1088 DisplayState *s = con->ds; in dpy_gl_cursor_position()
1091 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_gl_cursor_position()
1092 if (con != dcl->con) { in dpy_gl_cursor_position()
1095 if (dcl->ops->dpy_gl_cursor_position) { in dpy_gl_cursor_position()
1096 dcl->ops->dpy_gl_cursor_position(dcl, pos_x, pos_y); in dpy_gl_cursor_position()
1104 DisplayState *s = con->ds; in dpy_gl_release_dmabuf()
1107 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_gl_release_dmabuf()
1108 if (con != dcl->con) { in dpy_gl_release_dmabuf()
1111 if (dcl->ops->dpy_gl_release_dmabuf) { in dpy_gl_release_dmabuf()
1112 dcl->ops->dpy_gl_release_dmabuf(dcl, dmabuf); in dpy_gl_release_dmabuf()
1120 DisplayState *s = con->ds; in dpy_gl_update()
1123 assert(con->gl); in dpy_gl_update()
1126 QLIST_FOREACH(dcl, &s->listeners, next) { in dpy_gl_update()
1127 if (con != dcl->con) { in dpy_gl_update()
1130 if (dcl->ops->dpy_gl_update) { in dpy_gl_update()
1131 dcl->ops->dpy_gl_update(dcl, x, y, w, h); in dpy_gl_update()
1162 name = g_strdup_printf("console[%d]", con->index); in init_displaystate()
1175 con->hw_ops = hw_ops; in graphic_console_set_hwops()
1176 con->hw = opaque; in graphic_console_set_hwops()
1185 int width = 640; in graphic_console_init() local
1192 trace_console_gfx_reuse(s->index); in graphic_console_init()
1193 width = qemu_console_get_width(s, 0); in graphic_console_init()
1199 QEMU_GRAPHIC_CONSOLE(s)->head = head; in graphic_console_init()
1202 object_property_set_link(OBJECT(s), "device", OBJECT(dev), in graphic_console_init()
1206 surface = qemu_create_placeholder_surface(width, height, noinit); in graphic_console_init()
1208 s->gl_unblock_timer = timer_new_ms(QEMU_CLOCK_REALTIME, in graphic_console_init()
1222 int width = qemu_console_get_width(con, 640); in graphic_console_close() local
1225 trace_console_gfx_close(con->index); in graphic_console_close()
1226 object_property_set_link(OBJECT(con), "device", NULL, &error_abort); in graphic_console_close()
1229 if (con->gl) { in graphic_console_close()
1232 surface = qemu_create_placeholder_surface(width, height, unplugged); in graphic_console_close()
1253 if (con->index == index) { in qemu_console_lookup_by_index()
1268 "device", &error_abort); in qemu_console_lookup_by_device()
1269 if (DEVICE(obj) != dev) { in qemu_console_lookup_by_device()
1291 "Device '%s' not found", device_id); in qemu_console_lookup_by_device_name()
1297 error_setg(errp, "Device %s (head %d) is not bound to a QemuConsole", in qemu_console_lookup_by_device_name()
1311 if (!QEMU_IS_GRAPHIC_CONSOLE(con) || con->hw_ops != &unused_ops) { in qemu_graphic_console_lookup_unused()
1315 "device", &error_abort); in qemu_graphic_console_lookup_unused()
1326 return QEMU_IS_GRAPHIC_CONSOLE(con) ? QEMU_GRAPHIC_CONSOLE(con)->cursor : NULL; in qemu_console_get_cursor()
1331 return con->dcls > 0; in qemu_console_is_visible()
1347 return con->gl_block; in qemu_console_is_gl_blocked()
1362 if (candidate->device != c->device) { in qemu_graphic_console_is_multihead()
1366 if (candidate->head != c->head) { in qemu_graphic_console_is_multihead()
1377 if (c->device) { in qemu_console_get_label()
1381 dev = DEVICE(c->device); in qemu_console_get_label()
1384 return g_strdup_printf("%s.%d", dev->id ? in qemu_console_get_label()
1385 dev->id : in qemu_console_get_label()
1386 object_get_typename(c->device), in qemu_console_get_label()
1387 c->head); in qemu_console_get_label()
1389 return g_strdup(dev->id ? : object_get_typename(c->device)); in qemu_console_get_label()
1400 return g_strdup_printf("vc%d", con->index); in qemu_console_get_label()
1405 return con ? con->index : -1; in qemu_console_get_index()
1411 return -1; in qemu_console_get_head()
1414 return QEMU_GRAPHIC_CONSOLE(con)->head; in qemu_console_get_head()
1424 switch (con->scanout.kind) { in qemu_console_get_width()
1426 return qemu_dmabuf_get_width(con->scanout.dmabuf); in qemu_console_get_width()
1428 return con->scanout.texture.width; in qemu_console_get_width()
1430 return surface_width(con->surface); in qemu_console_get_width()
1441 switch (con->scanout.kind) { in qemu_console_get_height()
1443 return qemu_dmabuf_get_height(con->scanout.dmabuf); in qemu_console_get_height()
1445 return con->scanout.texture.height; in qemu_console_get_height()
1447 return surface_height(con->surface); in qemu_console_get_height()
1470 void qemu_console_resize(QemuConsole *s, int width, int height) in qemu_console_resize() argument
1476 if ((s->scanout.kind != SCANOUT_SURFACE || in qemu_console_resize()
1479 qemu_console_get_width(s, -1) == width && in qemu_console_resize()
1480 qemu_console_get_height(s, -1) == height) { in qemu_console_resize()
1484 surface = qemu_create_displaysurface(width, height); in qemu_console_resize()
1490 switch (console->scanout.kind) { in qemu_console_surface()
1492 return console->surface; in qemu_console_surface()
1509 assert(ui->type < DISPLAY_TYPE__MAX); in qemu_display_register()
1510 dpys[ui->type] = ui; in qemu_display_register()
1539 opts->type = prio[i]; in qemu_display_find_default()
1547 assert(opts->type < DISPLAY_TYPE__MAX); in qemu_display_early_init()
1548 if (opts->type == DISPLAY_TYPE_NONE) { in qemu_display_early_init()
1551 if (dpys[opts->type] == NULL) { in qemu_display_early_init()
1553 int rv = ui_module_load(DisplayType_str(opts->type), &local_err); in qemu_display_early_init()
1558 if (dpys[opts->type] == NULL) { in qemu_display_early_init()
1560 DisplayType_str(opts->type)); in qemu_display_early_init()
1563 if (dpys[opts->type]->early_init) { in qemu_display_early_init()
1564 dpys[opts->type]->early_init(opts); in qemu_display_early_init()
1570 assert(opts->type < DISPLAY_TYPE__MAX); in qemu_display_init()
1571 if (opts->type == DISPLAY_TYPE_NONE) { in qemu_display_init()
1574 assert(dpys[opts->type] != NULL); in qemu_display_init()
1575 dpys[opts->type]->init(ds, opts); in qemu_display_init()
1586 assert(opts->type < DISPLAY_TYPE__MAX); in qemu_display_get_vc()
1587 if (dpys[opts->type] && dpys[opts->type]->vc) { in qemu_display_get_vc()
1588 vc = dpys[opts->type]->vc; in qemu_display_get_vc()
1608 printf("%s\n", DisplayType_str(dpys[idx]->type)); in qemu_display_help()
1613 " -display backend,option=value,option=value...\n" in qemu_display_help()
1615 "top-level -help output; more detail is in the documentation.\n"); in qemu_display_help()