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

Bug#593861: future unblock: xserver-xorg-video-openchrome/0.2.904+svn842-1



On Sun, Aug 22, 2010 at 16:09:11 +0100, Adam D. Barratt wrote:

> On Sat, 2010-08-21 at 19:04 +0200, Julien Viard de Galbert wrote:
> > Please unblock package xserver-xorg-video-openchrome
> > 
> > I'm in the process of adopting the package, and was planning to upload
> > to experimental only, but the previous maintainer Raphael Geissert 
> > suggested (see [1]) that I upload first the version he prepared which 
> > include some bug fix from upstream, and get a freeze exception for it.
> > 
> >  1: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=583501#22
> 
> What does the diff between your package and 1:0.2.904+svn827-1, which is
> the current version in unstable, look like?
> 
diffstat and debdiff follow.  Most of the changes had been sitting in
git since May, but not uploaded due to Raphael not having access to the
hw anymore.  I'm quite happy Julien volunteered to maintain this
package.

Cheers,
Julien

 ChangeLog                          |   33 +++++
 debian/README.source               |    2 
 debian/changelog                   |   31 ++++
 debian/control                     |   28 +++-
 debian/copyright                   |    3 
 debian/gbp.conf                    |    5 
 debian/patches/01_gen_pci_ids.diff |   18 --
 debian/patches/manpage_typo.patch  |   22 ---
 debian/patches/series              |    2 
 debian/rules                       |    2 
 debian/watch                       |    2 
 debian/xsfbs/xsfbs.mk              |   35 +++--
 src/openchrome.man                 |    5 
 src/via_accel.c                    |   34 +++--
 src/via_crtc.c                     |   11 +
 src/via_cursor.c                   |   56 ++++++--
 src/via_dri.c                      |    5 
 src/via_driver.c                   |   87 +++++++++----
 src/via_driver.h                   |    3 
 src/via_id.c                       |    2 
 src/via_mode.h                     |   88 ++++++-------
 src/via_panel.c                    |   20 +--
 src/via_video.c                    |  240 ++++++++++++-------------------------
 src/via_video.h                    |    6 
 24 files changed, 414 insertions(+), 326 deletions(-)


diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/ChangeLog xserver-xorg-video-openchrome-0.2.904+svn842/ChangeLog
--- xserver-xorg-video-openchrome-0.2.904+svn827/ChangeLog	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/ChangeLog	2010-04-22 07:32:27.000000000 +0200
@@ -1,3 +1,36 @@
+2010-04-21  Bartosz Kosiorek  <gang65@poczta.onet.pl>
+
+	Replace RegionsEqual with REGION_EQUAL and use 
+        the xf86XVFillKeyHelperDrawable instead of xf86XVFillKeyHelper
+
+	* src/via_video.c: (viaReputImage), (viaPutImage):
+
+2010-03-07  Bartosz Kosiorek  <gang65@poczta.onet.pl>
+
+	Fix segfaults with EXA and XV (Ticket #359)
+        Tested on K8M890 and VN800
+
+	* src/via_video.c: (viaReputImage), (viaPutImage):
+
+2010-02-10  Bartosz Kosiorek  <gang65@poczta.onet.pl>
+
+	Fix bug with suspend and VT switch on VX800 and 64bit systems
+
+	* src/via_driver.h:
+	* src/via_video.c: (viaResetVideo), (viaSaveVideo),
+	(viaRestoreVideo), (viaExitVideo):
+	* src/via_video.h:
+
+2010-01-24  Bartosz Kosiorek  <gang65@poczta.onet.pl>
+
+	Fix starting address restore and save (initial 64-bit support)
+
+	* src/via_crtc.c: (ViaFirstCRTCSetMode),
+	(ViaFirstCRTCSetStartingAddress):
+	* src/via_dri.c: (VIADRIAgpInit):
+	* src/via_driver.c: (VIASave), (VIARestore):
+	* src/via_driver.h:
+
 2009-12-04  Bartosz Kosiorek  <gang65@poczta.onet.pl>
 
 	Enable new mode switch for VM800 chipsets
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/debian/README.source xserver-xorg-video-openchrome-0.2.904+svn842/debian/README.source
--- xserver-xorg-video-openchrome-0.2.904+svn827/debian/README.source	2010-09-04 22:40:10.000000000 +0200
+++ xserver-xorg-video-openchrome-0.2.904+svn842/debian/README.source	2010-09-04 22:40:11.000000000 +0200
@@ -25,7 +25,7 @@
 Otherwise, the upstream sources are manually installed in the Debian
 git repository.
 
-The .orig.tar.gz upstream source file could be generated this
+The .orig.tar.gz upstream source file could be generated using this
 "upstream-*" branch in the Debian git repository but it is actually
 copied from upstream tarballs directly.
 
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/debian/changelog xserver-xorg-video-openchrome-0.2.904+svn842/debian/changelog
--- xserver-xorg-video-openchrome-0.2.904+svn827/debian/changelog	2010-09-04 22:40:10.000000000 +0200
+++ xserver-xorg-video-openchrome-0.2.904+svn842/debian/changelog	2010-09-04 22:40:11.000000000 +0200
@@ -1,3 +1,34 @@
+xserver-xorg-video-openchrome (1:0.2.904+svn842-1) unstable; urgency=low
+
+  * New upstream snapshot
+    + 829: FIC PTM800Pro LF
+    + 837: MSI K8M890M2-V
+    + 838: Fix bug with suspend and VT switch on VX800 chipset on 64bit sys
+    + 840: Fix segfaults with EXA and XV
+
+  [ Timo Aaltonen ]
+  * Build against Xserver 1.7.
+  * Remove 01_gen_pci_ids.diff. The X server now uses an internal table to
+    choose a driver during autoconfiguration.
+
+  [ Julien Cristau ]
+  * Rename the build directory to not include DEB_BUILD_GNU_TYPE for no
+    good reason.  Thanks, Colin Watson!
+
+  [ Raphael Geissert ]
+  * Manpage typos patch merged upstream
+  * Fix watch file not to accept 'latest' as upstream version
+
+  [ Christopher James Halse Rogers ]
+  * Update xsfbs to fix build against xserver-xorg >= 1.7.6.901-1 and use new 
+    substvars in debian/control.
+
+  [ Julien Viard de Galbert ]
+  * New maintainer (Closes: #583501)
+  * Update standards version, no changes required
+
+ -- Julien Cristau <jcristau@debian.org>  Sat, 04 Sep 2010 22:36:13 +0200
+
 xserver-xorg-video-openchrome (1:0.2.904+svn827-1) unstable; urgency=low
 
   * New upstream snapshot
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/debian/control xserver-xorg-video-openchrome-0.2.904+svn842/debian/control
--- xserver-xorg-video-openchrome-0.2.904+svn827/debian/control	2010-09-04 22:40:10.000000000 +0200
+++ xserver-xorg-video-openchrome-0.2.904+svn842/debian/control	2010-09-04 22:40:11.000000000 +0200
@@ -2,17 +2,37 @@
 Section: x11
 Priority: optional
 Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
-Uploaders: Raphael Geissert <geissert@debian.org>
-Build-Depends: debhelper (>= 5), autotools-dev, autoconf, automake, libtool, pkg-config, xserver-xorg-dev (>= 2:1.3.0.0), x11proto-core-dev, x11proto-fonts-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-xext-dev, x11proto-xf86dri-dev, x11proto-video-dev, x11proto-gl-dev, libdrm-dev (>> 2.0), libx11-dev, libgl1-mesa-dev | libgl1-dev, libxvmc-dev, quilt
+Uploaders: Julien Viard de Galbert <julien@vdg.blogsite.org>
+Build-Depends:
+ debhelper (>= 5),
+ autotools-dev,
+ autoconf,
+ automake,
+ libtool,
+ pkg-config,
+ xserver-xorg-dev (>= 2:1.7.6.901),
+ x11proto-core-dev,
+ x11proto-fonts-dev,
+ x11proto-randr-dev,
+ x11proto-render-dev,
+ x11proto-xext-dev,
+ x11proto-xf86dri-dev,
+ x11proto-video-dev,
+ x11proto-gl-dev,
+ libdrm-dev (>> 2.0),
+ libx11-dev,
+ libgl1-mesa-dev | libgl1-dev,
+ libxvmc-dev,
+ quilt
 Build-Conflicts: autoconf2.13
-Standards-Version: 3.8.3
+Standards-Version: 3.9.1
 Homepage: http://www.openchrome.org
 Vcs-Git: git://git.debian.org/git/pkg-xorg/driver/xserver-xorg-video-openchrome
 Vcs-Browser: http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-openchrome.git
 
 Package: xserver-xorg-video-openchrome
 Architecture: i386 amd64 hurd-i386 kfreebsd-i386 kfreebsd-amd64 lpia
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${xserver:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${xviddriver:Depends}
 Provides: ${xviddriver:Provides}
 Conflicts: libchromexvmc1, libchromexvmcpro1
 Replaces: libchromexvmc1, libchromexvmcpro1
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/debian/copyright xserver-xorg-video-openchrome-0.2.904+svn842/debian/copyright
--- xserver-xorg-video-openchrome-0.2.904+svn827/debian/copyright	2010-09-04 22:40:10.000000000 +0200
+++ xserver-xorg-video-openchrome-0.2.904+svn842/debian/copyright	2010-09-04 22:40:11.000000000 +0200
@@ -58,7 +58,8 @@
 On Debian systems, a complete copy of the GPL can be found under
 /usr/share/common-licenses/GPL-3
 
-The Debian packaging is Copyright 2007-2008 by Raphael Geissert <atomo64@gmail.com>
+The Debian packaging is Copyright 2010- by Julien Viard de Galbert <julien@vdg.blogsite.org>
+based on Copyright 2007-2008 by Raphael Geissert <atomo64@gmail.com>
 based on the work © 2007 by Mario Limonciello <superm1@ubuntu.com> which was
 based upon the work by Eric Work <work.eric@gmail.com> and is licensed 
 under the GPL.
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/debian/gbp.conf xserver-xorg-video-openchrome-0.2.904+svn842/debian/gbp.conf
--- xserver-xorg-video-openchrome-0.2.904+svn827/debian/gbp.conf	1970-01-01 01:00:00.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/debian/gbp.conf	2010-09-04 22:40:11.000000000 +0200
@@ -0,0 +1,5 @@
+[DEFAULT]
+# the default branch for upstream sources
+upstream-branch=upstream-unstable
+# the default branch for the debian patch
+debian-branch=debian-unstable
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/debian/patches/01_gen_pci_ids.diff xserver-xorg-video-openchrome-0.2.904+svn842/debian/patches/01_gen_pci_ids.diff
--- xserver-xorg-video-openchrome-0.2.904+svn827/debian/patches/01_gen_pci_ids.diff	2010-09-04 22:40:10.000000000 +0200
+++ xserver-xorg-video-openchrome-0.2.904+svn842/debian/patches/01_gen_pci_ids.diff	1970-01-01 01:00:00.000000000 +0100
@@ -1,18 +0,0 @@
-Generate a list of known PCIs for xorg to auto-detect them and use openchrome for those
-Index: xserver-xorg-video-openchrome/src/Makefile.am
-===================================================================
---- xserver-xorg-video-openchrome.orig/src/Makefile.am
-+++ xserver-xorg-video-openchrome/src/Makefile.am
-@@ -92,6 +92,12 @@ EXTRA_DIST += \
- endif
- 
- 
-+pcidatadir = $(datadir)/xserver-xorg/pci
-+pcidata_DATA = openchrome.ids
-+
-+openchrome.ids : via_id.h
-+	awk '/^#define.*PCI_CHIP/ {print $$3}' ${srcdir}/via_id.h | sed -e 's/0x/1106/' > openchrome.ids
-+
- via_driver.lo: svnversion.h
- svnversion.h: $(openchrome_drv_la_SOURCES)
- 	@if [ -d .svn ]; then \
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/debian/patches/manpage_typo.patch xserver-xorg-video-openchrome-0.2.904+svn842/debian/patches/manpage_typo.patch
--- xserver-xorg-video-openchrome-0.2.904+svn827/debian/patches/manpage_typo.patch	2010-09-04 22:40:10.000000000 +0200
+++ xserver-xorg-video-openchrome-0.2.904+svn842/debian/patches/manpage_typo.patch	1970-01-01 01:00:00.000000000 +0100
@@ -1,22 +0,0 @@
-Index: xserver-xorg-video-openchrome/src/openchrome.man
-===================================================================
---- xserver-xorg-video-openchrome.orig/src/openchrome.man
-+++ xserver-xorg-video-openchrome/src/openchrome.man
-@@ -58,7 +58,7 @@ are supported:
- .BI "Option \*qAccelMethod\*q  \*q" string \*q
- The driver supports "XAA" and "EXA" acceleration methods.  The default
- method is XAA, since EXA is still experimental.  Contrary to XAA, EXA
--implements acceleration for screen uploads and downlads (if DRI is
-+implements acceleration for screen uploads and downloads (if DRI is
- enabled) and for the Render/Composite extension.
- .TP
- .BI "Option \*qActiveDevice\*q  \*q" string \*q
-@@ -80,7 +80,7 @@ EXA scratch area in AGP space, it will b
- no room for DRI textures, they will be allocated from the DRI part of
- VRAM (see the option "MaxDRIMem").  The default amount of AGP is
- 32768 kB.  Note that the AGP aperture set in the BIOS must be able
--to accomodate the amount of AGP memory specified here.  Otherwise no
-+to accommodate the amount of AGP memory specified here.  Otherwise no
- AGP memory will be available.  It is safe to set a very large AGP
- aperture in the BIOS.
- .TP
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/debian/patches/series xserver-xorg-video-openchrome-0.2.904+svn842/debian/patches/series
--- xserver-xorg-video-openchrome-0.2.904+svn827/debian/patches/series	2010-09-04 22:40:10.000000000 +0200
+++ xserver-xorg-video-openchrome-0.2.904+svn842/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
@@ -1,2 +0,0 @@
-01_gen_pci_ids.diff
-manpage_typo.patch
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/debian/rules xserver-xorg-video-openchrome-0.2.904+svn842/debian/rules
--- xserver-xorg-video-openchrome-0.2.904+svn827/debian/rules	2010-09-04 22:40:10.000000000 +0200
+++ xserver-xorg-video-openchrome-0.2.904+svn842/debian/rules	2010-09-04 22:40:11.000000000 +0200
@@ -4,7 +4,7 @@
 
 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILDDIR = obj-$(DEB_BUILD_GNU_TYPE)
+DEB_BUILDDIR = build
 
 export DH_ALWAYS_EXCLUDE=.la
 
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/debian/watch xserver-xorg-video-openchrome-0.2.904+svn842/debian/watch
--- xserver-xorg-video-openchrome-0.2.904+svn827/debian/watch	2010-09-04 22:40:10.000000000 +0200
+++ xserver-xorg-video-openchrome-0.2.904+svn842/debian/watch	2010-09-04 22:40:11.000000000 +0200
@@ -1,3 +1,3 @@
 version=3
 
-http://www.openchrome.org/releases/xf86-video-openchrome-(.*)\.tar\.gz
+http://www.openchrome.org/releases/xf86-video-openchrome-(\d.*)\.tar\.gz
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/debian/xsfbs/xsfbs.mk xserver-xorg-video-openchrome-0.2.904+svn842/debian/xsfbs/xsfbs.mk
--- xserver-xorg-video-openchrome-0.2.904+svn827/debian/xsfbs/xsfbs.mk	2010-09-04 22:40:10.000000000 +0200
+++ xserver-xorg-video-openchrome-0.2.904+svn842/debian/xsfbs/xsfbs.mk	2010-09-04 22:40:11.000000000 +0200
@@ -110,14 +110,15 @@
 .PHONY: prepare
 stampdir_targets+=prepare
 prepare: $(STAMP_DIR)/prepare
-$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts
+$(STAMP_DIR)/prepare: $(STAMP_DIR)/logdir $(STAMP_DIR)/genscripts
 	>$@
 
-.PHONY: log
-stampdir_targets+=log
-log: $(STAMP_DIR)/log
-$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir
+.PHONY: logdir
+stampdir_targets+=logdir
+logdir: $(STAMP_DIR)/logdir
+$(STAMP_DIR)/logdir: $(STAMP_DIR)/stampdir
 	mkdir -p $(STAMP_DIR)/log
+	>$@
 
 # Apply all patches to the upstream source.
 .PHONY: patch
@@ -145,7 +146,7 @@
 
 # Revert all patches to the upstream source.
 .PHONY: unpatch
-unpatch: $(STAMP_DIR)/log
+unpatch: $(STAMP_DIR)/logdir
 	rm -f $(STAMP_DIR)/patch
 	@echo -n "Unapplying patches..."; \
 	if $(QUILT) applied >/dev/null 2>/dev/null; then \
@@ -252,25 +253,33 @@
 	#                                    debian/*.prerm
 	>$@
 
-SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null)
+# Compute dependencies for drivers
+#
+VIDEODEP = $(shell cat /usr/share/xserver-xorg/videodrvdep 2>/dev/null)
+INPUTDEP = $(shell cat /usr/share/xserver-xorg/xinputdep 2>/dev/null)
+
+# these two can be removed post-squeeze
 VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
 INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null)
-SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS))
-VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI)
-INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI)
+VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI), xorg-driver-video
+INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI), xorg-driver-input
+
 ifeq ($(PACKAGE),)
 PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control)
 endif
 
 .PHONY: serverabi
 serverabi: install
-ifeq ($(SERVERMINVERS),)
-	@echo error: xserver-xorg-dev needs to be installed
+ifeq ($(VIDEODEP),)
+	@echo 'error: xserver-xorg-dev >= 1.7.6.901 needs to be installed'
 	@exit 1
 else
-	echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars
+	echo "xviddriver:Depends=$(VIDEODEP)" >> debian/$(PACKAGE).substvars
+	echo "xinpdriver:Depends=$(INPUTDEP)" >> debian/$(PACKAGE).substvars
+	# the following is there for compatibility...
 	echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
 	echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+	echo "xserver:Depends=$(VIDEODEP), $(INPUTDEP)" >> debian/$(PACKAGE).substvars
 endif
 
 # vim:set noet ai sts=8 sw=8 tw=0:
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/openchrome.man xserver-xorg-video-openchrome-0.2.904+svn842/src/openchrome.man
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/openchrome.man	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/openchrome.man	2010-04-22 07:32:27.000000000 +0200
@@ -1,3 +1,4 @@
+.\" Shorthand for double quote that works everywhere,
 .\" also within other double quotes:
 .ds q \N'34'
 .TH OPENCHROME __drivermansuffix__ __vendorversion__
@@ -58,7 +59,7 @@
 .BI "Option \*qAccelMethod\*q  \*q" string \*q
 The driver supports "XAA" and "EXA" acceleration methods.  The default
 method is XAA, since EXA is still experimental.  Contrary to XAA, EXA
-implements acceleration for screen uploads and downlads (if DRI is
+implements acceleration for screen uploads and downloads (if DRI is
 enabled) and for the Render/Composite extension.
 .TP
 .BI "Option \*qActiveDevice\*q  \*q" string \*q
@@ -80,7 +81,7 @@
 no room for DRI textures, they will be allocated from the DRI part of
 VRAM (see the option "MaxDRIMem").  The default amount of AGP is
 32768 kB.  Note that the AGP aperture set in the BIOS must be able
-to accomodate the amount of AGP memory specified here.  Otherwise no
+to accommodate the amount of AGP memory specified here.  Otherwise no
 AGP memory will be available.  It is safe to set a very large AGP
 aperture in the BIOS.
 .TP
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/via_accel.c xserver-xorg-video-openchrome-0.2.904+svn842/src/via_accel.c
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/via_accel.c	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/via_accel.c	2010-04-22 07:32:27.000000000 +0200
@@ -1210,7 +1210,8 @@
 
     /* General acceleration flags. */
     xaaptr->Flags = (PIXMAP_CACHE |
-                     OFFSCREEN_PIXMAPS | LINEAR_FRAMEBUFFER |
+                     OFFSCREEN_PIXMAPS | 
+                     LINEAR_FRAMEBUFFER |
                      MICROSOFT_ZERO_LINE_BIAS | 0);
 
     if (pScrn->bitsPerPixel == 8)
@@ -1228,14 +1229,17 @@
 
     xaaptr->Sync = viaAccelSync;
 
+    /* ScreenToScreen copies */
     xaaptr->SetupForScreenToScreenCopy = viaSetupForScreenToScreenCopy;
     xaaptr->SubsequentScreenToScreenCopy = viaSubsequentScreenToScreenCopy;
     xaaptr->ScreenToScreenCopyFlags = NO_PLANEMASK | ROP_NEEDS_SOURCE;
 
+    /* Solid filled rectangles */
     xaaptr->SetupForSolidFill = viaSetupForSolidFill;
     xaaptr->SubsequentSolidFillRect = viaSubsequentSolidFillRect;
     xaaptr->SolidFillFlags = NO_PLANEMASK | ROP_NEEDS_SOURCE;
 
+    /* Mono 8x8 pattern fills */
     xaaptr->SetupForMono8x8PatternFill = viaSetupForMono8x8PatternFill;
     xaaptr->SubsequentMono8x8PatternFillRect =
             viaSubsequentMono8x8PatternFillRect;
@@ -1244,6 +1248,7 @@
                                        HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
                                        BIT_ORDER_IN_BYTE_MSBFIRST | 0);
 
+    /* Color 8x8 pattern fills */
     xaaptr->SetupForColor8x8PatternFill = viaSetupForColor8x8PatternFill;
     xaaptr->SubsequentColor8x8PatternFillRect =
             viaSubsequentColor8x8PatternFillRect;
@@ -1252,12 +1257,14 @@
                                         HARDWARE_PATTERN_PROGRAMMED_BITS |
                                         HARDWARE_PATTERN_PROGRAMMED_ORIGIN | 0);
 
+    /* Solid lines */
     xaaptr->SetupForSolidLine = viaSetupForSolidLine;
     xaaptr->SubsequentSolidTwoPointLine = viaSubsequentSolidTwoPointLine;
     xaaptr->SubsequentSolidHorVertLine = viaSubsequentSolidHorVertLine;
     xaaptr->SolidBresenhamLineErrorTermBits = 14;
     xaaptr->SolidLineFlags = NO_PLANEMASK | ROP_NEEDS_SOURCE;
 
+    /* Dashed line */
     xaaptr->SetupForDashedLine = viaSetupForDashedLine;
     xaaptr->SubsequentDashedTwoPointLine = viaSubsequentDashedTwoPointLine;
     xaaptr->DashPatternMaxLength = 8;
@@ -1266,35 +1273,42 @@
                                LINE_PATTERN_POWER_OF_2_ONLY |
                                LINE_PATTERN_MSBFIRST_LSBJUSTIFIED | 0);
 
+    /* CPU to Screen color expansion */
     xaaptr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK |
-            CPU_TRANSFER_PAD_DWORD |
-            SCANLINE_PAD_DWORD |
-            BIT_ORDER_IN_BYTE_MSBFIRST |
-            LEFT_EDGE_CLIPPING | ROP_NEEDS_SOURCE | 0;
+           				 	CPU_TRANSFER_PAD_DWORD |
+						SCANLINE_PAD_DWORD |
+            					BIT_ORDER_IN_BYTE_MSBFIRST |
+            					LEFT_EDGE_CLIPPING | 
+            					ROP_NEEDS_SOURCE | 0;
 
     xaaptr->SetupForScanlineCPUToScreenColorExpandFill =
             viaSetupForCPUToScreenColorExpandFill;
     xaaptr->SubsequentScanlineCPUToScreenColorExpandFill =
             viaSubsequentScanlineCPUToScreenColorExpandFill;
     xaaptr->ColorExpandBase = pVia->BltBase;
-    xaaptr->ColorExpandRange = VIA_MMIO_BLTSIZE;
+    if (pVia->Chipset == VIA_VX800 || pVia->Chipset == VIA_VX855)
+        xaaptr->ColorExpandRange = VIA_MMIO_BLTSIZE;
+    else
+        xaaptr->ColorExpandRange = (64 * 1024);
 
+    /* ImageWrite */
     xaaptr->ImageWriteFlags = (NO_PLANEMASK |
                                CPU_TRANSFER_PAD_DWORD |
                                SCANLINE_PAD_DWORD |
                                BIT_ORDER_IN_BYTE_MSBFIRST |
-                               LEFT_EDGE_CLIPPING | ROP_NEEDS_SOURCE | 0);
+                               LEFT_EDGE_CLIPPING | 
+			       ROP_NEEDS_SOURCE | 0);
                                // SYNC_AFTER_IMAGE_WRITE | 0);
 
     /*
      * Most Unichromes are much faster using processor-to-framebuffer writes
      * than when using the 2D engine for this.
-     * test with x11perf -shmput500!
+     * test with "x11perf -shmput500"
+     * Example: K8M890 chipset; with GPU=86.3/sec; without GPU=132.0/sec
+     * TODO Check speed for other chipsets
      */
 
     switch (pVia->Chipset) {
-        case VIA_K8M800:
-        case VIA_K8M890:
         case VIA_P4M900:
         case VIA_VX800:
         case VIA_VX855:
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/via_crtc.c xserver-xorg-video-openchrome-0.2.904+svn842/src/via_crtc.c
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/via_crtc.c	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/via_crtc.c	2010-04-22 07:32:27.000000000 +0200
@@ -234,8 +234,8 @@
     /* Primary starting address -> 0x00, adjustframe does the rest */
     hwp->writeCrtc(hwp, 0x0C, 0x00);
     hwp->writeCrtc(hwp, 0x0D, 0x00);
-    hwp->writeCrtc(hwp, 0x34, 0x00);
     ViaCrtcMask(hwp, 0x48, 0x00, 0x03); /* is this even possible on CLE266A ? */
+    hwp->writeCrtc(hwp, 0x34, 0x00);
 
     /* vertical sync start : 2047 */
     temp = mode->CrtcVSyncStart;
@@ -331,15 +331,20 @@
     CARD32 Base;
     CARD32 tmp;
 
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaFirstCRTCSetStartingAddress\n"));
+
     Base = (y * pScrn->displayWidth + x) * (pScrn->bitsPerPixel / 8);
     Base = Base >> 1;
 
     hwp->writeCrtc(hwp, 0x0C, (Base & 0xFF00) >> 8);
     hwp->writeCrtc(hwp, 0x0D, Base & 0xFF);
-    hwp->writeCrtc(hwp, 0x34, (Base & 0xFF0000) >> 16);
-
+    /* FIXME The proper starting address for CR48 is 0x1F - Bits[28:24] */
     if (!(pVia->Chipset == VIA_CLE266 && CLE266_REV_IS_AX(pVia->ChipRev)))
         ViaCrtcMask(hwp, 0x48, Base >> 24, 0x0F);
+    /* CR34 are fire bits. Must be writed after CR0C CR0D CR48.  */
+    hwp->writeCrtc(hwp, 0x34, (Base & 0xFF0000) >> 16);
+
+
 }
 
 void
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/via_cursor.c xserver-xorg-video-openchrome-0.2.904+svn842/src/via_cursor.c
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/via_cursor.c	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/via_cursor.c	2010-04-22 07:32:27.000000000 +0200
@@ -145,9 +145,12 @@
     infoPtr->ShowCursor = viaShowCursor;
     infoPtr->UseHWCursor = viaUseHWCursor;
 
+    /* ARGB Cursor init */
     infoPtr->UseHWCursorARGB = viaUseHWCursorARGB;
-	if (pVia->CursorARGBSupported)
+    if (pVia->CursorARGBSupported) {
+        DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "HWCursor ARGB enabled\n"));
     	infoPtr->LoadCursorARGB = viaLoadCursorARGB;
+    }
 
     /* Set cursor location in frame buffer. */
     VIASETREG(VIA_REG_CURSOR_MODE, pVia->cursorOffset);
@@ -284,7 +287,7 @@
 }
 
 /*
- * ARGB Cursor
+ * display the current cursor
  */
 
 void
@@ -319,13 +322,19 @@
             */
 
             /* Duoview */
-	    if (pVia->CursorPipe)
+	    if (pVia->CursorPipe) {
+                /* Mono Cursor Display Path [bit31]: Secondary */
+                /* FIXME For CLE266 nad KM400 try to enable 32x32 cursor size [bit1] */
                 VIASETREG(VIA_REG_ALPHA_CONTROL, 0xF6000005);
-            else
+            } else {
+                /* Mono Cursor Display Path [bit31]: Primary */
                 VIASETREG(VIA_REG_ALPHA_CONTROL, 0x76000005);
+            }
     }
 }
 
+
+/* hide the current cursor */
 void
 viaHideCursor(ScrnInfoPtr pScrn)
 {
@@ -350,10 +359,16 @@
         
         default:
              temp = VIAGETREG(VIA_REG_ALPHA_CONTROL);
+             /* Hardware cursor disable [bit0] */
              VIASETREG(VIA_REG_ALPHA_CONTROL, temp & 0xFFFFFFFA);
     }
 }
 
+/*
+    Set the cursor position to (x,y).  X and/or y may be negative
+    indicating that the cursor image is partially offscreen on
+    the left and/or top edges of the screen.
+*/
 static void
 viaSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
 {
@@ -409,6 +424,15 @@
             && pCurs->bits->height <= pVia->CursorMaxHeight);
 }
 
+/*
+    If the driver is unable to use a hardware cursor for reasons
+    other than the cursor being larger than the maximum specified
+    in the MaxWidth or MaxHeight field below, it can supply the
+    UseHWCursor function.  If UseHWCursor is provided by the driver,
+    it will be called whenever the cursor shape changes or the video
+    mode changes.  This is useful for when the hardware cursor cannot
+    be used in interlaced or doublescan modes.
+*/
 static Bool
 viaUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
 {
@@ -423,8 +447,11 @@
             && pCurs->bits->height <= pVia->CursorMaxHeight);
 }
 
+/*
+    Load Mono Cursor Image 
+*/
 static void
-viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *s)
+viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
 {
     VIAPtr pVia = VIAPTR(pScrn);
     CARD32 temp;
@@ -439,7 +466,7 @@
     if (pVia->CursorARGBSupported) {
 #define ARGB_PER_CHUNK	(8 * sizeof (chunk) / 2)
 		for (i = 0; i < (pVia->CursorMaxWidth * pVia->CursorMaxHeight / ARGB_PER_CHUNK); i++) {
-		    chunk = *s++;
+		    chunk = *src++;
 		    for (j = 0; j < ARGB_PER_CHUNK; j++, chunk >>= 2)
 			*dst++ = mono_cursor_color[chunk & 3];
 		}
@@ -447,7 +474,7 @@
 		pVia->CursorFG = mono_cursor_color[3];
 		pVia->CursorBG = mono_cursor_color[2];
     } else {
-	memcpy(dst, (CARD8*)s, pVia->CursorSize);
+	memcpy(dst, (CARD8*)src, pVia->CursorSize);
     }
     switch(pVia->Chipset) {
         case VIA_CX700:
@@ -471,11 +498,17 @@
     }
 }
 
+/*
+    Set the cursor foreground and background colors.  In 8bpp, fg and
+    bg are indicies into the current colormap unless the 
+    HARDWARE_CURSOR_TRUECOLOR_AT_8BPP flag is set.  In that case
+    and in all other bpps the fg and bg are in 8-8-8 RGB format.
+*/
+
 static void
 viaSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
 {
     VIAPtr pVia = VIAPTR(pScrn);
-    CARD32 control = pVia->CursorRegControl;
     CARD32 pixel;
     CARD32 temp;
     CARD32 *dst;
@@ -487,12 +520,10 @@
     fg |= 0xff000000;
     bg |= 0xff000000;
 
+    /* Don't recolour the image if we don't have to. */
     if (fg == pVia->CursorFG && bg == pVia->CursorBG)
 	return;
 
-    temp = VIAGETREG(control);
-    VIASETREG(control, temp & 0xFFFFFFFE);
-
     dst = (CARD32*)pVia->cursorMap;
     for (i = 0; i < pVia->CursorMaxWidth * pVia->CursorMaxHeight; i++, dst++)
 	if ((pixel = *dst))
@@ -517,7 +548,8 @@
              }
              break;        
         default:
-             VIASETREG(control, temp);
+             temp = VIAGETREG(VIA_REG_ALPHA_CONTROL);
+             VIASETREG(VIA_REG_ALPHA_CONTROL, temp & 0xFFFFFFFE);
     }
 }
 
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/via_dri.c xserver-xorg-video-openchrome-0.2.904+svn842/src/via_dri.c
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/via_dri.c	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/via_dri.c	2010-04-22 07:32:27.000000000 +0200
@@ -267,6 +267,11 @@
     pVIADRI = pDRIInfo->devPrivate;
     pVia->agpSize = 0;
 
+/* For AMD64 */
+#ifdef __x86_64__
+    return FALSE;
+#endif
+
     if (drmAgpAcquire(pVia->drmFD) < 0) {
         xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpAcquire failed %d\n",
                    errno);
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/via_driver.c xserver-xorg-video-openchrome-0.2.904+svn842/src/via_driver.c
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/via_driver.c	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/via_driver.c	2010-04-22 07:32:27.000000000 +0200
@@ -309,6 +309,7 @@
 {
     static Bool setupDone = FALSE;
 
+    /* Only be loaded once */
     if (!setupDone) {
         setupDone = TRUE;
         xf86AddDriver(&VIA, module,
@@ -341,6 +342,7 @@
     if (pScrn->driverPrivate)
         return TRUE;
 
+    /* allocate VIARec */
     pScrn->driverPrivate = xnfcalloc(sizeof(VIARec), 1);
     VIAPtr pVia = ((VIARec *) (pScrn->driverPrivate));
 
@@ -457,7 +459,6 @@
 {
     ScrnInfoPtr scrn = NULL;
     EntityInfoPtr entity;
-    DevUnion *private;
 
     scrn = xf86ConfigPciEntity(scrn, 0, entity_num, VIAPciChipsets,
                                NULL, NULL, NULL, NULL, NULL);
@@ -654,6 +655,12 @@
     vbeInfoPtr pVbe;
 
     if (xf86LoadSubModule(pScrn, "vbe")) {
+        /* FIXME This line should be replaced to:
+
+           pVbe = VBEExtendedInit(NULL, index, 0);
+
+           for XF86 version > 4.2.99
+        */
         pVbe = VBEInit(NULL, index);
         ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
         vbeFree(pVbe);
@@ -666,7 +673,7 @@
     VIAPtr pVia = VIAPTR(pScrn);
     VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
 
-    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIASetupDefaultOptions\n"));
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIASetupDefaultOptions - Setting up default chipset options.\n"));
 
     pVia->shadowFB = FALSE;
     pVia->NoAccel = FALSE;
@@ -690,6 +697,9 @@
 #ifdef HAVE_DEBUG
     pVia->PrintVGARegs = FALSE;
 #endif
+
+    /* Disable vertical interpolation because the size of */
+    /* line buffer (limited to 800) is too small to do interpolation. */
     pVia->swov.maxWInterp = 800;
     pVia->swov.maxHInterp = 600;
     pVia->useLegacyVBE = TRUE;
@@ -1055,19 +1065,13 @@
         xf86DrvMsg(pScrn->scrnIndex, from,
                    "Probed amount of VideoRAM = %d kB\n", pScrn->videoRam);
 
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-               "Setting up default chipset options.\n");
     if (!VIASetupDefaultOptions(pScrn)) {
         VIAFreeRec(pScrn);
         return FALSE;
     }
 
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Reading config file...\n");
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, VIAOptions);
 
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-               "Starting to parse config file options...\n");
-
     if (xf86GetOptValInteger(VIAOptions, OPTION_VIDEORAM, &pScrn->videoRam))
         xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
                    "Setting amount of VideoRAM to %d kB\n", pScrn->videoRam);
@@ -1528,6 +1532,7 @@
         }
     }
 
