From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOj1M-0005h8-8k for qemu-devel@nongnu.org; Tue, 02 Sep 2014 04:01:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOj1E-0004gT-Hv for qemu-devel@nongnu.org; Tue, 02 Sep 2014 04:00:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOj1E-0004fl-9R for qemu-devel@nongnu.org; Tue, 02 Sep 2014 04:00:48 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8280kgV011190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 2 Sep 2014 04:00:47 -0400 From: Gerd Hoffmann Date: Tue, 2 Sep 2014 10:00:24 +0200 Message-Id: <1409644827-26317-12-git-send-email-kraxel@redhat.com> In-Reply-To: <1409644827-26317-1-git-send-email-kraxel@redhat.com> References: <1409644827-26317-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 11/14] pl110: move resize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Handle display resizes in the update callback. Signed-off-by: Gerd Hoffmann --- 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