From patchwork Wed May 25 15:56:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 97372 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 57893B6F95 for ; Thu, 26 May 2011 01:56:21 +1000 (EST) Received: from localhost ([::1]:45237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPGRW-0007Dt-RL for incoming@patchwork.ozlabs.org; Wed, 25 May 2011 11:56:18 -0400 Received: from eggs.gnu.org ([140.186.70.92]:49266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPGRP-0007DZ-1e for qemu-devel@nongnu.org; Wed, 25 May 2011 11:56:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPGRO-0007A0-0x for qemu-devel@nongnu.org; Wed, 25 May 2011 11:56:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPGRN-00079u-QJ for qemu-devel@nongnu.org; Wed, 25 May 2011 11:56:09 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4PFu9NX007366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 May 2011 11:56:09 -0400 Received: from playa.tlv.redhat.com (dhcp-3-110.tlv.redhat.com [10.35.3.110]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4PFu7fk014653; Wed, 25 May 2011 11:56:07 -0400 From: Alon Levy To: qemu-devel@nongnu.org, kraxel@redhat.com, yhalperi@redhat.com Date: Wed, 25 May 2011 18:56:05 +0300 Message-Id: <1306338965-6119-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFCv2] vga: VBE: report maximum VGA_MEM_SIZE memory 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 When using -vga qxl the amount reported is minimally 32 MiB, making windows guests come up in a 16 color mode. With this change they work correctly, coming up with the full range of VBE supported modes. This patch changes just the reported memory size by VBE (VBE_DISPI_INDEX_VIDEO_MEMORY_64K) and not the actual vram_size like my previous try. --- hw/vga.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/hw/vga.c b/hw/vga.c index 124295a..07048bc 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -545,7 +545,14 @@ static uint32_t vbe_ioport_read_data(void *opaque, uint32_t addr) val = s->vbe_regs[s->vbe_index]; } } else if (s->vbe_index == VBE_DISPI_INDEX_VIDEO_MEMORY_64K) { - val = s->vram_size / (64 * 1024); + /* + * windows xp guests don't like larger then VGA_RAM_SIZE (8 MiB), + * wrongly setting the display to 4 bit color depth. This fix doesn't + * affect native mode, where we have modes that require larger amounts + * of ram. (The maximum that VBE reports is 1600x1200 32 bit color depth + * which fits) + */ + val = MIN(VGA_RAM_SIZE, s->vram_size) / (64 * 1024); } else { val = 0; }