--- xserver-xorg-video-apm-1.2.3.orig/COPYING
+++ xserver-xorg-video-apm-1.2.3/COPYING
@@ -1,3 +1,27 @@
+Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+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
+XFREE86 PROJECT 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 XFree86 Project 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
+XFree86 Project.
+
 Copyright 2007 George Sapountzis
 
 Permission is hereby granted, free of charge, to any person obtaining a
--- xserver-xorg-video-apm-1.2.3.orig/ChangeLog
+++ xserver-xorg-video-apm-1.2.3/ChangeLog
@@ -1,3 +1,58 @@
+commit 21f5f7acf9235428ef2bcd5e34d0a44f9e4d838b
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Mon Dec 19 17:44:20 2011 -0500
+
+    Fix for new vgaHW ABI
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit f66da557eb7773856081bda2465973dfabf3eaa0
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Mon Dec 19 16:09:34 2011 -0500
+
+    Fall back to shadowfb if XAA fails to load
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit ca19356b3b979b92535f6f22f79c8bab852093a4
+Merge: 413eee0 967f6f2
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Mon Dec 19 16:06:05 2011 -0500
+
+    Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-apm
+
+commit 967f6f20670baa33506c3c1b107260a4f909f3d6
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Thu Nov 17 15:50:02 2011 -0500
+
+    Check ABI major not encoded ABI
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 6b195cc0273650d01fc20c26433b929e9683aa5f
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Wed Nov 16 13:02:14 2011 -0500
+
+    Adapt to vgahw changes in videoabi 12
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 9ce6499f013a5b6fdc9440fd3213dbb28b3bf1be
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Wed Nov 16 12:59:00 2011 -0500
+
+    s/IOADDRESS/unsigned long/
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 6f8a776f792c02779a34c911f803fde8c09b93f6
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Wed Jul 28 07:42:30 2010 -0700
+
+    Add XFree86 Copyright/License to COPYING for all code that came from XF86 4.4
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
 commit 876d8aea6c4c442756c03dd6cd64e14e42658d0b
 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
 Date:   Fri Jul 23 15:13:02 2010 -0700
@@ -122,6 +177,16 @@
     
     Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
 
+commit 413eee03287b6e161ce0337df712099b585aa722
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Fri Jun 4 17:10:07 2010 -0400
+
+    Remove non-linear framebuffer mapping
+    
+    It hasn't worked since the pciaccess conversion anyway.
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
 commit aa26b72a5f76012e8246de1e885f707f29e5fc4c
 Author: Adam Jackson <ajax@redhat.com>
 Date:   Tue May 18 12:59:36 2010 -0400
