[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-s3: Changes to 'upstream-unstable'



 ChangeLog       |   43 +++++++
 Makefile.am     |    2 
 README          |   20 +++
 configure.ac    |    7 -
 man/Makefile.am |   58 ++++++++++
 man/s3.man      |  240 ++++++++++++++++++++++++++++++++++++++++++
 src/Makefile.am |    3 
 src/s3.h        |   21 ++-
 src/s3_driver.c |  315 ++++++++++++++++++++++----------------------------------
 src/s3_shadow.c |  274 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/s3_video.c  |   22 +++
 11 files changed, 801 insertions(+), 204 deletions(-)

New commits:
commit aa955eda7b6fddd12b163ee66367ecc998f82ae0
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu Jul 2 11:33:54 2009 -0400

    s3 0.6.2

diff --git a/configure.ac b/configure.ac
index ce47a1f..c2cc3df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-s3],
-        0.6.1,
+        0.6.2,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-s3)
 

commit 2b83d07b90efd15756cf8c4c80f7f60c0e7cee2a
Author: Evgeny M. Zubok <evgeny.zubok@tochka.ru>
Date:   Thu Jun 25 19:48:34 2009 +0400

    Revert the using of BIOS defaults for the VRAM/DRAM timings

diff --git a/ChangeLog b/ChangeLog
index a13d5b4..ad0b227 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-06-25  Evgeny M. zubok <evgeny.zubok@tochka.ru>
+
+	* src/s3_driver.c:
+	Revert the old behaviour when the BIOS settings are used for
+	intialization of DRAM/VRAM timings, i. e. we don't touch the
+	timings during initialization phase until any memory option (like
+	slow_edodram) is specified.
+	
+	Add manual page.	
+
 2009-05-25  Evgeny M. Zubok <evgeny.zubok@tochka.ru>
 	
 	* src/s3_driver.c:
@@ -20,7 +30,7 @@
 	* src/s3_shadow.c:
 
 	Add shadowFB option. It can be used to speedup drawing when
-	hardware acceleration is unwanted or unavailable (for colour depth
+	hardware acceleration is undesirable or unavailable (for colour depth
 	24 with 24 bpp framebuffer, for example). shadowFB is disabled by
 	default. Enabling shadowFB option disables HW acceleration. Thanks
 	to Egor Ivanov for initial porting of shadowFB from s3virge.
diff --git a/man/s3.man b/man/s3.man
index acbd0c9..9109c2a 100644
--- a/man/s3.man
+++ b/man/s3.man
@@ -51,7 +51,7 @@ driver supports PCI video cards based on the following S3 chips:
 .PP
 Also driver supports the following RAMDACs:
 .TP 12
-.B IBM 524A 
+.B IBM 524, IBM 524A, IBM 526, IBM 526DB
 .TP 12
 .B TI ViewPoint 3025 
 
@@ -163,9 +163,9 @@ lower either the resolution or framebuffer's depth or both before the
 viewing, otherwise, you will get the allocation error and will not see
 the video. For example, with 24 bpp framebuffer and the same
 resolution 800x600 the offscreen area will be about 640 kB - it's
-enough for the 640x480 frame. 800x600 with the 16bpp framebuffer gives
-about 1110 kB of offscreen area - this allows to upscale up to 768x576
-movies. Note, that all movie resolutions in examples above are
+enough for the 640x480 frame. 800x600 with the 16 bpp framebuffer
+gives about 1110 kB of offscreen area - this allows to upscale up to
+768x576 movies. Note, that all movie resolutions in examples above are
 provided as a reference; the movies can have the different aspect
 ratios and non-standard dimensions. A total pixel amount is the main
 consideration not the certain width and height.
@@ -212,12 +212,12 @@ cycle).
 .BI "Option \*qslow_edodram\*q \*q" boolean \*q
 Switch to 2-cycle EDO mode. Try this if you encounter pixel
 corruption. Using this option will cause a decrease in
-performance. Default: off (1-cycle EDO mode).
+performance. Default: off (BIOS defaults).
 .TP
 .BI "Option \*qslow_dram\*q \*q" boolean \*q
 For Trio and Aurora64V+ chips: increase -RAS Precharge Timing to 3.5
-MCLK. Try this option if you encounter pixel errors. Default: off (2.5
-MCLK).
+MCLK. Try this option if you encounter pixel errors. Default: off
+(BIOS defaults).
 .TP
 .BI "Option \*qslow_vram\*q \*q" boolean \*q
 For Vision964, Vision968 chips: increase -RAS Low Timing to 4.5
diff --git a/src/s3_driver.c b/src/s3_driver.c
index 5d6623f..d5b01bf 100644
--- a/src/s3_driver.c
+++ b/src/s3_driver.c
@@ -1659,35 +1659,14 @@ static Bool S3ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
 		new->cr66 |= 0x80;
 	outb(vgaCRReg, new->cr66);
 
+
 	if (pS3->SlowDRAMRefresh)
 		new->cr3a = 0xb7;
-	else
+       	else
 		new->cr3a = 0xb5;
 	outb(vgaCRIndex, 0x3a);
 	outb(vgaCRReg, new->cr3a);
 
-	/* 
-	   Set 3.5 MCLKs for -RAS low, 2.5 MCLKs for -RAS precharge, 
-	   disable -CAS/-OE adjustment. It seems that cr68 has different 
-	   format for 96x and TRIOs
-	*/
-	if (!((pS3->Chipset == PCI_CHIP_968) || 
-	      (pS3->Chipset == PCI_CHIP_964_0) ||
-	      (pS3->Chipset == PCI_CHIP_964_1))) {
-
-		outb(vgaCRIndex, 0x39);
-		outb(vgaCRReg, 0xa5);
-
-		outb(vgaCRIndex, 0x68);
-		tmp = inb(vgaCRReg) & ~0x0f;
-		outb(vgaCRReg, tmp | 0x0f);
-
-		/* Enable 1-cycle EDO access */
-		outb(vgaCRIndex, 0x36);
-		tmp = inb(vgaCRReg);
-		outb(vgaCRReg, tmp & 0xf3);
-	}
-	
 	if (pS3->SlowVRAM) {
 		/*
 		 * some Diamond Stealth 64 VRAM cards have a problem with

commit bf6bdcc1220f3ed8c636e869c4b13e27923a139e
Author: Evgeny M. Zubok <evgeny.zubok@tochka.ru>
Date:   Thu Jun 25 01:57:06 2009 +0400

    Add manual page.

diff --git a/Makefile.am b/Makefile.am
index 16f4412..7052905 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,4 +19,4 @@
 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 AUTOMAKE_OPTIONS = foreign
-SUBDIRS = src
+SUBDIRS = src man
diff --git a/configure.ac b/configure.ac
index 67479ed..ce47a1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,7 +83,10 @@ AC_SUBST([DRIVER_NAME])
 XORG_MANPAGE_SECTIONS
 XORG_RELEASE_VERSION
 
+XORG_CHECK_LINUXDOC
+
 AC_OUTPUT([
 	Makefile
 	src/Makefile
+	man/Makefile
 ])
diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100644
index 0000000..f0eb29b
--- /dev/null
+++ b/man/Makefile.am
@@ -0,0 +1,58 @@
+#
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+# 
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation.
+# 
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+# 
+# Except as contained in this notice, the name of the copyright holders shall
+# not be used in advertising or otherwise to promote the sale, use or
+# other dealings in this Software without prior written authorization
+# from the copyright holders.
+# 
+
+drivermandir = $(DRIVER_MAN_DIR)
+
+driverman_PRE = @DRIVER_NAME@.man
+
+driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
+
+EXTRA_DIST = @DRIVER_NAME@.man
+
+CLEANFILES = $(driverman_DATA)
+
+SED = sed
+
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+  XORGMANNAME = X Version 11
+
+MAN_SUBSTS = \
+	-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
+	-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
+	-e 's|__xservername__|Xorg|g' \
+	-e 's|__xconfigfile__|xorg.conf|g' \
+	-e 's|__projectroot__|$(prefix)|g' \
+	-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
+	-e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
+	-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
+	-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
+	-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
+
+SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
+
+.man.$(DRIVER_MAN_SUFFIX):
+	sed $(MAN_SUBSTS) < $< > $@
diff --git a/man/s3.man b/man/s3.man
new file mode 100644
index 0000000..acbd0c9
--- /dev/null
+++ b/man/s3.man
@@ -0,0 +1,240 @@
+.\" shorthand for double quote that works everywhere.
+.ds q \N'34'
+.TH s3 __drivermansuffix__ __vendorversion__
+.SH NAME
+s3 \- S3 video driver
+.SH SYNOPSIS
+.B Section \*qDevice\*q
+.RS 2
+.B Identifier \*q\fIdevname\fP\*q
+.br
+.B Driver \*qs3\*q
+.br
+.B ...
+.br
+[\fBOption\fP "optionname" ["optionvalue"]]
+.RE
+.B EndSection
+
+.SH SUPPORTED HARDWARE
+The
+.B s3
+driver supports PCI video cards based on the following S3 chips:
+.TP 12
+.B Trio32
+86C732
+.TP 12
+.B Trio64
+86C764
+.TP 12
+.B Trio64V+
+86C765
+.TP 12
+.B Aurora64V+
+86CM65
+.TP 12
+.B Trio64UV+
+86C767
+.TP 12
+.B Trio64V2/DX
+86C775
+.TP 12
+.B Trio64V2/GX
+86C785
+.TP 12
+.B Vision964
+86C964
+.TP 12
+.B Vision968
+86C968
+
+.PP
+Also driver supports the following RAMDACs:
+.TP 12
+.B IBM 524A 
+.TP 12
+.B TI ViewPoint 3025 
+
+.SH DESCRIPTION
+\fBs3\fP is an __xservername__ driver for S3 based video cards. The
+driver provides full accelerated support for the following colour
+depths: 8, 15, 16 and 24. The overlay video (Xv) is supported in
+depths 16 and 24 for the Trio64V+, Trio64UV+, Trio64V2/DX and
+Trio64V2/GX chips.
+
+.SH CONFIGURATION DETAILS
+Please refer to __xconfigfile__(__filemansuffix__) for general
+configuration details.  This section only covers configuration details
+specific to this driver. All options names are case and white space
+insensitive when parsed by the server, for example, "trio 32/64" and
+"Trio32/64" are equivalent.
+
+.SS
+Chip overriding
+.PP
+The driver auto-detects the chipset and RAMDAC, but the following
+\fBChipset\fP names may optionally be specified in the configuration
+file \fB\*qDevice\*q\fP section, and will override the auto-detection:
+
+.PP
+.RS 4
+.TP 18
+"964-0", "964-1"
+86C964 (rev.0 and rev.1)
+.TP 18
+"968"
+86C968
+.TP 18
+"Trio32/64"
+86C732/86C764
+.TP 18 
+"Aurora64V+"
+86CM65
+.TP 18
+"Trio64UV+"
+86C767 
+.TP 18
+"Trio64V2/DX/GX"
+86C775/86C785
+.RE
+
+.PP
+The 86C765 (Trio64V+) is \fBChipset\fP "Trio32/64" with \fBChipRev\fP
+greater or equal 0x40.
+
+An overriding of RAMDAC auto-detection currently is not implemented.
+
+.SS
+Colour depth
+.PP
+For every supported colour depth the X server automatically selects an
+appropriate number of bits per pixel (bpp) for framebuffer. The depth
+8 is represented by 8 bpp framebuffer (1 byte/pixel), the depths 15
+and 16 (respectively 5.5.5 and 5.6.5 pixel formats) are represented by
+the 16 bpp framebuffer (2 bytes/pixel). Whenever the depth 24 is
+configured, the X server by default uses the 32 bpp framebuffer (4
+bytes/pixel), and the hardware is adjusted accordingly to the X.8.8.8
+pixel format, where X is the ignored upper byte.
+
+.PP
+As the second option for the depth 24, the X server can be configured
+to use 24 bpp framebuffer with the 8.8.8 pixel format (3 bytes/pixel),
+which is supported by Trio64V+, Trio64UV+, Trio64V2/DX and
+Trio64V2/GX. If the video board has limited video RAM the 24 bpp
+framebuffer has an advantage over 32 bpp framebuffer as it requires
+less memory to store screen, and, therefore, more space will be
+available for a video frame (see "Overlay video" section).  The 24 bpp
+framebuffer can be selected by X server's option \fB-fbbpp 24\fP or by
+specifying \fBDefaultFbBpp\fP option in
+__xconfigfile__(__filemansuffix__):
+
+.RS 4
+.B Section \*qScreen\*q
+.RS 2
+.B DefaultFbBpp 24
+.br
+.B DefaultDepth 24
+.br
+.B ...
+.RE
+.B EndSection
+.RE
+
+.PP
+However, the 24 bpp framebuffer mode has the hardware limitations: (i)
+the 2D acceleration doesn't work with this mode (use the
+\fB\*qshadowFB\*q\fP option to speed up drawing routines in this
+case); (ii) 24 bpp framebuffer cannot be used with either interlaced
+or doublescan graphics modes.
+
+.SS
+Overlay video
+.PP
+If your video board has limited RAM it would be useful to estimate how
+large video frame might be placed in offscreen video memory. Suppose
+that the video board has 2 MB of RAM, and X server is configured to
+display 800x600 with the depth 24. By default the 32 bpp framebuffer
+will be chosen for this depth, so 800 x 600 x 4 = 1875 kB will be
+reserved for screen, and 2 MB - 1875 kB = 173 kB will remain for the
+offscreen area. This is sufficient space, for example, for the VCD
+NTSC 352x240 frame. If you need to upscale video with a bigger frame,
+but it doesn't fit the offscreen area, the only way to do this is to
+lower either the resolution or framebuffer's depth or both before the
+viewing, otherwise, you will get the allocation error and will not see
+the video. For example, with 24 bpp framebuffer and the same
+resolution 800x600 the offscreen area will be about 640 kB - it's
+enough for the 640x480 frame. 800x600 with the 16bpp framebuffer gives
+about 1110 kB of offscreen area - this allows to upscale up to 768x576
+movies. Note, that all movie resolutions in examples above are
+provided as a reference; the movies can have the different aspect
+ratios and non-standard dimensions. A total pixel amount is the main
+consideration not the certain width and height.
+.PP
+Due to hardware limitation the overlay video will not work with the
+interlaced/doublescan modes. Downscaling is not implemented in
+hardware.
+
+.SS
+Configuration options
+.PP
+The following display
+.B Options
+are supported:
+.TP
+.BI "Option \*qHWCursor\*q \*q" boolean \*q
+Enable or disable the hardware cursor. Currently, hardware cursor is
+not implemented, so the option will be ignored. Default: off (software
+cursor).
+.TP
+.BI "Option \*qNoAccel\*q \*q" boolean \*q
+Disable acceleration. Very useful for determining if the driver has
+problems with drawing and acceleration routines. This is the first
+option to try if your server runs but you see graphic corruption on
+the screen. Using it decreases performance, as it uses software
+emulation for drawing operations the video driver can accelerate with
+hardware. Default: off (acceleration is enabled).
+.TP
+.BI "Option \*qShadowFB\*q \*q" boolean \*q
+Use shadow framebuffer. Disables hardware acceleration. Use this
+option when the hardware acceleration is not available or
+undesirable. Default: off.
+.TP
+.BI "Option \*qXVideo\*q \*q" boolean \*q
+Enable or disable Xv support. Default: on.
+
+.PP
+The following video memory \fBOptions\fP are supported:
+.TP
+.BI "Option \*qslow_dram_refresh\*q \*q" boolean \*q
+Enable three refresh cycles per scanline. Default: off (one refresh
+cycle).
+.TP
+.BI "Option \*qslow_edodram\*q \*q" boolean \*q
+Switch to 2-cycle EDO mode. Try this if you encounter pixel
+corruption. Using this option will cause a decrease in
+performance. Default: off (1-cycle EDO mode).
+.TP
+.BI "Option \*qslow_dram\*q \*q" boolean \*q
+For Trio and Aurora64V+ chips: increase -RAS Precharge Timing to 3.5
+MCLK. Try this option if you encounter pixel errors. Default: off (2.5
+MCLK).
+.TP
+.BI "Option \*qslow_vram\*q \*q" boolean \*q
+For Vision964, Vision968 chips: increase -RAS Low Timing to 4.5
+MCLK. Default: off (BIOS defaults).
+
+.SH SEE ALSO
+__xservername__(1), __xconfigfile__(__filemansuffix__), Xserver(1),
+X(__miscmansuffix__)
+
+.SH AUTHORS
+Thomas Roell, Mark Vojkovich, Kevin E. Martin, Amancio Hasty, Jon
+N. Tombs and others were the original authors of driver for XFree86
+3.x. Ani Joshi reworked driver for XFree86 4.x. The further
+modifications were made by the following contributors: Adam Jackson,
+Alan Coopersmith, Dave Airlie, Andrew Radrianasulu, Paulo Cesar
+Pereira de Andrade, Eric Anholt, Søren Sandmann Pedersen, Alex
+Deucher, Evgeny M. Zubok, Daniel Stone and others.
+
+.PP
+The manual was written by Evgeny M. Zubok <evgeny.zubok@tochka.ru>

commit 003d36e18e32b656c1dc309c5238fa5b4804c58e
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu May 28 15:14:38 2009 -0400

    Remove useless loader symbol lists.

diff --git a/src/s3_driver.c b/src/s3_driver.c
index 7869da7..5d6623f 100644
--- a/src/s3_driver.c
+++ b/src/s3_driver.c
@@ -183,71 +183,6 @@ RamDacSupportedInfoRec S3IBMRamdacs[] = {
 	{ -1 }
 };
 
-static const char *fbSymbols[] = {
-    "fbPictureInit",
-    "fbScreenInit",
-    NULL
-};
-
-static const char *vgaHWSymbols[] = {
-        "vgaHWGetHWRec",
-        "vgaHWFreeHWRec",
-        "vgaHWGetIOBase",
-        "vgaHWSave",
-        "vgaHWProtect",
-        "vgaHWRestore",
-        "vgaHWMapMem",
-        "vgaHWUnmapMem",
-        "vgaHWSaveScreen",
-        "vgaHWLock",
-	"vgaHWInit",
-	"vgaHWDPMSSet",
-        NULL
-};
-
-static const char *vbeSymbols[] = {
-    	"VBEInit",
-    	"vbeDoEDID",
-    	"vbeFree",
-    	NULL
-};
-
-static const char *shadowSymbols[] = {
-	"ShadowFBInit",
-	NULL
-};
-
-
-static const char *int10Symbols[] = {
-    	"xf86ExecX86int10",
-    	"xf86FreeInt10",
-    	"xf86InitInt10",
-    	"xf86Int10AllocPages",
-    	"xf86Int10FreePages",
-    	NULL
-};
-
-static const char *ramdacSymbols[] = {
-	"xf86InitCursor",
-	"xf86CreateCursorInfoRec",
-	"RamDacInit",
-	"RamDacCreateInfoRec",
-	"RamDacDestroyInfoRec",
-	"RamDacHelperCreateInfoRec",
-	"RamDacGetHWIndex",
-	"IBMramdacProbe",
-	"IBMramdac526CalculateMNPCForClock",
-	"IBMramdac526SetBppWeak",
-	NULL
-};
-
-static const char *xaaSymbols[] = {
-	"XAADestroyInfoRec",
-	"XAACreateInfoRec",
-	"XAAInit",
-	NULL
-};
-
 static int s3AccelLinePitches[] = { 640, 800, 1024, 1280, 1600 };
 
 #ifdef XFree86LOADER
@@ -277,12 +212,6 @@ pointer S3Setup (pointer module, pointer opts, int *errmaj, int *errmin)
         if (!setupDone) {  
                 setupDone = TRUE;
                 xf86AddDriver(&S3, module, 0);
-                LoaderRefSymLists(vgaHWSymbols,
-				  vbeSymbols, int10Symbols, ramdacSymbols,
-				  shadowSymbols,
-				  fbSymbols,
-				  xaaSymbols,
-				  NULL);
                 return (pointer) 1;
         } else {
                 if (errmaj)  
@@ -391,8 +320,6 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
         if (!xf86LoadSubModule(pScrn, "vgahw"))
                 return FALSE;
         
-        xf86LoaderReqSymLists(vgaHWSymbols, NULL);  
- 
         if (!vgaHWGetHWRec(pScrn))
                 return FALSE;
         
@@ -502,12 +429,10 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
         }
 
 	if (xf86LoadSubModule(pScrn, "int10")) {
-		xf86LoaderReqSymLists(int10Symbols, NULL);
 		pS3->pInt10 = xf86InitInt10(pEnt->index);
 	}
 
 	if (xf86LoadSubModule(pScrn, "vbe")) {
-		xf86LoaderReqSymLists(vbeSymbols, NULL);
 		pS3->pVBE = VBEInit(pS3->pInt10, pEnt->index);
 	}
 	
@@ -516,7 +441,6 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
 			S3FreeRec(pScrn);
 			return FALSE;
 		}
-		xf86LoaderReqSymLists(shadowSymbols, NULL);
 	}
 
 	if (!xf86SetGamma(pScrn, gzeros))
@@ -678,7 +602,6 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
 
 	if (!xf86LoadSubModule(pScrn, "ramdac"))
 		return FALSE;
-	xf86LoaderReqSymLists(ramdacSymbols, NULL);
 
 	pScrn->rgbBits = 8;	/* set default */
 
@@ -801,11 +724,9 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
         xf86SetDpi(pScrn, 0, 0);
  
         xf86LoadSubModule(pScrn, "fb");
-        xf86LoaderReqSymLists(fbSymbols, NULL);
 
 	if (!xf86LoadSubModule(pScrn, "xaa"))
 		return FALSE;
-	xf86LoaderReqSymLists(xaaSymbols, NULL);
 
 	return TRUE;
 }

