#endif
gd_egl_scanout_flush(&vc->gfx.dcl, 0, 0, vc->gfx.w, vc->gfx.h);
- vc->gfx.scale_x = (double)ww / vc->gfx.w;
- vc->gfx.scale_y = (double)wh / vc->gfx.h;
+ vc->gfx.scale_x = (double)ww / surface_width(vc->gfx.ds);
+ vc->gfx.scale_y = (double)wh / surface_height(vc->gfx.ds);
glFlush();
#ifdef CONFIG_GBM
glFlush();
}
-
- graphic_hw_gl_flushed(vc->gfx.dcl.con);
}
void gd_egl_update(DisplayChangeListener *dcl,
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
- vc->gfx.dcl.update_interval = gd_monitor_update_interval(
- vc->window ? vc->window : vc->gfx.drawing_area);
+ gd_update_monitor_refresh_rate(
+ vc, vc->window ? vc->window : vc->gfx.drawing_area);
if (!vc->gfx.esurface) {
gd_egl_init(vc);
surface_gl_destroy_texture(vc->gfx.gls, vc->gfx.ds);
surface_gl_create_texture(vc->gfx.gls, vc->gfx.ds);
}
+#ifdef CONFIG_GBM
if (vc->gfx.guest_fb.dmabuf) {
egl_dmabuf_release_texture(vc->gfx.guest_fb.dmabuf);
gd_egl_scanout_dmabuf(dcl, vc->gfx.guest_fb.dmabuf);
}
+#endif
}
graphic_hw_update(dcl->con);
if (resized) {
gd_update_windowsize(vc);
}
+
+ eglMakeCurrent(qemu_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
+ EGL_NO_CONTEXT);
}
-QEMUGLContext gd_egl_create_context(DisplayChangeListener *dcl,
+QEMUGLContext gd_egl_create_context(DisplayGLCtx *dgc,
QEMUGLParams *params)
{
- VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
+ VirtualConsole *vc = container_of(dgc, VirtualConsole, gfx.dgc);
eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
vc->gfx.esurface, vc->gfx.ectx);
- return qemu_egl_create_context(dcl, params);
+ return qemu_egl_create_context(dgc, params);
}
void gd_egl_scanout_disable(DisplayChangeListener *dcl)
}
gd_egl_scanout_texture(dcl, dmabuf->texture,
- false, dmabuf->width, dmabuf->height,
- 0, 0, dmabuf->width, dmabuf->height);
+ dmabuf->y0_top, dmabuf->width, dmabuf->height,
+ dmabuf->x, dmabuf->y, dmabuf->scanout_width,
+ dmabuf->scanout_height);
if (dmabuf->allow_fences) {
vc->gfx.guest_fb.dmabuf = dmabuf;
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
GtkWidget *area = vc->gfx.drawing_area;
- if (vc->gfx.guest_fb.dmabuf) {
+ if (vc->gfx.guest_fb.dmabuf && !vc->gfx.guest_fb.dmabuf->draw_submitted) {
graphic_hw_gl_block(vc->gfx.dcl.con, true);
vc->gfx.guest_fb.dmabuf->draw_submitted = true;
gtk_widget_queue_draw_area(area, x, y, w, h);
display_opengl = 1;
}
-int gd_egl_make_current(DisplayChangeListener *dcl,
+int gd_egl_make_current(DisplayGLCtx *dgc,
QEMUGLContext ctx)
{
- VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
+ VirtualConsole *vc = container_of(dgc, VirtualConsole, gfx.dgc);
return eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
vc->gfx.esurface, ctx);