--- xserver-xorg-video-apm-1.2.3.orig/autogen.sh
+++ xserver-xorg-video-apm-1.2.3/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
--- xserver-xorg-video-apm-1.2.3.orig/debian/watch
+++ xserver-xorg-video-apm-1.2.3/debian/watch
@@ -0,0 +1,3 @@
+#git=git://anongit.freedesktop.org/xorg/driver/xf86-video-apm
+version=3
+http://xorg.freedesktop.org/releases/individual/driver/ xf86-video-apm-(.*)\.tar\.gz
--- xserver-xorg-video-apm-1.2.3.orig/debian/compat
+++ xserver-xorg-video-apm-1.2.3/debian/compat
@@ -0,0 +1 @@
+8
--- xserver-xorg-video-apm-1.2.3.orig/debian/xserver-xorg-video-apm.links
+++ xserver-xorg-video-apm-1.2.3/debian/xserver-xorg-video-apm.links
@@ -0,0 +1 @@
+usr/share/bug/xserver-xorg-core/script usr/share/bug/xserver-xorg-video-apm/script
--- xserver-xorg-video-apm-1.2.3.orig/debian/README.source
+++ xserver-xorg-video-apm-1.2.3/debian/README.source
@@ -0,0 +1,49 @@
+------------------------------------------------------
+Quick Guide To Patching This Package For The Impatient
+------------------------------------------------------
+
+1. Make sure you have quilt installed
+2. Unpack the package as usual with "dpkg-source -x"
+3. Run the "patch" target in debian/rules
+4. Create a new patch with "quilt new" (see quilt(1))
+5. Edit all the files you want to include in the patch with "quilt edit" 
+   (see quilt(1)).
+6. Write the patch with "quilt refresh" (see quilt(1))
+7. Run the "clean" target in debian/rules
+
+Alternatively, instead of using quilt directly, you can drop the patch in to 
+debian/patches and add the name of the patch to debian/patches/series.
+
+------------------------------------
+Guide To The X Strike Force Packages
+------------------------------------
+
+The X Strike Force team maintains X packages in git repositories on
+git.debian.org in the pkg-xorg subdirectory. Most upstream packages
+are actually maintained in git repositories as well, so they often
+just need to be pulled into git.debian.org in a "upstream-*" branch.
+Otherwise, the upstream sources are manually installed in the Debian
+git repository.
+
+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.
+
+Due to X.org being highly modular, packaging all X.org applications
+as their own independent packages would have created too many Debian
+packages. For this reason, some X.org applications have been grouped
+into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils,
+x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils.
+Most packages, including the X.org server itself and all libraries
+and drivers are, however maintained independently.
+
+The Debian packaging is added by creating the "debian-*" git branch
+which contains the aforementioned "upstream-*" branch plus the debian/
+repository files.
+When a patch has to be applied to the Debian package, two solutions
+are involved:
+* If the patch is available in one of the upstream branches, it
+  may be git'cherry-picked into the Debian repository. In this
+  case, it appears directly in the .diff.gz.
+* Otherwise, the patch is added to debian/patches/ which is managed
+  with quilt as documented in /usr/share/doc/quilt/README.source.
--- xserver-xorg-video-apm-1.2.3.orig/debian/copyright
+++ xserver-xorg-video-apm-1.2.3/debian/copyright
@@ -0,0 +1,26 @@
+This package was downloaded from
+http://xorg.freedesktop.org/releases/individual/driver/
+
+Copyright (C) 1994-2003 The XFree86 Project, Inc.  All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is fur-
+nished to do so, subject to the following conditions:
+
+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, FIT-
+NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
+NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the XFree86 Project shall not
+be used in advertising or otherwise to promote the sale, use or other deal-
+ings in this Software without prior written authorization from the XFree86
+Project.
--- xserver-xorg-video-apm-1.2.3.orig/debian/changelog
+++ xserver-xorg-video-apm-1.2.3/debian/changelog
@@ -0,0 +1,270 @@
+xserver-xorg-video-apm (1:1.2.3-3.20.201403160725) ucs4-0-0-0; urgency=low
+
+  * UCS auto build. No patches were applied to the original source package
+
+ -- Univention builddaemon <buildd@univention.de>  Sun, 16 Mar 2014 07:25:01 +0100
+
+xserver-xorg-video-apm (1:1.2.3-3) unstable; urgency=low
+
+  * Merge from upstream master branch up to 21f5f7acf9 to cope with
+    the new vgaHW ABI, fixing the FTBFS against X server 1.12.
+
+ -- Cyril Brulebois <kibi@debian.org>  Tue, 01 May 2012 13:54:23 +0200
+
+xserver-xorg-video-apm (1:1.2.3-2) unstable; urgency=low
+
+  * Switch to dh:
+    - Use debhelper 8.
+    - Use dh-autoreconf.
+    - Bump xserver-xorg-dev build-dep for dh_xsf_substvars and xsf
+      debhelper sequence.
+    - Specify usr/share/man in .install, remove .manpages accordingly.
+  * Remove xsfbs accordingly.
+  * Remove long obsolete Replaces/Conflicts.
+  * Update Uploaders list. Thanks, David & Brice!
+  * Wrap Depends/Provides.
+  * Add quilt build-dep for future use.
+
+ -- Cyril Brulebois <kibi@debian.org>  Sat, 05 Feb 2011 14:41:55 +0100
+
+xserver-xorg-video-apm (1:1.2.3-1) experimental; urgency=low
+
+  [ Christopher James Halse Rogers ]
+  * New upstream release
+    - Fixes build against Xserver 1.9, which has dropped ISA support and
+      mibank.h
+  * Bump Standards-Version to 3.9.1 (no changes needed)
+
+  [ Cyril Brulebois ]
+  * Build against Xserver 1.9.1 rc1.
+
+ -- Cyril Brulebois <kibi@debian.org>  Sat, 16 Oct 2010 16:40:46 +0200
+
+xserver-xorg-video-apm (1:1.2.2-2) experimental; urgency=low
+
+  [ Julien Cristau ]
+  * Rename the build directory to not include DEB_BUILD_GNU_TYPE for no
+    good reason.  Thanks, Colin Watson!
+  * Remove myself from Uploaders
+
+  [ Cyril Brulebois ]
+  * Update to new xsfbs, replace deprecated ${xserver:Depends} with
+    ${xviddriver:Depends} in Depends, and bump B-D on xserver-xorg-dev
+    accordingly.
+  * Add myself to Uploaders.
+  * Bump Standards-Version from 3.8.3 to 3.8.4 (no changes needed).
+
+ -- Cyril Brulebois <kibi@debian.org>  Mon, 03 May 2010 22:28:38 +0200
+
+xserver-xorg-video-apm (1:1.2.2-1) experimental; urgency=low
+
+  [ David Nusinow ]
+  * Remove 01_gen_pci_ids.diff. The X server now uses a built-in table to
+    choose drivers.
+    + Disable patch system and remove quilt from build-depends
+
+  [ Timo Aaltonen ]
+  * New upstream release.
+  * Bump Standards-Version to 3.8.3.
+  * Build against Xserver 1.7.
+
+  [ Cyril Brulebois ]
+  * Upload to experimental.
+
+ -- Cyril Brulebois <kibi@debian.org>  Sun, 06 Dec 2009 03:35:21 +0100
+
+xserver-xorg-video-apm (1:1.2.1-2) unstable; urgency=low
+
+  * Upload to unstable.
+
+ -- Julien Cristau <jcristau@debian.org>  Thu, 09 Apr 2009 09:35:19 +0100
+
+xserver-xorg-video-apm (1:1.2.1-1) experimental; urgency=low
+
+  * New upstream release.
+  * Run autoreconf at build time.  Build-depend on xutils-dev, automake and
+    libtool.
+  * Handle parallel builds.
+  * Build against xserver 1.6 rc1.
+
+ -- Julien Cristau <jcristau@debian.org>  Sun, 25 Jan 2009 19:54:44 +0100
+
+xserver-xorg-video-apm (1:1.2.0-2) experimental; urgency=low
+
+  * Build against xserver 1.5.
+
+ -- Julien Cristau <jcristau@debian.org>  Thu, 04 Sep 2008 14:14:39 +0200
+
+xserver-xorg-video-apm (1:1.2.0-1) unstable; urgency=low
+
+  * New upstream release.
+  * Refresh patch 01_gen_pci_ids.diff.
+  * Bump Standards-Version to 3.7.3.
+  * Drop the XS- prefix from Vcs-* control fields.
+  * Add myself to Uploaders.
+  * Run dpkg-shlibdeps with --warnings=6.  Drivers reference symbols from
+    /usr/bin/Xorg and other modules, and that's not a bug, so we want
+    dpkg-shlibdeps to shut up about symbols it can't find.  Build-depend on
+    dpkg-dev >= 1.14.17.
+
+ -- Julien Cristau <jcristau@debian.org>  Mon, 02 Jun 2008 19:44:39 +0200
+
+xserver-xorg-video-apm (1:1.1.1-10) unstable; urgency=low
+
+  * Upload to unstable
+
+ -- David Nusinow <dnusinow@debian.org>  Sun, 16 Sep 2007 15:43:42 -0400
+
+xserver-xorg-video-apm (1:1.1.1-9) experimental; urgency=low
+
+  * Add 01_gen_pci_ids.diff
+    This patch provides a set of PCI ID's supported by this driver so that it
+    can be autoloaded by the X server
+    + Enable our patch system and add quilt as a build-dep
+
+ -- David Nusinow <dnusinow@debian.org>  Fri, 14 Sep 2007 00:53:11 -0400
+
+xserver-xorg-video-apm (1:1.1.1-8) experimental; urgency=low
+
+  * Build against xserver 1.4.
+  * Add upstream URL to debian/copyright.
+  * Add myself to uploaders, and remove Branden with his permission.
+
+ -- Brice Goglin <bgoglin@debian.org>  Thu, 13 Sep 2007 08:35:51 +0200
+
+xserver-xorg-video-apm (1:1.1.1-7) unstable; urgency=low
+
+  [ Timo Aaltonen ]
+  * Replaces/Conflicts: xserver-xorg-driver-apm.
+
+  [ Brice Goglin ]
+  * Install the upstream changelog.
+  * Bump Build-Depends: xserver-xorg-dev to >= 2:1.2.99.902
+    (needed to let xsfbs get access to serverminver).
+
+ -- Julien Cristau <jcristau@debian.org>  Wed, 02 May 2007 14:08:01 +0200
+
+xserver-xorg-video-apm (1:1.1.1-6) unstable; urgency=low
+
+  [ Julien Cristau ]
+  * Add XS-Vcs-*.
+  * Remove Fabio from Uploaders with his permission.
+  * Drop obsolete CVS information from the description.
+  * Pull some more changesets from upstream git (up to
+    5c471bae5933a3e915d8aba2dbf7c4f68c3086b7).
+  * Upload to unstable.
+
+  [ Brice Goglin ]
+  * Add a link to www.X.org and a reference to the xf86-video-apm
+    module in the long description.
+
+ -- Brice Goglin <Brice.Goglin@ens-lyon.org>  Tue, 24 Apr 2007 01:12:23 +0200
+
+xserver-xorg-video-apm (1:1.1.1-5) experimental; urgency=low
+
+  * Pull minor updates from upstream
+  * Generate server dependencies automatically from the ABI
+
+ -- David Nusinow <dnusinow@debian.org>  Wed, 21 Feb 2007 22:54:10 -0500
+
+xserver-xorg-video-apm (1:1.1.1-4) UNRELEASED; urgency=low
+
+  * Add link to xserver-xorg-core bug script, so that bugreports contain
+    the user's config and log files.
+  * Bump dependency on xserver-xorg-core to >= 2:1.1.1-11, as previous
+    versions don't have the bug script.
+
+ -- Julien Cristau <julien.cristau@ens-lyon.org>  Tue,  7 Nov 2006 07:30:39 +0100
+
+xserver-xorg-video-apm (1:1.1.1-3) unstable; urgency=low
+
+  [ Steve Langasek ]
+  * Prepare for upload to unstable
+
+  [ Drew Parsons ]
+  * Use dh_installman to install man pages.
+  * Exclude apm_drv.la from dh_install.
+  * Standards version 3.7.2.
+  * Use debhelper 5.
+
+ -- David Nusinow <dnusinow@debian.org>  Mon, 18 Sep 2006 19:57:22 -0400
+
+xserver-xorg-video-apm (1:1.1.1-2) experimental; urgency=low
+
+  * Bump xserver (build-)depends epochs to 2: to deal with botched
+    server upload
+  * Provides: xserver-xorg-video-1.0 not xserver-xorg-video.
+
+ -- David Nusinow <dnusinow@debian.org>  Wed, 23 Aug 2006 00:55:41 +0000
+
+xserver-xorg-video-apm (1:1.1.1-1) experimental; urgency=low
+
+  [ Andres Salomon ]
+  * Test for obj-$(DEB_BUILD_GNU_TYPE) before creating it during build;
+    idempotency fix.
+  * Run dh_install w/ --list-missing.
+
+  [ David Nusinow ]
+  * New upstream release
+  * Bump dependency on xserver-xorg-core to >= 1:1.1.1. Do the same thing for
+    the build-dep on xserver-xorg-dev.
+
+ -- David Nusinow <dnusinow@debian.org>  Sun,  6 Aug 2006 19:38:41 +0000
+
+xserver-xorg-video-apm (1:1.0.1.5-2) unstable; urgency=low
+
+  * Upload to modular
+
+ -- David Nusinow <dnusinow@debian.org>  Sun, 26 Mar 2006 20:25:24 -0500
+
+xserver-xorg-video-apm (1:1.0.1.5-1) experimental; urgency=low
+
+  * First upload to Debian
+  * Change source package, package, and provides names to denote the
+    type of driver and that they are for xserver-xorg
+
+ -- David Nusinow <dnusinow@debian.org>  Fri, 13 Jan 2006 00:35:22 -0500
+
+xserver-xorg-driver-apm (1:1.0.1.5-0ubuntu1) dapper; urgency=low
+
+  * New upstream release.
+  * Add provides on xserver-xorg-driver.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Wed,  4 Jan 2006 19:51:06 +1100
+
+xserver-xorg-driver-apm (1:1.0.1.4-0ubuntu1) dapper; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Mon, 19 Dec 2005 09:00:07 +1100
+
+xserver-xorg-driver-apm (1:1.0.1.3-0ubuntu1) dapper; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Mon, 12 Dec 2005 12:59:07 +1100
+
+xserver-xorg-driver-apm (1:1.0.1.2-0ubuntu2) dapper; urgency=low
+
+  * Add missing Build-Depends (x11proto-core-dev, x11proto-fonts-dev,
+    x11proto-randr-dev, x11proto-render-dev).
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Mon,  5 Dec 2005 12:51:31 +1100
+
+xserver-xorg-driver-apm (1:1.0.1.2-0ubuntu1) dapper; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Tue, 22 Nov 2005 13:24:35 +1100
+
+xserver-xorg-driver-apm (1:1.0.1.1-1) dapper; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Tue, 25 Oct 2005 16:58:05 +1000
+
+xserver-xorg-driver-apm (1:1.0.1-1) breezy; urgency=low
+
+  * First xserver-xorg-driver-apm release.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Wed,  6 Jul 2005 15:48:17 +1000
--- xserver-xorg-video-apm-1.2.3.orig/debian/control
+++ xserver-xorg-video-apm-1.2.3/debian/control
@@ -0,0 +1,39 @@
+Source: xserver-xorg-video-apm
+Section: x11
+Priority: optional
+Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
+Uploaders: Cyril Brulebois <kibi@debian.org>
+Build-Depends:
+ debhelper (>= 8),
+ dh-autoreconf,
+ quilt,
+ pkg-config,
+ xserver-xorg-dev (>= 2:1.9.4),
+ x11proto-xext-dev,
+ x11proto-video-dev,
+ x11proto-core-dev,
+ x11proto-fonts-dev,
+ x11proto-randr-dev,
+ x11proto-render-dev,
+ xutils-dev
+Standards-Version: 3.9.1
+Vcs-Git: git://git.debian.org/git/pkg-xorg/driver/xserver-xorg-video-apm
+Vcs-Browser: http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-apm.git
+
+Package: xserver-xorg-video-apm
+Architecture: any
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends},
+ ${xviddriver:Depends},
+Provides:
+ ${xviddriver:Provides}
+Description: X.Org X server -- APM display driver
+ This package provides the driver for the Alliance Pro Motion family
+ of video cards; specifically, the 6420, 6422, AT24, AT25, and AT3D
+ cards.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ .
+ This package is built from the X.org xf86-video-apm driver module.
--- xserver-xorg-video-apm-1.2.3.orig/debian/xserver-xorg-video-apm.install
+++ xserver-xorg-video-apm-1.2.3/debian/xserver-xorg-video-apm.install
@@ -0,0 +1,2 @@
+usr/lib/xorg/modules/drivers/*.so
+usr/share/man
--- xserver-xorg-video-apm-1.2.3.orig/debian/rules
+++ xserver-xorg-video-apm-1.2.3/debian/rules
@@ -0,0 +1,17 @@
+#!/usr/bin/make -f
+
+# Install in debian/tmp to retain control through dh_install:
+override_dh_auto_install:
+	dh_auto_install --destdir=debian/tmp
+
+# Kill *.la files, and forget no-one:
+override_dh_install:
+	find debian/tmp -name '*.la' -delete
+	dh_install --fail-missing
+
+# That's a plugin, use appropriate warning level:
+override_dh_shlibdeps:
+	dh_shlibdeps -- --warnings=6
+
+%:
+	dh $@ --with quilt,autoreconf,xsf --builddirectory=build/
--- xserver-xorg-video-apm-1.2.3.orig/debian/patches/series
+++ xserver-xorg-video-apm-1.2.3/debian/patches/series
@@ -0,0 +1 @@
+# placeholder
--- xserver-xorg-video-apm-1.2.3.orig/man/apm.man
+++ xserver-xorg-video-apm-1.2.3/man/apm.man
@@ -67,10 +67,6 @@
 .BI "Option \*qNoAccel\*q \*q" boolean \*q
 Disable or enable acceleration.  Default: acceleration is enabled.
 .TP
-.BI "Option \*qNoLinear\*q \*q" boolean \*q
-Disable or enable use of linear frame buffer. Default: on.
-Note: it may or may not work. Tell me if you need it.
-.TP
 .BI "Option \*qPciRetry\*q \*q" boolean \*q
 Enable or disable PCI retries.  Default: off.
 .TP
--- xserver-xorg-video-apm-1.2.3.orig/src/apm_funcs.c
+++ xserver-xorg-video-apm-1.2.3/src/apm_funcs.c
@@ -7,41 +7,15 @@
 #ifndef PSZ
 #define PSZ	8
 #endif
-#ifdef IOP_ACCESS
-#  define APM_SUFF_IOP	"_IOP"
-#  undef	RDXB
-#  undef	RDXW
-#  undef	RDXL
-#  undef	WRXB
-#  undef	WRXW
-#  undef	WRXL
-#  undef	ApmWriteSeq
-#  define RDXB	RDXB_IOP
-#  define RDXW	RDXW_IOP
-#  define RDXL	RDXL_IOP
-#  define WRXB	WRXB_IOP
-#  define WRXW	WRXW_IOP
-#  define WRXL	WRXL_IOP
-#  define ApmWriteSeq(i, v)	wrinx(pApm->xport, i, v)
-#else
-#  define APM_SUFF_IOP	""
-#endif
+
 #if PSZ == 24
 #  define APM_SUFF_24	"24"
-#  ifdef IOP_ACCESS
-#    define A(s)		Apm##s##24##_IOP
-#  else
-#    define A(s)		Apm##s##24
-#  endif
+#  define A(s)		Apm##s##24
 #else
 #  define APM_SUFF_24	""
-#  ifdef IOP_ACCESS
-#    define A(s)		Apm##s##_IOP
-#  else
-#    define A(s)		Apm##s
-#  endif
+#  define A(s)		Apm##s
 #endif
-#define	DPRINTNAME(s)	do { xf86DrvMsgVerb(pScrn->pScreen->myNum, X_NOTICE, 6, "Apm" #s APM_SUFF_24 APM_SUFF_IOP "\n"); } while (0)
+#define	DPRINTNAME(s)	do { xf86DrvMsgVerb(pScrn->pScreen->myNum, X_NOTICE, 6, "Apm" #s APM_SUFF_24 "\n"); } while (0)
 
 #if PSZ == 24
 #undef SETSOURCEXY
@@ -1495,7 +1469,7 @@
 
     WRXB(0x1FF, 0);
     if (!xf86ServerIsExiting())
-	FatalError("Hung in ApmSync" APM_SUFF_24 APM_SUFF_IOP "(%d) (Status = 0x%08X)\n", pScrn->pScreen->myNum, status);
+	FatalError("Hung in ApmSync" APM_SUFF_24 "(%d) (Status = 0x%08X)\n", pScrn->pScreen->myNum, status);
   }
   if (pApm->apmClip) {
     SETCLIP_CTRL(0);
@@ -1559,6 +1533,4 @@
 #undef A
 #undef DEPTH
 #undef PSZ
-#undef IOP_ACCESS
 #undef APM_SUFF_24
-#undef APM_SUFF_IOP
--- xserver-xorg-video-apm-1.2.3.orig/src/apm_video.c
+++ xserver-xorg-video-apm-1.2.3/src/apm_video.c
@@ -19,7 +19,6 @@
 
 static void	A(StopVideo)(ScrnInfoPtr, pointer, Bool);
 static int	A(SetPortAttribute)(ScrnInfoPtr, Atom, INT32, pointer);
-#ifndef IOP_ACCESS
 static int	ApmGetPortAttribute(ScrnInfoPtr, Atom ,INT32 *, pointer);
 static void	ApmQueryBestSize(ScrnInfoPtr, Bool, short, short, short,
 				    short, unsigned int *, unsigned int *,
@@ -27,7 +26,6 @@
 static int	ApmQueryImageAttributes(ScrnInfoPtr, int,
 					    unsigned short *, unsigned short *,
 					    int *, int *);
-#endif
 static int	A(ReputImage)(ScrnInfoPtr, short, short, RegionPtr, pointer,
 				DrawablePtr);
 static int	A(PutImage)(ScrnInfoPtr, short, short, short, short, short,
@@ -358,7 +356,6 @@
     return adapt;
 }
 
-#ifndef IOP_ACCESS
 /* ApmClipVideo -
 
    Takes the dst box in standard X BoxRec form (top and left
@@ -420,7 +417,6 @@
     else
 	*scaley = ((*y2 - *y1) / (dst->y2 - dst->y1)) >> 4;
 }
-#endif
 
 static void
 A(StopVideo)(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
@@ -457,7 +453,6 @@
   return Success;
 }
 
-#ifndef IOP_ACCESS
 static int
 ApmGetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 *value,
 		      pointer data)
@@ -485,7 +480,6 @@
     *p_w = drw_w & round;
     *p_h = drw_h & round;
 }
-#endif
 
 static void A(XvMoveCB)(FBAreaPtr area1, FBAreaPtr area2)
 {
@@ -903,7 +897,6 @@
     return Success;
 }
 
-#ifndef IOP_ACCESS
 static int
 ApmQueryImageAttributes(ScrnInfoPtr pScrn, int id,
 			  unsigned short *w, unsigned short *h,
@@ -949,5 +942,5 @@
 
     return size;
 }
-#endif
+
 #endif
--- xserver-xorg-video-apm-1.2.3.orig/src/apm_dga.c
+++ xserver-xorg-video-apm-1.2.3/src/apm_dga.c
@@ -316,18 +316,10 @@
 	 * This is just an attempt, because Daryll is tampering with MY
 	 * registers.
 	 */
