From patchwork Tue Aug 3 21:39:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tlb1144@gmx.net X-Patchwork-Id: 60797 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 2AB65B6EFF for ; Wed, 4 Aug 2010 07:42:00 +1000 (EST) Received: from localhost ([127.0.0.1]:48738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OgPFF-0003Vv-7m for incoming@patchwork.ozlabs.org; Tue, 03 Aug 2010 17:41:57 -0400 Received: from [140.186.70.92] (port=43243 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OgPD6-0001vi-UF for qemu-devel@nongnu.org; Tue, 03 Aug 2010 17:39:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OgPD5-00025T-3i for qemu-devel@nongnu.org; Tue, 03 Aug 2010 17:39:44 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:51341 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OgPD4-000259-K4 for qemu-devel@nongnu.org; Tue, 03 Aug 2010 17:39:43 -0400 Received: (qmail 19473 invoked by uid 0); 3 Aug 2010 21:39:39 -0000 Received: from 87.180.2.35 by www114.gmx.net with HTTP; Tue, 03 Aug 2010 23:39:36 +0200 (CEST) Date: Tue, 03 Aug 2010 23:39:37 +0200 From: tlb1144@gmx.net Message-ID: <20100803213937.157260@gmx.net> MIME-Version: 1.0 To: qemu-devel@nongnu.org X-Authenticated: #19058524 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX18Xx6MhVy8XT/rEAP6Jz+42XNWsWcjGTPpgv/tbfr 1QYNwQYAwOpItZz1obMkHsMm+wJEA6vWZvBA== X-GMX-UID: 0co+JgZLaHItSSadBCQlNgxiamdhZMSp X-FuHaFi: 0.48999999999999999 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [Patch] Cirrus_vga: More than 1024 lines 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 Cirrus VGA implementation supports 10 bits to set the number of scanlines which results in a maximum of 1024 pixel for vertical resolution. For large monitors (e.g. portrait monitor) it would be nice to have more lines. According to Cirrus technical documentation in gd5446trm.pdf (can be found e.g. here: http://www.tjd.phlegethon.org/gd5446trm.pdf.gz) page 4-55 chapter 4.44, CRTC Mode Control (CR17) bit 2 supports "Multiply Vertical Registers by Two: If this bit is '1', the scanline counter is clocked with HSYNC divided by two. This allows the number of scanlines to be doubled to 2048." This can be used in hw/cirrus_vga.c in functions cirrus_get_offsets() and cirrus_get_resolution(). With this patch and a patch for vgabios (described in 2nd mail), I was able to create a mode 1024x1536 (from 1024x768) which I use in qemu-0.12.5 with a portrait monitor. diff -r -u a/hw/cirrus_vga.c b/hw/cirrus_vga.c --- a/hw/cirrus_vga.c 2010-07-22 14:39:04.000000000 +0200 +++ b/hw/cirrus_vga.c 2010-07-31 22:17:57.000000000 +0200 @@ -1062,6 +1062,13 @@ line_compare = s->vga.cr[0x18] | ((s->vga.cr[0x07] & 0x10) << 4) | ((s->vga.cr[0x09] & 0x40) << 3); + + /* Multiply Vertical Registers by Two */ + if ((s->vga.cr[0x17] & 0x04)) + { + line_compare = line_compare * 2; + } + *pline_compare = line_compare; } @@ -1134,6 +1141,13 @@ ((s->cr[0x07] & 0x02) << 7) | ((s->cr[0x07] & 0x40) << 3); height = (height + 1); + + /* Multiply Vertical Registers by Two */ + if ((s->cr[0x17] & 0x04)) + { + height = height * 2; + } + /* interlace support */ if (s->cr[0x1a] & 0x01) height = height * 2;