Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 29 Nov 2002 08:52:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 29 Nov 2002 08:52:07 -0500 Received: from skunk.directfb.org ([212.84.236.169]:10441 "EHLO skunk.directfb.org") by vger.kernel.org with ESMTP id ; Fri, 29 Nov 2002 08:51:36 -0500 Date: Fri, 29 Nov 2002 14:58:16 +0100 From: Denis Oliver Kropp To: linux-kernel@vger.kernel.org Cc: marcelo@connective.com.br Subject: [PATCH] vmwarefb 0.6.0 (Linux 2.4.20) Message-ID: <20021129135816.GA30108@skunk> Reply-To: Denis Oliver Kropp Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline User-Agent: Mutt/1.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 65357 Lines: 2235 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Hi, this is an updated patch of the vmware framebuffer driver. Copyright headers are fixed now. Some users asked me to post this patch here to have it included in the official tree. -- Best regards, Denis Oliver Kropp .------------------------------------------. | DirectFB - Hardware accelerated graphics | | http://www.directfb.org/ | "------------------------------------------" Convergence GmbH --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="vmwarefb-0.6.0-linux-2.4.20.patch" diff -uraN linux-2.4.20/CREDITS linux-2.4.20-vmwarefb/CREDITS --- linux-2.4.20/CREDITS 2002-11-29 13:18:20.000000000 +0100 +++ linux-2.4.20-vmwarefb/CREDITS 2002-11-29 13:25:32.000000000 +0100 @@ -1688,6 +1688,7 @@ E: dok@directfb.org D: NeoMagic framebuffer driver D: CyberPro 32 bit support, fixes +D: VMware framebuffer driver S: Badensche Str. 46 S: 10715 Berlin S: Germany diff -uraN linux-2.4.20/drivers/video/Config.in linux-2.4.20-vmwarefb/drivers/video/Config.in --- linux-2.4.20/drivers/video/Config.in 2002-11-29 13:18:42.000000000 +0100 +++ linux-2.4.20-vmwarefb/drivers/video/Config.in 2002-11-29 13:28:40.000000000 +0100 @@ -147,6 +147,7 @@ bool ' SIS 315H/315 support' CONFIG_FB_SIS_315 fi tristate ' NeoMagic display support (EXPERIMENTAL)' CONFIG_FB_NEOMAGIC + tristate ' VMware SVGA display support (EXPERIMENTAL)' CONFIG_FB_VMWARE_SVGA tristate ' 3Dfx Banshee/Voodoo3 display support (EXPERIMENTAL)' CONFIG_FB_3DFX tristate ' 3Dfx Voodoo Graphics (sst1) support (EXPERIMENTAL)' CONFIG_FB_VOODOO1 tristate ' Trident support (EXPERIMENTAL)' CONFIG_FB_TRIDENT @@ -292,7 +293,8 @@ "$CONFIG_FB_PMAG_BA" = "y" -o "$CONFIG_FB_PMAGB_B" = "y" -o \ "$CONFIG_FB_MAXINE" = "y" -o "$CONFIG_FB_TX3912" = "y" -o \ "$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_NEOMAGIC" = "y" -o \ - "$CONFIG_FB_STI" = "y" -o "$CONFIG_FB_HP300" = "y" ]; then + "$CONFIG_FB_STI" = "y" -o "$CONFIG_FB_HP300" = "y" -o \ + "$CONFIG_FB_VMWARE_SVGA" = "y" ]; then define_tristate CONFIG_FBCON_CFB8 y else if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_ATARI" = "m" -o \ @@ -314,7 +316,7 @@ "$CONFIG_FB_MAXINE" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \ "$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_SIS" = "m" -o \ "$CONFIG_FB_TX3912" = "m" -o "$CONFIG_FB_NEOMAGIC" = "m" -o \ - "$CONFIG_FB_STI" = "m" ]; then + "$CONFIG_FB_STI" = "m" -o "$CONFIG_FB_VMWARE_SVGA" = "m" ]; then define_tristate CONFIG_FBCON_CFB8 m fi fi @@ -332,7 +334,7 @@ "$CONFIG_FB_CYBER2000" = "y" -o "$CONFIG_FB_3DFX" = "y" -o \ "$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_SA1100" = "y" -o \ "$CONFIG_FB_PVR2" = "y" -o "$CONFIG_FB_VOODOO1" = "y" -o \ - "$CONFIG_FB_NEOMAGIC" = "y" ]; then + "$CONFIG_FB_NEOMAGIC" = "y" -o "$CONFIG_FB_VMWARE_SVGA" = "y" ]; then define_tristate CONFIG_FBCON_CFB16 y else if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \ @@ -349,7 +351,7 @@ "$CONFIG_FB_CYBER2000" = "m" -o "$CONFIG_FB_SIS" = "m" -o \ "$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \ "$CONFIG_FB_PVR2" = "m" -o "$CONFIG_FB_VOODOO1" = "m" -o \ - "$CONFIG_FB_NEOMAGIC" = "m" ]; then + "$CONFIG_FB_NEOMAGIC" = "m" -o "$CONFIG_FB_VMWARE_SVGA" = "m" ]; then define_tristate CONFIG_FBCON_CFB16 m fi fi @@ -358,7 +360,8 @@ "$CONFIG_FB_MATROX" = "y" -o "$CONFIG_FB_PM2" = "y" -o \ "$CONFIG_FB_ATY128" = "y" -o "$CONFIG_FB_RADEON" = "y" -o \ "$CONFIG_FB_CYBER2000" = "y" -o "$CONFIG_FB_PVR2" = "y" -o \ - "$CONFIG_FB_VOODOO1" = "y" -o "$CONFIG_FB_NEOMAGIC" = "y" ]; then + "$CONFIG_FB_VOODOO1" = "y" -o "$CONFIG_FB_NEOMAGIC" = "y" -o \ + "$CONFIG_FB_VMWARE_SVGA" = "y" -o "$CONFIG_FB_VMWARE_SVGA" = "y" ]; then define_tristate CONFIG_FBCON_CFB24 y else if [ "$CONFIG_FB_ATY" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" -o \ @@ -366,7 +369,8 @@ "$CONFIG_FB_MATROX" = "m" -o "$CONFIG_FB_PM2" = "m" -o \ "$CONFIG_FB_ATY128" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \ "$CONFIG_FB_CYBER2000" = "m" -o "$CONFIG_FB_PVR2" = "m" -o \ - "$CONFIG_FB_VOODOO1" = "m" -o "$CONFIG_FB_NEOMAGIC" = "m" ]; then + "$CONFIG_FB_VOODOO1" = "m" -o "$CONFIG_FB_NEOMAGIC" = "m" -o \ + "$CONFIG_FB_VMWARE_SVGA" = "m" ]; then define_tristate CONFIG_FBCON_CFB24 m fi fi @@ -381,7 +385,7 @@ "$CONFIG_FB_RADEON" = "y" -o "$CONFIG_FB_PVR2" = "y" -o \ "$CONFIG_FB_3DFX" = "y" -o "$CONFIG_FB_SIS" = "y" -o \ "$CONFIG_FB_VOODOO1" = "y" -o "$CONFIG_FB_CYBER2000" = "y" -o \ - "$CONFIG_FB_STI" = "y" ]; then + "$CONFIG_FB_STI" = "y" -o "$CONFIG_FB_VMWARE_SVGA" = "y" ]; then define_tristate CONFIG_FBCON_CFB32 y else if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \ @@ -394,7 +398,8 @@ "$CONFIG_FB_3DFX" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \ "$CONFIG_FB_SGIVW" = "m" -o "$CONFIG_FB_SIS" = "m" -o \ "$CONFIG_FB_PVR2" = "m" -o "$CONFIG_FB_VOODOO1" = "m" -o \ - "$CONFIG_FB_CYBER2000" = "m" -o "$CONFIG_FB_STI" = "y" ]; then + "$CONFIG_FB_CYBER2000" = "m" -o "$CONFIG_FB_STI" = "y" -o \ + "$CONFIG_FB_VMWARE_SVGA" = "m" ]; then define_tristate CONFIG_FBCON_CFB32 m fi fi diff -uraN linux-2.4.20/drivers/video/Makefile linux-2.4.20-vmwarefb/drivers/video/Makefile --- linux-2.4.20/drivers/video/Makefile 2002-11-29 13:18:42.000000000 +0100 +++ linux-2.4.20-vmwarefb/drivers/video/Makefile 2002-11-29 13:24:53.000000000 +0100 @@ -107,6 +107,11 @@ obj-y += riva/rivafb.o endif +subdir-$(CONFIG_FB_VMWARE_SVGA) += vmware +ifeq ($(CONFIG_FB_VMWARE_SVGA),y) +obj-y += vmware/vmware.o +endif + subdir-$(CONFIG_FB_SIS) += sis ifeq ($(CONFIG_FB_SIS),y) obj-y += sis/sisfb.o diff -uraN linux-2.4.20/drivers/video/fbmem.c linux-2.4.20-vmwarefb/drivers/video/fbmem.c --- linux-2.4.20/drivers/video/fbmem.c 2002-11-29 13:18:43.000000000 +0100 +++ linux-2.4.20-vmwarefb/drivers/video/fbmem.c 2002-11-29 13:24:53.000000000 +0100 @@ -76,6 +76,8 @@ extern int aty128fb_setup(char*); extern int neofb_init(void); extern int neofb_setup(char*); +extern int vmwarefb_init(void); +extern int vmwarefb_setup(char*); extern int igafb_init(void); extern int igafb_setup(char*); extern int imsttfb_init(void); @@ -190,6 +192,9 @@ #ifdef CONFIG_FB_NEOMAGIC { "neo", neofb_init, neofb_setup }, #endif +#ifdef CONFIG_FB_VMWARE_SVGA + { "vmware", vmwarefb_init, vmwarefb_setup }, +#endif #ifdef CONFIG_FB_VIRGE { "virge", virgefb_init, virgefb_setup }, #endif diff -uraN linux-2.4.20/drivers/video/vmware/Makefile linux-2.4.20-vmwarefb/drivers/video/vmware/Makefile --- linux-2.4.20/drivers/video/vmware/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.4.20-vmwarefb/drivers/video/vmware/Makefile 2002-11-29 13:24:53.000000000 +0100 @@ -0,0 +1,15 @@ +# +# Makefile for the VMware SVGA framebuffer driver +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definitions are now in the main makefile... + +O_TARGET := vmware.o + +obj-y := vmwarefb.o +obj-m := $(O_TARGET) + +include $(TOPDIR)/Rules.make diff -uraN linux-2.4.20/drivers/video/vmware/guest_os.h linux-2.4.20-vmwarefb/drivers/video/vmware/guest_os.h --- linux-2.4.20/drivers/video/vmware/guest_os.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.4.20-vmwarefb/drivers/video/vmware/guest_os.h 2002-11-29 13:35:53.000000000 +0100 @@ -0,0 +1,35 @@ +/* + * linux/drivers/video/vmware/guest_os.h -- VMware SVGA Framebuffer Driver + * + * Copyright (c) 2002 Denis Oliver Kropp + * + * + * Card specific code is based on XFree86's VMware driver. + * Framebuffer framework code is based on code of neofb. + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + * + */ + +#ifndef _GUEST_OS_H_ +#define _GUEST_OS_H_ + +#define GUEST_OS_BASE 0x5000 + +#define GUEST_OS_DOS (GUEST_OS_BASE+1) +#define GUEST_OS_WIN31 (GUEST_OS_BASE+2) +#define GUEST_OS_WINDOWS95 (GUEST_OS_BASE+3) +#define GUEST_OS_WINDOWS98 (GUEST_OS_BASE+4) +#define GUEST_OS_WINDOWSME (GUEST_OS_BASE+5) +#define GUEST_OS_NT (GUEST_OS_BASE+6) +#define GUEST_OS_WIN2000 (GUEST_OS_BASE+7) +#define GUEST_OS_LINUX (GUEST_OS_BASE+8) +#define GUEST_OS_OS2 (GUEST_OS_BASE+9) +#define GUEST_OS_OTHER (GUEST_OS_BASE+10) +#define GUEST_OS_FREEBSD (GUEST_OS_BASE+11) +#define GUEST_OS_WHISTLER (GUEST_OS_BASE+12) + + +#endif diff -uraN linux-2.4.20/drivers/video/vmware/svga_limits.h linux-2.4.20-vmwarefb/drivers/video/vmware/svga_limits.h --- linux-2.4.20/drivers/video/vmware/svga_limits.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.4.20-vmwarefb/drivers/video/vmware/svga_limits.h 2002-11-29 13:35:50.000000000 +0100 @@ -0,0 +1,55 @@ +/* + * linux/drivers/video/vmware/svga_limits.h -- VMware SVGA Framebuffer Driver + * + * Copyright (c) 2002 Denis Oliver Kropp + * + * + * Card specific code is based on XFree86's VMware driver. + * Framebuffer framework code is based on code of neofb. + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + * + */ + +#ifndef _SVGA_LIMITS_H_ +#define _SVGA_LIMITS_H_ + +/* + * Location and size of SVGA frame buffer. + */ +#define SVGA_FB_MAX_SIZE (16*1024*1024) +#define SVGA_MEM_SIZE (256*1024) + +/* + * SVGA_FB_START is the default starting address of the SVGA frame + * buffer in the guest's physical address space. + * SVGA_FB_START_BIGMEM is the starting address of the SVGA frame + * buffer for VMs that have a large amount of physical memory. + * + * The address of SVGA_FB_START is set to 2GB - (SVGA_FB_MAX_SIZE + SVGA_MEM_SIZE), + * thus the SVGA frame buffer sits at [SVGA_FB_START .. 2GB-1] in the + * physical address space. Our older SVGA drivers for NT treat the + * address of the frame buffer as a signed integer. For backwards + * compatibility, we keep the default location of the frame buffer + * at under 2GB in the address space. This restricts VMs to have "only" + * up to ~2031MB (i.e., up to SVGA_FB_START) of physical memory. + * + * For VMs that want more memory than the ~2031MB, we place the SVGA + * frame buffer at SVGA_FB_START_BIGMEM. This allows VMs to have up + * to 3584MB, at least as far as the SVGA frame buffer is concerned + * (note that there may be other issues that limit the VM memory + * size). PCI devices use high memory addresses, so we have to put + * SVGA_FB_START_BIGMEM low enough so that it doesn't overlap with any + * of these devices. Placing SVGA_FB_START_BIGMEM at 0xE0000000 + * should leave plenty of room for the PCI devices. + * + * NOTE: All of that is only true for the 0710 chipset. As of the 0405 + * chipset, the framebuffer start is determined solely based on the value + * the guest BIOS or OS programs into the PCI base address registers. + */ +#define SVGA_FB_LEGACY_START 0x7EFC0000 +#define SVGA_FB_LEGACY_START_BIGMEM 0xE0000000 + +#endif diff -uraN linux-2.4.20/drivers/video/vmware/svga_reg.h linux-2.4.20-vmwarefb/drivers/video/vmware/svga_reg.h --- linux-2.4.20/drivers/video/vmware/svga_reg.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.4.20-vmwarefb/drivers/video/vmware/svga_reg.h 2002-11-29 13:35:50.000000000 +0100 @@ -0,0 +1,300 @@ +/* + * linux/drivers/video/vmware/svga_reg.h -- VMware SVGA Framebuffer Driver + * + * Copyright (c) 2002 Denis Oliver Kropp + * + * + * Card specific code is based on XFree86's VMware driver. + * Framebuffer framework code is based on code of neofb. + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + * + */ + +#ifndef _SVGA_REG_H_ +#define _SVGA_REG_H_ + +#include "svga_limits.h" + +/* + * Memory and port addresses and fundamental constants + */ + +#define SVGA_MAX_WIDTH 2364 +#define SVGA_MAX_HEIGHT 1773 + +#ifdef VMX86_SERVER +#define SVGA_DEFAULT_MAX_WIDTH 1600 +#define SVGA_DEFAULT_MAX_HEIGHT 1200 +#else +#define SVGA_DEFAULT_MAX_WIDTH SVGA_MAX_WIDTH +#define SVGA_DEFAULT_MAX_HEIGHT SVGA_MAX_HEIGHT +#endif + +#define SVGA_MAX_BITS_PER_PIXEL 32 +#if SVGA_MAX_WIDTH * SVGA_MAX_HEIGHT * SVGA_MAX_BITS_PER_PIXEL / 8 > \ + SVGA_FB_MAX_SIZE +#error "Bad SVGA maximum sizes" +#endif +#define SVGA_MAX_PSEUDOCOLOR_DEPTH 8 +#define SVGA_MAX_PSEUDOCOLORS (1 << SVGA_MAX_PSEUDOCOLOR_DEPTH) + +#define SVGA_MAGIC 0x900000 +#define SVGA_MAKE_ID(ver) (SVGA_MAGIC << 8 | (ver)) + +/* Version 2 let the address of the frame buffer be unsigned on Win32 */ +#define SVGA_VERSION_2 2 +#define SVGA_ID_2 SVGA_MAKE_ID(SVGA_VERSION_2) + +/* Version 1 has new registers starting with SVGA_REG_CAPABILITIES so + PALETTE_BASE has moved */ +#define SVGA_VERSION_1 1 +#define SVGA_ID_1 SVGA_MAKE_ID(SVGA_VERSION_1) + +/* Version 0 is the initial version */ +#define SVGA_VERSION_0 0 +#define SVGA_ID_0 SVGA_MAKE_ID(SVGA_VERSION_0) + +/* Invalid SVGA_ID_ */ +#define SVGA_ID_INVALID 0xFFFFFFFF + +/* More backwards compatibility, old location of color map: */ +#define SVGA_OLD_PALETTE_BASE 17 + +/* Base and Offset gets us headed the right way for PCI Base Addr Registers */ +#define SVGA_LEGACY_BASE_PORT 0x4560 +#define SVGA_INDEX_PORT 0x0 +#define SVGA_VALUE_PORT 0x1 +#define SVGA_BIOS_PORT 0x2 +#define SVGA_NUM_PORTS 0x3 + +/* This port is deprecated, but retained because of old drivers. */ +#define SVGA_LEGACY_ACCEL_PORT 0x3 + +/* Legal values for the SVGA_REG_CURSOR_ON register in cursor bypass mode */ +#define SVGA_CURSOR_ON_HIDE 0x0 /* Must be 0 to maintain backward compatibility */ +#define SVGA_CURSOR_ON_SHOW 0x1 /* Must be 1 to maintain backward compatibility */ +#define SVGA_CURSOR_ON_REMOVE_FROM_FB 0x2 /* Remove the cursor from the framebuffer because we need to see what's under it */ +#define SVGA_CURSOR_ON_RESTORE_TO_FB 0x3 /* Put the cursor back in the framebuffer so the user can see it */ + +/* + * Registers + */ + +enum { + SVGA_REG_ID = 0, + SVGA_REG_ENABLE = 1, + SVGA_REG_WIDTH = 2, + SVGA_REG_HEIGHT = 3, + SVGA_REG_MAX_WIDTH = 4, + SVGA_REG_MAX_HEIGHT = 5, + SVGA_REG_DEPTH = 6, + SVGA_REG_BITS_PER_PIXEL = 7, /* Current bpp in the guest */ + SVGA_REG_PSEUDOCOLOR = 8, + SVGA_REG_RED_MASK = 9, + SVGA_REG_GREEN_MASK = 10, + SVGA_REG_BLUE_MASK = 11, + SVGA_REG_BYTES_PER_LINE = 12, + SVGA_REG_FB_START = 13, + SVGA_REG_FB_OFFSET = 14, + SVGA_REG_FB_MAX_SIZE = 15, + SVGA_REG_FB_SIZE = 16, + + SVGA_REG_CAPABILITIES = 17, + SVGA_REG_MEM_START = 18, /* Memory for command FIFO and bitmaps */ + SVGA_REG_MEM_SIZE = 19, + SVGA_REG_CONFIG_DONE = 20, /* Set when memory area configured */ + SVGA_REG_SYNC = 21, /* Write to force synchronization */ + SVGA_REG_BUSY = 22, /* Read to check if sync is done */ + SVGA_REG_GUEST_ID = 23, /* Set guest OS identifier */ + SVGA_REG_CURSOR_ID = 24, /* ID of cursor */ + SVGA_REG_CURSOR_X = 25, /* Set cursor X position */ + SVGA_REG_CURSOR_Y = 26, /* Set cursor Y position */ + SVGA_REG_CURSOR_ON = 27, /* Turn cursor on/off */ + SVGA_REG_HOST_BITS_PER_PIXEL = 28, /* Current bpp in the host */ + + SVGA_REG_TOP = 30, /* Must be 1 greater than the last register */ + + SVGA_PALETTE_BASE = 1024 /* Base of SVGA color map */ +}; + + +/* + * Capabilities + */ + +#define SVGA_CAP_RECT_FILL 0x0001 +#define SVGA_CAP_RECT_COPY 0x0002 +#define SVGA_CAP_RECT_PAT_FILL 0x0004 +#define SVGA_CAP_OFFSCREEN 0x0008 +#define SVGA_CAP_RASTER_OP 0x0010 +#define SVGA_CAP_CURSOR 0x0020 +#define SVGA_CAP_CURSOR_BYPASS 0x0040 +#define SVGA_CAP_CURSOR_BYPASS_2 0x0080 +#define SVGA_CAP_8BIT_EMULATION 0x0100 +#define SVGA_CAP_ALPHA_CURSOR 0x0200 + + +/* + * Raster op codes (same encoding as X) used by FIFO drivers. + */ + +#define SVGA_ROP_CLEAR 0x00 /* 0 */ +#define SVGA_ROP_AND 0x01 /* src AND dst */ +#define SVGA_ROP_AND_REVERSE 0x02 /* src AND NOT dst */ +#define SVGA_ROP_COPY 0x03 /* src */ +#define SVGA_ROP_AND_INVERTED 0x04 /* NOT src AND dst */ +#define SVGA_ROP_NOOP 0x05 /* dst */ +#define SVGA_ROP_XOR 0x06 /* src XOR dst */ +#define SVGA_ROP_OR 0x07 /* src OR dst */ +#define SVGA_ROP_NOR 0x08 /* NOT src AND NOT dst */ +#define SVGA_ROP_EQUIV 0x09 /* NOT src XOR dst */ +#define SVGA_ROP_INVERT 0x0a /* NOT dst */ +#define SVGA_ROP_OR_REVERSE 0x0b /* src OR NOT dst */ +#define SVGA_ROP_COPY_INVERTED 0x0c /* NOT src */ +#define SVGA_ROP_OR_INVERTED 0x0d /* NOT src OR dst */ +#define SVGA_ROP_NAND 0x0e /* NOT src OR NOT dst */ +#define SVGA_ROP_SET 0x0f /* 1 */ +#define SVGA_ROP_UNSUPPORTED 0x10 + +#define SVGA_NUM_SUPPORTED_ROPS 16 +#define SVGA_ROP_ALL 0x0000ffff + +/* + * Memory area offsets (viewed as an array of 32-bit words) + */ + +/* + * The distance from MIN to MAX must be at least 10K + */ + +#define SVGA_FIFO_MIN 0 +#define SVGA_FIFO_MAX 1 +#define SVGA_FIFO_NEXT_CMD 2 +#define SVGA_FIFO_STOP 3 + +#define SVGA_FIFO_USER_DEFINED 4 + +/* + * Drawing object ID's, in the range 0 to SVGA_MAX_ID + */ + +#define SVGA_MAX_ID 499 + +/* + * Macros to compute variable length items (sizes in 32-bit words) + */ + +#define SVGA_BITMAP_SIZE(w,h) ((((w)+31) >> 5) * (h)) +#define SVGA_BITMAP_SCANLINE_SIZE(w) (( (w)+31 ) >> 5) +#define SVGA_PIXMAP_SIZE(w,h,d) ((( ((w)*(d))+31 ) >> 5) * (h)) +#define SVGA_PIXMAP_SCANLINE_SIZE(w,d) (( ((w)*(d))+31 ) >> 5) + +/* + * Increment from one scanline to the next of a bitmap or pixmap + */ +#define SVGA_BITMAP_INCREMENT(w) ((( (w)+31 ) >> 5) * sizeof (uint32)) +#define SVGA_PIXMAP_INCREMENT(w,d) ((( ((w)*(d))+31 ) >> 5) * sizeof (uint32)) + +/* + * Commands in the command FIFO + */ + +#define SVGA_CMD_UPDATE 1 + /* FIFO layout: + X, Y, Width, Height */ + +#define SVGA_CMD_RECT_FILL 2 + /* FIFO layout: + Color, X, Y, Width, Height */ + +#define SVGA_CMD_RECT_COPY 3 + /* FIFO layout: + Source X, Source Y, Dest X, Dest Y, Width, Height */ + +#define SVGA_CMD_DEFINE_BITMAP 4 + /* FIFO layout: + Pixmap ID, Width, Height, */ + +#define SVGA_CMD_DEFINE_BITMAP_SCANLINE 5 + /* FIFO layout: + Pixmap ID, Width, Height, Line #, scanline */ + +#define SVGA_CMD_DEFINE_PIXMAP 6 + /* FIFO layout: + Pixmap ID, Width, Height, Depth, */ + +#define SVGA_CMD_DEFINE_PIXMAP_SCANLINE 7 + /* FIFO layout: + Pixmap ID, Width, Height, Depth, Line #, scanline */ + +#define SVGA_CMD_RECT_BITMAP_FILL 8 + /* FIFO layout: + Bitmap ID, X, Y, Width, Height, Foreground, Background */ + +#define SVGA_CMD_RECT_PIXMAP_FILL 9 + /* FIFO layout: + Pixmap ID, X, Y, Width, Height */ + +#define SVGA_CMD_RECT_BITMAP_COPY 10 + /* FIFO layout: + Bitmap ID, Source X, Source Y, Dest X, Dest Y, + Width, Height, Foreground, Background */ + +#define SVGA_CMD_RECT_PIXMAP_COPY 11 + /* FIFO layout: + Pixmap ID, Source X, Source Y, Dest X, Dest Y, Width, Height */ + +#define SVGA_CMD_FREE_OBJECT 12 + /* FIFO layout: + Object (pixmap, bitmap, ...) ID */ + +#define SVGA_CMD_RECT_ROP_FILL 13 + /* FIFO layout: + Color, X, Y, Width, Height, ROP */ + +#define SVGA_CMD_RECT_ROP_COPY 14 + /* FIFO layout: + Source X, Source Y, Dest X, Dest Y, Width, Height, ROP */ + +#define SVGA_CMD_RECT_ROP_BITMAP_FILL 15 + /* FIFO layout: + ID, X, Y, Width, Height, Foreground, Background, ROP */ + +#define SVGA_CMD_RECT_ROP_PIXMAP_FILL 16 + /* FIFO layout: + ID, X, Y, Width, Height, ROP */ + +#define SVGA_CMD_RECT_ROP_BITMAP_COPY 17 + /* FIFO layout: + ID, Source X, Source Y, + Dest X, Dest Y, Width, Height, Foreground, Background, ROP */ + +#define SVGA_CMD_RECT_ROP_PIXMAP_COPY 18 + /* FIFO layout: + ID, Source X, Source Y, Dest X, Dest Y, Width, Height, ROP */ + +#define SVGA_CMD_DEFINE_CURSOR 19 + /* FIFO layout: + ID, Hotspot X, Hotspot Y, Width, Height, + Depth for AND mask, Depth for XOR mask, + , */ + +#define SVGA_CMD_DISPLAY_CURSOR 20 + /* FIFO layout: + ID, On/Off (1 or 0) */ + +#define SVGA_CMD_MOVE_CURSOR 21 + /* FIFO layout: + X, Y */ + +#define SVGA_CMD_DEFINE_ALPHA_CURSOR 22 + /* FIFO layout: + ID, Hotspot X, Hotspot Y, Width, Height, + */ + +#define SVGA_CMD_MAX 23 + +#endif diff -uraN linux-2.4.20/drivers/video/vmware/vmwarefb.c linux-2.4.20-vmwarefb/drivers/video/vmware/vmwarefb.c --- linux-2.4.20/drivers/video/vmware/vmwarefb.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.4.20-vmwarefb/drivers/video/vmware/vmwarefb.c 2002-11-29 13:35:53.000000000 +0100 @@ -0,0 +1,1529 @@ +/* + * linux/drivers/video/vmware/vmwarefb.c -- VMware SVGA Framebuffer Driver + * + * Copyright (c) 2002 Denis Oliver Kropp + * + * + * Card specific code is based on XFree86's VMware driver. + * Framebuffer framework code is based on code of neofb. + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + * + * + * 0.6.0 + * - added accelerated clear and move for console acceleration (dok) + * - removed VGA code that isn't needed at all in SVGA mode (dok) + * - disabling acceleration is only possible after power off via "noaccel" (dok) + * - added a workaround to fix console after running X (dok) + * + * 0.5.2 + * - take care of fb offset, fixes non-standard resolutions (dok) + * + * 0.5.1 + * - fixed undeclared integer when built as a module (dok) + * + * 0.5.0 + * - initial version (dok) + * + * + * TODO + * - support for changing bits per pixel (using 8bit emulation capability) + * - panning (yet unsupported by WMware) + * - disabling accel after bootup (requires yet unreleased VMware above 3.1) + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include