commit 061d5f51141323ea2f4e8e597e3d4bd7e3b7cbfa
Author: Evgeny M. Zubok <evgeny.zubok@tochka.ru>
Date:   Mon May 25 14:34:27 2009 +0400

    Trio64V+ now using NewMMIO. Enable Xv for Trio64V+ and Trio64UV+

diff --git a/ChangeLog b/ChangeLog
index 39aada1..a13d5b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2009-05-25  Evgeny M. Zubok <evgeny.zubok@tochka.ru>
+	
+	* src/s3_driver.c:
+	* src/s3_video.c:
+	
+	Enable Xv extension for Trio64V+ (thanks to Egor Ivanov for 
+	testing on real hardware) and Trio64UV+ (Tested only on Trio64V2 by
+	overriding Chipset with "Trio64UV+" but not on real hardware).
+
+	S3 Trio64V+ now using NewMMIO. Trio64V+ chips have the same ChipId
+	as Trio32/64 but only with chip revision greater or eq 0x40. So if 
+	you have problems with NewMMIO, you may override ChipRev in "Device" 
+ 	section of your xorg.conf: "ChipRev" 0x00. Note: disabling the NewMMIO 
+	also disables overlay video (Xv) because it isn't implemented for
+	Old MMIO yet.
+	
 2009-05-04  Evgeny M. Zubok <evgeny.zubok@tochka.ru>
 
 	* src/s3_driver.c:
