xserver-xorg-video-savage: Changes to 'debian-unstable'
Makefile.in | 2
configure | 256 ------
debian/changelog | 8
debian/patches/02_temporary_revert_pciaccess.diff | 873 ++++++++++++++++++++++
debian/patches/series | 1
man/Makefile.in | 2
src/Makefile.in | 2
7 files changed, 907 insertions(+), 237 deletions(-)
New commits:
commit 0f51b69cedfd45dcab85c49914496237aa737b08
Author: Brice Goglin <bgoglin@debian.org>
Date: Thu Nov 15 08:28:10 2007 +0100
Add 02_temporary_revert_pciaccess.diff to temporary revert all the pci-rework code
diff --git a/Makefile.in b/Makefile.in
index d972541..340f363 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -155,8 +155,6 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
-PCIACCESS_LIBS = @PCIACCESS_LIBS@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
diff --git a/configure b/configure
index 763ffe9..3b5740d 100755
--- a/configure
+++ b/configure
@@ -881,10 +881,6 @@ DRI_TRUE
DRI_FALSE
DRI_CFLAGS
DRI_LIBS
-PCIACCESS_CFLAGS
-PCIACCESS_LIBS
-XSERVER_LIBPCIACCESS_TRUE
-XSERVER_LIBPCIACCESS_FALSE
moduledir
DRIVER_NAME
APP_MAN_SUFFIX
@@ -921,9 +917,7 @@ PKG_CONFIG
XORG_CFLAGS
XORG_LIBS
DRI_CFLAGS
-DRI_LIBS
-PCIACCESS_CFLAGS
-PCIACCESS_LIBS'
+DRI_LIBS'
# Initialize some variables set by options.
@@ -1546,10 +1540,6 @@ Some influential environment variables:
XORG_LIBS linker flags for XORG, overriding pkg-config
DRI_CFLAGS C compiler flags for DRI, overriding pkg-config
DRI_LIBS linker flags for DRI, overriding pkg-config
- PCIACCESS_CFLAGS
- C compiler flags for PCIACCESS, overriding pkg-config
- PCIACCESS_LIBS
- linker flags for PCIACCESS, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -4393,7 +4383,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4396 "configure"' > conftest.$ac_ext
+ echo '#line 4386 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -7135,11 +7125,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7138: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7128: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7142: \$? = $ac_status" >&5
+ echo "$as_me:7132: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7425,11 +7415,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7428: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7418: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7432: \$? = $ac_status" >&5
+ echo "$as_me:7422: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7529,11 +7519,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7532: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7522: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7536: \$? = $ac_status" >&5
+ echo "$as_me:7526: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -9891,7 +9881,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9894 "configure"
+#line 9884 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9991,7 +9981,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9994 "configure"
+#line 9984 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12411,11 +12401,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12414: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12404: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12418: \$? = $ac_status" >&5
+ echo "$as_me:12408: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12515,11 +12505,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12518: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12508: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12522: \$? = $ac_status" >&5
+ echo "$as_me:12512: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14092,11 +14082,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14095: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14085: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14099: \$? = $ac_status" >&5
+ echo "$as_me:14089: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14196,11 +14186,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14199: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14189: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14203: \$? = $ac_status" >&5
+ echo "$as_me:14193: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16396,11 +16386,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16399: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16389: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16403: \$? = $ac_status" >&5
+ echo "$as_me:16393: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16686,11 +16676,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16689: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16679: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16693: \$? = $ac_status" >&5
+ echo "$as_me:16683: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16790,11 +16780,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16793: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16783: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16797: \$? = $ac_status" >&5
+ echo "$as_me:16787: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -21130,191 +21120,6 @@ _ACEOF
fi
-save_CFLAGS="$CFLAGS"
-CFLAGS="$XORG_CFLAGS"
-{ echo "$as_me:$LINENO: checking whether XSERVER_LIBPCIACCESS is declared" >&5
-echo $ECHO_N "checking whether XSERVER_LIBPCIACCESS is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_XSERVER_LIBPCIACCESS+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include "xorg-server.h"
-
-int
-main ()
-{
-#ifndef XSERVER_LIBPCIACCESS
- (void) XSERVER_LIBPCIACCESS;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_XSERVER_LIBPCIACCESS=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_XSERVER_LIBPCIACCESS=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_XSERVER_LIBPCIACCESS" >&5
-echo "${ECHO_T}$ac_cv_have_decl_XSERVER_LIBPCIACCESS" >&6; }
-if test $ac_cv_have_decl_XSERVER_LIBPCIACCESS = yes; then
- XSERVER_LIBPCIACCESS=yes
-else
- XSERVER_LIBPCIACCESS=no
-fi
-
-CFLAGS="$save_CFLAGS"
-
-if test "x$XSERVER_LIBPCIACCESS" = xyes; then
-
-pkg_failed=no
-{ echo "$as_me:$LINENO: checking for PCIACCESS" >&5
-echo $ECHO_N "checking for PCIACCESS... $ECHO_C" >&6; }
-
-if test -n "$PKG_CONFIG"; then
- if test -n "$PCIACCESS_CFLAGS"; then
- pkg_cv_PCIACCESS_CFLAGS="$PCIACCESS_CFLAGS"
- else
- if test -n "$PKG_CONFIG" && \
- { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.10.0\"") >&5
- ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.10.0") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- pkg_cv_PCIACCESS_CFLAGS=`$PKG_CONFIG --cflags "pciaccess >= 0.10.0" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- fi
-else
- pkg_failed=untried
-fi
-if test -n "$PKG_CONFIG"; then
- if test -n "$PCIACCESS_LIBS"; then
- pkg_cv_PCIACCESS_LIBS="$PCIACCESS_LIBS"
- else
- if test -n "$PKG_CONFIG" && \
- { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.10.0\"") >&5
- ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.10.0") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- pkg_cv_PCIACCESS_LIBS=`$PKG_CONFIG --libs "pciaccess >= 0.10.0" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- fi
-else
- pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "pciaccess >= 0.10.0"`
- else
- PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pciaccess >= 0.10.0"`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$PCIACCESS_PKG_ERRORS" >&5
-
- { { echo "$as_me:$LINENO: error: Package requirements (pciaccess >= 0.10.0) were not met:
-
-$PCIACCESS_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables PCIACCESS_CFLAGS
-and PCIACCESS_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-" >&5
-echo "$as_me: error: Package requirements (pciaccess >= 0.10.0) were not met:
-
-$PCIACCESS_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables PCIACCESS_CFLAGS
-and PCIACCESS_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-" >&2;}
- { (exit 1); exit 1; }; }
-elif test $pkg_failed = untried; then
- { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-Alternatively, you may set the environment variables PCIACCESS_CFLAGS
-and PCIACCESS_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details." >&5
-echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-Alternatively, you may set the environment variables PCIACCESS_CFLAGS
-and PCIACCESS_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-else
- PCIACCESS_CFLAGS=$pkg_cv_PCIACCESS_CFLAGS
- PCIACCESS_LIBS=$pkg_cv_PCIACCESS_LIBS
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- :
-fi
-fi
- if test "x$XSERVER_LIBPCIACCESS" = xyes; then
- XSERVER_LIBPCIACCESS_TRUE=
- XSERVER_LIBPCIACCESS_FALSE='#'
-else
- XSERVER_LIBPCIACCESS_TRUE='#'
- XSERVER_LIBPCIACCESS_FALSE=
-fi
-
-
@@ -21573,13 +21378,6 @@ echo "$as_me: error: conditional \"DRI\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
-if test -z "${XSERVER_LIBPCIACCESS_TRUE}" && test -z "${XSERVER_LIBPCIACCESS_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"XSERVER_LIBPCIACCESS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"XSERVER_LIBPCIACCESS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
@@ -22267,10 +22065,6 @@ DRI_TRUE!$DRI_TRUE$ac_delim
DRI_FALSE!$DRI_FALSE$ac_delim
DRI_CFLAGS!$DRI_CFLAGS$ac_delim
DRI_LIBS!$DRI_LIBS$ac_delim
-PCIACCESS_CFLAGS!$PCIACCESS_CFLAGS$ac_delim
-PCIACCESS_LIBS!$PCIACCESS_LIBS$ac_delim
-XSERVER_LIBPCIACCESS_TRUE!$XSERVER_LIBPCIACCESS_TRUE$ac_delim
-XSERVER_LIBPCIACCESS_FALSE!$XSERVER_LIBPCIACCESS_FALSE$ac_delim
moduledir!$moduledir$ac_delim
DRIVER_NAME!$DRIVER_NAME$ac_delim
APP_MAN_SUFFIX!$APP_MAN_SUFFIX$ac_delim
@@ -22289,7 +22083,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 35; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 31; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/debian/changelog b/debian/changelog
index d90e43b..da87678 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+xserver-xorg-video-savage (1:2.1.3-5) unstable; urgency=low
+
+ * Add 02_temporary_revert_pciaccess.diff to temporary revert
+ all the pci-rework code which does not seem to work even
+ when disabled, closes: #451074, #451219.
+
+ -- Brice Goglin <bgoglin@debian.org> Thu, 15 Nov 2007 08:19:08 +0100
+
xserver-xorg-video-savage (1:2.1.3-4) unstable; urgency=low
* Pull upstream up to 9c959f53ca8376aa136a9d434c3383cdb20487c2
diff --git a/debian/patches/02_temporary_revert_pciaccess.diff b/debian/patches/02_temporary_revert_pciaccess.diff
new file mode 100644
index 0000000..23cfc93
--- /dev/null
+++ b/debian/patches/02_temporary_revert_pciaccess.diff
@@ -0,0 +1,873 @@
+--- b/src/savage_driver.c
++++ b/src/savage_driver.c
+@@ -40,7 +40,6 @@
+ #endif
+
+ #include <unistd.h>
+-#include <errno.h>
+
+ #include "xf86RAC.h"
+ #include "shadowfb.h"
+@@ -73,13 +72,7 @@
+
+ static const OptionInfoRec * SavageAvailableOptions(int chipid, int busid);
+ static void SavageIdentify(int flags);
+-#ifdef XSERVER_LIBPCIACCESS
+-static Bool SavagePciProbe(DriverPtr drv, int entity_num,
+- struct pci_device *dev, intptr_t match_data);
+-#else
+ static Bool SavageProbe(DriverPtr drv, int flags);
+-static int LookupChipID(PciChipsets* pset, int ChipID);
+-#endif
+ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags);
+
+ static Bool SavageEnterVT(int scrnIndex, int flags);
+@@ -139,38 +132,18 @@
+
+ int gSavageEntityIndex = -1;
+
++_X_EXPORT DriverRec SAVAGE =
++{
++ SAVAGE_VERSION,
++ SAVAGE_DRIVER_NAME,
++ SavageIdentify,
++ SavageProbe,
++ SavageAvailableOptions,
++ NULL,
++ 0,
++ NULL
++};
+-#ifdef XSERVER_LIBPCIACCESS
+-#define SAVAGE_DEVICE_MATCH(d, i) \
+- { 0x5333, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
+-
+-static const struct pci_id_match savage_device_match[] = {
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SAVAGE4, S3_SAVAGE4),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SAVAGE3D, S3_SAVAGE3D),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SAVAGE3D_MV, S3_SAVAGE3D),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SAVAGE2000, S3_SAVAGE2000),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SAVAGE_MX_MV, S3_SAVAGE_MX),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SAVAGE_MX, S3_SAVAGE_MX),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SAVAGE_IX_MV, S3_SAVAGE_MX),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SAVAGE_IX, S3_SAVAGE_MX),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_PROSAVAGE_PM, S3_PROSAVAGE),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_PROSAVAGE_KM, S3_PROSAVAGE),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_S3TWISTER_P, S3_TWISTER),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_S3TWISTER_K, S3_TWISTER),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SUPSAV_MX128, S3_SUPERSAVAGE),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SUPSAV_MX64, S3_SUPERSAVAGE),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SUPSAV_MX64C, S3_SUPERSAVAGE),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SUPSAV_IX128SDR, S3_SUPERSAVAGE),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SUPSAV_IX128DDR, S3_SUPERSAVAGE),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SUPSAV_IX64SDR, S3_SUPERSAVAGE),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SUPSAV_IX64DDR, S3_SUPERSAVAGE),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SUPSAV_IXCSDR, S3_SUPERSAVAGE),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_SUPSAV_IXCDDR, S3_SUPERSAVAGE),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_PROSAVAGE_DDR, S3_PROSAVAGEDDR),
+- SAVAGE_DEVICE_MATCH(PCI_CHIP_PROSAVAGE_DDRK, S3_PROSAVAGEDDR),
+
+- { 0, 0, 0 },
+-};
+-#endif
+
+ /* Supported chipsets */
+
+@@ -213,7 +186,6 @@
+ { -1, NULL }
+ };
+
+-#ifndef XSERVER_LIBPCIACCESS
+ /* This table maps a PCI device ID to a chipset family identifier. */
+
+ static PciChipsets SavagePciChipsets[] = {
+@@ -242,7 +214,6 @@
+ { S3_SUPERSAVAGE, PCI_CHIP_SUPSAV_IXCDDR, RES_SHARED_VGA },
+ { -1, -1, RES_UNDEFINED }
+ };
+-#endif
+
+ typedef enum {
+ OPTION_PCI_BURST
+@@ -314,28 +285,6 @@
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
+ };
+
+-_X_EXPORT DriverRec SAVAGE =
+-{
+- SAVAGE_VERSION,
+- SAVAGE_DRIVER_NAME,
+- SavageIdentify,
+-#ifdef XSERVER_LIBPCIACCESS
+- NULL,
+-#else
+- SavageProbe,
+-#endif
+- SavageAvailableOptions,
+- NULL,
+- 0,
+- NULL,
+-
+-#ifdef XSERVER_LIBPCIACCESS
+- savage_device_match,
+- SavagePciProbe
+-#endif
+-};
+-
+-
+
+ static const char *vgaHWSymbols[] = {
+ "vgaHWBlankScreen",
+@@ -839,82 +788,6 @@
+ }
+
+
+-#ifdef XSERVER_LIBPCIACCESS
+-static Bool SavagePciProbe(DriverPtr drv, int entity_num,
+- struct pci_device *dev, intptr_t match_data)
+-{
+- ScrnInfoPtr pScrn;
+-
+-
+- if ((match_data < S3_SAVAGE3D) || (match_data > S3_SAVAGE2000)) {
+- return FALSE;
+- }
+-
+- pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL,
+- RES_SHARED_VGA, NULL, NULL, NULL, NULL);
+- if (pScrn != NULL) {
+- EntityInfoPtr pEnt;
+- SavagePtr psav;
+-
+-
+- pScrn->driverVersion = SAVAGE_VERSION;
+- pScrn->driverName = SAVAGE_DRIVER_NAME;
+- pScrn->name = "SAVAGE";
+- pScrn->Probe = NULL;
+- pScrn->PreInit = SavagePreInit;
+- pScrn->ScreenInit = SavageScreenInit;
+- pScrn->SwitchMode = SavageSwitchMode;
+- pScrn->AdjustFrame = SavageAdjustFrame;
+- pScrn->EnterVT = SavageEnterVT;
+- pScrn->LeaveVT = SavageLeaveVT;
+- pScrn->FreeScreen = NULL;
+- pScrn->ValidMode = SavageValidMode;
+-
+- if (!SavageGetRec(pScrn))
+- return FALSE;
+-
+- psav = SAVPTR(pScrn);
+-
+- psav->PciInfo = dev;
+- psav->Chipset = match_data;
+-
+- pEnt = xf86GetEntityInfo(entity_num);
+-
+- /* MX, IX, SuperSavage cards support Dual-Head, mark the entity as
+- * sharable.
+- */
+- if (pEnt->chipset == S3_SAVAGE_MX || pEnt->chipset == S3_SUPERSAVAGE) {
+- DevUnion *pPriv;
+- SavageEntPtr pSavageEnt;
+-
+- xf86SetEntitySharable(entity_num);
+-
+- if (gSavageEntityIndex == -1)
+- gSavageEntityIndex = xf86AllocateEntityPrivateIndex();
+-
+- pPriv = xf86GetEntityPrivate(pEnt->index, gSavageEntityIndex);
+- if (!pPriv->ptr) {
+- int j;
+- int instance = xf86GetNumEntityInstances(pEnt->index);
+-
+- for (j = 0; j < instance; j++)
+- xf86SetEntityInstanceForScreen(pScrn, pEnt->index, j);
+-
+- pPriv->ptr = xnfcalloc(sizeof(SavageEntRec), 1);
+- pSavageEnt = pPriv->ptr;
+- pSavageEnt->HasSecondary = FALSE;
+- } else {
+- pSavageEnt = pPriv->ptr;
+- pSavageEnt->HasSecondary = TRUE;
+- }
+- }
+- }
+-
+- return (pScrn != NULL);
+-}
+-
+-#else
+-
+ static Bool SavageProbe(DriverPtr drv, int flags)
+ {
+ int i;
+@@ -953,8 +826,6 @@
+ NULL, NULL, NULL, NULL);
+
+ if (pScrn != NULL) {
+- SavagePtr psav;
+-
+ pScrn->driverVersion = SAVAGE_VERSION;
+ pScrn->driverName = SAVAGE_DRIVER_NAME;
+ pScrn->name = "SAVAGE";
+@@ -968,23 +839,6 @@
+ pScrn->FreeScreen = NULL;
+ pScrn->ValidMode = SavageValidMode;
+ foundScreen = TRUE;
+-
+- if (!SavageGetRec(pScrn))
+- return FALSE;
+-
+- psav = SAVPTR(pScrn);
+-
+- psav->PciInfo = xf86GetPciInfoForEntity(pEnt->index);
+- if (pEnt->device->chipset && *pEnt->device->chipset) {
+- psav->Chipset = xf86StringToToken(SavageChipsets,
+- pEnt->device->chipset);
+- } else if (pEnt->device->chipID >= 0) {
+- psav->Chipset = LookupChipID(SavagePciChipsets,
+- pEnt->device->chipID);
+- } else {
+- psav->Chipset = LookupChipID(SavagePciChipsets,
+- psav->PciInfo->chipType);
+- }
+ }
+
+ pEnt = xf86GetEntityInfo(usedChips[i]);
+@@ -1038,7 +892,6 @@
+
+ return -1;
+ }
+-#endif
+
+ static void SavageDoDDC(ScrnInfoPtr pScrn)
+ {
+@@ -1553,6 +1406,7 @@
+ psav->pVbe = VBEInit(NULL, pEnt->index);
+ }
+
++ psav->PciInfo = xf86GetPciInfoForEntity(pEnt->index);
+ xf86RegisterResources(pEnt->index, NULL, ResNone);
+ xf86SetOperatingState(resVgaIo, pEnt->index, ResUnusedOpr);
+ xf86SetOperatingState(resVgaMem, pEnt->index, ResDisableOpr);
+@@ -1561,9 +1415,11 @@
+ if (pEnt->device->chipset && *pEnt->device->chipset) {
+ pScrn->chipset = pEnt->device->chipset;
+ psav->ChipId = pEnt->device->chipID;
++ psav->Chipset = xf86StringToToken(SavageChipsets, pScrn->chipset);
+ from = X_CONFIG;
+ } else if (pEnt->device->chipID >= 0) {
+ psav->ChipId = pEnt->device->chipID;
++ psav->Chipset = LookupChipID(SavagePciChipsets, psav->ChipId);
+ pScrn->chipset = (char *)xf86TokenToString(SavageChipsets,
+ psav->Chipset);
+ from = X_CONFIG;
+@@ -1571,7 +1427,8 @@
+ pEnt->device->chipID);
+ } else {
+ from = X_PROBED;
++ psav->ChipId = psav->PciInfo->chipType;
++ psav->Chipset = LookupChipID(SavagePciChipsets, psav->ChipId);
+- psav->ChipId = DEVICE_ID(psav->PciInfo);
+ pScrn->chipset = (char *)xf86TokenToString(SavageChipsets,
+ psav->Chipset);
+ }
+@@ -1584,7 +1441,7 @@
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n",
+ psav->ChipRev);
+ } else
++ psav->ChipRev = psav->PciInfo->chipRev;
+- psav->ChipRev = CHIP_REVISION(psav->PciInfo);
+
+ xf86DrvMsg(pScrn->scrnIndex, from, "Engine: \"%s\"\n", pScrn->chipset);
+
+@@ -1593,22 +1450,13 @@
+
+ xfree(pEnt);
+
+-#ifndef XSERVER_LIBPCIACCESS
+ psav->PciTag = pciTag(psav->PciInfo->bus, psav->PciInfo->device,
+ psav->PciInfo->func);
+-#endif
+
+
+ /* Set AGP Mode from config */
+ /* We support 1X 2X and 4X */
+ #ifdef XF86DRI
+-#ifdef XSERVER_LIBPCIACCESS
+- /* Try to read the AGP capabilty block from the device. If there is
+- * no AGP info, the device is PCI.
+- */
+-
+- psav->IsPCI = (pci_device_get_agp_info(psav->PciInfo) == NULL);
+-#else
+ /* AGP/PCI (FK: copied from radeon_driver.c) */
+ /* Proper autodetection of an AGP capable device requires examining
+ * PCI config registers to determine if the device implements extended
+@@ -1667,7 +1515,6 @@
+ cap_ptr = (cap_id >> 8) & SAVAGE_CAP_PTR_MASK;
+ }
+ }
+-#endif
+
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "%s card detected\n",
+ (psav->IsPCI) ? "PCI" : "AGP");
+@@ -3061,132 +2908,97 @@
+ static Bool SavageMapMem(ScrnInfoPtr pScrn)
+ {
+ SavagePtr psav = SAVPTR(pScrn);
++ int mode;
++ unsigned i;
+- int err;
+
+ TRACE(("SavageMapMem()\n"));
+
+ if( S3_SAVAGE3D_SERIES(psav->Chipset) ) {
++ psav->MmioRegion.bar = 0;
++ psav->MmioRegion.offset = SAVAGE_NEWMMIO_REGBASE_S3;
++
++ psav->FbRegion.bar = 0;
++ psav->FbRegion.offset = 0;
++
++ psav->last_bar = 0;
+-#ifdef XSERVER_LIBPCIACCESS
+- psav->MmioRegion.base = SAVAGE_NEWMMIO_REGBASE_S3
+- + psav->PciInfo->regions[0].base_addr;
+- psav->FbRegion.base = psav->PciInfo->regions[0].base_addr;
+-#else
+- psav->MmioRegion.base = SAVAGE_NEWMMIO_REGBASE_S3
+- + psav->PciInfo->memBase[0];
+- psav->FbRegion.base = psav->PciInfo->memBase[0];
+-#endif
+ } else {
++ psav->MmioRegion.bar = 0;
++ psav->MmioRegion.offset = SAVAGE_NEWMMIO_REGBASE_S4;
++
++ psav->FbRegion.bar = 1;
++ psav->FbRegion.offset = 0;
++
++ psav->last_bar = 1;
+-#ifdef XSERVER_LIBPCIACCESS
+- psav->MmioRegion.base = SAVAGE_NEWMMIO_REGBASE_S4
+- + psav->PciInfo->regions[0].base_addr;
+- psav->FbRegion.base = psav->PciInfo->regions[1].base_addr;
+-#else
+- psav->MmioRegion.base = SAVAGE_NEWMMIO_REGBASE_S4
+- + psav->PciInfo->memBase[0];
+- psav->FbRegion.base = psav->PciInfo->memBase[1];
+-#endif
+ }
+
+- psav->MmioRegion.size = SAVAGE_NEWMMIO_REGSIZE;
+- psav->FbRegion.size = psav->videoRambytes;
+-
+ /* On Paramount and Savage 2000, aperture 0 is PCI base 2. On other
+ * chipsets it's in the same BAR as the framebuffer.
+ */
+ if ((psav->Chipset == S3_SUPERSAVAGE)
++ || (psav->Chipset == S3_SAVAGE2000)) {
++ psav->ApertureRegion.bar = 2;
++ psav->ApertureRegion.offset = 0;
++
++ psav->last_bar = 2;
+- || (psav->Chipset == S3_SAVAGE2000)) {
+-#ifdef XSERVER_LIBPCIACCESS
+- psav->ApertureRegion.base = psav->PciInfo->regions[2].base_addr;
+-#else
+- psav->ApertureRegion.base = psav->PciInfo->memBase[2];
+-#endif
+ } else {
++ psav->ApertureRegion.bar = psav->FbRegion.bar;
++ psav->ApertureRegion.offset = 0x02000000;
+- psav->ApertureRegion.base = psav->FbRegion.base + 0x02000000;
+ }
+
+- psav->ApertureRegion.size = (psav->IsPrimary || psav->IsSecondary)
+- ? (0x01000000 * 2) : (0x01000000 * 5);
+
++ psav->MmioBase = psav->PciInfo->memBase[ psav->MmioRegion.bar ]
++ + psav->MmioRegion.offset;
++
++ psav->FrameBufferBase = psav->PciInfo->memBase[ psav->FbRegion.bar ]
++ + psav->FbRegion.offset;
+
++ psav->ApertureBase = psav->PciInfo->memBase[ psav->FbRegion.bar ]
++ + psav->ApertureRegion.offset;
++
++
++ /* FIXME: This seems fine even on Savage3D where the same BAR contains the
++ * FIXME: MMIO space and the framebuffer. Write-combining gets fixed up
++ * FIXME: later. Someone should investigate this, though. And kick S3
++ * FIXME: for doing something so silly.
++ */
++ mode = VIDMEM_MMIO;
++ for (i = 0; i <= psav->last_bar; i++) {
++ psav->bar_mappings[i] = xf86MapPciMem(pScrn->scrnIndex, mode,
++ psav->PciTag,
++ psav->PciInfo->memBase[i],
++ (1U << psav->PciInfo->size[i]));
++ if (!psav->bar_mappings[i]) {
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
++ "Internal error: cound not map PCI region %u, last BAR = %u\n",
++ i, psav->last_bar);
++ return FALSE;
++ }
++
++ mode = VIDMEM_FRAMEBUFFER;
+- if (psav->FbRegion.size != 0) {
+-#ifdef XSERVER_LIBPCIACCESS
+- err = pci_device_map_range(psav->PciInfo, psav->FbRegion.base,
+- psav->FbRegion.size,
+- (PCI_DEV_MAP_FLAG_WRITABLE
+- | PCI_DEV_MAP_FLAG_WRITE_COMBINE),
+- & psav->FbRegion.memory);
+-#else
+- psav->FbRegion.memory =
+- xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
+- psav->PciTag, psav->FbRegion.base,
+- psav->FbRegion.size);
+- err = (psav->FbRegion.memory == NULL) ? errno : 0;
+-#endif
+- if (err) {
+- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+- "Internal error: cound not map framebuffer range (%d, %s).\n",
+- err, strerror(err));
+- return FALSE;
+- }
+-
+- psav->FBBase = psav->FbRegion.memory;
+- psav->FBStart = (psav->IsSecondary)
+- ? psav->FBBase + 0x1000000 : psav->FBBase;
+ }
+
++ psav->MapBase = psav->bar_mappings[ psav->MmioRegion.bar ]
++ + psav->MmioRegion.offset;
++
++ psav->BciMem = psav->MapBase + 0x10000;
++
++ SavageEnableMMIO(pScrn);
++
++ psav->FBBase = psav->bar_mappings[ psav->FbRegion.bar ]
++ + psav->FbRegion.offset;
+- if (psav->ApertureRegion.memory == NULL) {
+-#ifdef XSERVER_LIBPCIACCESS
+- err = pci_device_map_range(psav->PciInfo, psav->ApertureRegion.base,
+- psav->ApertureRegion.size,
+- (PCI_DEV_MAP_FLAG_WRITABLE
+- | PCI_DEV_MAP_FLAG_WRITE_COMBINE),
+- & psav->ApertureRegion.memory);
+-#else
+- psav->ApertureRegion.memory =
+- xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
+- psav->PciTag, psav->ApertureRegion.base,
+- psav->ApertureRegion.size);
+- err = (psav->ApertureRegion.memory == NULL) ? errno : 0;
+-#endif
+- if (err) {
+- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+- "Internal error: cound not map aperture range (%d, %s).\n",
+- err, strerror(err));
+- return FALSE;
+- }
+-
+- psav->ApertureMap = (psav->IsSecondary)
+- ? psav->ApertureRegion.memory
+- : psav->ApertureRegion.memory + 0x1000000;
+- }
+
++ psav->FBStart = (psav->IsSecondary)
++ ? psav->FBBase + 0x1000000 : psav->FBBase;
+- if (psav->MmioRegion.memory == NULL) {
+-#ifdef XSERVER_LIBPCIACCESS
+- err = pci_device_map_range(psav->PciInfo, psav->MmioRegion.base,
+- psav->MmioRegion.size,
+- (PCI_DEV_MAP_FLAG_WRITABLE),
+- & psav->MmioRegion.memory);
+-#else
+- psav->MmioRegion.memory =
+- xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
+- psav->PciTag, psav->MmioRegion.base,
+- psav->MmioRegion.size);
+- err = (psav->MmioRegion.memory == NULL) ? errno : 0;
+-#endif
+- if (err) {
+- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+- "Internal error: cound not map MMIO range (%d, %s).\n",
+- err, strerror(err));
+- return FALSE;
+- }
+
++ psav->ApertureMap = psav->bar_mappings[ psav->ApertureRegion.bar ]
++ + psav->ApertureRegion.offset;
+- psav->MapBase = psav->MmioRegion.memory;
+- psav->BciMem = psav->MapBase + 0x10000;
+
++ if (psav->IsSecondary) {
++ psav->ApertureMap += 0x1000000;
+- SavageEnableMMIO(pScrn);
+ }
+
++ pScrn->memPhysBase = psav->PciInfo->memBase[0];
++
+- pScrn->memPhysBase = psav->FbRegion.base;
+ return TRUE;
+ }
+
+@@ -3194,55 +3006,30 @@
+ static void SavageUnmapMem(ScrnInfoPtr pScrn, int All)
+ {
+ SavagePtr psav = SAVPTR(pScrn);
++ unsigned i;
Reply to: