aboutsummaryrefslogtreecommitdiff
path: root/ui/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/console.c')
-rw-r--r--ui/console.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/ui/console.c b/ui/console.c
index 40eebb6..365a2c1 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1860,7 +1860,9 @@ void dpy_gl_scanout_disable(QemuConsole *con)
con->scanout.kind = SCANOUT_NONE;
}
QLIST_FOREACH(dcl, &s->listeners, next) {
- dcl->ops->dpy_gl_scanout_disable(dcl);
+ if (dcl->ops->dpy_gl_scanout_disable) {
+ dcl->ops->dpy_gl_scanout_disable(dcl);
+ }
}
}
@@ -1881,10 +1883,12 @@ void dpy_gl_scanout_texture(QemuConsole *con,
x, y, width, height
};
QLIST_FOREACH(dcl, &s->listeners, next) {
- dcl->ops->dpy_gl_scanout_texture(dcl, backing_id,
- backing_y_0_top,
- backing_width, backing_height,
- x, y, width, height);
+ if (dcl->ops->dpy_gl_scanout_texture) {
+ dcl->ops->dpy_gl_scanout_texture(dcl, backing_id,
+ backing_y_0_top,
+ backing_width, backing_height,
+ x, y, width, height);
+ }
}
}
@@ -1897,7 +1901,9 @@ void dpy_gl_scanout_dmabuf(QemuConsole *con,
con->scanout.kind = SCANOUT_DMABUF;
con->scanout.dmabuf = dmabuf;
QLIST_FOREACH(dcl, &s->listeners, next) {
- dcl->ops->dpy_gl_scanout_dmabuf(dcl, dmabuf);
+ if (dcl->ops->dpy_gl_scanout_dmabuf) {
+ dcl->ops->dpy_gl_scanout_dmabuf(dcl, dmabuf);
+ }
}
}
@@ -1951,7 +1957,9 @@ void dpy_gl_update(QemuConsole *con,
graphic_hw_gl_block(con, true);
QLIST_FOREACH(dcl, &s->listeners, next) {
- dcl->ops->dpy_gl_update(dcl, x, y, w, h);
+ if (dcl->ops->dpy_gl_update) {
+ dcl->ops->dpy_gl_update(dcl, x, y, w, h);
+ }
}
graphic_hw_gl_block(con, false);
}
@@ -2392,13 +2400,12 @@ static void vc_chr_open(Chardev *chr,
void qemu_console_resize(QemuConsole *s, int width, int height)
{
- DisplaySurface *surface = qemu_console_surface(s);
+ DisplaySurface *surface;
assert(s->console_type == GRAPHIC_CONSOLE);
- if (surface && (surface->flags & QEMU_ALLOCATED_FLAG) &&
- pixman_image_get_width(surface->image) == width &&
- pixman_image_get_height(surface->image) == height) {
+ if (qemu_console_get_width(s, -1) == width &&
+ qemu_console_get_height(s, -1) == height) {
return;
}