+    /* Initialize the colormap */
     Gamma zeros = { 0.0, 0.0, 0.0 };
     if (!xf86SetGamma(pScrn, zeros)) {
         VIAFreeRec(pScrn);
@@ -1974,7 +1979,9 @@
         Regs->SR17 = hwp->readSeq(hwp, 0x17);
         Regs->SR18 = hwp->readSeq(hwp, 0x18);
         Regs->SR19 = hwp->readSeq(hwp, 0x19);
+        /* PCI Bus Control */
         Regs->SR1A = hwp->readSeq(hwp, 0x1A);
+
         Regs->SR1B = hwp->readSeq(hwp, 0x1B);
         Regs->SR1C = hwp->readSeq(hwp, 0x1C);
         Regs->SR1D = hwp->readSeq(hwp, 0x1D);
@@ -2016,40 +2023,56 @@
                 Regs->SR4C = hwp->readSeq(hwp, 0x4C);
                 break;
         }
-        DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-              "Non-Primary Adapter! saving VGA_SR_MODE only !!\n"));
         DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Crtc...\n"));
 
         Regs->CR13 = hwp->readCrtc(hwp, 0x13);
 
         Regs->CR32 = hwp->readCrtc(hwp, 0x32);
         Regs->CR33 = hwp->readCrtc(hwp, 0x33);
-        Regs->CR34 = hwp->readCrtc(hwp, 0x34);
+
         Regs->CR35 = hwp->readCrtc(hwp, 0x35);
         Regs->CR36 = hwp->readCrtc(hwp, 0x36);
 
+
+
+        /* Starting Address */
+        /* Start Address High */
+        Regs->CR0C = hwp->readCrtc(hwp, 0x0C);
+        /* Start Address Low */
+        Regs->CR0D = hwp->readCrtc(hwp, 0x0D);
+        /* Starting Address Overflow Bits[28:24] */
         Regs->CR48 = hwp->readCrtc(hwp, 0x48);
+        /* CR34 are fire bits. Must be writed after CR0C CR0D CR48.  */
+        /* Starting Address Overflow Bits[23:16] */
+        Regs->CR34 = hwp->readCrtc(hwp, 0x34);
+
+
         Regs->CR49 = hwp->readCrtc(hwp, 0x49);
 
         DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TVSave...\n"));
         if (pBIOSInfo->TVI2CDev)
             ViaTVSave(pScrn);
 
-        /* Save LCD control registers. */
+        /* Save LCD control registers (from CR 0x50 to 0x93). */
         for (i = 0; i < 68; i++)
             Regs->CRTCRegs[i] = hwp->readCrtc(hwp, i + 0x50);
 
         if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) {
-
-            Regs->CRA0 = hwp->readCrtc(hwp, 0xA0);
-            Regs->CRA1 = hwp->readCrtc(hwp, 0xA1);
-            Regs->CRA2 = hwp->readCrtc(hwp, 0xA2);
-
+            /* LVDS Channel 2 Function Select 0 / DVI Function Select */ 
             Regs->CR97 = hwp->readCrtc(hwp, 0x97);
+            /* LVDS Channel 1 Function Select 0 */
             Regs->CR99 = hwp->readCrtc(hwp, 0x99);
+            /* Digital Video Port 1 Function Select 0 */
             Regs->CR9B = hwp->readCrtc(hwp, 0x9B);
+            /* Power Now Control 4 */
             Regs->CR9F = hwp->readCrtc(hwp, 0x9F);
 
+            /* Horizontal Scaling Initial Value */
+            Regs->CRA0 = hwp->readCrtc(hwp, 0xA0);
+            /* Vertical Scaling Initial Value */
+            Regs->CRA1 = hwp->readCrtc(hwp, 0xA1);
+            /* Scaling Enable Bit */
+            Regs->CRA2 = hwp->readCrtc(hwp, 0xA2);
         }
 
         /* Save TMDS status */
@@ -2137,11 +2160,19 @@
     hwp->writeSeq(hwp, 0x45, Regs->SR45);
     hwp->writeSeq(hwp, 0x46, Regs->SR46);
 
+    /* Reset VCK PLL */
+    hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) | 0x02); /* Set SR40[1] to 1 */
+    hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) & 0xFD); /* Set SR40[1] to 0 */
+
     /* ECK Clock Synthesizer: */
     hwp->writeSeq(hwp, 0x47, Regs->SR47);
     hwp->writeSeq(hwp, 0x48, Regs->SR48);
     hwp->writeSeq(hwp, 0x49, Regs->SR49);
 
+    /* Reset ECK PLL */
+    hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) | 0x01); /* Set SR40[0] to 1 */
+    hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) & 0xFE); /* Set SR40[0] to 0 */
+
     switch (pVia->Chipset) {
         case VIA_CLE266:
         case VIA_KM400:
@@ -2151,6 +2182,10 @@
             hwp->writeSeq(hwp, 0x4A, Regs->SR4A);
             hwp->writeSeq(hwp, 0x4B, Regs->SR4B);
             hwp->writeSeq(hwp, 0x4C, Regs->SR4C);
+
+            /* Reset LCK PLL */
+            hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) | 0x04); /* Set SR40[2] to 1 */
+            hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) & 0xFB); /* Set SR40[2] to 0 */
             break;
     }
 
@@ -2166,14 +2201,23 @@
     hwp->writeCrtc(hwp, 0x32, Regs->CR32);
     /* HSYNCH Adjuster */
     hwp->writeCrtc(hwp, 0x33, Regs->CR33);
-    /* Starting Address Overflow */
-    hwp->writeCrtc(hwp, 0x34, Regs->CR34);
     /* Extended Overflow */
     hwp->writeCrtc(hwp, 0x35, Regs->CR35);
     /*Power Management 3 (Monitor Control) */
     hwp->writeCrtc(hwp, 0x36, Regs->CR36);
 
+    /* Starting Address */
+    /* Start Address High */
+    hwp->writeCrtc(hwp, 0x0C, Regs->CR0C);
+    /* Start Address Low */
+    hwp->writeCrtc(hwp, 0x0D, Regs->CR0D);
+    /* Starting Address Overflow Bits[28:24] */
     hwp->writeCrtc(hwp, 0x48, Regs->CR48);
+    /* CR34 are fire bits. Must be writed after CR0C CR0D CR48.  */
+    /* Starting Address Overflow Bits[23:16] */
+    hwp->writeCrtc(hwp, 0x34, Regs->CR34);
+    
+
     hwp->writeCrtc(hwp, 0x49, Regs->CR49);
 
     /* Restore LCD control registers. */
