qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Gerd Hoffmann" <kraxel@redhat.com>,
	1658634@bugs.launchpad.net,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH] console: fix console resize
Date: Tue, 24 Jan 2017 11:20:17 +0100	[thread overview]
Message-ID: <1485253217-7405-1-git-send-email-kraxel@redhat.com> (raw)

Only skip surface reallocation in case the old surface was created using
qemu_alloc_display (via qemu_create_displaysurface) too, otherwise we
might end up with a DisplaySurface with the wrong backing storage.

Cc: 1658634@bugs.launchpad.net
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Fixes: cd958edb1fae85d0c7d1e1acbff82d22724e8d64
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/console.c b/ui/console.c
index b9575f2..67c65b7 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2121,7 +2121,7 @@ void qemu_console_resize(QemuConsole *s, int width, int height)
 
     assert(s->console_type == GRAPHIC_CONSOLE);
 
-    if (s->surface &&
+    if (s->surface && (surface->flags & QEMU_ALLOCATED_FLAG) &&
         pixman_image_get_width(s->surface->image) == width &&
         pixman_image_get_height(s->surface->image) == height) {
         return;
-- 
1.8.3.1

         reply	other threads:[~2017-01-24 10:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23  9:57 [Qemu-devel] [Bug 1658634] [NEW] Can't get correct display with latest QEMU and OVMF BIOS Kai Cong
2017-01-23 12:50 ` [Qemu-devel] [Bug 1658634] " Laszlo Ersek (Red Hat)
2017-01-24  4:04   ` Kai Cong
2017-01-24  9:06 ` Laszlo Ersek (Red Hat)
2017-01-24  9:09 ` Laszlo Ersek (Red Hat)
2017-01-24  9:12 ` Laszlo Ersek (Red Hat)
2017-01-24 10:20 ` Gerd Hoffmann [this message]
2017-01-24 10:37   ` [Qemu-devel] [Bug 1658634] [PATCH] console: fix console resize elmarco
2017-01-24 11:10     ` Gerd Hoffmann
2017-01-24 11:20     ` Laszlo Ersek (Red Hat)
2017-01-24 11:13   ` [Qemu-devel] " no-reply
2017-01-24 22:59 ` [Qemu-devel] [Bug 1658634] Re: Can't get correct display with latest QEMU and OVMF BIOS Kai Cong
2020-08-12 11:58 ` Laszlo Ersek (Red Hat)

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=1485253217-7405-1-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=1658634@bugs.launchpad.net \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.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).