diff --git a/src/s3.h b/src/s3.h
index 1857b0c..49b8a54 100644
--- a/src/s3.h
+++ b/src/s3.h
@@ -258,9 +258,4 @@ void S3RefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
 			 	 (pS3->Chipset == PCI_CHIP_AURORA64VP) || \
 				 (pS3->Chipset == PCI_CHIP_TRIO64UVP) || \
 				 (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX))
-
-#define HAS_STREAMS_PROCESSOR() ((pS3->Chipset == PCI_CHIP_AURORA64VP) || \
-				 (pS3->Chipset == PCI_CHIP_TRIO64UVP) || \
-				 (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX))
-
 #endif /* _S3_H */
diff --git a/src/s3_driver.c b/src/s3_driver.c
index 88dc25a..7869da7 100644
--- a/src/s3_driver.c
+++ b/src/s3_driver.c
@@ -534,8 +534,8 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
                 pS3->Chipset = pEnt->device->chipID;
                 pScrn->chipset = (char *)xf86TokenToString(S3Chipsets,
                                                            pS3->Chipset);
-                xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n",
-                           pS3->Chipset);
+                xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, 
+			   "ChipID override: 0x%04X\n", pS3->Chipset);
         } else {
   	        pS3->Chipset = PCI_DEV_DEVICE_ID(pS3->PciInfo);
                 pScrn->chipset = (char *)xf86TokenToString(S3Chipsets,
@@ -550,7 +550,8 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
         
         xfree(pEnt);
         
-        xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chipset: \"%s\"\n", pScrn->chipset);
+        xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chipset: \"%s\"\n", 
+		   pScrn->chipset);
         
 #ifndef XSERVER_LIBPCIACCESS
         pS3->PciTag = pciTag(pS3->PciInfo->bus, pS3->PciInfo->device,
@@ -561,6 +562,10 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
 	case PCI_CHIP_964_0:
 	case PCI_CHIP_964_1:
 	case PCI_CHIP_TRIO:
+		if (pS3->ChipRev >= 0x40) { /* S3 Trio64V+ has the New MMIO */
+			pS3->S3NewMMIO = TRUE;
+			break;
+		}
 	case PCI_CHIP_AURORA64VP:		/* ??? */
 		pS3->S3NewMMIO = FALSE;
 		break;
@@ -571,7 +576,13 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
 		break;
 	}
 
-	if (HAS_STREAMS_PROCESSOR() && pS3->S3NewMMIO)
+	/* TODO: Streams Processor and Xv for Old MMIO */
+
+	if (((pS3->Chipset == PCI_CHIP_AURORA64VP) ||
+	     (pS3->Chipset == PCI_CHIP_TRIO64UVP) ||
+	     (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX) ||
+	     ((pS3->Chipset == PCI_CHIP_TRIO) && (pS3->ChipRev >= 0x40)))
+	    && (pS3->S3NewMMIO))
         	pS3->hasStreams = TRUE;
         else
         	pS3->hasStreams = FALSE;
@@ -1308,7 +1319,6 @@ static Bool S3ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
         vgaRegPtr pVga = &hwp->ModeReg;
         int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg;
 	int vgaIOBase = hwp->IOBase;
-	int interlacedived = mode->Flags & V_INTERLACE ? 1 : 0;
 	int r, n, m;
 	unsigned char tmp;
 
@@ -1551,7 +1561,7 @@ static Bool S3ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
 	new->cr60 = n;
 	outb(vgaCRReg, new->cr60);
 
-	if (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX) {
+	if (pS3->hasStreams) {
 		new->cr60 = 255;		
 		outb(vgaCRIndex, 0x60);
 		outb(vgaCRReg, new->cr60);		
@@ -1640,7 +1650,7 @@ static Bool S3ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
 		outb(vgaCRReg, new->cr42);
 	}
 
-	if (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX) {
+	if (pS3->hasStreams) {
 		unsigned char a;
 
 		outb(vgaCRIndex, 0x67);
diff --git a/src/s3_video.c b/src/s3_video.c
index ad68de0..3e88889 100644
--- a/src/s3_video.c
+++ b/src/s3_video.c
@@ -289,9 +289,25 @@ static void S3StopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit)
 	if (exit) {
 		SET_FIFO_CNTL(0x00080000 | FIFO_PS24_SS0);
 
-		if (pPriv->videoStatus & CLIENT_VIDEO_ON)
+		if (pPriv->videoStatus & CLIENT_VIDEO_ON) {
+			WaitVSync();
+			SET_SSTREAM_CNTL(0x03000000);
+			SET_SSTREAM_FBADDR0(0x00000000);
+			SET_SSTREAM_FBADDR1(0x00000000);
+			SET_SSTREAM_STRIDE(0x00000001);
+			SET_SSTREAM_START(0x07ff07ff);
+			SET_SSTREAM_WIND(0x00010001);
+
+			SET_CHROMA_KEY(0x00000000);
+			SET_SSTRETCH(0x00000000);
+			SET_OPAQUE_OVERLAY(0x40000000);
+			SET_K1_VSCALE(0x00000000);
+			SET_K2_VSCALE(0x00000000);
+			SET_DDA_VERT(0x00000000);
 			SET_BLEND_CNTL(0x01000000);
-		
+			WaitVSync();
+		}
+
 		if (pPriv->area) {
 			xf86FreeOffscreenLinear(pPriv->area);
 	        	pPriv->area = NULL;
@@ -353,7 +369,7 @@ static int S3PutImage(ScrnInfoPtr pScrn, short src_x, short src_y,
 	S3PortPrivPtr pPriv = pS3->portPrivate;
    	INT32 x1, x2, y1, y2;
    	CARD8 *dst_start; 
-   	int pitch, new_h, offset, offsetV = 0, offsetU = 0;
+   	int offset, offsetV = 0, offsetU = 0;
    	int srcPitch, srcPitchUV = 0, dstPitch, dstSize;
    	int top, bottom, right, left, npixels, nlines;
    	BoxRec dstBox;

commit a1d6d9bec68c3bf47af69b73c875836bc46db3a1
Author: Evgeny M. Zubok <evgeny.zubok@tochka.ru>
Date:   Mon May 4 15:10:17 2009 +0400

    shadowFB option. Interlace mode support. Close bug #14999.

diff --git a/ChangeLog b/ChangeLog
index fab4ec7..39aada1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2009-05-04  Evgeny M. Zubok <evgeny.zubok@tochka.ru>
+
+	* src/s3_driver.c:
+	* src/s3_shadow.c:
+
+	Add shadowFB option. It can be used to speedup drawing when
+	hardware acceleration is unwanted or unavailable (for colour depth
+	24 with 24 bpp framebuffer, for example). shadowFB is disabled by
+	default. Enabling shadowFB option disables HW acceleration. Thanks
+	to Egor Ivanov for initial porting of shadowFB from s3virge.
+
+	Interlace mode support.
+
+	Close bug #14999.
+	
 2008-07-06  Evgeny M. Zubok <evgeny.zubok@tochka.ru>
 
 	* src/s3_video.c: 
@@ -14,7 +29,7 @@
 	not implemented yet for all chipsets).
 
 	Close bug #5527: 24-bit colour depth support (24bpp and 
-	32bpp framebuffer) for TRIO64V2. Acceleration doesn't work
+	32bpp framebuffer) for TRIOs. Acceleration doesn't work
 	with packed colour mode (24 bpp FB) but works with 32bpp 
 	framebuffer mode (hardware limitation? -- need data).
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 743babd..84f926c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -39,7 +39,8 @@ s3_drv_la_SOURCES = \
 	 s3_pcirename.h \
          s3_reg.h \
          s3_Ti.c \
-         s3_Trio64DAC.c
+         s3_Trio64DAC.c \
+	 s3_shadow.c
 
 noinst_LTLIBRARIES = libs3_accel_newmmio.la libs3_accel_pio.la
 s3_drv_la_LIBADD = libs3_accel_newmmio.la libs3_accel_pio.la
diff --git a/src/s3.h b/src/s3.h
index a12ff6e..1857b0c 100644
--- a/src/s3.h
+++ b/src/s3.h
@@ -163,6 +163,13 @@ typedef struct _S3Rec {
 	int			imageWidth;
 	int			imageHeight;
 	Bool			hwCursor;
+    
+	Bool                    shadowFB;
+	int                     rotate;
+	unsigned char           * ShadowPtr;
+	int                     ShadowPitch;
+	void	                (*PointerMoved)(int index, int x, int y);
+    
 } S3Rec, *S3Ptr;
 
 #define S3PTR(p)		((S3Ptr)((p)->driverPrivate))
@@ -224,6 +231,15 @@ void S3OutTiIndReg(ScrnInfoPtr pScrn, CARD32 reg, unsigned char mask,
 /* s3 gen cursor */
 Bool S3_CursorInit(ScreenPtr pScreen);
 
+/* in s3_shadow.c */
+void S3PointerMoved(int index, int x, int y);
+void S3RefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+void S3RefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+void S3RefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+void S3RefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+void S3RefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+
+
 #define TRIO64_RAMDAC	0x8811
 #define	TI3025_RAMDAC	0x3025
 #define	TI3020_RAMDAC	0x3020
diff --git a/src/s3_driver.c b/src/s3_driver.c
index 29e7fb5..88dc25a 100644
--- a/src/s3_driver.c
+++ b/src/s3_driver.c
@@ -54,7 +54,7 @@
 #include "mibstore.h"
 #include "fb.h"
 #include "inputstr.h"
-
+#include "shadowfb.h"
 #include "IBM.h"
 #include "TI.h"
 
@@ -157,7 +157,9 @@ typedef enum {
 	OPTION_SLOW_DRAM,
 	OPTION_SLOW_EDODRAM,
 	OPTION_SLOW_VRAM,
-	OPTION_XVIDEO
+	OPTION_XVIDEO,
+	OPTION_SHADOW_FB,
+	OPTION_ROTATE
 } S3Opts;
 
 static OptionInfoRec S3Options[] = {
@@ -168,6 +170,8 @@ static OptionInfoRec S3Options[] = {
 	{ OPTION_SLOW_EDODRAM, "slow_edodram", OPTV_BOOLEAN, {0}, FALSE },
 	{ OPTION_SLOW_VRAM, "slow_vram", OPTV_BOOLEAN, {0}, FALSE },
 	{ OPTION_XVIDEO, "XVideo", OPTV_BOOLEAN, {0}, FALSE },
+	{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
+	{ OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE },
 	{ -1, NULL, OPTV_NONE, {0}, FALSE }
 };
 
@@ -208,6 +212,12 @@ static const char *vbeSymbols[] = {
     	NULL
 };
 
+static const char *shadowSymbols[] = {
+	"ShadowFBInit",
+	NULL
+};
+
+
 static const char *int10Symbols[] = {
     	"xf86ExecX86int10",
     	"xf86FreeInt10",
@@ -269,6 +279,7 @@ pointer S3Setup (pointer module, pointer opts, int *errmaj, int *errmin)
                 xf86AddDriver(&S3, module, 0);
                 LoaderRefSymLists(vgaHWSymbols,
 				  vbeSymbols, int10Symbols, ramdacSymbols,
+				  shadowSymbols,
 				  fbSymbols,
 				  xaaSymbols,
 				  NULL);
@@ -372,6 +383,7 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
 	Gamma gzeros = {0.0, 0.0, 0.0};
 	int i, vgaCRIndex, vgaCRReg;
 	unsigned char tmp;
+	char *s;
 
         if (flags & PROBE_DETECT)
                 return FALSE;
@@ -435,6 +447,48 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
 	pS3->SlowDRAM = xf86ReturnOptValBool(S3Options, OPTION_SLOW_DRAM, FALSE);
 	pS3->SlowEDODRAM = xf86ReturnOptValBool(S3Options, OPTION_SLOW_EDODRAM, FALSE);
 	pS3->SlowVRAM = xf86ReturnOptValBool(S3Options, OPTION_SLOW_VRAM, FALSE);
+
+
+    
+	if (xf86GetOptValBool(S3Options, OPTION_SHADOW_FB, &pS3->shadowFB))
+		xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n",
+			   pS3->shadowFB ? "enabled" : "disabled");
+    
+	pS3->rotate = 0;
+	if ((s = xf86GetOptValString(S3Options, OPTION_ROTATE))) {
+		if(!xf86NameCmp(s, "CW")) {
+			/* accel is disabled below for shadowFB */
+			pS3->shadowFB = TRUE;
+			pS3->rotate = 1;
+			xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, 
+				   "Rotating screen clockwise - acceleration disabled\n");
+		} else if(!xf86NameCmp(s, "CCW")) {
+			pS3->shadowFB = TRUE;
+			pS3->rotate = -1;
+			xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,  "Rotating screen"
+				   "counter clockwise - acceleration disabled\n");
+		} else {
+			xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid"
+				   "value for Option \"Rotate\"\n", s);
+			xf86DrvMsg(pScrn->scrnIndex, X_INFO, 
+				   "Valid options are \"CW\" or \"CCW\"\n");
+		}
+	}
+	
+	if(pS3->shadowFB && !pS3->NoAccel) {
+		pS3->NoAccel = TRUE;
+		xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+			   "HW acceleration not supported with \"shadowFB\".\n");
+	}
+    
+	
+	if (pS3->rotate && pS3->HWCursor) {
+		xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+			   "HW cursor not supported with \"rotate\".\n");
+		pS3->HWCursor = FALSE;
+	}
+    
+        
         if (pScrn->numEntities > 1) {      
                 S3FreeRec(pScrn);
                 return FALSE;


Reply to: