From patchwork Fri Jun 24 16:56:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 101833 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 27F40B6F87 for ; Sat, 25 Jun 2011 03:27:25 +1000 (EST) Received: from localhost ([::1]:35206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QaAA5-0003fC-1q for incoming@patchwork.ozlabs.org; Fri, 24 Jun 2011 13:27:21 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qa9hE-0004Rc-Ui for qemu-devel@nongnu.org; Fri, 24 Jun 2011 12:57:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qa9hD-0001Uy-0F for qemu-devel@nongnu.org; Fri, 24 Jun 2011 12:57:32 -0400 Received: from mail-fx0-f45.google.com ([209.85.161.45]:64284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qa9hC-0001QQ-9F for qemu-devel@nongnu.org; Fri, 24 Jun 2011 12:57:30 -0400 Received: by mail-fx0-f45.google.com with SMTP id 12so94133fxg.4 for ; Fri, 24 Jun 2011 09:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=gPschpMr+oelBLJo3sjQ/2J5Z4oD0YMd4vnXWhRgNPo=; b=wiofS2+cjCLhjt+rhRejM6/ZVHt4xlSXAFbZw79Ul5HlR3mH4oDDB0fVRyEFjlE+ih lV1yqMeClYdDhRxWf/1vE0mh/PgZtcrLnq959wq7dRXFpZGYtwIxwlcUTHpgv701YAqP REbqQ8pi2BXB94YGwuLHefUp/SkYn/SMOfPIE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=WcRc+6t/DoEUH7vjENGWxAgotAiIb2wtiwWHJrHuNqUFOqFcD6viWNzOLInRV+7qbV xwat+Gv0UT4elBQFB7ZOf6Qr32x7dSAAQsNkSQEkISKway1mqQqbfibf1qkE++54qpJe UPi940LSar1tyCD1/He9TaOSxT9xGT6bGDKUM= Received: by 10.223.53.84 with SMTP id l20mr4740767fag.48.1308934649782; Fri, 24 Jun 2011 09:57:29 -0700 (PDT) Received: from localhost.localdomain (gbibp9ph1--blueice3n2.emea.ibm.com [195.212.29.84]) by mx.google.com with ESMTPS id h28sm1763884faj.5.2011.06.24.09.57.28 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Jun 2011 09:57:28 -0700 (PDT) From: Stefan Hajnoczi To: Date: Fri, 24 Jun 2011 17:56:38 +0100 Message-Id: <1308934609-20824-3-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1308934609-20824-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1308934609-20824-1-git-send-email-stefanha@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.45 Cc: Jan Kiszka , Anthony Liguori , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 02/13] Align dummy display to fixed-size active console 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 From: Jan Kiszka This fixes e.g. '-vga none -monitor vc:120Cx50C'. Signed-off-by: Jan Kiszka Signed-off-by: Stefan Hajnoczi --- console.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/console.c b/console.c index 9c6addf..acd8ca1 100644 --- a/console.c +++ b/console.c @@ -1349,8 +1349,15 @@ static struct DisplayAllocator default_allocator = { static void dumb_display_init(void) { DisplayState *ds = qemu_mallocz(sizeof(DisplayState)); + int width = 640; + int height = 480; + ds->allocator = &default_allocator; - ds->surface = qemu_create_displaysurface(ds, 640, 480); + if (is_fixedsize_console()) { + width = active_console->g_width; + height = active_console->g_height; + } + ds->surface = qemu_create_displaysurface(ds, width, height); register_displaystate(ds); }