From patchwork Mon Aug 24 16:42:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 31979 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 bilbo.ozlabs.org (Postfix) with ESMTPS id B958AB7B63 for ; Tue, 25 Aug 2009 03:29:30 +1000 (EST) Received: from localhost ([127.0.0.1]:36722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfdMF-00062a-Se for incoming@patchwork.ozlabs.org; Mon, 24 Aug 2009 13:29:27 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mfcfx-00017X-Q6 for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mfcfr-0000xe-Fx for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:43 -0400 Received: from [199.232.76.173] (port=33816 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mfcfr-0000x8-4M for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48540) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mfcfq-00035P-Fe for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:38 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7OGjbcR005010 for ; Mon, 24 Aug 2009 12:45:37 -0400 Received: from localhost.localdomain (vpn1-4-157.ams2.redhat.com [10.36.4.157]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7OGjKU5024317; Mon, 24 Aug 2009 12:45:36 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 24 Aug 2009 18:42:47 +0200 Message-Id: <174b3d6d69e24e4735b851d566cbf8cbb4cdae0b.1251131364.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 13/26] Everything outside of vga.c should use VGACommonState 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 Signed-off-by: Juan Quintela --- hw/cirrus_vga.c | 10 +++++----- hw/vga.c | 4 +++- hw/vga_int.h | 10 ++++------ hw/vmware_vga.c | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index 8ac30be..bc635e9 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c @@ -1078,7 +1078,7 @@ static void cirrus_write_bitblt(CirrusVGAState * s, unsigned reg_value) * ***************************************/ -static void cirrus_get_offsets(VGAState *s1, +static void cirrus_get_offsets(VGACommonState *s1, uint32_t *pline_offset, uint32_t *pstart_addr, uint32_t *pline_compare) @@ -1126,7 +1126,7 @@ static uint32_t cirrus_get_bpp16_depth(CirrusVGAState * s) return ret; } -static int cirrus_get_bpp(VGAState *s1) +static int cirrus_get_bpp(VGACommonState *s1) { CirrusVGAState * s = container_of(s1, CirrusVGAState, vga); uint32_t ret = 8; @@ -1164,7 +1164,7 @@ static int cirrus_get_bpp(VGAState *s1) return ret; } -static void cirrus_get_resolution(VGAState *s, int *pwidth, int *pheight) +static void cirrus_get_resolution(VGACommonState *s, int *pwidth, int *pheight) { int width, height; @@ -2234,7 +2234,7 @@ static inline void cirrus_cursor_compute_yrange(CirrusVGAState *s) /* NOTE: we do not currently handle the cursor bitmap change, so we update the cursor only if it moves. */ -static void cirrus_cursor_invalidate(VGAState *s1) +static void cirrus_cursor_invalidate(VGACommonState *s1) { CirrusVGAState *s = container_of(s1, CirrusVGAState, vga); int size; @@ -2263,7 +2263,7 @@ static void cirrus_cursor_invalidate(VGAState *s1) } } -static void cirrus_cursor_draw_line(VGAState *s1, uint8_t *d1, int scr_y) +static void cirrus_cursor_draw_line(VGACommonState *s1, uint8_t *d1, int scr_y) { CirrusVGAState *s = container_of(s1, CirrusVGAState, vga); int w, h, bpp, x1, x2, poffset; diff --git a/hw/vga.c b/hw/vga.c index 35350f1..99d045f 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -149,6 +149,8 @@ static uint32_t expand4[256]; static uint16_t expand2[256]; static uint8_t expand4to8[16]; +typedef VGACommonState VGAState; + static void vga_screen_dump(void *opaque, const char *filename); static char *screen_dump_filename; static DisplayChangeListener *screen_dump_dcl; @@ -2256,7 +2258,7 @@ static void vga_map(PCIDevice *pci_dev, int region_num, } } -void vga_common_init(VGAState *s, int vga_ram_size) +void vga_common_init(VGACommonState *s, int vga_ram_size) { int i, j, v, b; diff --git a/hw/vga_int.h b/hw/vga_int.h index bb28872..eb837ff 100644 --- a/hw/vga_int.h +++ b/hw/vga_int.h @@ -180,8 +180,6 @@ typedef struct VGACommonState { union vga_retrace retrace_info; } VGACommonState; -typedef VGACommonState VGAState; - static inline int c6_to_8(int v) { int b; @@ -190,15 +188,15 @@ static inline int c6_to_8(int v) return (v << 2) | (b << 1) | b; } -void vga_common_init(VGAState *s, int vga_ram_size); -void vga_init(VGAState *s); +void vga_common_init(VGACommonState *s, int vga_ram_size); +void vga_init(VGACommonState *s); void vga_common_reset(VGACommonState *s); -void vga_dirty_log_start(VGAState *s); +void vga_dirty_log_start(VGACommonState *s); uint32_t vga_mem_readb(void *opaque, target_phys_addr_t addr); void vga_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val); -void vga_invalidate_scanlines(VGAState *s, int y1, int y2); +void vga_invalidate_scanlines(VGACommonState *s, int y1, int y2); int ppm_save(const char *filename, struct DisplaySurface *ds); void vga_draw_cursor_line_8(uint8_t *d1, const uint8_t *src1, diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c index 5ceebf1..0d8a72f 100644 --- a/hw/vmware_vga.c +++ b/hw/vmware_vga.c @@ -1129,8 +1129,8 @@ static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size) vmsvga_reset(s); #ifdef EMBED_STDVGA - vga_common_init((VGAState *) s, vga_ram_size); - vga_init((VGAState *) s); + vga_common_init(&s->vga, vga_ram_size); + vga_init(&s->vga); #else s->vram_size = vga_ram_size; s->vram_offset = qemu_ram_alloc(vga_ram_size);