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>
Subject: [Qemu-devel] [PATCH 11/14] pl110: move resize
Date: Tue,  2 Sep 2014 10:00:24 +0200	[thread overview]
Message-ID: <1409644827-26317-12-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1409644827-26317-1-git-send-email-kraxel@redhat.com>

Handle display resizes in the update callback.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/pl110.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/hw/display/pl110.c b/hw/display/pl110.c
index 78b146b..f788382 100644
--- a/hw/display/pl110.c
+++ b/hw/display/pl110.c
@@ -200,6 +200,13 @@ static void pl110_update_display(void *opaque)
         break;
     }
 
+    /* handle resize */
+    if (surface_width(surface) != s->cols ||
+        surface_height(surface) != s->rows) {
+        qemu_console_resize(s->con, s->cols, s->rows);
+        surface = qemu_console_surface(s->con);
+    }
+
     g_assert(surface_bits_per_pixel(surface) == 32);
     dest_width = 4 * s->cols;
     first = 0;
@@ -219,9 +226,6 @@ static void pl110_invalidate_display(void * opaque)
 {
     PL110State *s = (PL110State *)opaque;
     s->invalidate = 1;
-    if (pl110_enabled(s)) {
-        qemu_console_resize(s->con, s->cols, s->rows);
-    }
 }
 
 static void pl110_update_palette(PL110State *s, int n)
@@ -254,11 +258,6 @@ static void pl110_update_palette(PL110State *s, int n)
 
 static void pl110_resize(PL110State *s, int width, int height)
 {
-    if (width != s->cols || height != s->rows) {
-        if (pl110_enabled(s)) {
-            qemu_console_resize(s->con, width, height);
-        }
-    }
     s->cols = width;
     s->rows = height;
 }
@@ -373,9 +372,6 @@ static void pl110_write(void *opaque, hwaddr offset,
     control:
         s->cr = val;
         s->bpp = (val >> 1) & 7;
-        if (pl110_enabled(s)) {
-            qemu_console_resize(s->con, s->cols, s->rows);
-        }
         break;
     case 10: /* LCDICR */
         s->int_status &= ~val;
-- 
1.8.3.1

  parent reply	other threads:[~2014-09-02  8:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02  8:00 [Qemu-devel] [PATCH 00/14] console/pl110: pixman conversion continued Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 01/14] console: add qemu_pixelformat_from_pixman Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 02/14] console: add qemu_default_pixman_format Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 03/14] console: reimplement qemu_default_pixelformat Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 04/14] console: stop using PixelFormat Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 05/14] console: add qemu_create_displaysurface_guestmem Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 06/14] console: add dpy_gfx_update_dirty Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 07/14] console: add qemu_pixman_linebuf_copy Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 08/14] console: Remove unused QEMU_BIG_ENDIAN_FLAG Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 09/14] pl110: add framebuffer_update_display_swap_pixman Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 10/14] pl100: Drop support for depths other than 32bpp Gerd Hoffmann
2014-09-02  8:00 ` Gerd Hoffmann [this message]
2014-09-02  8:00 ` [Qemu-devel] [PATCH 12/14] [wip] pl110: start using pixman Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 13/14] [wip] pl110: switch some conversions to swap+pixman mode Gerd Hoffmann
2014-09-02  8:00 ` [Qemu-devel] [PATCH 14/14] [wip] pl110: start handling paletted images via pixman Gerd Hoffmann

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=1409644827-26317-12-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).