xf86-video-savage 2.2.1

This commit is contained in:
matthieu 2008-10-12 21:24:21 +00:00
parent 0c603d7f57
commit 1905a08f33
21 changed files with 2476 additions and 1118 deletions

View File

@ -123,6 +123,7 @@ DRI_CFLAGS = @DRI_CFLAGS@
DRI_FALSE = @DRI_FALSE@
DRI_LIBS = @DRI_LIBS@
DRI_TRUE = @DRI_TRUE@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@ -151,6 +152,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@ -159,18 +161,25 @@ 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@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@
XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-savage],
2.1.3,
2.2.1,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-savage)
@ -95,6 +95,18 @@ if test "$DRI" = yes; then
AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
fi
save_CFLAGS="$CFLAGS"
CFLAGS="$XORG_CFLAGS"
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes], [XSERVER_LIBPCIACCESS=no],
[#include "xorg-server.h"])
CFLAGS="$save_CFLAGS"
if test "x$XSERVER_LIBPCIACCESS" = xyes; then
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
fi
AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
AC_SUBST([DRI_CFLAGS])
AC_SUBST([XORG_CFLAGS])
AC_SUBST([moduledir])

View File

@ -1,8 +1,8 @@
# ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun configure.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
# 2007, 2008 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
@ -43,14 +43,22 @@ EXIT_FAILURE=1
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.5.22
TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
VERSION=1.5.26
TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes.
if test -n "${ZSH_VERSION+set}" ; then
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh
# Check that we have a working $echo.
if test "X$1" = X--no-reexec; then
@ -105,11 +113,19 @@ esac
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
# We save the old values to restore during execute mode.
if test "${LC_ALL+set}" = set; then
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
fi
if test "${LANG+set}" = set; then
save_LANG="$LANG"; LANG=C; export LANG
lt_env=
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
eval "if test \"\${$lt_var+set}\" = set; then
save_$lt_var=\$$lt_var
lt_env=\"$lt_var=\$$lt_var \$lt_env\"
$lt_var=C
export $lt_var
fi"
done
if test -n "$lt_env"; then
lt_env="env $lt_env"
fi
# Make sure IFS has a sensible default
@ -136,6 +152,8 @@ duplicate_deps=no
preserve_args=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
extracted_archives=
extracted_serial=0
#####################################
# Shell function definitions:
@ -196,7 +214,13 @@ func_win32_libid ()
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
win32_nmres=`eval $NM -f posix -A $1 | \
$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
$SED -n -e '1,100{
/ I /{
s,.*,import,
p
q
}
}'`
case $win32_nmres in
import*) win32_libid_type="x86 archive import";;
*) win32_libid_type="x86 archive static";;
@ -327,7 +351,17 @@ func_extract_archives ()
*) my_xabs=`pwd`"/$my_xlib" ;;
esac
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
my_xdir="$my_gentop/$my_xlib"
my_xlib_u=$my_xlib
while :; do
case " $extracted_archives " in
*" $my_xlib_u "*)
extracted_serial=`expr $extracted_serial + 1`
my_xlib_u=lt$extracted_serial-$my_xlib ;;
*) break ;;
esac
done
extracted_archives="$extracted_archives $my_xlib_u"
my_xdir="$my_gentop/$my_xlib_u"
$show "${rm}r $my_xdir"
$run ${rm}r "$my_xdir"
@ -454,11 +488,12 @@ do
;;
--version)
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
$echo
$echo "Copyright (C) 2005 Free Software Foundation, Inc."
$echo "This is free software; see the source for copying conditions. There is NO"
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
echo "\
$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
exit $?
;;
@ -755,9 +790,11 @@ if test -z "$show_help"; then
*.class) xform=class ;;
*.cpp) xform=cpp ;;
*.cxx) xform=cxx ;;
*.f90) xform=f90 ;;
*.[fF][09]?) xform=[fF][09]. ;;
*.for) xform=for ;;
*.java) xform=java ;;
*.obj) xform=obj ;;
*.sx) xform=sx ;;
esac
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
@ -926,7 +963,7 @@ EOF
$run $rm "$lobj" "$output_obj"
$show "$command"
if $run eval "$command"; then :
if $run eval $lt_env "$command"; then :
else
test -n "$output_obj" && $run $rm $removelist
exit $EXIT_FAILURE
@ -998,7 +1035,7 @@ EOF
command="$command$suppress_output"
$run $rm "$obj" "$output_obj"
$show "$command"
if $run eval "$command"; then :
if $run eval $lt_env "$command"; then :
else
$run $rm $removelist
exit $EXIT_FAILURE
@ -1131,6 +1168,7 @@ EOF
thread_safe=no
vinfo=
vinfo_number=no
single_module="${wl}-single_module"
func_infer_tag $base_compile
@ -1138,8 +1176,9 @@ EOF
for arg
do
case $arg in
-all-static | -static)
if test "X$arg" = "X-all-static"; then
-all-static | -static | -static-libtool-libs)
case $arg in
-all-static)
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
fi
@ -1147,12 +1186,20 @@ EOF
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=yes
else
;;
-static)
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=built
fi
;;
-static-libtool-libs)
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=yes
;;
esac
build_libtool_libs=no
build_old_libs=yes
break
@ -1600,7 +1647,7 @@ EOF
continue
;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
compiler_flags="$compiler_flags $arg"
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
@ -1608,6 +1655,11 @@ EOF
continue
;;
-multi_module)
single_module="${wl}-multi_module"
continue
;;
-module)
module=yes
continue
@ -1621,10 +1673,11 @@ EOF
# -m* pass through architecture-specific compiler args for GCC
# -m*, -t[45]*, -txscale* pass through architecture-specific
# compiler args for GCC
# -pg pass through profiling flag for GCC
# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
# -F/path gives path to uninstalled frameworks, gcc on darwin
# @file GCC response files
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
-t[45]*|-txscale*|@*)
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
@ -1652,9 +1705,9 @@ EOF
-no-install)
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
# The PATH hackery in wrapper scripts is required on Windows
# in order for the loader to find any dlls it needs.
# and Darwin in order for the loader to find any dlls it needs.
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
fast_install=no
@ -1713,7 +1766,7 @@ EOF
continue
;;
-static)
-static | -static-libtool-libs)
# The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects
@ -2106,7 +2159,7 @@ EOF
lib=
found=no
case $deplib in
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
@ -2122,7 +2175,12 @@ EOF
continue
fi
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
if test "$linkmode" = lib; then
searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
else
searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
fi
for searchdir in $searchdirs; do
for search_ext in .la $std_shrext .so .a; do
# Search the libtool library
lib="$searchdir/lib${name}${search_ext}"
@ -2503,7 +2561,9 @@ EOF
if test "$linkmode,$pass" = "prog,link"; then
if test -n "$library_names" &&
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
{ { test "$prefer_static_libs" = no ||
test "$prefer_static_libs,$installed" = "built,yes"; } ||
test -z "$old_library"; }; then
# We need to hardcode the library path
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
# Make sure the rpath contains only unique directories.
@ -2916,12 +2976,18 @@ EOF
# we do not want to link against static libs,
# but need to link against shared
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names" ; then
for tmp in $deplibrary_names ; do
depdepl=$tmp
done
if test -f "$path/$depdepl" ; then
if test -f "$deplibdir/$depdepl" ; then
depdepl="$deplibdir/$depdepl"
elif test -f "$path/$depdepl" ; then
depdepl="$path/$depdepl"
else
# Can't find it, oh well...
depdepl=
fi
# do not add paths which are already there
case " $newlib_search_path " in
@ -3069,9 +3135,10 @@ EOF
case $linkmode in
oldlib)
if test -n "$deplibs"; then
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
fi
case " $deplibs" in
*\ -l* | *\ -L*)
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
esac
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
@ -3199,7 +3266,7 @@ EOF
# which has an extra 1 added just for fun
#
case $version_type in
darwin|linux|osf|windows)
darwin|linux|osf|windows|none)
current=`expr $number_major + $number_minor`
age="$number_minor"
revision="$number_revision"
@ -3210,9 +3277,10 @@ EOF
age="0"
;;
irix|nonstopux)
current=`expr $number_major + $number_minor - 1`
current=`expr $number_major + $number_minor`
age="$number_minor"
revision="$number_minor"
lt_irix_increment=no
;;
esac
;;
@ -3271,7 +3339,8 @@ EOF
versuffix="$major.$age.$revision"
# Darwin ld doesn't like 0 for these options...
minor_current=`expr $current + 1`
verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
;;
freebsd-aout)
@ -3285,8 +3354,11 @@ EOF
;;
irix | nonstopux)
major=`expr $current - $age + 1`
if test "X$lt_irix_increment" = "Xno"; then
major=`expr $current - $age`
else
major=`expr $current - $age + 1`
fi
case $version_type in
nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;;
@ -3437,11 +3509,11 @@ EOF
fi
# Eliminate all temporary directories.
for path in $notinst_path; do
lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
done
#for path in $notinst_path; do
# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
#done
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
@ -3542,13 +3614,12 @@ EOF
int main() { return 0; }
EOF
$rm conftest
$LTCC $LTCFLAGS -o conftest conftest.c $deplibs
if test "$?" -eq 0 ; then
if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
ldd_output=`ldd conftest`
for i in $deplibs; do
name=`expr $i : '-l\(.*\)'`
# If $name is empty we are operating on a -L argument.
if test "$name" != "" && test "$name" -ne "0"; then
if test "$name" != "" && test "$name" != "0"; then
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
@ -3587,9 +3658,7 @@ EOF
# If $name is empty we are operating on a -L argument.
if test "$name" != "" && test "$name" != "0"; then
$rm conftest
$LTCC $LTCFLAGS -o conftest conftest.c $i
# Did it work?
if test "$?" -eq 0 ; then
if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
ldd_output=`ldd conftest`
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
@ -3621,7 +3690,7 @@ EOF
droppeddeps=yes
$echo
$echo "*** Warning! Library $i is needed by this library but I was not able to"
$echo "*** make it link in! You will probably need to install it or some"
$echo "*** make it link in! You will probably need to install it or some"
$echo "*** library that it depends on before this library will be fully"
$echo "*** functional. Installing it before continuing would be even better."
fi
@ -3907,7 +3976,10 @@ EOF
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
if test -n "$hardcode_libdir_flag_spec_ld"; then
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
case $archive_cmds in
*\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
*) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
esac
else
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
fi
@ -4217,9 +4289,10 @@ EOF
;;
obj)
if test -n "$deplibs"; then
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
fi
case " $deplibs" in
*\ -l* | *\ -L*)
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
esac
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
@ -4266,12 +4339,14 @@ EOF
reload_conv_objs=
gentop=
# reload_cmds runs $LD directly, so let us get rid of
# -Wl from whole_archive_flag_spec
# -Wl from whole_archive_flag_spec and hope we can get by with
# turning comma into space..
wl=
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
else
gentop="$output_objdir/${obj}x"
generated="$generated $gentop"
@ -4719,16 +4794,16 @@ static const void *lt_preloaded_setup() {
case $host in
*cygwin* | *mingw* )
if test -f "$output_objdir/${outputname}.def" ; then
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
else
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
fi
;;
* )
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
;;
esac
;;
@ -4743,13 +4818,13 @@ static const void *lt_preloaded_setup() {
# really was required.
# Nullify the symbol file.
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
fi
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
@ -4836,7 +4911,7 @@ static const void *lt_preloaded_setup() {
if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
else
# fast_install is set to needless
relink_command=
@ -4873,7 +4948,7 @@ static const void *lt_preloaded_setup() {
fi
done
relink_command="(cd `pwd`; $relink_command)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
fi
# Quote $echo for shipping.
@ -5280,6 +5355,20 @@ EOF
Xsed='${SED} -e 1s/^X//'
sed_quote_subst='$sed_quote_subst'
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
@ -5422,7 +5511,7 @@ else
;;
esac
$echo >> $output "\
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
\$echo \"\$0: cannot exec \$program \$*\"
exit $EXIT_FAILURE
fi
else
@ -5608,7 +5697,7 @@ fi\
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
if test "$hardcode_automatic" = yes ; then
relink_command=
fi
@ -5957,9 +6046,9 @@ relink_command=\"$relink_command\""
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
else
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
fi
$echo "$modename: warning: relinking \`$file'" 1>&2
@ -6168,7 +6257,7 @@ relink_command=\"$relink_command\""
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
outputname="$tmpdir/$file"
# Replace the output file specification.
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
$show "$relink_command"
if $run eval "$relink_command"; then :
@ -6345,8 +6434,10 @@ relink_command=\"$relink_command\""
if test -f "$dir/$objdir/$dlname"; then
dir="$dir/$objdir"
else
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
exit $EXIT_FAILURE
if test ! -f "$dir/$dlname"; then
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
exit $EXIT_FAILURE
fi
fi
;;
@ -6410,12 +6501,12 @@ relink_command=\"$relink_command\""
fi
# Restore saved environment variables
if test "${save_LC_ALL+set}" = set; then
LC_ALL="$save_LC_ALL"; export LC_ALL
fi
if test "${save_LANG+set}" = set; then
LANG="$save_LANG"; export LANG
fi
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
eval "if test \"\${save_$lt_var+set}\" = set; then
$lt_var=\$save_$lt_var; export $lt_var
fi"
done
# Now prepare to actually exec the command.
exec_cmd="\$cmd$args"
@ -6772,9 +6863,9 @@ The following components of LINK-COMMAND are treated specially:
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE
try to export only the symbols listed in SYMFILE
try to export only the symbols listed in SYMFILE
-export-symbols-regex REGEX
try to export only the symbols matching REGEX
try to export only the symbols matching REGEX
-LLIBDIR search LIBDIR for required installed libraries
-lNAME OUTPUT-FILE requires the installed library libNAME
-module build a library that can dlopened
@ -6788,9 +6879,11 @@ The following components of LINK-COMMAND are treated specially:
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
-static do not do any dynamic linking of libtool libraries
-static do not do any dynamic linking of uninstalled libtool libraries
-static-libtool-libs
do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]]
specify library version info [each variable defaults to 0]
specify library version info [each variable defaults to 0]
All other options (arguments beginning with \`-') are ignored.

View File

@ -115,6 +115,7 @@ DRI_CFLAGS = @DRI_CFLAGS@
DRI_FALSE = @DRI_FALSE@
DRI_LIBS = @DRI_LIBS@
DRI_TRUE = @DRI_TRUE@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@ -143,6 +144,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@ -151,18 +153,25 @@ 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
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@
XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
@ -209,7 +218,6 @@ driverman_PRE = @DRIVER_NAME@.man
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = @DRIVER_NAME@.man
CLEANFILES = $(driverman_DATA)
SED = sed
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@

View File

@ -142,6 +142,7 @@ DRI_CFLAGS = @DRI_CFLAGS@
DRI_FALSE = @DRI_FALSE@
DRI_LIBS = @DRI_LIBS@
DRI_TRUE = @DRI_TRUE@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@ -170,6 +171,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@ -178,18 +180,25 @@ 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@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@
XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@

View File

@ -1,4 +1,3 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c,v 1.23 2003/12/22 17:48:10 tsi Exp $ */
/*
*

View File

@ -1,4 +1,3 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_bci.h,v 1.3 2002/05/14 20:19:51 alanh Exp $ */
#ifndef _S3BCI_H_
#define _S3BCI_H_

View File

@ -1,4 +1,3 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c,v 1.6 2003/01/18 15:22:29 eich Exp $ */
/*
Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
@ -391,7 +390,7 @@ Savage_OpenFramebuffer(
SavagePtr psav = SAVPTR(pScrn);
*name = NULL; /* no special device */
*mem = (unsigned char*)psav->FrameBufferBase;
*mem = (unsigned char*)psav->FbRegion.base;
*size = psav->videoRambytes;
*offset = 0;
*flags = DGA_NEED_ROOT;

View File

@ -467,8 +467,8 @@ static Bool SAVAGEDRIAgpInit(ScreenPtr pScreen)
xf86DrvMsg( pScreen->myNum, X_INFO,
"[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x; Card 0x%04x/0x%04x]\n",
mode, vendor, device,
psav->PciInfo->vendor,
psav->PciInfo->chipType );
VENDOR_ID(psav->PciInfo),
DEVICE_ID(psav->PciInfo));
if ( drmAgpEnable( psav->drmFD, mode ) < 0 ) {
xf86DrvMsg( pScreen->myNum, X_ERROR, "[agp] AGP not enabled\n" );
@ -624,7 +624,7 @@ static Bool SAVAGEDRIMapInit( ScreenPtr pScreen )
pSAVAGEDRIServer->registers.size = SAVAGEIOMAPSIZE;
if ( drmAddMap( psav->drmFD,
(drm_handle_t)psav->MmioBase,
(drm_handle_t)psav->MmioRegion.base,
pSAVAGEDRIServer->registers.size,
DRM_REGISTERS,0,
&pSAVAGEDRIServer->registers.handle ) < 0 ) {
@ -636,7 +636,7 @@ static Bool SAVAGEDRIMapInit( ScreenPtr pScreen )
pSAVAGEDRIServer->aperture.size = 5 * 0x01000000;
if ( drmAddMap( psav->drmFD,
(drm_handle_t)(psav->ApertureBase),
(drm_handle_t)(psav->ApertureRegion.base),
pSAVAGEDRIServer->aperture.size,
DRM_FRAME_BUFFER,0,
&pSAVAGEDRIServer->aperture.handle ) < 0 ) {
@ -882,14 +882,18 @@ Bool SAVAGEDRIScreenInit( ScreenPtr pScreen )
sprintf(pDRIInfo->busIdString,
"PCI:%d:%d:%d",
psav->PciInfo->bus,
#ifdef XSERVER_LIBPCIACCESS
psav->PciInfo->dev,
#else
psav->PciInfo->device,
#endif
psav->PciInfo->func);
}
pDRIInfo->ddxDriverMajorVersion = SAVAGE_VERSION_MAJOR;
pDRIInfo->ddxDriverMinorVersion = SAVAGE_VERSION_MINOR;
pDRIInfo->ddxDriverPatchVersion = SAVAGE_PATCHLEVEL;
pDRIInfo->frameBufferPhysicalAddress = (pointer) psav->FrameBufferBase;
pDRIInfo->frameBufferPhysicalAddress = (pointer) psav->FbRegion.base;
pDRIInfo->frameBufferSize = psav->videoRambytes;
pDRIInfo->frameBufferStride = pScrn->displayWidth*(pScrn->bitsPerPixel/8);
pDRIInfo->ddxDrawableTableEntry = SAVAGE_MAX_DRAWABLES;
@ -1115,14 +1119,7 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen )
pSAVAGEDRI->apertureHandle = pSAVAGEDRIServer->aperture.handle;
pSAVAGEDRI->apertureSize = pSAVAGEDRIServer->aperture.size;
{
unsigned int shift = 0;
if(pSAVAGEDRI->width > 1024)
shift = 1;
pSAVAGEDRI->aperturePitch = psav->ulAperturePitch;
}
pSAVAGEDRI->aperturePitch = psav->ulAperturePitch;
{
unsigned int value = 0;
@ -1432,11 +1429,11 @@ SAVAGEDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
if (nbox>1) {
/* Keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
pboxNew1 = xalloc(sizeof(BoxRec)*nbox);
if (!pboxNew1) return;
pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
pptNew1 = xalloc(sizeof(DDXPointRec)*nbox);
if (!pptNew1) {
DEALLOCATE_LOCAL(pboxNew1);
xfree(pboxNew1);
return;
}
pboxBase = pboxNext = pbox+nbox-1;
@ -1467,14 +1464,14 @@ SAVAGEDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
if (nbox > 1) {
/*reverse orderof rects in each band */
pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
pboxNew2 = xalloc(sizeof(BoxRec)*nbox);
pptNew2 = xalloc(sizeof(DDXPointRec)*nbox);
if (!pboxNew2 || !pptNew2) {
if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
if (pptNew2) xfree(pptNew2);
if (pboxNew2) xfree(pboxNew2);
if (pboxNew1) {
DEALLOCATE_LOCAL(pptNew1);
DEALLOCATE_LOCAL(pboxNew1);
xfree(pptNew1);
xfree(pboxNew1);
}
return;
}
@ -1529,12 +1526,12 @@ SAVAGEDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
SAVAGESelectBuffer(pScrn, SAVAGE_FRONT);
if (pboxNew2) {
DEALLOCATE_LOCAL(pptNew2);
DEALLOCATE_LOCAL(pboxNew2);
xfree(pptNew2);
xfree(pboxNew2);
}
if (pboxNew1) {
DEALLOCATE_LOCAL(pptNew1);
DEALLOCATE_LOCAL(pboxNew1);
xfree(pptNew1);
xfree(pboxNew1);
}
BCI_SEND(0xc0020000); /* wait for 2D idle */

View File

@ -39,6 +39,9 @@
#include "config.h"
#endif
#include <unistd.h>
#include <errno.h>
#include "xf86RAC.h"
#include "shadowfb.h"
@ -70,7 +73,13 @@ static void SavageDisableMMIO(ScrnInfoPtr pScrn);
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);
@ -111,7 +120,7 @@ static Bool SavageDDC1(int scrnIndex);
static unsigned int SavageDDC1Read(ScrnInfoPtr pScrn);
static void SavageProbeDDC(ScrnInfoPtr pScrn, int index);
static void SavageGetTvMaxSize(SavagePtr psav);
static Bool SavagePanningCheck(ScrnInfoPtr pScrn);
static Bool SavagePanningCheck(ScrnInfoPtr pScrn, DisplayModePtr pMode);
#ifdef XF86DRI
static Bool SavageCheckAvailableRamFor3D(ScrnInfoPtr pScrn);
#endif
@ -130,18 +139,38 @@ extern ScrnInfoPtr gpScrn;
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 */
@ -184,6 +213,7 @@ static SymTabRec SavageChipsets[] = {
{ -1, NULL }
};
#ifndef XSERVER_LIBPCIACCESS
/* This table maps a PCI device ID to a chipset family identifier. */
static PciChipsets SavagePciChipsets[] = {
@ -212,6 +242,7 @@ static PciChipsets SavagePciChipsets[] = {
{ S3_SUPERSAVAGE, PCI_CHIP_SUPSAV_IXCDDR, RES_SHARED_VGA },
{ -1, -1, RES_UNDEFINED }
};
#endif
typedef enum {
OPTION_PCI_BURST
@ -246,6 +277,7 @@ typedef enum {
,OPTION_AGP_MODE
,OPTION_AGP_SIZE
,OPTION_DRI
,OPTION_IGNORE_EDID
} SavageOpts;
@ -272,6 +304,7 @@ static const OptionInfoRec SavageOptions[] =
{ OPTION_DISABLE_COB, "DisableCOB", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_BCI_FOR_XV, "BCIforXv", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_DVI, "DVI", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_IGNORE_EDID, "IgnoreEDID", OPTV_BOOLEAN, {0}, FALSE },
#ifdef XF86DRI
{ OPTION_BUS_TYPE, "BusType", OPTV_ANYSTR, {0}, FALSE },
{ OPTION_DMA_TYPE, "DmaType", OPTV_ANYSTR, {0}, FALSE },
@ -283,6 +316,28 @@ static const OptionInfoRec SavageOptions[] =
{ -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",
@ -786,6 +841,82 @@ static void SavageIdentify(int flags)
}
#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;
@ -824,6 +955,8 @@ static Bool SavageProbe(DriverPtr drv, int flags)
NULL, NULL, NULL, NULL);
if (pScrn != NULL) {
SavagePtr psav;
pScrn->driverVersion = SAVAGE_VERSION;
pScrn->driverName = SAVAGE_DRIVER_NAME;
pScrn->name = "SAVAGE";
@ -837,6 +970,23 @@ static Bool SavageProbe(DriverPtr drv, int flags)
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]);
@ -890,6 +1040,7 @@ static int LookupChipID( PciChipsets* pset, int ChipID )
return -1;
}
#endif
static void SavageDoDDC(ScrnInfoPtr pScrn)
{
@ -924,11 +1075,12 @@ static void SavageDoDDC(ScrnInfoPtr pScrn)
xf86LoaderReqSymLists(i2cSymbols,NULL);
if (SavageI2CInit(pScrn)) {
unsigned char tmp;
xf86MonPtr pMon;
InI2CREG(tmp,psav->DDCPort);
OutI2CREG(tmp | 0x13,psav->DDCPort);
xf86SetDDCproperties(pScrn,xf86PrintEDID(
xf86DoEDID_DDC2(pScrn->scrnIndex,psav->I2C)));
pMon = xf86PrintEDID(xf86DoEDID_DDC2(pScrn->scrnIndex,psav->I2C));
if (!psav->IgnoreEDID) xf86SetDDCproperties(pScrn, pMon);
OutI2CREG(tmp,psav->DDCPort);
}
}
@ -1059,6 +1211,30 @@ static void SavageGetPanelInfo(ScrnInfoPtr pScrn)
psav->PanelX = panelX;
psav->PanelY = panelY;
do {
DisplayModePtr native = xf86CVTMode(panelX, panelY, 60.0, 0, 0);
if (!native)
break;
if (!pScrn->monitor->nHsync) {
pScrn->monitor->nHsync = 1;
pScrn->monitor->hsync[0].lo = 31.5;
pScrn->monitor->hsync[0].hi = (float)native->Clock /
(float)native->HTotal;
}
if (!pScrn->monitor->nVrefresh) {
pScrn->monitor->nVrefresh = 1;
pScrn->monitor->vrefresh[0].lo = 56.0;
pScrn->monitor->vrefresh[0].hi = (float)native->Clock * 1000.0 /
(float)native->HTotal /
(float)native->VTotal;
}
if (!pScrn->monitor->maxPixClock)
pScrn->monitor->maxPixClock = native->Clock;
xfree(native);
} while (0);
if( psav->LCDClock > 0.0 )
{
psav->maxClock = psav->LCDClock * 1000.0;
@ -1198,6 +1374,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
memcpy(psav->Options, SavageOptions, sizeof(SavageOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, psav->Options);
xf86GetOptValBool(psav->Options, OPTION_IGNORE_EDID, &psav->IgnoreEDID);
xf86GetOptValBool(psav->Options, OPTION_PCI_BURST, &psav->pci_burst);
if (psav->pci_burst) {
@ -1404,7 +1581,6 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
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);
@ -1413,11 +1589,9 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
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;
@ -1425,8 +1599,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
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);
}
@ -1439,7 +1612,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
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);
@ -1448,13 +1621,22 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
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
@ -1513,6 +1695,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
cap_ptr = (cap_id >> 8) & SAVAGE_CAP_PTR_MASK;
}
}
#endif
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "%s card detected\n",
(psav->IsPCI) ? "PCI" : "AGP");
@ -2906,97 +3089,136 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
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.
*/
psav->ApertureRegion.size = (psav->IsPrimary || psav->IsSecondary)
? (0x01000000 * 2) : (0x01000000 * 5);
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;
if (psav->ApertureRegion.size > psav->PciInfo->regions[2].size)
psav->ApertureRegion.size = psav->PciInfo->regions[2].size;
#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->MmioBase = psav->PciInfo->memBase[ psav->MmioRegion.bar ]
+ psav->MmioRegion.offset;
psav->FrameBufferBase = psav->PciInfo->memBase[ psav->FbRegion.bar ]
+ psav->FbRegion.offset;
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: could not map framebuffer range (%d, %s).\n",
err, strerror(err));
return FALSE;
}
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;
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;
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: could not map aperture range (%d, %s).\n",
err, strerror(err));
return FALSE;
}
psav->BciMem = psav->MapBase + 0x10000;
SavageEnableMMIO(pScrn);
psav->FBBase = psav->bar_mappings[ psav->FbRegion.bar ]
+ psav->FbRegion.offset;
psav->FBStart = (psav->IsSecondary)
? psav->FBBase + 0x1000000 : psav->FBBase;
psav->ApertureMap = psav->bar_mappings[ psav->ApertureRegion.bar ]
+ psav->ApertureRegion.offset;
if (psav->IsSecondary) {
psav->ApertureMap += 0x1000000;
psav->ApertureMap = (psav->IsSecondary)
? psav->ApertureRegion.memory + 0x1000000
: psav->ApertureRegion.memory;
}
pScrn->memPhysBase = psav->PciInfo->memBase[0];
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_MMIO,
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: could not map MMIO range (%d, %s).\n",
err, strerror(err));
return FALSE;
}
psav->MapBase = psav->MmioRegion.memory;
psav->BciMem = psav->MapBase + 0x10000;
SavageEnableMMIO(pScrn);
}
pScrn->memPhysBase = psav->FbRegion.base;
return TRUE;
}
@ -3004,30 +3226,55 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
static void SavageUnmapMem(ScrnInfoPtr pScrn, int All)
{
SavagePtr psav = SAVPTR(pScrn);
unsigned i;
TRACE(("SavageUnmapMem(%x,%x)\n", psav->MapBase, psav->FBBase));
if (psav->PrimaryVidMapped) {
vgaHWUnmapMem(pScrn);
psav->PrimaryVidMapped = FALSE;
vgaHWUnmapMem(pScrn);
psav->PrimaryVidMapped = FALSE;
}
SavageDisableMMIO(pScrn);
for (i = (All) ? 0 : 1; i <= psav->last_bar; i++) {
if (psav->bar_mappings[i]) {
xf86UnMapVidMem(pScrn->scrnIndex, psav->bar_mappings[i],
(1U << psav->PciInfo->size[i]));
psav->bar_mappings[i] = NULL;
}
if (All && (psav->MmioRegion.memory != NULL)) {
#ifdef XSERVER_LIBPCIACCESS
pci_device_unmap_range(psav->PciInfo,
psav->MmioRegion.memory,
psav->MmioRegion.size);
#else
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)psav->MapBase,
SAVAGE_NEWMMIO_REGSIZE);
#endif
psav->MmioRegion.memory = NULL;
psav->MapBase = 0;
psav->BciMem = 0;
}
if (All) {
psav->MapBase = 0;
psav->BciMem = 0;
if (psav->FbRegion.memory != NULL) {
#ifdef XSERVER_LIBPCIACCESS
pci_device_unmap_range(psav->PciInfo,
psav->FbRegion.memory,
psav->FbRegion.size);
#else
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)psav->FbRegion.base,
psav->FbRegion.size);
#endif
}
if (psav->ApertureRegion.memory != NULL) {
#ifdef XSERVER_LIBPCIACCESS
pci_device_unmap_range(psav->PciInfo,
psav->ApertureRegion.memory,
psav->ApertureRegion.size);
#else
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)psav->ApertureRegion.base,
psav->ApertureRegion.size);
#endif
}
psav->FbRegion.memory = NULL;
psav->ApertureRegion.memory = NULL;
psav->FBBase = 0;
psav->FBStart = 0;
psav->ApertureMap = 0;
@ -3116,7 +3363,7 @@ static void SavageInitShadowStatus(ScrnInfoPtr pScrn)
if( psav->ShadowStatus ) {
psav->ShadowPhysical =
psav->FrameBufferBase + psav->CursorKByte*1024 + 4096 - 32;
psav->FbRegion.base + psav->CursorKByte*1024 + 4096 - 32;
psav->ShadowVirtual = (CARD32 *)
(psav->FBBase + psav->CursorKByte*1024 + 4096 - 32);
@ -3413,7 +3660,7 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
}
#endif
SavagePanningCheck(pScrn);
SavagePanningCheck(pScrn, pScrn->currentMode);
#ifdef XvExtension
if( !psav->FBStart2nd && !psav->NoAccel /*&& !SavagePanningCheck(pScrn)*/ ) {
if (psav->IsSecondary)
@ -4059,7 +4306,7 @@ Bool SavageSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
pSavEnt = pPriv->ptr;
SavageModeInit(pSavEnt->pSecondaryScrn, pSavEnt->pSecondaryScrn->currentMode);
}
SavagePanningCheck(pScrn);
SavagePanningCheck(pScrn, mode);
return success;
}
@ -4515,7 +4762,8 @@ SavageDDC1(int scrnIndex)
xf86PrintEDID(pMon);
xf86SetDDCproperties(pScrn,pMon);
if (!psav->IgnoreEDID)
xf86SetDDCproperties(pScrn,pMon);
/* undo initialization */
OutI2CREG(byte,psav->I2CPort);
@ -4538,12 +4786,9 @@ SavageGetTvMaxSize(SavagePtr psav)
static Bool
SavagePanningCheck(ScrnInfoPtr pScrn)
SavagePanningCheck(ScrnInfoPtr pScrn, DisplayModePtr pMode)
{
SavagePtr psav = SAVPTR(pScrn);
DisplayModePtr pMode;
pMode = pScrn->currentMode;
psav->iResX = pMode->CrtcHDisplay;
psav->iResY = pMode->CrtcVDisplay;

View File

@ -33,6 +33,19 @@
#include <string.h>
#include <math.h>
#ifdef XSERVER_LIBPCIACCESS
#include <pciaccess.h>
#define VENDOR_ID(p) (p)->vendor_id
#define DEVICE_ID(p) (p)->device_id
#define SUBSYS_ID(p) (p)->subdevice_id
#define CHIP_REVISION(p) (p)->revision
#else
#define VENDOR_ID(p) (p)->vendor
#define DEVICE_ID(p) (p)->chipType
#define SUBSYS_ID(p) (p)->subsysCard
#define CHIP_REVISION(p) (p)->chipRev
#endif
#define MODE_24 24
#include "compiler.h"
@ -267,8 +280,14 @@ typedef struct _StatInfo {
} StatInfoRec,*StatInfoPtr;
struct savage_region {
unsigned bar;
unsigned long offset;
#ifdef XSERVER_LIBPCIACCESS
pciaddr_t base;
pciaddr_t size;
#else
unsigned long base;
unsigned long size;
#endif
void * memory;
};
typedef struct _Savage {
@ -292,18 +311,12 @@ typedef struct _Savage {
int endfb;
/* These are physical addresses. */
unsigned long FrameBufferBase;
unsigned long MmioBase;
unsigned long ApertureBase;
unsigned long ShadowPhysical;
/* These are linear addresses. */
struct savage_region MmioRegion;
struct savage_region FbRegion;
struct savage_region ApertureRegion;
unsigned last_bar;
unsigned char* bar_mappings[3];
unsigned char* MapBase;
unsigned char* BciMem;
@ -322,6 +335,7 @@ typedef struct _Savage {
/* Here are all the Options */
OptionInfoPtr Options;
Bool IgnoreEDID;
Bool ShowCache;
Bool pci_burst;
Bool NoPCIRetry;
@ -363,8 +377,12 @@ typedef struct _Savage {
int TVSizeY;
CloseScreenProcPtr CloseScreen;
#ifdef XSERVER_LIBPCIACCESS
struct pci_device * PciInfo;
#else
pciVideoPtr PciInfo;
PCITAG PciTag;
#endif
int Chipset;
int ChipId;
int ChipRev;

View File

@ -460,7 +460,6 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
CARD32 * srcp;
Bpp = pDst->drawable.bitsPerPixel / 8;
dwords = (((w * Bpp) + 3) >> 2) * h;
psav->sbd_offset = exaGetPixmapOffset(pDst);
psav->sbd_high = SavageSetBD(psav, pDst);
@ -486,17 +485,19 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
BCI_SEND(BCI_X_Y(x, y));
BCI_SEND(BCI_W_H(w, h));
srcp = (CARD32 *)src;
queue = 120 * 1024;
while (dwords) {
if (queue < 4) {
BCI_RESET;
queue = 120 * 1024;
dwords = (((w * Bpp) + 3) >> 2);
for (i = 0; i < h; i++) {
srcp = (CARD32 *)src;
for (j = 0; j < dwords; j++) {
if (queue < 4) {
BCI_RESET;
queue = 120 * 1024;
}
BCI_SEND(*srcp++);
queue -= 4;
}
BCI_SEND(*srcp);
queue -= 4;
dwords--;
srcp++;
src += src_pitch;
}
/*exaWaitSync(pDst->drawable.pScreen);*/

View File

@ -202,7 +202,7 @@ Bool SAVAGEInitMC(ScreenPtr pScreen)
return FALSE;
}
offset = pSAVAGE->hwmcOffset + pSAVAGE->FrameBufferBase;
offset = pSAVAGE->hwmcOffset + pSAVAGE->FbRegion.base;
if(drmAddMap(pSAVAGE->drmFD, offset, pSAVAGE->hwmcSize,
DRM_FRAME_BUFFER, 0, &pSAVAGEDriPriv->xvmcSurfHandle) < 0)

View File

@ -1,4 +1,3 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_i2c.c,v 1.1 2001/02/13 21:15:19 dawes Exp $ */
/*
Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.

View File

@ -1,4 +1,3 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h,v 1.11 2002/05/14 20:19:52 alanh Exp $ */
#ifndef _SAVAGE_REGS_H
#define _SAVAGE_REGS_H

View File

@ -1,4 +1,3 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_shadow.c,v 1.3 2000/03/31 20:13:33 dawes Exp $ */
/*
Copyright (c) 1999,2000 The XFree86 Project Inc.

View File

@ -1,4 +1,3 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c,v 1.11 2002/05/14 20:19:52 alanh Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@ -19,7 +18,6 @@
#endif
#define L_ADD(x) (B_O32(x) & 0xffff) + ((B_O32(x) >> 12) & 0xffff00)
Bool vbeModeInit( vbeInfoPtr, int );
static int SavageGetDevice( SavagePtr psav );
/*static int SavageGetTVType( SavagePtr psav );*/
void SavageSetVESAModeCrtc1( SavagePtr psav, int n, int Refresh );
@ -187,15 +185,6 @@ SavageSetVESAMode( SavagePtr psav, int n, int Refresh )
ErrorF("Set video mode failed\n");
}
}
#ifdef XFree86LOADER
else
{
if( !vbeModeInit( psav->pVbe, n ) )
{
ErrorF("Set video mode failed\n");
}
}
#endif
}
void

View File

@ -1,4 +1,3 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.h,v 1.1 2000/12/02 01:16:15 dawes Exp $ */
/*
This file was originally part of the Linux Real-Mode Interface, or LRMI.

View File

@ -1177,7 +1177,7 @@ SavageCopyPlanarDataBCI(
SavagePtr psav = SAVPTR(pScrn);
/* half of the dest buffer for copying the YVU data to it ??? */
unsigned char *dstCopy = (unsigned char *)(((unsigned long)dst
+ 2 * srcPitch * h
+ dstPitch * h
+ 0x0f) & ~0x0f);
/* for pixel transfer */
unsigned long offsetY = (unsigned long)dstCopy - (unsigned long)psav->FBBase;
@ -1189,21 +1189,15 @@ SavageCopyPlanarDataBCI(
BCI_GET_PTR;
/* copy Y planar */
for (i=0;i<srcPitch * h;i++) {
dstCopy[i] = srcY[i];
}
memcpy(dstCopy, srcY, srcPitch * h);
/* copy V planar */
dstCopy = dstCopy + srcPitch * h;
for (i=0;i<srcPitch2 * (h>>1);i++) {
dstCopy[i] = srcV[i];
}
memcpy(dstCopy, srcV, srcPitch2 * (h>>1));
/* copy U planar */
dstCopy = dstCopy + srcPitch2 * (h>>1);
for (i=0;i<srcPitch2 * (h>>1);i++) {
dstCopy[i] = srcU[i];
}
memcpy(dstCopy, srcU, srcPitch2 * (h>>1));
/*
* Transfer pixel data from one memory location to another location
@ -1253,6 +1247,9 @@ SavageCopyData(
int w
){
w <<= 1;
if (w == srcPitch && w == dstPitch) {
memcpy(dst, src, w * h);
} else
while(h--) {
memcpy(dst, src, w);
src += srcPitch;
@ -1469,11 +1466,12 @@ SavageDisplayVideoOld(
if( psav->videoFourCC != id )
SavageStreamsOff(pScrn);
if( !psav->videoFlags & VF_STREAMS_ON )
if( !(psav->videoFlags & VF_STREAMS_ON) )
{
SavageSetBlend(pScrn,id);
SavageStreamsOn(pScrn);
SavageResetVideo(pScrn);
pPriv->lastKnownPitch = 0;
}
if (S3_MOBILE_TWISTER_SERIES(psav->Chipset)
@ -1491,31 +1489,42 @@ SavageDisplayVideoOld(
* Process horizontal scaling
* upscaling and downscaling smaller than 2:1 controled by MM8198
* MM8190 controls downscaling mode larger than 2:1
* Together MM8190 and MM8198 can set arbitrary downscale up to 64:1
*/
scalratio = 0;
ssControl = 0;
if (src_w >= (drw_w * 2)) {
if (src_w < (drw_w * 4)) {
scalratio = HSCALING(2,1);
} else if (src_w < (drw_w * 8)) {
ssControl |= HDSCALE_4;
} else if (src_w < (drw_w * 16)) {
scalratio = HSCALING(src_w,(drw_w*4));
} else if (src_w < (drw_w * 8)) {
ssControl |= HDSCALE_8;
} else if (src_w < (drw_w * 32)) {
scalratio = HSCALING(src_w,(drw_w*8));
} else if (src_w < (drw_w * 16)) {
ssControl |= HDSCALE_16;
} else if (src_w < (drw_w * 64)) {
scalratio = HSCALING(src_w,(drw_w*16));
} else if (src_w < (drw_w * 32)) {
ssControl |= HDSCALE_32;
} else
scalratio = HSCALING(src_w,(drw_w*32));
} else if (src_w < (drw_w * 64)) {
ssControl |= HDSCALE_64;
scalratio = HSCALING(src_w,(drw_w*64));
} else {
/* Request beyond maximum downscale! */
ssControl |= HDSCALE_64;
scalratio = HSCALING(2,1);
}
} else
scalratio = HSCALING(src_w,drw_w);
ssControl |= src_w;
/*ssControl |= (1 << 24);*/
ssControl |= (GetBlendForFourCC(psav->videoFourCC) << 24);
#if 0
/* Wait for VBLANK. */
VerticalRetraceWait();
#endif
OUTREG(SSTREAM_CONTROL_REG, ssControl);
if (scalratio)
OUTREG(SSTREAM_STRETCH_REG,scalratio);
@ -1612,11 +1621,12 @@ SavageDisplayVideoNew(
if( psav->videoFourCC != id )
SavageStreamsOff(pScrn);
if( !psav->videoFlags & VF_STREAMS_ON )
if( !(psav->videoFlags & VF_STREAMS_ON) )
{
SavageSetBlend(pScrn,id);
SavageStreamsOn(pScrn);
SavageResetVideo(pScrn);
pPriv->lastKnownPitch = 0;
}
/* Calculate horizontal and vertical scale factors. */
@ -1746,11 +1756,12 @@ SavageDisplayVideo2000(
if( psav->videoFourCC != id )
SavageStreamsOff(pScrn);
if( !psav->videoFlags & VF_STREAMS_ON )
if( !(psav->videoFlags & VF_STREAMS_ON) )
{
SavageSetBlend(pScrn,id);
SavageStreamsOn(pScrn);
SavageResetVideo(pScrn);
pPriv->lastKnownPitch = 0;
}
if (src_w > drw_w)
@ -1912,6 +1923,10 @@ SavagePutImage(
break;
}
if (srcPitch2 != 0 && S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv) {
new_size = ((new_size + 0xF) & ~0xF) + srcPitch * height + srcPitch2 * height;
}
/* if(!(pPriv->area = SavageAllocateMemory(pScrn, pPriv->area, new_h)))
return BadAlloc;*/
pPriv->video_offset = SavageAllocateMemory(pScrn, &pPriv->video_memory,
@ -1937,7 +1952,7 @@ SavagePutImage(
offsetU += tmp;
offsetV += tmp;
nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
if (S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv) {
if (S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv && (npixels & 0xF) == 0) {
SavageCopyPlanarDataBCI(
pScrn,
buf + (top * srcPitch) + (left >> 1),