-	if (!pApm->noLinear) {
-	    tmp = (RDXB(0xDB) & 0xF4) |  0x0A;
-	    WRXB(0xDB, tmp);
-	    ApmWriteSeq(0x1B, 0x20);
-	    ApmWriteSeq(0x1C, 0x2F);
-	}
-	else {
-	    tmp = (RDXB_IOP(0xDB) & 0xF4) |  0x0A;
-	    WRXB_IOP(0xDB, tmp);
-	    wrinx(pApm->xport, 0x1B, 0x20);
-	    wrinx(pApm->xport, 0x1C, 0x2F);
-	}
+	tmp = (RDXB(0xDB) & 0xF4) |  0x0A;
+	WRXB(0xDB, tmp);
+	ApmWriteSeq(0x1B, 0x20);
+	ApmWriteSeq(0x1C, 0x2F);
 	pApm->apmLock = FALSE;
     }
     pScrn->AdjustFrame(pScrn->pScreen->myNum, x, y, flags);
--- xserver-xorg-video-apm-1.2.3.orig/src/apm.h
+++ xserver-xorg-video-apm-1.2.3/src/apm.h
@@ -109,14 +109,13 @@
     char		*MemMap;
     pointer		BltMap;
     Bool		UnlockCalled;
-    IOADDRESS		iobase, xport, xbase;
+    unsigned long	iobase, xport, xbase;
     unsigned char	savedSR10;
     CARD8		MiscOut;
     CARD8		c9, d9, db, Rush;
     unsigned int	saveCmd;
     pointer		FontInfo;
     Bool		hwCursor;
-    Bool		noLinear;
     ApmRegStr		ModeReg, SavedReg;
     CloseScreenProcPtr	CloseScreen;
     Bool		UsePCIRetry;  /* Do we use PCI-retry or busy-waiting */
--- xserver-xorg-video-apm-1.2.3.orig/src/apm_accel.c
+++ xserver-xorg-video-apm-1.2.3/src/apm_accel.c
@@ -32,14 +32,7 @@
 
 #include "apm_funcs.c"
 
-#define IOP_ACCESS
-#include "apm_funcs.c"
-
-#define PSZ	24
-#include "apm_funcs.c"
-
 #define PSZ	24
