From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Paul Durrant" <paul@xen.org>,
xen-devel@lists.xenproject.org,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Anthony PERARD" <anthony@xenproject.org>,
qemu-stable@nongnu.org
Subject: [PATCH v3 1/3] stdvga: fix screen blanking
Date: Wed, 5 Jun 2024 15:14:41 +0200 [thread overview]
Message-ID: <20240605131444.797896-2-kraxel@redhat.com> (raw)
In-Reply-To: <20240605131444.797896-1-kraxel@redhat.com>
In case the display surface uses a shared buffer (i.e. uses vga vram
directly instead of a shadow) go unshare the buffer before clearing it.
This avoids vga memory corruption, which in turn fixes unblanking not
working properly with X11.
Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2067
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/display/vga.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 30facc6c8e33..474b6b14c327 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1762,6 +1762,12 @@ static void vga_draw_blank(VGACommonState *s, int full_update)
if (s->last_scr_width <= 0 || s->last_scr_height <= 0)
return;
+ if (is_buffer_shared(surface)) {
+ /* unshare buffer, otherwise the blanking corrupts vga vram */
+ surface = qemu_create_displaysurface(s->last_scr_width, s->last_scr_height);
+ dpy_gfx_replace_surface(s->con, surface);
+ }
+
w = s->last_scr_width * surface_bytes_per_pixel(surface);
d = surface_data(surface);
for(i = 0; i < s->last_scr_height; i++) {
--
2.45.1
next prev parent reply other threads:[~2024-06-05 13:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 13:14 [PATCH v3 0/3] stdvga: fix screen blanking Gerd Hoffmann
2024-06-05 13:14 ` Gerd Hoffmann [this message]
2024-06-05 13:14 ` [PATCH v3 2/3] ui+display: rename is_placeholder() -> surface_is_placeholder() Gerd Hoffmann
2024-06-18 11:02 ` Philippe Mathieu-Daudé
2024-06-05 13:14 ` [PATCH v3 3/3] ui+display: rename is_buffer_shared() -> surface_is_allocated() Gerd Hoffmann
2024-06-06 8:36 ` Paul Durrant
2024-06-05 13:26 ` [PATCH v3 0/3] stdvga: fix screen blanking Marc-André Lureau
2024-06-18 11:08 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240605131444.797896-2-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=anthony@xenproject.org \
--cc=marcandre.lureau@redhat.com \
--cc=paul@xen.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).