[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 09/12] ui/console: optionally update after gfx switch
From: |
marcandre . lureau |
Subject: |
[PATCH v3 09/12] ui/console: optionally update after gfx switch |
Date: |
Mon, 7 Mar 2022 11:46:29 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
When switching to the dummy surface, we should also call gfx_update.
But when using GL, we shouldn't call it.
By making it an argument to displaychangelistener_gfx_switch(), it will
be explicit, and cannot be forgotten that easily.
Fixes: commit ebced091 ("console: save current scanout details")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
ui/console.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/ui/console.c b/ui/console.c
index 102fcf0a5068..06ba82db61c9 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1059,11 +1059,18 @@ static void console_putchar(QemuConsole *s, int ch)
}
static void displaychangelistener_gfx_switch(DisplayChangeListener *dcl,
- struct DisplaySurface
*new_surface)
+ struct DisplaySurface
*new_surface,
+ bool update)
{
if (dcl->ops->dpy_gfx_switch) {
dcl->ops->dpy_gfx_switch(dcl, new_surface);
}
+
+ if (update && dcl->ops->dpy_gfx_update) {
+ dcl->ops->dpy_gfx_update(dcl, 0, 0,
+ surface_width(new_surface),
+ surface_height(new_surface));
+ }
}
@@ -1079,7 +1086,7 @@ static void
displaychangelistener_display_console(DisplayChangeListener *dcl,
if (!dummy) {
dummy = qemu_create_placeholder_surface(640, 480, nodev);
}
- displaychangelistener_gfx_switch(dcl, dummy);
+ displaychangelistener_gfx_switch(dcl, dummy, TRUE);
return;
}
@@ -1098,12 +1105,8 @@ static void
displaychangelistener_display_console(DisplayChangeListener *dcl,
con->scanout.texture.width,
con->scanout.texture.height);
} else if (con->scanout.kind == SCANOUT_SURFACE) {
- displaychangelistener_gfx_switch(dcl, con->surface);
+ displaychangelistener_gfx_switch(dcl, con->surface, TRUE);
}
-
- dcl->ops->dpy_gfx_update(dcl, 0, 0,
- qemu_console_get_width(con, 0),
- qemu_console_get_height(con, 0));
}
void console_select(unsigned int index)
@@ -1682,7 +1685,7 @@ void dpy_gfx_replace_surface(QemuConsole *con,
if (con != (dcl->con ? dcl->con : active_console)) {
continue;
}
- displaychangelistener_gfx_switch(dcl, surface);
+ displaychangelistener_gfx_switch(dcl, surface, FALSE);
}
qemu_free_displaysurface(old_surface);
}
--
2.35.1.273.ge6ebfd0e8cbb
- [PATCH v3 00/12] GL & D-Bus display related fixes, marcandre . lureau, 2022/03/07
- [PATCH v3 01/12] ui/console: move check for compatible GL context, marcandre . lureau, 2022/03/07
- [PATCH v3 02/12] ui/console: move dcl compatiblity check to a callback, marcandre . lureau, 2022/03/07
- [PATCH v3 03/12] ui/console: egl-headless is compatible with non-gl listeners, marcandre . lureau, 2022/03/07
- [PATCH v3 04/12] ui/dbus: associate the DBusDisplayConsole listener with the given console, marcandre . lureau, 2022/03/07
- [PATCH v3 05/12] ui/console: move console compatibility check to dcl_display_console(), marcandre . lureau, 2022/03/07
- [PATCH v3 06/12] ui/shader: fix potential leak of shader on error, marcandre . lureau, 2022/03/07
- [PATCH v3 07/12] ui/shader: free associated programs, marcandre . lureau, 2022/03/07
- [PATCH v3 08/12] ui/console: add a dpy_gfx_switch callback helper, marcandre . lureau, 2022/03/07
- [PATCH v3 09/12] ui/console: optionally update after gfx switch,
marcandre . lureau <=
- [PATCH v3 10/12] ui/dbus: fix texture sharing, marcandre . lureau, 2022/03/07
- [PATCH v3 11/12] ui/dbus: do not send 2d scanout until gfx_update, marcandre . lureau, 2022/03/07
- [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, marcandre . lureau, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Akihiko Odaki, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Marc-André Lureau, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Akihiko Odaki, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Marc-André Lureau, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Akihiko Odaki, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Marc-André Lureau, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Akihiko Odaki, 2022/03/07