-#define IOP_ACCESS
 #include "apm_funcs.c"
 
 static void
@@ -279,21 +272,11 @@
 	i = 4;
     else
 	i = 8;
-    if (pApm->noLinear) {
-	stat = RDXL_IOP(0x1FC);
-	while ((stat & (STATUS_HOSTBLTBUSY | STATUS_ENGINEBUSY)) ||
-		((stat & STATUS_FIFO) < i)) {
-	    WRXB_IOP(0x1FC, 0);
-	    stat = RDXL_IOP(0x1FC);
-	}
-    }
-    else {
+    stat = RDXL_M(0x1FC);
+    while ((stat & (STATUS_HOSTBLTBUSY | STATUS_ENGINEBUSY)) ||
+	    ((stat & STATUS_FIFO) < i)) {
+	WRXB_M(0x1FC, 0);
 	stat = RDXL_M(0x1FC);
-	while ((stat & (STATUS_HOSTBLTBUSY | STATUS_ENGINEBUSY)) ||
-		((stat & STATUS_FIFO) < i)) {
-	    WRXB_M(0x1FC, 0);
-	    stat = RDXL_M(0x1FC);
-	}
     }
 
     /* Setup current register values */
@@ -316,26 +299,14 @@
 
     ApmSetupXAAInfo(pApm, pXAAinfo);
 
-    if (!pApm->noLinear) {
-	pApm->SetupForSolidFill			= ApmSetupForSolidFill;
-	pApm->SubsequentSolidFillRect		= ApmSubsequentSolidFillRect;
-	pApm->SetupForSolidFill24		= ApmSetupForSolidFill24;
-	pApm->SubsequentSolidFillRect24		= ApmSubsequentSolidFillRect24;
-	pApm->SetupForScreenToScreenCopy	= ApmSetupForScreenToScreenCopy;
-	pApm->SubsequentScreenToScreenCopy	= ApmSubsequentScreenToScreenCopy;
-	pApm->SetupForScreenToScreenCopy24	= ApmSetupForScreenToScreenCopy24;
-	pApm->SubsequentScreenToScreenCopy24	= ApmSubsequentScreenToScreenCopy24;
-    }
-    else {
-	pApm->SetupForSolidFill			= ApmSetupForSolidFill_IOP;
-	pApm->SubsequentSolidFillRect		= ApmSubsequentSolidFillRect_IOP;
-	pApm->SetupForSolidFill24		= ApmSetupForSolidFill24_IOP;
-	pApm->SubsequentSolidFillRect24		= ApmSubsequentSolidFillRect24_IOP;
-	pApm->SetupForScreenToScreenCopy	= ApmSetupForScreenToScreenCopy_IOP;
-	pApm->SubsequentScreenToScreenCopy	= ApmSubsequentScreenToScreenCopy_IOP;
-	pApm->SetupForScreenToScreenCopy24	= ApmSetupForScreenToScreenCopy24_IOP;
-	pApm->SubsequentScreenToScreenCopy24	= ApmSubsequentScreenToScreenCopy24_IOP;
-    }
+    pApm->SetupForSolidFill		= ApmSetupForSolidFill;
+    pApm->SubsequentSolidFillRect	= ApmSubsequentSolidFillRect;
+    pApm->SetupForSolidFill24		= ApmSetupForSolidFill24;
+    pApm->SubsequentSolidFillRect24	= ApmSubsequentSolidFillRect24;
+    pApm->SetupForScreenToScreenCopy	= ApmSetupForScreenToScreenCopy;
+    pApm->SubsequentScreenToScreenCopy	= ApmSubsequentScreenToScreenCopy;
+    pApm->SetupForScreenToScreenCopy24	= ApmSetupForScreenToScreenCopy24;
+    pApm->SubsequentScreenToScreenCopy24= ApmSubsequentScreenToScreenCopy24;
 
     /*
      * Init Rush extension.
@@ -427,334 +398,168 @@
     pXAAinfo->CacheMonoStipple = ApmCacheMonoStipple;
 
     if (pApm->CurrentLayout.bitsPerPixel != 24) {
-	if (!pApm->noLinear) {
 #define	XAA(s)		pXAAinfo->s = Apm##s
-	    if (pApm->Chipset < AT24)
-		pXAAinfo->Sync = ApmSync6422;
-	    else
-		XAA(Sync);
-
-	    /* Accelerated filled rectangles */
-	    pXAAinfo->SolidFillFlags = NO_PLANEMASK;
-	    XAA(SetupForSolidFill);
-	    XAA(SubsequentSolidFillRect);
-
-	    /* Accelerated screen to screen color expansion */
-	    pXAAinfo->ScreenToScreenColorExpandFillFlags = NO_PLANEMASK;
-	    XAA(SetupForScreenToScreenColorExpandFill);
-	    XAA(SubsequentScreenToScreenColorExpandFill);
-
-#if 0
-	    The constraints of the transfer range are incompatible with the
-	    XAA architecture. I rewrote the XAA functions using ImageWrite
-	    /* Accelerated CPU to screen color expansion */
-	    if ((pApm->Chipset == AT24 && pApm->ChipRev >= 4) ||
-		    pApm->Chipset == AT3D) {
-		pXAAinfo->CPUToScreenColorExpandFillFlags =
-		  NO_PLANEMASK | SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD
-		  | BIT_ORDER_IN_BYTE_MSBFIRST | LEFT_EDGE_CLIPPING |
-		  LEFT_EDGE_CLIPPING_NEGATIVE_X | SYNC_AFTER_COLOR_EXPAND;
-		XAA(SetupForCPUToScreenColorExpandFill);
-		XAA(SubsequentCPUToScreenColorExpandFill);
-		pXAAinfo->ColorExpandBase	= pApm->BltMap;
-		pXAAinfo->ColorExpandRange	= (pApm->Chipset >= AT3D) ? 32*1024 : 30*1024;
-	    }
-
-	    /* Accelerated image transfers */
-	    pXAAinfo->ImageWriteFlags	=
-			    LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X |
-			    SYNC_AFTER_IMAGE_WRITE;
-	    pXAAinfo->ImageWriteBase	= pApm->BltMap;
-	    pXAAinfo->ImageWriteRange	= (pApm->Chipset >= AT3D) ? 32*1024 : 30*1024;
-	    XAA(SetupForImageWrite);
-	    XAA(SubsequentImageWriteRect);
-#endif
-	    pXAAinfo->WritePixmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(WritePixmap);
-	    pXAAinfo->FillImageWriteRectsFlags	=
-			    LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(FillImageWriteRects);
-	    pXAAinfo->WriteBitmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X |
-			    BIT_ORDER_IN_BYTE_LSBFIRST;
-	    XAA(WriteBitmap);
-	    pXAAinfo->TEGlyphRendererFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(TEGlyphRenderer);
-
-	    /* Accelerated screen-screen bitblts */
-	    pXAAinfo->ScreenToScreenCopyFlags = NO_PLANEMASK;
-	    XAA(SetupForScreenToScreenCopy);
-	    XAA(SubsequentScreenToScreenCopy);
-
-	    /* Accelerated Line drawing */
-	    pXAAinfo->SolidLineFlags = NO_PLANEMASK | HARDWARE_CLIP_LINE;
-	    XAA(SetClippingRectangle);
-	    pXAAinfo->SolidBresenhamLineErrorTermBits = 15;
-
-	    if (pApm->Chipset >= AT24) {
-		XAA(SubsequentSolidBresenhamLine);
-
-		/* Pattern fill */
-		pXAAinfo->Mono8x8PatternFillFlags = NO_PLANEMASK |
-				HARDWARE_PATTERN_PROGRAMMED_BITS |
-				HARDWARE_PATTERN_SCREEN_ORIGIN;
-		XAA(SetupForMono8x8PatternFill);
-		XAA(SubsequentMono8x8PatternFillRect);
-		if (pApm->CurrentLayout.bitsPerPixel == 8) {
-		    pXAAinfo->Color8x8PatternFillFlags = NO_PLANEMASK |
-				    HARDWARE_PATTERN_SCREEN_ORIGIN;
-		    XAA(SetupForColor8x8PatternFill);
-		    XAA(SubsequentColor8x8PatternFillRect);
-		}
-	    }
-	    else
-		pXAAinfo->SubsequentSolidBresenhamLine =
-		    ApmSubsequentSolidBresenhamLine6422;
-#undef XAA
-	}
-	else {
-#define	XAA(s)		pXAAinfo->s = Apm##s##_IOP
-	    if (pApm->Chipset < AT24)
-		pXAAinfo->Sync = ApmSync6422_IOP;
-	    else
-		XAA(Sync);
-
-	    /* Accelerated filled rectangles */
-	    pXAAinfo->SolidFillFlags = NO_PLANEMASK;
-	    XAA(SetupForSolidFill);
-	    XAA(SubsequentSolidFillRect);
-
-	    /* Accelerated screen to screen color expansion */
-	    pXAAinfo->ScreenToScreenColorExpandFillFlags = NO_PLANEMASK;
-	    XAA(SetupForScreenToScreenColorExpandFill);
-	    XAA(SubsequentScreenToScreenColorExpandFill);
-
-#if 0
-	    The constraints of the transfer range are incompatible with the
-	    XAA architecture. I rewrote the XAA functions using ImageWrite
-	    /* Accelerated CPU to screen color expansion */
-	    if ((pApm->Chipset == AT24 && pApm->ChipRev >= 4) ||
-		    pApm->Chipset == AT3D) {
-		pXAAinfo->CPUToScreenColorExpandFillFlags =
-		  NO_PLANEMASK | SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD
-		  | BIT_ORDER_IN_BYTE_MSBFIRST | LEFT_EDGE_CLIPPING |
-		  LEFT_EDGE_CLIPPING_NEGATIVE_X | SYNC_AFTER_COLOR_EXPAND;
-		XAA(SetupForCPUToScreenColorExpandFill);
-		XAA(SubsequentCPUToScreenColorExpandFill);
-		pXAAinfo->ColorExpandBase	= pApm->BltMap;
-		pXAAinfo->ColorExpandRange	= (pApm->Chipset >= AT3D) ? 32*1024 : 30*1024;
-	    }
-
-	    /* Accelerated image transfers */
-	    pXAAinfo->ImageWriteFlags	=
-			    LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD;
-	    pXAAinfo->ImageWriteBase	= pApm->BltMap;
-	    pXAAinfo->ImageWriteRange	= (pApm->Chipset >= AT3D) ? 32*1024 : 30*1024;
-	    XAA(SetupForImageWrite);
-	    XAA(SubsequentImageWriteRect);
-#endif
-	    pXAAinfo->WritePixmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(WritePixmap);
-	    pXAAinfo->FillImageWriteRectsFlags	=
-			    LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(FillImageWriteRects);
-	    pXAAinfo->WriteBitmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X |
-			    BIT_ORDER_IN_BYTE_LSBFIRST;
-	    XAA(WriteBitmap);
-	    pXAAinfo->TEGlyphRendererFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(TEGlyphRenderer);
-
-	    /* Accelerated screen-screen bitblts */
-	    pXAAinfo->ScreenToScreenCopyFlags = NO_PLANEMASK;
-	    XAA(SetupForScreenToScreenCopy);
-	    XAA(SubsequentScreenToScreenCopy);
-
-	    /* Accelerated Line drawing */
-	    pXAAinfo->SolidLineFlags = NO_PLANEMASK | HARDWARE_CLIP_LINE;
-	    XAA(SetClippingRectangle);
-	    pXAAinfo->SolidBresenhamLineErrorTermBits = 15;
-
-	    if (pApm->Chipset >= AT24) {
-		XAA(SubsequentSolidBresenhamLine);
-
-		/* Pattern fill */
-		pXAAinfo->Mono8x8PatternFillFlags = NO_PLANEMASK |
-				HARDWARE_PATTERN_PROGRAMMED_BITS |
-				HARDWARE_PATTERN_SCREEN_ORIGIN;
-		XAA(SetupForMono8x8PatternFill);
-		XAA(SubsequentMono8x8PatternFillRect);
-		if (pApm->CurrentLayout.bitsPerPixel == 8) {
-		    pXAAinfo->Color8x8PatternFillFlags = NO_PLANEMASK |
-				    HARDWARE_PATTERN_SCREEN_ORIGIN;
-		    XAA(SetupForColor8x8PatternFill);
-		    XAA(SubsequentColor8x8PatternFillRect);
-		}
-	    }
-	    else
-		pXAAinfo->SubsequentSolidBresenhamLine =
-		    ApmSubsequentSolidBresenhamLine6422_IOP;
-#undef XAA
-	}
-    }
-    else {
-	if (!pApm->noLinear) {
-#define	XAA(s)		pXAAinfo->s = Apm##s##24
+	if (pApm->Chipset < AT24)
+	    pXAAinfo->Sync = ApmSync6422;
+	else
 	    XAA(Sync);
 
-	    /* Accelerated filled rectangles */
-	    pXAAinfo->SolidFillFlags = NO_PLANEMASK;
-	    XAA(SetupForSolidFill);
-	    XAA(SubsequentSolidFillRect);
+	/* Accelerated filled rectangles */
+	pXAAinfo->SolidFillFlags = NO_PLANEMASK;
+	XAA(SetupForSolidFill);
+	XAA(SubsequentSolidFillRect);
+
+	/* Accelerated screen to screen color expansion */
+	pXAAinfo->ScreenToScreenColorExpandFillFlags = NO_PLANEMASK;
+	XAA(SetupForScreenToScreenColorExpandFill);
+	XAA(SubsequentScreenToScreenColorExpandFill);
 
 #if 0
-	    /* Accelerated screen to screen color expansion */
-	    pXAAinfo->ScreenToScreenColorExpandFillFlags = NO_PLANEMASK;
-	    XAA(SetupForScreenToScreenColorExpandFill);
-	    XAA(SubsequentScreenToScreenColorExpandFill);
-
-#if 0
-	    The constraints of the transfer range are incompatible with the
-	    XAA architecture. I rewrote the XAA functions using ImageWrite
-	    /* Accelerated CPU to screen color expansion */
-	    if (pApm->Chipset == AT3D && pApm->ChipRev >= 4) {
-		pXAAinfo->CPUToScreenColorExpandFillFlags =
-		  NO_PLANEMASK | SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD
-		  | BIT_ORDER_IN_BYTE_MSBFIRST | LEFT_EDGE_CLIPPING |
-		  LEFT_EDGE_CLIPPING_NEGATIVE_X | SYNC_AFTER_COLOR_EXPAND;
-		XAA(SetupForCPUToScreenColorExpandFill);
-		XAA(SubsequentCPUToScreenColorExpandFill);
-		pXAAinfo->ColorExpandBase	= pApm->BltMap;
-		pXAAinfo->ColorExpandRange	= 32*1024;
-	    }
-
-	    /* Accelerated image transfers */
-	    pXAAinfo->ImageWriteFlags	=
-			    LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD |
-			    SYNC_AFTER_IMAGE_WRITE;
-	    pXAAinfo->ImageWriteBase	= pApm->BltMap;
-	    pXAAinfo->ImageWriteRange	= 32*1024;
-	    XAA(SetupForImageWrite);
-	    XAA(SubsequentImageWriteRect);
+	The constraints of the transfer range are incompatible with the
+	XAA architecture. I rewrote the XAA functions using ImageWrite
+	/* Accelerated CPU to screen color expansion */
+	if ((pApm->Chipset == AT24 && pApm->ChipRev >= 4) ||
+		pApm->Chipset == AT3D) {
+	    pXAAinfo->CPUToScreenColorExpandFillFlags =
+	      NO_PLANEMASK | SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD
+	      | BIT_ORDER_IN_BYTE_MSBFIRST | LEFT_EDGE_CLIPPING |
+	      LEFT_EDGE_CLIPPING_NEGATIVE_X | SYNC_AFTER_COLOR_EXPAND;
+	    XAA(SetupForCPUToScreenColorExpandFill);
+	    XAA(SubsequentCPUToScreenColorExpandFill);
+	    pXAAinfo->ColorExpandBase	= pApm->BltMap;
+	    pXAAinfo->ColorExpandRange	= (pApm->Chipset >= AT3D) ? 32*1024 : 30*1024;
+	}
+
+	/* Accelerated image transfers */
+	pXAAinfo->ImageWriteFlags	=
+			LEFT_EDGE_CLIPPING | NO_PLANEMASK |
+			SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD |
+			LEFT_EDGE_CLIPPING_NEGATIVE_X |
+			SYNC_AFTER_IMAGE_WRITE;
+	pXAAinfo->ImageWriteBase	= pApm->BltMap;
+	pXAAinfo->ImageWriteRange	= (pApm->Chipset >= AT3D) ? 32*1024 : 30*1024;
+	XAA(SetupForImageWrite);
+	XAA(SubsequentImageWriteRect);
 #endif
-	    pXAAinfo->WritePixmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(WritePixmap);
-	    pXAAinfo->FillImageWriteRectsFlags	=
-			    LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(FillImageWriteRects);
-	    pXAAinfo->WriteBitmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X |
-			    BIT_ORDER_IN_BYTE_LSBFIRST;
-	    XAA(WriteBitmap);
-	    pXAAinfo->TEGlyphRendererFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(TEGlyphRenderer);
+	pXAAinfo->WritePixmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
+			LEFT_EDGE_CLIPPING_NEGATIVE_X;
+	XAA(WritePixmap);
+	pXAAinfo->FillImageWriteRectsFlags	=
+			LEFT_EDGE_CLIPPING | NO_PLANEMASK |
+			LEFT_EDGE_CLIPPING_NEGATIVE_X;
+	XAA(FillImageWriteRects);
+	pXAAinfo->WriteBitmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
+			LEFT_EDGE_CLIPPING_NEGATIVE_X |
+			BIT_ORDER_IN_BYTE_LSBFIRST;
+	XAA(WriteBitmap);
+	pXAAinfo->TEGlyphRendererFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
+			LEFT_EDGE_CLIPPING_NEGATIVE_X;
+	XAA(TEGlyphRenderer);
+
+	/* Accelerated screen-screen bitblts */
+	pXAAinfo->ScreenToScreenCopyFlags = NO_PLANEMASK;
+	XAA(SetupForScreenToScreenCopy);
+	XAA(SubsequentScreenToScreenCopy);
+
+	/* Accelerated Line drawing */
+	pXAAinfo->SolidLineFlags = NO_PLANEMASK | HARDWARE_CLIP_LINE;
+	XAA(SetClippingRectangle);
+	pXAAinfo->SolidBresenhamLineErrorTermBits = 15;
 
-	    /* Accelerated Line drawing */
-	    pXAAinfo->SolidLineFlags = NO_PLANEMASK | HARDWARE_CLIP_LINE;
+	if (pApm->Chipset >= AT24) {
 	    XAA(SubsequentSolidBresenhamLine);
-	    XAA(SetClippingRectangle);
-	    pXAAinfo->SolidBresenhamLineErrorTermBits = 15;
 
 	    /* Pattern fill */
-	    pXAAinfo->Mono8x8PatternFillFlags = NO_PLANEMASK | NO_TRANSPARENCY |
+	    pXAAinfo->Mono8x8PatternFillFlags = NO_PLANEMASK |
 			    HARDWARE_PATTERN_PROGRAMMED_BITS |
 			    HARDWARE_PATTERN_SCREEN_ORIGIN;
 	    XAA(SetupForMono8x8PatternFill);
 	    XAA(SubsequentMono8x8PatternFillRect);
-#endif
-
-	    /* Accelerated screen-screen bitblts */
-	    pXAAinfo->ScreenToScreenCopyFlags = NO_PLANEMASK | NO_TRANSPARENCY;
-	    XAA(SetupForScreenToScreenCopy);
-	    XAA(SubsequentScreenToScreenCopy);
-#undef XAA
+	    if (pApm->CurrentLayout.bitsPerPixel == 8) {
+		pXAAinfo->Color8x8PatternFillFlags = NO_PLANEMASK |
+				HARDWARE_PATTERN_SCREEN_ORIGIN;
+		XAA(SetupForColor8x8PatternFill);
+		XAA(SubsequentColor8x8PatternFillRect);
+	    }
 	}
-	else {
-#define	XAA(s)		pXAAinfo->s = Apm##s##24##_IOP
-	    XAA(Sync);
+	else
+	    pXAAinfo->SubsequentSolidBresenhamLine =
+		ApmSubsequentSolidBresenhamLine6422;
+#undef XAA
+    }
+    else {
+#define	XAA(s)		pXAAinfo->s = Apm##s##24
+	XAA(Sync);
 
-	    /* Accelerated filled rectangles */
-	    pXAAinfo->SolidFillFlags = NO_PLANEMASK;
-	    XAA(SetupForSolidFill);
-	    XAA(SubsequentSolidFillRect);
+	/* Accelerated filled rectangles */
+	pXAAinfo->SolidFillFlags = NO_PLANEMASK;
+	XAA(SetupForSolidFill);
+	XAA(SubsequentSolidFillRect);
 
 #if 0
-	    /* Accelerated screen to screen color expansion */
-	    pXAAinfo->ScreenToScreenColorExpandFillFlags = NO_PLANEMASK;
-	    XAA(SetupForScreenToScreenColorExpandFill);
-	    XAA(SubsequentScreenToScreenColorExpandFill);
+	/* Accelerated screen to screen color expansion */
+	pXAAinfo->ScreenToScreenColorExpandFillFlags = NO_PLANEMASK;
+	XAA(SetupForScreenToScreenColorExpandFill);
+	XAA(SubsequentScreenToScreenColorExpandFill);
 
 #if 0
-	    The constraints of the transfer range are incompatible with the
-	    XAA architecture. I rewrote the XAA functions using ImageWrite
-	    /* Accelerated CPU to screen color expansion */
-	    if (pApm->Chipset == AT3D && pApm->ChipRev >= 4) {
-		pXAAinfo->CPUToScreenColorExpandFillFlags =
-		  NO_PLANEMASK | SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD
-		  | BIT_ORDER_IN_BYTE_MSBFIRST | LEFT_EDGE_CLIPPING |
-		  LEFT_EDGE_CLIPPING_NEGATIVE_X | SYNC_AFTER_COLOR_EXPAND;
-		XAA(SetupForCPUToScreenColorExpandFill);
-		XAA(SubsequentCPUToScreenColorExpandFill);
-		pXAAinfo->ColorExpandBase	= pApm->BltMap;
-		pXAAinfo->ColorExpandRange	= 32*1024;
-	    }
-
-	    /* Accelerated image transfers */
-	    pXAAinfo->ImageWriteFlags	=
-			    LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD;
-	    pXAAinfo->ImageWriteBase	= pApm->BltMap;
-	    pXAAinfo->ImageWriteRange	= 32*1024;
-	    XAA(SetupForImageWrite);
-	    XAA(SubsequentImageWriteRect);
+	The constraints of the transfer range are incompatible with the
+	XAA architecture. I rewrote the XAA functions using ImageWrite
+	/* Accelerated CPU to screen color expansion */
+	if (pApm->Chipset == AT3D && pApm->ChipRev >= 4) {
+	    pXAAinfo->CPUToScreenColorExpandFillFlags =
+	      NO_PLANEMASK | SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD
+	      | BIT_ORDER_IN_BYTE_MSBFIRST | LEFT_EDGE_CLIPPING |
+	      LEFT_EDGE_CLIPPING_NEGATIVE_X | SYNC_AFTER_COLOR_EXPAND;
+	    XAA(SetupForCPUToScreenColorExpandFill);
+	    XAA(SubsequentCPUToScreenColorExpandFill);
+	    pXAAinfo->ColorExpandBase	= pApm->BltMap;
+	    pXAAinfo->ColorExpandRange	= 32*1024;
+	}
+
+	/* Accelerated image transfers */
+	pXAAinfo->ImageWriteFlags	=
+			LEFT_EDGE_CLIPPING | NO_PLANEMASK |
+			SCANLINE_PAD_DWORD | CPU_TRANSFER_PAD_QWORD |
+			SYNC_AFTER_IMAGE_WRITE;
+	pXAAinfo->ImageWriteBase	= pApm->BltMap;
+	pXAAinfo->ImageWriteRange	= 32*1024;
+	XAA(SetupForImageWrite);
+	XAA(SubsequentImageWriteRect);
 #endif
-	    pXAAinfo->WritePixmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(WritePixmap);
-	    pXAAinfo->FillImageWriteRectsFlags	=
-			    LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(FillImageWriteRects);
-	    pXAAinfo->WriteBitmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X |
-			    BIT_ORDER_IN_BYTE_LSBFIRST;
-	    XAA(WriteBitmap);
-	    pXAAinfo->TEGlyphRendererFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
-			    LEFT_EDGE_CLIPPING_NEGATIVE_X;
-	    XAA(TEGlyphRenderer);
-
-	    /* Accelerated Line drawing */
-	    pXAAinfo->SolidLineFlags = NO_PLANEMASK | HARDWARE_CLIP_LINE;
-	    XAA(SubsequentSolidBresenhamLine);
-	    XAA(SetClippingRectangle);
-	    pXAAinfo->SolidBresenhamLineErrorTermBits = 15;
-
-	    /* Pattern fill */
-	    pXAAinfo->Mono8x8PatternFillFlags = NO_PLANEMASK | NO_TRANSPARENCY |
-			    HARDWARE_PATTERN_PROGRAMMED_BITS |
-			    HARDWARE_PATTERN_SCREEN_ORIGIN;
-	    XAA(SetupForMono8x8PatternFill);
-	    XAA(SubsequentMono8x8PatternFillRect);
+	pXAAinfo->WritePixmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
+			LEFT_EDGE_CLIPPING_NEGATIVE_X;
+	XAA(WritePixmap);
+	pXAAinfo->FillImageWriteRectsFlags	=
+			LEFT_EDGE_CLIPPING | NO_PLANEMASK |
+			LEFT_EDGE_CLIPPING_NEGATIVE_X;
+	XAA(FillImageWriteRects);
+	pXAAinfo->WriteBitmapFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
+			LEFT_EDGE_CLIPPING_NEGATIVE_X |
+			BIT_ORDER_IN_BYTE_LSBFIRST;
+	XAA(WriteBitmap);
+	pXAAinfo->TEGlyphRendererFlags = LEFT_EDGE_CLIPPING | NO_PLANEMASK |
+			LEFT_EDGE_CLIPPING_NEGATIVE_X;
+	XAA(TEGlyphRenderer);
+
+	/* Accelerated Line drawing */
+	pXAAinfo->SolidLineFlags = NO_PLANEMASK | HARDWARE_CLIP_LINE;
+	XAA(SubsequentSolidBresenhamLine);
+	XAA(SetClippingRectangle);
+	pXAAinfo->SolidBresenhamLineErrorTermBits = 15;
+
+	/* Pattern fill */
+	pXAAinfo->Mono8x8PatternFillFlags = NO_PLANEMASK | NO_TRANSPARENCY |
+			HARDWARE_PATTERN_PROGRAMMED_BITS |
+			HARDWARE_PATTERN_SCREEN_ORIGIN;
+	XAA(SetupForMono8x8PatternFill);
+	XAA(SubsequentMono8x8PatternFillRect);
 #endif
 
-	    /* Accelerated screen-screen bitblts */
-	    pXAAinfo->ScreenToScreenCopyFlags = NO_PLANEMASK | NO_TRANSPARENCY;
-	    XAA(SetupForScreenToScreenCopy);
-	    XAA(SubsequentScreenToScreenCopy);
+	/* Accelerated screen-screen bitblts */
+	pXAAinfo->ScreenToScreenCopyFlags = NO_PLANEMASK | NO_TRANSPARENCY;
+	XAA(SetupForScreenToScreenCopy);
+	XAA(SubsequentScreenToScreenCopy);
 #undef XAA
-	}
     }
 }
