From patchwork Thu Mar 25 10:38:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 48512 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 355BBB7C7E for ; Thu, 25 Mar 2010 21:40:16 +1100 (EST) Received: from localhost ([127.0.0.1]:57689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NukU0-0003PY-3m for incoming@patchwork.ozlabs.org; Thu, 25 Mar 2010 06:40:12 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NukSq-0003PB-Fp for qemu-devel@nongnu.org; Thu, 25 Mar 2010 06:39:00 -0400 Received: from [140.186.70.92] (port=57795 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NukSo-0003Or-Kv for qemu-devel@nongnu.org; Thu, 25 Mar 2010 06:38:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NukSm-0000Ln-24 for qemu-devel@nongnu.org; Thu, 25 Mar 2010 06:38:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15881) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NukSl-0000Li-Mp for qemu-devel@nongnu.org; Thu, 25 Mar 2010 06:38:56 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2PAcsiK031689 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 25 Mar 2010 06:38:54 -0400 Received: from zweiblum.home.kraxel.org (vpn2-10-226.ams2.redhat.com [10.36.10.226]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2PAcqu6010059; Thu, 25 Mar 2010 06:38:53 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 66DCB7010F; Thu, 25 Mar 2010 11:38:52 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 25 Mar 2010 11:38:52 +0100 Message-Id: <1269513532-7522-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH v3] update bochs vbe interface X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The bochs vbe interface got a new register a while back, which specifies the linear framebuffer size in 64k units. This patch adds support for the new register to qemu. With this patch applied vgabios 0.6c works with qemu. [ v2: Don't savevm the new register. Doing so breaks migration, and as it carries read-only information for the guest there is no need to save it. ] [ v3: Don't put the new register into vbe_regs. ] Signed-off-by: Gerd Hoffmann --- hw/vga.c | 6 ++++-- hw/vga_int.h | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/vga.c b/hw/vga.c index 6a1a059..bb65677 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -522,7 +522,7 @@ static uint32_t vbe_ioport_read_data(void *opaque, uint32_t addr) VGACommonState *s = opaque; uint32_t val; - if (s->vbe_index <= VBE_DISPI_INDEX_NB) { + if (s->vbe_index < VBE_DISPI_INDEX_NB) { if (s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_GETCAPS) { switch(s->vbe_index) { /* XXX: do not hardcode ? */ @@ -542,6 +542,8 @@ static uint32_t vbe_ioport_read_data(void *opaque, uint32_t addr) } else { val = s->vbe_regs[s->vbe_index]; } + } else if (s->vbe_index == VBE_DISPI_INDEX_VIDEO_MEMORY_64K) { + val = s->vram_size / (64 * 1024); } else { val = 0; } @@ -1955,7 +1957,7 @@ void vga_common_reset(VGACommonState *s) #ifdef CONFIG_BOCHS_VBE s->vbe_index = 0; memset(s->vbe_regs, '\0', sizeof(s->vbe_regs)); - s->vbe_regs[VBE_DISPI_INDEX_ID] = VBE_DISPI_ID0; + s->vbe_regs[VBE_DISPI_INDEX_ID] = VBE_DISPI_ID5; s->vbe_start_addr = 0; s->vbe_line_offset = 0; s->vbe_bank_mask = (s->vram_size >> 16) - 1; diff --git a/hw/vga_int.h b/hw/vga_int.h index 23a42ef..6a46a43 100644 --- a/hw/vga_int.h +++ b/hw/vga_int.h @@ -47,13 +47,15 @@ #define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7 #define VBE_DISPI_INDEX_X_OFFSET 0x8 #define VBE_DISPI_INDEX_Y_OFFSET 0x9 -#define VBE_DISPI_INDEX_NB 0xa +#define VBE_DISPI_INDEX_NB 0xa /* size of vbe_regs[] */ +#define VBE_DISPI_INDEX_VIDEO_MEMORY_64K 0xa /* read-only, not in vbe_regs */ #define VBE_DISPI_ID0 0xB0C0 #define VBE_DISPI_ID1 0xB0C1 #define VBE_DISPI_ID2 0xB0C2 #define VBE_DISPI_ID3 0xB0C3 #define VBE_DISPI_ID4 0xB0C4 +#define VBE_DISPI_ID5 0xB0C5 #define VBE_DISPI_DISABLED 0x00 #define VBE_DISPI_ENABLED 0x01