From patchwork Tue Sep 2 08:00:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 384997 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 86C4014017F for ; Tue, 2 Sep 2014 18:01:43 +1000 (EST) Received: from localhost ([::1]:36392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOj25-0006ud-Mo for incoming@patchwork.ozlabs.org; Tue, 02 Sep 2014 04:01:41 -0400 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 Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8280i2Z027854; Tue, 2 Sep 2014 04:00:45 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 0E20C808D3; Tue, 2 Sep 2014 10:00:42 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 11/14] pl110: move resize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;