--- xserver-xorg-video-apm-1.2.3.orig/src/apm_driver.c
+++ xserver-xorg-video-apm-1.2.3/src/apm_driver.c
@@ -200,7 +200,7 @@
 static void
 ApmUnlock(ApmPtr pApm)
 {
-    if (pApm->Chipset >= AT3D && !pApm->noLinear)
+    if (pApm->Chipset >= AT3D)
 	ApmWriteSeq(0x10, 0x12);
     else
 	wrinx(pApm->xport, 0x10, 0x12);
@@ -210,7 +210,7 @@
 static void
 ApmLock(ApmPtr pApm)
 {
-    if (pApm->Chipset >= AT3D && !pApm->noLinear)
+    if (pApm->Chipset >= AT3D)
 	ApmWriteSeq(0x10, pApm->savedSR10 ? 0 : 0x12);
     else
 	wrinx(pApm->xport, 0x10, pApm->savedSR10 ? 0 : 0x12);
@@ -417,9 +417,16 @@
 	return FALSE;
 
     hwp = VGAHWPTR(pScrn);
+    vgaHWSetStdFuncs(hwp);
     vgaHWGetIOBase(hwp);
-    pApm->iobase = hwp->PIOOffset;
-    pApm->xport = hwp->PIOOffset + 0x3C4;
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
+#define PIOOFFSET hwp->PIOOffset
+#else
+/* FIXME reintroduce domain support */
+#define PIOOFFSET 0
+#endif
+    pApm->iobase = PIOOFFSET;
+    pApm->xport = PIOOFFSET + 0x3C4;
 
     /* Set pScrn->monitor */
     pScrn->monitor = pScrn->confScreen->monitor;
@@ -494,21 +501,11 @@
 	/* Default to 8 */
 	pScrn->rgbBits = 8;
     }
-#ifndef XSERVER_LIBPCIACCESS
-    /* you're getting a linear framebuffer with pciaccess */
-    if (xf86ReturnOptValBool(pApm->Options, OPTION_NOLINEAR, FALSE)) {
-	pApm->noLinear = TRUE;
-	xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "No linear framebuffer\n");
-    }
-#else
-    pApm->noLinear = FALSE;
-#endif
     from = X_DEFAULT;
     pApm->hwCursor = FALSE;
     if (xf86GetOptValBool(pApm->Options, OPTION_HW_CURSOR, &pApm->hwCursor))
 	from = X_CONFIG;
