Lines Matching full:gfx

29     if (vc->gfx.scanout_mode == scanout) {  in gtk_egl_set_scanout_mode()
33 vc->gfx.scanout_mode = scanout; in gtk_egl_set_scanout_mode()
34 if (!vc->gfx.scanout_mode) { in gtk_egl_set_scanout_mode()
35 eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, in gtk_egl_set_scanout_mode()
36 vc->gfx.esurface, vc->gfx.ectx); in gtk_egl_set_scanout_mode()
37 egl_fb_destroy(&vc->gfx.guest_fb); in gtk_egl_set_scanout_mode()
38 if (vc->gfx.surface) { in gtk_egl_set_scanout_mode()
39 surface_gl_destroy_texture(vc->gfx.gls, vc->gfx.ds); in gtk_egl_set_scanout_mode()
40 surface_gl_create_texture(vc->gfx.gls, vc->gfx.ds); in gtk_egl_set_scanout_mode()
49 GdkWindow *gdk_window = gtk_widget_get_window(vc->gfx.drawing_area); in gd_egl_init()
59 vc->gfx.ectx = qemu_egl_init_ctx(); in gd_egl_init()
60 vc->gfx.esurface = qemu_egl_init_surface_x11 in gd_egl_init()
61 (vc->gfx.ectx, (EGLNativeWindowType)x11_window); in gd_egl_init()
63 assert(vc->gfx.esurface); in gd_egl_init()
70 QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf; in gd_egl_draw()
75 if (!vc->gfx.gls) { in gd_egl_draw()
79 window = gtk_widget_get_window(vc->gfx.drawing_area); in gd_egl_draw()
84 if (vc->gfx.scanout_mode) { in gd_egl_draw()
94 gd_egl_scanout_flush(&vc->gfx.dcl, 0, 0, vc->gfx.w, vc->gfx.h); in gd_egl_draw()
96 vc->gfx.scale_x = (double)ww / surface_width(vc->gfx.ds); in gd_egl_draw()
97 vc->gfx.scale_y = (double)wh / surface_height(vc->gfx.ds); in gd_egl_draw()
108 graphic_hw_gl_block(vc->gfx.dcl.con, false); in gd_egl_draw()
112 if (!vc->gfx.ds) { in gd_egl_draw()
115 eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, in gd_egl_draw()
116 vc->gfx.esurface, vc->gfx.ectx); in gd_egl_draw()
118 surface_gl_setup_viewport(vc->gfx.gls, vc->gfx.ds, ww, wh); in gd_egl_draw()
119 surface_gl_render_texture(vc->gfx.gls, vc->gfx.ds); in gd_egl_draw()
121 eglSwapBuffers(qemu_egl_display, vc->gfx.esurface); in gd_egl_draw()
123 vc->gfx.scale_x = (double)ww / surface_width(vc->gfx.ds); in gd_egl_draw()
124 vc->gfx.scale_y = (double)wh / surface_height(vc->gfx.ds); in gd_egl_draw()
133 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); in gd_egl_update()
135 if (!vc->gfx.gls || !vc->gfx.ds) { in gd_egl_update()
139 eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, in gd_egl_update()
140 vc->gfx.esurface, vc->gfx.ectx); in gd_egl_update()
141 surface_gl_update_texture(vc->gfx.gls, vc->gfx.ds, x, y, w, h); in gd_egl_update()
142 vc->gfx.glupdates++; in gd_egl_update()
149 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); in gd_egl_refresh()
152 vc, vc->window ? vc->window : vc->gfx.drawing_area); in gd_egl_refresh()
154 if (vc->gfx.guest_fb.dmabuf && in gd_egl_refresh()
155 qemu_dmabuf_get_draw_submitted(vc->gfx.guest_fb.dmabuf)) { in gd_egl_refresh()
160 if (!vc->gfx.esurface) { in gd_egl_refresh()
162 if (!vc->gfx.esurface) { in gd_egl_refresh()
165 vc->gfx.gls = qemu_gl_init_shader(); in gd_egl_refresh()
166 if (vc->gfx.ds) { in gd_egl_refresh()
167 surface_gl_destroy_texture(vc->gfx.gls, vc->gfx.ds); in gd_egl_refresh()
168 surface_gl_create_texture(vc->gfx.gls, vc->gfx.ds); in gd_egl_refresh()
171 if (vc->gfx.guest_fb.dmabuf) { in gd_egl_refresh()
172 egl_dmabuf_release_texture(vc->gfx.guest_fb.dmabuf); in gd_egl_refresh()
173 gd_egl_scanout_dmabuf(dcl, vc->gfx.guest_fb.dmabuf); in gd_egl_refresh()
180 if (vc->gfx.glupdates) { in gd_egl_refresh()
181 vc->gfx.glupdates = 0; in gd_egl_refresh()
190 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); in gd_egl_switch()
195 if (vc->gfx.ds && in gd_egl_switch()
196 surface_width(vc->gfx.ds) == surface_width(surface) && in gd_egl_switch()
197 surface_height(vc->gfx.ds) == surface_height(surface)) { in gd_egl_switch()
200 eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, in gd_egl_switch()
201 vc->gfx.esurface, vc->gfx.ectx); in gd_egl_switch()
203 surface_gl_destroy_texture(vc->gfx.gls, vc->gfx.ds); in gd_egl_switch()
204 vc->gfx.ds = surface; in gd_egl_switch()
205 if (vc->gfx.gls) { in gd_egl_switch()
206 surface_gl_create_texture(vc->gfx.gls, vc->gfx.ds); in gd_egl_switch()
220 VirtualConsole *vc = container_of(dgc, VirtualConsole, gfx.dgc); in gd_egl_create_context()
222 eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, in gd_egl_create_context()
223 vc->gfx.esurface, vc->gfx.ectx); in gd_egl_create_context()
229 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); in gd_egl_scanout_disable()
231 vc->gfx.w = 0; in gd_egl_scanout_disable()
232 vc->gfx.h = 0; in gd_egl_scanout_disable()
243 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); in gd_egl_scanout_texture()
245 vc->gfx.x = x; in gd_egl_scanout_texture()
246 vc->gfx.y = y; in gd_egl_scanout_texture()
247 vc->gfx.w = w; in gd_egl_scanout_texture()
248 vc->gfx.h = h; in gd_egl_scanout_texture()
249 vc->gfx.y0_top = backing_y_0_top; in gd_egl_scanout_texture()
251 if (!vc->gfx.esurface) { in gd_egl_scanout_texture()
253 if (!vc->gfx.esurface) { in gd_egl_scanout_texture()
258 eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, in gd_egl_scanout_texture()
259 vc->gfx.esurface, vc->gfx.ectx); in gd_egl_scanout_texture()
262 egl_fb_setup_for_tex(&vc->gfx.guest_fb, backing_width, backing_height, in gd_egl_scanout_texture()
270 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); in gd_egl_scanout_dmabuf()
274 eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, in gd_egl_scanout_dmabuf()
275 vc->gfx.esurface, vc->gfx.ectx); in gd_egl_scanout_dmabuf()
295 vc->gfx.guest_fb.dmabuf = dmabuf; in gd_egl_scanout_dmabuf()
305 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); in gd_egl_cursor_dmabuf()
317 egl_fb_setup_for_tex(&vc->gfx.cursor_fb, backing_width, backing_height, in gd_egl_cursor_dmabuf()
320 egl_fb_destroy(&vc->gfx.cursor_fb); in gd_egl_cursor_dmabuf()
328 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); in gd_egl_cursor_position()
330 vc->gfx.cursor_x = pos_x * vc->gfx.scale_x; in gd_egl_cursor_position()
331 vc->gfx.cursor_y = pos_y * vc->gfx.scale_y; in gd_egl_cursor_position()
337 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); in gd_egl_scanout_flush()
341 if (!vc->gfx.scanout_mode) { in gd_egl_scanout_flush()
344 if (!vc->gfx.guest_fb.framebuffer) { in gd_egl_scanout_flush()
348 eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, in gd_egl_scanout_flush()
349 vc->gfx.esurface, vc->gfx.ectx); in gd_egl_scanout_flush()
351 window = gtk_widget_get_window(vc->gfx.drawing_area); in gd_egl_scanout_flush()
355 egl_fb_setup_default(&vc->gfx.win_fb, ww, wh); in gd_egl_scanout_flush()
356 if (vc->gfx.cursor_fb.texture) { in gd_egl_scanout_flush()
357 egl_texture_blit(vc->gfx.gls, &vc->gfx.win_fb, &vc->gfx.guest_fb, in gd_egl_scanout_flush()
358 vc->gfx.y0_top); in gd_egl_scanout_flush()
359 egl_texture_blend(vc->gfx.gls, &vc->gfx.win_fb, &vc->gfx.cursor_fb, in gd_egl_scanout_flush()
360 vc->gfx.y0_top, in gd_egl_scanout_flush()
361 vc->gfx.cursor_x, vc->gfx.cursor_y, in gd_egl_scanout_flush()
362 vc->gfx.scale_x, vc->gfx.scale_y); in gd_egl_scanout_flush()
364 egl_fb_blit(&vc->gfx.win_fb, &vc->gfx.guest_fb, !vc->gfx.y0_top); in gd_egl_scanout_flush()
368 if (vc->gfx.guest_fb.dmabuf) { in gd_egl_scanout_flush()
369 egl_dmabuf_create_sync(vc->gfx.guest_fb.dmabuf); in gd_egl_scanout_flush()
373 eglSwapBuffers(qemu_egl_display, vc->gfx.esurface); in gd_egl_scanout_flush()
379 VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); in gd_egl_flush()
380 GtkWidget *area = vc->gfx.drawing_area; in gd_egl_flush()
382 if (vc->gfx.guest_fb.dmabuf && in gd_egl_flush()
383 !qemu_dmabuf_get_draw_submitted(vc->gfx.guest_fb.dmabuf)) { in gd_egl_flush()
384 graphic_hw_gl_block(vc->gfx.dcl.con, true); in gd_egl_flush()
385 qemu_dmabuf_set_draw_submitted(vc->gfx.guest_fb.dmabuf, true); in gd_egl_flush()
391 gd_egl_scanout_flush(&vc->gfx.dcl, x, y, w, h); in gd_egl_flush()
409 VirtualConsole *vc = container_of(dgc, VirtualConsole, gfx.dgc); in gd_egl_make_current()
411 if (!eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, in gd_egl_make_current()
412 vc->gfx.esurface, ctx)) { in gd_egl_make_current()