Hello community, here is the log from the commit of package xorg-x11-driver-video checked in at Tue Feb 13 13:15:16 CET 2007. -------- --- xorg-x11-driver-video/xorg-x11-driver-video.changes 2007-02-06 16:04:41.000000000 +0100 +++ /mounts/work_src_done/STABLE/xorg-x11-driver-video/xorg-x11-driver-video.changes 2007-02-13 04:36:28.000000000 +0100 @@ -1,0 +2,9 @@ +Tue Feb 13 04:35:47 CET 2007 - sndirsch@suse.de + +- updated vmware driver to release 10.15.0 + * Provide truely usable resizing support with the ability to + resize larger than the initial size and no wasted framebuffer + space. As a bonus, a variety of useful resolutions are built + in to the driver and always available. + +------------------------------------------------------------------- Old: ---- xf86-video-vmware-10.14.1.tar.bz2 New: ---- xf86-video-vmware-10.15.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xorg-x11-driver-video.spec ++++++ --- /var/tmp/diff_new_pack.z12297/_old 2007-02-13 13:14:49.000000000 +0100 +++ /var/tmp/diff_new_pack.z12297/_new 2007-02-13 13:14:49.000000000 +0100 @@ -14,7 +14,7 @@ BuildRequires: Mesa-devel libdrm-devel pkgconfig xorg-x11-proto-devel xorg-x11-server-sdk URL: http://xorg.freedesktop.org/ Version: 7.2 -Release: 52 +Release: 54 License: X11/MIT BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: System/X11/Servers/XF86_4 @@ -62,7 +62,7 @@ Source38: xf86-video-vesa-1.3.0.tar.bz2 Source39: xf86-video-vga-X11R7.1-4.1.0.tar.bz2 Source40: xf86-video-via-0.2.2.tar.bz2 -Source41: xf86-video-vmware-10.14.1.tar.bz2 +Source41: xf86-video-vmware-10.15.0.tar.bz2 Source42: xf86-video-voodoo-1.1.1.tar.bz2 Source43: xf86-video-impact-0.2.0.tar.bz2 Source44: HALlib-4.1.tar.gz @@ -202,6 +202,12 @@ %{_mandir}/man4/* %changelog -n xorg-x11-driver-video +* Tue Feb 13 2007 - sndirsch@suse.de +- updated vmware driver to release 10.15.0 + * Provide truely usable resizing support with the ability to + resize larger than the initial size and no wasted framebuffer + space. As a bonus, a variety of useful resolutions are built + in to the driver and always available. * Mon Feb 05 2007 - sndirsch@suse.de - removed "-nostdlib/-lgcc" to fix loading of mga_hal module (Bug #242127) ++++++ xf86-video-vmware-10.14.1.tar.bz2 -> xf86-video-vmware-10.15.0.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/configure new/xf86-video-vmware-10.15.0/configure --- old/xf86-video-vmware-10.14.1/configure 2006-12-07 01:54:28.000000000 +0100 +++ new/xf86-video-vmware-10.15.0/configure 2007-02-09 03:09:59.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for xf86-video-vmware 10.14.1. +# Generated by GNU Autoconf 2.60 for xf86-video-vmware 10.15.0. # # Report bugs to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg. # @@ -713,8 +713,8 @@ # Identity of this package. PACKAGE_NAME='xf86-video-vmware' PACKAGE_TARNAME='xf86-video-vmware' -PACKAGE_VERSION='10.14.1' -PACKAGE_STRING='xf86-video-vmware 10.14.1' +PACKAGE_VERSION='10.15.0' +PACKAGE_STRING='xf86-video-vmware 10.15.0' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' ac_unique_file="Makefile.am" @@ -1396,7 +1396,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xf86-video-vmware 10.14.1 to adapt to many kinds of systems. +\`configure' configures xf86-video-vmware 10.15.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1466,7 +1466,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-video-vmware 10.14.1:";; + short | recursive ) echo "Configuration of xf86-video-vmware 10.15.0:";; esac cat <<\_ACEOF @@ -1577,7 +1577,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-video-vmware configure 10.14.1 +xf86-video-vmware configure 10.15.0 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1591,7 +1591,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xf86-video-vmware $as_me 10.14.1, which was +It was created by xf86-video-vmware $as_me 10.15.0, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -2266,7 +2266,7 @@ # Define the identity of the package. PACKAGE='xf86-video-vmware' - VERSION='10.14.1' + VERSION='10.15.0' cat >>confdefs.h <<_ACEOF @@ -21896,7 +21896,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xf86-video-vmware $as_me 10.14.1, which was +This file was extended by xf86-video-vmware $as_me 10.15.0, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21949,7 +21949,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -xf86-video-vmware config.status 10.14.1 +xf86-video-vmware config.status 10.15.0 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/configure.ac new/xf86-video-vmware-10.15.0/configure.ac --- old/xf86-video-vmware-10.14.1/configure.ac 2006-12-07 01:47:15.000000000 +0100 +++ new/xf86-video-vmware-10.15.0/configure.ac 2007-02-09 03:07:43.000000000 +0100 @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-vmware], - 10.14.1, + 10.15.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-vmware) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/man/vmware.man new/xf86-video-vmware-10.15.0/man/vmware.man --- old/xf86-video-vmware-10.14.1/man/vmware.man 2006-11-01 04:16:54.000000000 +0100 +++ new/xf86-video-vmware-10.15.0/man/vmware.man 2007-02-08 22:44:12.000000000 +0100 @@ -28,9 +28,6 @@ .BI "Option \*qHWCursor\*q \*q" boolean \*q Enable or disable the HW cursor. Default: off. .TP -.BI "Option \*qNoAccel\*q \*q" boolean \*q -Disable or enable acceleration. Default: acceleration is enabled. -.TP .BI "Option \*qXinerama\*q \*q" boolean \*q Disable or enable Xinerama support. Default: xinerama is enabled if the hardware supports it. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/README new/xf86-video-vmware-10.15.0/README --- old/xf86-video-vmware-10.14.1/README 2006-07-01 08:18:43.000000000 +0200 +++ new/xf86-video-vmware-10.15.0/README 2007-02-09 03:09:34.000000000 +0100 @@ -20,6 +20,9 @@ Included by svga_reg.h, defines maximum frame buffer and memory region sizes. +svga_modes.h + A list of default display modes that are built into the driver. + guest_os.h Values for the GUEST_ID register. @@ -29,6 +32,9 @@ vm_device_version.h PCI vendor ID's and related information. +vmwarectrl.h +vmwarectrlproto.h + The definitions of the VMWARECTRL protocol extension. Programming the VMware SVGA Device ---------------------------------- diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/src/Makefile.am new/xf86-video-vmware-10.15.0/src/Makefile.am --- old/xf86-video-vmware-10.14.1/src/Makefile.am 2006-10-06 20:36:41.000000000 +0200 +++ new/xf86-video-vmware-10.15.0/src/Makefile.am 2007-02-10 00:06:05.000000000 +0100 @@ -33,9 +33,8 @@ bits2pixels.h \ guest_os.h \ includeCheck.h \ - offscreen_manager.c \ - offscreen_manager.h \ svga_limits.h \ + svga_modes.h \ svga_reg.h \ svga_struct.h \ vm_basic_types.h \ @@ -43,7 +42,6 @@ vmware.c \ vmwarecurs.c \ vmware.h \ - vmwarexaa.c \ vmwarectrl.c \ vmwarectrl.h \ vmwarectrlproto.h \ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/src/Makefile.in new/xf86-video-vmware-10.15.0/src/Makefile.in --- old/xf86-video-vmware-10.14.1/src/Makefile.in 2006-12-07 01:54:29.000000000 +0100 +++ new/xf86-video-vmware-10.15.0/src/Makefile.in 2007-02-10 00:07:25.000000000 +0100 @@ -75,9 +75,8 @@ vmware_drv_laLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(vmware_drv_la_LTLIBRARIES) vmware_drv_la_LIBADD = -am_vmware_drv_la_OBJECTS = bits2pixels.lo offscreen_manager.lo \ - vmware.lo vmwarecurs.lo vmwarexaa.lo vmwarectrl.lo \ - vmwarexinerama.lo +am_vmware_drv_la_OBJECTS = bits2pixels.lo vmware.lo vmwarecurs.lo \ + vmwarectrl.lo vmwarexinerama.lo vmware_drv_la_OBJECTS = $(am_vmware_drv_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -231,9 +230,8 @@ bits2pixels.h \ guest_os.h \ includeCheck.h \ - offscreen_manager.c \ - offscreen_manager.h \ svga_limits.h \ + svga_modes.h \ svga_reg.h \ svga_struct.h \ vm_basic_types.h \ @@ -241,7 +239,6 @@ vmware.c \ vmwarecurs.c \ vmware.h \ - vmwarexaa.c \ vmwarectrl.c \ vmwarectrl.h \ vmwarectrlproto.h \ @@ -317,11 +314,9 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bits2pixels.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/offscreen_manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmware.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmwarectrl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmwarecurs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmwarexaa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmwarexinerama.Plo@am__quote@ .c.o: diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/src/offscreen_manager.c new/xf86-video-vmware-10.15.0/src/offscreen_manager.c --- old/xf86-video-vmware-10.14.1/src/offscreen_manager.c 2006-09-19 19:09:42.000000000 +0200 +++ new/xf86-video-vmware-10.15.0/src/offscreen_manager.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,136 +0,0 @@ -/* ********************************************************** - * Copyright (C) 1998-2002 VMware, Inc. - * All Rights Reserved - * **********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/offscreen_manager.c,v 1.1 2002/12/10 04:17:19 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "vmware.h" - -struct _Heap { - CARD8* ptr; - CARD32 size; - CARD32 maxSlots; - CARD32 startOffset; - SVGASurface* frontBuffer; - SVGASurface* slotsStart; - Bool clear; -}; - -static SVGASurface* FillInSurface(Heap* heap, SVGASurface* surface, - CARD32 width, CARD32 height, - CARD32 bpp, CARD32 pitch, CARD32 size, - CARD32 sizeUsed); - -Heap* -vmwareHeap_Create(CARD8* ptr, CARD32 size, CARD32 maxSlots, CARD32 startOffset, - CARD32 sWidth, CARD32 sHeight, CARD32 sBPP, CARD32 sPitch, - CARD32 sFbOffset) -{ - Heap* newHeap = malloc(sizeof (Heap)); - - newHeap->ptr = ptr; - newHeap->size = size - sizeof(SVGASurface); /* leave room for frontbuffer */ - newHeap->maxSlots = maxSlots; - newHeap->startOffset = startOffset; - - newHeap->frontBuffer = FillInSurface(newHeap, - (SVGASurface*)(ptr + newHeap->size), - sWidth, sHeight, sBPP, sPitch, - sHeight * sPitch, 0); - newHeap->frontBuffer->dataOffset = sFbOffset; - newHeap->frontBuffer->numQueued = newHeap->frontBuffer->numDequeued = 0; - - newHeap->slotsStart = (SVGASurface*)(newHeap->ptr + newHeap->size) - - newHeap->maxSlots; - newHeap->clear = FALSE; - vmwareHeap_Clear(newHeap); - - return newHeap; -} - -void -vmwareHeap_Destroy(Heap* heap) -{ - free(heap); -} - -void -vmwareHeap_Clear(Heap* heap) -{ - if (!heap->clear) { - memset(heap->slotsStart, 0, heap->maxSlots * sizeof (SVGASurface)); - heap->clear = TRUE; - } -} - -static SVGASurface* -FillInSurface(Heap* heap, SVGASurface* surface, CARD32 width, CARD32 height, - CARD32 bpp, CARD32 pitch, CARD32 size, CARD32 offset) -{ - surface->size = sizeof (SVGASurface); - surface->version = SVGA_SURFACE_VERSION_1; - surface->bpp = bpp; - surface->width = width; - surface->height = height; - surface->pitch = pitch; - if (surface->userData == 0) { - /* - * We allocate exactly what we need the first time we use a slot, so - * all reuses of this slot will be equal or smaller. - */ - surface->userData = size; - } - surface->dataOffset = offset + heap->startOffset; - - return surface; -} - -SVGASurface* -vmwareHeap_GetFrontBuffer(Heap* heap) -{ - return heap->frontBuffer; -} - -SVGASurface* -vmwareHeap_AllocSurface(Heap* heap, CARD32 width, CARD32 height, - CARD32 pitch, CARD32 bpp) -{ - CARD32 size = pitch * height; - CARD32 sizeUsed = 0; - SVGASurface* surface = heap->slotsStart; - int i; - - /* - * NOTE: we use SVGASurface::userData to store the largest this slot's - * size has ever been, since we don't ever compact anything. - */ - - /* find a free slot that's big enough */ - for (i = 0; i < heap->maxSlots; i++) { - if (surface[i].userData == 0) { /* this surface has never been used */ - if ((CARD8*)heap->slotsStart - heap->ptr - sizeUsed < size) { - /* no room left for data*/ - return NULL; - } - - heap->clear = FALSE; - return FillInSurface(heap, surface + i, width, height, bpp, - pitch, size, sizeUsed); - } - - if (surface[i].numQueued == surface[i].numDequeued && - surface[i].userData >= size) { /* free and big enough, sweet! */ - heap->clear = FALSE; - return FillInSurface(heap, surface + i, width, height, bpp, - pitch, size, sizeUsed); - } - - sizeUsed += surface[i].userData; - } - - return NULL; -} diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/src/offscreen_manager.h new/xf86-video-vmware-10.15.0/src/offscreen_manager.h --- old/xf86-video-vmware-10.14.1/src/offscreen_manager.h 2006-09-19 19:09:42.000000000 +0200 +++ new/xf86-video-vmware-10.15.0/src/offscreen_manager.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,25 +0,0 @@ -/* ********************************************************** - * Copyright (C) 1998-2002 VMware, Inc. - * All Rights Reserved - * **********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/offscreen_manager.h,v 1.2 2002/12/11 17:07:58 dawes Exp $ */ - -#ifndef OFFSCREEN_MANAGER_H -#define OFFSCREEN_MANAGER_H - -struct _Heap; -typedef struct _Heap Heap; - -extern Heap* vmwareHeap_Create(CARD8* ptr, CARD32 size, CARD32 maxSlots, - CARD32 startOffset, CARD32 sWidth, CARD32 sHeight, - CARD32 sBPP, CARD32 sPitch, CARD32 sFbOffset); -extern void vmwareHeap_Destroy(Heap* heap); - -extern void vmwareHeap_Clear(Heap* heap); - -extern SVGASurface* vmwareHeap_GetFrontBuffer(Heap* heap); - -extern SVGASurface* vmwareHeap_AllocSurface(Heap* heap, CARD32 width, CARD32 height, - CARD32 pitch, CARD32 bpp); - -#endif diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/src/svga_modes.h new/xf86-video-vmware-10.15.0/src/svga_modes.h --- old/xf86-video-vmware-10.14.1/src/svga_modes.h 1970-01-01 01:00:00.000000000 +0100 +++ new/xf86-video-vmware-10.15.0/src/svga_modes.h 2007-02-09 19:00:10.000000000 +0100 @@ -0,0 +1,48 @@ +/* ********************************************************** + * Copyright (C) 2007 VMware, Inc. All Rights Reserved + * **********************************************************/ + +#ifndef _SVGA_MODES_H_ +#define _SVGA_MODES_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#include "includeCheck.h" + +#define SVGA_DEFAULT_MODES \ + /* 4:3 modes */ \ + SVGA_DEFAULT_MODE( 320, 240) \ + SVGA_DEFAULT_MODE( 400, 300) \ + SVGA_DEFAULT_MODE( 512, 384) \ + SVGA_DEFAULT_MODE( 640, 480) \ + SVGA_DEFAULT_MODE( 800, 600) \ + SVGA_DEFAULT_MODE(1024, 768) \ + SVGA_DEFAULT_MODE(1152, 864) \ + SVGA_DEFAULT_MODE(1280, 960) \ + SVGA_DEFAULT_MODE(1400, 1050) \ + SVGA_DEFAULT_MODE(1600, 1200) \ + SVGA_DEFAULT_MODE(1920, 1440) \ + SVGA_DEFAULT_MODE(2048, 1536) \ + SVGA_DEFAULT_MODE(2560, 1920) \ + /* 16:9 modes */ \ + SVGA_DEFAULT_MODE( 854, 480) \ + SVGA_DEFAULT_MODE(1280, 720) \ + SVGA_DEFAULT_MODE(1366, 768) \ + SVGA_DEFAULT_MODE(1920, 1080) \ + /* 16:10 modes */ \ + SVGA_DEFAULT_MODE(1280, 800) \ + SVGA_DEFAULT_MODE(1440, 900) \ + SVGA_DEFAULT_MODE(1680, 1050) \ + SVGA_DEFAULT_MODE(1920, 1200) \ + SVGA_DEFAULT_MODE(2560, 1600) \ + /* DVD modes */ \ + SVGA_DEFAULT_MODE( 720, 480) \ + SVGA_DEFAULT_MODE( 720, 576) \ + /* Odd modes */ \ + SVGA_DEFAULT_MODE( 320, 200) \ + SVGA_DEFAULT_MODE( 640, 400) \ + SVGA_DEFAULT_MODE( 800, 480) \ + SVGA_DEFAULT_MODE(1280, 768) \ + SVGA_DEFAULT_MODE(1280, 1024) + + +#endif /* _SVGA_MODES_H_ */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/src/vmware.c new/xf86-video-vmware-10.15.0/src/vmware.c --- old/xf86-video-vmware-10.14.1/src/vmware.c 2006-12-07 01:47:28.000000000 +0100 +++ new/xf86-video-vmware-10.15.0/src/vmware.c 2007-02-09 19:30:13.000000000 +0100 @@ -37,6 +37,7 @@ #include "vmware.h" #include "guest_os.h" #include "vm_device_version.h" +#include "svga_modes.h" #ifdef HaveDriverFuncs #define VMWARE_DRIVER_FUNC HaveDriverFuncs @@ -81,8 +82,8 @@ #define VMWARE_NAME "VMWARE" #define VMWARE_DRIVER_NAME "vmware" #define VMWARE_MAJOR_VERSION 10 -#define VMWARE_MINOR_VERSION 14 -#define VMWARE_PATCHLEVEL 1 +#define VMWARE_MINOR_VERSION 15 +#define VMWARE_PATCHLEVEL 0 #define VMWARE_DRIVER_VERSION \ (VMWARE_MAJOR_VERSION * 65536 + VMWARE_MINOR_VERSION * 256 + VMWARE_PATCHLEVEL) @@ -164,19 +165,32 @@ typedef enum { OPTION_HW_CURSOR, - OPTION_NOACCEL, OPTION_XINERAMA, OPTION_STATIC_XINERAMA } VMWAREOpts; static const OptionInfoRec VMWAREOptions[] = { { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_XINERAMA, "Xinerama", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_STATIC_XINERAMA, "StaticXinerama", OPTV_STRING, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; +/* Table of default modes to always add to the mode list. */ + +typedef struct { + int width; + int height; +} VMWAREDefaultMode; + +#define SVGA_DEFAULT_MODE(width, height) { width, height, }, + +static const VMWAREDefaultMode VMWAREDefaultModes[] = { + SVGA_DEFAULT_MODES +}; + +#undef SVGA_DEFAULT_MODE + static void VMWAREStopFIFO(ScrnInfoPtr pScrn); static void VMWARESave(ScrnInfoPtr pScrn); @@ -280,23 +294,6 @@ vmwareSendSVGACmdUpdate(pVMWARE, &BB); } -static void -vmwareSetPitchLock(VMWAREPtr pVMWARE, unsigned long fbPitch) -{ - CARD32 *vmwareFIFO = pVMWARE->vmwareFIFO; - - VmwareLog(("Attempting to set pitchlock\n")); - - if (pVMWARE->vmwareCapability & SVGA_CAP_PITCHLOCK) { - VmwareLog(("Using PitchLock register\n")); - vmwareWriteReg(pVMWARE, SVGA_REG_PITCHLOCK, fbPitch); - } else if (pVMWARE->hasPitchLockFIFOReg && - vmwareFIFO[SVGA_FIFO_MIN] >= (vmwareReadReg(pVMWARE, SVGA_REG_MEM_REGS) << 2)) { - VmwareLog(("Using PitchLock FIFO register\n")); - vmwareFIFO[SVGA_FIFO_PITCHLOCK] = fbPitch; - } -} - static CARD32 vmwareCalculateWeight(CARD32 mask) { @@ -863,12 +860,6 @@ } xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pVMWARE->hwCursor ? "HW" : "SW"); - if (xf86IsOptionSet(options, OPTION_NOACCEL)) { - pVMWARE->noAccel = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); - } else { - pVMWARE->noAccel = FALSE; - } pScrn->videoRam = pVMWARE->videoRam / 1024; pScrn->memPhysBase = pVMWARE->memPhysBase; @@ -960,14 +951,6 @@ xf86LoaderReqSymLists(ramdacSymbols, NULL); } - if (!pVMWARE->noAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { - VMWAREFreeRec(pScrn); - return FALSE; - } - xf86LoaderReqSymLists(vmwareXaaSymbols, NULL); - } - /* Initialise VMWARE_CTRL extension. */ VMwareCtrl_ExtInit(pScrn); @@ -1101,7 +1084,7 @@ } static Bool -VMWAREModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) +VMWAREModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool rebuildPixmap) { vgaHWPtr hwp = VGAHWPTR(pScrn); vgaRegPtr vgaReg = &hwp->ModeReg; @@ -1140,6 +1123,20 @@ VmwareLog(("fbSize: %u\n", pVMWARE->FbSize)); VmwareLog(("New dispWidth: %u\n", pScrn->displayWidth)); + if (rebuildPixmap) { + pScrn->pScreen->ModifyPixmapHeader((*pScrn->pScreen->GetScreenPixmap)(pScrn->pScreen), + pScrn->pScreen->width, + pScrn->pScreen->height, + pScrn->pScreen->rootDepth, + pScrn->bitsPerPixel, + PixmapBytePad(pScrn->displayWidth, + pScrn->pScreen->rootDepth), + (pointer)(pVMWARE->FbBase + pScrn->fbOffset)); + + (*pScrn->EnableDisableFBAccess)(pScrn->pScreen->myNum, FALSE); + (*pScrn->EnableDisableFBAccess)(pScrn->pScreen->myNum, TRUE); + } + vgaHWProtect(pScrn, FALSE); /* @@ -1148,15 +1145,6 @@ */ /* - * Let XAA know about the mode change. - */ - if (!pVMWARE->noAccel) { - if (!vmwareXAAModeInit(pScrn, mode)) { - return FALSE; - } - } - - /* * Update Xinerama info appropriately. */ if (pVMWARE->xinerama && !pVMWARE->xineramaStatic) { @@ -1218,9 +1206,6 @@ vmwareFIFO[SVGA_FIFO_NEXT_CMD] = min * sizeof(CARD32); vmwareFIFO[SVGA_FIFO_STOP] = min * sizeof(CARD32); vmwareWriteReg(pVMWARE, SVGA_REG_CONFIG_DONE, 1); - - pVMWARE->hasPitchLockFIFOReg = - extendedFifo && (vmwareFIFO[SVGA_FIFO_CAPABILITIES] & SVGA_FIFO_CAP_PITCHLOCK); } static void @@ -1248,12 +1233,6 @@ vmwareCursorCloseScreen(pScreen); } - if (pVMWARE->xaaInfo) { - vmwareXAACloseScreen(pScreen); - } - - vmwareSetPitchLock(pVMWARE, 0); - VMWARERestore(pScrn); VMWAREUnmapMem(pScrn); @@ -1450,9 +1429,7 @@ VMWAREInitFIFO(pScrn); /* Initialise the first mode */ - VMWAREModeInit(pScrn, pScrn->currentMode); - - vmwareSetPitchLock(pVMWARE, pVMWARE->fbPitch); + VMWAREModeInit(pScrn, pScrn->currentMode, FALSE); /* Set the viewport if supported */ VMWAREAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); @@ -1560,17 +1537,6 @@ } /* - * Initialize acceleration. - */ - if (!pVMWARE->noAccel) { - if (!vmwareXAAScreenInit(pScreen)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "XAA initialization failed -- running unaccelerated!\n"); - pVMWARE->noAccel = TRUE; - } - } - - /* * If backing store is to be supported (as is usually the case), * initialise it. */ @@ -1610,10 +1576,27 @@ } /* - * The initial mode that fixes the framebuffer is the current mode - * at ScreenInit time. + * We explictly add a set of default modes because the X server will + * not include modes larger than the initial one. */ - pVMWARE->initialMode = pScrn->currentMode; + { + unsigned int i; + unsigned int numModes = sizeof (VMWAREDefaultModes) / sizeof *(VMWAREDefaultModes); + char name[10]; + for (i = 0; i < numModes; i++) { + const VMWAREDefaultMode *mode = &VMWAREDefaultModes[i]; + + /* Only modes that fit the hardware maximums should be added. */ + if (mode->width <= pVMWARE->maxWidth && mode->height <= pVMWARE->maxHeight) { + snprintf(name, 10, "%dx%d", mode->width, mode->height); + VMWAREAddDisplayMode(pScrn, name, mode->width, mode->height); + } + } + + /* Add the hardware maximums as a mode. */ + snprintf(name, 10, "%dx%d", pVMWARE->maxWidth, pVMWARE->maxHeight); + VMWAREAddDisplayMode(pScrn, name, pVMWARE->maxWidth, pVMWARE->maxHeight); + } /* * We will lazily add the dynamic modes as the are needed when new @@ -1638,7 +1621,7 @@ static Bool VMWARESwitchMode(int scrnIndex, DisplayModePtr mode, int flags) { - return VMWAREModeInit(xf86Screens[scrnIndex], mode); + return VMWAREModeInit(xf86Screens[scrnIndex], mode, TRUE); } static Bool @@ -1651,9 +1634,7 @@ VMWAREInitFIFO(pScrn); } - vmwareSetPitchLock(pVMWARE, pVMWARE->fbPitch); - - return VMWAREModeInit(pScrn, pScrn->currentMode); + return VMWAREModeInit(pScrn, pScrn->currentMode, TRUE); } static void @@ -1662,8 +1643,6 @@ ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - vmwareSetPitchLock(pVMWARE, 0); - VMWARERestore(pScrn); } @@ -1776,7 +1755,7 @@ xf86AddDriver(&VMWARE, module, VMWARE_DRIVER_FUNC); LoaderRefSymLists(vgahwSymbols, fbSymbols, ramdacSymbols, - shadowfbSymbols, vmwareXaaSymbols, NULL); + shadowfbSymbols, NULL); return (pointer)1; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/src/vmwarectrl.c new/xf86-video-vmware-10.15.0/src/vmwarectrl.c --- old/xf86-video-vmware-10.14.1/src/vmwarectrl.c 2006-10-13 01:24:21.000000000 +0200 +++ new/xf86-video-vmware-10.15.0/src/vmwarectrl.c 2007-02-09 03:01:47.000000000 +0100 @@ -113,18 +113,27 @@ static Bool VMwareCtrlDoSetRes(ScrnInfoPtr pScrn, CARD32 x, - CARD32 y) + CARD32 y, + Bool resetXinerama) { DisplayModePtr mode; VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - + if (pScrn && pScrn->modes) { + VmwareLog(("DoSetRes: %d %d\n", x, y)); + + if (resetXinerama) { + xfree(pVMWARE->xineramaNextState); + pVMWARE->xineramaNextState = NULL; + pVMWARE->xineramaNextNumOutputs = 0; + } + /* * Don't resize larger than possible but don't * return an X Error either. */ - if (x > pVMWARE->initialMode->HDisplay || - y > pVMWARE->initialMode->VDisplay) { + if (x > pVMWARE->maxWidth || + y > pVMWARE->maxHeight) { return TRUE; } @@ -191,7 +200,7 @@ return BadMatch; } - if (!VMwareCtrlDoSetRes(pScrn, stuff->x, stuff->y)) { + if (!VMwareCtrlDoSetRes(pScrn, stuff->x, stuff->y, TRUE)) { return BadValue; } @@ -220,7 +229,8 @@ * VMwareCtrlDoSetTopology -- * * Set the custom topology and set a dynamic mode to the bounding box - * of the passed topology. + * of the passed topology. If a topology is already pending, then do + * nothing but do not return failure. * * Results: * TRUE on success, FALSE otherwise. @@ -245,11 +255,18 @@ short maxY = 0; size_t i; + if (pVMWARE->xineramaNextState) { + VmwareLog(("DoSetTopology: Aborting due to existing pending state\n")); + return TRUE; + } + for (i = 0; i < number; i++) { maxX = MAX(maxX, extents[i].x_org + extents[i].width); maxY = MAX(maxY, extents[i].y_org + extents[i].height); } + VmwareLog(("DoSetTopology: %d %d\n", maxX, maxY)); + xineramaState = (VMWAREXineramaPtr)xcalloc(number, sizeof(VMWAREXineramaRec)); if (xineramaState) { memcpy(xineramaState, extents, number * sizeof (VMWAREXineramaRec)); @@ -258,7 +275,7 @@ pVMWARE->xineramaNextState = xineramaState; pVMWARE->xineramaNextNumOutputs = number; - return VMwareCtrlDoSetRes(pScrn, maxX, maxY); + return VMwareCtrlDoSetRes(pScrn, maxX, maxY, FALSE); } else { return FALSE; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/src/vmware.h new/xf86-video-vmware-10.15.0/src/vmware.h --- old/xf86-video-vmware-10.14.1/src/vmware.h 2006-10-26 22:57:32.000000000 +0200 +++ new/xf86-video-vmware-10.15.0/src/vmware.h 2007-02-08 20:13:07.000000000 +0100 @@ -25,7 +25,6 @@ #include "vgaHW.h" /* VGA hardware */ #include "fb.h" -#include "xaa.h" #include "xf86cmap.h" /* xf86HandleColormaps */ @@ -33,8 +32,6 @@ #include "svga_reg.h" #include "svga_struct.h" -#include "offscreen_manager.h" - /* Arbitrarily choose max cursor dimensions. The emulation doesn't care. */ #define MAX_CURS 32 @@ -81,7 +78,6 @@ VMWARERegRec SavedReg; VMWARERegRec ModeReg; - DisplayModePtr initialMode; DisplayModePtr dynMode1; DisplayModePtr dynMode2; @@ -107,7 +103,6 @@ unsigned char* mmioVirtBase; CARD32* vmwareFIFO; - Bool hasPitchLockFIFOReg; xf86CursorInfoPtr CursorInfoRec; struct { @@ -126,23 +121,6 @@ ScreenRec ScrnFuncs; /* - * XAA info rec and misc storage - */ - XAAInfoRecPtr xaaInfo; - int xaaFGColor; - int xaaBGColor; - int xaaRop; - - unsigned char* xaaColorExpScanLine[1]; - unsigned int xaaColorExpSize; /* size of current scan line in DWords */ - - Heap* heap; - SVGASurface* frontBuffer; - - SVGASurface* curPict; - int op; - - /* * Xinerama state */ Bool xinerama; @@ -191,8 +169,6 @@ #define MOUSE_ID 1 -extern const char *vmwareXaaSymbols[]; - /*#define DEBUG_LOGGING*/ #ifdef DEBUG_LOGGING # define VmwareLog(args) ErrorF args @@ -257,19 +233,6 @@ ); -/* vmwarexaa.c */ -Bool vmwareXAAScreenInit( - ScreenPtr pScreen - ); - -Bool vmwareXAAModeInit( - ScrnInfoPtr pScrn, DisplayModePtr mode - ); - -void vmwareXAACloseScreen( - ScreenPtr pScreen - ); - /* vmwarectrl.c */ void VMwareCtrl_ExtInit(ScrnInfoPtr pScrn); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xf86-video-vmware-10.14.1/src/vmwarexaa.c new/xf86-video-vmware-10.15.0/src/vmwarexaa.c --- old/xf86-video-vmware-10.14.1/src/vmwarexaa.c 2006-07-01 08:18:43.000000000 +0200 +++ new/xf86-video-vmware-10.15.0/src/vmwarexaa.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,589 +0,0 @@ -/* ********************************************************** - * Copyright (C) 1998-2001 VMware, Inc. - * All Rights Reserved - * **********************************************************/ -#ifdef VMX86_DEVEL -char rcsId_vmwarexaa[] = - "Id: $"; -#endif -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarexaa.c,v 1.5 2003/02/04 01:39:53 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "vmware.h" - -#define OFFSCREEN_SCRATCH_SIZE 1*1024*1024 -/* We'll assume we average about 32x32 alpha surfaces (4096 bytes) or larger */ -#define OFFSCREEN_SCRATCH_MAX_SLOTS OFFSCREEN_SCRATCH_SIZE / 4096 - -const char *vmwareXaaSymbols[] = { - "XAACreateInfoRec", - "XAADestroyInfoRec", - "XAAInit", - NULL -}; - -static void vmwareXAASync(ScrnInfoPtr pScrn); - -static void vmwareSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, - unsigned int planemask); -static void vmwareSubsequentSolidFillRect(ScrnInfoPtr pScrn, - int x, int y, int w, int h); - -static void vmwareSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, - int xdir, int ydir, int rop, - unsigned int planemask, - int trans_color); -static void vmwareSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, - int x1, int y1, - int x2, int y2, - int width, int height); - -static void vmwareSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, - int fg, int bg, - int rop, - unsigned int planemask); -static void vmwareSubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, - int x, int y, - int w, int h, - int skipleft ); -static void vmwareSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno); - -#ifdef RENDER -static Bool vmwareSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int op, - CARD16 red, CARD16 green, - CARD16 blue, CARD16 alpha, - int alphaType, CARD8 *alphaPtr, - int alphaPitch, - int width, int height, - int flags); - -static Bool vmwareSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, int op, - int texType, CARD8 *texPtr, - int texPitch, - int width, int height, - int flags); - -static void vmwareSubsequentCPUToScreenTexture(ScrnInfoPtr pScrn, - int dstx, int dsty, - int srcx, int srcy, - int width, int height); - -static void vmwareXAAEnableDisableFBAccess(int index, Bool enable); - -CARD32 vmwareAlphaTextureFormats[2] = {PICT_a8, 0}; -CARD32 vmwareTextureFormats[2] = {PICT_a8r8g8b8, 0}; - -#endif - -#define SCRATCH_SIZE_BYTES(pvmware) \ - (((OFFSCREEN_SCRATCH_SIZE + (pvmware)->fbPitch - 1) / \ - (pvmware)->fbPitch) * (pvmware)->fbPitch) - -static void vmwareXAACreateHeap(ScreenPtr pScreen, ScrnInfoPtr pScrn, - VMWAREPtr pVMWARE) { - int scratchSizeBytes = SCRATCH_SIZE_BYTES(pVMWARE); - CARD8* osPtr = pVMWARE->FbBase + pVMWARE->videoRam - scratchSizeBytes; - - pVMWARE->heap = vmwareHeap_Create(osPtr, - scratchSizeBytes, - OFFSCREEN_SCRATCH_MAX_SLOTS, - pVMWARE->videoRam - scratchSizeBytes, - pScrn->virtualX, - pScrn->virtualY, - pVMWARE->bitsPerPixel, - pVMWARE->fbPitch, - pVMWARE->fbOffset); - pVMWARE->frontBuffer = vmwareHeap_GetFrontBuffer(pVMWARE->heap); -} - -#define DESTROY_XAA_INFO(pVMWARE) \ - if (pVMWARE->xaaInfo) { XAADestroyInfoRec(pVMWARE->xaaInfo); \ - pVMWARE->xaaInfo = NULL; } - -Bool -vmwareXAAScreenInit(ScreenPtr pScreen) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - XAAInfoRecPtr xaaInfo; - - pVMWARE->xaaInfo = XAACreateInfoRec(); - if (!pVMWARE->xaaInfo) { - return FALSE; - } - - xaaInfo = pVMWARE->xaaInfo; - - xaaInfo->Sync = vmwareXAASync; - - if (pVMWARE->vmwareCapability & SVGA_CAP_RECT_FILL) { - xaaInfo->SetupForSolidFill = vmwareSetupForSolidFill; - xaaInfo->SubsequentSolidFillRect = vmwareSubsequentSolidFillRect; - - xaaInfo->SolidFillFlags = NO_PLANEMASK | - (pVMWARE->vmwareCapability & SVGA_CAP_RASTER_OP ? 0 : GXCOPY_ONLY); - } - - if (pVMWARE->vmwareCapability & SVGA_CAP_RECT_COPY) { - xaaInfo->SetupForScreenToScreenCopy = vmwareSetupForScreenToScreenCopy; - xaaInfo->SubsequentScreenToScreenCopy = - vmwareSubsequentScreenToScreenCopy; - - xaaInfo->ScreenToScreenCopyFlags = NO_TRANSPARENCY | NO_PLANEMASK | - (pVMWARE->vmwareCapability & SVGA_CAP_RASTER_OP ? 0 : GXCOPY_ONLY); - } - - /* - * We don't support SVGA_CAP_GLYPH without clipping, since we use clipping - * for normal glyphs. - */ - if (pVMWARE->vmwareCapability & SVGA_CAP_GLYPH_CLIPPING) { - xaaInfo->SetupForScanlineCPUToScreenColorExpandFill = - vmwareSetupForScanlineCPUToScreenColorExpandFill; - xaaInfo->SubsequentScanlineCPUToScreenColorExpandFill = - vmwareSubsequentScanlineCPUToScreenColorExpandFill; - xaaInfo->SubsequentColorExpandScanline = - vmwareSubsequentColorExpandScanline; - - xaaInfo->NumScanlineColorExpandBuffers = 1; - xaaInfo->ScanlineColorExpandBuffers = pVMWARE->xaaColorExpScanLine; - - xaaInfo->ScanlineCPUToScreenColorExpandFillFlags = GXCOPY_ONLY | - NO_PLANEMASK | BIT_ORDER_IN_BYTE_MSBFIRST | LEFT_EDGE_CLIPPING; - } - - if (pVMWARE->vmwareCapability & SVGA_CAP_OFFSCREEN_1) { - int scratchSizeBytes = SCRATCH_SIZE_BYTES(pVMWARE); - BoxRec box; - RegionRec region; - - box.x1 = 0; - box.y1 = (pVMWARE->FbSize + pVMWARE->fbPitch - 1) / pVMWARE->fbPitch; - box.x2 = pScrn->displayWidth; - box.y2 = pVMWARE->videoRam / pVMWARE->fbPitch; - -#ifdef RENDER - if (pVMWARE->vmwareCapability & SVGA_CAP_ALPHA_BLEND && - pScrn->bitsPerPixel > 8) { - if (box.y2 - (scratchSizeBytes / pVMWARE->fbPitch) > box.y1 + 4) { - box.y2 -= scratchSizeBytes / pVMWARE->fbPitch; - - VmwareLog(("Allocated %d bytes at offset %d for alpha scratch\n", - scratchSizeBytes, - pVMWARE->videoRam - scratchSizeBytes)); - - vmwareXAACreateHeap(pScreen, pScrn, pVMWARE); - - xaaInfo->SetupForCPUToScreenAlphaTexture = - vmwareSetupForCPUToScreenAlphaTexture; - xaaInfo->SubsequentCPUToScreenAlphaTexture = - vmwareSubsequentCPUToScreenTexture; - xaaInfo->CPUToScreenAlphaTextureFlags = XAA_RENDER_NO_TILE | - XAA_RENDER_NO_SRC_ALPHA; - xaaInfo->CPUToScreenAlphaTextureFormats = vmwareAlphaTextureFormats; - - xaaInfo->SetupForCPUToScreenTexture = - vmwareSetupForCPUToScreenTexture; - xaaInfo->SubsequentCPUToScreenTexture = - vmwareSubsequentCPUToScreenTexture; - xaaInfo->CPUToScreenTextureFlags = XAA_RENDER_NO_TILE; - xaaInfo->CPUToScreenTextureFormats = vmwareTextureFormats; - } else { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Allocation of offscreen " - "scratch area for alpha blending failed\n"); - } - } -#endif - - if (box.y2 > box.y1) { - REGION_INIT(pScreen, ®ion, &box, 1); - - if (REGION_NOTEMPTY(pScreen, ®ion) && - xf86InitFBManagerRegion(pScreen, ®ion)) { - VmwareLog(("Offscreen memory initialized: (%d, %d) - (%d, %d)\n", - box.x1, box.y1, box.x2, box.y2)); - - xaaInfo->Flags = - LINEAR_FRAMEBUFFER | PIXMAP_CACHE | OFFSCREEN_PIXMAPS; - } else { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Offscreen memory manager " - "initialization failed.\n"); - } - - REGION_UNINIT(pScreen, ®ion); - } - } - - if (!XAAInit(pScreen, xaaInfo)) { - DESTROY_XAA_INFO(pVMWARE); - return FALSE; - } - -#ifdef RENDER - if (pVMWARE->heap) { - pVMWARE->EnableDisableFBAccess = pScrn->EnableDisableFBAccess; - pScrn->EnableDisableFBAccess = vmwareXAAEnableDisableFBAccess; - } -#endif - - return TRUE; -} - -Bool -vmwareXAAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) -{ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - - /* - * Alloc a sufficiently large buffer for XAA to render scanlines - * for a color expand into. - */ - if (pVMWARE->vmwareCapability & SVGA_CAP_GLYPH) { - /* - * This formula came straight from the XAA.HOWTO doc. The +62 is - * there because we potentially have 31 extra bits off to the left, - * since we claim LEFT_EDGE_CLIPPING support. - */ - int scanLineSize = ((pScrn->virtualX + 62)/32) * 4; - if (pVMWARE->xaaColorExpScanLine[0]) { - xfree(pVMWARE->xaaColorExpScanLine[0]); - } - pVMWARE->xaaColorExpScanLine[0] = xalloc(scanLineSize); - return pVMWARE->xaaColorExpScanLine[0] != NULL; - } - - return TRUE; -} - -void -vmwareXAACloseScreen(ScreenPtr pScreen) -{ - VMWAREPtr pVMWARE = VMWAREPTR(xf86Screens[pScreen->myNum]); - - if (pVMWARE->xaaColorExpScanLine[0]) { - xfree(pVMWARE->xaaColorExpScanLine[0]); - pVMWARE->xaaColorExpScanLine[0] = NULL; - } - - DESTROY_XAA_INFO(pVMWARE); - -#ifdef RENDER - if (pVMWARE->heap) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - pScrn->EnableDisableFBAccess = pVMWARE->EnableDisableFBAccess; - vmwareHeap_Destroy(pVMWARE->heap); - pVMWARE->heap = NULL; - } -#endif -} - -static void -vmwareXAASync(ScrnInfoPtr pScrn) -{ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - - VmwareLog(("Sync\n")); - - vmwareWaitForFB(pVMWARE); - -#ifdef RENDER - if (pVMWARE->heap) { - vmwareHeap_Clear(pVMWARE->heap); - } -#endif -} - -static void -vmwareSetupForSolidFill(ScrnInfoPtr pScrn, - int color, int rop, unsigned int planemask) -{ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - pVMWARE->xaaFGColor = color; - pVMWARE->xaaRop = rop; - - VmwareLog(("Setup Solid Fill (color = %d, rop = %d)\n", color, rop)); -} - -static void -vmwareSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h) -{ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - - VmwareLog((" Do Solid Fill (x = %d, y = %d, w = %d, h = %d)\n", x, y, w, h)); - - if (pVMWARE->xaaRop != GXcopy) { - /* - * We'll never get here if SVGA_CAP_RASTER_OP isn't set, since - * we tell XAA we are GXCOPY_ONLY. - */ - vmwareWriteWordToFIFO(pVMWARE, SVGA_CMD_RECT_ROP_FILL); - vmwareWriteWordToFIFO(pVMWARE, pVMWARE->xaaFGColor); - vmwareWriteWordToFIFO(pVMWARE, x); - vmwareWriteWordToFIFO(pVMWARE, y); - vmwareWriteWordToFIFO(pVMWARE, w); - vmwareWriteWordToFIFO(pVMWARE, h); - vmwareWriteWordToFIFO(pVMWARE, pVMWARE->xaaRop); - } else { - vmwareWriteWordToFIFO(pVMWARE, SVGA_CMD_RECT_FILL); - vmwareWriteWordToFIFO(pVMWARE, pVMWARE->xaaFGColor); - vmwareWriteWordToFIFO(pVMWARE, x); - vmwareWriteWordToFIFO(pVMWARE, y); - vmwareWriteWordToFIFO(pVMWARE, w); - vmwareWriteWordToFIFO(pVMWARE, h); - } -} - -static void -vmwareSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, - int xdir, int ydir, int rop, - unsigned int planemask, - int trans_color) -{ - /* - * We can safely ignore xdir and ydir since our "hardware" is smart - * enough to figure out the direction from the srcx/y, dstx/y, w and h. - */ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - pVMWARE->xaaRop = rop; - - VmwareLog(("Setup Screen2Screen copy (rop = %d)\n", rop)); -} - -static void -vmwareSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, - int x1, int y1, - int x2, int y2, - int width, int height) -{ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - - VmwareLog((" Do Screen2Screen copy (x1 = %d, y1 = %d, x2 = %d, y2 = %d," - " w = %d, h = %d)\n", x1, y1, x2, y2, width, height)); - - if (pVMWARE->xaaRop != GXcopy) { - /* - * We'll never get here if SVGA_CAP_RASTER_OP isn't set, since - * we tell XAA we are GXCOPY_ONLY. - */ - vmwareWriteWordToFIFO(pVMWARE, SVGA_CMD_RECT_ROP_COPY); - vmwareWriteWordToFIFO(pVMWARE, x1); - vmwareWriteWordToFIFO(pVMWARE, y1); - vmwareWriteWordToFIFO(pVMWARE, x2); - vmwareWriteWordToFIFO(pVMWARE, y2); - vmwareWriteWordToFIFO(pVMWARE, width); - vmwareWriteWordToFIFO(pVMWARE, height); - vmwareWriteWordToFIFO(pVMWARE, pVMWARE->xaaRop); - } else { - vmwareWriteWordToFIFO(pVMWARE, SVGA_CMD_RECT_COPY); - vmwareWriteWordToFIFO(pVMWARE, x1); - vmwareWriteWordToFIFO(pVMWARE, y1); - vmwareWriteWordToFIFO(pVMWARE, x2); - vmwareWriteWordToFIFO(pVMWARE, y2); - vmwareWriteWordToFIFO(pVMWARE, width); - vmwareWriteWordToFIFO(pVMWARE, height); - } -} - -static void -vmwareSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, - int fg, int bg, - int rop, - unsigned int planemask) -{ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - - pVMWARE->xaaFGColor = fg; - pVMWARE->xaaBGColor = bg; - VmwareLog(("Setup color expand (fg = %d, bg = %d, rop = %d)\n", - fg, bg, rop)); -} - -static void -vmwareSubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, - int x, int y, - int w, int h, - int skipleft ) -{ - /* - * XXX TODO: if xaaColorExpSize will fit entirely into the FIFO, - * temporarily switch to direct mode, and have XAA write bits - * directly into the fifo. See ATI driver for an example. - */ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - - pVMWARE->xaaColorExpSize = SVGA_GLYPH_SCANLINE_SIZE_DWORDS(w); - - VmwareLog((" Do color expand (x = %d, y = %d, w = %d, h = %d," - " skipleft = %d, sizedw = %d)\n", - x, y, w, h, skipleft, pVMWARE->xaaColorExpSize)); - - vmwareWriteWordToFIFO(pVMWARE, SVGA_CMD_DRAW_GLYPH_CLIPPED); - vmwareWriteWordToFIFO(pVMWARE, x); - vmwareWriteWordToFIFO(pVMWARE, y); - vmwareWriteWordToFIFO(pVMWARE, pVMWARE->xaaColorExpSize * 32U); - vmwareWriteWordToFIFO(pVMWARE, h); - vmwareWriteWordToFIFO(pVMWARE, pVMWARE->xaaFGColor); - vmwareWriteWordToFIFO(pVMWARE, pVMWARE->xaaBGColor); - vmwareWriteWordToFIFO(pVMWARE, x + skipleft); - vmwareWriteWordToFIFO(pVMWARE, y); - vmwareWriteWordToFIFO(pVMWARE, w - skipleft); - vmwareWriteWordToFIFO(pVMWARE, h); -} - -static void -vmwareSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) -{ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - CARD32* scanLine = (CARD32*)pVMWARE->xaaColorExpScanLine[0]; - unsigned int dwords = pVMWARE->xaaColorExpSize; - - while (dwords--) { - vmwareWriteWordToFIFO(pVMWARE, *scanLine++); - } -} - -#ifdef RENDER - -static void -RGBPlusAlphaChannelToPremultipliedRGBA( - CARD8 red, CARD8 green, CARD8 blue, - CARD8 *alphaPtr, /* in bytes */ - int alphaPitch, - CARD32 *dstPtr, - int dstPitch, /* in dwords */ - int width, int height) -{ - int x; - - while (height--) { - for (x = 0; x < width; x++) { - CARD8 alpha = alphaPtr[x]; - dstPtr[x] = (alpha << 24) | - ((red * alpha / 255) << 16) | - ((green * alpha / 255) << 8) | - (blue * alpha / 255); - } - dstPtr += dstPitch; - alphaPtr += alphaPitch; - } -} - -Bool -vmwareSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int op, - CARD16 red, CARD16 green, - CARD16 blue, CARD16 alpha, - int alphaType, CARD8 *alphaPtr, - int alphaPitch, - int width, int height, - int flags) -{ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - SVGASurface* surf; - - VmwareLog(("Setup alpha texture (op = %d, r = %d, g = %d, b = %d," - " a = %d, alphaType = %d, alphaPitch = %d, w = %d, h = %d," - " flags = %d)\n", op, red, green, blue, alpha, alphaType, - alphaPitch, width, height, flags)); - - if (op > PictOpSaturate) { - return FALSE; - } - - surf = vmwareHeap_AllocSurface(pVMWARE->heap, width, height, width * 4, 32); - - if (!surf) { - return FALSE; - } - - RGBPlusAlphaChannelToPremultipliedRGBA( - red >> 8, green >> 8, blue >> 8, - alphaPtr, alphaPitch, - (CARD32*)(pVMWARE->FbBase + surf->dataOffset), - width, width, height); - - pVMWARE->curPict = surf; - pVMWARE->op = op; - - return TRUE; -} - -Bool -vmwareSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, int op, - int texType, CARD8 *texPtr, - int texPitch, - int width, int height, - int flags) -{ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - SVGASurface* surf; - - VmwareLog(("Setup texture (op = %d, texType = %d, texPitch = %d," - " w = %d, h = %d, flags = %d)\n", op, texType, texPitch, - width, height, flags)); - - if (op > PictOpSaturate) { - return FALSE; - } - - surf = vmwareHeap_AllocSurface(pVMWARE->heap, width, height, texPitch, 32); - - if (!surf) { - return FALSE; - } - - memcpy(pVMWARE->FbBase + surf->dataOffset, texPtr, texPitch * height); - - pVMWARE->curPict = surf; - pVMWARE->op = op; - - return TRUE; -} - -void -vmwareSubsequentCPUToScreenTexture(ScrnInfoPtr pScrn, - int dstx, int dsty, - int srcx, int srcy, - int width, int height) -{ - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - - VmwareLog((" Do texture (dstx = %d, dsty = %d, srcx = %d, srcy = %d" - " w = %d, h = %d)\n", dstx, dsty, srcx, srcy, width, height)); - - pVMWARE->curPict->numQueued++; - pVMWARE->frontBuffer->numQueued++; - - vmwareWriteWordToFIFO(pVMWARE, SVGA_CMD_SURFACE_ALPHA_BLEND); - vmwareWriteWordToFIFO(pVMWARE, (CARD8*)pVMWARE->curPict - pVMWARE->FbBase); - vmwareWriteWordToFIFO(pVMWARE, (CARD8*)pVMWARE->frontBuffer - pVMWARE->FbBase); - vmwareWriteWordToFIFO(pVMWARE, srcx); - vmwareWriteWordToFIFO(pVMWARE, srcy); - vmwareWriteWordToFIFO(pVMWARE, dstx); - vmwareWriteWordToFIFO(pVMWARE, dsty); - vmwareWriteWordToFIFO(pVMWARE, width); - vmwareWriteWordToFIFO(pVMWARE, height); - vmwareWriteWordToFIFO(pVMWARE, pVMWARE->op); - vmwareWriteWordToFIFO(pVMWARE, 0); /* flags */ - vmwareWriteWordToFIFO(pVMWARE, 0); /* param1 */ - vmwareWriteWordToFIFO(pVMWARE, 0); /* param2 */ -} - -void -vmwareXAAEnableDisableFBAccess(int index, Bool enable) -{ - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = pScrn->pScreen; - VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - - if (enable && pVMWARE->heap) { - vmwareHeap_Destroy(pVMWARE->heap); - vmwareXAACreateHeap(pScreen, pScrn, pVMWARE); - } - - (*pVMWARE->EnableDisableFBAccess)(index, enable); -} - -#endif ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org