-    if (pApm->noLinear ||
-	xf86ReturnOptValBool(pApm->Options, OPTION_SW_CURSOR, FALSE)) {
+    if (xf86ReturnOptValBool(pApm->Options, OPTION_SW_CURSOR, FALSE)) {
 	from = X_CONFIG;
 	pApm->hwCursor = FALSE;
     }
@@ -683,23 +680,11 @@
 	}
     }
 
-    if (pApm->noLinear) {
-	/*
-	 * TODO not AT3D.
-	 * XXX ICI XXX
-	 */
-	pApm->LinMapSize      =  4 * 1024 * 1024 /* 0x10000 */;
-	pApm->FbMapSize       =  4 * 1024 * 1024 /* 0x10000 */;
-	if (pApm->Chipset >= AT3D)
-	    pApm->LinAddress +=  8 * 1024 * 1024 /* 0xA0000 */;
-    }
-    else {
-	if (pApm->Chipset >= AT3D)
-	    pApm->LinMapSize  = 16 * 1024 * 1024;
-	else
-	    pApm->LinMapSize  =  6 * 1024 * 1024;
-	pApm->FbMapSize   =  4 * 1024 * 1024;
-    }
+    if (pApm->Chipset >= AT3D)
+	pApm->LinMapSize  = 16 * 1024 * 1024;
+    else
+	pApm->LinMapSize  =  6 * 1024 * 1024;
+    pApm->FbMapSize   =  4 * 1024 * 1024;
 
     if (xf86LoadSubModule(pScrn, "int10")) {
 	void	*ptr;
@@ -722,7 +707,7 @@
     if (pEnt->device->videoRam != 0) {
 	pScrn->videoRam = pEnt->device->videoRam;
 	from = X_CONFIG;
-    } else if (!pApm->noLinear && pApm->Chipset >= AT3D) {
+    } else if (pApm->Chipset >= AT3D) {
 	unsigned char		d9, db, uc;
 	/*unsigned long		save;*/
 	volatile unsigned char	*LinMap;
@@ -1008,8 +993,9 @@
     /* Load XAA if needed */
     if (!pApm->NoAccel) {
 	if (!xf86LoadSubModule(pScrn, "xaa")) {
-	    ApmFreeRec(pScrn);
-	    return FALSE;
+	    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Falling back to shadowfb\n");
+	    pApm->NoAccel = TRUE;
+	    pApm->ShadowFB = TRUE;
 	}
     }
 
@@ -1077,55 +1063,42 @@
     if (pApm->LinMap == NULL)
 	return FALSE;
 
-    if (!pApm->noLinear) {
-	if (pApm->Chipset >= AT3D) {
-	    pApm->FbBase = (void *)(((char *)pApm->LinMap) + 0x800000);
-	    pApm->VGAMap = ((char *)pApm->LinMap) + 0xFFF000;
-	    pApm->MemMap = ((char *)pApm->LinMap) + 0xFFEC00;
-	    pApm->BltMap = (void *)(((char *)pApm->LinMap) + 0x3F8000);
+    if (pApm->Chipset >= AT3D) {
+	pApm->FbBase = (void *)(((char *)pApm->LinMap) + 0x800000);
+	pApm->VGAMap = ((char *)pApm->LinMap) + 0xFFF000;
+	pApm->MemMap = ((char *)pApm->LinMap) + 0xFFEC00;
+	pApm->BltMap = (void *)(((char *)pApm->LinMap) + 0x3F8000);
+    }
+    else {
+	pApm->FbBase = (void *)pApm->LinMap;
+	pApm->VGAMap = NULL;
+	if (pScrn->videoRam == 6 * 1024 - 32) {
+	    pApm->MemMap = ((char *)pApm->LinMap) + 0x5FF800;
+	    pApm->BltMap = (void *)(((char *)pApm->LinMap) + 0x5F8000);
 	}
 	else {
-	    pApm->FbBase = (void *)pApm->LinMap;
-	    pApm->VGAMap = NULL;
-	    if (pScrn->videoRam == 6 * 1024 - 32) {
-		pApm->MemMap = ((char *)pApm->LinMap) + 0x5FF800;
-		pApm->BltMap = (void *)(((char *)pApm->LinMap) + 0x5F8000);
-	    }
-	    else {
-		pApm->MemMap = ((char *)pApm->LinMap) + 0x3FF800;
-		pApm->BltMap = (void *)(((char *)pApm->LinMap) + 0x3F8000);
-	    }
+	    pApm->MemMap = ((char *)pApm->LinMap) + 0x3FF800;
+	    pApm->BltMap = (void *)(((char *)pApm->LinMap) + 0x3F8000);
 	}
+    }
 
-	/*
-	 * Initialize chipset
-	 */
-	pApm->c9 = RDXB(0xC9);
-	if (pApm->Chipset >= AT3D) {
-	    pApm->d9 = RDXB(0xD9);
-	    pApm->db = RDXB(0xDB);
+    /*
+     * Initialize chipset
+     */
+    pApm->c9 = RDXB(0xC9);
+    if (pApm->Chipset >= AT3D) {
+	pApm->d9 = RDXB(0xD9);
+	pApm->db = RDXB(0xDB);
 
-	    /* If you change these two, change them also in apm_funcs.c */
-	    WRXB(0xDB, (pApm->db & 0xF4) | 0x0A);
-	    WRXB(0xD9, (pApm->d9 & 0xCF) | 0x20);
+	/* If you change these two, change them also in apm_funcs.c */
+	WRXB(0xDB, (pApm->db & 0xF4) | 0x0A);
+	WRXB(0xD9, (pApm->d9 & 0xCF) | 0x20);
 
-	    vgaHWSetMmioFuncs(hwp, (CARD8 *)pApm->LinMap, 0xFFF000);
-	}
-	if (pApm->Chipset >= AP6422)
-	    WRXB(0xC9, pApm->c9 | 0x10);
+	vgaHWSetMmioFuncs(hwp, (CARD8 *)pApm->LinMap, 0xFFF000);
     }
-    else {
-	pApm->FbBase = pApm->LinMap;
+    if (pApm->Chipset >= AP6422)
+	WRXB(0xC9, pApm->c9 | 0x10);
 
-	/*
-	 * Initialize chipset
-	 */
-	if (pApm->Chipset >= AT3D) {
-	    pApm->d9 = RDXB_IOP(0xD9);
-	    pApm->db = RDXB_IOP(0xDB);
-	    WRXB_IOP(0xDB, pApm->db & 0xF4);
-	}
-    }
     /*
      * Save color mode
      */
@@ -1150,14 +1123,8 @@
     hwp->writeMiscOut(hwp, pApm->MiscOut);
     if (pApm->LinMap) {
 	if (pApm->Chipset >= AT3D) {
-	    if (!pApm->noLinear) {
-		WRXB(0xD9, pApm->d9);
-		WRXB(0xDB, pApm->db);
-	    }
-	    else {
-		WRXB_IOP(0xD9, pApm->d9);
-		WRXB_IOP(0xDB, pApm->db);
-	    }
+	    WRXB(0xD9, pApm->d9);
+	    WRXB(0xDB, pApm->db);
 	}
 	WRXB(0xC9, pApm->c9);
 	xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pApm->LinMap, pApm->LinMapSize);
@@ -1239,18 +1206,10 @@
 	ApmReg->SEQ[0x1C] = rdinx(pApm->xport, 0x1C);
 
 	/* Hardware cursor registers. */
-	if (pApm->noLinear) {
-	    ApmReg->EX[XR140] = RDXL_IOP(0x140);
-	    ApmReg->EX[XR144] = RDXW_IOP(0x144);
-	    ApmReg->EX[XR148] = RDXL_IOP(0x148);
-	    ApmReg->EX[XR14C] = RDXW_IOP(0x14C);
-	}
-	else {
-	    ApmReg->EX[XR140] = RDXL(0x140);
-	    ApmReg->EX[XR144] = RDXW(0x144);
-	    ApmReg->EX[XR148] = RDXL(0x148);
-	    ApmReg->EX[XR14C] = RDXW(0x14C);
-	}
+	ApmReg->EX[XR140] = RDXL(0x140);
+	ApmReg->EX[XR144] = RDXW(0x144);
+	ApmReg->EX[XR148] = RDXL(0x148);
+	ApmReg->EX[XR14C] = RDXW(0x14C);
 
 	ApmReg->CRT[0x19] = rdinx(pApm->iobase + 0x3D4, 0x19);
 	ApmReg->CRT[0x1A] = rdinx(pApm->iobase + 0x3D4, 0x1A);
@@ -1259,26 +1218,14 @@
 	ApmReg->CRT[0x1D] = rdinx(pApm->iobase + 0x3D4, 0x1D);
 	ApmReg->CRT[0x1E] = rdinx(pApm->iobase + 0x3D4, 0x1E);
 
-	if (pApm->noLinear) {
-	    /* RAMDAC registers. */
-	    ApmReg->EX[XRE8] = RDXL_IOP(0xE8);
-	    ApmReg->EX[XREC] = RDXL_IOP(0xEC);
-
-	    /* Color correction */
-	    ApmReg->EX[XRE0] = RDXL_IOP(0xE0);
-
-	    ApmReg->EX[XR80] = RDXB_IOP(0x80);
-	}
-	else {
-	    /* RAMDAC registers. */
-	    ApmReg->EX[XRE8] = RDXL(0xE8);
-	    ApmReg->EX[XREC] = RDXL(0xEC);
+	/* RAMDAC registers. */
+	ApmReg->EX[XRE8] = RDXL(0xE8);
+	ApmReg->EX[XREC] = RDXL(0xEC);
 
-	    /* Color correction */
-	    ApmReg->EX[XRE0] = RDXL(0xE0);
+	/* Color correction */
+	ApmReg->EX[XRE0] = RDXL(0xE0);
 
-	    ApmReg->EX[XR80] = RDXB(0x80);
-	}
+	ApmReg->EX[XR80] = RDXB(0x80);
     }
 }
 
@@ -1539,10 +1486,8 @@
 	ApmReg->EX[XRE8] = 0x071F01E8; /* Enable 58MHz MCLK (actually 57.3 MHz)
 				       This is what is used in the Windows
 				       drivers. The BIOS sets it to 50MHz. */
-    else if (!pApm->noLinear)
-	ApmReg->EX[XRE8] = RDXL(0xE8); /* No change */
     else
-	ApmReg->EX[XRE8] = RDXL_IOP(0xE8); /* No change */
+	ApmReg->EX[XRE8] = RDXL(0xE8); /* No change */
 
     ApmReg->EX[XRE0] = 0x10;
 
@@ -1626,10 +1571,7 @@
     }
     else {
 	/* Set aperture index to 0. */
-	if (pApm->noLinear)
-	    WRXW_IOP(0xC0, 0);
-	else
-	    WRXW(0xC0, 0);
+	WRXW(0xC0, 0);
 
 	/*
 	 * Write the extended registers first
@@ -1638,18 +1580,10 @@
 	wrinx(pApm->xport, 0x1C, ApmReg->SEQ[0x1C]);
 
 	/* Hardware cursor registers. */
-	if (pApm->noLinear) {
-	    WRXL_IOP(0x140, ApmReg->EX[XR140]);
-	    WRXW_IOP(0x144, ApmReg->EX[XR144]);
-	    WRXL_IOP(0x148, ApmReg->EX[XR148]);
-	    WRXW_IOP(0x14C, ApmReg->EX[XR14C]);
-	}
-	else {
-	    WRXL(0x140, ApmReg->EX[XR140]);
-	    WRXW(0x144, ApmReg->EX[XR144]);
-	    WRXL(0x148, ApmReg->EX[XR148]);
-	    WRXW(0x14C, ApmReg->EX[XR14C]);
-	}
+	WRXL(0x140, ApmReg->EX[XR140]);
+	WRXW(0x144, ApmReg->EX[XR144]);
+	WRXL(0x148, ApmReg->EX[XR148]);
+	WRXW(0x14C, ApmReg->EX[XR14C]);
 
 	wrinx(pApm->iobase + 0x3D4, 0x19, ApmReg->CRT[0x19]);
 	wrinx(pApm->iobase + 0x3D4, 0x1A, ApmReg->CRT[0x1A]);
@@ -1659,27 +1593,14 @@
 	wrinx(pApm->iobase + 0x3D4, 0x1E, ApmReg->CRT[0x1E]);
 
 	/* RAMDAC registers. */
-	if (pApm->noLinear) {
-	    WRXL_IOP(0xE8, ApmReg->EX[XRE8]);
-	    WRXL_IOP(0xEC, ApmReg->EX[XREC] & ~(1 << 7));
-	    WRXL_IOP(0xEC, ApmReg->EX[XREC] | (1 << 7)); /* Do a PLL resync */
-	}
-	else {
-	    WRXL(0xE8, ApmReg->EX[XRE8]);
-	    WRXL(0xEC, ApmReg->EX[XREC] & ~(1 << 7));
-	    WRXL(0xEC, ApmReg->EX[XREC] | (1 << 7)); /* Do a PLL resync */
-	}
+	WRXL(0xE8, ApmReg->EX[XRE8]);
+	WRXL(0xEC, ApmReg->EX[XREC] & ~(1 << 7));
+	WRXL(0xEC, ApmReg->EX[XREC] | (1 << 7)); /* Do a PLL resync */
 
 	/* Color correction */
-	if (pApm->noLinear)
-	    WRXL_IOP(0xE0, ApmReg->EX[XRE0]);
-	else
-	    WRXL(0xE0, ApmReg->EX[XRE0]);
+	WRXL(0xE0, ApmReg->EX[XRE0]);
 
-	if (pApm->noLinear)
-	    WRXB_IOP(0x80, ApmReg->EX[XR80]);
-	else
-	    WRXB(0x80, ApmReg->EX[XR80]);
+	WRXB(0x80, ApmReg->EX[XR80]);
 
 	/*
 	 * This function handles restoring the generic VGA registers.
@@ -1735,17 +1656,8 @@
     pApm->pScreen = pScreen;
 
     /* Map the chip memory and MMIO areas */
-    if (pApm->noLinear) {
-	PCI_READ_LONG(pApm->PciInfo, &pApm->saveCmd, PCI_CMD_STAT_REG);
-	PCI_WRITE_LONG(pApm->PciInfo, pApm->saveCmd | (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE), PCI_CMD_STAT_REG);
-#ifndef XSERVER_LIBPCIACCESS
-	pApm->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
-				 pApm->PciTag, 0xA0000, 0x10000);
-#endif
-    }
-    else
-	if (!ApmMapMem(pScrn))
-	    return FALSE;
+    if (!ApmMapMem(pScrn))
+	return FALSE;
 
     /* No memory reserved yet */
     pApm->OffscreenReserved = 0;
@@ -1895,10 +1807,7 @@
 
     xf86DPMSInit(pScreen, ApmDisplayPowerManagementSet, 0);
 
-    if (pApm->noLinear)
-	ApmInitVideo_IOP(pScreen);
-    else
-	ApmInitVideo(pScreen);
+    ApmInitVideo(pScreen);
 
     pScreen->SaveScreen  = ApmSaveScreen;
 
@@ -2023,14 +1932,9 @@
     vgaHWPtr	hwp = VGAHWPTR(pScrn);
 
     if (pApm->Chipset >= AT3D) {
-	if (!pApm->noLinear) {
-	    /* If you change it, change it also in apm_funcs.c */
-	    WRXB(0xDB, (pApm->db & 0xF4) | 0x0A | pApm->Rush);
-	    WRXB(0xD9, (pApm->d9 & 0xCF) | 0x20);
-	}
-	else {
-	    WRXB_IOP(0xDB, pApm->db & 0xF4);
-	}
+	/* If you change it, change it also in apm_funcs.c */
+	WRXB(0xDB, (pApm->db & 0xF4) | 0x0A | pApm->Rush);
+	WRXB(0xD9, (pApm->d9 & 0xCF) | 0x20);
     }
     if (pApm->Chipset >= AP6422)
 	WRXB(0xC9, pApm->c9 | 0x10);
@@ -2064,14 +1968,8 @@
     vgaHWLock(hwp);
     ApmLock(pApm);
     if (pApm->Chipset >= AT3D) {
-	if (!pApm->noLinear) {
-	    WRXB(0xD9, pApm->d9);
-	    WRXB(0xDB, pApm->db);
-	}
-	else {
-	    WRXB_IOP(0xD9, pApm->d9);
-	    WRXB_IOP(0xDB, pApm->db);
-	}
+	WRXB(0xD9, pApm->d9);
+	WRXB(0xDB, pApm->db);
     }
     WRXB(0xC9, pApm->c9);
 
@@ -2178,13 +2076,8 @@
     default:
 	dpmsreg = 0;
     }
-    if (pApm->noLinear) {
-	tmp = RDXB_IOP(0xD0);
-	WRXB_IOP(0xD0, (tmp & 0xFC) | dpmsreg);
-    } else {
-	tmp = RDXB(0xD0);
-	WRXB(0xD0, (tmp & 0xFC) | dpmsreg);
-    }
+    tmp = RDXB(0xD0);
+    WRXB(0xD0, (tmp & 0xFC) | dpmsreg);
 }
 
 static Bool
