From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] qxl: make sure we continue to run with a shared buffer
Date: Tue, 25 Oct 2011 14:34:33 +0200 [thread overview]
Message-ID: <1319546073-25024-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1319546073-25024-1-git-send-email-kraxel@redhat.com>
The qxl renderer works only with a shared displaysurface. So better
make sure we actually have one and restore it when needed.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl-render.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/hw/qxl-render.c b/hw/qxl-render.c
index a567693..2c51ba9 100644
--- a/hw/qxl-render.c
+++ b/hw/qxl-render.c
@@ -76,7 +76,14 @@ void qxl_render_update(PCIQXLDevice *qxl)
VGACommonState *vga = &qxl->vga;
QXLRect dirty[32], update;
void *ptr;
- int i;
+ int i, redraw = 0;
+
+ if (!is_buffer_shared(vga->ds->surface)) {
+ dprint(qxl, 1, "%s: restoring shared displaysurface\n", __func__);
+ qxl->guest_primary.resized++;
+ qxl->guest_primary.commands++;
+ redraw = 1;
+ }
if (qxl->guest_primary.resized) {
qxl->guest_primary.resized = 0;
@@ -127,6 +134,10 @@ void qxl_render_update(PCIQXLDevice *qxl)
memset(dirty, 0, sizeof(dirty));
qxl_spice_update_area(qxl, 0, &update,
dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
+ if (redraw) {
+ memset(dirty, 0, sizeof(dirty));
+ dirty[0] = update;
+ }
for (i = 0; i < ARRAY_SIZE(dirty); i++) {
if (qemu_spice_rect_is_empty(dirty+i)) {
--
1.7.1
next prev parent reply other threads:[~2011-10-25 12:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-25 12:34 [Qemu-devel] [PATCH 0/2] qxl: local rendering fixes Gerd Hoffmann
2011-10-25 12:34 ` [Qemu-devel] [PATCH 1/2] qxl: stride fixup Gerd Hoffmann
2011-10-25 12:34 ` Gerd Hoffmann [this message]
2011-10-25 13:35 ` [Qemu-devel] [PATCH 0/2] qxl: local rendering fixes Alon Levy
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=1319546073-25024-3-git-send-email-kraxel@redhat.com \
--to=kraxel@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).