@@ -2492,7 +2536,6 @@
 VIALoadRgbLut(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
               VisualPtr pVisual)
 {
-    VIAPtr pVia = VIAPTR(pScrn);
     vgaHWPtr hwp = VGAHWPTR(pScrn);
 
     int i, j, index;
@@ -2919,7 +2962,6 @@
 VIAWriteMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
 {
     VIAPtr pVia = VIAPTR(pScrn);
-    VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAWriteMode\n"));
 
@@ -3072,9 +3114,7 @@
 VIAAdjustFrame(int scrnIndex, int x, int y, int flags)
 {
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-    vgaHWPtr hwp = VGAHWPTR(pScrn);
     VIAPtr pVia = VIAPTR(pScrn);
-    CARD32 Base;
 
     DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "VIAAdjustFrame %dx%d\n", x, y));
 
@@ -3212,7 +3252,6 @@
 static void
 VIADPMS(ScrnInfoPtr pScrn, int mode, int flags)
 {
-    vgaHWPtr hwp = VGAHWPTR(pScrn);
     VIAPtr pVia = VIAPTR(pScrn);
     VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
 
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/via_driver.h xserver-xorg-video-openchrome-0.2.904+svn842/src/via_driver.h
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/via_driver.h	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/via_driver.h	2010-04-22 07:32:27.000000000 +0200
@@ -130,6 +130,7 @@
     CARD8   SR4A, SR4B, SR4C;
 
     /*   extended CRTC registers */
+    CARD8   CR0C, CR0D;
     CARD8   CR13, CR30, CR31, CR32, CR33, CR34, CR35, CR36;
     CARD8   CR37, CR38, CR39, CR3A, CR40, CR41, CR42, CR43;
     CARD8   CR44, CR45, CR46, CR47, CR48, CR49, CR4A;
@@ -418,10 +419,10 @@
     Bool                PrintVGARegs;
     Bool                PrintTVRegs;
     Bool                I2CScan;
+#endif /* HAVE_DEBUG */
     
     Bool                UseLegacyModeSwitch ;
     video_via_regs*     VideoRegs ;
-#endif /* HAVE_DEBUG */
 } VIARec, *VIAPtr;
 
 #define VIAPTR(p) ((VIAPtr)((p)->driverPrivate))
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/via_id.c xserver-xorg-video-openchrome-0.2.904+svn842/src/via_id.c
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/via_id.c	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/via_id.c	2010-04-22 07:32:27.000000000 +0200
@@ -152,6 +152,7 @@
     {"MSI PM8PM",                             VIA_VM800,   0x1462, 0x7222, VIA_DEVICE_CRT},
     {"Twinhead M6",                           VIA_VM800,   0x14FF, 0xA007, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
     {"RoverBook Partner W500",                VIA_VM800,   0x1509, 0x4330, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
+    {"FIC PTM800Pro LF",                      VIA_VM800,   0x1509, 0x601A, VIA_DEVICE_CRT},
     {"Clevo/RoverBook Voyager V511L",         VIA_VM800,   0x1558, 0x0662, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
     {"Clevo M5xxS",                           VIA_VM800,   0x1558, 0x5406, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
     {"Biostar P4M80-M4 / P4VMA-M",            VIA_VM800,   0x1565, 0x1202, VIA_DEVICE_CRT},
@@ -170,6 +171,7 @@
     {"Asustek M2V-MX SE",                     VIA_K8M890,  0x1043, 0x8297, VIA_DEVICE_CRT},
     {"Foxconn K8M890M2MA-RS2H",               VIA_K8M890,  0x105B, 0x0C84, VIA_DEVICE_CRT},
     {"Shuttle FX22V1",                        VIA_K8M890,  0x1297, 0x3080, VIA_DEVICE_CRT},
+    {"MSI K8M890M2-V",                        VIA_K8M890,  0x1462, 0x7139, VIA_DEVICE_CRT},
     {"MSI K9VGM-V",                           VIA_K8M890,  0x1462, 0x7253, VIA_DEVICE_CRT},
     {"Averatec 226x",                         VIA_K8M890,  0x14FF, 0xA002, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
     {"Fujitsu/Siemens Amilo La 1703",         VIA_K8M890,  0x1734, 0x10D9, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/via_mode.h xserver-xorg-video-openchrome-0.2.904+svn842/src/via_mode.h
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/via_mode.h	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/via_mode.h	2010-04-22 07:32:27.000000000 +0200
@@ -54,50 +54,50 @@
     CARD16 UniChrome;
     union pllparams UniChromePro;
 } ViaDotClocks[] = {
-    {  25200, 0x513C, /* 0xa79004 */ { 1, 4, 6, 169 } },
-    {  25312, 0xC763, /* 0xc49005 */ { 1, 4, 7, 198 } },
-    {  26591, 0x471A, /* 0xce9005 */ { 1, 4, 7, 208 } },
-    {  31500, 0xC558, /* 0xae9003 */ { 1, 4, 5, 176 } },
-    {  31704, 0x471F, /* 0xaf9002 */ { 1, 4, 4, 177 } },
-    {  32663, 0xC449, /* 0x479000 */ { 1, 4, 2,  73 } },
-    {  33750, 0x4721, /* 0x959002 */ { 1, 4, 4, 151 } },
-    {  35500, 0x5877, /* 0x759001 */ { 1, 4, 3, 119 } },
-    {  36000, 0x5879, /* 0x9f9002 */ { 1, 4, 4, 161 } },
-    {  39822, 0xC459, /* 0x578c02 */ { 1, 3, 4,  89 } },
-    {  40000, 0x515F, /* 0x848c04 */ { 1, 3, 6, 134 } },
-    {  41164, 0x4417, /* 0x2c8c00 */ { 1, 3, 2,  46 } },
-    {  46981, 0x5069, /* 0x678c02 */ { 1, 3, 4, 105 } },
-    {  49500, 0xC353, /* 0xa48c04 */ { 3, 3, 5, 138 } },
-    {  50000, 0xC354, /* 0x368c00 */ { 1, 3, 2,  56 } },
-    {  56300, 0x4F76, /* 0x3d8c00 */ { 1, 3, 2,  63 } },
-    {  57275,      0, /* 0x3e8c00 */ { 1, 3, 5, 157 } }, /* For XO 1.5 no need for a unichrome clock */
-    {  57284, 0x4E70, /* 0x3e8c00 */ { 1, 3, 2,  64 } },
-    {  64995, 0x0D3B, /* 0x6b8c01 */ { 1, 3, 3, 109 } },
-    {  65000, 0x0D3B, /* 0x6b8c01 */ { 1, 3, 3, 109 } }, /* Slightly unstable on PM800 */
-    {  65028, 0x866D, /* 0x6b8c01 */ { 1, 3, 3, 109 } },
-    {  74480, 0x156E, /* 0x288800 */ { 1, 2, 2,  42 } },
-    {  75000, 0x156E, /* 0x288800 */ { 1, 2, 2,  42 } },
-    {  78800, 0x442C, /* 0x2a8800 */ { 1, 2, 2,  44 } },
-    {  81135, 0x0622, /* 0x428801 */ { 1, 2, 3,  68 } },
-    {  81613, 0x4539, /* 0x708803 */ { 1, 2, 5, 114 } },
-    {  94500, 0x4542, /* 0x4d8801 */ { 1, 2, 3,  79 } },
-    { 108000, 0x0B53, /* 0x778802 */ { 1, 2, 4, 121 } },
-    { 108280, 0x4879, /* 0x778802 */ { 1, 2, 4, 121 } },
-    { 122000, 0x0D6F, /* 0x428800 */ { 1, 2, 2,  68 } },
-    { 122726, 0x073C, /* 0x878802 */ { 1, 2, 4, 137 } },
-    { 135000, 0x0742, /* 0x6f8801 */ { 1, 2, 3, 113 } },
-    { 148500, 0x0853, /* 0x518800 */ { 1, 2, 2,  83 } },
-    { 155800, 0x0857, /* 0x558402 */ { 1, 1, 4,  87 } }, 
-    { 157500, 0x422C, /* 0x2a8400 */ { 1, 1, 2,  44 } },
-    { 161793, 0x4571, /* 0x6f8403 */ { 1, 1, 5, 113 } }, 
-    { 162000, 0x0A71, /* 0x6f8403 */ { 1, 1, 5, 113 } },
-    { 175500, 0x4231, /* 0x2f8400 */ { 1, 1, 2,  49 } },
-    { 189000, 0x0542, /* 0x4d8401 */ { 1, 1, 3,  79 } },
-    { 202500, 0x0763, /* 0x6F8402 */ { 1, 1, 4, 113 } },
-    { 204800, 0x0764, /* 0x548401 */ { 1, 1, 3,  86 } },
-    { 218300, 0x043D, /* 0x3b8400 */ { 1, 1, 2,  61 } },
-    { 229500, 0x0660, /* 0x3e8400 */ { 1, 1, 2,  64 } }, /* Not tested on Pro } */
-    {      0,      0,                { 0, 0, 0,   0 } }
+    {  25200, 0x513C, /* 0xa79004 */ { { 1, 4, 6, 169 } } },
+    {  25312, 0xC763, /* 0xc49005 */ { { 1, 4, 7, 198 } } },
+    {  26591, 0x471A, /* 0xce9005 */ { { 1, 4, 7, 208 } } },
+    {  31500, 0xC558, /* 0xae9003 */ { { 1, 4, 5, 176 } } },
+    {  31704, 0x471F, /* 0xaf9002 */ { { 1, 4, 4, 177 } } },
+    {  32663, 0xC449, /* 0x479000 */ { { 1, 4, 2,  73 } } },
+    {  33750, 0x4721, /* 0x959002 */ { { 1, 4, 4, 151 } } },
+    {  35500, 0x5877, /* 0x759001 */ { { 1, 4, 3, 119 } } },
+    {  36000, 0x5879, /* 0x9f9002 */ { { 1, 4, 4, 161 } } },
+    {  39822, 0xC459, /* 0x578c02 */ { { 1, 3, 4,  89 } } },
+    {  40000, 0x515F, /* 0x848c04 */ { { 1, 3, 6, 134 } } },
+    {  41164, 0x4417, /* 0x2c8c00 */ { { 1, 3, 2,  46 } } },
+    {  46981, 0x5069, /* 0x678c02 */ { { 1, 3, 4, 105 } } },
+    {  49500, 0xC353, /* 0xa48c04 */ { { 3, 3, 5, 138 } } },
+    {  50000, 0xC354, /* 0x368c00 */ { { 1, 3, 2,  56 } } },
+    {  56300, 0x4F76, /* 0x3d8c00 */ { { 1, 3, 2,  63 } } },
+    {  57275,      0, /* 0x3e8c00 */ { { 1, 3, 5, 157 } } }, /* For XO 1.5 no need for a unichrome clock */
+    {  57284, 0x4E70, /* 0x3e8c00 */ { { 1, 3, 2,  64 } } },
+    {  64995, 0x0D3B, /* 0x6b8c01 */ { { 1, 3, 3, 109 } } },
+    {  65000, 0x0D3B, /* 0x6b8c01 */ { { 1, 3, 3, 109 } } }, /* Slightly unstable on PM800 */
+    {  65028, 0x866D, /* 0x6b8c01 */ { { 1, 3, 3, 109 } } },
+    {  74480, 0x156E, /* 0x288800 */ { { 1, 2, 2,  42 } } },
+    {  75000, 0x156E, /* 0x288800 */ { { 1, 2, 2,  42 } } },
+    {  78800, 0x442C, /* 0x2a8800 */ { { 1, 2, 2,  44 } } },
+    {  81135, 0x0622, /* 0x428801 */ { { 1, 2, 3,  68 } } },
+    {  81613, 0x4539, /* 0x708803 */ { { 1, 2, 5, 114 } } },
+    {  94500, 0x4542, /* 0x4d8801 */ { { 1, 2, 3,  79 } } },
+    { 108000, 0x0B53, /* 0x778802 */ { { 1, 2, 4, 121 } } },
+    { 108280, 0x4879, /* 0x778802 */ { { 1, 2, 4, 121 } } },
+    { 122000, 0x0D6F, /* 0x428800 */ { { 1, 2, 2,  68 } } },
+    { 122726, 0x073C, /* 0x878802 */ { { 1, 2, 4, 137 } } },
+    { 135000, 0x0742, /* 0x6f8801 */ { { 1, 2, 3, 113 } } },
+    { 148500, 0x0853, /* 0x518800 */ { { 1, 2, 2,  83 } } },
+    { 155800, 0x0857, /* 0x558402 */ { { 1, 1, 4,  87 } } }, 
+    { 157500, 0x422C, /* 0x2a8400 */ { { 1, 1, 2,  44 } } },
+    { 161793, 0x4571, /* 0x6f8403 */ { { 1, 1, 5, 113 } } }, 
+    { 162000, 0x0A71, /* 0x6f8403 */ { { 1, 1, 5, 113 } } },
+    { 175500, 0x4231, /* 0x2f8400 */ { { 1, 1, 2,  49 } } },
+    { 189000, 0x0542, /* 0x4d8401 */ { { 1, 1, 3,  79 } } },
+    { 202500, 0x0763, /* 0x6F8402 */ { { 1, 1, 4, 113 } } },
+    { 204800, 0x0764, /* 0x548401 */ { { 1, 1, 3,  86 } } },
+    { 218300, 0x043D, /* 0x3b8400 */ { { 1, 1, 2,  61 } } },
+    { 229500, 0x0660, /* 0x3e8400 */ { { 1, 1, 2,  64 } } }, /* Not tested on Pro } */
+    {      0,      0,                { { 0, 0, 0,   0 } } }
 };
 
 /*
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/via_panel.c xserver-xorg-video-openchrome-0.2.904+svn842/src/via_panel.c
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/via_panel.c	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/via_panel.c	2010-04-22 07:32:27.000000000 +0200
@@ -362,22 +362,22 @@
 ViaPanelGetSizeFromEDID(ScrnInfoPtr pScrn, xf86MonPtr pMon,
                         int *width, int *height)
 {
-    int i, max = 0, vsize;
+    int i, max_hsize = 0, vsize = 0;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetPanelSizeFromEDID\n"));
 
     /* !!! Why are we not checking VESA modes? */
 
     /* checking standard timings */
-    for (i = 0; i < 8; i++)
+    for (i = 0; i < STD_TIMINGS; i++)
         if ((pMon->timings2[i].hsize > 256)
-            && (pMon->timings2[i].hsize > max)) {
-            max = pMon->timings2[i].hsize;
+            && (pMon->timings2[i].hsize > max_hsize)) {
+            max_hsize = pMon->timings2[i].hsize;
             vsize = pMon->timings2[i].vsize;
         }
 
-    if (max != 0) {
-        *width = max;
+    if (max_hsize != 0) {
+        *width = max_hsize;
         *height = vsize;
         return TRUE;
     }
@@ -392,14 +392,14 @@
             struct detailed_timings timing = pMon->det_mon[i].section.d_timings;
 
             /* ignore v_active for now */
-            if ((timing.clock > 15000000) && (timing.h_active > max)) {
-                max = timing.h_active;
+            if ((timing.clock > 15000000) && (timing.h_active > max_hsize)) {
+                max_hsize = timing.h_active;
                 vsize = timing.v_active;
             }
         }
 
-    if (max != 0) {
-        *width = max;
+    if (max_hsize != 0) {
+        *width = max_hsize;
         *height = vsize;
         return TRUE;
     }
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/via_video.c xserver-xorg-video-openchrome-0.2.904+svn842/src/via_video.c
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/via_video.c	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/via_video.c	2010-04-22 07:32:27.000000000 +0200
@@ -466,8 +466,8 @@
 
     viaVidEng->video1_ctl = 0;
     viaVidEng->video3_ctl = 0;
-    viaVidEng->compose = 0x80000000;
-    viaVidEng->compose = 0x40000000;
+    viaVidEng->compose = V1_COMMAND_FIRE;
+    viaVidEng->compose = V3_COMMAND_FIRE;
     viaVidEng->color_key = 0x821;
     viaVidEng->snd_color_key = 0x821;
 
@@ -479,16 +479,16 @@
     VIAPtr pVia = VIAPTR(pScrn);
     vmmtr viaVidEng = (vmmtr) pVia->VidMapBase;
     
+    DBG_DD(ErrorF(" via_video.c : viaSaveVideo : \n"));
     /* Save video registers */
-    /* TODO: Identify which registers should be saved and restored */
     memcpy(pVia->VideoRegs, (void*)viaVidEng, sizeof(video_via_regs));
 
     pVia->dwV1 = ((vmmtr) viaVidEng)->video1_ctl;
     pVia->dwV3 = ((vmmtr) viaVidEng)->video3_ctl;
     viaVidEng->video1_ctl = 0;
     viaVidEng->video3_ctl = 0;
-    viaVidEng->compose = 0x80000000;
-    viaVidEng->compose = 0x40000000;
+    viaVidEng->compose = V1_COMMAND_FIRE;
+    viaVidEng->compose = V3_COMMAND_FIRE;
 }
 
 void
@@ -496,16 +496,65 @@
 {
     VIAPtr pVia = VIAPTR(pScrn);
     vmmtr viaVidEng = (vmmtr) pVia->VidMapBase;
+    video_via_regs  *localVidEng = pVia->VideoRegs;
+
     
+    DBG_DD(ErrorF(" via_video.c : viaRestoreVideo : \n"));
     /* Restore video registers */
-    /* TODO: Identify which registers should be saved and restored */
-    memcpy((void*)viaVidEng, pVia->VideoRegs, sizeof(video_via_regs));
-
+    /* flush restored video engines' setting to VidMapBase */
+    
+    viaVidEng->alphawin_hvstart = localVidEng->alphawin_hvstart;
+    viaVidEng->alphawin_size   = localVidEng->alphawin_size;
+    viaVidEng->alphawin_ctl    = localVidEng->alphawin_ctl;
+    viaVidEng->alphafb_stride  = localVidEng->alphafb_stride;
+    viaVidEng->color_key       = localVidEng->color_key;
+    viaVidEng->alphafb_addr    = localVidEng->alphafb_addr;
+    viaVidEng->chroma_low      = localVidEng->chroma_low;
+    viaVidEng->chroma_up       = localVidEng->chroma_up;
+
+    if (pVia->ChipId != PCI_CHIP_VT3314)
+    {
+        /*VT3314 only has V3*/
+        viaVidEng->video1_ctl      = localVidEng->video1_ctl;
+        viaVidEng->video1_fetch    = localVidEng->video1_fetch;
+        viaVidEng->video1y_addr1   = localVidEng->video1y_addr1;
+        viaVidEng->video1_stride   = localVidEng->video1_stride;
+        viaVidEng->video1_hvstart  = localVidEng->video1_hvstart;
+        viaVidEng->video1_size     = localVidEng->video1_size;
+        viaVidEng->video1y_addr2   = localVidEng->video1y_addr2;
+        viaVidEng->video1_zoom     = localVidEng->video1_zoom;
+        viaVidEng->video1_mictl    = localVidEng->video1_mictl;
+        viaVidEng->video1y_addr0   = localVidEng->video1y_addr0;
+        viaVidEng->video1_fifo     = localVidEng->video1_fifo;
+        viaVidEng->video1y_addr3   = localVidEng->video1y_addr3;
+        viaVidEng->v1_source_w_h   = localVidEng->v1_source_w_h ;
+        viaVidEng->video1_CSC1     = localVidEng->video1_CSC1;
+        viaVidEng->video1_CSC2     = localVidEng->video1_CSC2;
+    }
+    viaVidEng->snd_color_key   = localVidEng->snd_color_key;
+    viaVidEng->v3alpha_prefifo = localVidEng->v3alpha_prefifo;
+    viaVidEng->v3alpha_fifo    = localVidEng->v3alpha_fifo;
+    viaVidEng->video3_CSC2     = localVidEng->video3_CSC2;
+    viaVidEng->video3_CSC2     = localVidEng->video3_CSC2;
+    viaVidEng->v3_source_width = localVidEng->v3_source_width;
+    viaVidEng->video3_ctl      = localVidEng->video3_ctl;
+    viaVidEng->video3_addr0    = localVidEng->video3_addr0;
+    viaVidEng->video3_addr1    = localVidEng->video3_addr1;
+    viaVidEng->video3_stride   = localVidEng->video3_stride;
+    viaVidEng->video3_hvstart  = localVidEng->video3_hvstart;
+    viaVidEng->video3_size     = localVidEng->video3_size;
+    viaVidEng->v3alpha_fetch   = localVidEng->v3alpha_fetch;
+    viaVidEng->video3_zoom     = localVidEng->video3_zoom;
+    viaVidEng->video3_mictl    = localVidEng->video3_mictl;
+    viaVidEng->video3_CSC1     = localVidEng->video3_CSC1;
+    viaVidEng->video3_CSC2     = localVidEng->video3_CSC2;    
+    viaVidEng->compose         = localVidEng->compose;
+    
     viaVidEng->video1_ctl = pVia->dwV1;
     viaVidEng->video3_ctl = pVia->dwV3;
-    viaVidEng->compose = 0x80000000;
-    viaVidEng->compose = 0x40000000;
-
+    if (pVia->ChipId != PCI_CHIP_VT3314)
+        viaVidEng->compose = V1_COMMAND_FIRE;
+    viaVidEng->compose = V3_COMMAND_FIRE;
 }
 
 void
@@ -524,8 +573,8 @@
 
     viaVidEng->video1_ctl = 0;
     viaVidEng->video3_ctl = 0;
-    viaVidEng->compose = 0x80000000;
-    viaVidEng->compose = 0x40000000;
+    viaVidEng->compose = V1_COMMAND_FIRE;
+    viaVidEng->compose = V3_COMMAND_FIRE;
 
     /*
      * Free all adaptor info allocated in viaInitVideo.
@@ -636,133 +685,6 @@
     }
 }
 
-static Bool
-RegionsEqual(RegionPtr A, RegionPtr B)
-{
-    int *dataA, *dataB;
-    int num;
-
-    num = REGION_NUM_RECTS(A);
-    if (num != REGION_NUM_RECTS(B))
-        return FALSE;
-
-    if ((A->extents.x1 != B->extents.x1) ||
-        (A->extents.x2 != B->extents.x2) ||
-        (A->extents.y1 != B->extents.y1) || (A->extents.y2 != B->extents.y2))
-    return FALSE;
-
-    dataA = (int *)REGION_RECTS(A);
-    dataB = (int *)REGION_RECTS(B);
-
-    while (num--) {
-        if ((dataA[0] != dataB[0]) || (dataA[1] != dataB[1]))
-            return FALSE;
-        dataA += 2;
-        dataB += 2;
-    }
-
-    return TRUE;
-}
-
-static void
-viaVideoFillPixmap(ScrnInfoPtr pScrn,
-        char *base,
-        unsigned long pitch,
-        int depth,
-        int x, int y, int w, int h,
-        unsigned long color)
-{
-    int i;
-
-    ErrorF("pitch %lu, depth %d, x %d, y %d, w %d, h %d, color 0x%08lx\n",
-            pitch, depth, x, y, w, h, color);
-
-    depth = (depth + 7) >> 3;
-
-    base += y*pitch + x*depth;
-
-    switch(depth) {
-        case 4:
-        while(h--) {
-            register CARD32 *p = (CARD32 *)base;
-            for (i=0; i<w; ++i) {
-                *p++ = color;
-            }
-            base += pitch;
-        }
-        break;
-        case 2: {
-            register CARD16 col = color & 0x0000FFFF;
-            while(h--) {
-                register CARD16 *p = (CARD16 *)base;
-                for (i=0; i<w; ++i) {
-                    *p++ = col;
-                }
-                base += pitch;
-            }
-            break;
-        }
-        case 1: {
-            register CARD8 col = color & 0xFF;
-            while(h--) {
-                register CARD8 *p = (CARD8 *)base;
-                for (i=0; i<w; ++i) {
-                    *p++ = col;
-                }
-                base += pitch;
-            }
-            break;
-        }
-        default:
-        break;
-    }
-}
-    
-
-
-static int
-viaPaintColorkey(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv, RegionPtr clipBoxes,
-    DrawablePtr pDraw)
-{
-
-    if (pDraw->type == DRAWABLE_WINDOW) {
-
-        VIAPtr pVia = VIAPTR(pScrn);
-        PixmapPtr pPix = (pScrn->pScreen->GetWindowPixmap)((WindowPtr) pDraw);
-        unsigned long pitch = pPix->devKind;
-        long offset = (long) pPix->devPrivate.ptr - (long) pVia->FBBase;
-        int x,y;
-        BoxPtr pBox;
-        int nBox;
-
-        REGION_TRANSLATE(pScrn->pScreen, clipBoxes, - pPix->screen_x,
-            - pPix->screen_y);
-
-        nBox = REGION_NUM_RECTS(clipBoxes);
-        pBox = REGION_RECTS(clipBoxes);
-
-        while(nBox--) {
-            if (pVia->NoAccel || offset < 0 ||
-                offset > pScrn->videoRam*1024) {
-                viaVideoFillPixmap(pScrn, pPix->devPrivate.ptr, pitch,
-                    pDraw->bitsPerPixel, pBox->x1, pBox->y1,
-                    pBox->x2 - pBox->x1, pBox->y2 - pBox->y1,
-                    pPriv->colorKey);
-            } else {
-                viaAccelFillPixmap(pScrn, offset, pitch,
-                    pDraw->bitsPerPixel, pBox->x1, pBox->y1,
-                    pBox->x2 - pBox->x1, pBox->y2 - pBox->y1,
-                    pPriv->colorKey);
-            }
-            pBox++;
-        }
-
-        DamageDamageRegion(pPix, clipBoxes);
-    }
-
-    return 0;
-}
-
 
 /*
  * This one gets called, for example, on panning.
@@ -779,14 +701,19 @@
     viaPortPrivPtr pPriv = (viaPortPrivPtr) data;
     VIAPtr pVia = VIAPTR(pScrn);
 
-    if (!RegionsEqual(&pPriv->clip, clipBoxes)) {
+    if (!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) {
         REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes);
         if (pPriv->autoPaint) {
             if (pDraw->type == DRAWABLE_WINDOW) {
-                viaPaintColorkey(pScrn, pPriv, clipBoxes, pDraw);
+                /* TODO Replace xf86XVFillKeyHelper with xf86XVFillKeyHelperDrawable
+                   Currently resizing problem exist in VLC Media Player
+                   Example of implementation:
+                xf86XVFillKeyHelperDrawable(pDraw, pPriv->colorKey, clipBoxes);
+                DamageDamageRegion(pDraw, clipBoxes); */
+                
+                xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
             } else {
-                xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey,
-                    clipBoxes);
+                xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
             }
         }
     }
@@ -1298,7 +1225,7 @@
     unsigned long retCode;
 
 # ifdef XV_DEBUG
-    ErrorF(" via_video.c : viaPutImage : called\n");
+    ErrorF(" via_video.c : viaPutImage : called,  Screen[%d]\n", pScrn->scrnIndex);
     ErrorF(" via_video.c : FourCC=0x%x width=%d height=%d sync=%d\n", id,
             width, height, sync);
     ErrorF
@@ -1407,12 +1334,11 @@
 
             lpUpdateOverlay->dwFlags = DDOVER_KEYDEST;
 
-            if (pScrn->bitsPerPixel == 8)
-            lpUpdateOverlay->dwColorSpaceLowValue =
-            pPriv->colorKey & 0xff;
-            else
-            lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey;
-
+            if (pScrn->bitsPerPixel == 8) {
+                lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey & 0xff;
+            } else {
+                lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey;
+            }
             /* If use extend FIFO mode */
             if (pScrn->currentMode->HDisplay > 1024) {
                 dwUseExtendedFIFO = 1;
@@ -1438,7 +1364,7 @@
                     && (pPriv->old_src_w == src_w) && (pPriv->old_src_h == src_h)
                     && (pVia->old_dwUseExtendedFIFO == dwUseExtendedFIFO)
                     && (pVia->VideoStatus & VIDEO_SWOV_ON) &&
-                    RegionsEqual(&pPriv->clip, clipBoxes)) {
+                    REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) {
                 viaXvError(pScrn, pPriv, xve_none);
                 return Success;
             }
@@ -1456,16 +1382,18 @@
             pVia->VideoStatus |= VIDEO_SWOV_ON;
 
             /*  BitBlt: Draw the colorkey rectangle */
-            if (!RegionsEqual(&pPriv->clip, clipBoxes)) {
+            if (!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) {
                 REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes);
                 if (pPriv->autoPaint) {
                     if (pDraw->type == DRAWABLE_WINDOW) {
-                        viaPaintColorkey(pScrn, pPriv, clipBoxes, pDraw);
+                        xf86XVFillKeyHelperDrawable(pDraw, pPriv->colorKey, clipBoxes);
+                        DamageDamageRegion(pDraw, clipBoxes);
                     } else {
-                        xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey,
-                            clipBoxes);
+                        xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
                     }
                 }
+            } else {
+                DBG_DD(ErrorF(" via_video.c : // No need to draw Colorkey!! \n"));
             }
             /*
              *  Update video overlay
diff -Nru xserver-xorg-video-openchrome-0.2.904+svn827/src/via_video.h xserver-xorg-video-openchrome-0.2.904+svn842/src/via_video.h
--- xserver-xorg-video-openchrome-0.2.904+svn827/src/via_video.h	2010-01-11 21:34:09.000000000 +0100
+++ xserver-xorg-video-openchrome-0.2.904+svn842/src/via_video.h	2010-04-22 07:32:27.000000000 +0200
@@ -44,6 +44,10 @@
 
 #define VIDEO_BPP 2
 
+
+#define V1_COMMAND_FIRE               0x80000000  /* V1 commands fire */
+#define V3_COMMAND_FIRE               0x40000000  /* V3 commands fire */
+
 typedef struct
 {
     CARD32 interruptflag;	       /* 200 */
@@ -89,7 +93,7 @@
     CARD32 video3_ctl;		       /* 2a0 */
     CARD32 video3_addr0;	       /* 2a4 */
     CARD32 video3_addr1;	       /* 2a8 */
-    CARD32 video3_stribe;	       /* 2ac */
+    CARD32 video3_stride;	       /* 2ac */
     CARD32 video3_hvstart;	       /* 2b0 */
     CARD32 video3_size;		       /* 2b4 */
     CARD32 v3alpha_fetch;	       /* 2b8 */

Attachment: signature.asc
Description: Digital signature


Reply to: