summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-08-21 19:55:25 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-08-21 19:55:25 +0000
commitb5853db3122a860ffd437103d8e6ec33a52296bb (patch)
tree725fb2f8961ef7b2e47a3a30dc8cd56c25b984e8 /driver
parent69d970562c2db16e8757fdc954bd4d2af9df5336 (diff)
update to xf86-video-siliconmotion 1.6.0
Diffstat (limited to 'driver')
-rw-r--r--driver/xf86-video-siliconmotion/Makefile.in9
-rw-r--r--driver/xf86-video-siliconmotion/aclocal.m4727
-rw-r--r--driver/xf86-video-siliconmotion/configure1906
-rw-r--r--driver/xf86-video-siliconmotion/configure.ac14
-rw-r--r--driver/xf86-video-siliconmotion/ltmain.sh277
-rw-r--r--driver/xf86-video-siliconmotion/man/Makefile.in10
-rw-r--r--driver/xf86-video-siliconmotion/man/siliconmotion.man24
-rw-r--r--driver/xf86-video-siliconmotion/src/Makefile.am3
-rw-r--r--driver/xf86-video-siliconmotion/src/Makefile.in20
-rw-r--r--driver/xf86-video-siliconmotion/src/regsmi.h191
-rw-r--r--driver/xf86-video-siliconmotion/src/smi.h362
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_accel.c1117
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_dac.c109
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_dga.c328
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_driver.c5533
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_exa.c540
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_hwcurs.c516
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_i2c.c81
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_pcirename.h122
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_shadow.c529
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_video.c2064
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_video.h22
-rw-r--r--driver/xf86-video-siliconmotion/src/smi_xaa.c844
23 files changed, 8291 insertions, 7057 deletions
diff --git a/driver/xf86-video-siliconmotion/Makefile.in b/driver/xf86-video-siliconmotion/Makefile.in
index 359daa2e8..d1adf0f56 100644
--- a/driver/xf86-video-siliconmotion/Makefile.in
+++ b/driver/xf86-video-siliconmotion/Makefile.in
@@ -119,6 +119,7 @@ DEPDIR = @DEPDIR@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DRIVER_NAME = @DRIVER_NAME@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -147,6 +148,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@
@@ -155,18 +157,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@
diff --git a/driver/xf86-video-siliconmotion/aclocal.m4 b/driver/xf86-video-siliconmotion/aclocal.m4
index 6543017d8..a3a3008cb 100644
--- a/driver/xf86-video-siliconmotion/aclocal.m4
+++ b/driver/xf86-video-siliconmotion/aclocal.m4
@@ -13,7 +13,7 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-# serial 48 AC_PROG_LIBTOOL
+# serial 52 AC_PROG_LIBTOOL
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
@@ -101,7 +101,6 @@ AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
AC_REQUIRE([AC_OBJEXT])dnl
AC_REQUIRE([AC_EXEEXT])dnl
dnl
-
AC_LIBTOOL_SYS_MAX_CMD_LEN
AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
AC_LIBTOOL_OBJDIR
@@ -176,7 +175,7 @@ test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o
# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
@@ -203,6 +202,8 @@ file_magic*)
;;
esac
+_LT_REQUIRED_DARWIN_CHECKS
+
AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
enable_win32_dll=yes, enable_win32_dll=no)
@@ -263,8 +264,9 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# Check for compiler boilerplate output or warnings with
# the simple compiler test code.
AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
@@ -276,13 +278,85 @@ $rm conftest*
# Check for linker boilerplate output or warnings with
# the simple link test code.
AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
])# _LT_LINKER_BOILERPLATE
+# _LT_REQUIRED_DARWIN_CHECKS
+# --------------------------
+# Check for some things on darwin
+AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ echo "int foo(void){return 1;}" > conftest.c
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib ${wl}-single_module conftest.c
+ if test -f libconftest.dylib; then
+ lt_cv_apple_cc_single_mod=yes
+ rm -rf libconftest.dylib*
+ fi
+ rm conftest.c
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[0123]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*)
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil="~$DSYMUTIL \$lib || :"
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
# _LT_AC_SYS_LIBPATH_AIX
# ----------------------
@@ -293,12 +367,20 @@ $rm conftest*
# If we don't find anything, use the default library path according
# to the aix ld manual.
AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi],[])
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
])# _LT_AC_SYS_LIBPATH_AIX
@@ -529,13 +611,17 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
*32-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
@@ -552,6 +638,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
;;
*64-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
@@ -592,7 +681,11 @@ sparc*-*solaris*)
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
esac
;;
esac
@@ -623,7 +716,7 @@ AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
AC_CACHE_CHECK([$1], [$2],
[$2=no
ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$3"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -664,11 +757,12 @@ fi
# ------------------------------------------------------------
# Check whether the given compiler option works
AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
[$2=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $3"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -684,7 +778,7 @@ AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
$2=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
])
@@ -782,24 +876,27 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
fi
;;
*)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
= "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
;;
esac
])
@@ -952,7 +1049,7 @@ else
AC_CHECK_FUNC([shl_load],
[lt_cv_dlopen="shl_load"],
[AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
[AC_CHECK_FUNC([dlopen],
[lt_cv_dlopen="dlopen"],
[AC_CHECK_LIB([dl], [dlopen],
@@ -960,7 +1057,7 @@ else
[AC_CHECK_LIB([svld], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
[AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
])
])
])
@@ -1026,7 +1123,8 @@ fi
# ---------------------------------
# Check to see if options -c and -o are simultaneously supported by compiler
AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
[_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
[_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
@@ -1034,7 +1132,7 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -1174,6 +1272,7 @@ else
darwin*)
if test -n "$STRIP" ; then
striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
@@ -1191,7 +1290,8 @@ fi
# -----------------------------
# PORTME Fill in your ld.so characteristics
AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_MSG_CHECKING([dynamic linker characteristics])
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
library_names_spec=
libname_spec='lib$name'
soname_spec=
@@ -1205,20 +1305,58 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
+m4_if($1,[],[
if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`echo $lt_search_path_spec`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+fi])
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -1236,7 +1374,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[[4-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -1375,12 +1513,8 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+ m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -1397,18 +1531,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -1446,7 +1568,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -1509,7 +1631,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[[3-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -1564,7 +1686,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -1580,7 +1702,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -1593,18 +1715,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -1686,6 +1796,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -1781,6 +1895,13 @@ esac
AC_MSG_RESULT([$dynamic_linker])
test "$dynamic_linker" = no && can_build_shared=no
+AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
+[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
+[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -1791,7 +1912,8 @@ fi
# _LT_AC_TAGCONFIG
# ----------------
AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_ARG_WITH([tags],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_ARG_WITH([tags],
[AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
[include additional configurations @<:@automatic@:>@])],
[tagnames="$withval"])
@@ -2052,7 +2174,7 @@ m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
# AC_PATH_TOOL_PREFIX
# -------------------
-# find a file program which can recognise shared library
+# find a file program which can recognize shared library
AC_DEFUN([AC_PATH_TOOL_PREFIX],
[AC_REQUIRE([AC_PROG_EGREP])dnl
AC_MSG_CHECKING([for $1])
@@ -2115,7 +2237,7 @@ fi
# AC_PATH_MAGIC
# -------------
-# find a file program which can recognise a shared library
+# find a file program which can recognize a shared library
AC_DEFUN([AC_PATH_MAGIC],
[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
if test -z "$lt_cv_path_MAGIC_CMD"; then
@@ -2262,7 +2384,7 @@ esac
# how to check for library dependencies
# -- PORTME fill in with the dynamic library characteristics
AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependent libraries],
+[AC_CACHE_CHECK([how to recognize dependent libraries],
lt_cv_deplibs_check_method,
[lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
@@ -2279,7 +2401,7 @@ lt_cv_deplibs_check_method='unknown'
# whether `pass_all' will *always* work, you probably want this one.
case $host_os in
-aix4* | aix5*)
+aix[[4-9]]*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -2301,16 +2423,22 @@ cygwin*)
mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
;;
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | kfreebsd*-gnu | dragonfly*)
+freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
@@ -2348,7 +2476,7 @@ hpux10.20* | hpux11*)
esac
;;
-interix3*)
+interix[[3-9]]*)
# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
;;
@@ -2364,7 +2492,7 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -2398,6 +2526,10 @@ osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -2450,7 +2582,7 @@ AC_DEFUN([AC_PROG_NM],
lt_cv_path_NM="$NM"
else
lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
lt_nm_to_check="$lt_nm_to_check nm"
fi
for lt_tmp_nm in $lt_nm_to_check; do
@@ -2666,10 +2798,10 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
+lt_simple_link_test_code='int main(){return(0);}'
_LT_AC_SYS_COMPILER
@@ -2705,7 +2837,7 @@ aix3*)
fi
;;
-aix4* | aix5*)
+aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -2762,6 +2894,7 @@ _LT_AC_TAGVAR(postdep_objects, $1)=
_LT_AC_TAGVAR(predeps, $1)=
_LT_AC_TAGVAR(postdeps, $1)=
_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
# Source file extension for C++ test sources.
ac_ext=cpp
@@ -2771,10 +2904,10 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
@@ -2871,7 +3004,7 @@ case $host_os in
# FIXME: insert proper C++ library support
_LT_AC_TAGVAR(ld_shlibs, $1)=no
;;
- aix4* | aix5*)
+ aix[[4-9]]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -2884,7 +3017,7 @@ case $host_os in
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
case $ld_flag in
*-brtl*)
@@ -2920,7 +3053,7 @@ case $host_os in
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ :
else
# We have old collect2
_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
@@ -3030,59 +3163,31 @@ case $host_os in
fi
;;
darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_automatic, $1)=yes
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ if test "$GXX" = yes ; then
output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -3116,7 +3221,7 @@ case $host_os in
freebsd-elf*)
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
_LT_AC_TAGVAR(ld_shlibs, $1)=yes
@@ -3165,9 +3270,7 @@ case $host_os in
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- ;;
+ hppa*64*|ia64*) ;;
*)
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
;;
@@ -3235,7 +3338,7 @@ case $host_os in
;;
esac
;;
- interix3*)
+ interix[[3-9]]*)
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
@@ -3275,7 +3378,7 @@ case $host_os in
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -3327,7 +3430,7 @@ case $host_os in
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
@@ -3355,6 +3458,29 @@ case $host_os in
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
esac
;;
lynxos*)
@@ -3399,9 +3525,9 @@ case $host_os in
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
fi
output_verbose_link_cmd='echo'
else
@@ -3568,15 +3694,10 @@ case $host_os in
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
;;
esac
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
@@ -3623,6 +3744,12 @@ case $host_os in
fi
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
fi
;;
esac
@@ -3738,7 +3865,8 @@ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
# compiler output when linking a shared library.
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
dnl we can't use the lt_simple_compile_test_code here,
dnl because it contains code intended for an executable,
dnl not a library. It's possible we should let each
@@ -3863,10 +3991,15 @@ fi
$rm -f confest.$objext
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
# PORTME: override above test on systems where it is broken
ifelse([$1],[CXX],
[case $host_os in
-interix3*)
+interix[[3-9]]*)
# Interix 3.5 installs completely hosed .la files for C++, so rather than
# hack all around it, let's just trust "g++" to DTRT.
_LT_AC_TAGVAR(predep_objects,$1)=
@@ -3874,19 +4007,51 @@ interix3*)
_LT_AC_TAGVAR(postdeps,$1)=
;;
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ #
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
solaris*)
case $cc_basename in
CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
# Adding this requires a known-good setup of shared libraries for
# Sun compiler versions before 5.6, else PIC objects from an old
# archive will be linked into the output, leading to subtle bugs.
- _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
;;
esac
;;
esac
])
-
case " $_LT_AC_TAGVAR(postdeps, $1) " in
*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
esac
@@ -3929,10 +4094,17 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
+lt_simple_link_test_code="\
+ program t
+ end
+"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
@@ -3964,7 +4136,7 @@ aix3*)
postinstall_cmds='$RANLIB $lib'
fi
;;
-aix4* | aix5*)
+aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -4011,10 +4183,10 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
+lt_simple_compile_test_code="class foo {}"
# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
@@ -4067,7 +4239,7 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
# Code to be used in simple link tests
lt_simple_link_test_code="$lt_simple_compile_test_code"
@@ -4141,6 +4313,7 @@ if test -f "$ltmain"; then
_LT_AC_TAGVAR(predeps, $1) \
_LT_AC_TAGVAR(postdeps, $1) \
_LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
_LT_AC_TAGVAR(archive_cmds, $1) \
_LT_AC_TAGVAR(archive_expsym_cmds, $1) \
_LT_AC_TAGVAR(postinstall_cmds, $1) \
@@ -4156,6 +4329,7 @@ if test -f "$ltmain"; then
_LT_AC_TAGVAR(module_cmds, $1) \
_LT_AC_TAGVAR(module_expsym_cmds, $1) \
_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+ _LT_AC_TAGVAR(fix_srcfile_path, $1) \
_LT_AC_TAGVAR(exclude_expsyms, $1) \
_LT_AC_TAGVAR(include_expsyms, $1); do
@@ -4202,7 +4376,7 @@ ifelse([$1], [],
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
#
# This file is part of GNU Libtool:
@@ -4439,6 +4613,10 @@ predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
# shared library.
postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
@@ -4527,7 +4705,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
@@ -4610,6 +4788,7 @@ fi
# ---------------------------------
AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([LT_AC_PROG_SED])
AC_REQUIRE([AC_PROG_NM])
AC_REQUIRE([AC_OBJEXT])
# Check for command to grab the raw symbol name followed by C symbol from nm.
@@ -4646,7 +4825,7 @@ hpux*) # Its linker distinguishes data from code symbols
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
;;
-linux*)
+linux* | k*bsd*-gnu)
if test "$host_cpu" = ia64; then
symcode='[[ABCDGIRSTW]]'
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
@@ -4787,7 +4966,7 @@ EOF
echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
cat conftest.$ac_ext >&5
fi
- rm -f conftest* conftst*
+ rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
@@ -4836,13 +5015,16 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
# like `-m68040'.
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | os2* | pw32*)
+ mingw* | cygwin* | os2* | pw32*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
# PIC is the default on this platform
@@ -4853,7 +5035,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
# DJGPP does not support shared libraries at all
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
;;
- interix3*)
+ interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -4879,7 +5061,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
esac
else
case $host_os in
- aix4* | aix5*)
+ aix[[4-9]]*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
@@ -4919,7 +5101,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
;;
esac
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@@ -4962,7 +5144,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
;;
esac
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@@ -4975,7 +5157,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler.
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
@@ -4989,6 +5171,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
;;
esac
;;
@@ -5109,14 +5299,17 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
@@ -5125,7 +5318,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
;;
- interix3*)
+ interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -5183,10 +5376,11 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
hpux9* | hpux10* | hpux11*)
@@ -5216,7 +5410,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
@@ -5235,6 +5429,22 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
# All Alpha code is PIC.
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -5244,6 +5454,10 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ rdos*)
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
solaris*)
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -5303,7 +5517,7 @@ AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
#
if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
- _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
[$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
[case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
"" | " "*) ;;
@@ -5327,7 +5541,7 @@ esac
#
wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
$lt_tmp_static_flag,
[],
[_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
@@ -5338,11 +5552,12 @@ AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
# ------------------------------------
# See if the linker supports building shared libraries.
AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
ifelse([$1],[CXX],[
_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
case $host_os in
- aix4* | aix5*)
+ aix[[4-9]]*)
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
@@ -5355,12 +5570,13 @@ ifelse([$1],[CXX],[
_LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
;;
cygwin* | mingw*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
;;
*)
_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
esac
+ _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
],[
runpath_var=
_LT_AC_TAGVAR(allow_undefined_flag, $1)=
@@ -5391,12 +5607,14 @@ ifelse([$1],[CXX],[
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+ _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
_LT_CC_BASENAME([$compiler])
@@ -5446,7 +5664,7 @@ ifelse([$1],[CXX],[
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[[3-9]]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -5494,7 +5712,7 @@ EOF
_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_AC_TAGVAR(always_export_symbols, $1)=no
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -5512,7 +5730,7 @@ EOF
fi
;;
- interix3*)
+ interix[[3-9]]*)
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
@@ -5527,7 +5745,7 @@ EOF
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -5545,13 +5763,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -5591,7 +5818,7 @@ EOF
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
_LT_AC_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
@@ -5656,7 +5883,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[[4-9]]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -5676,7 +5903,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -5710,7 +5937,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ :
else
# We have old collect2
_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
@@ -5803,7 +6030,7 @@ _LT_EOF
# The linker will automatically build a .lib file if we build a DLL.
_LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
# FIXME: Should let the user specify the lib program.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
_LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
;;
@@ -5836,19 +6063,18 @@ _LT_EOF
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -5888,7 +6114,7 @@ _LT_EOF
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_AC_TAGVAR(hardcode_direct, $1)=yes
@@ -6011,15 +6237,15 @@ _LT_EOF
openbsd*)
if test -f /usr/libexec/ld.so; then
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
@@ -6028,10 +6254,10 @@ _LT_EOF
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
fi
;;
@@ -6090,17 +6316,16 @@ _LT_EOF
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
- *)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
;;
@@ -6157,7 +6382,7 @@ _LT_EOF
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
_LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -6232,7 +6457,7 @@ x|xyes)
# to ld, don't add -lc before -lgcc.
AC_MSG_CHECKING([whether -lc should be explicitly linked in])
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
soname=conftest
@@ -6335,6 +6560,30 @@ AC_DEFUN([LT_AC_PROG_RC],
[AC_CHECK_TOOL(RC, windres, no)
])
+
+# Cheap backport of AS_EXECUTABLE_P and required macros
+# from Autoconf 2.59; we should not use $as_executable_p directly.
+
+# _AS_TEST_PREPARE
+# ----------------
+m4_ifndef([_AS_TEST_PREPARE],
+[m4_defun([_AS_TEST_PREPARE],
+[if test -x / >/dev/null 2>&1; then
+ as_executable_p='test -x'
+else
+ as_executable_p='test -f'
+fi
+])])# _AS_TEST_PREPARE
+
+# AS_EXECUTABLE_P
+# ---------------
+# Check whether a file is executable.
+m4_ifndef([AS_EXECUTABLE_P],
+[m4_defun([AS_EXECUTABLE_P],
+[AS_REQUIRE([_AS_TEST_PREPARE])dnl
+$as_executable_p $1[]dnl
+])])# AS_EXECUTABLE_P
+
# NOTE: This macro has been submitted for inclusion into #
# GNU Autoconf as AC_PROG_SED. When it is available in #
# a released version of Autoconf we should remove this #
@@ -6355,12 +6604,13 @@ do
test -z "$as_dir" && as_dir=.
for lt_ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
fi
done
done
done
+IFS=$as_save_IFS
lt_ac_max=0
lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -6393,6 +6643,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
done
])
SED=$lt_cv_path_SED
+AC_SUBST([SED])
AC_MSG_RESULT([$SED])
])
@@ -7427,7 +7678,7 @@ AC_DEFUN([XORG_MACROS_VERSION],[
XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
- [XORG_MACROS_version=1.1.5
+ [XORG_MACROS_version=1.1.6
XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
@@ -7576,7 +7827,11 @@ AC_DEFUN([XORG_CHECK_LINUXDOC],[
XORG_SGML_PATH=$prefix/share/sgml
HAVE_DEFS_ENT=
-AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+if test x"$cross_compiling" = x"yes" ; then
+ HAVE_DEFS_ENT=no
+else
+ AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
AC_PATH_PROG(LINUXDOC, linuxdoc)
AC_PATH_PROG(PS2PDF, ps2pdf)
@@ -7897,14 +8152,14 @@ AC_DEFUN([XORG_RELEASE_VERSION],[
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
[`echo $PACKAGE_VERSION | cut -d . -f 1`],
[Major version of this package])
- PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
+ PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
if test "x$PVM" = "x"; then
PVM="0"
fi
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
[$PVM],
[Minor version of this package])
- PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
+ PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
if test "x$PVP" = "x"; then
PVP="0"
fi
diff --git a/driver/xf86-video-siliconmotion/configure b/driver/xf86-video-siliconmotion/configure
index 3c42ad3d1..c1a042d75 100644
--- a/driver/xf86-video-siliconmotion/configure
+++ b/driver/xf86-video-siliconmotion/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for xf86-video-siliconmotion 1.4.2.
+# Generated by GNU Autoconf 2.59 for xf86-video-siliconmotion 1.6.0.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='xf86-video-siliconmotion'
PACKAGE_TARNAME='xf86-video-siliconmotion'
-PACKAGE_VERSION='1.4.2'
-PACKAGE_STRING='xf86-video-siliconmotion 1.4.2'
+PACKAGE_VERSION='1.6.0'
+PACKAGE_STRING='xf86-video-siliconmotion 1.6.0'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
ac_unique_file="Makefile.am"
@@ -465,7 +465,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PKG_CONFIG ac_pt_PKG_CONFIG XORG_CFLAGS XORG_LIBS moduledir DRIVER_NAME APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE SED EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PKG_CONFIG ac_pt_PKG_CONFIG XORG_CFLAGS XORG_LIBS PCIACCESS_CFLAGS PCIACCESS_LIBS XSERVER_LIBPCIACCESS_TRUE XSERVER_LIBPCIACCESS_FALSE moduledir DRIVER_NAME APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -958,6 +958,14 @@ ac_env_XORG_LIBS_set=${XORG_LIBS+set}
ac_env_XORG_LIBS_value=$XORG_LIBS
ac_cv_env_XORG_LIBS_set=${XORG_LIBS+set}
ac_cv_env_XORG_LIBS_value=$XORG_LIBS
+ac_env_PCIACCESS_CFLAGS_set=${PCIACCESS_CFLAGS+set}
+ac_env_PCIACCESS_CFLAGS_value=$PCIACCESS_CFLAGS
+ac_cv_env_PCIACCESS_CFLAGS_set=${PCIACCESS_CFLAGS+set}
+ac_cv_env_PCIACCESS_CFLAGS_value=$PCIACCESS_CFLAGS
+ac_env_PCIACCESS_LIBS_set=${PCIACCESS_LIBS+set}
+ac_env_PCIACCESS_LIBS_value=$PCIACCESS_LIBS
+ac_cv_env_PCIACCESS_LIBS_set=${PCIACCESS_LIBS+set}
+ac_cv_env_PCIACCESS_LIBS_value=$PCIACCESS_LIBS
#
# Report the --help message.
@@ -966,7 +974,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures xf86-video-siliconmotion 1.4.2 to adapt to many kinds of systems.
+\`configure' configures xf86-video-siliconmotion 1.6.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1032,7 +1040,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xf86-video-siliconmotion 1.4.2:";;
+ short | recursive ) echo "Configuration of xf86-video-siliconmotion 1.6.0:";;
esac
cat <<\_ACEOF
@@ -1081,6 +1089,10 @@ Some influential environment variables:
PKG_CONFIG path to pkg-config utility
XORG_CFLAGS C compiler flags for XORG, overriding pkg-config
XORG_LIBS linker flags for XORG, 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.
@@ -1181,7 +1193,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-xf86-video-siliconmotion configure 1.4.2
+xf86-video-siliconmotion configure 1.6.0
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1195,7 +1207,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xf86-video-siliconmotion $as_me 1.4.2, which was
+It was created by xf86-video-siliconmotion $as_me 1.6.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1798,7 +1810,7 @@ fi
# Define the identity of the package.
PACKAGE='xf86-video-siliconmotion'
- VERSION='1.4.2'
+ VERSION='1.6.0'
cat >>confdefs.h <<_ACEOF
@@ -3206,6 +3218,7 @@ do
done
done
done
+IFS=$as_save_IFS
lt_ac_max=0
lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -3240,6 +3253,7 @@ done
fi
SED=$lt_cv_path_SED
+
echo "$as_me:$LINENO: result: $SED" >&5
echo "${ECHO_T}$SED" >&6
@@ -3454,8 +3468,8 @@ else
echo "${ECHO_T}no, using $LN_S" >&6
fi
-echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
-echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6
if test "${lt_cv_deplibs_check_method+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -3474,7 +3488,7 @@ lt_cv_deplibs_check_method='unknown'
# whether `pass_all' will *always* work, you probably want this one.
case $host_os in
-aix4* | aix5*)
+aix[4-9]*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3496,16 +3510,22 @@ cygwin*)
mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
;;
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | kfreebsd*-gnu | dragonfly*)
+freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
@@ -3543,7 +3563,7 @@ hpux10.20* | hpux11*)
esac
;;
-interix3*)
+interix[3-9]*)
# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
;;
@@ -3559,7 +3579,7 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3593,6 +3613,10 @@ osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3680,7 +3704,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 3683 "configure"' > conftest.$ac_ext
+ echo '#line 3707 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -3715,7 +3739,8 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -3726,6 +3751,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
case `/usr/bin/file conftest.o` in
*32-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
@@ -3742,6 +3770,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
;;
*64-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
@@ -3848,7 +3879,11 @@ sparc*-*solaris*)
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
esac
;;
esac
@@ -5279,7 +5314,7 @@ fi
# Provide some information about the compiler.
-echo "$as_me:5282:" \
+echo "$as_me:5317:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -5426,7 +5461,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-
# find the maximum length of command line arguments
echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
@@ -5513,24 +5547,27 @@ else
fi
;;
*)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
= "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
;;
esac
@@ -5547,6 +5584,7 @@ fi
+
# Check for command to grab the raw symbol name followed by C symbol from nm.
echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
@@ -5584,7 +5622,7 @@ hpux*) # Its linker distinguishes data from code symbols
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
;;
-linux*)
+linux* | k*bsd*-gnu)
if test "$host_cpu" = ia64; then
symcode='[ABCDGIRSTW]'
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
@@ -5737,7 +5775,7 @@ EOF
echo "$progname: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
- rm -f conftest* conftst*
+ rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
@@ -6087,7 +6125,7 @@ test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o
# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
@@ -6249,6 +6287,289 @@ fi
;;
esac
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
+echo "${ECHO_T}$DSYMUTIL" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_DSYMUTIL" && ac_cv_prog_ac_ct_DSYMUTIL=":"
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
+echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ DSYMUTIL=$ac_ct_DSYMUTIL
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_NMEDIT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ echo "$as_me:$LINENO: result: $NMEDIT" >&5
+echo "${ECHO_T}$NMEDIT" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_NMEDIT" && ac_cv_prog_ac_ct_NMEDIT=":"
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+echo "${ECHO_T}$ac_ct_NMEDIT" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ NMEDIT=$ac_ct_NMEDIT
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+
+ echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ echo "int foo(void){return 1;}" > conftest.c
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib ${wl}-single_module conftest.c
+ if test -f libconftest.dylib; then
+ lt_cv_apple_cc_single_mod=yes
+ rm -rf libconftest.dylib*
+ fi
+ rm conftest.c
+ fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6
+ echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ lt_cv_ld_exported_symbols_list=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_ld_exported_symbols_list=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6
+ case $host_os in
+ rhapsody* | darwin1.[0123])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*)
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil="~$DSYMUTIL \$lib || :"
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+
enable_dlopen=no
enable_win32_dll=no
@@ -6287,10 +6608,10 @@ objext=o
objext=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
+lt_simple_link_test_code='int main(){return(0);}'
# If no C compiler was specified, use CC.
@@ -6305,16 +6626,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
@@ -6331,7 +6652,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
else
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -6342,11 +6663,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:6345: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6666: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6349: \$? = $ac_status" >&5
+ echo "$as_me:6670: \$? = $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.
@@ -6397,13 +6718,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
lt_prog_compiler_pic='-DDLL_EXPORT'
;;
@@ -6413,7 +6736,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic='-fno-common'
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -6471,7 +6794,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -6504,7 +6827,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl='-Wl,'
@@ -6523,6 +6846,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# All Alpha code is PIC.
lt_prog_compiler_static='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -6532,6 +6871,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static='-non_shared'
;;
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
solaris*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
@@ -6594,12 +6937,12 @@ if test -n "$lt_prog_compiler_pic"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works=no
+ lt_cv_prog_compiler_pic_works=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -6610,27 +6953,27 @@ 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:6613: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6956: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6617: \$? = $ac_status" >&5
+ echo "$as_me:6960: \$? = $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.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works=yes
+ lt_cv_prog_compiler_pic_works=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6
-if test x"$lt_prog_compiler_pic_works" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
case $lt_prog_compiler_pic in
"" | " "*) ;;
*) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -6657,13 +7000,13 @@ esac
wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works=no
+ lt_cv_prog_compiler_static_works=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -6673,20 +7016,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works=yes
+ lt_cv_prog_compiler_static_works=yes
fi
else
- lt_prog_compiler_static_works=yes
+ lt_cv_prog_compiler_static_works=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6
-if test x"$lt_prog_compiler_static_works" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
:
else
lt_prog_compiler_static=
@@ -6703,7 +7046,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -6714,11 +7057,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:6717: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7060: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:6721: \$? = $ac_status" >&5
+ echo "$as_me:7064: \$? = $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
@@ -6798,12 +7141,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
for cc_temp in $compiler""; do
@@ -6862,7 +7206,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
@@ -6910,7 +7254,7 @@ EOF
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -6928,7 +7272,7 @@ EOF
fi
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct=no
hardcode_shlibpath_var=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
@@ -6943,7 +7287,7 @@ EOF
archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -6961,13 +7305,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
ld_shlibs=no
@@ -7072,7 +7425,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -7092,7 +7445,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -7126,7 +7479,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct=yes
+ :
else
# We have old collect2
hardcode_direct=unsupported
@@ -7204,11 +7557,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -7265,11 +7625,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -7321,7 +7688,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# The linker will automatically build a .lib file if we build a DLL.
old_archive_From_new_cmds='true'
# FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path='`cygpath -w "$srcfile"`'
enable_shared_with_static_runtimes=yes
;;
@@ -7354,19 +7721,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
link_all_deplibs=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -7406,7 +7772,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -7529,15 +7895,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
openbsd*)
if test -f /usr/libexec/ld.so; then
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
export_dynamic_flag_spec='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-R$libdir'
@@ -7546,10 +7912,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- ld_shlibs=no
+ ld_shlibs=no
fi
;;
@@ -7608,17 +7974,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
link_all_deplibs=yes
;;
@@ -7675,7 +8040,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag='${wl}-z,text'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
@@ -7752,7 +8117,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -7810,17 +8175,55 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`echo $lt_search_path_spec`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi
@@ -7841,7 +8244,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -7980,12 +8383,8 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -8002,18 +8401,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -8051,7 +8438,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -8114,7 +8501,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -8169,7 +8556,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -8185,7 +8572,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -8198,18 +8585,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -8291,6 +8666,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -8387,6 +8766,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -8444,6 +8838,7 @@ else
darwin*)
if test -n "$STRIP" ; then
striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
@@ -8720,7 +9115,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
if test $ac_cv_lib_dld_shl_load = yes; then
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
else
echo "$as_me:$LINENO: checking for dlopen" >&5
echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
@@ -9014,7 +9409,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
if test $ac_cv_lib_dld_dld_link = yes; then
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
fi
@@ -9063,7 +9458,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9066 "configure"
+#line 9461 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9163,7 +9558,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9166 "configure"
+#line 9561 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9290,7 +9685,7 @@ aix3*)
fi
;;
-aix4* | aix5*)
+aix[4-9]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -9346,6 +9741,7 @@ if test -f "$ltmain"; then
predeps \
postdeps \
compiler_lib_search_path \
+ compiler_lib_search_dirs \
archive_cmds \
archive_expsym_cmds \
postinstall_cmds \
@@ -9361,6 +9757,7 @@ if test -f "$ltmain"; then
module_cmds \
module_expsym_cmds \
lt_cv_prog_compiler_c_o \
+ fix_srcfile_path \
exclude_expsyms \
include_expsyms; do
@@ -9405,7 +9802,7 @@ echo "$as_me: creating $ofile" >&6;}
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
#
# This file is part of GNU Libtool:
@@ -9641,6 +10038,10 @@ predeps=$lt_predeps
# shared library.
postdeps=$lt_postdeps
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path
@@ -9729,7 +10130,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols
@@ -9889,6 +10290,7 @@ postdep_objects_CXX=
predeps_CXX=
postdeps_CXX=
compiler_lib_search_path_CXX=
+compiler_lib_search_dirs_CXX=
# Source file extension for C++ test sources.
ac_ext=cpp
@@ -9898,10 +10300,10 @@ objext=o
objext_CXX=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
@@ -9917,16 +10319,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -10133,7 +10535,7 @@ case $host_os in
# FIXME: insert proper C++ library support
ld_shlibs_CXX=no
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -10146,7 +10548,7 @@ case $host_os in
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
case $ld_flag in
*-brtl*)
@@ -10182,7 +10584,7 @@ case $host_os in
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct_CXX=yes
+ :
else
# We have old collect2
hardcode_direct_CXX=unsupported
@@ -10260,11 +10662,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -10322,11 +10731,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -10394,59 +10810,31 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
archive_cmds_need_lc_CXX=no
hardcode_direct_CXX=no
hardcode_automatic_CXX=yes
hardcode_shlibpath_var_CXX=unsupported
whole_archive_flag_spec_CXX=''
link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
+ allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+ if test "$GXX" = yes ; then
output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -10480,7 +10868,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
freebsd-elf*)
archive_cmds_need_lc_CXX=no
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
ld_shlibs_CXX=yes
@@ -10529,9 +10917,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_separator_CXX=:
case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
- ;;
+ hppa*64*|ia64*) ;;
*)
export_dynamic_flag_spec_CXX='${wl}-E'
;;
@@ -10599,7 +10985,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
esac
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct_CXX=no
hardcode_shlibpath_var_CXX=no
hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
@@ -10639,7 +11025,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator_CXX=:
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -10691,7 +11077,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler
archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
@@ -10719,6 +11105,29 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
esac
;;
lynxos*)
@@ -10763,9 +11172,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='${wl}-E'
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
fi
output_verbose_link_cmd='echo'
else
@@ -10932,15 +11341,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+ whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
;;
esac
link_all_deplibs_CXX=yes
@@ -10987,6 +11391,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
fi
;;
esac
@@ -11074,7 +11484,6 @@ test "$ld_shlibs_CXX" = no && can_build_shared=no
GCC_CXX="$GXX"
LD_CXX="$LD"
-
cat > conftest.$ac_ext <<EOF
class Foo
{
@@ -11176,9 +11585,14 @@ fi
$rm -f confest.$objext
+compiler_lib_search_dirs_CXX=
+if test -n "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
# PORTME: override above test on systems where it is broken
case $host_os in
-interix3*)
+interix[3-9]*)
# Interix 3.5 installs completely hosed .la files for C++, so rather than
# hack all around it, let's just trust "g++" to DTRT.
predep_objects_CXX=
@@ -11186,19 +11600,51 @@ interix3*)
postdeps_CXX=
;;
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ #
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
solaris*)
case $cc_basename in
CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
# Adding this requires a known-good setup of shared libraries for
# Sun compiler versions before 5.6, else PIC objects from an old
# archive will be linked into the output, leading to subtle bugs.
- postdeps_CXX='-lCstd -lCrun'
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
;;
esac
;;
esac
-
case " $postdeps_CXX " in
*" -lc "*) archive_cmds_need_lc_CXX=no ;;
esac
@@ -11229,12 +11675,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# like `-m68040'.
lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | os2* | pw32*)
+ mingw* | cygwin* | os2* | pw32*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
;;
darwin* | rhapsody*)
@@ -11246,7 +11694,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# DJGPP does not support shared libraries at all
lt_prog_compiler_pic_CXX=
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -11272,7 +11720,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
else
case $host_os in
- aix4* | aix5*)
+ aix[4-9]*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
@@ -11312,7 +11760,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
;;
esac
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@@ -11355,7 +11803,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
;;
esac
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@@ -11368,7 +11816,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_CXX='-KPIC'
lt_prog_compiler_static_CXX='-static'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler.
lt_prog_compiler_wl_CXX='-Wl,'
lt_prog_compiler_pic_CXX='-fpic'
@@ -11382,6 +11830,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_CXX='-non_shared'
;;
*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
;;
esac
;;
@@ -11491,12 +11947,12 @@ if test -n "$lt_prog_compiler_pic_CXX"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works_CXX=no
+ lt_cv_prog_compiler_pic_works_CXX=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -11507,27 +11963,27 @@ 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:11510: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11966: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11514: \$? = $ac_status" >&5
+ echo "$as_me:11970: \$? = $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.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_CXX=yes
+ lt_cv_prog_compiler_pic_works_CXX=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6
-if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
case $lt_prog_compiler_pic_CXX in
"" | " "*) ;;
*) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
@@ -11554,13 +12010,13 @@ esac
wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works_CXX=no
+ lt_cv_prog_compiler_static_works_CXX=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -11570,20 +12026,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_CXX=yes
+ lt_cv_prog_compiler_static_works_CXX=yes
fi
else
- lt_prog_compiler_static_works_CXX=yes
+ lt_cv_prog_compiler_static_works_CXX=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6
-if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
:
else
lt_prog_compiler_static_CXX=
@@ -11600,7 +12056,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -11611,11 +12067,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:11614: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12070: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11618: \$? = $ac_status" >&5
+ echo "$as_me:12074: \$? = $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
@@ -11668,7 +12124,7 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
case $host_os in
- aix4* | aix5*)
+ aix[4-9]*)
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
@@ -11681,12 +12137,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
export_symbols_cmds_CXX="$ltdll_cmds"
;;
cygwin* | mingw*)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
;;
*)
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
esac
+ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
echo "${ECHO_T}$ld_shlibs_CXX" >&6
@@ -11712,7 +12169,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -11770,20 +12227,7 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -11801,7 +12245,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -11940,12 +12384,7 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -11962,18 +12401,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -12011,7 +12438,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -12074,7 +12501,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -12129,7 +12556,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -12145,7 +12572,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -12158,18 +12585,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -12251,6 +12666,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -12347,6 +12766,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -12430,6 +12864,7 @@ if test -f "$ltmain"; then
predeps_CXX \
postdeps_CXX \
compiler_lib_search_path_CXX \
+ compiler_lib_search_dirs_CXX \
archive_cmds_CXX \
archive_expsym_cmds_CXX \
postinstall_cmds_CXX \
@@ -12445,6 +12880,7 @@ if test -f "$ltmain"; then
module_cmds_CXX \
module_expsym_cmds_CXX \
lt_cv_prog_compiler_c_o_CXX \
+ fix_srcfile_path_CXX \
exclude_expsyms_CXX \
include_expsyms_CXX; do
@@ -12677,6 +13113,10 @@ predeps=$lt_predeps_CXX
# shared library.
postdeps=$lt_postdeps_CXX
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
@@ -12765,7 +13205,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_CXX"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_CXX
@@ -12856,10 +13296,17 @@ objext=o
objext_F77=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
+lt_simple_link_test_code="\
+ program t
+ end
+"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
@@ -12875,16 +13322,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -12922,7 +13369,7 @@ aix3*)
postinstall_cmds='$RANLIB $lib'
fi
;;
-aix4* | aix5*)
+aix[4-9]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -12968,13 +13415,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
lt_prog_compiler_pic_F77='-DDLL_EXPORT'
;;
@@ -12984,7 +13433,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_F77='-fno-common'
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -13042,7 +13491,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic_F77='-DDLL_EXPORT'
@@ -13075,7 +13524,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_F77='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl_F77='-Wl,'
@@ -13094,6 +13543,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# All Alpha code is PIC.
lt_prog_compiler_static_F77='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ lt_prog_compiler_wl_F77='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ lt_prog_compiler_wl_F77=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -13103,6 +13568,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_F77='-non_shared'
;;
+ rdos*)
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
solaris*)
lt_prog_compiler_pic_F77='-KPIC'
lt_prog_compiler_static_F77='-Bstatic'
@@ -13165,12 +13634,12 @@ if test -n "$lt_prog_compiler_pic_F77"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works_F77=no
+ lt_cv_prog_compiler_pic_works_F77=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic_F77"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -13181,27 +13650,27 @@ 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:13184: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13653: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13188: \$? = $ac_status" >&5
+ echo "$as_me:13657: \$? = $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.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_F77=yes
+ lt_cv_prog_compiler_pic_works_F77=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then
case $lt_prog_compiler_pic_F77 in
"" | " "*) ;;
*) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
@@ -13228,13 +13697,13 @@ esac
wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_F77+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works_F77=no
+ lt_cv_prog_compiler_static_works_F77=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -13244,20 +13713,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_F77=yes
+ lt_cv_prog_compiler_static_works_F77=yes
fi
else
- lt_prog_compiler_static_works_F77=yes
+ lt_cv_prog_compiler_static_works_F77=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6
-if test x"$lt_prog_compiler_static_works_F77" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then
:
else
lt_prog_compiler_static_F77=
@@ -13274,7 +13743,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -13285,11 +13754,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:13288: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13757: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13292: \$? = $ac_status" >&5
+ echo "$as_me:13761: \$? = $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
@@ -13369,12 +13838,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+ exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
for cc_temp in $compiler""; do
@@ -13433,7 +13903,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs_F77=no
@@ -13481,7 +13951,7 @@ EOF
allow_undefined_flag_F77=unsupported
always_export_symbols_F77=no
enable_shared_with_static_runtimes_F77=yes
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -13499,7 +13969,7 @@ EOF
fi
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct_F77=no
hardcode_shlibpath_var_F77=no
hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
@@ -13514,7 +13984,7 @@ EOF
archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -13532,13 +14002,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
ld_shlibs_F77=no
@@ -13643,7 +14122,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -13663,7 +14142,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -13697,7 +14176,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct_F77=yes
+ :
else
# We have old collect2
hardcode_direct_F77=unsupported
@@ -13765,11 +14244,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -13816,11 +14302,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -13872,7 +14365,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# The linker will automatically build a .lib file if we build a DLL.
old_archive_From_new_cmds_F77='true'
# FIXME: Should let the user specify the lib program.
- old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
enable_shared_with_static_runtimes_F77=yes
;;
@@ -13905,19 +14398,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
link_all_deplibs_F77=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -13957,7 +14449,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_F77='-R$libdir'
hardcode_direct_F77=yes
@@ -14080,15 +14572,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
openbsd*)
if test -f /usr/libexec/ld.so; then
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
export_dynamic_flag_spec_F77='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec_F77='-R$libdir'
@@ -14097,10 +14589,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- ld_shlibs_F77=no
+ ld_shlibs_F77=no
fi
;;
@@ -14159,17 +14651,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
link_all_deplibs_F77=yes
;;
@@ -14226,7 +14717,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag_F77='${wl}-z,text'
archive_cmds_need_lc_F77=no
hardcode_shlibpath_var_F77=no
@@ -14303,7 +14794,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -14361,20 +14852,7 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -14392,7 +14870,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -14531,12 +15009,7 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -14553,18 +15026,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -14602,7 +15063,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -14665,7 +15126,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -14720,7 +15181,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -14736,7 +15197,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -14749,18 +15210,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -14842,6 +15291,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -14938,6 +15391,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -15021,6 +15489,7 @@ if test -f "$ltmain"; then
predeps_F77 \
postdeps_F77 \
compiler_lib_search_path_F77 \
+ compiler_lib_search_dirs_F77 \
archive_cmds_F77 \
archive_expsym_cmds_F77 \
postinstall_cmds_F77 \
@@ -15036,6 +15505,7 @@ if test -f "$ltmain"; then
module_cmds_F77 \
module_expsym_cmds_F77 \
lt_cv_prog_compiler_c_o_F77 \
+ fix_srcfile_path_F77 \
exclude_expsyms_F77 \
include_expsyms_F77; do
@@ -15268,6 +15738,10 @@ predeps=$lt_predeps_F77
# shared library.
postdeps=$lt_postdeps_F77
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_F77
@@ -15356,7 +15830,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_F77"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_F77
@@ -15415,10 +15889,10 @@ objext=o
objext_GCJ=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
+lt_simple_compile_test_code="class foo {}"
# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
@@ -15434,16 +15908,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -15481,7 +15955,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
else
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -15492,11 +15966,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:15495: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15969: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15499: \$? = $ac_status" >&5
+ echo "$as_me:15973: \$? = $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.
@@ -15547,14 +16021,16 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+
;;
darwin* | rhapsody*)
@@ -15563,7 +16039,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_GCJ='-fno-common'
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -15621,10 +16097,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+
;;
hpux9* | hpux10* | hpux11*)
@@ -15654,7 +16130,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_GCJ='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl_GCJ='-Wl,'
@@ -15673,6 +16149,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# All Alpha code is PIC.
lt_prog_compiler_static_GCJ='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ lt_prog_compiler_wl_GCJ=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -15682,6 +16174,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_GCJ='-non_shared'
;;
+ rdos*)
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
solaris*)
lt_prog_compiler_pic_GCJ='-KPIC'
lt_prog_compiler_static_GCJ='-Bstatic'
@@ -15744,12 +16240,12 @@ if test -n "$lt_prog_compiler_pic_GCJ"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works_GCJ=no
+ lt_cv_prog_compiler_pic_works_GCJ=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -15760,27 +16256,27 @@ 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:15763: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16259: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15767: \$? = $ac_status" >&5
+ echo "$as_me:16263: \$? = $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.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_GCJ=yes
+ lt_cv_prog_compiler_pic_works_GCJ=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6
-if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then
case $lt_prog_compiler_pic_GCJ in
"" | " "*) ;;
*) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
@@ -15807,13 +16303,13 @@ esac
wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works_GCJ=no
+ lt_cv_prog_compiler_static_works_GCJ=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -15823,20 +16319,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_GCJ=yes
+ lt_cv_prog_compiler_static_works_GCJ=yes
fi
else
- lt_prog_compiler_static_works_GCJ=yes
+ lt_cv_prog_compiler_static_works_GCJ=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6
-if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then
:
else
lt_prog_compiler_static_GCJ=
@@ -15853,7 +16349,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -15864,11 +16360,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:15867: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16363: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:15871: \$? = $ac_status" >&5
+ echo "$as_me:16367: \$? = $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
@@ -15948,12 +16444,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+ exclude_expsyms_GCJ='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
for cc_temp in $compiler""; do
@@ -16012,7 +16509,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs_GCJ=no
@@ -16060,7 +16557,7 @@ EOF
allow_undefined_flag_GCJ=unsupported
always_export_symbols_GCJ=no
enable_shared_with_static_runtimes_GCJ=yes
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -16078,7 +16575,7 @@ EOF
fi
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct_GCJ=no
hardcode_shlibpath_var_GCJ=no
hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
@@ -16093,7 +16590,7 @@ EOF
archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -16111,13 +16608,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
ld_shlibs_GCJ=no
@@ -16222,7 +16728,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -16242,7 +16748,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -16276,7 +16782,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct_GCJ=yes
+ :
else
# We have old collect2
hardcode_direct_GCJ=unsupported
@@ -16354,11 +16860,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -16415,11 +16928,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -16471,7 +16991,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# The linker will automatically build a .lib file if we build a DLL.
old_archive_From_new_cmds_GCJ='true'
# FIXME: Should let the user specify the lib program.
- old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
enable_shared_with_static_runtimes_GCJ=yes
;;
@@ -16504,19 +17024,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
link_all_deplibs_GCJ=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_GCJ="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_GCJ="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -16556,7 +17075,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_GCJ='-R$libdir'
hardcode_direct_GCJ=yes
@@ -16679,15 +17198,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
openbsd*)
if test -f /usr/libexec/ld.so; then
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
export_dynamic_flag_spec_GCJ='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec_GCJ='-R$libdir'
@@ -16696,10 +17215,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- ld_shlibs_GCJ=no
+ ld_shlibs_GCJ=no
fi
;;
@@ -16758,17 +17277,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
link_all_deplibs_GCJ=yes
;;
@@ -16825,7 +17343,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag_GCJ='${wl}-z,text'
archive_cmds_need_lc_GCJ=no
hardcode_shlibpath_var_GCJ=no
@@ -16902,7 +17420,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -16960,20 +17478,7 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -16991,7 +17496,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -17130,12 +17635,7 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -17152,18 +17652,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -17201,7 +17689,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -17264,7 +17752,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -17319,7 +17807,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -17335,7 +17823,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -17348,18 +17836,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -17441,6 +17917,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -17537,6 +18017,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -17620,6 +18115,7 @@ if test -f "$ltmain"; then
predeps_GCJ \
postdeps_GCJ \
compiler_lib_search_path_GCJ \
+ compiler_lib_search_dirs_GCJ \
archive_cmds_GCJ \
archive_expsym_cmds_GCJ \
postinstall_cmds_GCJ \
@@ -17635,6 +18131,7 @@ if test -f "$ltmain"; then
module_cmds_GCJ \
module_expsym_cmds_GCJ \
lt_cv_prog_compiler_c_o_GCJ \
+ fix_srcfile_path_GCJ \
exclude_expsyms_GCJ \
include_expsyms_GCJ; do
@@ -17867,6 +18364,10 @@ predeps=$lt_predeps_GCJ
# shared library.
postdeps=$lt_postdeps_GCJ
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
@@ -17955,7 +18456,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_GCJ"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_GCJ
@@ -18013,7 +18514,7 @@ objext=o
objext_RC=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
# Code to be used in simple link tests
lt_simple_link_test_code="$lt_simple_compile_test_code"
@@ -18032,16 +18533,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -18101,6 +18602,7 @@ if test -f "$ltmain"; then
predeps_RC \
postdeps_RC \
compiler_lib_search_path_RC \
+ compiler_lib_search_dirs_RC \
archive_cmds_RC \
archive_expsym_cmds_RC \
postinstall_cmds_RC \
@@ -18116,6 +18618,7 @@ if test -f "$ltmain"; then
module_cmds_RC \
module_expsym_cmds_RC \
lt_cv_prog_compiler_c_o_RC \
+ fix_srcfile_path_RC \
exclude_expsyms_RC \
include_expsyms_RC; do
@@ -18348,6 +18851,10 @@ predeps=$lt_predeps_RC
# shared library.
postdeps=$lt_postdeps_RC
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_RC
@@ -18436,7 +18943,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_RC"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_RC
@@ -19856,6 +20363,72 @@ fi
sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Checks for libraries.
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $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
+ char *p = (char *) XSERVER_LIBPCIACCESS;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; 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 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
+
+CPPFLAGS="$SAVE_CPPFLAGS"
# Checks for header files.
echo "$as_me:$LINENO: checking for ANSI C header files" >&5
@@ -20025,6 +20598,131 @@ _ACEOF
fi
+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.8.0\"") >&5
+ ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.8.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.8.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.8.0\"") >&5
+ ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.8.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.8.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.8.0"`
+ else
+ PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pciaccess >= 0.8.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.8.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.8.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://www.freedesktop.org/software/pkgconfig>.
+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://www.freedesktop.org/software/pkgconfig>.
+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
+ XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
+fi
+
+
+if test "x$XSERVER_LIBPCIACCESS" = xyes; then
+ XSERVER_LIBPCIACCESS_TRUE=
+ XSERVER_LIBPCIACCESS_FALSE='#'
+else
+ XSERVER_LIBPCIACCESS_TRUE='#'
+ XSERVER_LIBPCIACCESS_FALSE=
+fi
+
+
@@ -20122,7 +20820,7 @@ cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
_ACEOF
- PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
+ PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
if test "x$PVM" = "x"; then
PVM="0"
fi
@@ -20131,7 +20829,7 @@ cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION_MINOR $PVM
_ACEOF
- PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
+ PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
if test "x$PVP" = "x"; then
PVP="0"
fi
@@ -20269,6 +20967,13 @@ echo "$as_me: error: conditional \"am__fastdepCC\" 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
@@ -20540,7 +21245,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by xf86-video-siliconmotion $as_me 1.4.2, which was
+This file was extended by xf86-video-siliconmotion $as_me 1.6.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20603,7 +21308,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-xf86-video-siliconmotion config.status 1.4.2
+xf86-video-siliconmotion config.status 1.6.0
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -20852,6 +21557,7 @@ s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
s,@CCDEPMODE@,$CCDEPMODE,;t t
s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@SED@,$SED,;t t
s,@EGREP@,$EGREP,;t t
s,@LN_S@,$LN_S,;t t
s,@ECHO@,$ECHO,;t t
@@ -20859,6 +21565,10 @@ s,@AR@,$AR,;t t
s,@ac_ct_AR@,$ac_ct_AR,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@DSYMUTIL@,$DSYMUTIL,;t t
+s,@ac_ct_DSYMUTIL@,$ac_ct_DSYMUTIL,;t t
+s,@NMEDIT@,$NMEDIT,;t t
+s,@ac_ct_NMEDIT@,$ac_ct_NMEDIT,;t t
s,@CPP@,$CPP,;t t
s,@CXX@,$CXX,;t t
s,@CXXFLAGS@,$CXXFLAGS,;t t
@@ -20875,6 +21585,10 @@ s,@PKG_CONFIG@,$PKG_CONFIG,;t t
s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
s,@XORG_CFLAGS@,$XORG_CFLAGS,;t t
s,@XORG_LIBS@,$XORG_LIBS,;t t
+s,@PCIACCESS_CFLAGS@,$PCIACCESS_CFLAGS,;t t
+s,@PCIACCESS_LIBS@,$PCIACCESS_LIBS,;t t
+s,@XSERVER_LIBPCIACCESS_TRUE@,$XSERVER_LIBPCIACCESS_TRUE,;t t
+s,@XSERVER_LIBPCIACCESS_FALSE@,$XSERVER_LIBPCIACCESS_FALSE,;t t
s,@moduledir@,$moduledir,;t t
s,@DRIVER_NAME@,$DRIVER_NAME,;t t
s,@APP_MAN_SUFFIX@,$APP_MAN_SUFFIX,;t t
diff --git a/driver/xf86-video-siliconmotion/configure.ac b/driver/xf86-video-siliconmotion/configure.ac
index b92f99e04..b736ef755 100644
--- a/driver/xf86-video-siliconmotion/configure.ac
+++ b/driver/xf86-video-siliconmotion/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-siliconmotion],
- 1.4.2,
+ 1.6.0,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-siliconmotion)
@@ -58,10 +58,22 @@ PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_M
sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Checks for libraries.
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
+AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
+ [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
+ [#include "xorg-server.h"])
+CPPFLAGS="$SAVE_CPPFLAGS"
# Checks for header files.
AC_HEADER_STDC
+if test "x$XSERVER_LIBPCIACCESS" = xyes; then
+ PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
+ XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
+fi
+AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
+
AC_SUBST([XORG_CFLAGS])
AC_SUBST([moduledir])
diff --git a/driver/xf86-video-siliconmotion/ltmain.sh b/driver/xf86-video-siliconmotion/ltmain.sh
index 85faf0734..248cd4047 100644
--- a/driver/xf86-video-siliconmotion/ltmain.sh
+++ b/driver/xf86-video-siliconmotion/ltmain.sh
@@ -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)"
-
-# 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
+VERSION=1.5.26
+TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
+
+# 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.
diff --git a/driver/xf86-video-siliconmotion/man/Makefile.in b/driver/xf86-video-siliconmotion/man/Makefile.in
index e9c0e3cbc..77f42b601 100644
--- a/driver/xf86-video-siliconmotion/man/Makefile.in
+++ b/driver/xf86-video-siliconmotion/man/Makefile.in
@@ -111,6 +111,7 @@ DEPDIR = @DEPDIR@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DRIVER_NAME = @DRIVER_NAME@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -139,6 +140,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@
@@ -147,18 +149,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@
@@ -205,7 +214,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@
diff --git a/driver/xf86-video-siliconmotion/man/siliconmotion.man b/driver/xf86-video-siliconmotion/man/siliconmotion.man
index 0f900054d..fa8f03060 100644
--- a/driver/xf86-video-siliconmotion/man/siliconmotion.man
+++ b/driver/xf86-video-siliconmotion/man/siliconmotion.man
@@ -21,7 +21,7 @@ siliconmotion \- Silicon Motion video driver
.B EndSection
.SH DESCRIPTION
.B siliconmotion
-is an XFree86 driver for Silicon Motion based video cards. The driver is fully
+is an __xservername__ driver for Silicon Motion based video cards. The driver is fully
accelerated, and provides support for the following framebuffer depths:
8, 16, and 24. All
visual types are supported for depth 8, and TrueColor
@@ -49,7 +49,7 @@ SM712
.B Lynx3DM
SM720
.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
+Please refer to __xconfigfile__(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
driver. All options names are case and white space insensitive when
parsed by the server, for example, "lynxe" and "LynxE" are equivalent.
@@ -178,6 +178,17 @@ This will increase performance, especially for small fills/blits,
because the driver does not have to poll the ViRGE before sending it
commands to make sure it is ready. It should work on most
recent PCI chipsets. Default: off.
+.TP
+.BI "Option \*qAccelMethod\*q \*q" "string" \*q
+Chooses between available acceleration architectures. Valid options are
+.B XAA
+and
+.B EXA.
+XAA is the traditional acceleration architecture and support for it is very
+stable. EXA is a newer acceleration architecture with better performance for
+the Render and Composite extensions, but the rendering code for it is newer and
+possibly unstable. The default is
+.B XAA.
.PP
The following additional
@@ -189,14 +200,13 @@ Enable or disable viewing offscreen cache memory. A
development debug option. Default: off.
.SH SEE ALSO
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
+__xservername__(1), __xconfigfile__(__filemansuffix__), xorgconfig(1), Xserver(1), X(__miscmansuffix__)
.SH SUPPORT
-For assistance with this driver, or XFree86 in general, check the XFree86 web
-site at http://www.xfree86.org. A FAQ is available on the web site at
-http://www.xfree86.org/FAQ/. If you find a problem with XFree86 or have a
+For assistance with this driver, or __xservername__ in general, check the web
+site at http://www.x.org/. If you find a problem with __xservername__ or have a
question not answered in the FAQ please use our bug report form available on
-the web site or send mail to XFree86@XFree86.org. When reporting problems
+the web site or send mail to xorg@lists.freedesktop.org. When reporting problems
with the driver send as much detail as possible, including chipset type, a
server output log, and operating system specifics.
diff --git a/driver/xf86-video-siliconmotion/src/Makefile.am b/driver/xf86-video-siliconmotion/src/Makefile.am
index b122d0874..7cdf9ab48 100644
--- a/driver/xf86-video-siliconmotion/src/Makefile.am
+++ b/driver/xf86-video-siliconmotion/src/Makefile.am
@@ -31,12 +31,15 @@ siliconmotion_drv_ladir = @moduledir@/drivers
siliconmotion_drv_la_SOURCES = \
regsmi.h \
smi_accel.c \
+ smi_xaa.c \
+ smi_exa.c \
smi_dac.c \
smi_dga.c \
smi_driver.c \
smi.h \
smi_hwcurs.c \
smi_i2c.c \
+ smi_pcirename.h \
smi_shadow.c \
smi_video.c \
smi_video.h
diff --git a/driver/xf86-video-siliconmotion/src/Makefile.in b/driver/xf86-video-siliconmotion/src/Makefile.in
index cc71b04ab..bdb371f1b 100644
--- a/driver/xf86-video-siliconmotion/src/Makefile.in
+++ b/driver/xf86-video-siliconmotion/src/Makefile.in
@@ -75,9 +75,9 @@ am__installdirs = "$(DESTDIR)$(siliconmotion_drv_ladir)"
siliconmotion_drv_laLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(siliconmotion_drv_la_LTLIBRARIES)
siliconmotion_drv_la_LIBADD =
-am_siliconmotion_drv_la_OBJECTS = smi_accel.lo smi_dac.lo smi_dga.lo \
- smi_driver.lo smi_hwcurs.lo smi_i2c.lo smi_shadow.lo \
- smi_video.lo
+am_siliconmotion_drv_la_OBJECTS = smi_accel.lo smi_xaa.lo smi_exa.lo \
+ smi_dac.lo smi_dga.lo smi_driver.lo smi_hwcurs.lo smi_i2c.lo \
+ smi_shadow.lo smi_video.lo
siliconmotion_drv_la_OBJECTS = $(am_siliconmotion_drv_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -123,6 +123,7 @@ DEPDIR = @DEPDIR@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DRIVER_NAME = @DRIVER_NAME@
+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@
@@ -225,12 +234,15 @@ siliconmotion_drv_ladir = @moduledir@/drivers
siliconmotion_drv_la_SOURCES = \
regsmi.h \
smi_accel.c \
+ smi_xaa.c \
+ smi_exa.c \
smi_dac.c \
smi_dga.c \
smi_driver.c \
smi.h \
smi_hwcurs.c \
smi_i2c.c \
+ smi_pcirename.h \
smi_shadow.c \
smi_video.c \
smi_video.h
@@ -308,10 +320,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smi_dac.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smi_dga.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smi_driver.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smi_exa.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smi_hwcurs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smi_i2c.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smi_shadow.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smi_video.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smi_xaa.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
diff --git a/driver/xf86-video-siliconmotion/src/regsmi.h b/driver/xf86-video-siliconmotion/src/regsmi.h
index 6640ec01f..c5af8cc4a 100644
--- a/driver/xf86-video-siliconmotion/src/regsmi.h
+++ b/driver/xf86-video-siliconmotion/src/regsmi.h
@@ -26,7 +26,6 @@ Silicon Motion 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 and SIlicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/regsmi.h,v 1.2 2002/01/25 21:56:09 tsi Exp $ */
#ifndef _REGSMI_H
#define _REGSMI_H
@@ -40,75 +39,63 @@ authorization from the XFree86 Project and SIlicon Motion.
/* Chip tags */
#define PCI_SMI_VENDOR_ID PCI_VENDOR_SMI
#define SMI_UNKNOWN 0
-#define SMI_LYNX PCI_CHIP_SMI910
-#define SMI_LYNXE PCI_CHIP_SMI810
-#define SMI_LYNX3D PCI_CHIP_SMI820
-#define SMI_LYNXEM PCI_CHIP_SMI710
+#define SMI_LYNX PCI_CHIP_SMI910
+#define SMI_LYNXE PCI_CHIP_SMI810
+#define SMI_LYNX3D PCI_CHIP_SMI820
+#define SMI_LYNXEM PCI_CHIP_SMI710
#define SMI_LYNXEMplus PCI_CHIP_SMI712
-#define SMI_LYNX3DM PCI_CHIP_SMI720
-#define SMI_COUGAR3DR PCI_CHIP_SMI731
+#define SMI_LYNX3DM PCI_CHIP_SMI720
+#define SMI_COUGAR3DR PCI_CHIP_SMI731
/* I/O Functions */
static __inline__ CARD8
VGAIN8_INDEX(SMIPtr pSmi, int indexPort, int dataPort, CARD8 index)
{
- if (pSmi->IOBase)
- {
- MMIO_OUT8(pSmi->IOBase, indexPort, index);
- return(MMIO_IN8(pSmi->IOBase, dataPort));
- }
- else
- {
- outb(pSmi->PIOBase + indexPort, index);
- return(inb(pSmi->PIOBase + dataPort));
- }
+ if (pSmi->IOBase) {
+ MMIO_OUT8(pSmi->IOBase, indexPort, index);
+ return(MMIO_IN8(pSmi->IOBase, dataPort));
+ } else {
+ outb(pSmi->PIOBase + indexPort, index);
+ return(inb(pSmi->PIOBase + dataPort));
+ }
}
static __inline__ void
VGAOUT8_INDEX(SMIPtr pSmi, int indexPort, int dataPort, CARD8 index, CARD8 data)
{
- if (pSmi->IOBase)
- {
- MMIO_OUT8(pSmi->IOBase, indexPort, index);
- MMIO_OUT8(pSmi->IOBase, dataPort, data);
- }
- else
- {
- outb(pSmi->PIOBase + indexPort, index);
- outb(pSmi->PIOBase + dataPort, data);
- }
+ if (pSmi->IOBase) {
+ MMIO_OUT8(pSmi->IOBase, indexPort, index);
+ MMIO_OUT8(pSmi->IOBase, dataPort, data);
+ } else {
+ outb(pSmi->PIOBase + indexPort, index);
+ outb(pSmi->PIOBase + dataPort, data);
+ }
}
static __inline__ CARD8
VGAIN8(SMIPtr pSmi, int port)
{
- if (pSmi->IOBase)
- {
- return(MMIO_IN8(pSmi->IOBase, port));
- }
- else
- {
- return(inb(pSmi->PIOBase + port));
- }
+ if (pSmi->IOBase) {
+ return(MMIO_IN8(pSmi->IOBase, port));
+ } else {
+ return(inb(pSmi->PIOBase + port));
+ }
}
static __inline__ void
VGAOUT8(SMIPtr pSmi, int port, CARD8 data)
{
- if (pSmi->IOBase)
- {
- MMIO_OUT8(pSmi->IOBase, port, data);
- }
- else
- {
- outb(pSmi->PIOBase + port, data);
- }
+ if (pSmi->IOBase) {
+ MMIO_OUT8(pSmi->IOBase, port, data);
+ } else {
+ outb(pSmi->PIOBase + port, data);
+ }
}
#define OUT_SEQ(pSmi, index, data) \
- VGAOUT8_INDEX((pSmi), VGA_SEQ_INDEX, VGA_SEQ_DATA, (index), (data))
+ VGAOUT8_INDEX((pSmi), VGA_SEQ_INDEX, VGA_SEQ_DATA, (index), (data))
#define IN_SEQ(pSmi, index) \
- VGAIN8_INDEX((pSmi), VGA_SEQ_INDEX, VGA_SEQ_DATA, (index))
+ VGAIN8_INDEX((pSmi), VGA_SEQ_INDEX, VGA_SEQ_DATA, (index))
#define WRITE_DPR(pSmi, dpr, data) MMIO_OUT32(pSmi->DPRBase, dpr, data); DEBUG((VERBLEV, "DPR%02X = %08X\n", dpr, data))
#define READ_DPR(pSmi, dpr) MMIO_IN32(pSmi->DPRBase, dpr)
@@ -120,88 +107,82 @@ VGAOUT8(SMIPtr pSmi, int port, CARD8 data)
#define READ_FPR(pSmi, fpr) MMIO_IN32(pSmi->FPRBase, fpr)
/* 2D Engine commands */
-#define SMI_TRANSPARENT_SRC 0x00000100
+#define SMI_TRANSPARENT_SRC 0x00000100
#define SMI_TRANSPARENT_DEST 0x00000300
-#define SMI_OPAQUE_PXL 0x00000000
-#define SMI_TRANSPARENT_PXL 0x00000400
+#define SMI_OPAQUE_PXL 0x00000000
+#define SMI_TRANSPARENT_PXL 0x00000400
-#define SMI_MONO_PACK_8 0x00001000
-#define SMI_MONO_PACK_16 0x00002000
-#define SMI_MONO_PACK_32 0x00003000
+#define SMI_MONO_PACK_8 0x00001000
+#define SMI_MONO_PACK_16 0x00002000
+#define SMI_MONO_PACK_32 0x00003000
-#define SMI_ROP2_SRC 0x00008000
-#define SMI_ROP2_PAT 0x0000C000
-#define SMI_ROP3 0x00000000
+#define SMI_ROP2_SRC 0x00008000
+#define SMI_ROP2_PAT 0x0000C000
+#define SMI_ROP3 0x00000000
-#define SMI_BITBLT 0x00000000
-#define SMI_RECT_FILL 0x00010000
-#define SMI_TRAPEZOID_FILL 0x00030000
+#define SMI_BITBLT 0x00000000
+#define SMI_RECT_FILL 0x00010000
+#define SMI_TRAPEZOID_FILL 0x00030000
#define SMI_SHORT_STROKE 0x00060000
-#define SMI_BRESENHAM_LINE 0x00070000
-#define SMI_HOSTBLT_WRITE 0x00080000
-#define SMI_HOSTBLT_READ 0x00090000
-#define SMI_ROTATE_BLT 0x000B0000
+#define SMI_BRESENHAM_LINE 0x00070000
+#define SMI_HOSTBLT_WRITE 0x00080000
+#define SMI_HOSTBLT_READ 0x00090000
+#define SMI_ROTATE_BLT 0x000B0000
-#define SMI_SRC_COLOR 0x00000000
-#define SMI_SRC_MONOCHROME 0x00400000
+#define SMI_SRC_COLOR 0x00000000
+#define SMI_SRC_MONOCHROME 0x00400000
#define SMI_GRAPHICS_STRETCH 0x00800000
-#define SMI_ROTATE_CW 0x01000000
-#define SMI_ROTATE_CCW 0x02000000
+#define SMI_ROTATE_CW 0x01000000
+#define SMI_ROTATE_CCW 0x02000000
-#define SMI_MAJOR_X 0x00000000
-#define SMI_MAJOR_Y 0x04000000
+#define SMI_MAJOR_X 0x00000000
+#define SMI_MAJOR_Y 0x04000000
-#define SMI_LEFT_TO_RIGHT 0x00000000
-#define SMI_RIGHT_TO_LEFT 0x08000000
+#define SMI_LEFT_TO_RIGHT 0x00000000
+#define SMI_RIGHT_TO_LEFT 0x08000000
-#define SMI_COLOR_PATTERN 0x40000000
-#define SMI_MONO_PATTERN 0x00000000
+#define SMI_COLOR_PATTERN 0x40000000
+#define SMI_MONO_PATTERN 0x00000000
-#define SMI_QUICK_START 0x10000000
-#define SMI_START_ENGINE 0x80000000
+#define SMI_QUICK_START 0x10000000
+#define SMI_START_ENGINE 0x80000000
#define MAXLOOP 0x100000 /* timeout value for engine waits */
-#define ENGINE_IDLE() \
- ((VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x16) & 0x08) == 0)
-#define FIFO_EMPTY() \
- ((VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x16) & 0x10) != 0)
+#define ENGINE_IDLE() \
+ ((VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x16) & 0x08) == 0)
+#define FIFO_EMPTY() \
+ ((VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x16) & 0x10) != 0)
/* Wait until "v" queue entries are free */
-#define WaitQueue(v) \
- do \
- { \
- if (pSmi->NoPCIRetry) \
- { \
- int loop = MAXLOOP; mem_barrier(); \
- while (!FIFO_EMPTY()) \
- if (loop-- == 0) break; \
- if (loop <= 0) SMI_GEReset(pScrn, 1, __LINE__, __FILE__); \
- } \
- } while (0)
+#define WaitQueue(v) \
+ do { \
+ if (pSmi->NoPCIRetry) { \
+ int loop = MAXLOOP; mem_barrier(); \
+ while (!FIFO_EMPTY()) \
+ if (loop-- == 0) break; \
+ if (loop <= 0) SMI_GEReset(pScrn, 1, __LINE__, __FILE__); \
+ } \
+ } while (0)
/* Wait until GP is idle */
-#define WaitIdle() \
- do \
- { \
- int loop = MAXLOOP; mem_barrier(); \
- while (!ENGINE_IDLE()) \
- if (loop-- == 0) break; \
- if (loop <= 0) SMI_GEReset(pScrn, 1, __LINE__, __FILE__); \
- } \
- while (0)
+#define WaitIdle() \
+ do { \
+ int loop = MAXLOOP; mem_barrier(); \
+ while (!ENGINE_IDLE()) \
+ if (loop-- == 0) break; \
+ if (loop <= 0) SMI_GEReset(pScrn, 1, __LINE__, __FILE__); \
+ } while (0)
/* Wait until GP is idle and queue is empty */
-#define WaitIdleEmpty() \
- do \
- { \
- WaitQueue(MAXFIFO); \
- WaitIdle(); \
- } \
- while (0)
+#define WaitIdleEmpty() \
+ do { \
+ WaitQueue(MAXFIFO); \
+ WaitIdle(); \
+ } while (0)
#define RGB8_PSEUDO (-1)
#define RGB16_565 0
@@ -210,7 +191,7 @@ VGAOUT8(SMIPtr pSmi, int port, CARD8 data)
/* register defines so we're not hardcoding numbers */
-#define FPR00 0x0000
+#define FPR00 0x0000
/* video window formats - I=indexed, P=packed */
#define FPR00_FMT_8I 0x0
diff --git a/driver/xf86-video-siliconmotion/src/smi.h b/driver/xf86-video-siliconmotion/src/smi.h
index ad1c2e249..c785fa026 100644
--- a/driver/xf86-video-siliconmotion/src/smi.h
+++ b/driver/xf86-video-siliconmotion/src/smi.h
@@ -26,11 +26,12 @@ Silicon Motion 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 and Silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v 1.12tsi Exp $ */
#ifndef _SMI_H
#define _SMI_H
+#include "smi_pcirename.h"
+
#include <string.h>
#include <stdio.h>
@@ -49,6 +50,7 @@ authorization from the XFree86 Project and Silicon Motion.
#include "fb.h"
#include "xaa.h"
+#include "exa.h"
#include "xf86cmap.h"
#include "xf86i2c.h"
@@ -63,7 +65,7 @@ authorization from the XFree86 Project and Silicon Motion.
/******************************************************************************/
#ifndef SMI_DEBUG
-# define SMI_DEBUG 0
+# define SMI_DEBUG 0
#endif
#define SMI_USE_IMAGE_WRITES 0
@@ -77,177 +79,186 @@ authorization from the XFree86 Project and Silicon Motion.
/* Driver data structure; this should contain all needed info for a mode */
typedef struct
{
- Bool modeInit;
- CARD16 mode;
- CARD8 SR17, SR18, SR21, SR31, SR32, SR6A, SR6B, SR81, SRA0;
- CARD8 CR33, CR33_2, CR3A;
- CARD8 CR40[14], CR40_2[14];
- CARD8 CR90[16], CR9F_2;
- CARD8 CRA0[14];
- CARD8 smiDACMask, smiDacRegs[256][3];
+ Bool modeInit;
+ CARD16 mode;
+ CARD8 SR17, SR18, SR21, SR31, SR32, SR6A, SR6B, SR81, SRA0;
+ CARD8 CR33, CR33_2, CR3A;
+ CARD8 CR40[14], CR40_2[14];
+ CARD8 CR90[16], CR9F_2;
+ CARD8 CRA0[14];
+ CARD8 smiDACMask, smiDacRegs[256][3];
/* CZ 2.11.2001: for gamma correction */
CARD8 CCR66;
/* end CZ */
- CARD8 smiFont[8192];
- CARD32 DPR10, DPR1C, DPR20, DPR24, DPR28, DPR2C, DPR30, DPR3C, DPR40,
- DPR44;
- CARD32 VPR00, VPR0C, VPR10;
- CARD32 CPR00;
- CARD32 FPR00_, FPR0C_, FPR10_;
- /* LCD FIFO regs, etc. - dualhead */
- CARD8 SR22, SR40, SR41, SR42, SR43, SR44, SR45, SR48, SR49,
- SR4A, SR4B, SR4C;
- /* PLL controls */
- CARD8 SR68, SR69, SR6C, SR6D, SR6E, SR6F;
+ CARD8 smiFont[8192];
+ CARD32 DPR10, DPR1C, DPR20, DPR24, DPR28, DPR2C, DPR30, DPR3C, DPR40,
+ DPR44;
+ CARD32 VPR00, VPR0C, VPR10;
+ CARD32 CPR00;
+ CARD32 FPR00_, FPR0C_, FPR10_;
+ /* LCD FIFO regs, etc. - dualhead */
+ CARD8 SR22, SR40, SR41, SR42, SR43, SR44, SR45, SR48, SR49,
+ SR4A, SR4B, SR4C;
+ /* PLL controls */
+ CARD8 SR68, SR69, SR6C, SR6D, SR6E, SR6F;
} SMIRegRec, *SMIRegPtr;
/* Global PDEV structure. */
typedef struct
{
- /* accel additions */
- CARD32 AccelCmd; /* Value for DPR0C */
- CARD32 Stride; /* Stride of frame buffer */
- CARD32 ScissorsLeft; /* Left/top of current
- scissors */
- CARD32 ScissorsRight; /* Right/bottom of current
- scissors */
- Bool ClipTurnedOn; /* Clipping was turned on by
- the previous command */
- CARD8 SR18Value; /* PDR#521: original SR18
- value */
- CARD8 SR21Value; /* PDR#521: original SR21
- value */
- SMIRegRec SavedReg; /* console saved mode
- registers */
- SMIRegRec ModeReg; /* XServer video state mode
- registers */
- xf86CursorInfoPtr CursorInfoRec; /* HW Cursor info */
-
- Bool ModeStructInit; /* Flag indicating ModeReg has
- been duped from console
- state */
- int vgaCRIndex, vgaCRReg;
- int width, height; /* Width and height of the
- screen */
- int Bpp; /* Bytes per pixel */
-
- /* XAA */
- int videoRAMBytes; /* In units as noted, set in
- PreInit */
- int videoRAMKBytes; /* In units as noted, set in
- PreInit */
- unsigned char * MapBase; /* Base of mapped memory */
- int MapSize; /* Size of mapped memory */
- CARD8 * DPRBase; /* Base of DPR registers */
- CARD8 * VPRBase; /* Base of VPR registers */
- CARD8 * CPRBase; /* Base of CPR registers */
- CARD8 * FPRBase; /* Base of FPR registers - for 0730 chipset */
- CARD8 * DataPortBase; /* Base of data port */
- int DataPortSize; /* Size of data port */
- CARD8 * IOBase; /* Base of MMIO VGA ports */
- IOADDRESS PIOBase; /* Base of I/O ports */
- unsigned char * FBBase; /* Base of FB */
- CARD32 FBOffset; /* Current visual FB starting
- location */
- CARD32 FBCursorOffset; /* Cursor storage location */
- CARD32 FBReserved; /* Reserved memory in frame
- buffer */
+ /* accel additions */
+ CARD32 AccelCmd; /* Value for DPR0C */
+ CARD32 Stride; /* Stride of frame buffer */
+ CARD32 ScissorsLeft; /* Left/top of current
+ scissors */
+ CARD32 ScissorsRight; /* Right/bottom of current
+ scissors */
+ Bool ClipTurnedOn; /* Clipping was turned on by
+ the previous command */
+ CARD8 SR18Value; /* PDR#521: original SR18
+ value */
+ CARD8 SR21Value; /* PDR#521: original SR21
+ value */
+ SMIRegRec SavedReg; /* console saved mode
+ registers */
+ SMIRegRec ModeReg; /* XServer video state mode
+ registers */
+ xf86CursorInfoPtr CursorInfoRec; /* HW Cursor info */
+
+ Bool ModeStructInit; /* Flag indicating ModeReg has
+ been duped from console
+ state */
+ int vgaCRIndex, vgaCRReg;
+ int width, height; /* Width and height of the
+ screen */
+ int Bpp; /* Bytes per pixel */
+
+ /* XAA */
+ int videoRAMBytes; /* In units as noted, set in
+ PreInit */
+ int videoRAMKBytes; /* In units as noted, set in
+ PreInit */
+ unsigned char * MapBase; /* Base of mapped memory */
+ int MapSize; /* Size of mapped memory */
+ CARD8 * DPRBase; /* Base of DPR registers */
+ CARD8 * VPRBase; /* Base of VPR registers */
+ CARD8 * CPRBase; /* Base of CPR registers */
+ CARD8 * FPRBase; /* Base of FPR registers - for 0730 chipset */
+ CARD8 * DataPortBase; /* Base of data port */
+ int DataPortSize; /* Size of data port */
+ CARD8 * IOBase; /* Base of MMIO VGA ports */
+ IOADDRESS PIOBase; /* Base of I/O ports */
+ unsigned char * FBBase; /* Base of FB */
+ CARD32 FBOffset; /* Current visual FB starting
+ location */
+ CARD32 FBCursorOffset; /* Cursor storage location */
+ CARD32 FBReserved; /* Reserved memory in frame
+ buffer */
- Bool PrimaryVidMapped; /* Flag indicating if
- vgaHWMapMem was used
- successfully for
- this screen */
- int MCLK; /* Memory Clock */
- int GEResetCnt; /* Limit the number of errors
- printed using a counter */
-
- Bool pci_burst; /* Enable PCI burst mode for
- reads? */
- Bool NoPCIRetry; /* Disable PCI retries */
- Bool fifo_conservative; /* Adjust fifo for
- acceleration? */
- Bool fifo_moderate; /* Adjust fifo for
+ Bool PrimaryVidMapped; /* Flag indicating if
+ vgaHWMapMem was used
+ successfully for
+ this screen */
+ int MCLK; /* Memory Clock */
+ int GEResetCnt; /* Limit the number of errors
+ printed using a counter */
+
+ Bool pci_burst; /* Enable PCI burst mode for
+ reads? */
+ Bool NoPCIRetry; /* Disable PCI retries */
+ Bool fifo_conservative; /* Adjust fifo for
+ acceleration? */
+ Bool fifo_moderate; /* Adjust fifo for
+ acceleration? */
+ Bool fifo_aggressive; /* Adjust fifo for
acceleration? */
- Bool fifo_aggressive; /* Adjust fifo for
- acceleration? */
- Bool NoAccel; /* Disable Acceleration */
- Bool hwcursor; /* hardware cursor enabled */
- Bool ShowCache; /* Debugging option */
- Bool useBIOS; /* Use BIOS for mode sets */
- Bool zoomOnLCD; /* Zoom on LCD */
+ Bool NoAccel; /* Disable Acceleration */
+ Bool hwcursor; /* hardware cursor enabled */
+ Bool ShowCache; /* Debugging option */
+ Bool useBIOS; /* Use BIOS for mode sets */
+ Bool zoomOnLCD; /* Zoom on LCD */
- CloseScreenProcPtr CloseScreen; /* Pointer used to save wrapped
- CloseScreen function */
- XAAInfoRecPtr AccelInfoRec; /* XAA info Rec */
- pciVideoPtr PciInfo; /* PCI info vars */
- PCITAG PciTag;
- int Chipset; /* Chip info, set using PCI
- above */
- int ChipRev;
-
- /* DGA */
- DGAModePtr DGAModes; /* Pointer to DGA modes */
- int numDGAModes; /* Number of DGA modes */
- Bool DGAactive; /* Flag if DGA is active */
- int DGAViewportStatus;
-
- /* DPMS */
- int CurrentDPMS; /* Current DPMS state */
- unsigned char DPMS_SR20; /* Saved DPMS SR20 register */
- unsigned char DPMS_SR21; /* Saved DPMS SR21 register */
- unsigned char DPMS_SR31; /* Saved DPMS SR31 register */
- unsigned char DPMS_SR34; /* Saved DPMS SR34 register */
-
- /* Panel information */
- Bool lcd; /* LCD active, 1=DSTN, 2=TFT */
- int lcdWidth; /* LCD width */
- int lcdHeight; /* LCD height */
-
- I2CBusPtr I2C; /* Pointer into I2C module */
- xf86Int10InfoPtr pInt10; /* Pointer to INT10 module */
-
- /* Shadow frame buffer (rotation) */
- Bool shadowFB; /* Flag if shadow buffer is
+ CloseScreenProcPtr CloseScreen; /* Pointer used to save wrapped
+ CloseScreen function */
+ XAAInfoRecPtr XAAInfoRec; /* XAA info Rec */
+
+ /* EXA */
+ ExaDriverPtr EXADriverPtr;
+ Bool useEXA; /* enable exa acceleration */
+
+ pciVideoPtr PciInfo; /* PCI info vars */
+#ifndef XSERVER_LIBPCIACCESS
+ PCITAG PciTag;
+#endif
+ int Chipset; /* Chip info, set using PCI
+ above */
+ int ChipRev;
+
+ /* DGA */
+ DGAModePtr DGAModes; /* Pointer to DGA modes */
+ int numDGAModes; /* Number of DGA modes */
+ Bool DGAactive; /* Flag if DGA is active */
+ int DGAViewportStatus;
+
+ /* DPMS */
+ int CurrentDPMS; /* Current DPMS state */
+ unsigned char DPMS_SR20; /* Saved DPMS SR20 register */
+ unsigned char DPMS_SR21; /* Saved DPMS SR21 register */
+ unsigned char DPMS_SR31; /* Saved DPMS SR31 register */
+ unsigned char DPMS_SR34; /* Saved DPMS SR34 register */
+
+ /* Panel information */
+ Bool lcd; /* LCD active, 1=DSTN, 2=TFT */
+ int lcdWidth; /* LCD width */
+ int lcdHeight; /* LCD height */
+
+ I2CBusPtr I2C; /* Pointer into I2C module */
+ xf86Int10InfoPtr pInt10; /* Pointer to INT10 module */
+
+ /* Shadow frame buffer (rotation) */
+ Bool shadowFB; /* Flag if shadow buffer is
used */
- int rotate; /* Rotation flags */
- int ShadowPitch; /* Pitch of shadow buffer */
- int ShadowWidthBytes; /* Width of shadow
- buffer in bytes */
- int ShadowWidth; /* Width of shadow buffer in
- pixels */
- int ShadowHeight; /* Height of shadow buffer in
- pixels */
- CARD32 saveBufferSize; /* #670 - FB save buffer size */
- void * pSaveBuffer; /* #670 - FB save buffer */
- CARD32 fbMapOffset; /* offset for fb mapping */
- CARD32 savedFBOffset; /* #670 - Saved FBOffset value */
- CARD32 savedFBReserved; /* #670 - Saved
- FBReserved value */
- CARD8 * paletteBuffer; /* #920 - Palette save buffer */
-
- /* Polylines - #671 */
- ValidateGCProcPtr ValidatePolylines; /* Org.
- ValidatePolylines
- function */
- Bool polyLines; /* Our polylines patch is
- active */
-
- void (*PointerMoved)(int index, int x, int y);
-
- int videoKey; /* Video chroma key */
- Bool ByteSwap; /* Byte swap for ZV port */
- Bool interlaced; /* True: Interlaced Video */
- /* XvExtension */
- XF86VideoAdaptorPtr ptrAdaptor; /* Pointer to VideoAdapter
- structure */
- void (*BlockHandler)(int i, pointer blockData, pointer pTimeout,
- pointer pReadMask);
- GCPtr videoGC;
- OptionInfoPtr Options;
- CARD8 DACmask;
-
- Bool Dualhead;
+ int rotate; /* Rotation flags */
+ int ShadowPitch; /* Pitch of shadow buffer */
+ int ShadowWidthBytes; /* Width of shadow
+ buffer in bytes */
+ int ShadowWidth; /* Width of shadow buffer in
+ pixels */
+ int ShadowHeight; /* Height of shadow buffer in
+ pixels */
+ CARD32 saveBufferSize; /* #670 - FB save buffer size */
+ void * pSaveBuffer; /* #670 - FB save buffer */
+ CARD32 fbMapOffset; /* offset for fb mapping */
+ CARD32 savedFBOffset; /* #670 - Saved FBOffset value */
+ CARD32 savedFBReserved; /* #670 - Saved
+ FBReserved value */
+ CARD8 * paletteBuffer; /* #920 - Palette save buffer */
+
+ /* Polylines - #671 */
+ ValidateGCProcPtr ValidatePolylines; /* Org.
+ ValidatePolylines
+ function */
+ Bool polyLines; /* Our polylines patch is
+ active */
+
+ void (*PointerMoved)(int index, int x, int y);
+
+ int videoKey; /* Video chroma key */
+ Bool ByteSwap; /* Byte swap for ZV port */
+ Bool interlaced; /* True: Interlaced Video */
+ /* XvExtension */
+ XF86VideoAdaptorPtr ptrAdaptor; /* Pointer to VideoAdapter
+ structure */
+ void (*BlockHandler)(int i, pointer blockData, pointer pTimeout,
+ pointer pReadMask);
+ GCPtr videoGC;
+ OptionInfoPtr Options;
+ CARD8 DACmask;
+
+ Bool Dualhead;
+
+ Bool IsSwitching; /* when switching modes */
} SMIRec, *SMIPtr;
@@ -258,20 +269,20 @@ typedef struct
/******************************************************************************/
#if SMI_DEBUG
-# define VERBLEV 1
-# define ENTER_PROC(PROCNAME) xf86ErrorFVerb(VERBLEV, "ENTER\t" PROCNAME \
- "(%d)\n", __LINE__); xf86Break1()
-# define DEBUG_PROC(PROCNAME) xf86ErrorFVerb(VERBLEV, "DEBUG\t" PROCNAME \
- "(%d)\n", __LINE__); xf86Break2()
-# define LEAVE_PROC(PROCNAME) xf86ErrorFVerb(VERBLEV, "LEAVE\t" PROCNAME \
- "(%d)\n", __LINE__); xf86Break1()
-# define DEBUG(arg) xf86ErrorFVerb arg
+# define VERBLEV 1
+# define ENTER_PROC(PROCNAME) xf86ErrorFVerb(VERBLEV, "ENTER\t" PROCNAME \
+ "(%d)\n", __LINE__); xf86Break1()
+# define DEBUG_PROC(PROCNAME) xf86ErrorFVerb(VERBLEV, "DEBUG\t" PROCNAME \
+ "(%d)\n", __LINE__); xf86Break2()
+# define LEAVE_PROC(PROCNAME) xf86ErrorFVerb(VERBLEV, "LEAVE\t" PROCNAME \
+ "(%d)\n", __LINE__); xf86Break1()
+# define DEBUG(arg) xf86ErrorFVerb arg
#else
-# define VERBLEV 4
-# define ENTER_PROC(PROCNAME)
-# define DEBUG_PROC(PROCNAME)
-# define LEAVE_PROC(PROCNAME)
-# define DEBUG(arg)
+# define VERBLEV 4
+# define ENTER_PROC(PROCNAME)
+# define DEBUG_PROC(PROCNAME)
+# define LEAVE_PROC(PROCNAME)
+# define DEBUG(arg)
#endif
/* Some Silicon Motion structs & registers */
@@ -332,10 +343,13 @@ void SMI_CommonCalcClock(int scrnIndex, long freq, int min_m, int min_n1,
Bool SMI_I2CInit(ScrnInfoPtr pScrn);
/* smi_accel.c */
-Bool SMI_AccelInit(ScreenPtr pScrn);
+Bool SMI_XAAInit(ScreenPtr pScrn);
+Bool SMI_EXAInit(ScreenPtr pScrn);
void SMI_AccelSync(ScrnInfoPtr pScrn);
void SMI_GEReset(ScrnInfoPtr pScrn, int from_timeout, int line, char *file);
void SMI_EngineReset(ScrnInfoPtr);
+void SMI_SetClippingRectangle(ScrnInfoPtr, int, int, int, int);
+void SMI_DisableClipping(ScrnInfoPtr);
/* smi_hwcurs.c */
Bool SMI_HWCursorInit(ScreenPtr pScrn);
diff --git a/driver/xf86-video-siliconmotion/src/smi_accel.c b/driver/xf86-video-siliconmotion/src/smi_accel.c
index c5b61fcf8..5cdadc077 100644
--- a/driver/xf86-video-siliconmotion/src/smi_accel.c
+++ b/driver/xf86-video-siliconmotion/src/smi_accel.c
@@ -26,7 +26,6 @@ Silicon Motion 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 and silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c,v 1.7tsi Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -34,857 +33,116 @@ authorization from the XFree86 Project and silicon Motion.
#include "smi.h"
-#include "miline.h"
-#include "xaalocal.h"
-#include "xaarop.h"
-#include "servermd.h"
-
-
-static void SMI_SetupForScreenToScreenCopy(ScrnInfoPtr, int, int, int,
- unsigned int, int);
-static void SMI_SubsequentScreenToScreenCopy(ScrnInfoPtr, int, int, int, int,
- int, int);
-static void SMI_SetupForSolidFill(ScrnInfoPtr, int, int, unsigned);
-static void SMI_SubsequentSolidFillRect(ScrnInfoPtr, int, int, int, int);
-static void SMI_SubsequentSolidHorVertLine(ScrnInfoPtr, int, int, int, int);
-static void SMI_SetupForCPUToScreenColorExpandFill(ScrnInfoPtr, int, int, int,
- unsigned int);
-static void SMI_SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr, int, int, int,
- int, int);
-static void SMI_SetupForMono8x8PatternFill(ScrnInfoPtr, int, int, int, int, int,
- unsigned int);
-static void SMI_SubsequentMono8x8PatternFillRect(ScrnInfoPtr, int, int, int,
- int, int, int);
-static void SMI_SetupForColor8x8PatternFill(ScrnInfoPtr, int, int, int,
- unsigned int, int);
-static void SMI_SubsequentColor8x8PatternFillRect(ScrnInfoPtr, int, int, int,
- int, int, int);
-#if SMI_USE_IMAGE_WRITES
-static void SMI_SetupForImageWrite(ScrnInfoPtr, int, unsigned int, int, int,
- int);
-static void SMI_SubsequentImageWriteRect(ScrnInfoPtr, int, int, int, int, int);
-#endif
-static void SMI_SetClippingRectangle(ScrnInfoPtr, int, int, int, int);
-static void SMI_DisableClipping(ScrnInfoPtr);
-/* #671 */
-static void SMI_ValidatePolylines(GCPtr, unsigned long, DrawablePtr);
-static void SMI_Polylines(DrawablePtr, GCPtr, int, int, DDXPointPtr);
-
-Bool
-SMI_AccelInit(ScreenPtr pScreen)
-{
- XAAInfoRecPtr infoPtr;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- SMIPtr pSmi = SMIPTR(pScrn);
- /*BoxRec AvailFBArea;*/
- Bool ret;
- /*int numLines, maxLines;*/
-
- ENTER_PROC("SMI_AccelInit");
-
- pSmi->AccelInfoRec = infoPtr = XAACreateInfoRec();
- if (infoPtr == NULL)
- {
- LEAVE_PROC("SMI_AccelInit");
- return FALSE;
- }
-
- infoPtr->Flags = PIXMAP_CACHE
- | LINEAR_FRAMEBUFFER
- | OFFSCREEN_PIXMAPS;
-
- infoPtr->Sync = SMI_AccelSync;
-
- /* Screen to screen copies */
- infoPtr->ScreenToScreenCopyFlags = NO_PLANEMASK
- | ONLY_TWO_BITBLT_DIRECTIONS;
- infoPtr->SetupForScreenToScreenCopy = SMI_SetupForScreenToScreenCopy;
- infoPtr->SubsequentScreenToScreenCopy = SMI_SubsequentScreenToScreenCopy;
- if (pScrn->bitsPerPixel == 24)
- {
- infoPtr->ScreenToScreenCopyFlags |= NO_TRANSPARENCY;
- }
- if ((pSmi->Chipset == SMI_LYNX3D) && (pScrn->bitsPerPixel == 8))
- {
- infoPtr->ScreenToScreenCopyFlags |= GXCOPY_ONLY;
- }
-
- /* Solid Fills */
- infoPtr->SolidFillFlags = NO_PLANEMASK;
- infoPtr->SetupForSolidFill = SMI_SetupForSolidFill;
- infoPtr->SubsequentSolidFillRect = SMI_SubsequentSolidFillRect;
-
- /* Solid Lines */
- infoPtr->SolidLineFlags = NO_PLANEMASK;
- infoPtr->SetupForSolidLine = SMI_SetupForSolidFill;
- infoPtr->SubsequentSolidHorVertLine = SMI_SubsequentSolidHorVertLine;
-
- /* Color Expansion Fills */
- infoPtr->CPUToScreenColorExpandFillFlags = ROP_NEEDS_SOURCE
- | NO_PLANEMASK
- | BIT_ORDER_IN_BYTE_MSBFIRST
- | LEFT_EDGE_CLIPPING
- | CPU_TRANSFER_PAD_DWORD
- | SCANLINE_PAD_DWORD;
- infoPtr->ColorExpandBase = pSmi->DataPortBase;
- infoPtr->ColorExpandRange = pSmi->DataPortSize;
- infoPtr->SetupForCPUToScreenColorExpandFill =
- SMI_SetupForCPUToScreenColorExpandFill;
- infoPtr->SubsequentCPUToScreenColorExpandFill =
- SMI_SubsequentCPUToScreenColorExpandFill;
-
- /* 8x8 Mono Pattern Fills */
- infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK
- | HARDWARE_PATTERN_PROGRAMMED_BITS
- | HARDWARE_PATTERN_SCREEN_ORIGIN
- | BIT_ORDER_IN_BYTE_MSBFIRST;
- infoPtr->SetupForMono8x8PatternFill = SMI_SetupForMono8x8PatternFill;
- infoPtr->SubsequentMono8x8PatternFillRect =
- SMI_SubsequentMono8x8PatternFillRect;
-
- /* 8x8 Color Pattern Fills */
- if (!SMI_LYNX3D_SERIES(pSmi->Chipset) || (pScrn->bitsPerPixel != 24))
- {
- infoPtr->Color8x8PatternFillFlags = NO_PLANEMASK
- | HARDWARE_PATTERN_SCREEN_ORIGIN;
- infoPtr->SetupForColor8x8PatternFill =
- SMI_SetupForColor8x8PatternFill;
- infoPtr->SubsequentColor8x8PatternFillRect =
- SMI_SubsequentColor8x8PatternFillRect;
- }
-
-#if SMI_USE_IMAGE_WRITES
- /* Image Writes */
- infoPtr->ImageWriteFlags = ROP_NEEDS_SOURCE
- | NO_PLANEMASK
- | CPU_TRANSFER_PAD_DWORD
- | SCANLINE_PAD_DWORD;
- infoPtr->ImageWriteBase = pSmi->DataPortBase;
- infoPtr->ImageWriteRange = pSmi->DataPortSize;
- infoPtr->SetupForImageWrite = SMI_SetupForImageWrite;
- infoPtr->SubsequentImageWriteRect = SMI_SubsequentImageWriteRect;
-#endif
-
- /* Clipping */
- infoPtr->ClippingFlags = HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY
- | HARDWARE_CLIP_MONO_8x8_FILL
- | HARDWARE_CLIP_COLOR_8x8_FILL
- | HARDWARE_CLIP_SOLID_FILL
- | HARDWARE_CLIP_SOLID_LINE
- | HARDWARE_CLIP_DASHED_LINE;
- infoPtr->SetClippingRectangle = SMI_SetClippingRectangle;
- infoPtr->DisableClipping = SMI_DisableClipping;
-
- /* Pixmap Cache */
- if (pScrn->bitsPerPixel == 24)
- {
- infoPtr->CachePixelGranularity = 16;
- }
- else
- {
- infoPtr->CachePixelGranularity = 128 / pScrn->bitsPerPixel;
- }
-
- /* Offscreen Pixmaps */
- infoPtr->maxOffPixWidth = 4096;
- infoPtr->maxOffPixHeight = 4096;
- if (pScrn->bitsPerPixel == 24)
- {
- infoPtr->maxOffPixWidth = 4096 / 3;
-
- if (pSmi->Chipset == SMI_LYNX)
- {
- infoPtr->maxOffPixHeight = 4096 / 3;
- }
- }
-
- SMI_EngineReset(pScrn);
-
-
- /* CZ 18.06.2001: moved to smi_driver.c before the NoAccel question
- to have offscreen framebuffer in NoAccel mode */
-#if 0
- maxLines = pSmi->FBReserved / (pSmi->width * pSmi->Bpp);
- if (pSmi->rotate)
- {
- numLines = maxLines;
- }
- else
- {
-#if SMI_USE_VIDEO
- numLines = ((pSmi->FBReserved - pSmi->width * pSmi->Bpp * pSmi->height)
- * 25 / 100 + pSmi->width * pSmi->Bpp - 1)
- / (pSmi->width * pSmi->Bpp);
- numLines += pSmi->height;
-#else
- numLines = maxLines;
-#endif
- }
-
- AvailFBArea.x1 = 0;
- AvailFBArea.y1 = 0;
- AvailFBArea.x2 = pSmi->width;
- AvailFBArea.y2 = numLines;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FrameBuffer Box: %d,%d - %d,%d\n",
- AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2);
- xf86InitFBManager(pScreen, &AvailFBArea);
-#endif
-
- ret = XAAInit(pScreen, infoPtr);
- if (ret && pSmi->shadowFB) /* #671 */
- {
- pSmi->ValidatePolylines = infoPtr->ValidatePolylines;
- infoPtr->ValidatePolylines = SMI_ValidatePolylines;
- }
-
- LEAVE_PROC("SMI_AccelInit");
- return(ret);
-}
-
void
SMI_GEReset(ScrnInfoPtr pScrn, int from_timeout, int line, char *file)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- CARD8 tmp;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ CARD8 tmp;
- ENTER_PROC("SMI_GEReset");
+ ENTER_PROC("SMI_GEReset");
- if (from_timeout)
- {
- if (pSmi->GEResetCnt++ < 10 || xf86GetVerbosity() > 1)
- {
- xf86DrvMsg(pScrn->scrnIndex,X_INFO,"\tSMI_GEReset called from %s line %d\n", file, line);
- }
- }
- else
- {
- WaitIdleEmpty();
+ if (from_timeout) {
+ if (pSmi->GEResetCnt++ < 10 || xf86GetVerbosity() > 1) {
+ xf86DrvMsg(pScrn->scrnIndex,X_INFO,"\tSMI_GEReset called from %s line %d\n", file, line);
}
+ } else {
+ WaitIdleEmpty();
+ }
- tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15, tmp | 0x30);
+ tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15, tmp | 0x30);
- WaitIdleEmpty();
+ WaitIdleEmpty();
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15, tmp);
- SMI_EngineReset(pScrn);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15, tmp);
+ SMI_EngineReset(pScrn);
- LEAVE_PROC("SMI_GEReset");
+ LEAVE_PROC("SMI_GEReset");
}
/* The sync function for the GE */
void
SMI_AccelSync(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_AccelSync");
+ ENTER_PROC("SMI_AccelSync");
- WaitIdleEmpty(); /* #161 */
+ WaitIdleEmpty(); /* #161 */
- LEAVE_PROC("SMI_AccelSync");
+ LEAVE_PROC("SMI_AccelSync");
}
void
SMI_EngineReset(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- CARD32 DEDataFormat = 0;
- int i;
- int xyAddress[] = { 320, 400, 512, 640, 800, 1024, 1280, 1600, 2048 };
+ SMIPtr pSmi = SMIPTR(pScrn);
+ CARD32 DEDataFormat = 0;
+ int i;
+ int xyAddress[] = { 320, 400, 512, 640, 800, 1024, 1280, 1600, 2048 };
- ENTER_PROC("SMI_EngineReset");
+ ENTER_PROC("SMI_EngineReset");
- pSmi->Stride = (pSmi->width * pSmi->Bpp + 15) & ~15;
+ pSmi->Stride = (pSmi->width * pSmi->Bpp + 15) & ~15;
- switch (pScrn->bitsPerPixel)
- {
- case 8:
- DEDataFormat = 0x00000000;
- break;
+ switch (pScrn->bitsPerPixel) {
+ case 8:
+ DEDataFormat = 0x00000000;
+ break;
+ case 16:
+ pSmi->Stride >>= 1;
+ DEDataFormat = 0x00100000;
+ break;
+ case 24:
+ DEDataFormat = 0x00300000;
+ break;
+ case 32:
+ pSmi->Stride >>= 2;
+ DEDataFormat = 0x00200000;
+ break;
+ }
- case 16:
- pSmi->Stride >>= 1;
- DEDataFormat = 0x00100000;
- break;
-
- case 24:
- DEDataFormat = 0x00300000;
- break;
-
- case 32:
- pSmi->Stride >>= 2;
- DEDataFormat = 0x00200000;
- break;
- }
- for (i = 0; i < sizeof(xyAddress) / sizeof(xyAddress[0]); i++)
- {
- if (pSmi->rotate)
- {
- if (xyAddress[i] == pSmi->height)
- {
- DEDataFormat |= i << 16;
- break;
- }
- }
- else
- {
- if (xyAddress[i] == pSmi->width)
- {
- DEDataFormat |= i << 16;
- break;
- }
- }
+ for (i = 0; i < sizeof(xyAddress) / sizeof(xyAddress[0]); i++) {
+ if (pSmi->rotate) {
+ if (xyAddress[i] == pSmi->height) {
+ DEDataFormat |= i << 16;
+ break;
+ }
+ } else {
+ if (xyAddress[i] == pSmi->width) {
+ DEDataFormat |= i << 16;
+ break;
+ }
}
+ }
- WaitIdleEmpty();
- WRITE_DPR(pSmi, 0x10, (pSmi->Stride << 16) | pSmi->Stride);
- WRITE_DPR(pSmi, 0x1C, DEDataFormat);
- WRITE_DPR(pSmi, 0x24, 0xFFFFFFFF);
- WRITE_DPR(pSmi, 0x28, 0xFFFFFFFF);
- WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride);
- WRITE_DPR(pSmi, 0x40, pSmi->FBOffset);
- WRITE_DPR(pSmi, 0x44, pSmi->FBOffset);
+ WaitIdleEmpty();
+ WRITE_DPR(pSmi, 0x10, (pSmi->Stride << 16) | pSmi->Stride);
+ WRITE_DPR(pSmi, 0x1C, DEDataFormat);
+ WRITE_DPR(pSmi, 0x24, 0xFFFFFFFF);
+ WRITE_DPR(pSmi, 0x28, 0xFFFFFFFF);
+ WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride);
+ WRITE_DPR(pSmi, 0x40, pSmi->FBOffset >> 3);
+ WRITE_DPR(pSmi, 0x44, pSmi->FBOffset >> 3);
- SMI_DisableClipping(pScrn);
+ SMI_DisableClipping(pScrn);
- LEAVE_PROC("SMI_EngineReset");
+ LEAVE_PROC("SMI_EngineReset");
}
/******************************************************************************/
-/* Screen to Screen Copies */
+/* Clipping */
/******************************************************************************/
-static void
-SMI_SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop,
- unsigned int planemask, int trans)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SetupForScreenToScreenCopy");
- DEBUG((VERBLEV, "xdir=%d ydir=%d rop=%02X trans=%08X\n", xdir, ydir,
- rop, trans));
-
- pSmi->AccelCmd = XAAGetCopyROP(rop)
- | SMI_BITBLT
- | SMI_START_ENGINE;
-
- if ((xdir == -1) || (ydir == -1))
- {
- pSmi->AccelCmd |= SMI_RIGHT_TO_LEFT;
- }
-
- if (trans != -1)
- {
- pSmi->AccelCmd |= SMI_TRANSPARENT_SRC | SMI_TRANSPARENT_PXL;
- WaitQueue(1);
- WRITE_DPR(pSmi, 0x20, trans);
- }
-
- if (pSmi->ClipTurnedOn)
- {
- WaitQueue(1);
- WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
- pSmi->ClipTurnedOn = FALSE;
- }
-
- LEAVE_PROC("SMI_SetupForScreenToScreenCopy");
-}
-
-static void
-SMI_SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2,
- int y2, int w, int h)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SubsequentScreenToScreenCopy");
- DEBUG((VERBLEV, "x1=%d y1=%d x2=%d y2=%d w=%d h=%d\n", x1, y1, x2, y2, w,
- h));
-
- if (pSmi->AccelCmd & SMI_RIGHT_TO_LEFT)
- {
- x1 += w - 1;
- y1 += h - 1;
- x2 += w - 1;
- y2 += h - 1;
- }
-
- if (pScrn->bitsPerPixel == 24)
- {
- x1 *= 3;
- x2 *= 3;
- w *= 3;
-
- if (pSmi->Chipset == SMI_LYNX)
- {
- y1 *= 3;
- y2 *= 3;
- }
-
- if (pSmi->AccelCmd & SMI_RIGHT_TO_LEFT)
- {
- x1 += 2;
- x2 += 2;
- }
- }
-
- WaitQueue(4);
- WRITE_DPR(pSmi, 0x00, (x1 << 16) + (y1 & 0xFFFF));
- WRITE_DPR(pSmi, 0x04, (x2 << 16) + (y2 & 0xFFFF));
- WRITE_DPR(pSmi, 0x08, (w << 16) + (h & 0xFFFF));
- WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
-
- LEAVE_PROC("SMI_SubsequentScreenToScreenCopy");
-}
-
-/******************************************************************************/
-/* Solid Fills */
-/******************************************************************************/
-
-static void
-SMI_SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
- unsigned int planemask)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SetupForSolidFill");
- DEBUG((VERBLEV, "color=%08X rop=%02X\n", color, rop));
-
- pSmi->AccelCmd = XAAGetPatternROP(rop)
- | SMI_BITBLT
- | SMI_START_ENGINE;
-
- if (pSmi->ClipTurnedOn)
- {
- WaitQueue(4);
- WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
- pSmi->ClipTurnedOn = FALSE;
- }
- else
- {
- WaitQueue(3);
- }
- WRITE_DPR(pSmi, 0x14, color);
- WRITE_DPR(pSmi, 0x34, 0xFFFFFFFF);
- WRITE_DPR(pSmi, 0x38, 0xFFFFFFFF);
-
- LEAVE_PROC("SMI_SetupForSolidFill");
-}
-
-void
-SMI_SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SubsequentSolidFillRect");
- DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", x, y, w, h));
-
- if (pScrn->bitsPerPixel == 24)
- {
- x *= 3;
- w *= 3;
-
- if (pSmi->Chipset == SMI_LYNX)
- {
- y *= 3;
- }
- }
-
- WaitQueue(3);
- WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF));
- WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
- WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
-
- LEAVE_PROC("SMI_SubsequentSolidFillRect");
-}
-
-/******************************************************************************/
-/* Solid Lines */
-/******************************************************************************/
-
-static void
-SMI_SubsequentSolidHorVertLine(ScrnInfoPtr pScrn, int x, int y, int len,
- int dir)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
- int w, h;
-
- ENTER_PROC("SMI_SubsequentSolidHorVertLine");
- DEBUG((VERBLEV, "x=%d y=%d len=%d dir=%d\n", x, y, len, dir));
-
- if (dir == DEGREES_0)
- {
- w = len;
- h = 1;
- }
- else
- {
- w = 1;
- h = len;
- }
-
- if (pScrn->bitsPerPixel == 24)
- {
- x *= 3;
- w *= 3;
-
- if (pSmi->Chipset == SMI_LYNX)
- {
- y *= 3;
- }
- }
-
- WaitQueue(3);
- WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF));
- WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
- WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
-
- LEAVE_PROC("SMI_SubsequentSolidHorVertLine");
-}
-
-/******************************************************************************/
-/* Color Expansion Fills */
-/******************************************************************************/
-
-static void
-SMI_SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg, int bg,
- int rop, unsigned int planemask)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SetupForCPUToScreenColorExpandFill");
- DEBUG((VERBLEV, "fg=%08X bg=%08X rop=%02X\n", fg, bg, rop));
-
- pSmi->AccelCmd = XAAGetCopyROP(rop)
- | SMI_HOSTBLT_WRITE
- | SMI_SRC_MONOCHROME
- | SMI_START_ENGINE;
-
- if (bg == -1)
- {
- pSmi->AccelCmd |= SMI_TRANSPARENT_SRC;
-
- WaitQueue(3);
- WRITE_DPR(pSmi, 0x14, fg);
- WRITE_DPR(pSmi, 0x18, ~fg);
- WRITE_DPR(pSmi, 0x20, fg);
- }
- else
- {
- WaitQueue(2);
- WRITE_DPR(pSmi, 0x14, fg);
- WRITE_DPR(pSmi, 0x18, bg);
- }
-
- LEAVE_PROC("SMI_SetupForCPUToScreenColorExpandFill");
-}
-
void
-SMI_SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int x, int y, int w,
- int h, int skipleft)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SubsequentCPUToScreenColorExpandFill");
- DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d skipleft=%d\n", x, y, w, h, skipleft));
-
- if (pScrn->bitsPerPixel == 24)
- {
- x *= 3;
- w *= 3;
- skipleft *= 3;
-
- if (pSmi->Chipset == SMI_LYNX)
- {
- y *= 3;
- }
- }
-
- if (skipleft)
- {
- WaitQueue(5);
- WRITE_DPR(pSmi, 0x2C, (pSmi->ScissorsLeft & 0xFFFF0000)
- | (x + skipleft) | 0x2000);
- pSmi->ClipTurnedOn = TRUE;
- }
- else
- {
- if (pSmi->ClipTurnedOn)
- {
- WaitQueue(5);
- WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
- pSmi->ClipTurnedOn = FALSE;
- }
- else
- {
- WaitQueue(4);
- }
- }
- WRITE_DPR(pSmi, 0x00, 0);
- WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF));
- WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
- WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
-
- LEAVE_PROC("SMI_SubsequentCPUToScreenColorExpandFill");
-}
-
-/******************************************************************************/
-/* 8x8 Mono Pattern Fills */
-/******************************************************************************/
-
-static void
-SMI_SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, int fg,
- int bg, int rop, unsigned int planemask)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SetupForMono8x8PatternFill");
- DEBUG((VERBLEV, "patx=%08X paty=%08X fg=%08X bg=%08X rop=%02X\n", patx,
- paty, fg, bg, rop));
-
- pSmi->AccelCmd = XAAGetPatternROP(rop)
- | SMI_BITBLT
- | SMI_START_ENGINE;
-
- if (pSmi->ClipTurnedOn)
- {
- WaitQueue(1);
- WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
- pSmi->ClipTurnedOn = FALSE;
- }
-
- if (bg == -1)
- {
- WaitQueue(5);
- WRITE_DPR(pSmi, 0x14, fg);
- WRITE_DPR(pSmi, 0x18, ~fg);
- WRITE_DPR(pSmi, 0x20, fg);
- WRITE_DPR(pSmi, 0x34, patx);
- WRITE_DPR(pSmi, 0x38, paty);
- }
- else
- {
- WaitQueue(4);
- WRITE_DPR(pSmi, 0x14, fg);
- WRITE_DPR(pSmi, 0x18, bg);
- WRITE_DPR(pSmi, 0x34, patx);
- WRITE_DPR(pSmi, 0x38, paty);
- }
-
- LEAVE_PROC("SMI_SetupForMono8x8PatternFill");
-}
-
-static void
-SMI_SubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty,
- int x, int y, int w, int h)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SubsequentMono8x8PatternFillRect");
- DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", x, y, w, h));
-
- if (pScrn->bitsPerPixel == 24)
- {
- x *= 3;
- w *= 3;
- if (pSmi->Chipset == SMI_LYNX)
- {
- y *= 3;
- }
- }
-
- WaitQueue(3);
- WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF));
- WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
- WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
-
- LEAVE_PROC("SMI_SubsequentMono8x8PatternFillRect");
-}
-
-/******************************************************************************/
-/* 8x8 Color Pattern Fills */
-/******************************************************************************/
-
-static void
-SMI_SetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, int rop,
- unsigned int planemask, int trans_color)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SetupForColor8x8PatternFill");
- DEBUG((VERBLEV, "patx=%d paty=%d rop=%02X trans_color=%08X\n", patx, paty,
- rop, trans_color));
-
- pSmi->AccelCmd = XAAGetPatternROP(rop)
- | SMI_BITBLT
- | SMI_COLOR_PATTERN
- | SMI_START_ENGINE;
-
- if (pScrn->bitsPerPixel <= 16)
- {
- /* PDR#950 */
- CARD8* pattern = pSmi->FBBase
- + (patx + paty * pSmi->Stride) * pSmi->Bpp;
-
- WaitIdleEmpty();
- WRITE_DPR(pSmi, 0x0C, SMI_BITBLT | SMI_COLOR_PATTERN);
- memcpy(pSmi->DataPortBase, pattern, 8 * pSmi->Bpp * 8);
- }
- else
- {
- if (pScrn->bitsPerPixel == 24)
- {
- patx *= 3;
-
- if (pSmi->Chipset == SMI_LYNX)
- {
- paty *= 3;
- }
- }
-
- WaitQueue(1);
- WRITE_DPR(pSmi, 0x00, (patx << 16) | (paty & 0xFFFF));
- }
-
- if (trans_color == -1)
- {
- pSmi->AccelCmd |= SMI_TRANSPARENT_SRC | SMI_TRANSPARENT_PXL;
-
- WaitQueue(1);
- WRITE_DPR(pSmi, 0x20, trans_color);
- }
-
- if (pSmi->ClipTurnedOn)
- {
- WaitQueue(1);
- WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
- pSmi->ClipTurnedOn = FALSE;
- }
-
- LEAVE_PROC("SMI_SetupForColor8x8PatternFill");
-}
-
-static void
-SMI_SubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty,
- int x, int y, int w, int h)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SubsequentColor8x8PatternFillRect");
- DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", x, y, w, h));
-
- if (pScrn->bitsPerPixel == 24)
- {
- x *= 3;
- w *= 3;
-
- if (pSmi->Chipset == SMI_LYNX)
- {
- y *= 3;
- }
- }
-
- WaitQueue(3);
- WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF));
- WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF)); /* PDR#950 */
- WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
-
- LEAVE_PROC("SMI_SubsequentColor8x8PatternFillRect");
-}
-
-#if SMI_USE_IMAGE_WRITES
-/******************************************************************************/
-/* Image Writes */
-/******************************************************************************/
-
-static void
-SMI_SetupForImageWrite(ScrnInfoPtr pScrn, int rop, unsigned int planemask,
- int trans_color, int bpp, int depth)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SetupForImageWrite");
- DEBUG((VERBLEV, "rop=%02X trans_color=%08X bpp=%d depth=%d\n", rop,
- trans_color, bpp, depth));
-
- pSmi->AccelCmd = XAAGetCopyROP(rop)
- | SMI_HOSTBLT_WRITE
- | SMI_START_ENGINE;
-
- if (trans_color != -1)
- {
- pSmi->AccelCmd |= SMI_TRANSPARENT_SRC | SMI_TRANSPARENT_PXL;
-
- WaitQueue(1);
- WRITE_DPR(pSmi, 0x20, trans_color);
- }
-
- LEAVE_PROC("SMI_SetupForImageWrite");
-}
-
-static void
-SMI_SubsequentImageWriteRect(ScrnInfoPtr pScrn, int x, int y, int w, int h,
- int skipleft)
-{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_SubsequentImageWriteRect");
- DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d skipleft=%d\n", x, y, w, h, skipleft));
-
- if (pScrn->bitsPerPixel == 24)
- {
- x *= 3;
- w *= 3;
- skipleft *= 3;
-
- if (pSmi->Chipset == SMI_LYNX)
- {
- y *= 3;
- }
- }
-
- if (skipleft)
- {
- WaitQueue(5);
- WRITE_DPR(pSmi, 0x2C, (pSmi->ScissorsLeft & 0xFFFF0000) |
- (x + skipleft) | 0x2000);
- pSmi->ClipTurnedOn = TRUE;
- }
- else
- {
- if (pSmi->ClipTurnedOn)
- {
- WaitQueue(5);
- WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
- pSmi->ClipTurnedOn = FALSE;
- }
- else
- {
- WaitQueue(4);
- }
- }
- WRITE_DPR(pSmi, 0x00, 0);
- WRITE_DPR(pSmi, 0x04, (x << 16) | (y * 0xFFFF));
- WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
- WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
-
- LEAVE_PROC("SMI_SubsequentImageWriteRect");
-}
-#endif
-
-/******************************************************************************/
-/* Clipping */
-/******************************************************************************/
-
-static void
SMI_SetClippingRectangle(ScrnInfoPtr pScrn, int left, int top, int right,
- int bottom)
+ int bottom)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_SetClippingRectangle");
- DEBUG((VERBLEV, "left=%d top=%d right=%d bottom=%d\n", left, top, right,
- bottom));
+ ENTER_PROC("SMI_SetClippingRectangle");
+ DEBUG((VERBLEV, "left=%d top=%d right=%d bottom=%d\n", left, top, right,
+ bottom));
/* CZ 26.10.2001: this code prevents offscreen pixmaps being drawn ???
left = max(left, 0);
@@ -893,227 +151,52 @@ SMI_SetClippingRectangle(ScrnInfoPtr pScrn, int left, int top, int right,
bottom = min(bottom, pSmi->height);
*/
- if (pScrn->bitsPerPixel == 24)
- {
- left *= 3;
- right *= 3;
+ if (pScrn->bitsPerPixel == 24) {
+ left *= 3;
+ right *= 3;
- if (pSmi->Chipset == SMI_LYNX)
- {
- top *= 3;
- bottom *= 3;
- }
+ if (pSmi->Chipset == SMI_LYNX) {
+ top *= 3;
+ bottom *= 3;
}
+ }
- pSmi->ScissorsLeft = (top << 16) | (left & 0xFFFF) | 0x2000;
- pSmi->ScissorsRight = (bottom << 16) | (right & 0xFFFF);
+ pSmi->ScissorsLeft = (top << 16) | (left & 0xFFFF) | 0x2000;
+ pSmi->ScissorsRight = (bottom << 16) | (right & 0xFFFF);
- pSmi->ClipTurnedOn = FALSE;
+ pSmi->ClipTurnedOn = FALSE;
- WaitQueue(2);
- WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
- WRITE_DPR(pSmi, 0x30, pSmi->ScissorsRight);
+ WaitQueue(2);
+ WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
+ WRITE_DPR(pSmi, 0x30, pSmi->ScissorsRight);
- LEAVE_PROC("SMI_SetClippingRectangle");
+ LEAVE_PROC("SMI_SetClippingRectangle");
}
-static void
+void
SMI_DisableClipping(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_DisableClipping");
+ ENTER_PROC("SMI_DisableClipping");
- pSmi->ScissorsLeft = 0;
- if (pScrn->bitsPerPixel == 24)
- {
- if (pSmi->Chipset == SMI_LYNX)
- {
- pSmi->ScissorsRight = ((pSmi->height * 3) << 16)
- | (pSmi->width * 3);
- }
- else
- {
- pSmi->ScissorsRight = (pSmi->height << 16) | (pSmi->width * 3);
- }
+ pSmi->ScissorsLeft = 0;
+ if (pScrn->bitsPerPixel == 24) {
+ if (pSmi->Chipset == SMI_LYNX) {
+ pSmi->ScissorsRight = ((pSmi->height * 3) << 16) | (pSmi->width * 3);
+ } else {
+ pSmi->ScissorsRight = (pSmi->height << 16) | (pSmi->width * 3);
}
- else
- {
- pSmi->ScissorsRight = (pSmi->height << 16) | pSmi->width;
- }
-
- pSmi->ClipTurnedOn = FALSE;
-
- WaitQueue(2);
- WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
- WRITE_DPR(pSmi, 0x30, pSmi->ScissorsRight);
-
- LEAVE_PROC("SMI_DisableClipping");
-}
-
-/******************************************************************************/
-/* Polylines #671 */
-/******************************************************************************/
-
-/*
-
-In order to speed up the "logout" screen in rotated modes, we need to intercept
-the Polylines function. Normally, the polylines are drawn and the shadowFB is
-then sending a request of the bounding rectangle of those poylines. This should
-be okay, if it weren't for the fact that the Gnome logout screen is drawing
-polylines in rectangles and this asks for a rotation of the entire rectangle.
-This is very slow.
-
-To circumvent this slowness, we intercept the ValidatePolylines function and
-override the default "Fallback" Polylines with our own Polylines function. Our
-Polylines function first draws the polylines through the original Fallback
-function and then rotates the lines, line by line. We then set a flag and
-return control to the shadowFB which will try to rotate the bounding rectangle.
-However, the flag has been set and the RefreshArea function does nothing but
-clear the flag so the next Refresh that comes in shoiuld be handled correctly.
-
-All this code improves the speed quite a bit.
-
-*/
+ } else {
+ pSmi->ScissorsRight = (pSmi->height << 16) | pSmi->width;
+ }
-#define IS_VISIBLE(pWin) \
-( \
- pScrn->vtSema \
- && (((WindowPtr) pWin)->visibility != VisibilityFullyObscured) \
-)
+ pSmi->ClipTurnedOn = FALSE;
-#define TRIM_BOX(box, pGC) \
-{ \
- BoxPtr extents = &pGC->pCompositeClip->extents; \
- if (box.x1 < extents->x1) box.x1 = extents->x1; \
- if (box.y1 < extents->y1) box.y1 = extents->y1; \
- if (box.x2 > extents->x2) box.x2 = extents->x2; \
- if (box.y2 > extents->y2) box.y2 = extents->y2; \
-}
+ WaitQueue(2);
+ WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
+ WRITE_DPR(pSmi, 0x30, pSmi->ScissorsRight);
-#define TRANSLATE_BOX(box, pDraw) \
-{ \
- box.x1 += pDraw->x; \
- box.y1 += pDraw->y; \
- box.x2 += pDraw->x; \
- box.y2 += pDraw->y; \
+ LEAVE_PROC("SMI_DisableClipping");
}
-#define BOX_NOT_EMPTY(box) \
- ((box.x2 > box.x1) && (box.y2 > box.y1))
-
-static void
-SMI_ValidatePolylines(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- SMIPtr pSmi = SMIPTR(infoRec->pScrn);
-
- ENTER_PROC("SMI_ValidatePolylines");
-
- pSmi->ValidatePolylines(pGC, changes, pDraw);
- if (pGC->ops->Polylines == XAAGetFallbackOps()->Polylines)
- {
- /* Override the Polylines function with our own Polylines function. */
- pGC->ops->Polylines = SMI_Polylines;
- }
-
- LEAVE_PROC("SMI_ValidatePolylines");
-}
-
-static void
-SMI_Polylines(DrawablePtr pDraw, GCPtr pGC, int mode, int npt,
- DDXPointPtr pptInit)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- ScrnInfoPtr pScrn = infoRec->pScrn;
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_Polylines");
-
- /* Call the original Polylines function. */
- pGC->ops->Polylines = XAAGetFallbackOps()->Polylines;
- (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
- pGC->ops->Polylines = SMI_Polylines;
-
- if (IS_VISIBLE(pDraw) && npt)
- {
- /* Allocate a temporary buffer for all segments of the polyline. */
- BoxPtr pBox = xnfcalloc(sizeof(BoxRec), npt);
- int extra = pGC->lineWidth >> 1, box;
-
- if (npt > 1)
- {
- /* Adjust the extra space required per polyline segment. */
- if (pGC->joinStyle == JoinMiter)
- {
- extra = 6 * pGC->lineWidth;
- }
- else if (pGC->capStyle == CapProjecting)
- {
- extra = pGC->lineWidth;
- }
- }
-
- for (box = 0; --npt;)
- {
- /* Setup the bounding box for one polyline segment. */
- pBox[box].x1 = pptInit->x;
- pBox[box].y1 = pptInit->y;
- pptInit++;
- pBox[box].x2 = pptInit->x;
- pBox[box].y2 = pptInit->y;
- if (mode == CoordModePrevious)
- {
- pBox[box].x2 += pBox[box].x1;
- pBox[box].y2 += pBox[box].y1;
- }
-
- /* Sort coordinates. */
- if (pBox[box].x1 > pBox[box].x2)
- {
- int tmp = pBox[box].x1;
- pBox[box].x1 = pBox[box].x2;
- pBox[box].x2 = tmp;
- }
- if (pBox[box].y1 > pBox[box].y2)
- {
- int tmp = pBox[box].y1;
- pBox[box].y1 = pBox[box].y2;
- pBox[box].y2 = tmp;
- }
-
- /* Add extra space required for each polyline segment. */
- pBox[box].x1 -= extra;
- pBox[box].y1 -= extra;
- pBox[box].x2 += extra + 1;
- pBox[box].y2 += extra + 1;
-
- /* See if we need to draw this polyline segment. */
- TRANSLATE_BOX(pBox[box], pDraw);
- TRIM_BOX(pBox[box], pGC);
- if (BOX_NOT_EMPTY(pBox[box]))
- {
- box++;
- }
- }
-
- if (box)
- {
- /* Refresh all polyline segments now. */
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
- SMI_RefreshArea730(pScrn, box, pBox);
- }
- else
- {
- SMI_RefreshArea(pScrn, box, pBox);
- }
- }
-
- /* Free the temporary buffer. */
- xfree(pBox);
- }
-
- pSmi->polyLines = TRUE;
- LEAVE_PROC("SMI_Polylines");
-}
diff --git a/driver/xf86-video-siliconmotion/src/smi_dac.c b/driver/xf86-video-siliconmotion/src/smi_dac.c
index 7489ddd18..a5cfd7784 100644
--- a/driver/xf86-video-siliconmotion/src/smi_dac.c
+++ b/driver/xf86-video-siliconmotion/src/smi_dac.c
@@ -26,7 +26,6 @@ Silicon Motion 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 and Silicon Motion.
*/
-/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -41,63 +40,65 @@ SMI_CommonCalcClock(int scrnIndex, long freq, int min_m, int min_n1,
int max_n1, int min_n2, int max_n2, long freq_min,
long freq_max, unsigned char *mdiv, unsigned char *ndiv)
{
- double div, diff, best_diff;
- unsigned int m;
- unsigned char n1, n2;
- unsigned char best_n1 = 63, best_n2 = 3, best_m = 255;
-
- double ffreq = freq / 1000.0 / BASE_FREQ;
- double ffreq_min = freq_min / 1000.0 / BASE_FREQ;
- double ffreq_max = freq_max / 1000.0 / BASE_FREQ;
-
- if (ffreq < ffreq_min / (1 << max_n2))
- {
- xf86DrvMsg(scrnIndex,X_WARNING,"invalid frequency %1.3f MHz [freq >= %1.3f MHz]\n",
- ffreq * BASE_FREQ, ffreq_min * BASE_FREQ / (1 << max_n2));
- ffreq = ffreq_min / (1 << max_n2);
- }
- if (ffreq > ffreq_max / (1 << min_n2))
- {
- xf86DrvMsg(scrnIndex,X_WARNING,"invalid frequency %1.3f MHz [freq <= %1.3f MHz]\n",
- ffreq * BASE_FREQ, ffreq_max * BASE_FREQ / (1 << min_n2));
- ffreq = ffreq_max / (1 << min_n2);
- }
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ double div, diff, best_diff;
+ unsigned int m;
+ unsigned char n1, n2;
+ unsigned char best_n1 = 63, best_n2 = 3, best_m = 255;
+
+ double ffreq = freq / 1000.0 / BASE_FREQ;
+ double ffreq_min = freq_min / 1000.0 / BASE_FREQ;
+ double ffreq_max = freq_max / 1000.0 / BASE_FREQ;
+
+ if (ffreq < ffreq_min / (1 << max_n2)) {
+ xf86DrvMsg(scrnIndex,X_WARNING,"invalid frequency %1.3f MHz [freq >= %1.3f MHz]\n",
+ ffreq * BASE_FREQ, ffreq_min * BASE_FREQ / (1 << max_n2));
+ ffreq = ffreq_min / (1 << max_n2);
+ }
+ if (ffreq > ffreq_max / (1 << min_n2)) {
+ xf86DrvMsg(scrnIndex,X_WARNING,"invalid frequency %1.3f MHz [freq <= %1.3f MHz]\n",
+ ffreq * BASE_FREQ, ffreq_max * BASE_FREQ / (1 << min_n2));
+ ffreq = ffreq_max / (1 << min_n2);
+ }
- /* work out suitable timings */
- best_diff = ffreq;
-
- for (n2 = min_n2; n2 <= max_n2; n2++)
- {
- for (n1 = min_n1; n1 <= max_n1; n1++)
- {
- m = (int)(ffreq * n1 * (1 << n2) + 0.5);
- if ( (m < min_m) || (m > 255) )
- {
- continue;
- }
- div = (double)(m) / (double)(n1);
- if ( (div >= ffreq_min) && (div <= ffreq_max) )
- {
- diff = ffreq - div / (1 << n2);
- if (diff < 0.0)
- {
- diff = -diff;
- }
- if (diff < best_diff)
- {
- best_diff = diff;
- best_m = m;
- best_n1 = n1;
- best_n2 = n2;
- }
- }
+ /* work out suitable timings */
+ best_diff = ffreq;
+
+ for (n2 = min_n2; n2 <= max_n2; n2++) {
+ for (n1 = min_n1; n1 <= max_n1; n1++) {
+ m = (int)(ffreq * n1 * (1 << n2) + 0.5);
+ if ( (m < min_m) || (m > 255) ) {
+ continue;
+ }
+ div = (double)(m) / (double)(n1);
+ if ( (div >= ffreq_min) && (div <= ffreq_max) ) {
+ diff = ffreq - div / (1 << n2);
+ if (diff < 0.0) {
+ diff = -diff;
+ }
+ if (diff < best_diff) {
+ best_diff = diff;
+ best_m = m;
+ best_n1 = n1;
+ best_n2 = n2;
}
+ }
}
+ }
- DEBUG((VERBLEV, "Clock parameters for %1.6f MHz: m=%d, n1=%d, n2=%d\n",
- ((double)(best_m) / (double)(best_n1) / (1 << best_n2)) * BASE_FREQ,
- best_m, best_n1, best_n2));
+ DEBUG((VERBLEV, "Clock parameters for %1.6f MHz: m=%d, n1=%d, n2=%d\n",
+ ((double)(best_m) / (double)(best_n1) / (1 << best_n2)) * BASE_FREQ,
+ best_m, best_n1, best_n2));
+ if (SMI_LYNX_SERIES(pSmi->Chipset)) {
*ndiv = best_n1 | (best_n2 << 6);
- *mdiv = best_m;
+ } else {
+ *ndiv = best_n1 | (best_n2 << 7);
+ if (freq > 120000)
+ *ndiv |= 1 << 6;
+ }
+
+ *mdiv = best_m;
}
+
diff --git a/driver/xf86-video-siliconmotion/src/smi_dga.c b/driver/xf86-video-siliconmotion/src/smi_dga.c
index 3fd086438..a51b0b1e2 100644
--- a/driver/xf86-video-siliconmotion/src/smi_dga.c
+++ b/driver/xf86-video-siliconmotion/src/smi_dga.c
@@ -26,7 +26,6 @@ Silicon Motion 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 and Silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dga.c,v 1.1 2000/11/28 20:59:19 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -55,145 +54,132 @@ static void SMI_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int,
static
DGAFunctionRec SMI_DGAFuncs =
{
- SMI_OpenFramebuffer,
- NULL,
- SMI_SetMode,
- SMI_SetViewport,
- SMI_GetViewport,
- SMI_AccelSync,
- SMI_FillRect,
- SMI_BlitRect,
- SMI_BlitTransRect
+ SMI_OpenFramebuffer,
+ NULL,
+ SMI_SetMode,
+ SMI_SetViewport,
+ SMI_GetViewport,
+ SMI_AccelSync,
+ SMI_FillRect,
+ SMI_BlitRect,
+ SMI_BlitTransRect
};
Bool
SMI_DGAInit(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- SMIPtr pSmi = SMIPTR(pScrn);
- DGAModePtr modes = NULL, newmodes = NULL, currentMode;
- DisplayModePtr pMode, firstMode;
- int Bpp = pScrn->bitsPerPixel >> 3;
- int num = 0;
- Bool ret;
-
- ENTER_PROC("SMI_DGAInit");
-
- pMode = firstMode = pScrn->modes;
-
- while (pMode)
- {
- newmodes = xrealloc(modes, (num + 1) * sizeof(DGAModeRec));
- if (newmodes == NULL)
- {
- xfree(modes);
- LEAVE_PROC("SMI_DGAInit");
- return(FALSE);
- }
-
- modes = newmodes;
-
- currentMode = modes + num;
- num++;
-
- currentMode->mode = pMode;
- currentMode->flags = DGA_PIXMAP_AVAILABLE;
- if (!pSmi->NoAccel)
- {
- currentMode->flags |= DGA_FILL_RECT
- | DGA_BLIT_RECT
- | DGA_BLIT_RECT_TRANS;
- }
- if (pMode->Flags & V_DBLSCAN)
- {
- currentMode->flags |= DGA_DOUBLESCAN;
- }
- if (pMode->Flags & V_INTERLACE)
- {
- currentMode->flags |= DGA_INTERLACED;
- }
-
- currentMode->byteOrder = pScrn->imageByteOrder;
- currentMode->depth = pScrn->depth;
- currentMode->bitsPerPixel = pScrn->bitsPerPixel;
- currentMode->red_mask = pScrn->mask.red;
- currentMode->green_mask = pScrn->mask.green;
- currentMode->blue_mask = pScrn->mask.blue;
- currentMode->visualClass = (Bpp == 1) ? PseudoColor : TrueColor;
- currentMode->viewportWidth = pMode->HDisplay;
- currentMode->viewportHeight = pMode->VDisplay;
- currentMode->xViewportStep = (Bpp == 3) ? 8 : (8 / Bpp);
- currentMode->yViewportStep = 1;
- currentMode->viewportFlags = DGA_FLIP_RETRACE;
- currentMode->offset = 0;
- currentMode->address = pSmi->FBBase;
-
- xf86ErrorFVerb(VERBLEV, "\tSMI_DGAInit %dx%d @ %d bpp\n",
- currentMode->viewportWidth, currentMode->viewportHeight,
- currentMode->bitsPerPixel);
-
- currentMode->bytesPerScanline = ((pScrn->displayWidth * Bpp) + 15)
- & ~15L;
- currentMode->imageWidth = pScrn->displayWidth;
- currentMode->imageHeight = pSmi->FBReserved
- / currentMode->bytesPerScanline;
- currentMode->pixmapWidth = currentMode->imageWidth;
- currentMode->pixmapHeight = currentMode->imageHeight;
- currentMode->maxViewportX = currentMode->imageWidth
- - currentMode->viewportWidth;
- currentMode->maxViewportY = currentMode->imageHeight
- - currentMode->viewportHeight;
-
- pMode = pMode->next;
- if (pMode == firstMode)
- {
- break;
- }
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ DGAModePtr modes = NULL, newmodes = NULL, currentMode;
+ DisplayModePtr pMode, firstMode;
+ int Bpp = pScrn->bitsPerPixel >> 3;
+ int num = 0;
+ Bool ret;
+
+ ENTER_PROC("SMI_DGAInit");
+
+ pMode = firstMode = pScrn->modes;
+
+ while (pMode) {
+ newmodes = xrealloc(modes, (num + 1) * sizeof(DGAModeRec));
+ if (newmodes == NULL) {
+ xfree(modes);
+ LEAVE_PROC("SMI_DGAInit");
+ return FALSE;
}
- pSmi->numDGAModes = num;
- pSmi->DGAModes = modes;
+ modes = newmodes;
+
+ currentMode = modes + num;
+ num++;
+
+ currentMode->mode = pMode;
+ currentMode->flags = DGA_PIXMAP_AVAILABLE;
+ if (!pSmi->NoAccel) {
+ currentMode->flags |= DGA_FILL_RECT
+ | DGA_BLIT_RECT
+ | DGA_BLIT_RECT_TRANS;
+ }
+ if (pMode->Flags & V_DBLSCAN) {
+ currentMode->flags |= DGA_DOUBLESCAN;
+ }
+ if (pMode->Flags & V_INTERLACE) {
+ currentMode->flags |= DGA_INTERLACED;
+ }
- ret = DGAInit(pScreen, &SMI_DGAFuncs, modes, num);
- LEAVE_PROC("SMI_DGAInit");
- return(ret);
+ currentMode->byteOrder = pScrn->imageByteOrder;
+ currentMode->depth = pScrn->depth;
+ currentMode->bitsPerPixel = pScrn->bitsPerPixel;
+ currentMode->red_mask = pScrn->mask.red;
+ currentMode->green_mask = pScrn->mask.green;
+ currentMode->blue_mask = pScrn->mask.blue;
+ currentMode->visualClass = (Bpp == 1) ? PseudoColor : TrueColor;
+ currentMode->viewportWidth = pMode->HDisplay;
+ currentMode->viewportHeight = pMode->VDisplay;
+ currentMode->xViewportStep = (Bpp == 3) ? 8 : (8 / Bpp);
+ currentMode->yViewportStep = 1;
+ currentMode->viewportFlags = DGA_FLIP_RETRACE;
+ currentMode->offset = 0;
+ currentMode->address = pSmi->FBBase;
+
+ xf86ErrorFVerb(VERBLEV, "\tSMI_DGAInit %dx%d @ %d bpp\n",
+ currentMode->viewportWidth, currentMode->viewportHeight,
+ currentMode->bitsPerPixel);
+
+ currentMode->bytesPerScanline = ((pScrn->displayWidth * Bpp) + 15) & ~15L;
+ currentMode->imageWidth = pScrn->displayWidth;
+ currentMode->imageHeight = pSmi->FBReserved / currentMode->bytesPerScanline;
+ currentMode->pixmapWidth = currentMode->imageWidth;
+ currentMode->pixmapHeight = currentMode->imageHeight;
+ currentMode->maxViewportX = currentMode->imageWidth - currentMode->viewportWidth;
+ currentMode->maxViewportY = currentMode->imageHeight - currentMode->viewportHeight;
+
+ pMode = pMode->next;
+ if (pMode == firstMode) {
+ break;
+ }
+ }
+
+ pSmi->numDGAModes = num;
+ pSmi->DGAModes = modes;
+
+ ret = DGAInit(pScreen, &SMI_DGAFuncs, modes, num);
+ LEAVE_PROC("SMI_DGAInit");
+ return ret;
}
static Bool
SMI_SetMode(ScrnInfoPtr pScrn, DGAModePtr pMode)
{
- static int OldDisplayWidth[MAXSCREENS];
- int index = pScrn->pScreen->myNum;
- SMIPtr pSmi = SMIPTR(pScrn);
+ static int OldDisplayWidth[MAXSCREENS];
+ int index = pScrn->pScreen->myNum;
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_SetMode");
+ ENTER_PROC("SMI_SetMode");
- if (pMode == NULL)
- { /* restore the original mode */
+ if (pMode == NULL) {
+ /* restore the original mode */
- /* put the ScreenParameters back */
- pScrn->displayWidth = OldDisplayWidth[index];
+ /* put the ScreenParameters back */
+ pScrn->displayWidth = OldDisplayWidth[index];
- SMI_SwitchMode(index, pScrn->currentMode, 0);
- pSmi->DGAactive = FALSE;
- }
- else
- {
- if (!pSmi->DGAactive)
- { /* save the old parameters */
- OldDisplayWidth[index] = pScrn->displayWidth;
+ SMI_SwitchMode(index, pScrn->currentMode, 0);
+ pSmi->DGAactive = FALSE;
+ } else {
+ if (!pSmi->DGAactive) {
+ /* save the old parameters */
+ OldDisplayWidth[index] = pScrn->displayWidth;
- pSmi->DGAactive = TRUE;
- }
+ pSmi->DGAactive = TRUE;
+ }
- pScrn->displayWidth = pMode->bytesPerScanline
- / (pMode->bitsPerPixel >> 3);
+ pScrn->displayWidth = pMode->bytesPerScanline / (pMode->bitsPerPixel >> 3);
- SMI_SwitchMode(index, pMode->mode, 0);
- }
+ SMI_SwitchMode(index, pMode->mode, 0);
+ }
- LEAVE_PROC("SMI_SetMode");
- return(TRUE);
+ LEAVE_PROC("SMI_SetMode");
+ return TRUE;
}
@@ -202,103 +188,97 @@ SMI_GetViewport(ScrnInfoPtr pScrn)
{
SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_GetViewport");
+ ENTER_PROC("SMI_GetViewport");
- LEAVE_PROC("SMI_GetViewport");
+ LEAVE_PROC("SMI_GetViewport");
- return(pSmi->DGAViewportStatus);
+ return pSmi->DGAViewportStatus;
}
static void
SMI_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_SetViewport");
+ ENTER_PROC("SMI_SetViewport");
- SMI_AdjustFrame(pScrn->pScreen->myNum, x, y, flags);
- pSmi->DGAViewportStatus = 0;
+ SMI_AdjustFrame(pScrn->pScreen->myNum, x, y, flags);
+ pSmi->DGAViewportStatus = 0;
- LEAVE_PROC("SMI_SetViewport");
+ LEAVE_PROC("SMI_SetViewport");
}
static void
SMI_FillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned long color)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_FillRect");
+ ENTER_PROC("SMI_FillRect");
- if (pSmi->AccelInfoRec)
- {
- (*pSmi->AccelInfoRec->SetupForSolidFill)(pScrn, color, GXcopy, ~0);
- (*pSmi->AccelInfoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
- SET_SYNC_FLAG(pSmi->AccelInfoRec);
- }
+ if (pSmi->XAAInfoRec) {
+ (*pSmi->XAAInfoRec->SetupForSolidFill)(pScrn, color, GXcopy, ~0);
+ (*pSmi->XAAInfoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
+ SET_SYNC_FLAG(pSmi->XAAInfoRec);
+ }
- LEAVE_PROC("SMI_FillRect");
+ LEAVE_PROC("SMI_FillRect");
}
static void
SMI_BlitRect(ScrnInfoPtr pScrn, int srcx, int srcy, int w, int h, int dstx,
- int dsty)
+ int dsty)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_BlitRect");
+ ENTER_PROC("SMI_BlitRect");
- if (pSmi->AccelInfoRec)
- {
- int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1;
- int ydir = (srcy < dsty) ? -1 : 1;
+ if (pSmi->XAAInfoRec) {
+ int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1;
+ int ydir = (srcy < dsty) ? -1 : 1;
- (*pSmi->AccelInfoRec->SetupForScreenToScreenCopy)(pScrn, xdir, ydir,
- GXcopy, ~0, -1);
- (*pSmi->AccelInfoRec->SubsequentScreenToScreenCopy)(pScrn, srcx, srcy,
- dstx, dsty, w, h);
- SET_SYNC_FLAG(pSmi->AccelInfoRec);
- }
+ (*pSmi->XAAInfoRec->SetupForScreenToScreenCopy)(pScrn, xdir, ydir, GXcopy, ~0, -1);
+ (*pSmi->XAAInfoRec->SubsequentScreenToScreenCopy)(pScrn, srcx, srcy, dstx, dsty, w, h);
+ SET_SYNC_FLAG(pSmi->XAAInfoRec);
+ }
- LEAVE_PROC("SMI_BlitRect");
+ LEAVE_PROC("SMI_BlitRect");
}
static void
SMI_BlitTransRect(ScrnInfoPtr pScrn, int srcx, int srcy, int w, int h, int dstx,
- int dsty, unsigned long color)
+ int dsty, unsigned long color)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_BlitTraneRect");
+ ENTER_PROC("SMI_BlitTraneRect");
- if (pSmi->AccelInfoRec)
- {
- int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1;
- int ydir = (srcy < dsty) ? -1 : 1;
+ if (pSmi->XAAInfoRec) {
+ int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1;
+ int ydir = (srcy < dsty) ? -1 : 1;
- (*pSmi->AccelInfoRec->SetupForScreenToScreenCopy)(pScrn, xdir, ydir,
- GXcopy, ~0, color);
- (*pSmi->AccelInfoRec->SubsequentScreenToScreenCopy)(pScrn, srcx, srcy,
- dstx, dsty, w, h);
- SET_SYNC_FLAG(pSmi->AccelInfoRec);
- }
+ (*pSmi->XAAInfoRec->SetupForScreenToScreenCopy)(pScrn, xdir, ydir, GXcopy, ~0, color);
+ (*pSmi->XAAInfoRec->SubsequentScreenToScreenCopy)(pScrn, srcx, srcy, dstx, dsty, w, h);
+ SET_SYNC_FLAG(pSmi->XAAInfoRec);
+ }
- LEAVE_PROC("SMI_BlitTraneRect");
+ LEAVE_PROC("SMI_BlitTraneRect");
}
static Bool
SMI_OpenFramebuffer(ScrnInfoPtr pScrn, char **name, unsigned char **mem,
- int *size, int *offset, int *flags)
+ int *size, int *offset, int *flags)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_OpenFrameBuffer");
+ ENTER_PROC("SMI_OpenFrameBuffer");
- *name = NULL; /* no special device */
- *mem = (unsigned char*)pSmi->FBBase;
- *size = pSmi->videoRAMBytes;
- *offset = 0;
- *flags = DGA_NEED_ROOT;
+ *name = NULL; /* no special device */
+ *mem = (unsigned char*)pSmi->FBBase;
+ *size = pSmi->videoRAMBytes;
+ *offset = 0;
+ *flags = DGA_NEED_ROOT;
- LEAVE_PROC("SMI_OpenFrameBuffer");
- return(TRUE);
+ LEAVE_PROC("SMI_OpenFrameBuffer");
+ return TRUE;
}
+
diff --git a/driver/xf86-video-siliconmotion/src/smi_driver.c b/driver/xf86-video-siliconmotion/src/smi_driver.c
index 1e086f6f2..ec2af1a3b 100644
--- a/driver/xf86-video-siliconmotion/src/smi_driver.c
+++ b/driver/xf86-video-siliconmotion/src/smi_driver.c
@@ -26,7 +26,6 @@ Silicon Motion 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 or Silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v 1.36tsi Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -89,10 +88,10 @@ static void SMI_DetectPanelSize(ScrnInfoPtr pScrn);
#define SILICONMOTION_NAME "Silicon Motion"
#define SILICONMOTION_DRIVER_NAME "siliconmotion"
-#define SILICONMOTION_VERSION_NAME "1.4.1"
-#define SILICONMOTION_VERSION_MAJOR 1
-#define SILICONMOTION_VERSION_MINOR 4
-#define SILICONMOTION_PATCHLEVEL 1
+#define SILICONMOTION_VERSION_NAME PACKAGE_VERSION
+#define SILICONMOTION_VERSION_MAJOR PACKAGE_VERSION_MAJOR
+#define SILICONMOTION_VERSION_MINOR PACKAGE_VERSION_MINOR
+#define SILICONMOTION_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL
#define SILICONMOTION_DRIVER_VERSION ((SILICONMOTION_VERSION_MAJOR << 24) | \
(SILICONMOTION_VERSION_MINOR << 16) | \
(SILICONMOTION_PATCHLEVEL))
@@ -107,90 +106,91 @@ static void SMI_DetectPanelSize(ScrnInfoPtr pScrn);
_X_EXPORT DriverRec SILICONMOTION =
{
- SILICONMOTION_DRIVER_VERSION,
- SILICONMOTION_DRIVER_NAME,
- SMI_Identify,
- SMI_Probe,
- SMI_AvailableOptions,
- NULL,
- 0
+ SILICONMOTION_DRIVER_VERSION,
+ SILICONMOTION_DRIVER_NAME,
+ SMI_Identify,
+ SMI_Probe,
+ SMI_AvailableOptions,
+ NULL,
+ 0
};
/* Supported chipsets */
static SymTabRec SMIChipsets[] =
{
- { PCI_CHIP_SMI910, "Lynx" },
- { PCI_CHIP_SMI810, "LynxE" },
- { PCI_CHIP_SMI820, "Lynx3D" },
- { PCI_CHIP_SMI710, "LynxEM" },
- { PCI_CHIP_SMI712, "LynxEM+" },
- { PCI_CHIP_SMI720, "Lynx3DM" },
- { PCI_CHIP_SMI731, "Cougar3DR" },
- { -1, NULL }
+ { PCI_CHIP_SMI910, "Lynx" },
+ { PCI_CHIP_SMI810, "LynxE" },
+ { PCI_CHIP_SMI820, "Lynx3D" },
+ { PCI_CHIP_SMI710, "LynxEM" },
+ { PCI_CHIP_SMI712, "LynxEM+" },
+ { PCI_CHIP_SMI720, "Lynx3DM" },
+ { PCI_CHIP_SMI731, "Cougar3DR" },
+ { -1, NULL }
};
static PciChipsets SMIPciChipsets[] =
{
- /* numChipset, PciID, Resource */
- { PCI_CHIP_SMI910, PCI_CHIP_SMI910, RES_SHARED_VGA },
- { PCI_CHIP_SMI810, PCI_CHIP_SMI810, RES_SHARED_VGA },
- { PCI_CHIP_SMI820, PCI_CHIP_SMI820, RES_SHARED_VGA },
- { PCI_CHIP_SMI710, PCI_CHIP_SMI710, RES_SHARED_VGA },
- { PCI_CHIP_SMI712, PCI_CHIP_SMI712, RES_SHARED_VGA },
- { PCI_CHIP_SMI720, PCI_CHIP_SMI720, RES_SHARED_VGA },
- { PCI_CHIP_SMI731, PCI_CHIP_SMI731, RES_SHARED_VGA },
- { -1, -1, RES_UNDEFINED }
+ /* numChipset, PciID, Resource */
+ { PCI_CHIP_SMI910, PCI_CHIP_SMI910, RES_SHARED_VGA },
+ { PCI_CHIP_SMI810, PCI_CHIP_SMI810, RES_SHARED_VGA },
+ { PCI_CHIP_SMI820, PCI_CHIP_SMI820, RES_SHARED_VGA },
+ { PCI_CHIP_SMI710, PCI_CHIP_SMI710, RES_SHARED_VGA },
+ { PCI_CHIP_SMI712, PCI_CHIP_SMI712, RES_SHARED_VGA },
+ { PCI_CHIP_SMI720, PCI_CHIP_SMI720, RES_SHARED_VGA },
+ { PCI_CHIP_SMI731, PCI_CHIP_SMI731, RES_SHARED_VGA },
+ { -1, -1, RES_UNDEFINED }
};
typedef enum
{
- OPTION_PCI_BURST,
- OPTION_FIFO_CONSERV,
- OPTION_FIFO_MODERATE,
- OPTION_FIFO_AGGRESSIVE,
- OPTION_PCI_RETRY,
- OPTION_NOACCEL,
- OPTION_MCLK,
- OPTION_SHOWCACHE,
- OPTION_SWCURSOR,
- OPTION_HWCURSOR,
- OPTION_SHADOW_FB,
- OPTION_ROTATE,
- OPTION_VIDEOKEY,
- OPTION_BYTESWAP,
- /* CZ 26.10.2001: interlaced video */
- OPTION_INTERLACED,
- /* end CZ */
- OPTION_USEBIOS,
- OPTION_ZOOMONLCD,
- OPTION_DUALHEAD,
- NUMBER_OF_OPTIONS
-
+ OPTION_PCI_BURST,
+ OPTION_FIFO_CONSERV,
+ OPTION_FIFO_MODERATE,
+ OPTION_FIFO_AGGRESSIVE,
+ OPTION_PCI_RETRY,
+ OPTION_NOACCEL,
+ OPTION_MCLK,
+ OPTION_SHOWCACHE,
+ OPTION_SWCURSOR,
+ OPTION_HWCURSOR,
+ OPTION_SHADOW_FB,
+ OPTION_ROTATE,
+ OPTION_VIDEOKEY,
+ OPTION_BYTESWAP,
+ /* CZ 26.10.2001: interlaced video */
+ OPTION_INTERLACED,
+ /* end CZ */
+ OPTION_USEBIOS,
+ OPTION_ZOOMONLCD,
+ OPTION_DUALHEAD,
+ OPTION_ACCELMETHOD,
+ NUMBER_OF_OPTIONS
} SMIOpts;
static const OptionInfoRec SMIOptions[] =
{
- { OPTION_PCI_BURST, "pci_burst", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_FIFO_CONSERV, "fifo_conservative", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_FIFO_MODERATE, "fifo_moderate", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_FIFO_AGGRESSIVE, "fifo_aggressive", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_PCI_RETRY, "pci_retry", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_MCLK, "set_mclk", OPTV_FREQ, {0}, FALSE },
- { OPTION_SHOWCACHE, "show_cache", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_HWCURSOR, "HWCursor", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_SWCURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE },
- { OPTION_VIDEOKEY, "VideoKey", OPTV_INTEGER, {0}, FALSE },
- { OPTION_BYTESWAP, "ByteSwap", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_PCI_BURST, "pci_burst", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_FIFO_CONSERV, "fifo_conservative", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_FIFO_MODERATE, "fifo_moderate", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_FIFO_AGGRESSIVE, "fifo_aggressive", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_PCI_RETRY, "pci_retry", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_MCLK, "set_mclk", OPTV_FREQ, {0}, FALSE },
+ { OPTION_SHOWCACHE, "show_cache", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_HWCURSOR, "HWCursor", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_SWCURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE },
+ { OPTION_VIDEOKEY, "VideoKey", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_BYTESWAP, "ByteSwap", OPTV_BOOLEAN, {0}, FALSE },
/* CZ 26.10.2001: interlaced video */
- { OPTION_INTERLACED, "Interlaced", OPTV_BOOLEAN, {0}, FALSE },
- /* end CZ */
- { OPTION_USEBIOS, "UseBIOS", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_ZOOMONLCD, "ZoomOnLCD", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_DUALHEAD, "Dualhead", OPTV_BOOLEAN, {0}, FALSE },
- { -1, NULL, OPTV_NONE, {0}, FALSE }
+ { OPTION_INTERLACED, "Interlaced", OPTV_BOOLEAN, {0}, FALSE },
+ /* end CZ */
+ { OPTION_USEBIOS, "UseBIOS", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_ZOOMONLCD, "ZoomOnLCD", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_DUALHEAD, "Dualhead", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_ACCELMETHOD, "AccelMethod", OPTV_STRING, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
};
/*
@@ -204,92 +204,105 @@ static const OptionInfoRec SMIOptions[] =
static const char *vgahwSymbols[] =
{
- "vgaHWCopyReg",
- "vgaHWGetHWRec",
- "vgaHWGetIOBase",
- "vgaHWGetIndex",
- "vgaHWInit",
- "vgaHWLock",
- "vgaHWMapMem",
- "vgaHWProtect",
- "vgaHWRestore",
- "vgaHWSave",
- "vgaHWSaveScreen",
- "vgaHWSetMmioFuncs",
- "vgaHWSetStdFuncs",
- "vgaHWUnmapMem",
- "vgaHWddc1SetSpeedWeak",
- NULL
+ "vgaHWCopyReg",
+ "vgaHWGetHWRec",
+ "vgaHWGetIOBase",
+ "vgaHWGetIndex",
+ "vgaHWInit",
+ "vgaHWLock",
+ "vgaHWMapMem",
+ "vgaHWProtect",
+ "vgaHWRestore",
+ "vgaHWSave",
+ "vgaHWSaveScreen",
+ "vgaHWSetMmioFuncs",
+ "vgaHWSetStdFuncs",
+ "vgaHWUnmapMem",
+ "vgaHWddc1SetSpeedWeak",
+ NULL
};
static const char *xaaSymbols[] =
{
- "XAAGetCopyROP",
- "XAACreateInfoRec",
- "XAADestroyInfoRec",
- "XAAGetFallbackOps",
- "XAAInit",
- "XAAGetPatternROP",
- NULL
+ "XAAGetCopyROP",
+ "XAACreateInfoRec",
+ "XAADestroyInfoRec",
+ "XAAGetFallbackOps",
+ "XAAInit",
+ "XAAGetPatternROP",
+ NULL
+};
+
+static const char *exaSymbols[] =
+{
+ "exaDriverAlloc",
+ "exaDriverInit",
+ "exaDriverFini",
+ "exaOffscreenAlloc",
+ "exaOffscreenFree",
+ "exaGetPixmapPitch",
+ "exaGetPixmapOffset",
+ "exaGetPixmapSize",
+ NULL
};
static const char *ramdacSymbols[] =
{
- "xf86CreateCursorInfoRec",
- "xf86DestroyCursorInfoRec",
- "xf86InitCursor",
- NULL
+ "xf86CreateCursorInfoRec",
+ "xf86DestroyCursorInfoRec",
+ "xf86InitCursor",
+ NULL
};
static const char *ddcSymbols[] =
{
- "xf86PrintEDID",
- "xf86DoEDID_DDC1",
- "xf86DoEDID_DDC2",
- "xf86SetDDCproperties",
- NULL
+ "xf86PrintEDID",
+ "xf86DoEDID_DDC1",
+ "xf86DoEDID_DDC2",
+ "xf86SetDDCproperties",
+ NULL
};
static const char *i2cSymbols[] =
{
- "xf86CreateI2CBusRec",
- "xf86CreateI2CDevRec",
- "xf86DestroyI2CBusRec",
- "xf86DestroyI2CDevRec",
- "xf86I2CBusInit",
- "xf86I2CDevInit",
- "xf86I2CReadBytes",
- "xf86I2CWriteByte",
- NULL
+ "xf86CreateI2CBusRec",
+ "xf86CreateI2CDevRec",
+ "xf86DestroyI2CBusRec",
+ "xf86DestroyI2CDevRec",
+ "xf86I2CBusInit",
+ "xf86I2CDevInit",
+ "xf86I2CReadBytes",
+ "xf86I2CWriteByte",
+ NULL
};
static const char *shadowSymbols[] =
{
- "ShadowFBInit",
- NULL
+ "ShadowFBInit",
+ NULL
};
static const char *int10Symbols[] =
{
- "xf86ExecX86int10",
- "xf86FreeInt10",
- "xf86InitInt10",
- NULL
+ "xf86ExecX86int10",
+ "xf86FreeInt10",
+ "xf86InitInt10",
+ NULL
};
static const char *vbeSymbols[] =
{
- "VBEInit",
- "vbeDoEDID",
- "vbeFree",
- NULL
+ "VBEInit",
+ "vbeDoEDID",
+ "vbeFree",
+ NULL
};
static const char *fbSymbols[] =
{
- "fbPictureInit",
- "fbScreenInit",
- NULL
+ "fbPictureInit",
+ "fbScreenInit",
+ NULL
};
#ifdef XFree86LOADER
@@ -298,18 +311,18 @@ static MODULESETUPPROTO(siliconmotionSetup);
static XF86ModuleVersionInfo SMIVersRec =
{
- "siliconmotion",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- SILICONMOTION_VERSION_MAJOR,
- SILICONMOTION_VERSION_MINOR,
- SILICONMOTION_PATCHLEVEL,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_VIDEODRV,
- {0, 0, 0, 0}
+ "siliconmotion",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ SILICONMOTION_VERSION_MAJOR,
+ SILICONMOTION_VERSION_MINOR,
+ SILICONMOTION_PATCHLEVEL,
+ ABI_CLASS_VIDEODRV,
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_VIDEODRV,
+ {0, 0, 0, 0}
};
/*
@@ -319,48 +332,45 @@ static XF86ModuleVersionInfo SMIVersRec =
*/
_X_EXPORT XF86ModuleData siliconmotionModuleData =
{
- &SMIVersRec,
- siliconmotionSetup,
- NULL
+ &SMIVersRec,
+ siliconmotionSetup,
+ NULL
};
static pointer
siliconmotionSetup(pointer module, pointer opts, int *errmaj, int *errmin)
{
- static Bool setupDone = FALSE;
+ static Bool setupDone = FALSE;
- if (!setupDone)
- {
- setupDone = TRUE;
- xf86AddDriver(&SILICONMOTION, module, 0);
-
- /*
- * Modules that this driver always requires can be loaded here
- * by calling LoadSubModule().
- */
-
- /*
- * Tell the loader about symbols from other modules that this module
- * might refer to.
- */
- LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, ramdacSymbols,
- ddcSymbols, i2cSymbols, int10Symbols, vbeSymbols,
- shadowSymbols, NULL);
-
- /*
- * The return value must be non-NULL on success even though there
- * is no TearDownProc.
- */
- return (pointer) 1;
- }
- else
- {
- if (errmaj)
- {
- *errmaj = LDR_ONCEONLY;
- }
- return(NULL);
+ if (!setupDone) {
+ setupDone = TRUE;
+ xf86AddDriver(&SILICONMOTION, module, 0);
+
+ /*
+ * Modules that this driver always requires can be loaded here
+ * by calling LoadSubModule().
+ */
+
+ /*
+ * Tell the loader about symbols from other modules that this module
+ * might refer to.
+ */
+ LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, exaSymbols, ramdacSymbols,
+ ddcSymbols, i2cSymbols, int10Symbols, vbeSymbols,
+ shadowSymbols, NULL);
+
+ /*
+ * The return value must be non-NULL on success even though there
+ * is no TearDownProc.
+ */
+ return (pointer) 1;
+
+ } else {
+ if (errmaj) {
+ *errmaj = LDR_ONCEONLY;
}
+ return NULL;
+ }
}
#endif /* XFree86LOADER */
@@ -368,871 +378,797 @@ siliconmotionSetup(pointer module, pointer opts, int *errmaj, int *errmin)
static Bool
SMI_GetRec(ScrnInfoPtr pScrn)
{
- ENTER_PROC("SMI_GetRec");
-
- /*
- * Allocate an 'Chip'Rec, and hook it into pScrn->driverPrivate.
- * pScrn->driverPrivate is initialised to NULL, so we can check if
- * the allocation has already been done.
- */
- if (pScrn->driverPrivate == NULL)
- {
- pScrn->driverPrivate = xnfcalloc(sizeof(SMIRec), 1);
- }
-
- LEAVE_PROC("SMI_GetRec");
- return(TRUE);
+ ENTER_PROC("SMI_GetRec");
+
+ /*
+ * Allocate an 'Chip'Rec, and hook it into pScrn->driverPrivate.
+ * pScrn->driverPrivate is initialised to NULL, so we can check if
+ * the allocation has already been done.
+ */
+ if (pScrn->driverPrivate == NULL) {
+ pScrn->driverPrivate = xnfcalloc(sizeof(SMIRec), 1);
+ }
+
+ LEAVE_PROC("SMI_GetRec");
+ return TRUE;
}
static void
SMI_FreeRec(ScrnInfoPtr pScrn)
{
- ENTER_PROC("SMI_FreeRec");
+ ENTER_PROC("SMI_FreeRec");
- if (pScrn->driverPrivate != NULL)
- {
- xfree(pScrn->driverPrivate);
- pScrn->driverPrivate = NULL;
- }
+ if (pScrn->driverPrivate != NULL) {
+ xfree(pScrn->driverPrivate);
+ pScrn->driverPrivate = NULL;
+ }
- LEAVE_PROC("SMI_FreeRec");
+ LEAVE_PROC("SMI_FreeRec");
}
static const OptionInfoRec *
SMI_AvailableOptions(int chipid, int busid)
{
- ENTER_PROC("SMI_AvailableOptions");
- LEAVE_PROC("SMI_AvailableOptions");
- return(SMIOptions);
+ ENTER_PROC("SMI_AvailableOptions");
+ LEAVE_PROC("SMI_AvailableOptions");
+ return SMIOptions;
}
static void
SMI_Identify(int flags)
{
- ENTER_PROC("SMI_Identify");
+ ENTER_PROC("SMI_Identify");
- xf86PrintChipsets(SILICONMOTION_NAME, "driver (version "
- SILICONMOTION_VERSION_NAME ") for Silicon Motion Lynx chipsets",
- SMIChipsets);
+ xf86PrintChipsets(SILICONMOTION_NAME, "driver (version "
+ SILICONMOTION_VERSION_NAME ") for Silicon Motion Lynx chipsets",
+ SMIChipsets);
- LEAVE_PROC("SMI_Identify");
+ LEAVE_PROC("SMI_Identify");
}
static Bool
SMI_Probe(DriverPtr drv, int flags)
{
- int i;
- GDevPtr *devSections;
- int *usedChips;
- int numDevSections;
- int numUsed;
- Bool foundScreen = FALSE;
+ int i;
+ GDevPtr *devSections;
+ int *usedChips;
+ int numDevSections;
+ int numUsed;
+ Bool foundScreen = FALSE;
- ENTER_PROC("SMI_Probe");
+ ENTER_PROC("SMI_Probe");
- numDevSections = xf86MatchDevice(SILICONMOTION_DRIVER_NAME, &devSections);
- if (numDevSections <= 0)
- {
- /* There's no matching device section in the config file, so quit now.
- */
- LEAVE_PROC("SMI_Probe");
- return(FALSE);
- }
+ numDevSections = xf86MatchDevice(SILICONMOTION_DRIVER_NAME, &devSections);
- if (xf86GetPciVideoInfo() == NULL)
- {
- LEAVE_PROC("SMI_Probe");
- return(FALSE);
- }
-
- numUsed = xf86MatchPciInstances(SILICONMOTION_NAME, PCI_SMI_VENDOR_ID,
- SMIChipsets, SMIPciChipsets, devSections,
- numDevSections, drv, &usedChips);
+ if (numDevSections <= 0) {
+ /* There's no matching device section in the config file, so quit now. */
+ LEAVE_PROC("SMI_Probe");
+ return FALSE;
+ }
- /* Free it since we don't need that list after this */
- xfree(devSections);
- if (numUsed <= 0)
- {
- LEAVE_PROC("SMI_Probe");
- return(FALSE);
- }
+#ifndef XSERVER_LIBPCIACCESS
+ if (xf86GetPciVideoInfo() == NULL) {
+ LEAVE_PROC("SMI_Probe");
+ return FALSE;
+ }
+#endif
- if (flags & PROBE_DETECT)
- {
- foundScreen = TRUE;
- }
- else
- {
- for (i = 0; i < numUsed; i++)
- {
- /* Allocate a ScrnInfoRec and claim the slot */
- ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0);
-
- /* Fill in what we can of the ScrnInfoRec */
- pScrn->driverVersion = SILICONMOTION_DRIVER_VERSION;
- pScrn->driverName = SILICONMOTION_DRIVER_NAME;
- pScrn->name = SILICONMOTION_NAME;
- pScrn->Probe = SMI_Probe;
- pScrn->PreInit = SMI_PreInit;
- pScrn->ScreenInit = SMI_ScreenInit;
- pScrn->SwitchMode = SMI_SwitchMode;
- pScrn->AdjustFrame = SMI_AdjustFrame;
- pScrn->EnterVT = SMI_EnterVT;
- pScrn->LeaveVT = SMI_LeaveVT;
- pScrn->FreeScreen = SMI_FreeScreen;
- pScrn->ValidMode = SMI_ValidMode;
- foundScreen = TRUE;
-
- xf86ConfigActivePciEntity(pScrn, usedChips[i], SMIPciChipsets, NULL,
- NULL, NULL, NULL, NULL);
- }
- }
- xfree(usedChips);
+ numUsed = xf86MatchPciInstances(SILICONMOTION_NAME, PCI_SMI_VENDOR_ID,
+ SMIChipsets, SMIPciChipsets, devSections,
+ numDevSections, drv, &usedChips);
+ /* Free it since we don't need that list after this */
+ xfree(devSections);
+ if (numUsed <= 0) {
LEAVE_PROC("SMI_Probe");
- return(foundScreen);
+ return FALSE;
+ }
+
+ if (flags & PROBE_DETECT) {
+ foundScreen = TRUE;
+ } else {
+ for (i = 0; i < numUsed; i++) {
+ /* Allocate a ScrnInfoRec and claim the slot */
+ ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0);
+
+ /* Fill in what we can of the ScrnInfoRec */
+ pScrn->driverVersion = SILICONMOTION_DRIVER_VERSION;
+ pScrn->driverName = SILICONMOTION_DRIVER_NAME;
+ pScrn->name = SILICONMOTION_NAME;
+ pScrn->Probe = SMI_Probe;
+ pScrn->PreInit = SMI_PreInit;
+ pScrn->ScreenInit = SMI_ScreenInit;
+ pScrn->SwitchMode = SMI_SwitchMode;
+ pScrn->AdjustFrame = SMI_AdjustFrame;
+ pScrn->EnterVT = SMI_EnterVT;
+ pScrn->LeaveVT = SMI_LeaveVT;
+ pScrn->FreeScreen = SMI_FreeScreen;
+ pScrn->ValidMode = SMI_ValidMode;
+ foundScreen = TRUE;
+
+ xf86ConfigActivePciEntity(pScrn, usedChips[i], SMIPciChipsets, NULL,
+ NULL, NULL, NULL, NULL);
+ }
+ }
+ xfree(usedChips);
+
+ LEAVE_PROC("SMI_Probe");
+ return foundScreen;
}
static Bool
SMI_PreInit(ScrnInfoPtr pScrn, int flags)
{
- EntityInfoPtr pEnt;
- SMIPtr pSmi;
- MessageType from;
- int i;
- double real;
- ClockRangePtr clockRanges;
- char *s;
- unsigned char config, m, n, shift;
- int mclk;
- vgaHWPtr hwp;
- int vgaCRIndex, vgaIOBase;
- vbeInfoPtr pVbe = NULL;
+ EntityInfoPtr pEnt;
+ SMIPtr pSmi;
+ MessageType from;
+ int i;
+ double real;
+ ClockRangePtr clockRanges;
+ char *s;
+ unsigned char config, m, n, shift;
+ int mclk;
+ vgaHWPtr hwp;
+ int vgaCRIndex, vgaIOBase;
+ vbeInfoPtr pVbe = NULL;
- ENTER_PROC("SMI_PreInit");
+ ENTER_PROC("SMI_PreInit");
- if (flags & PROBE_DETECT)
- {
- SMI_ProbeDDC(pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index);
- LEAVE_PROC("SMI_PreInit");
- return(TRUE);
- }
-
- /* Ignoring the Type list for now. It might be needed when multiple cards
- * are supported.
- */
- if (pScrn->numEntities > 1)
- {
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
-
- /* The vgahw module should be loaded here when needed */
- if (!xf86LoadSubModule(pScrn, "vgahw"))
- {
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
-
- xf86LoaderReqSymLists(vgahwSymbols, NULL);
-
- /*
- * Allocate a vgaHWRec
- */
- if (!vgaHWGetHWRec(pScrn))
- {
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
-
- /* Allocate the SMIRec driverPrivate */
- if (!SMI_GetRec(pScrn))
- {
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
- pSmi = SMIPTR(pScrn);
-
- /* Set pScrn->monitor */
- pScrn->monitor = pScrn->confScreen->monitor;
-
- /*
- * The first thing we should figure out is the depth, bpp, etc.
- * We support only 24bpp layouts, so indicate that.
- */
- if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb))
- {
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
-
- /* Check that the returned depth is one we support */
- switch (pScrn->depth)
- {
- case 8:
- case 16:
- case 24:
- /* OK */
- break;
-
- default:
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Given depth (%d) is not supported by this driver\n",
- pScrn->depth);
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
- xf86PrintDepthBpp(pScrn);
-
- /*
- * This must happen after pScrn->display has been set because
- * xf86SetWeight references it.
- */
- if (pScrn->depth > 8)
- {
- /* The defaults are OK for us */
- rgb zeros = {0, 0, 0};
-
- if (!xf86SetWeight(pScrn, zeros, zeros))
- {
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
- }
-
- if (!xf86SetDefaultVisual(pScrn, -1))
- {
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
-
- /* We don't currently support DirectColor at > 8bpp */
- if ((pScrn->depth > 8) && (pScrn->defaultVisual != TrueColor))
- {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual (%s) "
- "is not supported at depth %d\n",
- xf86GetVisualName(pScrn->defaultVisual), pScrn->depth);
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
-
- /* We use a programmable clock */
- pScrn->progClock = TRUE;
-
- /* Collect all of the relevant option flags (fill in pScrn->options) */
- xf86CollectOptions(pScrn, NULL);
-
- /* Set the bits per RGB for 8bpp mode */
- if (pScrn->depth == 8)
- {
- pScrn->rgbBits = 6;
- }
+ if (flags & PROBE_DETECT) {
+ SMI_ProbeDDC(pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index);
+ LEAVE_PROC("SMI_PreInit");
+ return TRUE;
+ }
- /* Process the options */
- if (!(pSmi->Options = xalloc(sizeof(SMIOptions))))
- return FALSE;
- memcpy(pSmi->Options, SMIOptions, sizeof(SMIOptions));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pSmi->Options);
+ /* Ignoring the Type list for now. It might be needed when multiple cards
+ * are supported.
+ */
+ if (pScrn->numEntities > 1) {
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
- if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_BURST, FALSE))
- {
- pSmi->pci_burst = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_burst - PCI burst "
- "read enabled\n");
- }
- else
- {
- pSmi->pci_burst = FALSE;
- }
+ /* The vgahw module should be loaded here when needed */
+ if (!xf86LoadSubModule(pScrn, "vgahw")) {
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
- pSmi->NoPCIRetry = TRUE;
- if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_RETRY, FALSE))
- {
- if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_BURST, FALSE))
- {
- pSmi->NoPCIRetry = FALSE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_retry\n");
- }
- else
- {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"pci_retry\" option "
- "requires \"pci_burst\".\n");
- }
- }
+ xf86LoaderReqSymLists(vgahwSymbols, NULL);
- if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_CONSERV))
- {
- pSmi->fifo_conservative = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_conservative "
- "set\n");
- }
- else
- {
- pSmi->fifo_conservative = FALSE;
- }
+ /*
+ * Allocate a vgaHWRec
+ */
+ if (!vgaHWGetHWRec(pScrn)) {
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
- if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_MODERATE))
- {
- pSmi->fifo_moderate = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_moderate set\n");
- }
- else
- {
- pSmi->fifo_moderate = FALSE;
- }
+ /* Allocate the SMIRec driverPrivate */
+ if (!SMI_GetRec(pScrn)) {
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
+ pSmi = SMIPTR(pScrn);
- if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_AGGRESSIVE))
- {
- pSmi->fifo_aggressive = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_aggressive set\n");
- }
- else
- {
- pSmi->fifo_aggressive = FALSE;
- }
+ /* Set pScrn->monitor */
+ pScrn->monitor = pScrn->confScreen->monitor;
- if (xf86ReturnOptValBool(pSmi->Options, OPTION_NOACCEL, FALSE))
- {
- pSmi->NoAccel = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - Acceleration "
- "disabled\n");
- }
- else
- {
- pSmi->NoAccel = FALSE;
- }
+ /*
+ * The first thing we should figure out is the depth, bpp, etc.
+ */
+ if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support32bppFb)) {
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
+
+ /* Check that the returned depth is one we support */
+ switch (pScrn->depth) {
+ case 8:
+ case 16:
+ case 24:
+ /* OK */
+ break;
+
+ default:
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Given depth (%d) is not supported by this driver\n",
+ pScrn->depth);
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
- if (xf86ReturnOptValBool(pSmi->Options, OPTION_SHOWCACHE, FALSE))
- {
- pSmi->ShowCache = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: show_cache set\n");
- }
- else
- {
- pSmi->ShowCache = FALSE;
- }
+ xf86PrintDepthBpp(pScrn);
- if (xf86GetOptValFreq(pSmi->Options, OPTION_MCLK, OPTUNITS_MHZ, &real))
- {
- pSmi->MCLK = (int)(real * 1000.0);
- if (pSmi->MCLK <= 120000)
- {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: set_mclk set to "
- "%1.3f MHz\n", pSmi->MCLK / 1000.0);
- }
- else
- {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Memory Clock value of "
- "%1.3f MHz is larger than limit of 120 MHz\n",
- pSmi->MCLK / 1000.0);
- pSmi->MCLK = 0;
- }
- }
- else
- {
- pSmi->MCLK = 0;
- }
+ /*
+ * This must happen after pScrn->display has been set because
+ * xf86SetWeight references it.
+ */
+ if (pScrn->depth > 8) {
+ /* The defaults are OK for us */
+ rgb zeros = {0, 0, 0};
- from = X_DEFAULT;
- pSmi->hwcursor = TRUE;
- if (xf86GetOptValBool(pSmi->Options, OPTION_HWCURSOR, &pSmi->hwcursor))
- {
- from = X_CONFIG;
- }
- if (xf86ReturnOptValBool(pSmi->Options, OPTION_SWCURSOR, FALSE))
- {
- pSmi->hwcursor = FALSE;
- from = X_CONFIG;
+ if (!xf86SetWeight(pScrn, zeros, zeros)) {
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
}
- xf86DrvMsg(pScrn->scrnIndex, from, "Using %s Cursor\n",
- pSmi->hwcursor ? "Hardware" : "Software");
+ }
- if (xf86GetOptValBool(pSmi->Options, OPTION_SHADOW_FB, &pSmi->shadowFB))
- {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n",
- pSmi->shadowFB ? "enabled" : "disabled");
- }
+ if (!xf86SetDefaultVisual(pScrn, -1)) {
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
+
+ /* We don't currently support DirectColor at > 8bpp */
+ if ((pScrn->depth > 8) && (pScrn->defaultVisual != TrueColor)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual (%s) "
+ "is not supported at depth %d\n",
+ xf86GetVisualName(pScrn->defaultVisual), pScrn->depth);
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
+
+ /* We use a programmable clock */
+ pScrn->progClock = TRUE;
+
+ /* Collect all of the relevant option flags (fill in pScrn->options) */
+ xf86CollectOptions(pScrn, NULL);
+
+ /* Set the bits per RGB for 8bpp mode */
+ if (pScrn->depth == 8) {
+ pScrn->rgbBits = 6;
+ }
+
+ /* Process the options */
+ if (!(pSmi->Options = xalloc(sizeof(SMIOptions))))
+ return FALSE;
+ memcpy(pSmi->Options, SMIOptions, sizeof(SMIOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pSmi->Options);
+
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_BURST, FALSE)) {
+ pSmi->pci_burst = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_burst - PCI burst "
+ "read enabled\n");
+ } else {
+ pSmi->pci_burst = FALSE;
+ }
+
+ pSmi->NoPCIRetry = TRUE;
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_RETRY, FALSE)) {
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_BURST, FALSE)) {
+ pSmi->NoPCIRetry = FALSE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_retry\n");
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"pci_retry\" option "
+ "requires \"pci_burst\".\n");
+ }
+ }
+
+ if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_CONSERV)) {
+ pSmi->fifo_conservative = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_conservative "
+ "set\n");
+ } else {
+ pSmi->fifo_conservative = FALSE;
+ }
+
+ if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_MODERATE)) {
+ pSmi->fifo_moderate = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_moderate set\n");
+ } else {
+ pSmi->fifo_moderate = FALSE;
+ }
+
+ if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_AGGRESSIVE)) {
+ pSmi->fifo_aggressive = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_aggressive set\n");
+ } else {
+ pSmi->fifo_aggressive = FALSE;
+ }
+
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_NOACCEL, FALSE)) {
+ pSmi->NoAccel = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - Acceleration "
+ "disabled\n");
+ } else {
+ pSmi->NoAccel = FALSE;
+ }
+
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_SHOWCACHE, FALSE)) {
+ pSmi->ShowCache = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: show_cache set\n");
+ } else {
+ pSmi->ShowCache = FALSE;
+ }
+
+ if (xf86GetOptValFreq(pSmi->Options, OPTION_MCLK, OPTUNITS_MHZ, &real)) {
+ pSmi->MCLK = (int)(real * 1000.0);
+ if (pSmi->MCLK <= 120000) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: set_mclk set to "
+ "%1.3f MHz\n", pSmi->MCLK / 1000.0);
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Memory Clock value of "
+ "%1.3f MHz is larger than limit of 120 MHz\n",
+ pSmi->MCLK / 1000.0);
+ pSmi->MCLK = 0;
+ }
+ } else {
+ pSmi->MCLK = 0;
+ }
+
+ from = X_DEFAULT;
+ pSmi->hwcursor = TRUE;
+ if (xf86GetOptValBool(pSmi->Options, OPTION_HWCURSOR, &pSmi->hwcursor)) {
+ from = X_CONFIG;
+ }
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_SWCURSOR, FALSE)) {
+ pSmi->hwcursor = FALSE;
+ from = X_CONFIG;
+ }
+ xf86DrvMsg(pScrn->scrnIndex, from, "Using %s Cursor\n",
+ pSmi->hwcursor ? "Hardware" : "Software");
+
+ if (xf86GetOptValBool(pSmi->Options, OPTION_SHADOW_FB, &pSmi->shadowFB)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n",
+ pSmi->shadowFB ? "enabled" : "disabled");
+ }
#if 1 /* PDR#932 */
- if ((pScrn->depth == 8) || (pScrn->depth == 16))
+ if ((pScrn->depth == 8) || (pScrn->depth == 16))
#endif /* PDR#932 */
- if ((s = xf86GetOptValString(pSmi->Options, OPTION_ROTATE)))
- {
- if(!xf86NameCmp(s, "CW"))
- {
- pSmi->shadowFB = TRUE;
- pSmi->rotate = SMI_ROTATE_CCW;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen "
- "clockwise\n");
- }
- else if (!xf86NameCmp(s, "CCW"))
- {
- pSmi->shadowFB = TRUE;
- pSmi->rotate = SMI_ROTATE_CW;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen counter "
- "clockwise\n");
- }
- else
- {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid "
- "value for Option \"Rotate\"\n", s);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Valid options are \"CW\" or "
- "\"CCW\"\n");
- }
+ if ((s = xf86GetOptValString(pSmi->Options, OPTION_ROTATE))) {
+ if (!xf86NameCmp(s, "CW")) {
+ pSmi->shadowFB = TRUE;
+ pSmi->rotate = SMI_ROTATE_CCW;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen "
+ "clockwise\n");
+ } else if (!xf86NameCmp(s, "CCW")) {
+ pSmi->shadowFB = TRUE;
+ pSmi->rotate = SMI_ROTATE_CW;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen counter "
+ "clockwise\n");
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid "
+ "value for Option \"Rotate\"\n", s);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Valid options are \"CW\" or "
+ "\"CCW\"\n");
+ }
}
- if (pSmi->rotate)
- {
- /* Disable the RandR extension, it messes up the internal rotation stuff */
- xf86DisableRandR();
- }
+ if (pSmi->rotate) {
+ /* Disable the RandR extension, it messes up the internal rotation stuff */
+ xf86DisableRandR();
+ }
- if (xf86GetOptValInteger(pSmi->Options, OPTION_VIDEOKEY, &pSmi->videoKey))
- {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: Video key set to "
- "0x%08X\n", pSmi->videoKey);
- }
- else
- {
- pSmi->videoKey = (1 << pScrn->offset.red) | (1 << pScrn->offset.green)
- | (((pScrn->mask.blue >> pScrn->offset.blue) - 1)
- << pScrn->offset.blue);
- }
-
- if (xf86ReturnOptValBool(pSmi->Options, OPTION_BYTESWAP, FALSE))
- {
- pSmi->ByteSwap = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ByteSwap enabled.\n");
- }
- else
- {
- pSmi->ByteSwap = FALSE;
- }
-
- /* CZ 26.10.2001: interlaced video */
- if (xf86ReturnOptValBool(pSmi->Options, OPTION_INTERLACED, FALSE))
- {
- pSmi->interlaced = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: Interlaced enabled.\n");
- }
- else
- {
- pSmi->interlaced = FALSE;
- }
- /* end CZ */
-
- if (xf86GetOptValBool(pSmi->Options, OPTION_USEBIOS, &pSmi->useBIOS))
- {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: UseBIOS %s.\n",
- pSmi->useBIOS ? "enabled" : "disabled");
- }
- else
- {
- /* Default to UseBIOS enabled. */
- pSmi->useBIOS = TRUE;
- }
-
- if (xf86GetOptValBool(pSmi->Options, OPTION_ZOOMONLCD, &pSmi->zoomOnLCD))
- {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ZoomOnLCD %s.\n",
- pSmi->zoomOnLCD ? "enabled" : "disabled");
- }
- else
- {
- /* Default to ZoomOnLCD enabled. */
- pSmi->zoomOnLCD = TRUE;
- }
+ if (xf86GetOptValInteger(pSmi->Options, OPTION_VIDEOKEY, &pSmi->videoKey)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: Video key set to "
+ "0x%08X\n", pSmi->videoKey);
+ } else {
+ pSmi->videoKey = (1 << pScrn->offset.red) |
+ (1 << pScrn->offset.green) |
+ (((pScrn->mask.blue >> pScrn->offset.blue) - 1)
+ << pScrn->offset.blue);
+ }
+
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_BYTESWAP, FALSE)) {
+ pSmi->ByteSwap = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ByteSwap enabled.\n");
+ } else {
+ pSmi->ByteSwap = FALSE;
+ }
- /* Find the PCI slot for this screen */
- pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
- if ((pEnt->location.type != BUS_PCI) || (pEnt->resources))
- {
- xfree(pEnt);
- SMI_FreeRec(pScrn);
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
+ /* CZ 26.10.2001: interlaced video */
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_INTERLACED, FALSE)) {
+ pSmi->interlaced = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: Interlaced enabled.\n");
+ } else {
+ pSmi->interlaced = FALSE;
+ }
+ /* end CZ */
+
+ if (xf86GetOptValBool(pSmi->Options, OPTION_USEBIOS, &pSmi->useBIOS)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: UseBIOS %s.\n",
+ pSmi->useBIOS ? "enabled" : "disabled");
+ } else {
+ /* Default to UseBIOS enabled. */
+ pSmi->useBIOS = TRUE;
+ }
+
+ if (xf86GetOptValBool(pSmi->Options, OPTION_ZOOMONLCD, &pSmi->zoomOnLCD)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ZoomOnLCD %s.\n",
+ pSmi->zoomOnLCD ? "enabled" : "disabled");
+ } else {
+ /* Default to ZoomOnLCD enabled. */
+ pSmi->zoomOnLCD = TRUE;
+ }
+
+ /* Find the PCI slot for this screen */
+ pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
+ if ((pEnt->location.type != BUS_PCI) || (pEnt->resources)) {
+ xfree(pEnt);
+ SMI_FreeRec(pScrn);
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
- if (xf86LoadSubModule(pScrn,"int10")) {
- xf86LoaderReqSymLists(int10Symbols,NULL);
- pSmi->pInt10 = xf86InitInt10(pEnt->index);
- }
+ if (xf86LoadSubModule(pScrn,"int10")) {
+ xf86LoaderReqSymLists(int10Symbols,NULL);
+ pSmi->pInt10 = xf86InitInt10(pEnt->index);
+ }
- if (pSmi->pInt10 && xf86LoadSubModule(pScrn, "vbe"))
- {
- xf86LoaderReqSymLists(vbeSymbols, NULL);
- pVbe = VBEInit(pSmi->pInt10, pEnt->index);
- }
-
- pSmi->PciInfo = xf86GetPciInfoForEntity(pEnt->index);
- xf86RegisterResources(pEnt->index, NULL, ResExclusive);
-/* xf86SetOperatingState(resVgaIo, pEnt->index, ResUnusedOpr); */
-/* xf86SetOperatingState(resVgaMem, pEnt->index, ResDisableOpr); */
-
- /*
- * Set the Chipset and ChipRev, allowing config file entries to
- * override.
- */
- if (pEnt->device->chipset && *pEnt->device->chipset)
- {
- pScrn->chipset = pEnt->device->chipset;
- pSmi->Chipset = xf86StringToToken(SMIChipsets, pScrn->chipset);
- from = X_CONFIG;
- }
- else if (pEnt->device->chipID >= 0)
- {
- pSmi->Chipset = pEnt->device->chipID;
- pScrn->chipset = (char *) xf86TokenToString(SMIChipsets, pSmi->Chipset);
- from = X_CONFIG;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n",
- pSmi->Chipset);
- }
- else
- {
- from = X_PROBED;
- pSmi->Chipset = pSmi->PciInfo->chipType;
- pScrn->chipset = (char *) xf86TokenToString(SMIChipsets, pSmi->Chipset);
- }
+ if (pSmi->pInt10 && xf86LoadSubModule(pScrn, "vbe")) {
+ xf86LoaderReqSymLists(vbeSymbols, NULL);
+ pVbe = VBEInit(pSmi->pInt10, pEnt->index);
+ }
+
+ pSmi->PciInfo = xf86GetPciInfoForEntity(pEnt->index);
+ xf86RegisterResources(pEnt->index, NULL, ResExclusive);
+/* xf86SetOperatingState(resVgaIo, pEnt->index, ResUnusedOpr); */
+/* xf86SetOperatingState(resVgaMem, pEnt->index, ResDisableOpr); */
+
+ /*
+ * Set the Chipset and ChipRev, allowing config file entries to
+ * override.
+ */
+ if (pEnt->device->chipset && *pEnt->device->chipset) {
+ pScrn->chipset = pEnt->device->chipset;
+ pSmi->Chipset = xf86StringToToken(SMIChipsets, pScrn->chipset);
+ from = X_CONFIG;
+ } else if (pEnt->device->chipID >= 0) {
+ pSmi->Chipset = pEnt->device->chipID;
+ pScrn->chipset = (char *) xf86TokenToString(SMIChipsets, pSmi->Chipset);
+ from = X_CONFIG;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n",
+ pSmi->Chipset);
+ } else {
+ from = X_PROBED;
+ pSmi->Chipset = PCI_DEV_DEVICE_ID(pSmi->PciInfo);
+ pScrn->chipset = (char *) xf86TokenToString(SMIChipsets, pSmi->Chipset);
+ }
+
+ if (pEnt->device->chipRev >= 0) {
+ pSmi->ChipRev = pEnt->device->chipRev;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n",
+ pSmi->ChipRev);
+ } else {
+ pSmi->ChipRev = PCI_DEV_REVISION(pSmi->PciInfo);
+ }
+ xfree(pEnt);
+
+ /*
+ * This shouldn't happen because such problems should be caught in
+ * SMI_Probe(), but check it just in case.
+ */
+ if (pScrn->chipset == NULL) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ChipID 0x%04X is not "
+ "recognised\n", pSmi->Chipset);
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
- if (pEnt->device->chipRev >= 0)
- {
- pSmi->ChipRev = pEnt->device->chipRev;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n",
- pSmi->ChipRev);
- }
- else
- {
- pSmi->ChipRev = pSmi->PciInfo->chipRev;
- }
- xfree(pEnt);
+ if (pSmi->Chipset < 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Chipset \"%s\" is not "
+ "recognised\n", pScrn->chipset);
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
- /*
- * This shouldn't happen because such problems should be caught in
- * SMI_Probe(), but check it just in case.
- */
- if (pScrn->chipset == NULL)
- {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ChipID 0x%04X is not "
- "recognised\n", pSmi->Chipset);
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
- if (pSmi->Chipset < 0)
- {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Chipset \"%s\" is not "
- "recognised\n", pScrn->chipset);
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
+ xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset);
- xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset);
+#ifndef XSERVER_LIBPCIACCESS
+ pSmi->PciTag = pciTag(pSmi->PciInfo->bus, pSmi->PciInfo->device,
+ pSmi->PciInfo->func);
+#endif
- pSmi->PciTag = pciTag(pSmi->PciInfo->bus, pSmi->PciInfo->device,
- pSmi->PciInfo->func);
+ pSmi->Dualhead = FALSE;
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_DUALHEAD, FALSE) &&
+ SMI_LYNXM_SERIES(pSmi->Chipset)) {
+ pSmi->Dualhead = TRUE;
+ }
- pSmi->Dualhead = FALSE;
- if (xf86ReturnOptValBool(pSmi->Options, OPTION_DUALHEAD, FALSE) &&
- SMI_LYNXM_SERIES(pSmi->Chipset))
- {
- pSmi->Dualhead = TRUE;
+ /* tweak options for dualhead */
+ if (pSmi->Dualhead) {
+ pSmi->useBIOS = FALSE;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "UseBIOS disabled in dualhead mode\n");
+ pSmi->hwcursor = FALSE;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No hardware cursor in dualhead mode\n");
+ if (pScrn->bitsPerPixel != 16) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Dualhead only supported at "
+ "depth 16\n");
+ return FALSE;
}
+ }
- /* tweak options for dualhead */
- if (pSmi->Dualhead) {
- pSmi->useBIOS = FALSE;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "UseBIOS disabled in dualhead mode\n");
- pSmi->hwcursor = FALSE;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No hardware cursor in dualhead mode\n");
- if (pScrn->bitsPerPixel != 16) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Dualhead only supported at "
- "depth 16\n");
- return FALSE;
- }
- }
+ SMI_MapMem(pScrn);
+ SMI_DisableVideo(pScrn);
- SMI_MapMem(pScrn);
- SMI_DisableVideo(pScrn);
+ hwp = VGAHWPTR(pScrn);
+ vgaIOBase = hwp->IOBase;
+ vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET;
+ pSmi->PIOBase = hwp->PIOOffset;
- hwp = VGAHWPTR(pScrn);
- vgaIOBase = hwp->IOBase;
- vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET;
- pSmi->PIOBase = hwp->PIOOffset;
+ xf86ErrorFVerb(VERBLEV, "\tSMI_PreInit vgaCRIndex=%x, vgaIOBase=%x, "
+ "MMIOBase=%p\n", vgaCRIndex, vgaIOBase, hwp->MMIOBase);
- xf86ErrorFVerb(VERBLEV, "\tSMI_PreInit vgaCRIndex=%x, vgaIOBase=%x, "
- "MMIOBase=%p\n", vgaCRIndex, vgaIOBase, hwp->MMIOBase);
+ /* detect the panel size */
+ SMI_DetectPanelSize(pScrn);
- /* detect the panel size */
- SMI_DetectPanelSize(pScrn);
+ if (xf86LoadSubModule(pScrn, "i2c")) {
+ xf86LoaderReqSymLists(i2cSymbols, NULL);
+ SMI_I2CInit(pScrn);
+ }
- if (xf86LoadSubModule(pScrn, "i2c"))
- {
- xf86LoaderReqSymLists(i2cSymbols, NULL);
- SMI_I2CInit(pScrn);
- }
- if (xf86LoadSubModule(pScrn, "ddc"))
- {
- xf86MonPtr pMon = NULL;
+ if (xf86LoadSubModule(pScrn, "ddc")) {
+ xf86MonPtr pMon = NULL;
- xf86LoaderReqSymLists(ddcSymbols, NULL);
+ xf86LoaderReqSymLists(ddcSymbols, NULL);
#if 1 /* PDR#579 */
- if (pVbe)
- {
- pMon = vbeDoEDID(pVbe, NULL);
- if (pMon != NULL)
- {
- if ( (pMon->rawData[0] == 0x00)
- && (pMon->rawData[1] == 0xFF)
- && (pMon->rawData[2] == 0xFF)
- && (pMon->rawData[3] == 0xFF)
- && (pMon->rawData[4] == 0xFF)
- && (pMon->rawData[5] == 0xFF)
- && (pMon->rawData[6] == 0xFF)
- && (pMon->rawData[7] == 0x00)
- )
- {
- pMon = xf86PrintEDID(pMon);
- if (pMon != NULL)
- {
- xf86SetDDCproperties(pScrn, pMon);
- }
- }
- }
- }
-#else
- if ( (pVbe)
- && ((pMon = xf86PrintEDID(vbeDoEDID(pVbe, NULL))) != NULL)
- )
- {
+ if (pVbe) {
+ pMon = vbeDoEDID(pVbe, NULL);
+ if (pMon != NULL) {
+ if ((pMon->rawData[0] == 0x00) &&
+ (pMon->rawData[1] == 0xFF) &&
+ (pMon->rawData[2] == 0xFF) &&
+ (pMon->rawData[3] == 0xFF) &&
+ (pMon->rawData[4] == 0xFF) &&
+ (pMon->rawData[5] == 0xFF) &&
+ (pMon->rawData[6] == 0xFF) &&
+ (pMon->rawData[7] == 0x00)) {
+ pMon = xf86PrintEDID(pMon);
+ if (pMon != NULL) {
xf86SetDDCproperties(pScrn, pMon);
+ }
}
+ }
+#else
+ if ((pVbe) &&
+ ((pMon = xf86PrintEDID(vbeDoEDID(pVbe, NULL))) != NULL)) {
+ xf86SetDDCproperties(pScrn, pMon);
#endif
- else if (!SMI_ddc1(pScrn->scrnIndex))
- {
- if (pSmi->I2C)
- {
- xf86SetDDCproperties(pScrn,
- xf86PrintEDID(xf86DoEDID_DDC2(pScrn->scrnIndex,
- pSmi->I2C)));
- }
- }
- }
+ } else if (!SMI_ddc1(pScrn->scrnIndex)) {
+ if (pSmi->I2C) {
+ xf86SetDDCproperties(pScrn,
+ xf86PrintEDID(xf86DoEDID_DDC2(pScrn->scrnIndex,
+ pSmi->I2C)));
+ }
+ }
+ }
- vbeFree(pVbe);
- xf86FreeInt10(pSmi->pInt10);
- pSmi->pInt10 = NULL;
+ vbeFree(pVbe);
+ xf86FreeInt10(pSmi->pInt10);
+ pSmi->pInt10 = NULL;
- /*
- * If the driver can do gamma correction, it should call xf86SetGamma()
- * here. (from MGA, no ViRGE gamma support yet, but needed for
- * xf86HandleColormaps support.)
- */
- {
- Gamma zeros = { 0.0, 0.0, 0.0 };
-
- if (!xf86SetGamma(pScrn, zeros))
- {
- LEAVE_PROC("SMI_PreInit");
- SMI_EnableVideo(pScrn);
- SMI_UnmapMem(pScrn);
- return(FALSE);
- }
- }
+ /*
+ * If the driver can do gamma correction, it should call xf86SetGamma()
+ * here. (from MGA, no ViRGE gamma support yet, but needed for
+ * xf86HandleColormaps support.)
+ */
+ {
+ Gamma zeros = { 0.0, 0.0, 0.0 };
+ if (!xf86SetGamma(pScrn, zeros)) {
+ LEAVE_PROC("SMI_PreInit");
+ SMI_EnableVideo(pScrn);
+ SMI_UnmapMem(pScrn);
+ return FALSE;
+ }
+ }
- /* Next go on to detect amount of installed ram */
- config = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x71);
- /* And compute the amount of video memory and offscreen memory */
- pSmi->videoRAMKBytes = 0;
+ /* Next go on to detect amount of installed ram */
+ config = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x71);
- if (!pScrn->videoRam)
- {
- switch (pSmi->Chipset)
- {
- default:
- {
- int mem_table[4] = { 1, 2, 4, 0 };
- pSmi->videoRAMKBytes = mem_table[(config >> 6)] * 1024;
- break;
- }
-
- case SMI_LYNX3D:
- {
- int mem_table[4] = { 0, 2, 4, 6 };
- pSmi->videoRAMKBytes = mem_table[(config >> 6)] * 1024 + 512;
- break;
- }
-
- case SMI_LYNX3DM:
- {
- int mem_table[4] = { 16, 2, 4, 8 };
- pSmi->videoRAMKBytes = mem_table[(config >> 6)] * 1024;
- break;
- }
-
- case SMI_COUGAR3DR:
- {
- /* DANGER - Cougar3DR BIOS is broken - hardcode video ram size */
- /* per instructions from Silicon Motion engineers */
- pSmi->videoRAMKBytes = 16 * 1024;
- break;
- }
- }
- pSmi->videoRAMBytes = pSmi->videoRAMKBytes * 1024;
- pScrn->videoRam = pSmi->videoRAMKBytes;
+ /* And compute the amount of video memory and offscreen memory */
+ pSmi->videoRAMKBytes = 0;
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "videoram: %dkB\n",
- pSmi->videoRAMKBytes);
- }
- else
+ if (!pScrn->videoRam) {
+ switch (pSmi->Chipset) {
+ default:
{
- pSmi->videoRAMKBytes = pScrn->videoRam;
- pSmi->videoRAMBytes = pScrn->videoRam * 1024;
-
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "videoram: %dk\n",
- pSmi->videoRAMKBytes);
- }
+ int mem_table[4] = { 1, 2, 4, 0 };
+ pSmi->videoRAMKBytes = mem_table[(config >> 6)] * 1024;
+ break;
+ }
+ case SMI_LYNX3D:
+ {
+ int mem_table[4] = { 0, 2, 4, 6 };
+ pSmi->videoRAMKBytes = mem_table[(config >> 6)] * 1024 + 512;
+ break;
+ }
+ case SMI_LYNX3DM:
+ {
+ int mem_table[4] = { 16, 2, 4, 8 };
+ pSmi->videoRAMKBytes = mem_table[(config >> 6)] * 1024;
+ break;
+ }
+ case SMI_COUGAR3DR:
+ {
+ /* DANGER - Cougar3DR BIOS is broken - hardcode video ram size */
+ /* per instructions from Silicon Motion engineers */
+ pSmi->videoRAMKBytes = 16 * 1024;
+ break;
+ }
+ }
+ pSmi->videoRAMBytes = pSmi->videoRAMKBytes * 1024;
+ pScrn->videoRam = pSmi->videoRAMKBytes;
+
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "videoram: %dkB\n",
+ pSmi->videoRAMKBytes);
+ } else {
+ pSmi->videoRAMKBytes = pScrn->videoRam;
+ pSmi->videoRAMBytes = pScrn->videoRam * 1024;
+
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "videoram: %dk\n",
+ pSmi->videoRAMKBytes);
+ }
+
+ /* Detect current MCLK and print it for user */
+ m = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A);
+ n = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B);
+ switch (n >> 6) {
+ default:
+ shift = 1;
+ break;
+ case 1:
+ shift = 4;
+ break;
+ case 2:
+ shift = 2;
+ break;
+ }
+ n &= 0x3F;
+ mclk = ((1431818 * m) / n / shift + 50) / 100;
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected current MCLK value of "
+ "%1.3f MHz\n", mclk / 1000.0);
+
+ SMI_EnableVideo(pScrn);
+ SMI_UnmapMem(pScrn);
+
+ pSmi->IsSwitching = FALSE;
+
+ if (pSmi->Dualhead) {
+ pScrn->display->virtualX = 2 * pSmi->lcdWidth;
+ pScrn->display->virtualY = pSmi->lcdHeight;
+ }
+
+ pScrn->virtualX = pScrn->display->virtualX;
+
+ /*
+ * Setup the ClockRanges, which describe what clock ranges are available,
+ * and what sort of modes they can be used for.
+ */
+ clockRanges = xnfcalloc(sizeof(ClockRange),1);
+ clockRanges->next = NULL;
+ clockRanges->minClock = 20000;
+
+ if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR))
+ clockRanges->maxClock = 200000;
+ else
+ clockRanges->maxClock = 135000;
+
+ clockRanges->clockIndex = -1;
+ clockRanges->interlaceAllowed = FALSE;
+ clockRanges->doubleScanAllowed = FALSE;
+
+ i = xf86ValidateModes(
+ pScrn, /* Screen pointer */
+ pScrn->monitor->Modes, /* Available monitor modes */
+ pScrn->display->modes, /* req mode names for screen */
+ clockRanges, /* list of clock ranges allowed */
+ NULL, /* use min/max below */
+ 128, /* min line pitch (width) */
+ 4096, /* maximum line pitch (width) */
+ 128, /* bits of granularity for line pitch */
+ /* (width) above */
+ 128, /* min virtual height */
+ 4096, /* max virtual height */
+ pScrn->display->virtualX, /* force virtual x */
+ pScrn->display->virtualY, /* force virtual Y */
+ pSmi->videoRAMBytes, /* size of aperture used to access */
+ /* video memory */
+ LOOKUP_BEST_REFRESH); /* how to pick modes */
+
+ if (i == -1) {
+ SMI_FreeRec(pScrn);
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
- /* Detect current MCLK and print it for user */
- m = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A);
- n = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B);
- switch (n >> 6)
- {
- default:
- shift = 1;
- break;
+ /* Prune the modes marked as invalid */
+ xf86PruneDriverModes(pScrn);
- case 1:
- shift = 4;
- break;
+ if ((i == 0) || (pScrn->modes == NULL)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
+ SMI_FreeRec(pScrn);
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
+ xf86SetCrtcForModes(pScrn, 0);
- case 2:
- shift = 2;
- break;
- }
- n &= 0x3F;
- mclk = ((1431818 * m) / n / shift + 50) / 100;
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected current MCLK value of "
- "%1.3f MHz\n", mclk / 1000.0);
+ /* Set the current mode to the first in the list */
+ pScrn->currentMode = pScrn->modes;
- SMI_EnableVideo(pScrn);
- SMI_UnmapMem(pScrn);
+ /* Print the list of modes being used */
+ xf86PrintModes(pScrn);
- if (pSmi->Dualhead) {
- pScrn->display->virtualX = 2 * pSmi->lcdWidth;
- pScrn->display->virtualY = pSmi->lcdHeight;
- }
+ /* Set display resolution */
+ xf86SetDpi(pScrn, 0, 0);
- pScrn->virtualX = pScrn->display->virtualX;
+ if ((xf86LoadSubModule(pScrn, "fb") == NULL)) {
+ SMI_FreeRec(pScrn);
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
+ }
- /*
- * Setup the ClockRanges, which describe what clock ranges are available,
- * and what sort of modes they can be used for.
- */
- clockRanges = xnfcalloc(sizeof(ClockRange),1);
- clockRanges->next = NULL;
- clockRanges->minClock = 20000;
-
- if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR))
- clockRanges->maxClock = 200000;
- else
- clockRanges->maxClock = 135000;
-
- clockRanges->clockIndex = -1;
- clockRanges->interlaceAllowed = FALSE;
- clockRanges->doubleScanAllowed = FALSE;
+ if (!pSmi->NoAccel) {
+ from = X_DEFAULT;
+ char *strptr;
- i = xf86ValidateModes(
- pScrn, /* Screen pointer */
- pScrn->monitor->Modes, /* Available monitor modes */
- pScrn->display->modes, /* req mode names for screen */
- clockRanges, /* list of clock ranges allowed */
- NULL, /* use min/max below */
- 128, /* min line pitch (width) */
- 4096, /* maximum line pitch (width) */
- 128, /* bits of granularity for line pitch */
- /* (width) above */
- 128, /* min virtual height */
- 4096, /* max virtual height */
- pScrn->display->virtualX, /* force virtual x */
- pScrn->display->virtualY, /* force virtual Y */
- pSmi->videoRAMBytes, /* size of aperture used to access */
- /* video memory */
- LOOKUP_BEST_REFRESH); /* how to pick modes */
-
- if (i == -1)
- {
- SMI_FreeRec(pScrn);
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
+ if ((strptr = (char *)xf86GetOptValString(pSmi->Options, OPTION_ACCELMETHOD))) {
+ if (!xf86NameCmp(strptr,"XAA")) {
+ from = X_CONFIG;
+ pSmi->useEXA = FALSE;
+ } else if(!xf86NameCmp(strptr,"EXA")) {
+ from = X_CONFIG;
+ pSmi->useEXA = TRUE;
+ }
}
+
+ xf86DrvMsg(pScrn->scrnIndex, from, "Using %s acceleration architecture\n",
+ pSmi->useEXA ? "EXA" : "XAA");
+ }
- /* Prune the modes marked as invalid */
- xf86PruneDriverModes(pScrn);
+ xf86LoaderReqSymLists(fbSymbols, NULL);
- if ((i == 0) || (pScrn->modes == NULL))
- {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
+ /* Load XAA or EXA if needed */
+ if (!pSmi->NoAccel) {
+ if (!pSmi->useEXA) {
+ if (!xf86LoadSubModule(pScrn, "xaa")) {
SMI_FreeRec(pScrn);
LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
- xf86SetCrtcForModes(pScrn, 0);
-
- /* Set the current mode to the first in the list */
- pScrn->currentMode = pScrn->modes;
-
- /* Print the list of modes being used */
- xf86PrintModes(pScrn);
-
- /* Set display resolution */
- xf86SetDpi(pScrn, 0, 0);
-
- if ((xf86LoadSubModule(pScrn, "fb") == NULL))
- {
+ return FALSE;
+ }
+ xf86LoaderReqSymLists(xaaSymbols, NULL);
+ } else {
+ XF86ModReqInfo req;
+ int errmaj, errmin;
+
+ memset(&req, 0, sizeof(XF86ModReqInfo));
+ req.majorversion = 2;
+ req.minorversion = 0;
+
+ if (!LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL,
+ &req, &errmaj, &errmin)) {
+ LoaderErrorMsg(NULL, "exa", errmaj, errmin);
SMI_FreeRec(pScrn);
LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
-
- xf86LoaderReqSymLists(fbSymbols, NULL);
- /* Load XAA if needed */
- if (!pSmi->NoAccel || pSmi->hwcursor)
- {
- if (!xf86LoadSubModule(pScrn, "xaa"))
- {
- SMI_FreeRec(pScrn);
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
- xf86LoaderReqSymLists(xaaSymbols, NULL);
+ return FALSE;
+ }
+ xf86LoaderReqSymLists(exaSymbols, NULL);
}
+ }
- /* Load ramdac if needed */
- if (pSmi->hwcursor)
- {
- if (!xf86LoadSubModule(pScrn, "ramdac"))
- {
- SMI_FreeRec(pScrn);
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
- xf86LoaderReqSymLists(ramdacSymbols, NULL);
+ /* Load ramdac if needed */
+ if (pSmi->hwcursor) {
+ if (!xf86LoadSubModule(pScrn, "ramdac")) {
+ SMI_FreeRec(pScrn);
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
}
+ xf86LoaderReqSymLists(ramdacSymbols, NULL);
+ }
- if (pSmi->shadowFB)
- {
- if (!xf86LoadSubModule(pScrn, "shadowfb"))
- {
- SMI_FreeRec(pScrn);
- LEAVE_PROC("SMI_PreInit");
- return(FALSE);
- }
- xf86LoaderReqSymLists(shadowSymbols, NULL);
+ if (pSmi->shadowFB) {
+ if (!xf86LoadSubModule(pScrn, "shadowfb")) {
+ SMI_FreeRec(pScrn);
+ LEAVE_PROC("SMI_PreInit");
+ return FALSE;
}
+ xf86LoaderReqSymLists(shadowSymbols, NULL);
+ }
- LEAVE_PROC("SMI_PreInit");
- return(TRUE);
+ LEAVE_PROC("SMI_PreInit");
+ return TRUE;
}
/*
@@ -1243,71 +1179,63 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
static Bool
SMI_EnterVT(int scrnIndex, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- SMIPtr pSmi = SMIPTR(pScrn);
- Bool ret;
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ Bool ret;
- ENTER_PROC("SMI_EnterVT");
+ ENTER_PROC("SMI_EnterVT");
- /* Enable MMIO and map memory */
- SMI_MapMem(pScrn);
- SMI_Save(pScrn);
+ /* Enable MMIO and map memory */
+ SMI_MapMem(pScrn);
+ SMI_Save(pScrn);
- /* #670 */
- if (pSmi->shadowFB)
- {
- pSmi->FBOffset = pSmi->savedFBOffset;
- pSmi->FBReserved = pSmi->savedFBReserved;
- }
+ /* #670 */
+ if (pSmi->shadowFB) {
+ pSmi->FBOffset = pSmi->savedFBOffset;
+ pSmi->FBReserved = pSmi->savedFBReserved;
+ }
- ret = SMI_ModeInit(pScrn, pScrn->currentMode);
+ ret = SMI_ModeInit(pScrn, pScrn->currentMode);
- /* #670 */
- if (ret && pSmi->shadowFB)
- {
- BoxRec box;
-
- /* #920 */
- if (pSmi->paletteBuffer)
- {
- int i;
-
- VGAOUT8(pSmi, VGA_DAC_WRITE_ADDR, 0);
- for(i = 0; i < 256 * 3; i++)
- {
- VGAOUT8(pSmi, VGA_DAC_DATA, pSmi->paletteBuffer[i]);
- }
- xfree(pSmi->paletteBuffer);
- pSmi->paletteBuffer = NULL;
- }
+ /* #670 */
+ if (ret && pSmi->shadowFB) {
+ BoxRec box;
- if (pSmi->pSaveBuffer)
- {
- memcpy(pSmi->FBBase, pSmi->pSaveBuffer, pSmi->saveBufferSize);
- xfree(pSmi->pSaveBuffer);
- pSmi->pSaveBuffer = NULL;
- }
+ /* #920 */
+ if (pSmi->paletteBuffer) {
+ int i;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pScrn->virtualY;
- box.y2 = pScrn->virtualX;
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
- SMI_RefreshArea730(pScrn, 1, &box);
- }
- else
- {
- SMI_RefreshArea(pScrn, 1, &box);
- }
+ VGAOUT8(pSmi, VGA_DAC_WRITE_ADDR, 0);
+ for (i = 0; i < 256 * 3; i++) {
+ VGAOUT8(pSmi, VGA_DAC_DATA, pSmi->paletteBuffer[i]);
+ }
+ xfree(pSmi->paletteBuffer);
+ pSmi->paletteBuffer = NULL;
}
- /* Reset the grapics engine */
- if (!pSmi->NoAccel)
- SMI_EngineReset(pScrn);
+ if (pSmi->pSaveBuffer) {
+ memcpy(pSmi->FBBase, pSmi->pSaveBuffer, pSmi->saveBufferSize);
+ xfree(pSmi->pSaveBuffer);
+ pSmi->pSaveBuffer = NULL;
+ }
+
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = pScrn->virtualY;
+ box.y2 = pScrn->virtualX;
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
+ SMI_RefreshArea730(pScrn, 1, &box);
+ } else {
+ SMI_RefreshArea(pScrn, 1, &box);
+ }
+ }
- LEAVE_PROC("SMI_EnterVT");
- return(ret);
+ /* Reset the grapics engine */
+ if (!pSmi->NoAccel)
+ SMI_EngineReset(pScrn);
+
+ LEAVE_PROC("SMI_EnterVT");
+ return ret;
}
/*
@@ -1319,48 +1247,43 @@ SMI_EnterVT(int scrnIndex, int flags)
static void
SMI_LeaveVT(int scrnIndex, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- SMIPtr pSmi = SMIPTR(pScrn);
- vgaRegPtr vgaSavePtr = &hwp->SavedReg;
- SMIRegPtr SMISavePtr = &pSmi->SavedReg;
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
+ vgaRegPtr vgaSavePtr = &hwp->SavedReg;
+ SMIRegPtr SMISavePtr = &pSmi->SavedReg;
- ENTER_PROC("SMI_LeaveVT");
+ ENTER_PROC("SMI_LeaveVT");
- /* #670 */
- if (pSmi->shadowFB)
- {
- pSmi->pSaveBuffer = xnfalloc(pSmi->saveBufferSize);
- if (pSmi->pSaveBuffer)
- {
- memcpy(pSmi->pSaveBuffer, pSmi->FBBase, pSmi->saveBufferSize);
- }
+ /* #670 */
+ if (pSmi->shadowFB) {
+ pSmi->pSaveBuffer = xnfalloc(pSmi->saveBufferSize);
+ if (pSmi->pSaveBuffer) {
+ memcpy(pSmi->pSaveBuffer, pSmi->FBBase, pSmi->saveBufferSize);
+ }
+
+ pSmi->savedFBOffset = pSmi->FBOffset;
+ pSmi->savedFBReserved = pSmi->FBReserved;
+
+ /* #920 */
+ if (pSmi->Bpp == 1) {
+ pSmi->paletteBuffer = xnfalloc(256 * 3);
+ if (pSmi->paletteBuffer) {
+ int i;
- pSmi->savedFBOffset = pSmi->FBOffset;
- pSmi->savedFBReserved = pSmi->FBReserved;
-
- /* #920 */
- if (pSmi->Bpp == 1)
- {
- pSmi->paletteBuffer = xnfalloc(256 * 3);
- if (pSmi->paletteBuffer)
- {
- int i;
-
- VGAOUT8(pSmi, VGA_DAC_READ_ADDR, 0);
- for (i = 0; i < 256 * 3; i++)
- {
- pSmi->paletteBuffer[i] = VGAIN8(pSmi, VGA_DAC_DATA);
- }
- }
+ VGAOUT8(pSmi, VGA_DAC_READ_ADDR, 0);
+ for (i = 0; i < 256 * 3; i++) {
+ pSmi->paletteBuffer[i] = VGAIN8(pSmi, VGA_DAC_DATA);
}
+ }
}
+ }
- memset(pSmi->FBBase, 0, 256 * 1024); /* #689 */
- SMI_WriteMode(pScrn, vgaSavePtr, SMISavePtr);
- SMI_UnmapMem(pScrn);
+ memset(pSmi->FBBase, 0, 256 * 1024); /* #689 */
+ SMI_WriteMode(pScrn, vgaSavePtr, SMISavePtr);
+ SMI_UnmapMem(pScrn);
- LEAVE_PROC("SMI_LeaveVT");
+ LEAVE_PROC("SMI_LeaveVT");
}
/*
@@ -1372,172 +1295,159 @@ SMI_LeaveVT(int scrnIndex, int flags)
static void
SMI_Save(ScrnInfoPtr pScrn)
{
- int i;
- CARD32 offset;
-
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- vgaRegPtr vgaSavePtr = &hwp->SavedReg;
- SMIPtr pSmi = SMIPTR(pScrn);
- SMIRegPtr save = &pSmi->SavedReg;
-
- int vgaIOBase = hwp->IOBase;
- int vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET;
- int vgaCRData = vgaIOBase + VGA_CRTC_DATA_OFFSET;
-
- ENTER_PROC("SMI_Save");
-
- /* Save the standard VGA registers */
- vgaHWSave(pScrn, vgaSavePtr, VGA_SR_ALL);
- save->smiDACMask = VGAIN8(pSmi, VGA_DAC_MASK);
- VGAOUT8(pSmi, VGA_DAC_READ_ADDR, 0);
- for (i = 0; i < 256; i++)
- {
- save->smiDacRegs[i][0] = VGAIN8(pSmi, VGA_DAC_DATA);
- save->smiDacRegs[i][1] = VGAIN8(pSmi, VGA_DAC_DATA);
- save->smiDacRegs[i][2] = VGAIN8(pSmi, VGA_DAC_DATA);
- }
- for (i = 0, offset = 2; i < 8192; i++, offset += 8)
- {
- save->smiFont[i] = *(pSmi->FBBase + offset);
- }
-
- /* Now we save all the extended registers we need. */
- save->SR17 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x17);
- save->SR18 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18);
- save->SR21 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
- save->SR31 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31);
- save->SR32 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x32);
- save->SR6A = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A);
- save->SR6B = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B);
- save->SR81 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81);
- save->SRA0 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0xA0);
-
- if (pSmi->Dualhead) {
- /* dualhead stuff */
- save->SR22 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x22);
- save->SR40 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x40);
- save->SR41 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x41);
- save->SR42 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x42);
- save->SR43 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x43);
- save->SR44 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x44);
- save->SR45 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x45);
- save->SR48 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x48);
- save->SR49 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x49);
- save->SR4A = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x4A);
- save->SR4B = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x4B);
- save->SR4C = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x4C);
- /* PLL stuff */
- save->SR68 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x68);
- save->SR69 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x69);
- save->SR6C = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6C);
- save->SR6D = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6D);
- save->SR6E = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6E);
- save->SR6F = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6F);
- }
-
- if (SMI_LYNXM_SERIES(pSmi->Chipset))
- {
- /* Save primary registers */
- save->CR90[14] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E);
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E,
- save->CR90[14] & ~0x20);
-
- for (i = 0; i < 16; i++)
- {
- save->CR90[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x90 + i);
- }
- save->CR33 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33);
- save->CR3A = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A);
- for (i = 0; i < 14; i++)
- {
- save->CR40[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i);
- }
-
- /* Save secondary registers */
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, save->CR90[14] | 0x20);
- save->CR33_2 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33);
- for (i = 0; i < 14; i++)
- {
- save->CR40_2[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData,
- 0x40 + i);
- }
- save->CR9F_2 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9F);
-
- /* Save common registers */
- for (i = 0; i < 14; i++)
- {
- save->CRA0[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0xA0 + i);
- }
-
- /* PDR#1069 */
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, save->CR90[14]);
- }
- else
- {
- save->CR33 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33);
- save->CR3A = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A);
- for (i = 0; i < 14; i++)
- {
- save->CR40[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i);
- }
- }
-
- /* CZ 2.11.2001: for gamma correction (TODO: other chipsets?) */
- if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR)) {
- save->CCR66 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66);
- }
- /* end CZ */
-
- save->DPR10 = READ_DPR(pSmi, 0x10);
- save->DPR1C = READ_DPR(pSmi, 0x1C);
- save->DPR20 = READ_DPR(pSmi, 0x20);
- save->DPR24 = READ_DPR(pSmi, 0x24);
- save->DPR28 = READ_DPR(pSmi, 0x28);
- save->DPR2C = READ_DPR(pSmi, 0x2C);
- save->DPR30 = READ_DPR(pSmi, 0x30);
- save->DPR3C = READ_DPR(pSmi, 0x3C);
- save->DPR40 = READ_DPR(pSmi, 0x40);
- save->DPR44 = READ_DPR(pSmi, 0x44);
-
- save->VPR00 = READ_VPR(pSmi, 0x00);
- save->VPR0C = READ_VPR(pSmi, 0x0C);
- save->VPR10 = READ_VPR(pSmi, 0x10);
-
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
- save->FPR00_ = READ_FPR(pSmi, FPR00);
- save->FPR0C_ = READ_FPR(pSmi, FPR0C);
- save->FPR10_ = READ_FPR(pSmi, FPR10);
- }
-
- save->CPR00 = READ_CPR(pSmi, 0x00);
-
- if (!pSmi->ModeStructInit)
- {
- /* XXX Should check the return value of vgaHWCopyReg() */
- vgaHWCopyReg(&hwp->ModeReg, vgaSavePtr);
- memcpy(&pSmi->ModeReg, save, sizeof(SMIRegRec));
- pSmi->ModeStructInit = TRUE;
- }
-
- if (pSmi->useBIOS && (pSmi->pInt10 != NULL))
- {
- pSmi->pInt10->num = 0x10;
- pSmi->pInt10->ax = 0x0F00;
- xf86ExecX86int10(pSmi->pInt10);
- save->mode = pSmi->pInt10->ax & 0x007F;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Current mode 0x%02X.\n",
- save->mode);
- }
-
- if (xf86GetVerbosity() > 1)
- {
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
- "Saved current video mode. Register dump:\n");
- SMI_PrintRegs(pScrn);
- }
+ int i;
+ CARD32 offset;
+
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ vgaRegPtr vgaSavePtr = &hwp->SavedReg;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ SMIRegPtr save = &pSmi->SavedReg;
+
+ int vgaIOBase = hwp->IOBase;
+ int vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET;
+ int vgaCRData = vgaIOBase + VGA_CRTC_DATA_OFFSET;
+
+ ENTER_PROC("SMI_Save");
+
+ /* Save the standard VGA registers */
+ vgaHWSave(pScrn, vgaSavePtr, VGA_SR_ALL);
+ save->smiDACMask = VGAIN8(pSmi, VGA_DAC_MASK);
+ VGAOUT8(pSmi, VGA_DAC_READ_ADDR, 0);
+ for (i = 0; i < 256; i++) {
+ save->smiDacRegs[i][0] = VGAIN8(pSmi, VGA_DAC_DATA);
+ save->smiDacRegs[i][1] = VGAIN8(pSmi, VGA_DAC_DATA);
+ save->smiDacRegs[i][2] = VGAIN8(pSmi, VGA_DAC_DATA);
+ }
+ for (i = 0, offset = 2; i < 8192; i++, offset += 8) {
+ save->smiFont[i] = *(pSmi->FBBase + offset);
+ }
+
+ /* Now we save all the extended registers we need. */
+ save->SR17 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x17);
+ save->SR18 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18);
+ save->SR21 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
+ save->SR31 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31);
+ save->SR32 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x32);
+ save->SR6A = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A);
+ save->SR6B = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B);
+ save->SR81 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81);
+ save->SRA0 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0xA0);
+
+ /* vclk1 */
+ save->SR6C = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6C);
+ save->SR6D = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6D);
+ /* vclk1 control */
+ save->SR68 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x68);
+
+ if (pSmi->Dualhead) {
+ /* dualhead stuff */
+ save->SR22 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x22);
+ save->SR40 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x40);
+ save->SR41 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x41);
+ save->SR42 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x42);
+ save->SR43 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x43);
+ save->SR44 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x44);
+ save->SR45 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x45);
+ save->SR48 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x48);
+ save->SR49 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x49);
+ save->SR4A = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x4A);
+ save->SR4B = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x4B);
+ save->SR4C = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x4C);
+ /* PLL2 stuff */
+ save->SR69 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x69);
+ save->SR6E = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6E);
+ save->SR6F = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6F);
+ }
+
+ if (SMI_LYNXM_SERIES(pSmi->Chipset)) {
+ /* Save primary registers */
+ save->CR90[14] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E);
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, save->CR90[14] & ~0x20);
+
+ for (i = 0; i < 16; i++) {
+ save->CR90[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x90 + i);
+ }
+ save->CR33 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33);
+ save->CR3A = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A);
+ for (i = 0; i < 14; i++) {
+ save->CR40[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i);
+ }
+
+ /* Save secondary registers */
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, save->CR90[14] | 0x20);
+ save->CR33_2 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33);
+ for (i = 0; i < 14; i++) {
+ save->CR40_2[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i);
+ }
+ save->CR9F_2 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9F);
+
+ /* Save common registers */
+ for (i = 0; i < 14; i++) {
+ save->CRA0[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0xA0 + i);
+ }
+
+ /* PDR#1069 */
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, save->CR90[14]);
+ } else {
+ save->CR33 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33);
+ save->CR3A = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A);
+ for (i = 0; i < 14; i++) {
+ save->CR40[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i);
+ }
+ }
+
+ /* CZ 2.11.2001: for gamma correction (TODO: other chipsets?) */
+ if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR)) {
+ save->CCR66 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66);
+ }
+ /* end CZ */
+
+ save->DPR10 = READ_DPR(pSmi, 0x10);
+ save->DPR1C = READ_DPR(pSmi, 0x1C);
+ save->DPR20 = READ_DPR(pSmi, 0x20);
+ save->DPR24 = READ_DPR(pSmi, 0x24);
+ save->DPR28 = READ_DPR(pSmi, 0x28);
+ save->DPR2C = READ_DPR(pSmi, 0x2C);
+ save->DPR30 = READ_DPR(pSmi, 0x30);
+ save->DPR3C = READ_DPR(pSmi, 0x3C);
+ save->DPR40 = READ_DPR(pSmi, 0x40);
+ save->DPR44 = READ_DPR(pSmi, 0x44);
+
+ save->VPR00 = READ_VPR(pSmi, 0x00);
+ save->VPR0C = READ_VPR(pSmi, 0x0C);
+ save->VPR10 = READ_VPR(pSmi, 0x10);
+
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
+ save->FPR00_ = READ_FPR(pSmi, FPR00);
+ save->FPR0C_ = READ_FPR(pSmi, FPR0C);
+ save->FPR10_ = READ_FPR(pSmi, FPR10);
+ }
+
+ save->CPR00 = READ_CPR(pSmi, 0x00);
+
+ if (!pSmi->ModeStructInit) {
+ /* XXX Should check the return value of vgaHWCopyReg() */
+ vgaHWCopyReg(&hwp->ModeReg, vgaSavePtr);
+ memcpy(&pSmi->ModeReg, save, sizeof(SMIRegRec));
+ pSmi->ModeStructInit = TRUE;
+ }
+
+ if (pSmi->useBIOS && (pSmi->pInt10 != NULL)) {
+ pSmi->pInt10->num = 0x10;
+ pSmi->pInt10->ax = 0x0F00;
+ xf86ExecX86int10(pSmi->pInt10);
+ save->mode = pSmi->pInt10->ax & 0x007F;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Current mode 0x%02X.\n",
+ save->mode);
+ }
+
+ if (xf86GetVerbosity() > 1) {
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
+ "Saved current video mode. Register dump:\n");
+ SMI_PrintRegs(pScrn);
+ }
- LEAVE_PROC("SMI_Save");
+ LEAVE_PROC("SMI_Save");
}
/*
@@ -1548,151 +1458,135 @@ SMI_Save(ScrnInfoPtr pScrn)
static void
SMI_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore)
{
- int i;
- CARD8 tmp;
- CARD32 offset;
+ int i;
+ CARD8 tmp;
+ CARD32 offset;
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- SMIPtr pSmi = SMIPTR(pScrn);
- int vgaIOBase = hwp->IOBase;
- int vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET;
- int vgaCRData = vgaIOBase + VGA_CRTC_DATA_OFFSET;
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int vgaIOBase = hwp->IOBase;
+ int vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET;
+ int vgaCRData = vgaIOBase + VGA_CRTC_DATA_OFFSET;
- ENTER_PROC("SMI_WriteMode");
+ ENTER_PROC("SMI_WriteMode");
- vgaHWProtect(pScrn, TRUE);
+ vgaHWProtect(pScrn, TRUE);
- /* Wait for engine to become idle */
+ /* Wait for engine to become idle */
+ if (pSmi->IsSwitching)
WaitIdle();
- if (pSmi->useBIOS && (pSmi->pInt10 != NULL)
- && (restore->mode != 0))
- {
- pSmi->pInt10->num = 0x10;
- pSmi->pInt10->ax = restore->mode | 0x80;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting mode 0x%02X\n",
- restore->mode);
- xf86ExecX86int10(pSmi->pInt10);
+ if (pSmi->useBIOS && (pSmi->pInt10 != NULL) && (restore->mode != 0)) {
+ pSmi->pInt10->num = 0x10;
+ pSmi->pInt10->ax = restore->mode | 0x80;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting mode 0x%02X\n",
+ restore->mode);
+ xf86ExecX86int10(pSmi->pInt10);
- /* Enable linear mode. */
- outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
- tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
- outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x01);
+ /* Enable linear mode. */
+ outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
+ tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
+ outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x01);
+
+ /* Enable DPR/VPR registers. */
+ tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp & ~0x03);
+ } else {
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x17, restore->SR17);
+ tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18) & ~0x1F;
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18, tmp |
+ (restore->SR18 & 0x1F));
+ tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp & ~0x03);
+ tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31) & ~0xC0;
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31, tmp |
+ (restore->SR31 & 0xC0));
+ tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x32) & ~0x07;
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x32, tmp |
+ (restore->SR32 & 0x07));
+ if (restore->SR6B != 0xFF) {
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A, restore->SR6A);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B, restore->SR6B);
+ }
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, restore->SR81);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0xA0, restore->SRA0);
+
+ /* Restore the standard VGA registers */
+ vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_ALL);
+ if (restore->smiDACMask) {
+ VGAOUT8(pSmi, VGA_DAC_MASK, restore->smiDACMask);
+ } else {
+ VGAOUT8(pSmi, VGA_DAC_MASK, 0xFF);
+ }
+ VGAOUT8(pSmi, VGA_DAC_WRITE_ADDR, 0);
+ for (i = 0; i < 256; i++) {
+ VGAOUT8(pSmi, VGA_DAC_DATA, restore->smiDacRegs[i][0]);
+ VGAOUT8(pSmi, VGA_DAC_DATA, restore->smiDacRegs[i][1]);
+ VGAOUT8(pSmi, VGA_DAC_DATA, restore->smiDacRegs[i][2]);
+ }
+ for (i = 0, offset = 2; i < 8192; i++, offset += 8) {
+ *(pSmi->FBBase + offset) = restore->smiFont[i];
+ }
+
+ if (SMI_LYNXM_SERIES(pSmi->Chipset)) {
+ /* Restore secondary registers */
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E,
+ restore->CR90[14] | 0x20);
+
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33, restore->CR33_2);
+ for (i = 0; i < 14; i++) {
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i,
+ restore->CR40_2[i]);
+ }
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9F, restore->CR9F_2);
- /* Enable DPR/VPR registers. */
- tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp & ~0x03);
- }
- else
- {
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x17, restore->SR17);
- tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18) & ~0x1F;
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18, tmp |
- (restore->SR18 & 0x1F));
- tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp & ~0x03);
- tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31) & ~0xC0;
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31, tmp |
- (restore->SR31 & 0xC0));
- tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x32) & ~0x07;
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x32, tmp |
- (restore->SR32 & 0x07));
- if (restore->SR6B != 0xFF)
- {
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A,
- restore->SR6A);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B,
- restore->SR6B);
- }
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, restore->SR81);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0xA0, restore->SRA0);
-
- /* Restore the standard VGA registers */
- vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_ALL);
- if (restore->smiDACMask)
- {
- VGAOUT8(pSmi, VGA_DAC_MASK, restore->smiDACMask);
- }
- else
- {
- VGAOUT8(pSmi, VGA_DAC_MASK, 0xFF);
- }
- VGAOUT8(pSmi, VGA_DAC_WRITE_ADDR, 0);
- for (i = 0; i < 256; i++)
- {
- VGAOUT8(pSmi, VGA_DAC_DATA, restore->smiDacRegs[i][0]);
- VGAOUT8(pSmi, VGA_DAC_DATA, restore->smiDacRegs[i][1]);
- VGAOUT8(pSmi, VGA_DAC_DATA, restore->smiDacRegs[i][2]);
- }
- for (i = 0, offset = 2; i < 8192; i++, offset += 8)
- {
- *(pSmi->FBBase + offset) = restore->smiFont[i];
- }
+ /* Restore primary registers */
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E,
+ restore->CR90[14] & ~0x20);
- if (SMI_LYNXM_SERIES(pSmi->Chipset))
- {
- /* Restore secondary registers */
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E,
- restore->CR90[14] | 0x20);
-
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33, restore->CR33_2);
- for (i = 0; i < 14; i++)
- {
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i,
- restore->CR40_2[i]);
- }
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9F, restore->CR9F_2);
-
- /* Restore primary registers */
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E,
- restore->CR90[14] & ~0x20);
-
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33, restore->CR33);
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A, restore->CR3A);
- for (i = 0; i < 14; i++)
- {
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i,
- restore->CR40[i]);
- }
- for (i = 0; i < 16; i++)
- {
- if (i != 14)
- {
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x90 + i,
- restore->CR90[i]);
- }
- }
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, restore->CR90[14]);
-
- /* Restore common registers */
- for (i = 0; i < 14; i++)
- {
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0xA0 + i,
- restore->CRA0[i]);
- }
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33, restore->CR33);
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A, restore->CR3A);
+ for (i = 0; i < 14; i++) {
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i,
+ restore->CR40[i]);
+ }
+ for (i = 0; i < 16; i++) {
+ if (i != 14) {
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x90 + i,
+ restore->CR90[i]);
}
+ }
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, restore->CR90[14]);
- /* Restore the standard VGA registers */
- if (xf86IsPrimaryPci(pSmi->PciInfo)) {
- vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_CMAP
- | VGA_SR_FONTS);
- }
-
- if (restore->modeInit)
- vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_ALL);
-
- if (!SMI_LYNXM_SERIES(pSmi->Chipset))
- {
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33, restore->CR33);
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A, restore->CR3A);
- for (i = 0; i < 14; i++)
- {
- VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i,
- restore->CR40[i]);
- }
- }
+ /* Restore common registers */
+ for (i = 0; i < 14; i++) {
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0xA0 + i,
+ restore->CRA0[i]);
+ }
+ }
+
+ /* Restore the standard VGA registers */
+ if (xf86IsPrimaryPci(pSmi->PciInfo)) {
+ vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_CMAP | VGA_SR_FONTS);
+ }
+
+ if (restore->modeInit)
+ vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_ALL);
+
+ if (!SMI_LYNXM_SERIES(pSmi->Chipset)) {
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33, restore->CR33);
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A, restore->CR3A);
+ for (i = 0; i < 14; i++) {
+ VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i,
+ restore->CR40[i]);
+ }
}
+ /* vclk1 */
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x68, restore->SR68);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6C, restore->SR6C);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6D, restore->SR6D);
+
if (pSmi->Dualhead) {
/* TFT panel uses FIFO1, DSTN panel uses FIFO1 for upper panel and
@@ -1700,12 +1594,9 @@ SMI_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore)
* -- AGD
*/
- /* PLL regs */
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x68, restore->SR68);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x69, restore->SR69);
+ /* PLL2 regs */
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6C, restore->SR6C);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6D, restore->SR6D);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x69, restore->SR69);
VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6E, restore->SR6E);
VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6F, restore->SR6F);
@@ -1739,377 +1630,359 @@ SMI_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore)
VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33, restore->CR33);
}
+ }
- /* CZ 2.11.2001: for gamma correction (TODO: other chipsets?) */
- if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR)) {
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66, restore->CCR66);
- }
- /* end CZ */
+ /* CZ 2.11.2001: for gamma correction (TODO: other chipsets?) */
+ if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR)) {
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66, restore->CCR66);
+ }
+ /* end CZ */
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, 0x00);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, 0x00);
- /* Reset the graphics engine */
- WRITE_DPR(pSmi, 0x10, restore->DPR10);
- WRITE_DPR(pSmi, 0x1C, restore->DPR1C);
- WRITE_DPR(pSmi, 0x20, restore->DPR20);
- WRITE_DPR(pSmi, 0x24, restore->DPR24);
- WRITE_DPR(pSmi, 0x28, restore->DPR28);
- WRITE_DPR(pSmi, 0x2C, restore->DPR2C);
- WRITE_DPR(pSmi, 0x30, restore->DPR30);
- WRITE_DPR(pSmi, 0x3C, restore->DPR3C);
- WRITE_DPR(pSmi, 0x40, restore->DPR40);
- WRITE_DPR(pSmi, 0x44, restore->DPR44);
+ /* Reset the graphics engine */
+ WRITE_DPR(pSmi, 0x10, restore->DPR10);
+ WRITE_DPR(pSmi, 0x1C, restore->DPR1C);
+ WRITE_DPR(pSmi, 0x20, restore->DPR20);
+ WRITE_DPR(pSmi, 0x24, restore->DPR24);
+ WRITE_DPR(pSmi, 0x28, restore->DPR28);
+ WRITE_DPR(pSmi, 0x2C, restore->DPR2C);
+ WRITE_DPR(pSmi, 0x30, restore->DPR30);
+ WRITE_DPR(pSmi, 0x3C, restore->DPR3C);
+ WRITE_DPR(pSmi, 0x40, restore->DPR40);
+ WRITE_DPR(pSmi, 0x44, restore->DPR44);
- /* write video controller regs */
- WRITE_VPR(pSmi, 0x00, restore->VPR00);
- WRITE_VPR(pSmi, 0x0C, restore->VPR0C);
- WRITE_VPR(pSmi, 0x10, restore->VPR10);
+ /* write video controller regs */
+ WRITE_VPR(pSmi, 0x00, restore->VPR00);
+ WRITE_VPR(pSmi, 0x0C, restore->VPR0C);
+ WRITE_VPR(pSmi, 0x10, restore->VPR10);
- if(pSmi->Chipset == SMI_COUGAR3DR)
- {
- WRITE_FPR(pSmi, FPR00, restore->FPR00_);
- WRITE_FPR(pSmi, FPR0C, restore->FPR0C_);
- WRITE_FPR(pSmi, FPR10, restore->FPR10_);
- }
+ if(pSmi->Chipset == SMI_COUGAR3DR) {
+ WRITE_FPR(pSmi, FPR00, restore->FPR00_);
+ WRITE_FPR(pSmi, FPR0C, restore->FPR0C_);
+ WRITE_FPR(pSmi, FPR10, restore->FPR10_);
+ }
- WRITE_CPR(pSmi, 0x00, restore->CPR00);
+ WRITE_CPR(pSmi, 0x00, restore->CPR00);
- if (xf86GetVerbosity() > 1)
- {
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
- "Done restoring mode. Register dump:\n");
- SMI_PrintRegs(pScrn);
- }
+ if (xf86GetVerbosity() > 1) {
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
+ "Done restoring mode. Register dump:\n");
+ SMI_PrintRegs(pScrn);
+ }
- vgaHWProtect(pScrn, FALSE);
+ vgaHWProtect(pScrn, FALSE);
- LEAVE_PROC("SMI_WriteMode");
+ LEAVE_PROC("SMI_WriteMode");
}
static void
SMI_DetectPanelSize(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- /* panel size detection ... requires BIOS call on 730 hardware */
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
- if (pSmi->pInt10 != NULL)
- {
- pSmi->pInt10->num = 0x10;
- pSmi->pInt10->ax = 0x5F00;
- pSmi->pInt10->bx = 0;
- pSmi->pInt10->cx = 0;
- pSmi->pInt10->dx = 0;
- xf86ExecX86int10(pSmi->pInt10);
- if (pSmi->pInt10->ax == 0x005F)
- {
- switch (pSmi->pInt10->cx & 0x0F)
- {
- case PANEL_640x480:
- pSmi->lcdWidth = 640;
- pSmi->lcdHeight = 480;
- break;
-
- case PANEL_800x600:
- pSmi->lcdWidth = 800;
- pSmi->lcdHeight = 600;
- break;
-
- case PANEL_1024x768:
- pSmi->lcdWidth = 1024;
- pSmi->lcdHeight = 768;
- break;
-
- case PANEL_1280x1024:
- pSmi->lcdWidth = 1280;
- pSmi->lcdHeight = 1024;
- break;
-
- case PANEL_1600x1200:
- pSmi->lcdWidth = 1600;
- pSmi->lcdHeight = 1200;
- break;
-
- case PANEL_1400x1050:
- pSmi->lcdWidth = 1400;
- pSmi->lcdHeight = 1050;
- break;
- }
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected panel size via BIOS: %d x %d\n",
- pSmi->lcdWidth, pSmi->lcdHeight);
- }
- else
- {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BIOS error during 730 panel detection!\n");
- pSmi->lcdWidth = pScrn->virtualX;
- pSmi->lcdHeight = pScrn->virtualY;
- }
- }
- else
- {
- /* int10 support isn't setup on the second call to this function,
- so if this is the second call, don't do detection again */
- if (pSmi->lcd == 0)
- {
- /* If we get here, int10 support is not loaded or not working */
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No BIOS support for 730 panel detection!\n");
- pSmi->lcdWidth = pScrn->virtualX;
- pSmi->lcdHeight = pScrn->virtualY;
- }
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ /* panel size detection ... requires BIOS call on 730 hardware */
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
+ if (pSmi->pInt10 != NULL) {
+ pSmi->pInt10->num = 0x10;
+ pSmi->pInt10->ax = 0x5F00;
+ pSmi->pInt10->bx = 0;
+ pSmi->pInt10->cx = 0;
+ pSmi->pInt10->dx = 0;
+ xf86ExecX86int10(pSmi->pInt10);
+ if (pSmi->pInt10->ax == 0x005F) {
+ switch (pSmi->pInt10->cx & 0x0F) {
+ case PANEL_640x480:
+ pSmi->lcdWidth = 640;
+ pSmi->lcdHeight = 480;
+ break;
+ case PANEL_800x600:
+ pSmi->lcdWidth = 800;
+ pSmi->lcdHeight = 600;
+ break;
+ case PANEL_1024x768:
+ pSmi->lcdWidth = 1024;
+ pSmi->lcdHeight = 768;
+ break;
+ case PANEL_1280x1024:
+ pSmi->lcdWidth = 1280;
+ pSmi->lcdHeight = 1024;
+ break;
+ case PANEL_1600x1200:
+ pSmi->lcdWidth = 1600;
+ pSmi->lcdHeight = 1200;
+ break;
+ case PANEL_1400x1050:
+ pSmi->lcdWidth = 1400;
+ pSmi->lcdHeight = 1050;
+ break;
}
-
- /* Set this to indicate that we've done the detection */
- pSmi->lcd = 1;
- }
- else /* panel size detection for hardware other than 730 */
- {
- pSmi->lcd = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31) & 0x01;
- if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x01)
- {
- pSmi->lcd <<= 1;
- }
- switch (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x0C)
- {
- case 0x00:
- pSmi->lcdWidth = 640;
- pSmi->lcdHeight = 480;
- break;
-
- case 0x04:
- pSmi->lcdWidth = 800;
- pSmi->lcdHeight = 600;
- break;
-
- case 0x08:
- if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x74) & 0x02)
- {
- pSmi->lcdWidth = 1024;
- pSmi->lcdHeight = 600;
- }
- else
- {
- pSmi->lcdWidth = 1024;
- pSmi->lcdHeight = 768;
- }
- break;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected panel size via BIOS: %d x %d\n",
+ pSmi->lcdWidth, pSmi->lcdHeight);
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BIOS error during 730 panel detection!\n");
+ pSmi->lcdWidth = pScrn->virtualX;
+ pSmi->lcdHeight = pScrn->virtualY;
+ }
+ } else {
+ /* int10 support isn't setup on the second call to this function,
+ so if this is the second call, don't do detection again */
+ if (pSmi->lcd == 0) {
+ /* If we get here, int10 support is not loaded or not working */
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No BIOS support for 730 panel detection!\n");
+ pSmi->lcdWidth = pScrn->virtualX;
+ pSmi->lcdHeight = pScrn->virtualY;
+ }
+ }
+
+ /* Set this to indicate that we've done the detection */
+ pSmi->lcd = 1;
+ } else {
+ /* panel size detection for hardware other than 730 */
+ pSmi->lcd = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31) & 0x01;
- case 0x0C:
- pSmi->lcdWidth = 1280;
- pSmi->lcdHeight = 1024;
- break;
- }
+ if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x01) {
+ pSmi->lcd <<= 1;
+ }
+ switch (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x0C) {
+ case 0x00:
+ pSmi->lcdWidth = 640;
+ pSmi->lcdHeight = 480;
+ break;
+ case 0x04:
+ pSmi->lcdWidth = 800;
+ pSmi->lcdHeight = 600;
+ break;
+ case 0x08:
+ if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x74) & 0x02) {
+ pSmi->lcdWidth = 1024;
+ pSmi->lcdHeight = 600;
+ } else {
+ pSmi->lcdWidth = 1024;
+ pSmi->lcdHeight = 768;
+ }
+ break;
+ case 0x0C:
+ pSmi->lcdWidth = 1280;
+ pSmi->lcdHeight = 1024;
+ break;
}
+ }
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s Panel Size = %dx%d\n",
- (pSmi->lcd == 0) ? "OFF" : (pSmi->lcd == 1) ? "TFT" : "DSTN",
- pSmi->lcdWidth, pSmi->lcdHeight);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s Panel Size = %dx%d\n",
+ (pSmi->lcd == 0) ? "OFF" : (pSmi->lcd == 1) ? "TFT" : "DSTN",
+ pSmi->lcdWidth, pSmi->lcdHeight);
}
static Bool
SMI_MapMem(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- vgaHWPtr hwp;
- CARD32 memBase;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ vgaHWPtr hwp;
+ CARD32 memBase;
+
+ ENTER_PROC("SMI_MapMem");
+
+ /* Map the Lynx register space */
+ switch (pSmi->Chipset) {
+ default:
+ memBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM) + 0x400000;
+ pSmi->MapSize = 0x10000;
+ break;
+ case SMI_COUGAR3DR:
+ memBase = PCI_REGION_BASE(pSmi->PciInfo, 1, REGION_MEM);
+ pSmi->MapSize = 0x200000;
+ break;
+ case SMI_LYNX3D:
+ memBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM) + 0x680000;
+ pSmi->MapSize = 0x180000;
+ break;
+ case SMI_LYNXEM:
+ case SMI_LYNXEMplus:
+ memBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM) + 0x400000;
+ pSmi->MapSize = 0x400000;
+ break;
+ case SMI_LYNX3DM:
+ memBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM);
+ pSmi->MapSize = 0x200000;
+ break;
+ }
+#ifndef XSERVER_LIBPCIACCESS
+ pSmi->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pSmi->PciTag,
+ memBase, pSmi->MapSize);
+#else
+ {
+ void** result = (void**)&pSmi->MapBase;
+ int err = pci_device_map_range(pSmi->PciInfo,
+ memBase,
+ pSmi->MapSize,
+ PCI_DEV_MAP_FLAG_WRITABLE,
+ result);
+
+ if (err)
+ return FALSE;
+ }
+#endif
+ if (pSmi->MapBase == NULL) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: could not map "
+ "MMIO registers.\n");
+ LEAVE_PROC("SMI_MapMem");
+ return FALSE;
+ }
+
+ switch (pSmi->Chipset) {
+ default:
+ pSmi->DPRBase = pSmi->MapBase + 0x8000;
+ pSmi->VPRBase = pSmi->MapBase + 0xC000;
+ pSmi->CPRBase = pSmi->MapBase + 0xE000;
+ pSmi->IOBase = NULL;
+ pSmi->DataPortBase = pSmi->MapBase;
+ pSmi->DataPortSize = 0x8000;
+ break;
+ case SMI_COUGAR3DR:
+ pSmi->DPRBase = pSmi->MapBase + 0x000000;
+ pSmi->VPRBase = pSmi->MapBase + 0x000800;
+ pSmi->CPRBase = pSmi->MapBase + 0x001000;
+ pSmi->FPRBase = pSmi->MapBase + 0x005800;
+ pSmi->IOBase = pSmi->MapBase + 0x0C0000;
+ pSmi->DataPortBase = pSmi->MapBase + 0x100000;
+ pSmi->DataPortSize = 0x100000;
+ break;
+ case SMI_LYNX3D:
+ pSmi->DPRBase = pSmi->MapBase + 0x000000;
+ pSmi->VPRBase = pSmi->MapBase + 0x000800;
+ pSmi->CPRBase = pSmi->MapBase + 0x001000;
+ pSmi->IOBase = pSmi->MapBase + 0x040000;
+ pSmi->DataPortBase = pSmi->MapBase + 0x080000;
+ pSmi->DataPortSize = 0x100000;
+ break;
+ case SMI_LYNXEM:
+ case SMI_LYNXEMplus:
+ pSmi->DPRBase = pSmi->MapBase + 0x008000;
+ pSmi->VPRBase = pSmi->MapBase + 0x00C000;
+ pSmi->CPRBase = pSmi->MapBase + 0x00E000;
+ pSmi->IOBase = pSmi->MapBase + 0x300000;
+ pSmi->DataPortBase = pSmi->MapBase /*+ 0x100000*/;
+ pSmi->DataPortSize = 0x8000 /*0x200000*/;
+ break;
+ case SMI_LYNX3DM:
+ pSmi->DPRBase = pSmi->MapBase + 0x000000;
+ pSmi->VPRBase = pSmi->MapBase + 0x000800;
+ pSmi->CPRBase = pSmi->MapBase + 0x001000;
+ pSmi->IOBase = pSmi->MapBase + 0x0C0000;
+ pSmi->DataPortBase = pSmi->MapBase + 0x100000;
+ pSmi->DataPortSize = 0x100000;
+ break;
+ }
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
+ "Physical MMIO at 0x%08lX\n", (unsigned long)memBase);
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
+ "Logical MMIO at %p - %p\n", pSmi->MapBase,
+ pSmi->MapBase + pSmi->MapSize - 1);
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
+ "DPR=%p, VPR=%p, IOBase=%p\n",
+ pSmi->DPRBase, pSmi->VPRBase, pSmi->IOBase);
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
+ "DataPort=%p - %p\n", pSmi->DataPortBase,
+ pSmi->DataPortBase + pSmi->DataPortSize - 1);
+
+ pScrn->memPhysBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM);
+
+ SMI_EnableMmio(pScrn);
+
+ if (pSmi->videoRAMBytes) {
+ /* Map the frame buffer */
+ if (pSmi->Chipset == SMI_LYNX3DM)
+ pSmi->fbMapOffset = 0x200000;
+ else
+ pSmi->fbMapOffset = 0x0;
- ENTER_PROC("SMI_MapMem");
+ pSmi->FBOffset = 0;
- /* Map the Lynx register space */
- switch (pSmi->Chipset)
- {
- default:
- memBase = pSmi->PciInfo->memBase[0] + 0x400000;
- pSmi->MapSize = 0x10000;
- break;
-
- case SMI_COUGAR3DR:
- memBase = pSmi->PciInfo->memBase[1];
- pSmi->MapSize = 0x200000;
- break;
-
- case SMI_LYNX3D:
- memBase = pSmi->PciInfo->memBase[0] + 0x680000;
- pSmi->MapSize = 0x180000;
- break;
-
- case SMI_LYNXEM:
- case SMI_LYNXEMplus:
- memBase = pSmi->PciInfo->memBase[0] + 0x400000;
- pSmi->MapSize = 0x400000;
- break;
-
- case SMI_LYNX3DM:
- memBase = pSmi->PciInfo->memBase[0];
- pSmi->MapSize = 0x200000;
- break;
- }
- pSmi->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pSmi->PciTag,
- memBase, pSmi->MapSize);
-
- if (pSmi->MapBase == NULL)
- {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: could not map "
- "MMIO registers.\n");
- LEAVE_PROC("SMI_MapMem");
- return(FALSE);
- }
+ pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
- switch (pSmi->Chipset)
+#ifndef XSERVER_LIBPCIACCESS
+ pSmi->FBBase = xf86MapPciMem(pScrn->scrnIndex,
+ VIDMEM_FRAMEBUFFER,
+ pSmi->PciTag,
+ pScrn->memPhysBase + pSmi->fbMapOffset,
+ pSmi->videoRAMBytes);
+#else
{
- default:
- pSmi->DPRBase = pSmi->MapBase + 0x8000;
- pSmi->VPRBase = pSmi->MapBase + 0xC000;
- pSmi->CPRBase = pSmi->MapBase + 0xE000;
- pSmi->IOBase = NULL;
- pSmi->DataPortBase = pSmi->MapBase;
- pSmi->DataPortSize = 0x8000;
- break;
-
- case SMI_COUGAR3DR:
- pSmi->DPRBase = pSmi->MapBase + 0x000000;
- pSmi->VPRBase = pSmi->MapBase + 0x000800;
- pSmi->CPRBase = pSmi->MapBase + 0x001000;
- pSmi->FPRBase = pSmi->MapBase + 0x005800;
- pSmi->IOBase = pSmi->MapBase + 0x0C0000;
- pSmi->DataPortBase = pSmi->MapBase + 0x100000;
- pSmi->DataPortSize = 0x100000;
- break;
-
- case SMI_LYNX3D:
- pSmi->DPRBase = pSmi->MapBase + 0x000000;
- pSmi->VPRBase = pSmi->MapBase + 0x000800;
- pSmi->CPRBase = pSmi->MapBase + 0x001000;
- pSmi->IOBase = pSmi->MapBase + 0x040000;
- pSmi->DataPortBase = pSmi->MapBase + 0x080000;
- pSmi->DataPortSize = 0x100000;
- break;
-
- case SMI_LYNXEM:
- case SMI_LYNXEMplus:
- pSmi->DPRBase = pSmi->MapBase + 0x008000;
- pSmi->VPRBase = pSmi->MapBase + 0x00C000;
- pSmi->CPRBase = pSmi->MapBase + 0x00E000;
- pSmi->IOBase = pSmi->MapBase + 0x300000;
- pSmi->DataPortBase = pSmi->MapBase /*+ 0x100000*/;
- pSmi->DataPortSize = 0x8000 /*0x200000*/;
- break;
-
- case SMI_LYNX3DM:
- pSmi->DPRBase = pSmi->MapBase + 0x000000;
- pSmi->VPRBase = pSmi->MapBase + 0x000800;
- pSmi->CPRBase = pSmi->MapBase + 0x001000;
- pSmi->IOBase = pSmi->MapBase + 0x0C0000;
- pSmi->DataPortBase = pSmi->MapBase + 0x100000;
- pSmi->DataPortSize = 0x100000;
- break;
- }
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
- "Physical MMIO at 0x%08lX\n", (unsigned long)memBase);
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
- "Logical MMIO at %p - %p\n", pSmi->MapBase,
- pSmi->MapBase + pSmi->MapSize - 1);
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
- "DPR=%p, VPR=%p, IOBase=%p\n",
- pSmi->DPRBase, pSmi->VPRBase, pSmi->IOBase);
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
- "DataPort=%p - %p\n", pSmi->DataPortBase,
- pSmi->DataPortBase + pSmi->DataPortSize - 1);
-
- pScrn->memPhysBase = pSmi->PciInfo->memBase[0];
-
- SMI_EnableMmio(pScrn);
-
- if (pSmi->videoRAMBytes) {
-
- /* Map the frame buffer */
- if (pSmi->Chipset == SMI_LYNX3DM)
- pSmi->fbMapOffset = 0x200000;
- else
- pSmi->fbMapOffset = 0x0;
-
- pSmi->FBOffset = 0;
-
- pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
-
- pSmi->FBBase = xf86MapPciMem(pScrn->scrnIndex,
- VIDMEM_FRAMEBUFFER,
- pSmi->PciTag,
+ void** result = (void**)&pSmi->FBBase;
+ int err = pci_device_map_range(pSmi->PciInfo,
pScrn->memPhysBase + pSmi->fbMapOffset,
- pSmi->videoRAMBytes);
-
- if (pSmi->FBBase == NULL)
- {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: could not "
- "map framebuffer.\n");
- LEAVE_PROC("SMI_MapMem");
- return(FALSE);
- }
-
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
- "Physical frame buffer at 0x%08lX offset: 0x%08lX\n",
- pScrn->memPhysBase, pScrn->fbOffset);
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
- "Logical frame buffer at %p - %p\n", pSmi->FBBase,
- pSmi->FBBase + pSmi->videoRAMBytes - 1);
-
- /* Set up offset to hwcursor memory area. It's a 1K chunk at the end of
- * the frame buffer.
- */
- pSmi->FBCursorOffset = pSmi->videoRAMBytes - 1024;
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Cursor Offset: %08lX\n",
- (unsigned long)pSmi->FBCursorOffset);
-
- /* set up the fifo reserved space */
- if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x01)/* #1074 */
- {
- CARD32 fifoOffset = 0;
- fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x46)
- << 3;
- fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x47)
- << 11;
- fifoOffset |= (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x49)
- & 0x1C) << 17;
- pSmi->FBReserved = fifoOffset; /* PDR#1074 */
- }
- else
- {
- pSmi->FBReserved = pSmi->videoRAMBytes - 2048;
- }
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Reserved: %08lX\n",
- (unsigned long)pSmi->FBReserved);
-
+ pSmi->videoRAMBytes,
+ PCI_DEV_MAP_FLAG_WRITABLE |
+ PCI_DEV_MAP_FLAG_WRITE_COMBINE,
+ result);
+
+ if (err)
+ return FALSE;
}
-
- /* Assign hwp->MemBase & IOBase here */
- hwp = VGAHWPTR(pScrn);
- if (pSmi->IOBase != NULL)
- {
- vgaHWSetMmioFuncs(hwp, pSmi->MapBase, pSmi->IOBase - pSmi->MapBase);
+#endif
+
+ if (pSmi->FBBase == NULL) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: could not "
+ "map framebuffer.\n");
+ LEAVE_PROC("SMI_MapMem");
+ return FALSE;
}
- vgaHWGetIOBase(hwp);
- /* Map the VGA memory when the primary video */
- if (xf86IsPrimaryPci(pSmi->PciInfo))
- {
- hwp->MapSize = 0x10000;
- if (!vgaHWMapMem(pScrn))
- {
- LEAVE_PROC("SMI_MapMem");
- return(FALSE);
- }
- pSmi->PrimaryVidMapped = TRUE;
- }
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
+ "Physical frame buffer at 0x%08lX offset: 0x%08lX\n",
+ pScrn->memPhysBase, pScrn->fbOffset);
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
+ "Logical frame buffer at %p - %p\n", pSmi->FBBase,
+ pSmi->FBBase + pSmi->videoRAMBytes - 1);
- LEAVE_PROC("SMI_MapMem");
- return(TRUE);
+ /* Set up offset to hwcursor memory area. It's a 1K chunk at the end of
+ * the frame buffer.
+ */
+ pSmi->FBCursorOffset = pSmi->videoRAMBytes - 1024;
+
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Cursor Offset: %08lX\n",
+ (unsigned long)pSmi->FBCursorOffset);
+
+ /* set up the fifo reserved space */
+ if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x01)/* #1074 */ {
+ CARD32 fifoOffset = 0;
+ fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x46) << 3;
+ fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x47) << 11;
+ fifoOffset |= (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x49)
+ & 0x1C) << 17;
+ pSmi->FBReserved = fifoOffset; /* PDR#1074 */
+ } else {
+ pSmi->FBReserved = pSmi->videoRAMBytes - 2048;
+ }
+
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Reserved: %08lX\n",
+ (unsigned long)pSmi->FBReserved);
+
+ }
+
+ /* Assign hwp->MemBase & IOBase here */
+ hwp = VGAHWPTR(pScrn);
+ if (pSmi->IOBase != NULL) {
+ vgaHWSetMmioFuncs(hwp, pSmi->MapBase, pSmi->IOBase - pSmi->MapBase);
+ }
+ vgaHWGetIOBase(hwp);
+
+ /* Map the VGA memory when the primary video */
+ if (xf86IsPrimaryPci(pSmi->PciInfo)) {
+ hwp->MapSize = 0x10000;
+ if (!vgaHWMapMem(pScrn)) {
+ LEAVE_PROC("SMI_MapMem");
+ return FALSE;
+ }
+ pSmi->PrimaryVidMapped = TRUE;
+ }
+
+ LEAVE_PROC("SMI_MapMem");
+ return TRUE;
}
/* UnMapMem - contains half of pre-4.0 EnterLeave function. The EnterLeave
@@ -2119,27 +1992,25 @@ SMI_MapMem(ScrnInfoPtr pScrn)
static void
SMI_UnmapMem(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_UnmapMem");
+ ENTER_PROC("SMI_UnmapMem");
- /* Unmap VGA mem if mapped. */
- if (pSmi->PrimaryVidMapped)
- {
- vgaHWUnmapMem(pScrn);
- pSmi->PrimaryVidMapped = FALSE;
- }
+ /* Unmap VGA mem if mapped. */
+ if (pSmi->PrimaryVidMapped) {
+ vgaHWUnmapMem(pScrn);
+ pSmi->PrimaryVidMapped = FALSE;
+ }
- SMI_DisableMmio(pScrn);
+ SMI_DisableMmio(pScrn);
- xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pSmi->MapBase, pSmi->MapSize);
- if (pSmi->FBBase != NULL)
- {
- xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pSmi->FBBase,
- pSmi->videoRAMBytes);
- }
+ xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pSmi->MapBase, pSmi->MapSize);
+ if (pSmi->FBBase != NULL) {
+ xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pSmi->FBBase,
+ pSmi->videoRAMBytes);
+ }
- LEAVE_PROC("SMI_UnmapMem");
+ LEAVE_PROC("SMI_UnmapMem");
}
/* This gets called at the start of each server generation. */
@@ -2147,221 +2018,209 @@ SMI_UnmapMem(ScrnInfoPtr pScrn)
static Bool
SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- SMIPtr pSmi = SMIPTR(pScrn);
- EntityInfoPtr pEnt;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ EntityInfoPtr pEnt;
- ENTER_PROC("SMI_ScreenInit");
+ ENTER_PROC("SMI_ScreenInit");
- /* Map MMIO regs and framebuffer */
- if (!SMI_MapMem(pScrn))
- {
- LEAVE_PROC("SMI_ScreenInit");
- return(FALSE);
- }
+ /* Map MMIO regs and framebuffer */
+ if (!SMI_MapMem(pScrn)) {
+ LEAVE_PROC("SMI_ScreenInit");
+ return FALSE;
+ }
- pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
+ pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
- if (!pSmi->pInt10) {
- pSmi->pInt10 = xf86InitInt10(pEnt->index);
- }
+ if (!pSmi->pInt10) {
+ pSmi->pInt10 = xf86InitInt10(pEnt->index);
+ }
- /* Save the chip/graphics state */
- SMI_Save(pScrn);
+ /* Save the chip/graphics state */
+ SMI_Save(pScrn);
- /* Zero the frame buffer, #258 */
- memset(pSmi->FBBase, 0, pSmi->videoRAMBytes);
-
- /* Initialize the first mode */
- if (!SMI_ModeInit(pScrn, pScrn->currentMode))
- {
- LEAVE_PROC("SMI_ScreenInit");
- return(FALSE);
- }
-
- /*
- * The next step is to setup the screen's visuals, and initialise the
- * framebuffer code. In cases where the framebuffer's default choises for
- * things like visual layouts and bits per RGB are OK, this may be as simple
- * as calling the framebuffer's ScreenInit() function. If not, the visuals
- * will need to be setup before calling a fb ScreenInit() function and fixed
- * up after.
- */
-
- /*
- * Reset the visual list.
- */
- miClearVisualTypes();
-
- /* Setup the visuals we support. */
-
- if (!miSetVisualTypes(pScrn->depth,
- miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits,
- pScrn->defaultVisual))
- {
- LEAVE_PROC("SMI_ScreenInit");
- return(FALSE);
- }
- if (!miSetPixmapDepths ()) return FALSE;
-
- if (!SMI_InternalScreenInit(scrnIndex, pScreen))
- {
- LEAVE_PROC("SMI_ScreenInit");
- return(FALSE);
- }
+ /* Zero the frame buffer, #258 */
+ memset(pSmi->FBBase, 0, pSmi->videoRAMBytes);
- xf86SetBlackWhitePixels(pScreen);
+ /* Initialize the first mode */
+ if (!SMI_ModeInit(pScrn, pScrn->currentMode)) {
+ LEAVE_PROC("SMI_ScreenInit");
+ return FALSE;
+ }
+
+ /*
+ * The next step is to setup the screen's visuals, and initialise the
+ * framebuffer code. In cases where the framebuffer's default choises for
+ * things like visual layouts and bits per RGB are OK, this may be as simple
+ * as calling the framebuffer's ScreenInit() function. If not, the visuals
+ * will need to be setup before calling a fb ScreenInit() function and fixed
+ * up after.
+ */
+
+ /*
+ * Reset the visual list.
+ */
+ miClearVisualTypes();
+
+ /* Setup the visuals we support. */
+
+ if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth),
+ pScrn->rgbBits, pScrn->defaultVisual)) {
+ LEAVE_PROC("SMI_ScreenInit");
+ return FALSE;
+ }
+ if (!miSetPixmapDepths ()) return FALSE;
- if (pScrn->bitsPerPixel > 8)
- {
- VisualPtr visual;
- /* Fixup RGB ordering */
- visual = pScreen->visuals + pScreen->numVisuals;
- while (--visual >= pScreen->visuals)
- {
- if ((visual->class | DynamicClass) == DirectColor)
- {
- visual->offsetRed = pScrn->offset.red;
- visual->offsetGreen = pScrn->offset.green;
- visual->offsetBlue = pScrn->offset.blue;
- visual->redMask = pScrn->mask.red;
- visual->greenMask = pScrn->mask.green;
- visual->blueMask = pScrn->mask.blue;
- }
- }
+ if (!SMI_InternalScreenInit(scrnIndex, pScreen)) {
+ LEAVE_PROC("SMI_ScreenInit");
+ return FALSE;
+ }
+
+ xf86SetBlackWhitePixels(pScreen);
+
+ if (pScrn->bitsPerPixel > 8) {
+ VisualPtr visual;
+ /* Fixup RGB ordering */
+ visual = pScreen->visuals + pScreen->numVisuals;
+ while (--visual >= pScreen->visuals) {
+ if ((visual->class | DynamicClass) == DirectColor) {
+ visual->offsetRed = pScrn->offset.red;
+ visual->offsetGreen = pScrn->offset.green;
+ visual->offsetBlue = pScrn->offset.blue;
+ visual->redMask = pScrn->mask.red;
+ visual->greenMask = pScrn->mask.green;
+ visual->blueMask = pScrn->mask.blue;
+ }
}
+ }
- /* must be after RGB ordering fixed */
- fbPictureInit(pScreen, 0, 0);
+ /* must be after RGB ordering fixed */
+ fbPictureInit(pScreen, 0, 0);
- /* CZ 18.06.2001: moved here from smi_accel.c to have offscreen
- framebuffer in NoAccel mode */
- {
- int numLines, maxLines;
- BoxRec AvailFBArea;
+ /* CZ 18.06.2001: moved here from smi_accel.c to have offscreen
+ framebuffer in NoAccel mode */
+ if (!pSmi->useEXA) {
+ int numLines, maxLines;
+ BoxRec AvailFBArea;
- maxLines = pSmi->FBReserved / (pSmi->width * pSmi->Bpp);
- if (pSmi->rotate) {
- numLines = maxLines;
- } else {
- /* CZ 3.11.2001: What does the following code? see also smi_video.c aaa line 1226 */
+ maxLines = pSmi->FBReserved / (pSmi->width * pSmi->Bpp);
+ if (pSmi->rotate) {
+ numLines = maxLines;
+ } else {
+ /* CZ 3.11.2001: What does the following code? see also smi_video.c aaa line 1226 */
/*#if SMI_USE_VIDEO */
#if 0
- numLines = ((pSmi->FBReserved - pSmi->width * pSmi->Bpp
- * pSmi->height) * 25 / 100 + pSmi->width
- * pSmi->Bpp - 1) / (pSmi->width * pSmi->Bpp);
- numLines += pSmi->height;
+ numLines = ((pSmi->FBReserved - pSmi->width * pSmi->Bpp
+ * pSmi->height) * 25 / 100 + pSmi->width
+ * pSmi->Bpp - 1) / (pSmi->width * pSmi->Bpp);
+ numLines += pSmi->height;
#else
- numLines = maxLines;
+ numLines = maxLines;
#endif
- }
+ }
- AvailFBArea.x1 = 0;
- AvailFBArea.y1 = 0;
- AvailFBArea.x2 = pSmi->width;
- AvailFBArea.y2 = numLines;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "FrameBuffer Box: %d,%d - %d,%d\n",
- AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2,
- AvailFBArea.y2);
- xf86InitFBManager(pScreen, &AvailFBArea);
- }
- /* end CZ */
+ AvailFBArea.x1 = 0;
+ AvailFBArea.y1 = 0;
+ AvailFBArea.x2 = pSmi->width;
+ AvailFBArea.y2 = numLines;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "FrameBuffer Box: %d,%d - %d,%d\n",
+ AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2,
+ AvailFBArea.y2);
+ xf86InitFBManager(pScreen, &AvailFBArea);
+ }
+ /* end CZ */
- /* Initialize acceleration layer */
- if (!pSmi->NoAccel) {
- if (!SMI_AccelInit(pScreen)) {
- LEAVE_PROC("SMI_ScreenInit");
- return(FALSE);
- }
+ /* Initialize acceleration layer */
+ if (!pSmi->NoAccel) {
+ if (!pSmi->useEXA) {
+ if (!SMI_XAAInit(pScreen)) {
+ LEAVE_PROC("SMI_ScreenInit");
+ return FALSE;
+ }
+ } else {
+ if (!SMI_EXAInit(pScreen)) {
+ LEAVE_PROC("SMI_ScreenInit");
+ return FALSE;
+ }
}
+ }
- miInitializeBackingStore(pScreen);
+ miInitializeBackingStore(pScreen);
- /* hardware cursor needs to wrap this layer */
- SMI_DGAInit(pScreen);
+ /* hardware cursor needs to wrap this layer */
+ if(!pSmi->NoAccel && !pSmi->useEXA)
+ SMI_DGAInit(pScreen);
- /* Initialise cursor functions */
- miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
+ /* Initialise cursor functions */
+ miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
- /* Initialize HW cursor layer. Must follow software cursor
- * initialization.
- */
- if (pSmi->hwcursor)
- {
- if (!SMI_HWCursorInit(pScreen))
- {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware cursor "
- "initialization failed\n");
- }
+ /* Initialize HW cursor layer. Must follow software cursor
+ * initialization.
+ */
+ if (pSmi->hwcursor) {
+ if (!SMI_HWCursorInit(pScreen)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware cursor "
+ "initialization failed\n");
}
+ }
- if (pSmi->shadowFB)
- {
- RefreshAreaFuncPtr refreshArea;
+ if (pSmi->shadowFB) {
+ RefreshAreaFuncPtr refreshArea;
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
- refreshArea = SMI_RefreshArea730;
- }
- else
- {
- refreshArea = SMI_RefreshArea;
- }
-
- if (pSmi->rotate)
- {
- if (pSmi->PointerMoved == NULL)
- {
- pSmi->PointerMoved = pScrn->PointerMoved;
- pScrn->PointerMoved = SMI_PointerMoved;
- }
- }
-
- ShadowFBInit(pScreen, refreshArea);
- }
-
- /* Initialise default colormap */
- if (!miCreateDefColormap(pScreen))
- {
- LEAVE_PROC("SMI_ScreenInit");
- return(FALSE);
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
+ refreshArea = SMI_RefreshArea730;
+ } else {
+ refreshArea = SMI_RefreshArea;
}
- /* Initialize colormap layer. Must follow initialization of the default
- * colormap. And SetGamma call, else it will load palette with solid white.
- */
- /* CZ 2.11.2001: CMAP_PALETTED_TRUECOLOR for gamma correction */
- if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, SMI_LoadPalette, NULL,
- CMAP_RELOAD_ON_MODE_SWITCH | CMAP_PALETTED_TRUECOLOR))
- {
- LEAVE_PROC("SMI_ScreenInit");
- return(FALSE);
+ if (pSmi->rotate) {
+ if (pSmi->PointerMoved == NULL) {
+ pSmi->PointerMoved = pScrn->PointerMoved;
+ pScrn->PointerMoved = SMI_PointerMoved;
+ }
}
- pScreen->SaveScreen = SMI_SaveScreen;
- pSmi->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = SMI_CloseScreen;
+ ShadowFBInit(pScreen, refreshArea);
+ }
- if (!xf86DPMSInit(pScreen, SMI_DisplayPowerManagementSet, 0))
- {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DPMS initialization failed!\n");
- }
-
- if (!pSmi->Dualhead)
- SMI_InitVideo(pScreen);
- else
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No overlay in dualhead mode\n");
+ /* Initialise default colormap */
+ if (!miCreateDefColormap(pScreen)) {
+ LEAVE_PROC("SMI_ScreenInit");
+ return FALSE;
+ }
- /* Report any unused options (only for the first generation) */
- if (serverGeneration == 1)
- {
- xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
- }
-
+ /* Initialize colormap layer. Must follow initialization of the default
+ * colormap. And SetGamma call, else it will load palette with solid white.
+ */
+ /* CZ 2.11.2001: CMAP_PALETTED_TRUECOLOR for gamma correction */
+ if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, SMI_LoadPalette, NULL,
+ CMAP_RELOAD_ON_MODE_SWITCH | CMAP_PALETTED_TRUECOLOR)) {
LEAVE_PROC("SMI_ScreenInit");
- return(TRUE);
+ return FALSE;
+ }
+
+ pScreen->SaveScreen = SMI_SaveScreen;
+ pSmi->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = SMI_CloseScreen;
+
+ if (!xf86DPMSInit(pScreen, SMI_DisplayPowerManagementSet, 0)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DPMS initialization failed!\n");
+ }
+
+ if (!pSmi->Dualhead)
+ SMI_InitVideo(pScreen);
+ else
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No overlay in dualhead mode\n");
+
+ /* Report any unused options (only for the first generation) */
+ if (serverGeneration == 1) {
+ xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
+ }
+
+ LEAVE_PROC("SMI_ScreenInit");
+ return TRUE;
}
/* Common init routines needed in EnterVT and ScreenInit */
@@ -2369,649 +2228,577 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
static int
SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- SMIPtr pSmi = SMIPTR(pScrn);
- int width, height, displayWidth;
- int bytesPerPixel = pScrn->bitsPerPixel / 8;
- int xDpi, yDpi;
- int ret;
-
- ENTER_PROC("SMI_InternalScreenInit");
-
- if (pSmi->rotate)
- {
- width = pScrn->virtualY;
- height = pScrn->virtualX;
- xDpi = pScrn->yDpi;
- yDpi = pScrn->xDpi;
- displayWidth = ((width * bytesPerPixel + 15) & ~15) / bytesPerPixel;
- }
- else
- {
- width = pScrn->virtualX;
- height = pScrn->virtualY;
- xDpi = pScrn->xDpi;
- yDpi = pScrn->yDpi;
- displayWidth = pScrn->displayWidth;
- }
-
- if (pSmi->shadowFB)
- {
- pSmi->ShadowWidth = width;
- pSmi->ShadowHeight = height;
- pSmi->ShadowWidthBytes = (width * bytesPerPixel + 15) & ~15;
- if (bytesPerPixel == 3)
- {
- pSmi->ShadowPitch = ((height * 3) << 16)
- | pSmi->ShadowWidthBytes;
- }
- else
- {
- pSmi->ShadowPitch = (height << 16)
- | (pSmi->ShadowWidthBytes / bytesPerPixel);
- }
-
- pSmi->saveBufferSize = pSmi->ShadowWidthBytes * pSmi->ShadowHeight;
- pSmi->FBReserved -= pSmi->saveBufferSize;
- pSmi->FBReserved &= ~0x15;
- WRITE_VPR(pSmi, 0x0C, (pSmi->FBOffset = pSmi->FBReserved) >> 3);
- if(pSmi->Chipset == SMI_COUGAR3DR)
- {
- WRITE_FPR(pSmi, FPR0C, (pSmi->FBOffset = pSmi->FBReserved) >> 3);
- }
- pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Shadow: width=%d height=%d "
- "offset=0x%08lX pitch=0x%08X\n",
- pSmi->ShadowWidth, pSmi->ShadowHeight,
- (unsigned long)pSmi->FBOffset,
- pSmi->ShadowPitch);
- }
- else
- {
- pSmi->FBOffset = 0;
- pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
- }
-
- /*
- * Call the framebuffer layer's ScreenInit function, and fill in other
- * pScreen fields.
- */
-
- DEBUG((VERBLEV, "\tInitializing FB @ 0x%08X for %dx%d (%d)\n",
- pSmi->FBBase, width, height, displayWidth));
- switch (pScrn->bitsPerPixel)
- {
- case 8:
- case 16:
- case 24:
- ret = fbScreenInit(pScreen, pSmi->FBBase, width, height, xDpi,
- yDpi, displayWidth,pScrn->bitsPerPixel);
- break;
- default:
- xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) "
- "in SMI_InternalScreenInit\n", pScrn->bitsPerPixel);
- LEAVE_PROC("SMI_InternalScreenInit");
- return(FALSE);
- }
-
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int width, height, displayWidth;
+ int bytesPerPixel = pScrn->bitsPerPixel / 8;
+ int xDpi, yDpi;
+ int ret;
+
+ ENTER_PROC("SMI_InternalScreenInit");
+
+ if (pSmi->rotate) {
+ width = pScrn->virtualY;
+ height = pScrn->virtualX;
+ xDpi = pScrn->yDpi;
+ yDpi = pScrn->xDpi;
+ displayWidth = ((width * bytesPerPixel + 15) & ~15) / bytesPerPixel;
+ } else {
+ width = pScrn->virtualX;
+ height = pScrn->virtualY;
+ xDpi = pScrn->xDpi;
+ yDpi = pScrn->yDpi;
+ displayWidth = pScrn->displayWidth;
+ }
+
+ if (pSmi->shadowFB) {
+ pSmi->ShadowWidth = width;
+ pSmi->ShadowHeight = height;
+ pSmi->ShadowWidthBytes = (width * bytesPerPixel + 15) & ~15;
+ if (bytesPerPixel == 3) {
+ pSmi->ShadowPitch = ((height * 3) << 16)
+ | pSmi->ShadowWidthBytes;
+ } else {
+ pSmi->ShadowPitch = (height << 16)
+ | (pSmi->ShadowWidthBytes / bytesPerPixel);
+ }
+
+ pSmi->saveBufferSize = pSmi->ShadowWidthBytes * pSmi->ShadowHeight;
+ pSmi->FBReserved -= pSmi->saveBufferSize;
+ pSmi->FBReserved &= ~0x15;
+ WRITE_VPR(pSmi, 0x0C, (pSmi->FBOffset = pSmi->FBReserved) >> 3);
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
+ WRITE_FPR(pSmi, FPR0C, (pSmi->FBOffset = pSmi->FBReserved) >> 3);
+ }
+ pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Shadow: width=%d height=%d "
+ "offset=0x%08lX pitch=0x%08X\n",
+ pSmi->ShadowWidth, pSmi->ShadowHeight,
+ (unsigned long)pSmi->FBOffset,
+ pSmi->ShadowPitch);
+ } else {
+ pSmi->FBOffset = 0;
+ pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
+ }
+
+ /*
+ * Call the framebuffer layer's ScreenInit function, and fill in other
+ * pScreen fields.
+ */
+
+ DEBUG((VERBLEV, "\tInitializing FB @ 0x%08X for %dx%d (%d)\n",
+ pSmi->FBBase, width, height, displayWidth));
+ switch (pScrn->bitsPerPixel) {
+ case 8:
+ case 16:
+ case 24:
+ case 32:
+ ret = fbScreenInit(pScreen, pSmi->FBBase, width, height, xDpi,
+ yDpi, displayWidth, pScrn->bitsPerPixel);
+ break;
+ default:
+ xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) "
+ "in SMI_InternalScreenInit\n", pScrn->bitsPerPixel);
LEAVE_PROC("SMI_InternalScreenInit");
- return(ret);
+ return FALSE;
+ }
+
+ LEAVE_PROC("SMI_InternalScreenInit");
+ return ret;
}
/* Checks if a mode is suitable for the selected configuration. */
static ModeStatus
SMI_ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- SMIPtr pSmi = SMIPTR(pScrn);
- float refresh;
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ float refresh;
- ENTER_PROC("SMI_ValidMode");
- refresh = (mode->VRefresh > 0) ? mode->VRefresh
- : mode->Clock * 1000.0 / mode->VTotal / mode->HTotal;
- xf86DrvMsg(scrnIndex, X_INFO, "Mode: %dx%d %d-bpp, %fHz\n", mode->HDisplay,
- mode->VDisplay, pScrn->bitsPerPixel, refresh);
+ ENTER_PROC("SMI_ValidMode");
+ refresh = (mode->VRefresh > 0) ? mode->VRefresh
+ : mode->Clock * 1000.0 / mode->VTotal / mode->HTotal;
+ xf86DrvMsg(scrnIndex, X_INFO, "Mode: %dx%d %d-bpp, %fHz\n", mode->HDisplay,
+ mode->VDisplay, pScrn->bitsPerPixel, refresh);
- if (pSmi->shadowFB)
- {
- int mem;
+ if (pSmi->shadowFB) {
+ int mem;
- if (pScrn->bitsPerPixel == 24)
- {
- LEAVE_PROC("SMI_ValidMode");
- return(MODE_BAD);
- }
+ if (pScrn->bitsPerPixel == 24) {
+ LEAVE_PROC("SMI_ValidMode");
+ return MODE_BAD;
+ }
- mem = (pScrn->virtualX * pScrn->bitsPerPixel / 8 + 15) & ~15;
- mem *= pScrn->virtualY * 2;
+ mem = (pScrn->virtualX * pScrn->bitsPerPixel / 8 + 15) & ~15;
+ mem *= pScrn->virtualY * 2;
- if (mem > pSmi->FBReserved) /* PDR#1074 */
- {
- LEAVE_PROC("SMI_ValidMode");
- return(MODE_MEM);
- }
+ if (mem > pSmi->FBReserved) /* PDR#1074 */ {
+ LEAVE_PROC("SMI_ValidMode");
+ return MODE_MEM;
}
+ }
- if (!pSmi->useBIOS || pSmi->lcd)
- {
+ if (!pSmi->useBIOS || pSmi->lcd) {
#if 1 /* PDR#983 */
- if (pSmi->zoomOnLCD)
- {
- if ( (mode->HDisplay > pSmi->lcdWidth)
- || (mode->VDisplay > pSmi->lcdHeight)
- )
- {
- LEAVE_PROC("SMI_ValidMode");
- return(MODE_PANEL);
- }
- }
- else
+ if (pSmi->zoomOnLCD) {
+ if ((mode->HDisplay > pSmi->lcdWidth) ||
+ (mode->VDisplay > pSmi->lcdHeight)) {
+ LEAVE_PROC("SMI_ValidMode");
+ return MODE_PANEL;
+ }
+ } else
#endif
- {
- if ( (mode->HDisplay != pSmi->lcdWidth)
- || (mode->VDisplay != pSmi->lcdHeight)
- )
- {
- LEAVE_PROC("SMI_ValidMode");
- return(MODE_PANEL);
- }
- }
-
+ {
+ if ((mode->HDisplay != pSmi->lcdWidth) ||
+ (mode->VDisplay != pSmi->lcdHeight)) {
+ LEAVE_PROC("SMI_ValidMode");
+ return MODE_PANEL;
+ }
}
+ }
#if 1 /* PDR#944 */
- if (pSmi->rotate)
- {
- if ( (mode->HDisplay != pSmi->lcdWidth)
- || (mode->VDisplay != pSmi->lcdHeight)
- )
- {
- LEAVE_PROC("SMI_ValidMode");
- return(MODE_PANEL);
- }
+ if (pSmi->rotate) {
+ if ((mode->HDisplay != pSmi->lcdWidth) ||
+ (mode->VDisplay != pSmi->lcdHeight)) {
+ LEAVE_PROC("SMI_ValidMode");
+ return MODE_PANEL;
}
+ }
#endif
- LEAVE_PROC("SMI_ValidMode");
- return(MODE_OK);
+ LEAVE_PROC("SMI_ValidMode");
+ return MODE_OK;
}
static void
-SMI_DPRInit(ScrnInfoPtr pScrn) {
-
- SMIPtr pSmi = SMIPTR(pScrn);
- int i;
- int xyAddress[] = { 320, 400, 512, 640, 800, 1024, 1280, 1600, 2048 };
- CARD32 DEDataFormat = 0;
-
- /* Store values to current mode register structs */
- SMIRegPtr new = &pSmi->ModeReg;
-
- /* Set DPR registers */
- pSmi->Stride = (pSmi->width * pSmi->Bpp + 15) & ~15;
- switch (pScrn->bitsPerPixel)
- {
- case 8:
- DEDataFormat = 0x00000000;
- break;
-
- case 16:
- pSmi->Stride >>= 1;
- DEDataFormat = 0x00100000;
- break;
-
- case 24:
- DEDataFormat = 0x00300000;
- break;
-
- case 32:
- pSmi->Stride >>= 2;
- DEDataFormat = 0x00200000;
- break;
- }
- for (i = 0; i < sizeof(xyAddress) / sizeof(xyAddress[0]); i++)
- {
- if (pSmi->rotate)
- {
- if (xyAddress[i] == pSmi->height)
- {
- DEDataFormat |= i << 16;
- break;
- }
- }
- else
- {
- if (xyAddress[i] == pSmi->width)
- {
- DEDataFormat |= i << 16;
- break;
- }
- }
- }
- new->DPR10 = (pSmi->Stride << 16) | pSmi->Stride;
- new->DPR1C = DEDataFormat;
- new->DPR20 = 0;
- new->DPR24 = 0xFFFFFFFF;
- new->DPR28 = 0xFFFFFFFF;
- new->DPR2C = 0;
- new->DPR30 = 0;
- new->DPR3C = (pSmi->Stride << 16) | pSmi->Stride;
- new->DPR40 = pSmi->FBOffset;
- new->DPR44 = pSmi->FBOffset;
-}
-
-static Bool
-SMI_ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
+SMI_DPRInit(ScrnInfoPtr pScrn)
{
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- SMIPtr pSmi = SMIPTR(pScrn);
- unsigned char tmp;
- int panelIndex, modeIndex, i;
-
- /* Store values to current mode register structs */
- SMIRegPtr new = &pSmi->ModeReg;
- vgaRegPtr vganew = &hwp->ModeReg;
-
- ENTER_PROC("SMI_ModeInit");
-
- if(!vgaHWInit(pScrn, mode))
- {
- LEAVE_PROC("SMI_ModeInit");
- return(FALSE);
- }
-
- new->modeInit = TRUE;
-
- if (pSmi->rotate)
- {
- pSmi->width = pScrn->virtualY;
- pSmi->height = pScrn->virtualX;
- }
- else
- {
- pSmi->width = pScrn->virtualX;
- pSmi->height = pScrn->virtualY;
- }
- pSmi->Bpp = pScrn->bitsPerPixel / 8;
-
- outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x17);
- tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
- if (pSmi->pci_burst)
- {
- new->SR17 = tmp | 0x20;
- }
- else
- {
- new->SR17 = tmp & ~0x20;
- }
-
- outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
- new->SR18 = inb(pSmi->PIOBase + VGA_SEQ_DATA) | 0x11;
-
- outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
- new->SR21 = inb(pSmi->PIOBase + VGA_SEQ_DATA) & ~0x03;
-
- if (pSmi->Chipset != SMI_COUGAR3DR)
- {
- outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x31);
- new->SR31 = inb(pSmi->PIOBase + VGA_SEQ_DATA) & ~0xC0;
-
- outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x32);
- new->SR32 = inb(pSmi->PIOBase + VGA_SEQ_DATA) & ~0x07;
-
- if (SMI_LYNXM_SERIES(pSmi->Chipset))
- {
- new->SR32 |= 0x04;
- }
- }
-
- new->SRA0 = new->CR33 = new->CR3A = 0x00;
-
- if (pSmi->lcdWidth == 640)
- {
- panelIndex = 0;
- }
- else if (pSmi->lcdWidth == 800)
- {
- panelIndex = 1;
- }
- else
- {
- panelIndex = 2;
- }
-
- if (mode->HDisplay == 640)
- {
- modeIndex = 0;
- }
- else if (mode->HDisplay == 800)
- {
- modeIndex = 1;
- }
- else
- {
- modeIndex = 2;
- }
-
- if (SMI_LYNXM_SERIES(pSmi->Chipset))
- {
- static unsigned char PanelTable[3][14] =
- {
- { 0x5F, 0x4F, 0x00, 0x52, 0x1E, 0x0B, 0xDF, 0x00, 0xE9, 0x0B, 0x2E,
- 0x00, 0x4F, 0xDF },
- { 0x7F, 0x63, 0x00, 0x69, 0x19, 0x72, 0x57, 0x00, 0x58, 0x0C, 0xA2,
- 0x20, 0x4F, 0xDF },
- { 0xA3, 0x7F, 0x00, 0x83, 0x14, 0x24, 0xFF, 0x00, 0x02, 0x08, 0xA7,
- 0xE0, 0x4F, 0xDF },
- };
-
- for (i = 0; i < 14; i++)
- {
- new->CR40[i] = PanelTable[panelIndex][i];
- }
- new->CR90[14] = 0x03;
- new->CR90[15] = 0x00;
- if (mode->VDisplay < pSmi->lcdHeight)
- {
- new->CRA0[6] = (pSmi->lcdHeight - mode->VDisplay) / 8;
- }
- else
- {
- new->CRA0[6] = 0;
- }
-
- if (mode->HDisplay < pSmi->lcdWidth)
- {
- new->CRA0[7] = (pSmi->lcdWidth - mode->HDisplay) / 16;
- }
- else
- {
- new->CRA0[7] = 0;
- }
- }
- else
- {
- static unsigned char PanelTable[3][3][14] =
- {
- { /* 640x480 panel */
- { 0x5F, 0x4F, 0x00, 0x53, 0x00, 0x0B, 0xDF, 0x00, 0xEA, 0x0C,
- 0x2E, 0x00, 0x4F, 0xDF },
- { 0x5F, 0x4F, 0x00, 0x53, 0x00, 0x0B, 0xDF, 0x00, 0xEA, 0x0C,
- 0x2E, 0x00, 0x4F, 0xDF },
- { 0x5F, 0x4F, 0x00, 0x53, 0x00, 0x0B, 0xDF, 0x00, 0xEA, 0x0C,
- 0x2E, 0x00, 0x4F, 0xDF },
- },
- { /* 800x600 panel */
- { 0x7F, 0x59, 0x19, 0x5E, 0x8E, 0x72, 0x1C, 0x37, 0x1D, 0x00,
- 0xA2, 0x20, 0x4F, 0xDF },
- { 0x7F, 0x63, 0x00, 0x68, 0x18, 0x72, 0x58, 0x00, 0x59, 0x0C,
- 0xE0, 0x20, 0x63, 0x57 },
- { 0x7F, 0x63, 0x00, 0x68, 0x18, 0x72, 0x58, 0x00, 0x59, 0x0C,
- 0xE0, 0x20, 0x63, 0x57 },
- },
- { /* 1024x768 panel */
- { 0xA3, 0x67, 0x0F, 0x6D, 0x1D, 0x24, 0x70, 0x95, 0x72, 0x07,
- 0xA3, 0x20, 0x4F, 0xDF },
- { 0xA3, 0x71, 0x19, 0x77, 0x07, 0x24, 0xAC, 0xD1, 0xAE, 0x03,
- 0xE1, 0x20, 0x63, 0x57 },
- { 0xA3, 0x7F, 0x00, 0x85, 0x15, 0x24, 0xFF, 0x00, 0x01, 0x07,
- 0xE5, 0x20, 0x7F, 0xFF },
- },
- };
-
- for (i = 0; i < 14; i++)
- {
- new->CR40[i] = PanelTable[panelIndex][modeIndex][i];
- }
- }
-
- /* CZ 2.11.2001: for gamma correction (TODO: other chipsets?) */
- new->CCR66 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66);
- if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR)){
- switch (pScrn->bitsPerPixel) {
- case 8:
- new->CCR66 = (new->CCR66 & 0xF3) | 0x00; /* 6 bits-RAM */
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int i;
+ int xyAddress[] = { 320, 400, 512, 640, 800, 1024, 1280, 1600, 2048 };
+ CARD32 DEDataFormat = 0;
+
+ /* Store values to current mode register structs */
+ SMIRegPtr new = &pSmi->ModeReg;
+
+ /* Set DPR registers */
+ pSmi->Stride = (pSmi->width * pSmi->Bpp + 15) & ~15;
+ switch (pScrn->bitsPerPixel) {
+ case 8:
+ DEDataFormat = 0x00000000;
+ break;
+ case 16:
+ pSmi->Stride >>= 1;
+ DEDataFormat = 0x00100000;
+ break;
+ case 24:
+ DEDataFormat = 0x00300000;
+ break;
+ case 32:
+ pSmi->Stride >>= 2;
+ DEDataFormat = 0x00200000;
+ break;
+ }
+
+ for (i = 0; i < sizeof(xyAddress) / sizeof(xyAddress[0]); i++) {
+ if (pSmi->rotate) {
+ if (xyAddress[i] == pSmi->height) {
+ DEDataFormat |= i << 16;
break;
- case 16:
- new->CCR66 = (new->CCR66 & 0xF3) | 0x00; /* 6 bits-RAM */
- /* no Gamma correction in 16 Bit mode (s. Release.txt 1.3.1) */
- break;
- case 24:
- case 32:
- new->CCR66 = (new->CCR66 & 0xF3) | 0x04; /* Gamma correct ON */
+ }
+ } else {
+ if (xyAddress[i] == pSmi->width) {
+ DEDataFormat |= i << 16;
break;
- default:
- LEAVE_PROC("SMI_ModeInit");
- return(FALSE);
}
}
+ }
- if (pSmi->Chipset != SMI_COUGAR3DR)
- {
- outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x30);
- if (inb(pSmi->PIOBase + VGA_SEQ_DATA) & 0x01)
- {
- new->SR21 = 0x00;
- }
- }
-
- if (pSmi->MCLK > 0)
- {
- SMI_CommonCalcClock(pScrn->scrnIndex, pSmi->MCLK,
- 1, 1, 31, 0, 2,
- pScrn->clockRanges->minClock,
- pScrn->clockRanges->maxClock,
- &new->SR6A, &new->SR6B);
- }
- else
- {
- new->SR6B = 0xFF;
- }
-
- if ((mode->HDisplay == 640) && SMI_LYNXM_SERIES(pSmi->Chipset))
- {
- vganew->MiscOutReg &= ~0x0C;
- }
- else
- {
- vganew->MiscOutReg |= 0x0C;
- }
- vganew->MiscOutReg |= 0xE0;
- if (mode->HDisplay == 800)
- {
- vganew->MiscOutReg &= ~0xC0;
- }
- if ((mode->HDisplay == 1024) && SMI_LYNXM_SERIES(pSmi->Chipset))
- {
- vganew->MiscOutReg &= ~0xC0;
- }
-
- /* dualhead */
- if (pSmi->Dualhead) {
+ new->DPR10 = (pSmi->Stride << 16) | pSmi->Stride;
+ new->DPR1C = DEDataFormat;
+ new->DPR20 = 0;
+ new->DPR24 = 0xFFFFFFFF;
+ new->DPR28 = 0xFFFFFFFF;
+ new->DPR2C = 0;
+ new->DPR30 = 0;
+ new->DPR3C = (pSmi->Stride << 16) | pSmi->Stride;
+ new->DPR40 = pSmi->FBOffset >> 3;
+ new->DPR44 = pSmi->FBOffset >> 3;
- /* PLL controls */
- /* set CRT to vclk */
- new->SR68 = 0x54;
- /* set LCD to vclk2 */
- new->SR69 = 0x04;
+}
- if (pSmi->lcdWidth == 640)
- {
- /* vclk */
- new->SR6C = 0x07;
- new->SR6D = 0x04;
+static Bool
+SMI_ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
+{
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
+ unsigned char tmp;
+ int panelIndex, modeIndex, i, vclk;
+
+ /* Store values to current mode register structs */
+ SMIRegPtr new = &pSmi->ModeReg;
+ vgaRegPtr vganew = &hwp->ModeReg;
+
+ ENTER_PROC("SMI_ModeInit");
- /* vclk2 */
- new->SR6E = 0x07;
- new->SR6F = 0x04;
- }
- else if (pSmi->lcdWidth == 800)
+ if (!vgaHWInit(pScrn, mode)) {
+ LEAVE_PROC("SMI_ModeInit");
+ return FALSE;
+ }
+
+ new->modeInit = TRUE;
+
+ if (pSmi->rotate) {
+ pSmi->width = pScrn->virtualY;
+ pSmi->height = pScrn->virtualX;
+ } else {
+ pSmi->width = pScrn->virtualX;
+ pSmi->height = pScrn->virtualY;
+ }
+ pSmi->Bpp = pScrn->bitsPerPixel / 8;
+
+ outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x17);
+ tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
+ if (pSmi->pci_burst) {
+ new->SR17 = tmp | 0x20;
+ } else {
+ new->SR17 = tmp & ~0x20;
+ }
+
+ outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
+ new->SR18 = inb(pSmi->PIOBase + VGA_SEQ_DATA) | 0x11;
+
+ outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
+ new->SR21 = inb(pSmi->PIOBase + VGA_SEQ_DATA) & ~0x03;
+
+ if (pSmi->Chipset != SMI_COUGAR3DR) {
+ outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x31);
+ new->SR31 = inb(pSmi->PIOBase + VGA_SEQ_DATA) & ~0xC0;
+
+ outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x32);
+ new->SR32 = inb(pSmi->PIOBase + VGA_SEQ_DATA) & ~0x07;
+
+ if (SMI_LYNXM_SERIES(pSmi->Chipset)) {
+ new->SR32 |= 0x04;
+ }
+ }
+
+ new->SRA0 = new->CR33 = new->CR3A = 0x00;
+
+ if (pSmi->lcdWidth == 640) {
+ panelIndex = 0;
+ } else if (pSmi->lcdWidth == 800) {
+ panelIndex = 1;
+ } else {
+ panelIndex = 2;
+ }
+
+ if (mode->HDisplay == 640) {
+ modeIndex = 0;
+ } else if (mode->HDisplay == 800) {
+ modeIndex = 1;
+ } else {
+ modeIndex = 2;
+ }
+
+ if (SMI_LYNXM_SERIES(pSmi->Chipset)) {
+ static unsigned char PanelTable[3][14] =
{
- /* vclk */
- new->SR6C = 0x0B;
- new->SR6D = 0x82;
-
- /* vclk2 */
- new->SR6E = 0x0B;
- new->SR6F = 0x82;
- }
- else
+ { 0x5F, 0x4F, 0x00, 0x52, 0x1E, 0x0B, 0xDF, 0x00, 0xE9, 0x0B, 0x2E,
+ 0x00, 0x4F, 0xDF },
+ { 0x7F, 0x63, 0x00, 0x69, 0x19, 0x72, 0x57, 0x00, 0x58, 0x0C, 0xA2,
+ 0x20, 0x4F, 0xDF },
+ { 0xA3, 0x7F, 0x00, 0x83, 0x14, 0x24, 0xFF, 0x00, 0x02, 0x08, 0xA7,
+ 0xE0, 0x4F, 0xDF },
+ };
+
+ for (i = 0; i < 14; i++) {
+ new->CR40[i] = PanelTable[panelIndex][i];
+ }
+ new->CR90[14] = 0x03;
+ new->CR90[15] = 0x00;
+ if (mode->VDisplay < pSmi->lcdHeight) {
+ new->CRA0[6] = (pSmi->lcdHeight - mode->VDisplay) / 8;
+ } else {
+ new->CRA0[6] = 0;
+ }
+
+ if (mode->HDisplay < pSmi->lcdWidth) {
+ new->CRA0[7] = (pSmi->lcdWidth - mode->HDisplay) / 16;
+ } else {
+ new->CRA0[7] = 0;
+ }
+ } else {
+ static unsigned char PanelTable[3][3][14] =
{
- /* vclk */
- new->SR6C = 0x52;
- new->SR6D = 0x89;
-
- /* vclk2 */
- new->SR6E = 0x52;
- new->SR6F = 0x89;
- }
+ { /* 640x480 panel */
+ { 0x5F, 0x4F, 0x00, 0x53, 0x00, 0x0B, 0xDF, 0x00, 0xEA, 0x0C,
+ 0x2E, 0x00, 0x4F, 0xDF },
+ { 0x5F, 0x4F, 0x00, 0x53, 0x00, 0x0B, 0xDF, 0x00, 0xEA, 0x0C,
+ 0x2E, 0x00, 0x4F, 0xDF },
+ { 0x5F, 0x4F, 0x00, 0x53, 0x00, 0x0B, 0xDF, 0x00, 0xEA, 0x0C,
+ 0x2E, 0x00, 0x4F, 0xDF },
+ },
+ { /* 800x600 panel */
+ { 0x7F, 0x59, 0x19, 0x5E, 0x8E, 0x72, 0x1C, 0x37, 0x1D, 0x00,
+ 0xA2, 0x20, 0x4F, 0xDF },
+ { 0x7F, 0x63, 0x00, 0x68, 0x18, 0x72, 0x58, 0x00, 0x59, 0x0C,
+ 0xE0, 0x20, 0x63, 0x57 },
+ { 0x7F, 0x63, 0x00, 0x68, 0x18, 0x72, 0x58, 0x00, 0x59, 0x0C,
+ 0xE0, 0x20, 0x63, 0x57 },
+ },
+ { /* 1024x768 panel */
+ { 0xA3, 0x67, 0x0F, 0x6D, 0x1D, 0x24, 0x70, 0x95, 0x72, 0x07,
+ 0xA3, 0x20, 0x4F, 0xDF },
+ { 0xA3, 0x71, 0x19, 0x77, 0x07, 0x24, 0xAC, 0xD1, 0xAE, 0x03,
+ 0xE1, 0x20, 0x63, 0x57 },
+ { 0xA3, 0x7F, 0x00, 0x85, 0x15, 0x24, 0xFF, 0x00, 0x01, 0x07,
+ 0xE5, 0x20, 0x7F, 0xFF },
+ },
+ };
+
+ for (i = 0; i < 14; i++) {
+ new->CR40[i] = PanelTable[panelIndex][modeIndex][i];
+ }
+ }
+
+ /* CZ 2.11.2001: for gamma correction (TODO: other chipsets?) */
+ new->CCR66 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66);
+ if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR)) {
+ switch (pScrn->bitsPerPixel) {
+ case 8:
+ new->CCR66 = (new->CCR66 & 0xF3) | 0x00; /* 6 bits-RAM */
+ break;
+ case 16:
+ new->CCR66 = (new->CCR66 & 0xF3) | 0x00; /* 6 bits-RAM */
+ /* no Gamma correction in 16 Bit mode (s. Release.txt 1.3.1) */
+ break;
+ case 24:
+ case 32:
+ new->CCR66 = (new->CCR66 & 0xF3) | 0x04; /* Gamma correct ON */
+ break;
+ default:
+ LEAVE_PROC("SMI_ModeInit");
+ return FALSE;
+ }
+ }
+
+ if (pSmi->Chipset != SMI_COUGAR3DR) {
+ outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x30);
+ if (inb(pSmi->PIOBase + VGA_SEQ_DATA) & 0x01) {
+ new->SR21 = 0x00;
+ }
+ }
+
+ if (pSmi->MCLK > 0) {
+ SMI_CommonCalcClock(pScrn->scrnIndex, pSmi->MCLK,
+ 1, 1, 63, 0, 0,
+ pScrn->clockRanges->minClock,
+ pScrn->clockRanges->maxClock,
+ &new->SR6A, &new->SR6B);
+ } else {
+ new->SR6B = 0xFF;
+ }
+
+ if ((mode->HDisplay == 640) && SMI_LYNXM_SERIES(pSmi->Chipset)) {
+ vganew->MiscOutReg &= ~0x0C;
+ } else {
+ vganew->MiscOutReg |= 0x0C;
+ }
+ vganew->MiscOutReg |= 0xE0;
+ if (mode->HDisplay == 800) {
+ vganew->MiscOutReg &= ~0xC0;
+ }
+ if ((mode->HDisplay == 1024) && SMI_LYNXM_SERIES(pSmi->Chipset)) {
+ vganew->MiscOutReg &= ~0xC0;
+ }
+
+ /* calculate vclk1 */
+ vclk = mode->Clock;
+ if (SMI_LYNX_SERIES(pSmi->Chipset)) {
+ SMI_CommonCalcClock(pScrn->scrnIndex, vclk,
+ 1, 1, 63, 0, 3,
+ pScrn->clockRanges->minClock,
+ pScrn->clockRanges->maxClock,
+ &new->SR6C, &new->SR6D);
+ } else {
+ SMI_CommonCalcClock(pScrn->scrnIndex, vclk,
+ 1, 1, 63, 0, 1,
+ pScrn->clockRanges->minClock,
+ pScrn->clockRanges->maxClock,
+ &new->SR6C, &new->SR6D);
+ }
+
+ /* use vclk1 */
+ new->SR68 = 0x54;
+
+ /* dualhead */
+ if (pSmi->Dualhead) {
+ /* PLL controls */
+ /* set LCD to vclk2 */
+ new->SR69 = 0x04;
+
+ if (pSmi->lcdWidth == 640) {
+ /* vclk */
+ new->SR6C = 0x07;
+ new->SR6D = 0x04;
+
+ /* vclk2 */
+ new->SR6E = 0x07;
+ new->SR6F = 0x04;
+ } else if (pSmi->lcdWidth == 800) {
+ /* vclk */
+ new->SR6C = 0x0B;
+ new->SR6D = 0x82;
+
+ /* vclk2 */
+ new->SR6E = 0x0B;
+ new->SR6F = 0x82;
+ } else {
+ /* vclk */
+ new->SR6C = 0x52;
+ new->SR6D = 0x89;
+
+ /* vclk2 */
+ new->SR6E = 0x52;
+ new->SR6F = 0x89;
+ }
/* TFT panel uses FIFO1, DSTN panel uses FIFO1 for upper panel and
* FIFO2 for lower panel. I don't have a DSTN panel, so it's untested.
* -- AGD
*/
- CARD32 fifo1_readoffset, fifo2_readoffset, fifo_writeoffset;
-
- /* setting SR21 bit 2 disables ZV circuitry,
- * if ZV is needed, SR21 = 0x20
- */
- /* enable DAC, PLL, etc. */
- new->SR21 = 0x24;
-
- /* clear DPMS state */
- new->SR22 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x22) & ~0x30;
-
- /* enable virtual refresh and LCD and CRT outputs */
- if (pScrn->bitsPerPixel > 8)
- new->SR31 = /*0xCB*/ 0xC3; /* 16 bpp */
- else
- new->SR31 = /*0x8B*/ 0x83; /* 8 bpp */
-
- /* FIFO1 Read Offset */
- fifo1_readoffset = pSmi->lcdWidth / 2;
- fifo2_readoffset = pSmi->lcdWidth / 2;
- new->SR44 = fifo1_readoffset & 0x000000FF;
- /* FIFO2 Read Offset */
- new->SR4B = fifo2_readoffset & 0x000000FF;
- /* FIFO1/2 Read Offset overflow */
- new->SR4C = (((fifo1_readoffset & 0x00000300) >> 8) << 2) |
- (((fifo2_readoffset & 0x00000300) >> 8) << 6);
-
- /* FIFO Write Offset */
- fifo_writeoffset = pSmi->lcdWidth / 4;
- new->SR48 = fifo_writeoffset & 0x000000FF;
- new->SR49 = (fifo_writeoffset & 0x00000300) >> 8;
+ CARD32 fifo1_readoffset, fifo2_readoffset, fifo_writeoffset;
- /* set FIFO levels */
- new->SR4A = 0x41;
-
- /* something related to tv... */
- new->CR33 |= 0x07;
-
- }
+ /* setting SR21 bit 2 disables ZV circuitry,
+ * if ZV is needed, SR21 = 0x20
+ */
+ /* enable DAC, PLL, etc. */
+ new->SR21 = 0x24;
- /* init graphics engine regs */
- SMI_DPRInit(pScrn);
+ /* clear DPMS state */
+ new->SR22 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x22) & ~0x30;
- /* Set VPR registers (and FPR registers for SM731) */
- switch (pScrn->bitsPerPixel)
- {
- case 8:
- new->VPR00 = 0x00000000;
- new->FPR00_= 0x00080000;
- break;
-
- case 16:
- new->VPR00 = 0x00020000;
- new->FPR00_= 0x000A0000;
- break;
-
- case 24:
- new->VPR00 = 0x00040000;
- new->FPR00_= 0x000C0000;
- break;
-
- case 32:
- new->VPR00 = 0x00030000;
- new->FPR00_= 0x000B0000;
- break;
- }
- new->VPR0C = pSmi->FBOffset >> 3;
- if (pSmi->rotate)
- {
- new->VPR10 = (((( pSmi->height * pSmi->Bpp) >> 3)
- + 2) << 16) | ((pSmi->height * pSmi->Bpp) >> 3);
- }
+ /* enable virtual refresh and LCD and CRT outputs */
+ if (pScrn->bitsPerPixel > 8)
+ new->SR31 = /*0xCB*/ 0xC3; /* 16 bpp */
else
- {
- new->VPR10 = ((((pSmi->width * pSmi->Bpp) >> 3)
- + 2) << 16) | ((pSmi->width * pSmi->Bpp) >> 3);
- }
-
- new->FPR0C_ = new->VPR0C;
- new->FPR10_ = new->VPR10;
-
- /* Set CPR registers */
- new->CPR00 = 0x00000000;
-
- pScrn->vtSema = TRUE;
-
- /* Find the INT 10 mode number */
- {
- static struct
- {
- int x, y, bpp;
- CARD16 mode;
-
- } modeTable[] =
- {
- { 640, 480, 8, 0x50 },
- { 640, 480, 16, 0x52 },
- { 640, 480, 24, 0x53 },
- { 640, 480, 32, 0x54 },
- { 800, 480, 8, 0x4A },
- { 800, 480, 16, 0x4C },
- { 800, 480, 24, 0x4D },
- { 800, 600, 8, 0x55 },
- { 800, 600, 16, 0x57 },
- { 800, 600, 24, 0x58 },
- { 800, 600, 32, 0x59 },
- { 1024, 768, 8, 0x60 },
- { 1024, 768, 16, 0x62 },
- { 1024, 768, 24, 0x63 },
- { 1024, 768, 32, 0x64 },
- { 1280, 1024, 8, 0x65 },
- { 1280, 1024, 16, 0x67 },
- { 1280, 1024, 24, 0x68 },
- { 1280, 1024, 32, 0x69 },
- };
-
- new->mode = 0;
- for (i = 0; i < sizeof(modeTable) / sizeof(modeTable[0]); i++)
- {
- if ( (modeTable[i].x == mode->HDisplay)
- && (modeTable[i].y == mode->VDisplay)
- && (modeTable[i].bpp == pScrn->bitsPerPixel)
- )
- {
- new->mode = modeTable[i].mode;
- break;
- }
- }
+ new->SR31 = /*0x8B*/ 0x83; /* 8 bpp */
+
+ /* FIFO1 Read Offset */
+ fifo1_readoffset = pSmi->lcdWidth / 2;
+ fifo2_readoffset = pSmi->lcdWidth / 2;
+ new->SR44 = fifo1_readoffset & 0x000000FF;
+ /* FIFO2 Read Offset */
+ new->SR4B = fifo2_readoffset & 0x000000FF;
+ /* FIFO1/2 Read Offset overflow */
+ new->SR4C = (((fifo1_readoffset & 0x00000300) >> 8) << 2) |
+ (((fifo2_readoffset & 0x00000300) >> 8) << 6);
+
+ /* FIFO Write Offset */
+ fifo_writeoffset = pSmi->lcdWidth / 4;
+ new->SR48 = fifo_writeoffset & 0x000000FF;
+ new->SR49 = (fifo_writeoffset & 0x00000300) >> 8;
+
+ /* set FIFO levels */
+ new->SR4A = 0x41;
+
+ /* something related to tv... */
+ new->CR33 |= 0x07;
+
+ }
+
+ /* init graphics engine regs */
+ SMI_DPRInit(pScrn);
+
+ /* Set VPR registers (and FPR registers for SM731) */
+ switch (pScrn->bitsPerPixel) {
+ case 8:
+ new->VPR00 = 0x00000000;
+ new->FPR00_= 0x00080000;
+ break;
+ case 16:
+ new->VPR00 = 0x00020000;
+ new->FPR00_= 0x000A0000;
+ break;
+ case 24:
+ new->VPR00 = 0x00040000;
+ new->FPR00_= 0x000C0000;
+ break;
+ case 32:
+ new->VPR00 = 0x00030000;
+ new->FPR00_= 0x000B0000;
+ break;
+ }
+ new->VPR0C = pSmi->FBOffset >> 3;
+ if (pSmi->rotate) {
+ new->VPR10 = (((( pSmi->height * pSmi->Bpp) >> 3) + 2) << 16) |
+ ((pSmi->height * pSmi->Bpp) >> 3);
+ } else {
+ new->VPR10 = ((((pSmi->width * pSmi->Bpp) >> 3) + 2) << 16) |
+ ((pSmi->width * pSmi->Bpp) >> 3);
+ }
+
+ new->FPR0C_ = new->VPR0C;
+ new->FPR10_ = new->VPR10;
+
+ /* Set CPR registers */
+ new->CPR00 = 0x00000000;
+
+ pScrn->vtSema = TRUE;
+
+ /* Find the INT 10 mode number */
+ {
+ static struct {
+ int x, y, bpp;
+ CARD16 mode;
+ } modeTable[] =
+ {
+ { 640, 480, 8, 0x50 },
+ { 640, 480, 16, 0x52 },
+ { 640, 480, 24, 0x53 },
+ { 640, 480, 32, 0x54 },
+ { 800, 480, 8, 0x4A },
+ { 800, 480, 16, 0x4C },
+ { 800, 480, 24, 0x4D },
+ { 800, 600, 8, 0x55 },
+ { 800, 600, 16, 0x57 },
+ { 800, 600, 24, 0x58 },
+ { 800, 600, 32, 0x59 },
+ { 1024, 768, 8, 0x60 },
+ { 1024, 768, 16, 0x62 },
+ { 1024, 768, 24, 0x63 },
+ { 1024, 768, 32, 0x64 },
+ { 1280, 1024, 8, 0x65 },
+ { 1280, 1024, 16, 0x67 },
+ { 1280, 1024, 24, 0x68 },
+ { 1280, 1024, 32, 0x69 },
+ };
+
+ new->mode = 0;
+ for (i = 0; i < sizeof(modeTable) / sizeof(modeTable[0]); i++) {
+ if ((modeTable[i].x == mode->HDisplay) &&
+ (modeTable[i].y == mode->VDisplay) &&
+ (modeTable[i].bpp == pScrn->bitsPerPixel)) {
+ new->mode = modeTable[i].mode;
+ break;
+ }
}
+ }
- /* Zero the font memory */
- memset(new->smiFont, 0, sizeof(new->smiFont));
+ /* Zero the font memory */
+ memset(new->smiFont, 0, sizeof(new->smiFont));
- /* Write the mode registers to hardware */
- SMI_WriteMode(pScrn, vganew, new);
+ /* Write the mode registers to hardware */
+ SMI_WriteMode(pScrn, vganew, new);
- /* Adjust the viewport */
- SMI_AdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+ /* Adjust the viewport */
+ SMI_AdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
- LEAVE_PROC("SMI_ModeInit");
- return(TRUE);
+ LEAVE_PROC("SMI_ModeInit");
+ return TRUE;
}
/*
@@ -3024,360 +2811,343 @@ SMI_ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
static Bool
SMI_CloseScreen(int scrnIndex, ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- SMIPtr pSmi = SMIPTR(pScrn);
- vgaRegPtr vgaSavePtr = &hwp->SavedReg;
- SMIRegPtr SMISavePtr = &pSmi->SavedReg;
- Bool ret;
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
+ vgaRegPtr vgaSavePtr = &hwp->SavedReg;
+ SMIRegPtr SMISavePtr = &pSmi->SavedReg;
+ Bool ret;
- ENTER_PROC("SMI_CloseScreen");
+ ENTER_PROC("SMI_CloseScreen");
- if (pScrn->vtSema)
- {
- SMI_WriteMode(pScrn, vgaSavePtr, SMISavePtr);
- vgaHWLock(hwp);
- SMI_UnmapMem(pScrn);
- }
-
- if (pSmi->AccelInfoRec != NULL)
- {
- XAADestroyInfoRec(pSmi->AccelInfoRec);
- }
- if (pSmi->CursorInfoRec != NULL)
- {
- xf86DestroyCursorInfoRec(pSmi->CursorInfoRec);
- }
- if (pSmi->DGAModes != NULL)
- {
- xfree(pSmi->DGAModes);
- }
- if (pSmi->pInt10 != NULL)
- {
- xf86FreeInt10(pSmi->pInt10);
- pSmi->pInt10 = NULL;
- }
- if (pSmi->ptrAdaptor != NULL)
- {
- xfree(pSmi->ptrAdaptor);
- }
- if (pSmi->BlockHandler != NULL)
- {
- pScreen->BlockHandler = pSmi->BlockHandler;
- }
- /* #670 */
- if (pSmi->pSaveBuffer)
- {
- xfree(pSmi->pSaveBuffer);
- }
- /* #920 */
- if (pSmi->paletteBuffer)
- {
- xfree(pSmi->paletteBuffer);
- }
-
- pScrn->vtSema = FALSE;
- pScreen->CloseScreen = pSmi->CloseScreen;
- ret = (*pScreen->CloseScreen)(scrnIndex, pScreen);
-
- LEAVE_PROC("SMI_CloseScreen");
- return(ret);
+ if (pScrn->vtSema) {
+ SMI_WriteMode(pScrn, vgaSavePtr, SMISavePtr);
+ vgaHWLock(hwp);
+ SMI_UnmapMem(pScrn);
+ }
+
+ if (pSmi->XAAInfoRec != NULL) {
+ XAADestroyInfoRec(pSmi->XAAInfoRec);
+ }
+ if (pSmi->EXADriverPtr) {
+ exaDriverFini(pScreen);
+ pSmi->EXADriverPtr = NULL;
+ }
+ if (pSmi->CursorInfoRec != NULL) {
+ xf86DestroyCursorInfoRec(pSmi->CursorInfoRec);
+ }
+ if (pSmi->DGAModes != NULL) {
+ xfree(pSmi->DGAModes);
+ }
+ if (pSmi->pInt10 != NULL) {
+ xf86FreeInt10(pSmi->pInt10);
+ pSmi->pInt10 = NULL;
+ }
+ if (pSmi->ptrAdaptor != NULL) {
+ xfree(pSmi->ptrAdaptor);
+ }
+ if (pSmi->BlockHandler != NULL) {
+ pScreen->BlockHandler = pSmi->BlockHandler;
+ }
+ /* #670 */
+ if (pSmi->pSaveBuffer) {
+ xfree(pSmi->pSaveBuffer);
+ }
+/* #920 */
+ if (pSmi->paletteBuffer) {
+ xfree(pSmi->paletteBuffer);
+ }
+
+ pScrn->vtSema = FALSE;
+ pScreen->CloseScreen = pSmi->CloseScreen;
+ ret = (*pScreen->CloseScreen)(scrnIndex, pScreen);
+
+ LEAVE_PROC("SMI_CloseScreen");
+ return ret;
}
static void
SMI_FreeScreen(int scrnIndex, int flags)
{
- SMI_FreeRec(xf86Screens[scrnIndex]);
+ SMI_FreeRec(xf86Screens[scrnIndex]);
}
static Bool
SMI_SaveScreen(ScreenPtr pScreen, int mode)
{
- Bool ret;
+ Bool ret;
- ENTER_PROC("SMI_SaveScreen");
+ ENTER_PROC("SMI_SaveScreen");
- ret = vgaHWSaveScreen(pScreen, mode);
+ ret = vgaHWSaveScreen(pScreen, mode);
- LEAVE_PROC("SMI_SaveScreen");
- return(ret);
+ LEAVE_PROC("SMI_SaveScreen");
+ return ret;
}
void
SMI_AdjustFrame(int scrnIndex, int x, int y, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- SMIPtr pSmi = SMIPTR(pScrn);
- CARD32 Base, lcdBase;
-
- ENTER_PROC("SMI_AdjustFrame");
-
- if (pSmi->ShowCache && y)
- {
- y += pScrn->virtualY - 1;
- }
-
- if (pSmi->Dualhead) {
- lcdBase = 0;
- x = pSmi->lcdWidth;
- y = 0;
- }
-
- Base = pSmi->FBOffset + (x + y * pScrn->virtualX) * pSmi->Bpp;
- if (SMI_LYNX3D_SERIES(pSmi->Chipset) || SMI_COUGAR_SERIES(pSmi->Chipset))
- {
- Base = (Base + 15) & ~15;
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ CARD32 Base, lcdBase;
+
+ ENTER_PROC("SMI_AdjustFrame");
+
+ if (pSmi->ShowCache && y) {
+ y += pScrn->virtualY - 1;
+ }
+
+ if (pSmi->Dualhead) {
+ lcdBase = 0;
+ x = pSmi->lcdWidth;
+ y = 0;
+ }
+
+ Base = pSmi->FBOffset + (x + y * pScrn->virtualX) * pSmi->Bpp;
+ if (SMI_LYNX3D_SERIES(pSmi->Chipset) ||
+ SMI_COUGAR_SERIES(pSmi->Chipset)) {
+ Base = (Base + 15) & ~15;
#if 1 /* PDR#1058 */
- while ((Base % pSmi->Bpp) > 0)
- {
- Base -= 16;
- }
-#endif
+ while ((Base % pSmi->Bpp) > 0) {
+ Base -= 16;
}
- else
- {
- Base = (Base + 7) & ~7;
-#if 1 /* PDR#1058 */
- while ((Base % pSmi->Bpp) > 0)
- {
- Base -= 8;
- }
#endif
+ } else {
+ Base = (Base + 7) & ~7;
+#if 1 /* PDR#1058 */
+ while ((Base % pSmi->Bpp) > 0) {
+ Base -= 8;
}
+#endif
+ }
+ if (pSmi->Dualhead) {
- if (pSmi->Dualhead) {
-
- /* FIFO1 read start address */
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x40,
+ /* FIFO1 read start address */
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x40,
(lcdBase & 0x000000FF));
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x41,
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x41,
((lcdBase & 0x0000FF00) >> 8));
- /* FIFO2 read start address */
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x42,
+ /* FIFO2 read start address */
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x42,
(lcdBase & 0x000000FF));
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x43,
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x43,
((lcdBase & 0x0000FF00) >> 8));
- /* FIFO1/2 read start address overflow */
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x45,
+ /* FIFO1/2 read start address overflow */
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x45,
((lcdBase & 0x000F0000) >> 12) | (((lcdBase & 0x000F0000) >> 12) << 4));
- }
+ }
- WRITE_VPR(pSmi, 0x0C, Base >> 3);
- if(pSmi->Chipset == SMI_COUGAR3DR)
- {
- WRITE_FPR(pSmi, FPR0C, Base >> 3);
- }
+ WRITE_VPR(pSmi, 0x0C, Base >> 3);
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
+ WRITE_FPR(pSmi, FPR0C, Base >> 3);
+ }
- LEAVE_PROC("SMI_AdjustFrame");
+ LEAVE_PROC("SMI_AdjustFrame");
}
Bool
SMI_SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
- Bool ret;
+ Bool ret;
+ SMIPtr pSmi = SMIPTR(xf86Screens[scrnIndex]);
- ENTER_PROC("SMI_SwitchMode");
+ ENTER_PROC("SMI_SwitchMode");
- ret = SMI_ModeInit(xf86Screens[scrnIndex], mode);
+ pSmi->IsSwitching = TRUE;
+ ret = SMI_ModeInit(xf86Screens[scrnIndex], mode);
+ pSmi->IsSwitching = FALSE;
- LEAVE_PROC("SMI_SwitchMode");
- return(ret);
+ LEAVE_PROC("SMI_SwitchMode");
+ return ret;
}
void
SMI_LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, LOCO *colors,
VisualPtr pVisual)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- int i;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int i;
- ENTER_PROC("SMI_LoadPalette");
+ ENTER_PROC("SMI_LoadPalette");
- /* Enable both the CRT and LCD DAC RAM paths, so both palettes are updated */
- if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR))
- {
- CARD8 ccr66;
+ /* Enable both the CRT and LCD DAC RAM paths, so both palettes are updated */
+ if ((pSmi->Chipset == SMI_LYNX3DM) ||
+ (pSmi->Chipset == SMI_COUGAR3DR)) {
+ CARD8 ccr66;
- ccr66 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66);
- ccr66 &= 0x0f;
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66, ccr66);
- }
+ ccr66 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66);
+ ccr66 &= 0x0f;
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66, ccr66);
+ }
- for(i = 0; i < numColors; i++)
- {
+ for(i = 0; i < numColors; i++) {
DEBUG((VERBLEV, "pal[%d] = %d %d %d\n", indicies[i],
- colors[indicies[i]].red, colors[indicies[i]].green, colors[indicies[i]].blue));
- VGAOUT8(pSmi, VGA_DAC_WRITE_ADDR, indicies[i]);
- VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].red);
- VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].green);
- VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].blue);
- }
-
- LEAVE_PROC("SMI_LoadPalette");
+ colors[indicies[i]].red, colors[indicies[i]].green, colors[indicies[i]].blue));
+ VGAOUT8(pSmi, VGA_DAC_WRITE_ADDR, indicies[i]);
+ VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].red);
+ VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].green);
+ VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].blue);
+ }
+
+ LEAVE_PROC("SMI_LoadPalette");
}
static void
SMI_DisableVideo(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- CARD8 tmp;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ CARD8 tmp;
- if (!(tmp = VGAIN8(pSmi, VGA_DAC_MASK)))
- return;
- pSmi->DACmask = tmp;
- VGAOUT8(pSmi, VGA_DAC_MASK, 0);
+ if (!(tmp = VGAIN8(pSmi, VGA_DAC_MASK)))
+ return;
+ pSmi->DACmask = tmp;
+ VGAOUT8(pSmi, VGA_DAC_MASK, 0);
}
static void
SMI_EnableVideo(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- VGAOUT8(pSmi, VGA_DAC_MASK, pSmi->DACmask);
+ VGAOUT8(pSmi, VGA_DAC_MASK, pSmi->DACmask);
}
void
SMI_EnableMmio(ScrnInfoPtr pScrn)
{
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- SMIPtr pSmi = SMIPTR(pScrn);
- CARD8 tmp;
-
- ENTER_PROC("SMI_EnableMmio");
-
- /*
- * Enable chipset (seen on uninitialized secondary cards) might not be
- * needed once we use the VGA softbooter
- */
- vgaHWSetStdFuncs(hwp);
-
- /* Enable linear mode */
- outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
- tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
- pSmi->SR18Value = tmp; /* PDR#521 */
- outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x11);
-
- /* Enable 2D/3D Engine and Video Processor */
- outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
- tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
- pSmi->SR21Value = tmp; /* PDR#521 */
- outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp & ~0x03);
-
- LEAVE_PROC("SMI_EnableMmio");
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
+ CARD8 tmp;
+
+ ENTER_PROC("SMI_EnableMmio");
+
+ /*
+ * Enable chipset (seen on uninitialized secondary cards) might not be
+ * needed once we use the VGA softbooter
+ */
+ vgaHWSetStdFuncs(hwp);
+
+ /* Enable linear mode */
+ outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
+ tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
+ pSmi->SR18Value = tmp; /* PDR#521 */
+ outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x11);
+
+ /* Enable 2D/3D Engine and Video Processor */
+ outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
+ tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
+ pSmi->SR21Value = tmp; /* PDR#521 */
+ outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp & ~0x03);
+
+ LEAVE_PROC("SMI_EnableMmio");
}
void
SMI_DisableMmio(ScrnInfoPtr pScrn)
{
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- SMIPtr pSmi = SMIPTR(pScrn);
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_DisableMmio");
+ ENTER_PROC("SMI_DisableMmio");
- vgaHWSetStdFuncs(hwp);
+ vgaHWSetStdFuncs(hwp);
- /* Disable 2D/3D Engine and Video Processor */
- outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
- outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR21Value); /* PDR#521 */
+ /* Disable 2D/3D Engine and Video Processor */
+ outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
+ outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR21Value); /* PDR#521 */
- /* Disable linear mode */
- outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
- outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR18Value); /* PDR#521 */
+ /* Disable linear mode */
+ outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
+ outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR18Value); /* PDR#521 */
- LEAVE_PROC("SMI_DisableMmio");
+ LEAVE_PROC("SMI_DisableMmio");
}
/* This function is used to debug, it prints out the contents of Lynx regs */
static void
SMI_PrintRegs(ScrnInfoPtr pScrn)
{
- unsigned char i;
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- SMIPtr pSmi = SMIPTR(pScrn);
- int vgaCRIndex = hwp->IOBase + VGA_CRTC_INDEX_OFFSET;
- int vgaCRReg = hwp->IOBase + VGA_CRTC_DATA_OFFSET;
- int vgaStatus = hwp->IOBase + VGA_IN_STAT_1_OFFSET;
-
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
- "START register dump ------------------\n");
-
- xf86ErrorFVerb(VERBLEV, "MISCELLANEOUS OUTPUT\n %02X\n",
- VGAIN8(pSmi, VGA_MISC_OUT_R));
-
- xf86ErrorFVerb(VERBLEV, "\nSEQUENCER\n"
- " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF");
- for (i = 0x00; i <= 0xAF; i++)
- {
- if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
- if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " ");
- xf86ErrorFVerb(VERBLEV, "%02X ",
- VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, i));
- }
-
- xf86ErrorFVerb(VERBLEV, "\n\nCRT CONTROLLER\n"
- " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF");
- for (i = 0x00; i <= 0xAD; i++)
- {
- if (i == 0x20) i = 0x30;
- if (i == 0x50) i = 0x90;
- if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
- if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " ");
- xf86ErrorFVerb(VERBLEV, "%02X ",
- VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRReg, i));
- }
-
- xf86ErrorFVerb(VERBLEV, "\n\nGRAPHICS CONTROLLER\n"
- " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF");
- for (i = 0x00; i <= 0x08; i++)
- {
- if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
- if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " ");
- xf86ErrorFVerb(VERBLEV, "%02X ",
- VGAIN8_INDEX(pSmi, VGA_GRAPH_INDEX, VGA_GRAPH_DATA, i));
- }
-
- xf86ErrorFVerb(VERBLEV, "\n\nATTRIBUTE 0CONTROLLER\n"
- " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF");
- for (i = 0x00; i <= 0x14; i++)
- {
- (void) VGAIN8(pSmi, vgaStatus);
- if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
- if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " ");
- xf86ErrorFVerb(VERBLEV, "%02X ",
- VGAIN8_INDEX(pSmi, VGA_ATTR_INDEX, VGA_ATTR_DATA_R, i));
- }
+ unsigned char i;
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int vgaCRIndex = hwp->IOBase + VGA_CRTC_INDEX_OFFSET;
+ int vgaCRReg = hwp->IOBase + VGA_CRTC_DATA_OFFSET;
+ int vgaStatus = hwp->IOBase + VGA_IN_STAT_1_OFFSET;
+
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
+ "START register dump ------------------\n");
+
+ xf86ErrorFVerb(VERBLEV, "MISCELLANEOUS OUTPUT\n %02X\n",
+ VGAIN8(pSmi, VGA_MISC_OUT_R));
+
+ xf86ErrorFVerb(VERBLEV, "\nSEQUENCER\n"
+ " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF");
+ for (i = 0x00; i <= 0xAF; i++) {
+ if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
+ if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " ");
+ xf86ErrorFVerb(VERBLEV, "%02X ",
+ VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, i));
+ }
+
+ xf86ErrorFVerb(VERBLEV, "\n\nCRT CONTROLLER\n"
+ " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF");
+ for (i = 0x00; i <= 0xAD; i++) {
+ if (i == 0x20) i = 0x30;
+ if (i == 0x50) i = 0x90;
+ if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
+ if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " ");
+ xf86ErrorFVerb(VERBLEV, "%02X ",
+ VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRReg, i));
+ }
+
+ xf86ErrorFVerb(VERBLEV, "\n\nGRAPHICS CONTROLLER\n"
+ " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF");
+ for (i = 0x00; i <= 0x08; i++) {
+ if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
+ if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " ");
+ xf86ErrorFVerb(VERBLEV, "%02X ",
+ VGAIN8_INDEX(pSmi, VGA_GRAPH_INDEX, VGA_GRAPH_DATA, i));
+ }
+
+ xf86ErrorFVerb(VERBLEV, "\n\nATTRIBUTE 0CONTROLLER\n"
+ " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF");
+ for (i = 0x00; i <= 0x14; i++) {
(void) VGAIN8(pSmi, vgaStatus);
- VGAOUT8(pSmi, VGA_ATTR_INDEX, 0x20);
-
- xf86ErrorFVerb(VERBLEV, "\n\nDPR x0 x4 x8 xC");
- for (i = 0x00; i <= 0x44; i += 4)
- {
- if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
- xf86ErrorFVerb(VERBLEV, " %08lX", (unsigned long)READ_DPR(pSmi, i));
- }
-
- xf86ErrorFVerb(VERBLEV, "\n\nVPR x0 x4 x8 xC");
- for (i = 0x00; i <= 0x60; i += 4)
- {
- if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
- xf86ErrorFVerb(VERBLEV, " %08lX", (unsigned long)READ_VPR(pSmi, i));
- }
-
- xf86ErrorFVerb(VERBLEV, "\n\nCPR x0 x4 x8 xC");
- for (i = 0x00; i <= 0x18; i += 4)
- {
- if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
- xf86ErrorFVerb(VERBLEV, " %08lX", (unsigned long)READ_CPR(pSmi, i));
- }
-
- xf86ErrorFVerb(VERBLEV, "\n\n");
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
- "END register dump --------------------\n");
+ if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
+ if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " ");
+ xf86ErrorFVerb(VERBLEV, "%02X ",
+ VGAIN8_INDEX(pSmi, VGA_ATTR_INDEX, VGA_ATTR_DATA_R, i));
+ }
+ (void) VGAIN8(pSmi, vgaStatus);
+ VGAOUT8(pSmi, VGA_ATTR_INDEX, 0x20);
+
+ xf86ErrorFVerb(VERBLEV, "\n\nDPR x0 x4 x8 xC");
+ for (i = 0x00; i <= 0x44; i += 4) {
+ if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
+ xf86ErrorFVerb(VERBLEV, " %08lX", (unsigned long)READ_DPR(pSmi, i));
+ }
+
+ xf86ErrorFVerb(VERBLEV, "\n\nVPR x0 x4 x8 xC");
+ for (i = 0x00; i <= 0x60; i += 4) {
+ if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
+ xf86ErrorFVerb(VERBLEV, " %08lX", (unsigned long)READ_VPR(pSmi, i));
+ }
+
+ xf86ErrorFVerb(VERBLEV, "\n\nCPR x0 x4 x8 xC");
+ for (i = 0x00; i <= 0x18; i += 4) {
+ if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i);
+ xf86ErrorFVerb(VERBLEV, " %08lX", (unsigned long)READ_CPR(pSmi, i));
+ }
+
+ xf86ErrorFVerb(VERBLEV, "\n\n");
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
+ "END register dump --------------------\n");
}
/*
@@ -3388,212 +3158,197 @@ static void
SMI_DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
int flags)
{
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- SMIPtr pSmi = SMIPTR(pScrn);
- CARD8 SR01, SR20, SR21, SR22, SR23, SR24, SR31, SR34;
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
+ CARD8 SR01, SR20, SR21, SR22, SR23, SR24, SR31, SR34;
- ENTER_PROC("SMI_DisplayPowerManagementSet");
+ ENTER_PROC("SMI_DisplayPowerManagementSet");
- /* If we already are in the requested DPMS mode, just return */
- if (pSmi->CurrentDPMS == PowerManagementMode)
- {
- LEAVE_PROC("SMI_DisplayPowerManagementSet");
- return;
- }
+ /* If we already are in the requested DPMS mode, just return */
+ if (pSmi->CurrentDPMS == PowerManagementMode) {
+ LEAVE_PROC("SMI_DisplayPowerManagementSet");
+ return;
+ }
#if 1 /* PDR#735 */
- if (pSmi->useBIOS && pSmi->pInt10 != NULL)
- {
- pSmi->pInt10->ax = 0x4F10;
- switch (PowerManagementMode)
- {
- case DPMSModeOn:
- pSmi->pInt10->bx = 0x0001;
- break;
-
- case DPMSModeStandby:
- pSmi->pInt10->bx = 0x0101;
- break;
-
- case DPMSModeSuspend:
- pSmi->pInt10->bx = 0x0201;
- break;
-
- case DPMSModeOff:
- pSmi->pInt10->bx = 0x0401;
- break;
- }
- pSmi->pInt10->cx = 0x0000;
- pSmi->pInt10->num = 0x10;
- xf86ExecX86int10(pSmi->pInt10);
- if (pSmi->pInt10->ax == 0x004F)
- {
- pSmi->CurrentDPMS = PowerManagementMode;
+ if (pSmi->useBIOS && pSmi->pInt10 != NULL) {
+ pSmi->pInt10->ax = 0x4F10;
+ switch (PowerManagementMode) {
+ case DPMSModeOn:
+ pSmi->pInt10->bx = 0x0001;
+ break;
+ case DPMSModeStandby:
+ pSmi->pInt10->bx = 0x0101;
+ break;
+ case DPMSModeSuspend:
+ pSmi->pInt10->bx = 0x0201;
+ break;
+ case DPMSModeOff:
+ pSmi->pInt10->bx = 0x0401;
+ break;
+ }
+ pSmi->pInt10->cx = 0x0000;
+ pSmi->pInt10->num = 0x10;
+ xf86ExecX86int10(pSmi->pInt10);
+ if (pSmi->pInt10->ax == 0x004F) {
+ pSmi->CurrentDPMS = PowerManagementMode;
#if 1 /* PDR#835 */
- if (PowerManagementMode == DPMSModeOn)
- {
- SR01 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x01);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x01,
- SR01 & ~0x20);
- }
+ if (PowerManagementMode == DPMSModeOn) {
+ SR01 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x01);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x01,
+ SR01 & ~0x20);
+ }
#endif
- LEAVE_PROC("SMI_DisplayPowerManagementSet");
- return;
- }
+ LEAVE_PROC("SMI_DisplayPowerManagementSet");
+ return;
}
+ }
#endif
- /* Save the current SR registers */
- if (pSmi->CurrentDPMS == DPMSModeOn)
- {
- pSmi->DPMS_SR20 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x20);
- pSmi->DPMS_SR21 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
- pSmi->DPMS_SR31 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31);
- pSmi->DPMS_SR34 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x34);
- }
-
- /* Read the required SR registers for the DPMS handler */
- SR01 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x01);
- SR20 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x20);
- SR21 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
- SR22 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x22);
- SR23 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x23);
- SR24 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x24);
- SR31 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31);
- SR34 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x34);
-
- switch (PowerManagementMode)
- {
- case DPMSModeOn:
- /* Screen On: HSync: On, VSync : On */
- SR01 &= ~0x20;
- SR20 = pSmi->DPMS_SR20;
- SR21 = pSmi->DPMS_SR21;
- SR22 &= ~0x30;
- SR23 &= ~0xC0;
- SR24 |= 0x01;
- SR31 = pSmi->DPMS_SR31;
- SR34 = pSmi->DPMS_SR34;
- break;
-
- case DPMSModeStandby:
- /* Screen: Off; HSync: Off, VSync: On */
- SR01 |= 0x20;
- SR20 = (SR20 & ~0xB0) | 0x10;
- SR21 |= 0x88;
- SR22 = (SR22 & ~0x30) | 0x10;
- SR23 = (SR23 & ~0x07) | 0xD8;
- SR24 &= ~0x01;
- SR31 = (SR31 & ~0x07) | 0x00;
- SR34 |= 0x80;
- break;
-
- case DPMSModeSuspend:
- /* Screen: Off; HSync: On, VSync: Off */
- SR01 |= 0x20;
- SR20 = (SR20 & ~0xB0) | 0x10;
- SR21 |= 0x88;
- SR22 = (SR22 & ~0x30) | 0x20;
- SR23 = (SR23 & ~0x07) | 0xD8;
- SR24 &= ~0x01;
- SR31 = (SR31 & ~0x07) | 0x00;
- SR34 |= 0x80;
- break;
-
- case DPMSModeOff:
- /* Screen: Off; HSync: Off, VSync: Off */
- SR01 |= 0x20;
- SR20 = (SR20 & ~0xB0) | 0x10;
- SR21 |= 0x88;
- SR22 = (SR22 & ~0x30) | 0x30;
- SR23 = (SR23 & ~0x07) | 0xD8;
- SR24 &= ~0x01;
- SR31 = (SR31 & ~0x07) | 0x00;
- SR34 |= 0x80;
- break;
-
- default:
- xf86ErrorFVerb(VERBLEV, "Invalid PowerManagementMode %d passed to "
- "SMI_DisplayPowerManagementSet\n", PowerManagementMode);
- LEAVE_PROC("SMI_DisplayPowerManagementSet");
- return;
- }
-
- /* Wait for vertical retrace */
- while (hwp->readST01(hwp) & 0x8) ;
- while (!(hwp->readST01(hwp) & 0x8)) ;
-
- /* Write the registers */
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x01, SR01);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x34, SR34);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31, SR31);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x20, SR20);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x22, SR22);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x23, SR23);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, SR21);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x24, SR24);
-
- /* Save the current power state */
- pSmi->CurrentDPMS = PowerManagementMode;
-
+ /* Save the current SR registers */
+ if (pSmi->CurrentDPMS == DPMSModeOn) {
+ pSmi->DPMS_SR20 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x20);
+ pSmi->DPMS_SR21 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
+ pSmi->DPMS_SR31 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31);
+ pSmi->DPMS_SR34 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x34);
+ }
+
+ /* Read the required SR registers for the DPMS handler */
+ SR01 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x01);
+ SR20 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x20);
+ SR21 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
+ SR22 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x22);
+ SR23 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x23);
+ SR24 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x24);
+ SR31 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31);
+ SR34 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x34);
+
+ switch (PowerManagementMode) {
+ case DPMSModeOn:
+ /* Screen On: HSync: On, VSync : On */
+ SR01 &= ~0x20;
+ SR20 = pSmi->DPMS_SR20;
+ SR21 = pSmi->DPMS_SR21;
+ SR22 &= ~0x30;
+ SR23 &= ~0xC0;
+ SR24 |= 0x01;
+ SR31 = pSmi->DPMS_SR31;
+ SR34 = pSmi->DPMS_SR34;
+ break;
+ case DPMSModeStandby:
+ /* Screen: Off; HSync: Off, VSync: On */
+ SR01 |= 0x20;
+ SR20 = (SR20 & ~0xB0) | 0x10;
+ SR21 |= 0x88;
+ SR22 = (SR22 & ~0x30) | 0x10;
+ SR23 = (SR23 & ~0x07) | 0xD8;
+ SR24 &= ~0x01;
+ SR31 = (SR31 & ~0x07) | 0x00;
+ SR34 |= 0x80;
+ break;
+ case DPMSModeSuspend:
+ /* Screen: Off; HSync: On, VSync: Off */
+ SR01 |= 0x20;
+ SR20 = (SR20 & ~0xB0) | 0x10;
+ SR21 |= 0x88;
+ SR22 = (SR22 & ~0x30) | 0x20;
+ SR23 = (SR23 & ~0x07) | 0xD8;
+ SR24 &= ~0x01;
+ SR31 = (SR31 & ~0x07) | 0x00;
+ SR34 |= 0x80;
+ break;
+ case DPMSModeOff:
+ /* Screen: Off; HSync: Off, VSync: Off */
+ SR01 |= 0x20;
+ SR20 = (SR20 & ~0xB0) | 0x10;
+ SR21 |= 0x88;
+ SR22 = (SR22 & ~0x30) | 0x30;
+ SR23 = (SR23 & ~0x07) | 0xD8;
+ SR24 &= ~0x01;
+ SR31 = (SR31 & ~0x07) | 0x00;
+ SR34 |= 0x80;
+ break;
+ default:
+ xf86ErrorFVerb(VERBLEV, "Invalid PowerManagementMode %d passed to "
+ "SMI_DisplayPowerManagementSet\n", PowerManagementMode);
LEAVE_PROC("SMI_DisplayPowerManagementSet");
+ return;
+ }
+
+ /* Wait for vertical retrace */
+ while (hwp->readST01(hwp) & 0x8) ;
+ while (!(hwp->readST01(hwp) & 0x8)) ;
+
+ /* Write the registers */
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x01, SR01);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x34, SR34);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31, SR31);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x20, SR20);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x22, SR22);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x23, SR23);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, SR21);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x24, SR24);
+
+ /* Save the current power state */
+ pSmi->CurrentDPMS = PowerManagementMode;
+
+ LEAVE_PROC("SMI_DisplayPowerManagementSet");
}
static void
SMI_ProbeDDC(ScrnInfoPtr pScrn, int index)
{
- vbeInfoPtr pVbe;
- if (xf86LoadSubModule(pScrn, "vbe"))
- {
- pVbe = VBEInit(NULL, index);
- ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
- vbeFree(pVbe);
- }
+ vbeInfoPtr pVbe;
+ if (xf86LoadSubModule(pScrn, "vbe")) {
+ pVbe = VBEInit(NULL, index);
+ ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
+ }
}
static unsigned int
SMI_ddc1Read(ScrnInfoPtr pScrn)
{
- register vgaHWPtr hwp = VGAHWPTR(pScrn);
- SMIPtr pSmi = SMIPTR(pScrn);
- unsigned int ret;
+ register vgaHWPtr hwp = VGAHWPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
+ unsigned int ret;
- ENTER_PROC("SMI_ddc1Read");
+ ENTER_PROC("SMI_ddc1Read");
- while (hwp->readST01(hwp) & 0x8) ;
- while (!(hwp->readST01(hwp) & 0x8)) ;
+ while (hwp->readST01(hwp) & 0x8) ;
+ while (!(hwp->readST01(hwp) & 0x8)) ;
- ret = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72) & 0x08;
+ ret = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72) & 0x08;
- LEAVE_PROC("SMI_ddc1Read");
- return(ret);
+ LEAVE_PROC("SMI_ddc1Read");
+ return ret;
}
static Bool
SMI_ddc1(int scrnIndex)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- SMIPtr pSmi = SMIPTR(pScrn);
- Bool success = FALSE;
- xf86MonPtr pMon;
- unsigned char tmp;
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ Bool success = FALSE;
+ xf86MonPtr pMon;
+ unsigned char tmp;
- ENTER_PROC("SMI_ddc1");
+ ENTER_PROC("SMI_ddc1");
- tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72, tmp | 0x20);
+ tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72, tmp | 0x20);
- pMon = xf86PrintEDID(xf86DoEDID_DDC1(scrnIndex,
- vgaHWddc1SetSpeedWeak(),
- SMI_ddc1Read));
- if (pMon != NULL)
- {
- success = TRUE;
- }
- xf86SetDDCproperties(pScrn, pMon);
+ pMon = xf86PrintEDID(xf86DoEDID_DDC1(scrnIndex,
+ vgaHWddc1SetSpeedWeak(),
+ SMI_ddc1Read));
+ if (pMon != NULL) {
+ success = TRUE;
+ }
+ xf86SetDDCproperties(pScrn, pMon);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72, tmp);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72, tmp);
- LEAVE_PROC("SMI_ddc1");
- return(success);
+ LEAVE_PROC("SMI_ddc1");
+ return success;
}
+
diff --git a/driver/xf86-video-siliconmotion/src/smi_exa.c b/driver/xf86-video-siliconmotion/src/smi_exa.c
new file mode 100644
index 000000000..575ab650e
--- /dev/null
+++ b/driver/xf86-video-siliconmotion/src/smi_exa.c
@@ -0,0 +1,540 @@
+/*
+Copyright (C) 2006 Dennis De Winter All Rights Reserved.
+Copyright (C) 2007 Alex Deucher 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, 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 CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "smi.h"
+
+
+static void
+SMI_EXASync(ScreenPtr pScreen, int marker);
+
+static Bool
+SMI_PrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap,
+ int xdir, int ydir, int alu, Pixel planemask);
+
+static void
+SMI_Copy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, int width, int height);
+
+static void
+SMI_DoneCopy(PixmapPtr pDstPixmap);
+
+static Bool
+SMI_PrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg);
+
+static void
+SMI_Solid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2);
+
+static void
+SMI_DoneSolid(PixmapPtr pPixmap);
+
+Bool
+SMI_UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int src_pitch);
+
+Bool
+SMI_DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch);
+
+Bool
+SMI_EXAInit(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_EXAInit");
+
+ if (!(pSmi->EXADriverPtr = exaDriverAlloc())) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate EXADriverRec.\n");
+ LEAVE_PROC("SMI_EXAInit");
+ return FALSE;
+ }
+
+ pSmi->EXADriverPtr->exa_major = 2;
+ pSmi->EXADriverPtr->exa_minor = 0;
+
+ SMI_EngineReset(pScrn);
+
+ /* Memory Manager */
+ pSmi->EXADriverPtr->memoryBase = pSmi->FBBase + pSmi->FBOffset;
+ pSmi->EXADriverPtr->memorySize = pSmi->FBReserved;
+ pSmi->EXADriverPtr->offScreenBase = pSmi->width * pSmi->height * pSmi->Bpp;
+
+ /* Flags */
+ pSmi->EXADriverPtr->flags = EXA_TWO_BITBLT_DIRECTIONS;
+ if (pSmi->EXADriverPtr->memorySize > pSmi->EXADriverPtr->offScreenBase) {
+ /* Offscreen Pixmaps */
+ pSmi->EXADriverPtr->flags |= EXA_OFFSCREEN_PIXMAPS;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "EXA offscreen memory manager enabled.\n");
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Not enough video RAM for EXA offscreen memory manager.\n");
+ }
+
+ /* 12 bit coordinates */
+ pSmi->EXADriverPtr->maxX = 4096;
+ pSmi->EXADriverPtr->maxY = 4096;
+
+ if (pScrn->bitsPerPixel == 24) {
+ pSmi->EXADriverPtr->maxX = 4096 / 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ pSmi->EXADriverPtr->maxY = 4096 / 3;
+ }
+ }
+
+ pSmi->EXADriverPtr->pixmapPitchAlign = 16;
+ pSmi->EXADriverPtr->pixmapOffsetAlign = 8;
+
+ /* Sync */
+ pSmi->EXADriverPtr->WaitMarker = SMI_EXASync;
+
+ /* Copy */
+ pSmi->EXADriverPtr->PrepareCopy = SMI_PrepareCopy;
+ pSmi->EXADriverPtr->Copy = SMI_Copy;
+ pSmi->EXADriverPtr->DoneCopy = SMI_DoneCopy;
+
+ /* Solid */
+ pSmi->EXADriverPtr->PrepareSolid = SMI_PrepareSolid;
+ pSmi->EXADriverPtr->Solid = SMI_Solid;
+ pSmi->EXADriverPtr->DoneSolid = SMI_DoneSolid;
+
+#if 0
+ /* DFS & UTS */
+ pSmi->EXADriverPtr->UploadToScreen = SMI_UploadToScreen;
+ pSmi->EXADriverPtr->DownloadFromScreen = SMI_DownloadFromScreen;
+#endif
+
+ if(!exaDriverInit(pScreen, pSmi->EXADriverPtr)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "exaDriverInit failed.\n");
+ LEAVE_PROC("SMI_EXAInit");
+ return FALSE;
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EXA Acceleration enabled.\n");
+ LEAVE_PROC("SMI_EXAInit");
+ return TRUE;
+ }
+}
+
+static void
+SMI_EXASync(ScreenPtr pScreen, int marker)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(xf86Screens[pScreen->myNum]);
+
+ ENTER_PROC("SMI_EXASync");
+
+ WaitIdleEmpty();
+
+ LEAVE_PROC("SMI_EXASync");
+}
+
+static CARD32
+SMI_DEDataFormat(PixmapPtr pPixmap) {
+ CARD32 DEDataFormat = 0;
+
+ switch (pPixmap->drawable.bitsPerPixel) {
+ case 8:
+ DEDataFormat = 0x00000000;
+ break;
+ case 16:
+ DEDataFormat = 0x00100000;
+ break;
+ case 24:
+ DEDataFormat = 0x00300000;
+ break;
+ case 32:
+ DEDataFormat = 0x00200000;
+ break;
+ }
+ return DEDataFormat;
+}
+
+/* ----------------------------------------------------- EXA Copy ---------------------------------------------- */
+
+CARD8 SMI_BltRop[16] = /* table stolen from KAA */
+{
+ /* GXclear */ 0x00, /* 0 */
+ /* GXand */ 0x88, /* src AND dst */
+ /* GXandReverse */ 0x44, /* src AND NOT dst */
+ /* GXcopy */ 0xCC, /* src */
+ /* GXandInverted*/ 0x22, /* NOT src AND dst */
+ /* GXnoop */ 0xAA, /* dst */
+ /* GXxor */ 0x66, /* src XOR dst */
+ /* GXor */ 0xEE, /* src OR dst */
+ /* GXnor */ 0x11, /* NOT src AND NOT dst */
+ /* GXequiv */ 0x99, /* NOT src XOR dst */
+ /* GXinvert */ 0x55, /* NOT dst */
+ /* GXorReverse */ 0xDD, /* src OR NOT dst */
+ /* GXcopyInverted*/ 0x33, /* NOT src */
+ /* GXorInverted */ 0xBB, /* NOT src OR dst */
+ /* GXnand */ 0x77, /* NOT src OR NOT dst */
+ /* GXset */ 0xFF, /* 1 */
+};
+
+static Bool
+SMI_PrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir,
+ int alu, Pixel planemask)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int src_pitch, dst_pitch;
+ unsigned long src_offset, dst_offset;
+
+ ENTER_PROC("SMI_PrepareCopy");
+ DEBUG((VERBLEV, "xdir=%d ydir=%d alu=%02X", xdir, ydir, alu));
+
+ /* Bit Mask not supported > 16 bpp */
+ if ((pSrcPixmap->drawable.bitsPerPixel > 16) &&
+ (!EXA_PM_IS_SOLID(&pSrcPixmap->drawable, planemask))) {
+ LEAVE_PROC("SMI_PrepareCopy");
+ return FALSE;
+ }
+
+ /* calculate pitch in pixel unit */
+ src_pitch = exaGetPixmapPitch(pSrcPixmap) / (pSrcPixmap->drawable.bitsPerPixel >> 3);
+ dst_pitch = exaGetPixmapPitch(pDstPixmap) / (pDstPixmap->drawable.bitsPerPixel >> 3);
+ /* calculate offset in 8 byte (64 bit) unit */
+ src_offset = exaGetPixmapOffset(pSrcPixmap) >> 3;
+ dst_offset = exaGetPixmapOffset(pDstPixmap) >> 3;
+
+ pSmi->AccelCmd = SMI_BltRop[alu]
+ | SMI_BITBLT
+ | SMI_QUICK_START;
+
+ if (xdir < 0 || (ydir < 0)) {
+ pSmi->AccelCmd |= SMI_RIGHT_TO_LEFT;
+ }
+
+ WaitQueue(7);
+ /* Destination and Source Window Widths */
+ WRITE_DPR(pSmi, 0x3C, (dst_pitch << 16) | (src_pitch & 0xFFFF));
+
+ if (pDstPixmap->drawable.bitsPerPixel == 24) {
+ src_pitch *= 3;
+ dst_pitch *= 3;
+ }
+
+ /* Bit Mask (planemask) - 16 bit only */
+ if (pSrcPixmap->drawable.bitsPerPixel == 16) {
+ WRITE_DPR(pSmi, 0x28, planemask | 0xFFFF0000);
+ } else {
+ WRITE_DPR(pSmi, 0x28, 0xFFFFFFFF);
+ }
+
+ /* Destination and Source Row Pitch */
+ WRITE_DPR(pSmi, 0x10, (dst_pitch << 16) | (src_pitch & 0xFFFF));
+ /* Drawing engine data format */
+ WRITE_DPR(pSmi, 0x1C, SMI_DEDataFormat(pDstPixmap));
+ /* Destination and Source Base Address (offset) */
+ WRITE_DPR(pSmi, 0x40, src_offset);
+ WRITE_DPR(pSmi, 0x44, dst_offset);
+
+ WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
+
+ LEAVE_PROC("SMI_PrepareCopy");
+ return TRUE;
+}
+
+static void
+SMI_Copy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX,
+ int dstY, int width, int height)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_Copy");
+ DEBUG((VERBLEV, "srcX=%d srcY=%d dstX=%d dstY=%d width=%d height=%d\n",
+ srcX, srcY, dstX, dstY, width, height));
+
+ if (pSmi->AccelCmd & SMI_RIGHT_TO_LEFT) {
+ srcX += width - 1;
+ srcY += height - 1;
+ dstX += width - 1;
+ dstY += height - 1;
+ }
+
+ if (pDstPixmap->drawable.bitsPerPixel == 24) {
+ srcX *= 3;
+ dstX *= 3;
+ width *= 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ srcY *= 3;
+ dstY *= 3;
+ }
+
+ if (pSmi->AccelCmd & SMI_RIGHT_TO_LEFT) {
+ srcX += 2;
+ dstX += 2;
+ }
+ }
+
+ WaitQueue(3);
+ WRITE_DPR(pSmi, 0x00, (srcX << 16) + (srcY & 0xFFFF));
+ WRITE_DPR(pSmi, 0x04, (dstX << 16) + (dstY & 0xFFFF));
+ WRITE_DPR(pSmi, 0x08, (width << 16) + (height & 0xFFFF));
+
+ LEAVE_PROC("SMI_Copy");
+}
+
+static void
+SMI_DoneCopy(PixmapPtr pDstPixmap)
+{
+ ENTER_PROC("SMI_DoneCopy");
+
+ LEAVE_PROC("SMI_DoneCopy");
+}
+
+/* ----------------------------------------------------- EXA Solid --------------------------------------------- */
+
+CARD8 SMI_SolidRop[16] = /* table stolen from KAA */
+{
+ /* GXclear */ 0x00, /* 0 */
+ /* GXand */ 0xA0, /* src AND dst */
+ /* GXandReverse */ 0x50, /* src AND NOT dst */
+ /* GXcopy */ 0xF0, /* src */
+ /* GXandInverted*/ 0x0A, /* NOT src AND dst */
+ /* GXnoop */ 0xAA, /* dst */
+ /* GXxor */ 0x5A, /* src XOR dst */
+ /* GXor */ 0xFA, /* src OR dst */
+ /* GXnor */ 0x05, /* NOT src AND NOT dst */
+ /* GXequiv */ 0xA5, /* NOT src XOR dst */
+ /* GXinvert */ 0x55, /* NOT dst */
+ /* GXorReverse */ 0xF5, /* src OR NOT dst */
+ /* GXcopyInverted*/ 0x0F, /* NOT src */
+ /* GXorInverted */ 0xAF, /* NOT src OR dst */
+ /* GXnand */ 0x5F, /* NOT src OR NOT dst */
+ /* GXset */ 0xFF, /* 1 */
+};
+
+static Bool
+SMI_PrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int dst_pitch;
+ unsigned long dst_offset;
+
+ ENTER_PROC("SMI_PrepareSolid");
+ DEBUG((VERBLEV, "alu=%02X\n", alu));
+
+ /* HW ignores alpha */
+ if (pPixmap->drawable.bitsPerPixel == 32)
+ return FALSE;
+
+ /* Bit Mask not supported > 16 bpp */
+ if ((pPixmap->drawable.bitsPerPixel > 16) &&
+ (!EXA_PM_IS_SOLID(&pPixmap->drawable, planemask))) {
+ LEAVE_PROC("SMI_PrepareCopy");
+ return FALSE;
+ }
+
+ /* calculate pitch in pixel unit */
+ dst_pitch = exaGetPixmapPitch(pPixmap) / (pPixmap->drawable.bitsPerPixel >> 3);
+ /* calculate offset in 8 byte (64 bit) unit */
+ dst_offset = exaGetPixmapOffset(pPixmap) >> 3;
+
+ pSmi->AccelCmd = SMI_SolidRop[alu]
+ | SMI_BITBLT
+ | SMI_QUICK_START;
+
+ WaitQueue(10);
+ /* Destination Window Width */
+ WRITE_DPR(pSmi, 0x3C, (dst_pitch << 16) | (dst_pitch & 0xFFFF));
+
+ if (pPixmap->drawable.bitsPerPixel == 24) {
+ dst_pitch *= 3;
+ }
+
+ /* Bit Mask (planemask) - 16 bit only */
+ if (pPixmap->drawable.bitsPerPixel == 16) {
+ WRITE_DPR(pSmi, 0x28, planemask | 0xFFFF0000);
+ } else {
+ WRITE_DPR(pSmi, 0x28, 0xFFFFFFFF);
+ }
+
+ /* Destination Row Pitch */
+ WRITE_DPR(pSmi, 0x10, (dst_pitch << 16) | (dst_pitch & 0xFFFF));
+ /* Drawing engine data format */
+ WRITE_DPR(pSmi, 0x1C, SMI_DEDataFormat(pPixmap));
+ /* Source and Destination Base Address (offset) */
+ WRITE_DPR(pSmi, 0x40, dst_offset);
+ WRITE_DPR(pSmi, 0x44, dst_offset);
+ /* Foreground Color */
+ WRITE_DPR(pSmi, 0x14, fg);
+ /* Mono Pattern High and Low */
+ WRITE_DPR(pSmi, 0x34, 0xFFFFFFFF);
+ WRITE_DPR(pSmi, 0x38, 0xFFFFFFFF);
+
+ WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
+
+ LEAVE_PROC("SMI_PrepareSolid");
+ return TRUE;
+}
+
+static void
+SMI_Solid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int w, h;
+
+ ENTER_PROC("SMI_Solid");
+ DEBUG((VERBLEV, "x1=%d y1=%d x2=%d y2=%d\n", x1, y1, x2, y2));
+
+ w = (x2 - x1);
+ h = (y2 - y1);
+
+ if (pPixmap->drawable.bitsPerPixel == 24) {
+ x1 *= 3;
+ w *= 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ y1 *= 3;
+ }
+ }
+
+ WaitQueue(2);
+ WRITE_DPR(pSmi, 0x04, (x1 << 16) | (y1 & 0xFFFF));
+ WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
+
+ LEAVE_PROC("SMI_Solid");
+}
+
+static void
+SMI_DoneSolid(PixmapPtr pPixmap)
+{
+ ENTER_PROC("SMI_DoneSolid");
+
+ LEAVE_PROC("SMI_DoneSolid");
+}
+
+/* --------------------------------------- EXA DFS & UTS ---------------------------------------- */
+
+Bool
+SMI_DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
+ char *dst, int dst_pitch)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_DownloadFromScreen");
+ DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d dst=%d dst_pitch=%d\n",
+ x, y, w, h, dst, dst_pitch));
+
+ unsigned char *src = pSrc->devPrivate.ptr;
+ int src_pitch = exaGetPixmapPitch(pSrc);
+
+ exaWaitSync(pSrc->drawable.pScreen);
+
+ src += (y * src_pitch) + (x * pSmi->Bpp);
+ w *= pSmi->Bpp;
+
+ while (h--) {
+ memcpy(dst, src, w);
+ src += src_pitch;
+ dst += dst_pitch;
+ }
+
+ return TRUE;
+ LEAVE_PROC("SMI_DownloadFromScreen");
+}
+
+Bool
+SMI_UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
+ char *src, int src_pitch)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int dst_pitch, source_pitch, align, aligned_pitch;
+ unsigned long dst_offset;
+
+ ENTER_PROC("SMI_UploadToScreen");
+ DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d src=%d src_pitch=%d\n",
+ x, y, w, h, src, src_pitch));
+
+ if (pDst->drawable.bitsPerPixel == 24) {
+ align = 16;
+ } else {
+ align = 128 / pDst->drawable.bitsPerPixel;
+ }
+
+ aligned_pitch = (src_pitch + align - 1) & ~(align - 1);
+
+ /* calculate pitch in pixel unit */
+ dst_pitch = exaGetPixmapPitch(pDst) / (pDst->drawable.bitsPerPixel >> 3);
+ source_pitch = src_pitch / (pDst->drawable.bitsPerPixel >> 3);
+ /* calculate offset in 8 byte (64 bit) unit */
+ dst_offset = exaGetPixmapOffset(pDst) >> 3;
+
+ pSmi->AccelCmd = 0xCC /* GXcopy */
+ | SMI_HOSTBLT_WRITE
+ | SMI_QUICK_START;
+
+ /* set clipping */
+ SMI_SetClippingRectangle(pScrn, x, y, x+w, y+h);
+
+ WaitQueue(7);
+ /* Destination and Source Window Widths */
+ WRITE_DPR(pSmi, 0x3C, (dst_pitch << 16) | (source_pitch & 0xFFFF));
+
+ if (pDst->drawable.bitsPerPixel == 24) {
+ x *= 3;
+ w *= 3;
+ dst_pitch *= 3;
+ if (pSmi->Chipset == SMI_LYNX) {
+ y *= 3;
+ }
+ }
+
+ /* Source and Destination Row Pitch */
+ WRITE_DPR(pSmi, 0x10, (dst_pitch << 16) | (source_pitch & 0xFFFF));
+ /* Drawing engine data format */
+ WRITE_DPR(pSmi, 0x1C, SMI_DEDataFormat(pDst));
+ /* Source and Destination Base Address (offset) */
+ WRITE_DPR(pSmi, 0x40, 0);
+ WRITE_DPR(pSmi, 0x44, dst_offset);
+
+ WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
+ WRITE_DPR(pSmi, 0x00, 0);
+ WRITE_DPR(pSmi, 0x04, (x << 16) | (y * 0xFFFF));
+ WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
+
+ while (h--) {
+ WaitQueue(aligned_pitch);
+ memcpy(pSmi->DataPortBase, src, aligned_pitch);
+ src += src_pitch;
+ }
+
+ /* disable clipping */
+ SMI_DisableClipping(pScrn);
+
+ exaWaitSync(pDst->drawable.pScreen);
+
+ LEAVE_PROC("SMI_UploadToScreen");
+
+ return TRUE;
+}
+
diff --git a/driver/xf86-video-siliconmotion/src/smi_hwcurs.c b/driver/xf86-video-siliconmotion/src/smi_hwcurs.c
index 003e7ef68..b48a409a5 100644
--- a/driver/xf86-video-siliconmotion/src/smi_hwcurs.c
+++ b/driver/xf86-video-siliconmotion/src/smi_hwcurs.c
@@ -26,7 +26,6 @@ Silicon Motion 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 and Silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_hwcurs.c,v 1.1 2000/11/28 20:59:20 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -40,184 +39,160 @@ authorization from the XFree86 Project and Silicon Motion.
static unsigned char *
SMI_RealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
{
- SMIPtr pSmi = SMIPTR(infoPtr->pScrn);
- CursorBitsPtr bits = pCurs->bits;
- unsigned char * ram;
- unsigned char * psource = bits->source;
- unsigned char * pmask = bits->mask;
- int x, y, srcwidth, i;
-
- ENTER_PROC("SMI_RealizeCursor");
-
- /* Allocate memory */
- ram = (unsigned char *) xcalloc(1, 1024);
- if (ram == NULL)
- {
- LEAVE_PROC("SMI_RealizeCursor");
- return(NULL);
+ SMIPtr pSmi = SMIPTR(infoPtr->pScrn);
+ CursorBitsPtr bits = pCurs->bits;
+ unsigned char * ram;
+ unsigned char * psource = bits->source;
+ unsigned char * pmask = bits->mask;
+ int x, y, srcwidth, i;
+
+ ENTER_PROC("SMI_RealizeCursor");
+
+ /* Allocate memory */
+ ram = (unsigned char *) xcalloc(1, 1024);
+ if (ram == NULL) {
+ LEAVE_PROC("SMI_RealizeCursor");
+ return NULL;
+ }
+
+ /* Calculate cursor information */
+ srcwidth = ((bits->width + 31) / 8) & ~3;
+ i = 0;
+
+ switch (pSmi->rotate) {
+ default:
+ /* Copy cursor image */
+ for (y = 0; y < min(MAX_CURSOR, bits->height); y++) {
+ for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++) {
+ unsigned char mask = byte_reversed[*pmask++];
+ unsigned char source = byte_reversed[*psource++] & mask;
+
+ ram[i++] = ~mask;
+ ram[i++] = source;
+ if (i & 4) i += 4;
+ }
+
+ pmask += srcwidth - x;
+ psource += srcwidth - x;
+
+ /* Fill remaining part of line with no shape */
+ for (; x < MAX_CURSOR / 8; x++) {
+ ram[i++] = 0xFF;
+ ram[i++] = 0x00;
+ if (i & 4) i += 4;
+ }
}
- /* Calculate cursor information */
- srcwidth = ((bits->width + 31) / 8) & ~3;
- i = 0;
-
- switch (pSmi->rotate)
- {
- default:
- /* Copy cursor image */
- for (y = 0; y < min(MAX_CURSOR, bits->height); y++)
- {
- for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++)
- {
- unsigned char mask = byte_reversed[*pmask++];
- unsigned char source = byte_reversed[*psource++] & mask;
-
- ram[i++] = ~mask;
- ram[i++] = source;
- if (i & 4) i += 4;
- }
-
- pmask += srcwidth - x;
- psource += srcwidth - x;
-
- /* Fill remaining part of line with no shape */
- for (; x < MAX_CURSOR / 8; x++)
- {
- ram[i++] = 0xFF;
- ram[i++] = 0x00;
- if (i & 4) i += 4;
- }
- }
+ /* Fill remaining part of memory with no shape */
+ for (; y < MAX_CURSOR; y++) {
+ for (x = 0; x < MAX_CURSOR / 8; x++) {
+ ram[i++] = 0xFF;
+ ram[i++] = 0x00;
+ if (i & 4) i += 4;
+ }
+ }
+ break;
+ case SMI_ROTATE_CW:
+ /* Initialize cursor memory */
+ for (i = 0; i < 1024;) {
+ ram[i++] = 0xFF;
+ ram[i++] = 0x00;
+ if (i & 4) i += 4;
+ }
- /* Fill remaining part of memory with no shape */
- for (; y < MAX_CURSOR; y++)
- {
- for (x = 0; x < MAX_CURSOR / 8; x++)
- {
- ram[i++] = 0xFF;
- ram[i++] = 0x00;
- if (i & 4) i += 4;
- }
- }
- break;
-
- case SMI_ROTATE_CW:
- /* Initialize cursor memory */
- for (i = 0; i < 1024;)
- {
- ram[i++] = 0xFF;
- ram[i++] = 0x00;
- if (i & 4) i += 4;
+ /* Rotate cursor image */
+ for (y = 0; y < min(MAX_CURSOR, bits->height); y++) {
+ unsigned char bitmask = 0x01 << (y & 7);
+ int index = ((MAX_CURSOR - y - 1) / 8) * 2;
+ if (index & 4) index += 4;
+
+ for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++) {
+ unsigned char mask = *pmask++;
+ unsigned char source = *psource++ & mask;
+
+ i = index + (x * 8) * 16;
+ if (mask || (source & mask)) {
+ unsigned char bit;
+ for (bit = 0x01; bit; bit <<= 1) {
+ if (mask & bit) {
+ ram[i + 0] &= ~bitmask;
}
- /* Rotate cursor image */
- for (y = 0; y < min(MAX_CURSOR, bits->height); y++)
- {
- unsigned char bitmask = 0x01 << (y & 7);
- int index = ((MAX_CURSOR - y - 1) / 8) * 2;
- if (index & 4) index += 4;
-
- for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++)
- {
- unsigned char mask = *pmask++;
- unsigned char source = *psource++ & mask;
-
- i = index + (x * 8) * 16;
- if (mask || (source & mask))
- {
- unsigned char bit;
- for (bit = 0x01; bit; bit <<= 1)
- {
- if (mask & bit)
- {
- ram[i + 0] &= ~bitmask;
- }
-
- if (source & bit)
- {
- ram[i + 1] |= bitmask;
- }
-
- i += 16;
- }
- }
- }
-
- pmask += srcwidth - x;
- psource += srcwidth - x;
+ if (source & bit) {
+ ram[i + 1] |= bitmask;
}
- break;
-
- case SMI_ROTATE_CCW:
- /* Initialize cursor memory */
- for (i = 0; i < 1024;)
- {
- ram[i++] = 0xFF;
- ram[i++] = 0x00;
- if (i & 4) i += 4;
+
+ i += 16;
+ }
+ }
+ }
+
+ pmask += srcwidth - x;
+ psource += srcwidth - x;
+ }
+ break;
+ case SMI_ROTATE_CCW:
+ /* Initialize cursor memory */
+ for (i = 0; i < 1024;) {
+ ram[i++] = 0xFF;
+ ram[i++] = 0x00;
+ if (i & 4) i += 4;
+ }
+
+ /* Rotate cursor image */
+ for (y = 0; y < min(MAX_CURSOR, bits->height); y++) {
+ unsigned char bitmask = 0x80 >> (y & 7);
+ int index = (y >> 3) * 2;
+ if (index & 4) index += 4;
+
+ for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++) {
+ unsigned char mask = *pmask++;
+ unsigned char source = *psource++ & mask;
+
+ i = index + (MAX_CURSOR - x * 8 - 1) * 16;
+ if (mask || (source & mask)) {
+ unsigned char bit;
+ for (bit = 0x01; bit; bit <<= 1) {
+ if (mask & bit) {
+ ram[i + 0] &= ~bitmask;
}
- /* Rotate cursor image */
- for (y = 0; y < min(MAX_CURSOR, bits->height); y++)
- {
- unsigned char bitmask = 0x80 >> (y & 7);
- int index = (y >> 3) * 2;
- if (index & 4) index += 4;
-
- for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++)
- {
- unsigned char mask = *pmask++;
- unsigned char source = *psource++ & mask;
-
- i = index + (MAX_CURSOR - x * 8 - 1) * 16;
- if (mask || (source & mask))
- {
- unsigned char bit;
- for (bit = 0x01; bit; bit <<= 1)
- {
- if (mask & bit)
- {
- ram[i + 0] &= ~bitmask;
- }
-
- if (source & bit)
- {
- ram[i + 1] |= bitmask;
- }
-
- i -= 16;
- }
- }
- }
-
- pmask += srcwidth - x;
- psource += srcwidth - x;
+ if (source & bit) {
+ ram[i + 1] |= bitmask;
}
- break;
+
+ i -= 16;
+ }
+ }
+ }
+
+ pmask += srcwidth - x;
+ psource += srcwidth - x;
}
+ break;
+ }
- LEAVE_PROC("SMI_RealizeCursor");
- return(ram);
+ LEAVE_PROC("SMI_RealizeCursor");
+ return ram;
}
static void
SMI_LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- CARD8 tmp;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ CARD8 tmp;
- ENTER_PROC("SMI_LoadCursorImage");
+ ENTER_PROC("SMI_LoadCursorImage");
/* Load storage location. */
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x80,
- pSmi->FBCursorOffset / 2048);
- tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81) & 0x80;
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81,
- tmp | ((pSmi->FBCursorOffset / 2048) >> 8));
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x80,
+ pSmi->FBCursorOffset / 2048);
+ tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81) & 0x80;
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81,
+ tmp | ((pSmi->FBCursorOffset / 2048) >> 8));
/* Program FPR copy when on the 730 */
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
CARD32 fpr15c;
/* put address in upper word, and disable the cursor */
@@ -226,27 +201,26 @@ SMI_LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
WRITE_FPR(pSmi, FPR15C, fpr15c);
}
- /* Copy cursor image to framebuffer storage */
- memcpy(pSmi->FBBase + pSmi->FBCursorOffset, src, 1024);
+ /* Copy cursor image to framebuffer storage */
+ memcpy(pSmi->FBBase + pSmi->FBCursorOffset, src, 1024);
- LEAVE_PROC("SMI_LoadCursorImage");
+ LEAVE_PROC("SMI_LoadCursorImage");
}
static void
SMI_ShowCursor(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- char tmp;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ char tmp;
- ENTER_PROC("SMI_ShowCursor");
+ ENTER_PROC("SMI_ShowCursor");
- /* Show cursor */
- tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, tmp | 0x80);
+ /* Show cursor */
+ tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, tmp | 0x80);
/* Program FPR copy when on the 730 */
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
CARD32 fpr15c;
/* turn on the top bit */
@@ -255,24 +229,23 @@ SMI_ShowCursor(ScrnInfoPtr pScrn)
WRITE_FPR(pSmi, FPR15C, fpr15c);
}
- LEAVE_PROC("SMI_ShowCursor");
+ LEAVE_PROC("SMI_ShowCursor");
}
static void
SMI_HideCursor(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- char tmp;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ char tmp;
- ENTER_PROC("SMI_HideCursor");
+ ENTER_PROC("SMI_HideCursor");
- /* Hide cursor */
- tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, tmp & ~0x80);
+ /* Hide cursor */
+ tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, tmp & ~0x80);
/* Program FPR copy when on the 730 */
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
CARD32 fpr15c;
/* turn off the top bit */
@@ -281,83 +254,63 @@ SMI_HideCursor(ScrnInfoPtr pScrn)
WRITE_FPR(pSmi, FPR15C, fpr15c);
}
- LEAVE_PROC("SMI_HideCursor");
+ LEAVE_PROC("SMI_HideCursor");
}
static void
SMI_SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- int xoff, yoff;
-
- ENTER_PROC("SMI_SetCursorPosition");
-
- /* Calculate coordinates for rotation */
- switch (pSmi->rotate)
- {
- default:
- xoff = x;
- yoff = y;
- break;
-
- case SMI_ROTATE_CW:
- xoff = pSmi->ShadowHeight - y - MAX_CURSOR;
- yoff = x;
- break;
-
- case SMI_ROTATE_CCW:
- xoff = y;
- yoff = pSmi->ShadowWidth - x - MAX_CURSOR;
- break;
- }
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int xoff, yoff;
+
+ ENTER_PROC("SMI_SetCursorPosition");
+
+ /* Calculate coordinates for rotation */
+ switch (pSmi->rotate) {
+ default:
+ xoff = x;
+ yoff = y;
+ break;
+ case SMI_ROTATE_CW:
+ xoff = pSmi->ShadowHeight - y - MAX_CURSOR;
+ yoff = x;
+ break;
+ case SMI_ROTATE_CCW:
+ xoff = y;
+ yoff = pSmi->ShadowWidth - x - MAX_CURSOR;
+ break;
+ }
- /* Program coordinates */
- if (xoff >= 0)
- {
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x88, xoff & 0xFF);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x89,
- (xoff >> 8) & 0x07);
- }
- else
- {
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x88,
- (-xoff) & (MAX_CURSOR - 1));
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x89, 0x08);
- }
+ /* Program coordinates */
+ if (xoff >= 0) {
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x88, xoff & 0xFF);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x89, (xoff >> 8) & 0x07);
+ } else {
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x88, (-xoff) & (MAX_CURSOR - 1));
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x89, 0x08);
+ }
- if (yoff >= 0)
- {
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8A, yoff & 0xFF);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8B,
- (yoff >> 8) & 0x07);
- }
- else
- {
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8A,
- (-yoff) & (MAX_CURSOR - 1));
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8B, 0x08);
- }
+ if (yoff >= 0) {
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8A, yoff & 0xFF);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8B, (yoff >> 8) & 0x07);
+ } else {
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8A, (-yoff) & (MAX_CURSOR - 1));
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8B, 0x08);
+ }
/* Program FPR copy when on the 730 */
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
CARD32 fpr158;
- if (xoff >= 0)
- {
+ if (xoff >= 0) {
fpr158 = (xoff & FPR158_MASK_MAXBITS)<<16;
- }
- else
- {
+ } else {
fpr158 = (((-xoff) & FPR158_MASK_MAXBITS) | FPR158_MASK_BOUNDARY)<<16;
}
- if (yoff >= 0)
- {
+ if (yoff >= 0) {
fpr158 |= (yoff & FPR158_MASK_MAXBITS);
- }
- else
- {
+ } else {
fpr158 |= (((-yoff) & FPR158_MASK_MAXBITS) | FPR158_MASK_BOUNDARY);
}
@@ -366,34 +319,33 @@ SMI_SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
}
- LEAVE_PROC("SMI_SetCursorPosition");
+ LEAVE_PROC("SMI_SetCursorPosition");
}
static void
SMI_SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- unsigned char packedFG, packedBG;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ unsigned char packedFG, packedBG;
- ENTER_PROC("SMI_SetCursorColors");
+ ENTER_PROC("SMI_SetCursorColors");
- /* Pack the true color into 8 bit */
- packedFG = (fg & 0xE00000) >> 16
- | (fg & 0x00E000) >> 11
- | (fg & 0x0000C0) >> 6
- ;
- packedBG = (bg & 0xE00000) >> 16
- | (bg & 0x00E000) >> 11
- | (bg & 0x0000C0) >> 6
- ;
+ /* Pack the true color into 8 bit */
+ packedFG = (fg & 0xE00000) >> 16
+ | (fg & 0x00E000) >> 11
+ | (fg & 0x0000C0) >> 6
+ ;
+ packedBG = (bg & 0xE00000) >> 16
+ | (bg & 0x00E000) >> 11
+ | (bg & 0x0000C0) >> 6
+ ;
- /* Program the colors */
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8C, packedFG);
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8D, packedBG);
+ /* Program the colors */
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8C, packedFG);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8D, packedBG);
/* Program FPR copy when on the 730 */
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
CARD32 fpr15c;
fpr15c = READ_FPR(pSmi, FPR15C) & FPR15C_MASK_HWCADDREN;
@@ -408,44 +360,44 @@ SMI_SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
Bool
SMI_HWCursorInit(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- SMIPtr pSmi = SMIPTR(pScrn);
- xf86CursorInfoPtr infoPtr;
- Bool ret;
-
- ENTER_PROC("SMI_HWCursorInit");
-
- /* Create cursor infor record */
- infoPtr = xf86CreateCursorInfoRec();
- if (infoPtr == NULL)
- {
- LEAVE_PROC("SMI_HWCursorInit");
- return(FALSE);
- }
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ xf86CursorInfoPtr infoPtr;
+ Bool ret;
+
+ ENTER_PROC("SMI_HWCursorInit");
+
+ /* Create cursor infor record */
+ infoPtr = xf86CreateCursorInfoRec();
+ if (infoPtr == NULL) {
+ LEAVE_PROC("SMI_HWCursorInit");
+ return FALSE;
+ }
pSmi->CursorInfoRec = infoPtr;
- /* Fill in the information */
+ /* Fill in the information */
infoPtr->MaxWidth = MAX_CURSOR;
infoPtr->MaxHeight = MAX_CURSOR;
- infoPtr->Flags = HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8
- | HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK
- | HARDWARE_CURSOR_AND_SOURCE_WITH_MASK
- | HARDWARE_CURSOR_BIT_ORDER_MSBFIRST
- | HARDWARE_CURSOR_TRUECOLOR_AT_8BPP
- | HARDWARE_CURSOR_INVERT_MASK;
+ infoPtr->Flags = HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8
+ | HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK
+ | HARDWARE_CURSOR_AND_SOURCE_WITH_MASK
+ | HARDWARE_CURSOR_BIT_ORDER_MSBFIRST
+ | HARDWARE_CURSOR_TRUECOLOR_AT_8BPP
+ | HARDWARE_CURSOR_INVERT_MASK;
infoPtr->SetCursorColors = SMI_SetCursorColors;
infoPtr->SetCursorPosition = SMI_SetCursorPosition;
infoPtr->LoadCursorImage = SMI_LoadCursorImage;
infoPtr->HideCursor = SMI_HideCursor;
infoPtr->ShowCursor = SMI_ShowCursor;
- infoPtr->RealizeCursor = SMI_RealizeCursor;
+ infoPtr->RealizeCursor = SMI_RealizeCursor;
infoPtr->UseHWCursor = NULL;
- /* Proceed with cursor initialization */
+ /* Proceed with cursor initialization */
ret = xf86InitCursor(pScreen, infoPtr);
- LEAVE_PROC("SMI_HWCursorInit");
- return(ret);
+ LEAVE_PROC("SMI_HWCursorInit");
+ return ret;
}
+
diff --git a/driver/xf86-video-siliconmotion/src/smi_i2c.c b/driver/xf86-video-siliconmotion/src/smi_i2c.c
index f4aa19d7c..a829463c2 100644
--- a/driver/xf86-video-siliconmotion/src/smi_i2c.c
+++ b/driver/xf86-video-siliconmotion/src/smi_i2c.c
@@ -26,7 +26,6 @@ Silicon Motion 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 and Silicon Motion.
*/
-/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -55,64 +54,62 @@ authorization from the XFree86 Project and Silicon Motion.
static void
SMI_I2CPutBits(I2CBusPtr b, int clock, int data)
{
- SMIPtr pSmi = SMIPTR(xf86Screens[b->scrnIndex]);
- unsigned int reg = 0x30;
+ SMIPtr pSmi = SMIPTR(xf86Screens[b->scrnIndex]);
+ unsigned int reg = 0x30;
- ENTER_PROC("SMI_I2CPutBits");
+ ENTER_PROC("SMI_I2CPutBits");
- if (clock) reg |= 0x01;
- if (data) reg |= 0x02;
+ if (clock) reg |= 0x01;
+ if (data) reg |= 0x02;
- VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72, reg);
+ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72, reg);
- LEAVE_PROC("SMI_I2CPutBits");
+ LEAVE_PROC("SMI_I2CPutBits");
}
static void
SMI_I2CGetBits(I2CBusPtr b, int *clock, int *data)
{
- SMIPtr pSmi = SMIPTR(xf86Screens[b->scrnIndex]);
- unsigned int reg = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72);
+ SMIPtr pSmi = SMIPTR(xf86Screens[b->scrnIndex]);
+ unsigned int reg = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72);
- ENTER_PROC("SMI_I2CGetBits");
+ ENTER_PROC("SMI_I2CGetBits");
- *clock = reg & 0x04;
- *data = reg & 0x08;
+ *clock = reg & 0x04;
+ *data = reg & 0x08;
- LEAVE_PROC("SMI_I2CGetBits");
+ LEAVE_PROC("SMI_I2CGetBits");
}
Bool
SMI_I2CInit(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER_PROC("SMI_I2CInit");
-
- if (pSmi->I2C == NULL)
- {
- I2CBusPtr I2CPtr = xf86CreateI2CBusRec();
- if (I2CPtr == NULL)
- {
- LEAVE_PROC("SMI_I2CInit");
- return(FALSE);
- }
-
- I2CPtr->BusName = "I2C bus";
- I2CPtr->scrnIndex = pScrn->scrnIndex;
- I2CPtr->I2CPutBits = SMI_I2CPutBits;
- I2CPtr->I2CGetBits = SMI_I2CGetBits;
-
- if (!xf86I2CBusInit(I2CPtr))
- {
- xf86DestroyI2CBusRec(I2CPtr, TRUE, TRUE);
- LEAVE_PROC("SMI_I2CInit");
- return(FALSE);
- }
-
- pSmi->I2C = I2CPtr;
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_I2CInit");
+
+ if (pSmi->I2C == NULL) {
+ I2CBusPtr I2CPtr = xf86CreateI2CBusRec();
+ if (I2CPtr == NULL) {
+ LEAVE_PROC("SMI_I2CInit");
+ return FALSE;
}
- LEAVE_PROC("SMI_I2CInit");
- return(TRUE);
+ I2CPtr->BusName = "I2C bus";
+ I2CPtr->scrnIndex = pScrn->scrnIndex;
+ I2CPtr->I2CPutBits = SMI_I2CPutBits;
+ I2CPtr->I2CGetBits = SMI_I2CGetBits;
+
+ if (!xf86I2CBusInit(I2CPtr)) {
+ xf86DestroyI2CBusRec(I2CPtr, TRUE, TRUE);
+ LEAVE_PROC("SMI_I2CInit");
+ return FALSE;
+ }
+
+ pSmi->I2C = I2CPtr;
+ }
+
+ LEAVE_PROC("SMI_I2CInit");
+ return TRUE;
}
+
diff --git a/driver/xf86-video-siliconmotion/src/smi_pcirename.h b/driver/xf86-video-siliconmotion/src/smi_pcirename.h
new file mode 100644
index 000000000..9321046b3
--- /dev/null
+++ b/driver/xf86-video-siliconmotion/src/smi_pcirename.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2007 George Sapountzis
+ *
+ * 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
+ */
+
+/**
+ * Macros for porting drivers from legacy xfree86 PCI code to the pciaccess
+ * library. The main purpose being to facilitate source code compatibility.
+ */
+
+#ifndef S3PCIRENAME_H
+#define S3PCIRENAME_H
+
+enum region_type {
+ REGION_MEM,
+ REGION_IO
+};
+
+#ifndef XSERVER_LIBPCIACCESS
+
+/* pciVideoPtr */
+#define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor)
+#define PCI_DEV_DEVICE_ID(_pcidev) ((_pcidev)->chipType)
+#define PCI_DEV_REVISION(_pcidev) ((_pcidev)->chipRev)
+
+#define PCI_SUB_VENDOR_ID(_pcidev) ((_pcidev)->subsysVendor)
+#define PCI_SUB_DEVICE_ID(_pcidev) ((_pcidev)->subsysCard)
+
+#define PCI_DEV_TAG(_pcidev) pciTag((_pcidev)->bus, \
+ (_pcidev)->device, \
+ (_pcidev)->func)
+#define PCI_DEV_BUS(_pcidev) ((_pcidev)->bus)
+#define PCI_DEV_DEV(_pcidev) ((_pcidev)->device)
+#define PCI_DEV_FUNC(_pcidev) ((_pcidev)->func)
+
+/* pciConfigPtr */
+#define PCI_CFG_TAG(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->tag)
+#define PCI_CFG_BUS(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->busnum)
+#define PCI_CFG_DEV(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->devnum)
+#define PCI_CFG_FUNC(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->funcnum)
+
+/* region addr: xfree86 uses different fields for memory regions and I/O ports */
+#define PCI_REGION_BASE(_pcidev, _b, _type) \
+ (((_type) == REGION_MEM) ? (_pcidev)->memBase[(_b)] \
+ : (_pcidev)->ioBase[(_b)])
+
+/* region size: xfree86 uses the log2 of the region size,
+ * but with zero meaning no region, not size of one XXX */
+#define PCI_REGION_SIZE(_pcidev, _b) \
+ (((_pcidev)->size[(_b)] > 0) ? (1 << (_pcidev)->size[(_b)]) : 0)
+
+/* read/write PCI configuration space */
+#define PCI_READ_BYTE(_pcidev, _value_ptr, _offset) \
+ *(_value_ptr) = pciReadByte(PCI_CFG_TAG(_pcidev), (_offset))
+
+#define PCI_READ_LONG(_pcidev, _value_ptr, _offset) \
+ *(_value_ptr) = pciReadLong(PCI_CFG_TAG(_pcidev), (_offset))
+
+#define PCI_WRITE_LONG(_pcidev, _value, _offset) \
+ pciWriteLong(PCI_CFG_TAG(_pcidev), (_offset), (_value))
+
+#else /* XSERVER_LIBPCIACCESS */
+
+typedef struct pci_device *pciVideoPtr;
+
+#define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor_id)
+#define PCI_DEV_DEVICE_ID(_pcidev) ((_pcidev)->device_id)
+#define PCI_DEV_REVISION(_pcidev) ((_pcidev)->revision)
+
+#define PCI_SUB_VENDOR_ID(_pcidev) ((_pcidev)->subvendor_id)
+#define PCI_SUB_DEVICE_ID(_pcidev) ((_pcidev)->subdevice_id)
+
+/* pci-rework functions take a 'pci_device' parameter instead of a tag */
+#define PCI_DEV_TAG(_pcidev) (_pcidev)
+
+/* PCI_DEV macros, typically used in printf's, add domain ? XXX */
+#define PCI_DEV_BUS(_pcidev) ((_pcidev)->bus)
+#define PCI_DEV_DEV(_pcidev) ((_pcidev)->dev)
+#define PCI_DEV_FUNC(_pcidev) ((_pcidev)->func)
+
+/* pci-rework functions take a 'pci_device' parameter instead of a tag */
+#define PCI_CFG_TAG(_pcidev) (_pcidev)
+
+/* PCI_CFG macros, typically used in DRI init, contain the domain */
+#define PCI_CFG_BUS(_pcidev) (((_pcidev)->domain << 8) | \
+ (_pcidev)->bus)
+#define PCI_CFG_DEV(_pcidev) ((_pcidev)->dev)
+#define PCI_CFG_FUNC(_pcidev) ((_pcidev)->func)
+
+#define PCI_REGION_BASE(_pcidev, _b, _type) ((_pcidev)->regions[(_b)].base_addr)
+#define PCI_REGION_SIZE(_pcidev, _b) ((_pcidev)->regions[(_b)].size)
+
+#define PCI_READ_BYTE(_pcidev, _value_ptr, _offset) \
+ pci_device_cfg_read_u8((_pcidev), (_value_ptr), (_offset))
+
+#define PCI_READ_LONG(_pcidev, _value_ptr, _offset) \
+ pci_device_cfg_read_u32((_pcidev), (_value_ptr), (_offset))
+
+#define PCI_WRITE_LONG(_pcidev, _value, _offset) \
+ pci_device_cfg_write_u32((_pcidev), (_value), (_offset))
+
+#endif /* XSERVER_LIBPCIACCESS */
+
+#endif /* CIRPCIRENAME_H */
diff --git a/driver/xf86-video-siliconmotion/src/smi_shadow.c b/driver/xf86-video-siliconmotion/src/smi_shadow.c
index 10cfe4d06..dcfa16a7b 100644
--- a/driver/xf86-video-siliconmotion/src/smi_shadow.c
+++ b/driver/xf86-video-siliconmotion/src/smi_shadow.c
@@ -26,7 +26,6 @@ Silicon Motion 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 and Silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c,v 1.1 2000/11/28 20:59:20 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -47,141 +46,128 @@ authorization from the XFree86 Project and Silicon Motion.
|*=============================================================================
|*
|* PARAMETERS: pScrn Pointer to ScrnInfo structure.
-|* num Number of boxes to refresh.
-|* pbox Pointer to an array of boxes to refresh.
+|* num Number of boxes to refresh.
+|* pbox Pointer to an array of boxes to refresh.
|*
|* DESCRIPTION: Refresh a portion of the shadow buffer to the visual screen
-|* buffer. This is mainly used for rotation purposes.
-|* y
+|* buffer. This is mainly used for rotation purposes.
+|*
|* RETURNS: Nothing.
|*
\******************************************************************************/
void SMI_RefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- int width, height, srcX, srcY, destX, destY;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int width, height, srcX, srcY, destX, destY;
- ENTER_PROC("SMI_RefreshArea");
+ ENTER_PROC("SMI_RefreshArea");
- /* #671 */
- if (pSmi->polyLines)
- {
- pSmi->polyLines = FALSE;
- return;
- }
+ /* #671 */
+ if (pSmi->polyLines) {
+ pSmi->polyLines = FALSE;
+ return;
+ }
- if (pSmi->rotate)
- {
- /* IF we need to do rotation, setup the hardware here. */
- WaitIdleEmpty();
- WRITE_DPR(pSmi, 0x10, pSmi->ShadowPitch);
- WRITE_DPR(pSmi, 0x3C, pSmi->ShadowPitch);
- WRITE_DPR(pSmi, 0x44, pSmi->FBOffset >> 3);
- }
+ if (pSmi->rotate) {
+ /* IF we need to do rotation, setup the hardware here. */
+ WaitIdleEmpty();
+ WRITE_DPR(pSmi, 0x10, pSmi->ShadowPitch);
+ WRITE_DPR(pSmi, 0x3C, pSmi->ShadowPitch);
+ WRITE_DPR(pSmi, 0x44, pSmi->FBOffset >> 3);
+ }
- /* #672 */
- if (pSmi->ClipTurnedOn)
- {
- WaitQueue(1);
- WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
- pSmi->ClipTurnedOn = FALSE;
- }
+ /* #672 */
+ if (pSmi->ClipTurnedOn) {
+ WaitQueue(1);
+ WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
+ pSmi->ClipTurnedOn = FALSE;
+ }
- while (num--)
- {
- /* Get coordinates of the box to refresh. */
- srcX = pbox->x1;
- srcY = pbox->y1;
- width = pbox->x2 - srcX;
- height = pbox->y2 - srcY;
-
- DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", srcX, srcY, width, height));
-
- if ((width > 0) && (height > 0))
- {
- switch (pSmi->rotate)
- {
- case SMI_ROTATE_CW:
- /* 90 degrees CW rotation. Calculate destination
- coordinates:
-
- *---+
- | | +-----*
- | | | | destX = shadowHeight - srcY - 1
- | | --> | | destY = srcX
- | | | |
- | | +-----+
- +---+
- */
- destX = pSmi->ShadowHeight - srcY - 1;
- destY = srcX;
-
- WaitQueue(4);
- WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
- WRITE_DPR(pSmi, 0x04, (destX << 16) + destY);
- WRITE_DPR(pSmi, 0x08, (width << 16) + height);
- WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT |
- SMI_ROTATE_CW | SMI_START_ENGINE);
- break;
-
- case SMI_ROTATE_CCW:
- /* 90 degrees CCW rotatation. Calculate destination
- coordinates:
-
- *---+
- | | +-----+
- | | | | destX = srcY
- | | --> | | destY = shadowWidth - srcX - 1
- | | | |
- | | *-----+
- +---+
- */
- destX = srcY;
- destY = pSmi->ShadowWidth - srcX - 1;
-
- WaitQueue(4);
- WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
- WRITE_DPR(pSmi, 0x04, (destX << 16) + destY);
- WRITE_DPR(pSmi, 0x08, (width << 16) + height);
- WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT |
- SMI_ROTATE_CCW | SMI_START_ENGINE);
- break;
-
- default:
- /* No rotation, perform a normal copy. */
- if (pScrn->bitsPerPixel == 24)
- {
- srcX *= 3;
- width *= 3;
-
- if (pSmi->Chipset == SMI_LYNX)
- {
- srcY *= 3;
- }
- }
-
- WaitQueue(4);
- WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
- WRITE_DPR(pSmi, 0x04, (srcX << 16) + srcY);
- WRITE_DPR(pSmi, 0x08, (width << 16) + height);
- WRITE_DPR(pSmi, 0x0C, SMI_BITBLT + SMI_START_ENGINE + 0xCC);
- break;
- }
+ while (num--) {
+ /* Get coordinates of the box to refresh. */
+ srcX = pbox->x1;
+ srcY = pbox->y1;
+ width = pbox->x2 - srcX;
+ height = pbox->y2 - srcY;
+
+ DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", srcX, srcY, width, height));
+
+ if ((width > 0) && (height > 0)) {
+ switch (pSmi->rotate) {
+ case SMI_ROTATE_CW:
+ /* 90 degrees CW rotation. Calculate destination coordinates:
+
+ *---+
+ | | +-----*
+ | | | | destX = shadowHeight - srcY - 1
+ | | --> | | destY = srcX
+ | | | |
+ | | +-----+
+ +---+
+ */
+ destX = pSmi->ShadowHeight - srcY - 1;
+ destY = srcX;
+
+ WaitQueue(4);
+ WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
+ WRITE_DPR(pSmi, 0x04, (destX << 16) + destY);
+ WRITE_DPR(pSmi, 0x08, (width << 16) + height);
+ WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT |
+ SMI_ROTATE_CW | SMI_START_ENGINE);
+ break;
+ case SMI_ROTATE_CCW:
+ /* 90 degrees CCW rotatation. Calculate destination coordinates:
+
+ *---+
+ | | +-----+
+ | | | | destX = srcY
+ | | --> | | destY = shadowWidth - srcX - 1
+ | | | |
+ | | *-----+
+ +---+
+ */
+ destX = srcY;
+ destY = pSmi->ShadowWidth - srcX - 1;
+
+ WaitQueue(4);
+ WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
+ WRITE_DPR(pSmi, 0x04, (destX << 16) + destY);
+ WRITE_DPR(pSmi, 0x08, (width << 16) + height);
+ WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT |
+ SMI_ROTATE_CCW | SMI_START_ENGINE);
+ break;
+ default:
+ /* No rotation, perform a normal copy. */
+ if (pScrn->bitsPerPixel == 24) {
+ srcX *= 3;
+ width *= 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ srcY *= 3;
+ }
}
- pbox++;
+ WaitQueue(4);
+ WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
+ WRITE_DPR(pSmi, 0x04, (srcX << 16) + srcY);
+ WRITE_DPR(pSmi, 0x08, (width << 16) + height);
+ WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_BITBLT | SMI_START_ENGINE);
+ break;
+ }
}
- if (pSmi->rotate)
- {
- /* If we did a rotation, we need to restore the hardware state here. */
- WaitIdleEmpty();
- WRITE_DPR(pSmi, 0x10, (pSmi->Stride << 16) | pSmi->Stride);
- WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride);
- WRITE_DPR(pSmi, 0x44, 0);
- }
+ pbox++;
+ }
+
+ if (pSmi->rotate) {
+ /* If we did a rotation, we need to restore the hardware state here. */
+ WaitIdleEmpty();
+ WRITE_DPR(pSmi, 0x10, (pSmi->Stride << 16) | pSmi->Stride);
+ WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride);
+ WRITE_DPR(pSmi, 0x44, 0);
+ }
- LEAVE_PROC("SMI_RefreshArea");
+ LEAVE_PROC("SMI_RefreshArea");
}
/* Custom version for the 730 series (Cougar3DR).
@@ -189,155 +175,140 @@ void SMI_RefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
void SMI_RefreshArea730(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- int width, height, srcX, srcY, destX, destY;
- int maxPixels, tempWidth;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int width, height, srcX, srcY, destX, destY;
+ int maxPixels, tempWidth;
- ENTER_PROC("SMI_RefreshArea730");
+ ENTER_PROC("SMI_RefreshArea730");
- /* #671 */
- if (pSmi->polyLines)
- {
- pSmi->polyLines = FALSE;
- return;
- }
+ /* #671 */
+ if (pSmi->polyLines) {
+ pSmi->polyLines = FALSE;
+ return;
+ }
- if (pSmi->rotate)
- {
- /* IF we need to do rotation, setup the hardware here. */
- WaitIdleEmpty();
- WRITE_DPR(pSmi, 0x10, pSmi->ShadowPitch);
- WRITE_DPR(pSmi, 0x3C, pSmi->ShadowPitch);
- WRITE_DPR(pSmi, 0x44, pSmi->FBOffset >> 3);
- }
+ if (pSmi->rotate) {
+ /* IF we need to do rotation, setup the hardware here. */
+ WaitIdleEmpty();
+ WRITE_DPR(pSmi, 0x10, pSmi->ShadowPitch);
+ WRITE_DPR(pSmi, 0x3C, pSmi->ShadowPitch);
+ WRITE_DPR(pSmi, 0x44, pSmi->FBOffset >> 3);
+ }
- /* #672 */
- if (pSmi->ClipTurnedOn)
- {
- WaitQueue(1);
- WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
- pSmi->ClipTurnedOn = FALSE;
- }
+ /* #672 */
+ if (pSmi->ClipTurnedOn) {
+ WaitQueue(1);
+ WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
+ pSmi->ClipTurnedOn = FALSE;
+ }
- /* SM731 cannot rotate-blt more than a certain number of pixels
- (based on a calculation from the Windows driver source */
- maxPixels = 1280 / pScrn->bitsPerPixel;
-
- while (num--)
- {
- /* Get coordinates of the box to refresh. */
- srcX = pbox->x1;
- srcY = pbox->y1;
- width = pbox->x2 - srcX;
- height = pbox->y2 - srcY;
-
- DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", srcX, srcY, width, height));
-
- if ((width > 0) && (height > 0))
- {
- switch (pSmi->rotate)
- {
- case SMI_ROTATE_CW:
- /* 90 degrees CW rotation. Calculate destination
- coordinates:
-
- *---+
- | | +-----*
- | | | | destX = shadowHeight - srcY - 1
- | | --> | | destY = srcX
- | | | |
- | | +-----+
- +---+
- */
- destX = pSmi->ShadowHeight - srcY - 1;
- destY = srcX;
-
- for (tempWidth=width; tempWidth>0;)
- {
- if (width>maxPixels)
- width = maxPixels;
- WaitQueue(4);
- WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
- WRITE_DPR(pSmi, 0x04, (destX << 16) + destY);
- WRITE_DPR(pSmi, 0x08, (width << 16) + height);
- WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT |
- SMI_ROTATE_CW | SMI_START_ENGINE);
- destY += maxPixels;
- srcX += maxPixels;
- tempWidth -= maxPixels;
- width = tempWidth;
- }
-
- break;
-
- case SMI_ROTATE_CCW:
- /* 90 degrees CCW rotatation. Calculate destination
- coordinates:
-
- *---+
- | | +-----+
- | | | | destX = srcY
- | | --> | | destY = shadowWidth - srcX - 1
- | | | |
- | | *-----+
- +---+
- */
- destX = srcY;
- destY = pSmi->ShadowWidth - srcX - 1;
-
- for (tempWidth=width; tempWidth>0;)
- {
- if (width>maxPixels)
- width = maxPixels;
- WaitQueue(4);
- WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
- WRITE_DPR(pSmi, 0x04, (destX << 16) + destY);
- WRITE_DPR(pSmi, 0x08, (width << 16) + height);
- WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT |
- SMI_ROTATE_CCW | SMI_START_ENGINE);
- destY -= maxPixels;
- srcX += maxPixels;
- tempWidth -= maxPixels;
- width = tempWidth;
- }
-
- break;
-
- default:
- /* No rotation, perform a normal copy. */
- if (pScrn->bitsPerPixel == 24)
- {
- srcX *= 3;
- width *= 3;
-
- if (pSmi->Chipset == SMI_LYNX)
- {
- srcY *= 3;
- }
- }
-
- WaitQueue(4);
- WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
- WRITE_DPR(pSmi, 0x04, (srcX << 16) + srcY);
- WRITE_DPR(pSmi, 0x08, (width << 16) + height);
- WRITE_DPR(pSmi, 0x0C, SMI_BITBLT + SMI_START_ENGINE + 0xCC);
- break;
- }
+ /* SM731 cannot rotate-blt more than a certain number of pixels
+ (based on a calculation from the Windows driver source */
+ maxPixels = 1280 / pScrn->bitsPerPixel;
+
+ while (num--) {
+ /* Get coordinates of the box to refresh. */
+ srcX = pbox->x1;
+ srcY = pbox->y1;
+ width = pbox->x2 - srcX;
+ height = pbox->y2 - srcY;
+
+ DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", srcX, srcY, width, height));
+
+ if ((width > 0) && (height > 0)) {
+ switch (pSmi->rotate) {
+ case SMI_ROTATE_CW:
+ /* 90 degrees CW rotation. Calculate destination coordinates:
+
+ *---+
+ | | +-----*
+ | | | | destX = shadowHeight - srcY - 1
+ | | --> | | destY = srcX
+ | | | |
+ | | +-----+
+ +---+
+ */
+ destX = pSmi->ShadowHeight - srcY - 1;
+ destY = srcX;
+
+ for (tempWidth=width; tempWidth > 0;) {
+ if (width>maxPixels)
+ width = maxPixels;
+ WaitQueue(4);
+ WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
+ WRITE_DPR(pSmi, 0x04, (destX << 16) + destY);
+ WRITE_DPR(pSmi, 0x08, (width << 16) + height);
+ WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT |
+ SMI_ROTATE_CW | SMI_START_ENGINE);
+ destY += maxPixels;
+ srcX += maxPixels;
+ tempWidth -= maxPixels;
+ width = tempWidth;
}
- pbox++;
- }
+ break;
+ case SMI_ROTATE_CCW:
+ /* 90 degrees CCW rotatation. Calculate destination coordinates:
+
+ *---+
+ | | +-----+
+ | | | | destX = srcY
+ | | --> | | destY = shadowWidth - srcX - 1
+ | | | |
+ | | *-----+
+ +---+
+ */
+ destX = srcY;
+ destY = pSmi->ShadowWidth - srcX - 1;
+
+ for (tempWidth=width; tempWidth > 0;) {
+ if (width>maxPixels)
+ width = maxPixels;
+ WaitQueue(4);
+ WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
+ WRITE_DPR(pSmi, 0x04, (destX << 16) + destY);
+ WRITE_DPR(pSmi, 0x08, (width << 16) + height);
+ WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT |
+ SMI_ROTATE_CCW | SMI_START_ENGINE);
+ destY -= maxPixels;
+ srcX += maxPixels;
+ tempWidth -= maxPixels;
+ width = tempWidth;
+ }
+
+ break;
+ default:
+ /* No rotation, perform a normal copy. */
+ if (pScrn->bitsPerPixel == 24) {
+ srcX *= 3;
+ width *= 3;
- if (pSmi->rotate)
- {
- /* If we did a rotation, we need to restore the hardware state here. */
- WaitIdleEmpty();
- WRITE_DPR(pSmi, 0x10, (pSmi->Stride << 16) | pSmi->Stride);
- WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride);
- WRITE_DPR(pSmi, 0x44, 0);
+ if (pSmi->Chipset == SMI_LYNX) {
+ srcY *= 3;
+ }
+ }
+
+ WaitQueue(4);
+ WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY);
+ WRITE_DPR(pSmi, 0x04, (srcX << 16) + srcY);
+ WRITE_DPR(pSmi, 0x08, (width << 16) + height);
+ WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_BITBLT | SMI_START_ENGINE);
+ break;
+ }
}
- LEAVE_PROC("SMI_RefreshArea730");
+ pbox++;
+ }
+
+ if (pSmi->rotate) {
+ /* If we did a rotation, we need to restore the hardware state here. */
+ WaitIdleEmpty();
+ WRITE_DPR(pSmi, 0x10, (pSmi->Stride << 16) | pSmi->Stride);
+ WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride);
+ WRITE_DPR(pSmi, 0x44, 0);
+ }
+
+ LEAVE_PROC("SMI_RefreshArea730");
}
/******************************************************************************\
@@ -345,8 +316,8 @@ void SMI_RefreshArea730(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|*=============================================================================
|*
|* PARAMETERS: index Index of current screen.
-|* x X location of pointer.
-|* y Y location of pointer.
+|* x X location of pointer.
+|* y Y location of pointer.
|*
|* DESCRIPTION: Adjust the pointer location if we are in rotation mode.
|*
@@ -359,27 +330,25 @@ void SMI_PointerMoved(int index, int x, int y)
SMIPtr pSmi = SMIPTR(pScrn);
int newX, newY;
- switch (pSmi->rotate)
- {
- case SMI_ROTATE_CW:
- /* 90 degrees CW rotation. */
- newX = pScrn->pScreen->height - y - 1;
- newY = x;
- break;
-
- case SMI_ROTATE_CCW:
- /* 90 degrees CCW rotation. */
- newX = y;
- newY = pScrn->pScreen->width - x - 1;
- break;
-
- default:
- /* No rotation. */
- newX = x;
- newY = y;
- break;
+ switch (pSmi->rotate) {
+ case SMI_ROTATE_CW:
+ /* 90 degrees CW rotation. */
+ newX = pScrn->pScreen->height - y - 1;
+ newY = x;
+ break;
+ case SMI_ROTATE_CCW:
+ /* 90 degrees CCW rotation. */
+ newX = y;
+ newY = pScrn->pScreen->width - x - 1;
+ break;
+ default:
+ /* No rotation. */
+ newX = x;
+ newY = y;
+ break;
}
- /* Pass adjusted pointer coordinates original PointerMoved function. */
+ /* Pass adjusted pointer coordinates original PointerMoved function. */
(*pSmi->PointerMoved)(index, newX, newY);
}
+
diff --git a/driver/xf86-video-siliconmotion/src/smi_video.c b/driver/xf86-video-siliconmotion/src/smi_video.c
index 1166c0333..b00b8da43 100644
--- a/driver/xf86-video-siliconmotion/src/smi_video.c
+++ b/driver/xf86-video-siliconmotion/src/smi_video.c
@@ -41,8 +41,6 @@ Author of changes: Corvin Zahn <zahn@zac.de>
Date: 2.11.2001
*/
-/* $XdotOrg: driver/xf86-video-siliconmotion/src/smi_video.c,v 1.5 2005/07/11 02:29:59 ajax Exp $ */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c,v 1.13 2003/11/10 18:22:26 tsi Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -136,8 +134,10 @@ static void SMI_WaitForSync(ScrnInfoPtr pScrn);
SMI_I2CDataPtr i2cData);*/
static void SMI_InitOffscreenImages(ScreenPtr pScreen);
-static FBAreaPtr SMI_AllocateMemory(ScrnInfoPtr pScrn, FBAreaPtr area,
- int numLines);
+static void SMI_VideoSave(ScreenPtr pScreen, ExaOffscreenArea *area);
+static CARD32 SMI_AllocateMemory(ScrnInfoPtr pScrn, void **mem_struct, int size);
+static void SMI_FreeMemory(ScrnInfoPtr pScrn, void *mem_struct);
+
static int SMI_AllocSurface(ScrnInfoPtr pScrn,
int id, unsigned short width, unsigned short height,
@@ -237,9 +237,9 @@ static VideoNormDataRec VideoNorms[] =
static XF86VideoFormatRec SMI_VideoFormats[] =
{
- { 15, TrueColor }, /* depth, class */
- { 16, TrueColor }, /* depth, class */
- { 24, TrueColor }, /* depth, class */
+ { 15, TrueColor }, /* depth, class */
+ { 16, TrueColor }, /* depth, class */
+ { 24, TrueColor }, /* depth, class */
};
@@ -280,85 +280,85 @@ static XF86AttributeRec SMI_VideoAttributes[2] = {
/**************************************************************************/
static XF86ImageRec SMI_VideoImages[] =
{
- XVIMAGE_YUY2,
- XVIMAGE_YV12,
- XVIMAGE_I420,
- {
- FOURCC_RV15, /* id */
- XvRGB, /* type */
- LSBFirst, /* byte_order */
- { 'R', 'V' ,'1', '5',
- 0x00, '5', 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00 }, /* guid */
- 16, /* bits_per_pixel */
- XvPacked, /* format */
- 1, /* num_planes */
- 15, /* depth */
- 0x001F, 0x03E0, 0x7C00, /* red_mask, green, blue */
- 0, 0, 0, /* y_sample_bits, u, v */
- 0, 0, 0, /* horz_y_period, u, v */
- 0, 0, 0, /* vert_y_period, u, v */
- { 'R', 'V', 'B' }, /* component_order */
- XvTopToBottom /* scaline_order */
- },
- {
- FOURCC_RV16, /* id */
- XvRGB, /* type */
- LSBFirst, /* byte_order */
- { 'R', 'V' ,'1', '6',
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00 }, /* guid */
- 16, /* bits_per_pixel */
- XvPacked, /* format */
- 1, /* num_planes */
- 16, /* depth */
- 0x001F, 0x07E0, 0xF800, /* red_mask, green, blue */
- 0, 0, 0, /* y_sample_bits, u, v */
- 0, 0, 0, /* horz_y_period, u, v */
- 0, 0, 0, /* vert_y_period, u, v */
- { 'R', 'V', 'B' }, /* component_order */
- XvTopToBottom /* scaline_order */
- },
- {
- FOURCC_RV24, /* id */
- XvRGB, /* type */
- LSBFirst, /* byte_order */
- { 'R', 'V' ,'2', '4',
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00 }, /* guid */
- 24, /* bits_per_pixel */
- XvPacked, /* format */
- 1, /* num_planes */
- 24, /* depth */
- 0x0000FF, 0x00FF00, 0xFF0000, /* red_mask, green, blue */
- 0, 0, 0, /* y_sample_bits, u, v */
- 0, 0, 0, /* horz_y_period, u, v */
- 0, 0, 0, /* vert_y_period, u, v */
- { 'R', 'V', 'B' }, /* component_order */
- XvTopToBottom /* scaline_order */
- },
- {
- FOURCC_RV32, /* id */
- XvRGB, /* type */
- LSBFirst, /* byte_order */
- { 'R', 'V' ,'3', '2',
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00 }, /* guid */
- 32, /* bits_per_pixel */
- XvPacked, /* format */
- 1, /* num_planes */
- 24, /* depth */
- 0x0000FF, 0x00FF00, 0xFF0000, /* red_mask, green, blue */
- 0, 0, 0, /* y_sample_bits, u, v */
- 0, 0, 0, /* horz_y_period, u, v */
- 0, 0, 0, /* vert_y_period, u, v */
- { 'R', 'V', 'B' }, /* component_order */
- XvTopToBottom /* scaline_order */
- },
+ XVIMAGE_YUY2,
+ XVIMAGE_YV12,
+ XVIMAGE_I420,
+ {
+ FOURCC_RV15, /* id */
+ XvRGB, /* type */
+ LSBFirst, /* byte_order */
+ { 'R', 'V' ,'1', '5',
+ 0x00, '5', 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00 }, /* guid */
+ 16, /* bits_per_pixel */
+ XvPacked, /* format */
+ 1, /* num_planes */
+ 15, /* depth */
+ 0x001F, 0x03E0, 0x7C00, /* red_mask, green, blue */
+ 0, 0, 0, /* y_sample_bits, u, v */
+ 0, 0, 0, /* horz_y_period, u, v */
+ 0, 0, 0, /* vert_y_period, u, v */
+ { 'R', 'V', 'B' }, /* component_order */
+ XvTopToBottom /* scaline_order */
+ },
+ {
+ FOURCC_RV16, /* id */
+ XvRGB, /* type */
+ LSBFirst, /* byte_order */
+ { 'R', 'V' ,'1', '6',
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00 }, /* guid */
+ 16, /* bits_per_pixel */
+ XvPacked, /* format */
+ 1, /* num_planes */
+ 16, /* depth */
+ 0x001F, 0x07E0, 0xF800, /* red_mask, green, blue */
+ 0, 0, 0, /* y_sample_bits, u, v */
+ 0, 0, 0, /* horz_y_period, u, v */
+ 0, 0, 0, /* vert_y_period, u, v */
+ { 'R', 'V', 'B' }, /* component_order */
+ XvTopToBottom /* scaline_order */
+ },
+ {
+ FOURCC_RV24, /* id */
+ XvRGB, /* type */
+ LSBFirst, /* byte_order */
+ { 'R', 'V' ,'2', '4',
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00 }, /* guid */
+ 24, /* bits_per_pixel */
+ XvPacked, /* format */
+ 1, /* num_planes */
+ 24, /* depth */
+ 0x0000FF, 0x00FF00, 0xFF0000, /* red_mask, green, blue */
+ 0, 0, 0, /* y_sample_bits, u, v */
+ 0, 0, 0, /* horz_y_period, u, v */
+ 0, 0, 0, /* vert_y_period, u, v */
+ { 'R', 'V', 'B' }, /* component_order */
+ XvTopToBottom /* scaline_order */
+ },
+ {
+ FOURCC_RV32, /* id */
+ XvRGB, /* type */
+ LSBFirst, /* byte_order */
+ { 'R', 'V' ,'3', '2',
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00 }, /* guid */
+ 32, /* bits_per_pixel */
+ XvPacked, /* format */
+ 1, /* num_planes */
+ 24, /* depth */
+ 0x0000FF, 0x00FF00, 0xFF0000, /* red_mask, green, blue */
+ 0, 0, 0, /* y_sample_bits, u, v */
+ 0, 0, 0, /* horz_y_period, u, v */
+ 0, 0, 0, /* vert_y_period, u, v */
+ { 'R', 'V', 'B' }, /* component_order */
+ XvTopToBottom /* scaline_order */
+ },
};
@@ -645,19 +645,14 @@ SMI_InitVideo(ScreenPtr pScreen)
SMI_InitOffscreenImages(pScreen);
}
- if (newAdaptor != NULL)
- {
- if (numAdaptors == 0)
- {
+ if (newAdaptor != NULL) {
+ if (numAdaptors == 0) {
numAdaptors = 1;
ptrAdaptors = &newAdaptor;
- }
- else
- {
+ } else {
newAdaptors = xalloc((numAdaptors + 1) *
sizeof(XF86VideoAdaptorPtr*));
- if (newAdaptors != NULL)
- {
+ if (newAdaptors != NULL) {
memcpy(newAdaptors, ptrAdaptors,
numAdaptors * sizeof(XF86VideoAdaptorPtr));
newAdaptors[numAdaptors++] = newAdaptor;
@@ -666,14 +661,12 @@ SMI_InitVideo(ScreenPtr pScreen)
}
}
- if (numAdaptors != 0)
- {
- DEBUG((VERBLEV, "ScreenInit %i\n",numAdaptors));
+ if (numAdaptors != 0) {
+ DEBUG((VERBLEV, "ScreenInit %i\n",numAdaptors));
xf86XVScreenInit(pScreen, ptrAdaptors, numAdaptors);
}
- if (newAdaptors != NULL)
- {
+ if (newAdaptors != NULL) {
xfree(newAdaptors);
}
@@ -719,8 +712,7 @@ SetAttr(ScrnInfoPtr pScrn, int i, int value)
SetKeyReg(pSmi, 0x5C, 0xEDEDED | (my_value << 24));
} else if (pPort->I2CDev.SlaveAddr == SAA7110) {
return SetAttrSAA7110(pScrn, i, value);
- }
- else if (pPort->I2CDev.SlaveAddr == SAA7111) {
+ } else if (pPort->I2CDev.SlaveAddr == SAA7111) {
return SetAttrSAA7111(pScrn, i, value);
}
#if 0
@@ -777,16 +769,14 @@ SetAttrSAA7111(ScrnInfoPtr pScrn, int i, int value)
ENTRIES(SAA7111CompositeChannelSelect[channel]) / 2)) {
return XvBadAlloc;
}
- }
- else {
+ } else {
if (!xf86I2CWriteVec(&(pPort->I2CDev),
SAA7111SVideoChannelSelect[channel],
ENTRIES(SAA7111SVideoChannelSelect[channel]) / 2)) {
return XvBadAlloc;
}
}
- }
- else if (i >= XV_CAPTURE_BRIGHTNESS && i <= XV_HUE) {
+ } else if (i >= XV_CAPTURE_BRIGHTNESS && i <= XV_HUE) {
int slave_adr = 0;
switch (i) {
@@ -816,8 +806,7 @@ SetAttrSAA7111(ScrnInfoPtr pScrn, int i, int value)
}
if (!xf86I2CWriteByte(&(pPort->I2CDev), slave_adr, (value & 0xff)))
return XvBadAlloc;
- }
- else {
+ } else {
return BadMatch;
}
@@ -838,45 +827,42 @@ SetAttrSAA7111(ScrnInfoPtr pScrn, int i, int value)
/******************************************************************************\
-** **
-** V I D E O M A N A G E M E N T **
-** **
+** **
+** V I D E O M A N A G E M E N T **
+** **
\******************************************************************************/
static XF86VideoAdaptorPtr
-SMI_SetupVideo(
- ScreenPtr pScreen
-)
+SMI_SetupVideo(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- SMIPtr pSmi = SMIPTR(pScrn);
- SMI_PortPtr smiPortPtr;
- XF86VideoAdaptorPtr ptrAdaptor;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ SMI_PortPtr smiPortPtr;
+ XF86VideoAdaptorPtr ptrAdaptor;
- ENTER_PROC("SMI_SetupVideo");
+ ENTER_PROC("SMI_SetupVideo");
- ptrAdaptor = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
- sizeof(DevUnion) + sizeof(SMI_PortRec));
- if (ptrAdaptor == NULL)
- {
- LEAVE_PROC("SMI_SetupVideo");
- return(NULL);
- }
+ ptrAdaptor = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
+ sizeof(DevUnion) + sizeof(SMI_PortRec));
+ if (ptrAdaptor == NULL) {
+ LEAVE_PROC("SMI_SetupVideo");
+ return NULL;
+ }
- ptrAdaptor->type = XvInputMask
+ ptrAdaptor->type = XvInputMask
#if SMI_USE_CAPTURE
- | XvOutputMask
- | XvVideoMask
+ | XvOutputMask
+ | XvVideoMask
#endif
- | XvImageMask
- | XvWindowMask
- ;
+ | XvImageMask
+ | XvWindowMask
+ ;
- ptrAdaptor->flags = VIDEO_OVERLAID_IMAGES
- | VIDEO_CLIP_TO_VIEWPORT
- ;
+ ptrAdaptor->flags = VIDEO_OVERLAID_IMAGES
+ | VIDEO_CLIP_TO_VIEWPORT
+ ;
- ptrAdaptor->name = "Silicon Motion Lynx Series Video Engine";
+ ptrAdaptor->name = "Silicon Motion Lynx Series Video Engine";
ptrAdaptor->nPorts = 1;
ptrAdaptor->pPortPrivates = (DevUnion*) &ptrAdaptor[1];
@@ -896,39 +882,39 @@ SMI_SetupVideo(
}
#endif
- ptrAdaptor->nFormats = nElems(SMI_VideoFormats);
- ptrAdaptor->pFormats = SMI_VideoFormats;
+ ptrAdaptor->nFormats = nElems(SMI_VideoFormats);
+ ptrAdaptor->pFormats = SMI_VideoFormats;
- ptrAdaptor->nAttributes = nElems(SMI_VideoAttributes);
- ptrAdaptor->pAttributes = SMI_VideoAttributes;
+ ptrAdaptor->nAttributes = nElems(SMI_VideoAttributes);
+ ptrAdaptor->pAttributes = SMI_VideoAttributes;
- ptrAdaptor->nImages = nElems(SMI_VideoImages);
- ptrAdaptor->pImages = SMI_VideoImages;
+ ptrAdaptor->nImages = nElems(SMI_VideoImages);
+ ptrAdaptor->pImages = SMI_VideoImages;
#if SMI_USE_CAPTURE
- if (pSmi->Chipset == SMI_COUGAR3DR)
- ptrAdaptor->PutVideo = NULL;
- else
- ptrAdaptor->PutVideo = SMI_PutVideo;
- ptrAdaptor->PutStill = NULL;
+ if (pSmi->Chipset == SMI_COUGAR3DR)
+ ptrAdaptor->PutVideo = NULL;
+ else
+ ptrAdaptor->PutVideo = SMI_PutVideo;
+ ptrAdaptor->PutStill = NULL;
ptrAdaptor->GetVideo = NULL;
- ptrAdaptor->GetStill = NULL;
+ ptrAdaptor->GetStill = NULL;
#else
- ptrAdaptor->PutVideo = NULL;
- ptrAdaptor->PutStill = NULL;
- ptrAdaptor->GetVideo = NULL;
- ptrAdaptor->GetStill = NULL;
+ ptrAdaptor->PutVideo = NULL;
+ ptrAdaptor->PutStill = NULL;
+ ptrAdaptor->GetVideo = NULL;
+ ptrAdaptor->GetStill = NULL;
#endif
- ptrAdaptor->StopVideo = SMI_StopVideo;
- ptrAdaptor->SetPortAttribute = SMI_SetPortAttribute;
- ptrAdaptor->GetPortAttribute = SMI_GetPortAttribute;
- ptrAdaptor->QueryBestSize = SMI_QueryBestSize;
- ptrAdaptor->PutImage = SMI_PutImage;
- ptrAdaptor->QueryImageAttributes = SMI_QueryImageAttributes;
+ ptrAdaptor->StopVideo = SMI_StopVideo;
+ ptrAdaptor->SetPortAttribute = SMI_SetPortAttribute;
+ ptrAdaptor->GetPortAttribute = SMI_GetPortAttribute;
+ ptrAdaptor->QueryBestSize = SMI_QueryBestSize;
+ ptrAdaptor->PutImage = SMI_PutImage;
+ ptrAdaptor->QueryImageAttributes = SMI_QueryImageAttributes;
smiPortPtr->Attribute[XV_COLORKEY] = pSmi->videoKey;
smiPortPtr->Attribute[XV_INTERLACED] = pSmi->interlaced;
- smiPortPtr->videoStatus = 0;
+ smiPortPtr->videoStatus = 0;
#if 0
/* aaa does not work ? */
@@ -945,11 +931,9 @@ SMI_SetupVideo(
smiPortPtr->I2CDev.pI2CBus = pSmi->I2C;
- if (xf86I2CDevInit(&(smiPortPtr->I2CDev)))
- {
+ if (xf86I2CDevInit(&(smiPortPtr->I2CDev))) {
- if (xf86I2CWriteVec(&(smiPortPtr->I2CDev), SAA7111InitData,
- ENTRIES(SAA7111InitData) / 2)) {
+ if (xf86I2CWriteVec(&(smiPortPtr->I2CDev), SAA7111InitData, ENTRIES(SAA7111InitData) / 2)) {
xvEncoding = MAKE_ATOM(XV_ENCODING_NAME);
xvHue = MAKE_ATOM(XV_HUE_NAME);
xvSaturation = MAKE_ATOM(XV_SATURATION_NAME);
@@ -981,20 +965,18 @@ SMI_SetupVideo(
SMI_ResetVideo(pScrn);
LEAVE_PROC("SMI_SetupVideo");
- return(ptrAdaptor);
+ return ptrAdaptor;
}
static void
-SMI_ResetVideo(
- ScrnInfoPtr pScrn
-)
+SMI_ResetVideo(ScrnInfoPtr pScrn)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr;
- int r, g, b;
+ int r, g, b;
- ENTER_PROC("SMI_ResetVideo");
+ ENTER_PROC("SMI_ResetVideo");
SetAttr(pScrn, XV_ENCODING, 0); /* Encoding = pal-composite-0 */
SetAttr(pScrn, XV_BRIGHTNESS, 128); /* Brightness = 128 (CCIR level) */
@@ -1003,31 +985,28 @@ SMI_ResetVideo(
SetAttr(pScrn, XV_SATURATION, 64); /* Color saturation = 64 (CCIR level) */
SetAttr(pScrn, XV_HUE, 0); /* Hue = 0 */
- switch (pScrn->depth)
- {
- case 8:
- SetKeyReg(pSmi, FPR04, pPort->Attribute[XV_COLORKEY] & 0x00FF);
- SetKeyReg(pSmi, FPR08, 0);
- break;
-
- case 15:
- case 16:
- SetKeyReg(pSmi, FPR04, pPort->Attribute[XV_COLORKEY] & 0xFFFF);
- SetKeyReg(pSmi, FPR08, 0);
- break;
-
- default:
- r = (pPort->Attribute[XV_COLORKEY] & pScrn->mask.red) >> pScrn->offset.red;
- g = (pPort->Attribute[XV_COLORKEY] & pScrn->mask.green) >> pScrn->offset.green;
- b = (pPort->Attribute[XV_COLORKEY] & pScrn->mask.blue) >> pScrn->offset.blue;
- SetKeyReg(pSmi, FPR04, ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3));
- SetKeyReg(pSmi, FPR08, 0);
- break;
- }
+ switch (pScrn->depth) {
+ case 8:
+ SetKeyReg(pSmi, FPR04, pPort->Attribute[XV_COLORKEY] & 0x00FF);
+ SetKeyReg(pSmi, FPR08, 0);
+ break;
+ case 15:
+ case 16:
+ SetKeyReg(pSmi, FPR04, pPort->Attribute[XV_COLORKEY] & 0xFFFF);
+ SetKeyReg(pSmi, FPR08, 0);
+ break;
+ default:
+ r = (pPort->Attribute[XV_COLORKEY] & pScrn->mask.red) >> pScrn->offset.red;
+ g = (pPort->Attribute[XV_COLORKEY] & pScrn->mask.green) >> pScrn->offset.green;
+ b = (pPort->Attribute[XV_COLORKEY] & pScrn->mask.blue) >> pScrn->offset.blue;
+ SetKeyReg(pSmi, FPR04, ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3));
+ SetKeyReg(pSmi, FPR08, 0);
+ break;
+ }
- SetKeyReg(pSmi, FPR5C, 0xEDEDED | (pPort->Attribute[XV_BRIGHTNESS] << 24));
+ SetKeyReg(pSmi, FPR5C, 0xEDEDED | (pPort->Attribute[XV_BRIGHTNESS] << 24));
- LEAVE_PROC("SMI_ResetVideo");
+ LEAVE_PROC("SMI_ResetVideo");
}
@@ -1049,15 +1028,15 @@ SMI_PutVideo(
)
{
SMI_PortPtr pPort = (SMI_PortPtr) data;
- SMIPtr pSmi = SMIPTR(pScrn);
- CARD32 vid_pitch, vid_address;
- CARD32 vpr00, cpr00;
- int xscale, yscale;
- BoxRec dstBox;
- INT32 x1, y1, x2, y2;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ CARD32 vid_pitch, vid_address;
+ CARD32 vpr00, cpr00;
+ int xscale, yscale;
+ BoxRec dstBox;
+ INT32 x1, y1, x2, y2;
int norm;
- int areaHeight, width, height, fbPitch;
- int top, left;
+ int size, width, height, fbPitch;
+ int top, left;
ENTER_PROC("SMI_PutVideo");
@@ -1079,42 +1058,39 @@ SMI_PutVideo(
"vid_w=%d vid_h=%d drw_w=%d drw_h=%d\n",
vid_x, vid_y, drw_x, drw_y, vid_w, vid_h, drw_w, drw_h));
- x1 = vid_x;
- y1 = vid_y;
- x2 = vid_x + vid_w;
- y2 = vid_y + vid_h;
+ x1 = vid_x;
+ y1 = vid_y;
+ x2 = vid_x + vid_w;
+ y2 = vid_y + vid_h;
- width = vid_w;
- height = vid_h;
+ width = vid_w;
+ height = vid_h;
- dstBox.x1 = drw_x;
- dstBox.y1 = drw_y;
- dstBox.x2 = drw_x + drw_w;
- dstBox.y2 = drw_y + drw_h;
+ dstBox.x1 = drw_x;
+ dstBox.y1 = drw_y;
+ dstBox.x2 = drw_x + drw_w;
+ dstBox.y2 = drw_y + drw_h;
#if 1
- if (!SMI_ClipVideo(pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes, width,
- height))
+ if (!SMI_ClipVideo(pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes, width, height)) {
#else
- if (!xf86XVClipVideoHelper(&dstBox, &x1, &y1, &x2, &y2, clipBoxes, width,
- height))
+ if (!xf86XVClipVideoHelper(&dstBox, &x1, &y1, &x2, &y2, clipBoxes, width, height)) {
#endif
- {
LEAVE_PROC("SMI_PutVideo");
- return(Success);
- }
+ return Success;
+ }
DEBUG((VERBLEV, "Clip: x1=%d y1=%d x2=%d y2=%d\n", x1 >> 16, y1 >> 16, x2 >> 16, y2 >> 16));
- dstBox.x1 -= pScrn->frameX0;
- dstBox.y1 -= pScrn->frameY0;
- dstBox.x2 -= pScrn->frameX0;
- dstBox.y2 -= pScrn->frameY0;
+ dstBox.x1 -= pScrn->frameX0;
+ dstBox.y1 -= pScrn->frameY0;
+ dstBox.x2 -= pScrn->frameX0;
+ dstBox.y2 -= pScrn->frameY0;
- vid_pitch = (vid_w * 2 + 7) & ~7;
+ vid_pitch = (vid_w * 2 + 7) & ~7;
- vpr00 = READ_VPR(pSmi, 0x00) & ~0x0FF000FF;
- cpr00 = READ_CPR(pSmi, 0x00) & ~0x000FFF00;
+ vpr00 = READ_VPR(pSmi, 0x00) & ~0x0FF000FF;
+ cpr00 = READ_CPR(pSmi, 0x00) & ~0x000FFF00;
/* vpr00:
Bit 2..0 = 6: Video Window I Format = YUV4:2:2
@@ -1141,8 +1117,7 @@ SMI_PutVideo(
Bit 24 = 0: Select Video Window I Source Addr = 0
*/
vpr00 |= 0x0010000E;
- }
- else {
+ } else {
/*
Bit 21 = 10: Vertical Interpolation = enabled
Bit 24 = 1: Select Video Window I Source Addr = 1
@@ -1172,8 +1147,7 @@ SMI_PutVideo(
Bit 13..11 = 0: Frame Skip Enable = no skip
*/
cpr00 |= 0x01000601;
- }
- else {
+ } else {
/*
Bit 9 = 0: Double Buffer Enable = disabled
Bit 10 = 0: Interlace Data Capture = disabled
@@ -1182,120 +1156,92 @@ SMI_PutVideo(
cpr00 |= 0x01000801;
}
- if (pSmi->ByteSwap)
- cpr00 |= 0x00004000;
+ if (pSmi->ByteSwap)
+ cpr00 |= 0x00004000;
- fbPitch = pSmi->Stride;
- if (pSmi->Bpp != 3)
- {
- fbPitch *= pSmi->Bpp;
- }
+ fbPitch = pSmi->Stride;
+ if (pSmi->Bpp != 3) {
+ fbPitch *= pSmi->Bpp;
+ }
- if (vid_w <= drw_w)
- {
- xscale = (256 * vid_w / drw_w) & 0xFF;
- }
- else if (vid_w / 2 <= drw_w)
- {
- xscale = (128 * vid_w / drw_w) & 0xFF;
- width /= 2;
- vid_pitch /= 2;
- cpr00 |= 0x00010000;
- }
- else if (vid_w / 4 <= drw_w)
- {
- xscale = (64 * vid_w / drw_w) & 0xFF;
- width /= 4;
- vid_pitch /= 4;
- cpr00 |= 0x00020000;
- }
- else
- {
- xscale = 0;
- width /= 4;
- vid_pitch /= 4;
- cpr00 |= 0x00020000;
- }
+ if (vid_w <= drw_w) {
+ xscale = (256 * vid_w / drw_w) & 0xFF;
+ } else if (vid_w / 2 <= drw_w) {
+ xscale = (128 * vid_w / drw_w) & 0xFF;
+ width /= 2;
+ vid_pitch /= 2;
+ cpr00 |= 0x00010000;
+ } else if (vid_w / 4 <= drw_w) {
+ xscale = (64 * vid_w / drw_w) & 0xFF;
+ width /= 4;
+ vid_pitch /= 4;
+ cpr00 |= 0x00020000;
+ } else {
+ xscale = 0;
+ width /= 4;
+ vid_pitch /= 4;
+ cpr00 |= 0x00020000;
+ }
- if (vid_h <= drw_h)
- {
- yscale = (256 * vid_h / drw_h) & 0xFF;
- }
- else if (vid_h / 2 <= drw_h)
- {
+ if (vid_h <= drw_h) {
+ yscale = (256 * vid_h / drw_h) & 0xFF;
+ } else if (vid_h / 2 <= drw_h) {
+ yscale = (128 * vid_h / drw_h) & 0xFF;
+ height /= 2;
+ cpr00 |= 0x00040000;
+ } else if (vid_h / 4 <= drw_h) {
+ yscale = (64 * vid_h / drw_h) & 0xFF;
+ height /= 4;
+ cpr00 |= 0x00080000;
+ } else {
+ yscale = 0;
+ height /= 4;
+ cpr00 |= 0x00080000;
+ }
+
+ do {
+ size = vid_pitch * height;
+ DEBUG((VERBLEV, "SMI_AllocateMemory: vid_pitch=%d height=%d size=%d\n",
+ vid_pitch, height, size));
+ pPort->video_offset = SMI_AllocateMemory(pScrn, &pPort->video_memory, size);
+ if (pPort->video_offset == 0) {
+ if ((cpr00 & 0x000C0000) == 0) {
+ /* height -> 1/2 height */
yscale = (128 * vid_h / drw_h) & 0xFF;
- height /= 2;
+ height = vid_h / 2;
cpr00 |= 0x00040000;
- }
- else if (vid_h / 4 <= drw_h)
- {
+ } else if (cpr00 & 0x00040000) {
+ /* 1/2 height -> 1/4 height */
yscale = (64 * vid_h / drw_h) & 0xFF;
- height /= 4;
- cpr00 |= 0x00080000;
- }
- else
- {
- yscale = 0;
- height /= 4;
- cpr00 |= 0x00080000;
- }
-
- do
- {
- areaHeight = (vid_pitch * height + fbPitch - 1) / fbPitch;
- DEBUG((VERBLEV, "SMI_AllocateMemory: vid_pitch=%d height=%d fbPitch=%d areaHeight=%d\n",
- vid_pitch, height, fbPitch, areaHeight));
- pPort->area = SMI_AllocateMemory(pScrn, pPort->area, areaHeight);
- if (pPort->area == NULL)
- {
- if ((cpr00 & 0x000C0000) == 0)
- {
- /* height -> 1/2 height */
- yscale = (128 * vid_h / drw_h) & 0xFF;
- height = vid_h / 2;
- cpr00 |= 0x00040000;
- }
- else if (cpr00 & 0x00040000)
- {
- /* 1/2 height -> 1/4 height */
- yscale = (64 * vid_h / drw_h) & 0xFF;
- height = vid_h / 4;
- cpr00 ^= 0x000C0000;
- }
- else
- {
- /* 1/4 height */
- if ((cpr00 & 0x00030000) == 0)
- {
- /* width -> 1/2 width */
- xscale = (128 * vid_w / drw_w) & 0xFF;
- width = vid_w / 2;
- cpr00 |= 0x00010000;
- }
- else if (cpr00 & 0x00010000)
- {
- /* 1/2 width -> 1/4 width */
- xscale = (64 * vid_w / drw_w) & 0xFF;
- width = vid_w / 4;
- cpr00 ^= 0x00030000;
- }
- else
- {
+ height = vid_h / 4;
+ cpr00 ^= 0x000C0000;
+ } else {
+ /* 1/4 height */
+ if ((cpr00 & 0x00030000) == 0) {
+ /* width -> 1/2 width */
+ xscale = (128 * vid_w / drw_w) & 0xFF;
+ width = vid_w / 2;
+ cpr00 |= 0x00010000;
+ } else if (cpr00 & 0x00010000) {
+ /* 1/2 width -> 1/4 width */
+ xscale = (64 * vid_w / drw_w) & 0xFF;
+ width = vid_w / 4;
+ cpr00 ^= 0x00030000;
+ } else {
DEBUG((VERBLEV, "allocate error\n"));
LEAVE_PROC("SMI_PutVideo");
- return(BadAlloc);
- }
- }
+ return BadAlloc;
}
+ }
}
- while (pPort->area == NULL);
+ } while (pPort->video_offset == 0);
DEBUG((VERBLEV, "xscale==%d yscale=%d width=%d height=%d\n",
xscale, yscale, width, height));
/* aaa whats this ----------------------v ?
vid_address = (pPort->area->box.y1 * fbPitch) + ((y1 >> 16) * vid_pitch);*/
- vid_address = (pPort->area->box.y1 * fbPitch);
+ vid_address = pPort->video_offset;
DEBUG((VERBLEV, "test RegionsEqual\n"));
#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,0,0)
@@ -1309,26 +1255,26 @@ SMI_PutVideo(
DEBUG((VERBLEV, "FillKey\n"));
xf86XVFillKeyHelper(pScrn->pScreen, pPort->Attribute[XV_COLORKEY], clipBoxes);
- }
+ }
- left = x1 >> 16;
- top = y1 >> 16;
- width = (x2 - x1) >> 16;
- height = (y2 - y1) >> 16;
+ left = x1 >> 16;
+ top = y1 >> 16;
+ width = (x2 - x1) >> 16;
+ height = (y2 - y1) >> 16;
- OUT_SEQ(pSmi, 0x21, IN_SEQ(pSmi, 0x21) & ~0x04);
- WRITE_VPR(pSmi, 0x54, READ_VPR(pSmi, 0x54) | 0x00200000);
+ OUT_SEQ(pSmi, 0x21, IN_SEQ(pSmi, 0x21) & ~0x04);
+ WRITE_VPR(pSmi, 0x54, READ_VPR(pSmi, 0x54) | 0x00200000);
#if 0
SMI_WaitForSync(pScrn);
#endif
/* Video Window I Left and Top Boundaries */
- WRITE_VPR(pSmi, 0x14, dstBox.x1 + (dstBox.y1 << 16));
+ WRITE_VPR(pSmi, 0x14, dstBox.x1 + (dstBox.y1 << 16));
/* Video Window I Right and Bottom Boundaries */
- WRITE_VPR(pSmi, 0x18, dstBox.x2 + (dstBox.y2 << 16));
+ WRITE_VPR(pSmi, 0x18, dstBox.x2 + (dstBox.y2 << 16));
/* Video Window I Source Width and Offset */
- WRITE_VPR(pSmi, 0x20, (vid_pitch / 8) + ((vid_pitch / 8) << 16));
+ WRITE_VPR(pSmi, 0x20, (vid_pitch / 8) + ((vid_pitch / 8) << 16));
/* Video Window I Stretch Factor */
- WRITE_VPR(pSmi, 0x24, (xscale << 8) + yscale);
+ WRITE_VPR(pSmi, 0x24, (xscale << 8) + yscale);
if (pPort->Attribute[XV_INTERLACED]) {
/* Video Window II Left and Top Boundaries */
@@ -1360,8 +1306,7 @@ SMI_PutVideo(
WRITE_CPR(pSmi, 0x10, vid_address / 8 + vid_pitch / 8);
/* Capture Port Source Offset Address */
WRITE_CPR(pSmi, 0x14, 2*(vid_pitch / 8) + ((2*(vid_pitch / 8)) << 16));
- }
- else {
+ } else {
/* Video Source Clipping Control */
WRITE_CPR(pSmi, 0x04, left + (top << 16));
/* Video Source Capture Size Control */
@@ -1374,13 +1319,13 @@ SMI_PutVideo(
WRITE_CPR(pSmi, 0x14, (vid_pitch / 8) + ((vid_pitch / 8) << 16));
}
- WRITE_CPR(pSmi, 0x00, cpr00);
- WRITE_VPR(pSmi, 0x00, vpr00);
+ WRITE_CPR(pSmi, 0x00, cpr00);
+ WRITE_VPR(pSmi, 0x00, vpr00);
pPort->videoStatus = CLIENT_VIDEO_ON;
DEBUG((VERBLEV, "SMI_PutVideo success\n"));
LEAVE_PROC("SMI_PutVideo");
- return(Success);
+ return Success;
}
#endif
@@ -1392,55 +1337,44 @@ SMI_StopVideo(
Bool shutdown
)
{
- SMI_PortPtr pPort = (SMI_PortPtr) data;
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMI_PortPtr pPort = (SMI_PortPtr) data;
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_StopVideo");
+ ENTER_PROC("SMI_StopVideo");
- REGION_EMPTY(pScrn->pScreen, &pPort->clip);
+ REGION_EMPTY(pScrn->pScreen, &pPort->clip);
- if (shutdown)
- {
- if (pPort->videoStatus & CLIENT_VIDEO_ON)
- {
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
- WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE));
- }
- else
- {
- WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x01000008);
- }
+ if (shutdown) {
+ if (pPort->videoStatus & CLIENT_VIDEO_ON) {
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
+ WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE));
+ } else {
+ WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x01000008);
+ }
#if SMI_USE_CAPTURE
- if (pSmi->Chipset != SMI_COUGAR3DR)
- {
- WRITE_CPR(pSmi, 0x00, READ_CPR(pSmi, 0x00) & ~0x00000001);
- WRITE_VPR(pSmi, 0x54, READ_VPR(pSmi, 0x54) & ~0x00F00000);
- }
- /* #864 OUT_SEQ(pSmi, 0x21, IN_SEQ(pSmi, 0x21) | 0x04); */
+ if (pSmi->Chipset != SMI_COUGAR3DR) {
+ WRITE_CPR(pSmi, 0x00, READ_CPR(pSmi, 0x00) & ~0x00000001);
+ WRITE_VPR(pSmi, 0x54, READ_VPR(pSmi, 0x54) & ~0x00F00000);
+ }
+/* #864 OUT_SEQ(pSmi, 0x21, IN_SEQ(pSmi, 0x21) | 0x04); */
#endif
- }
- if (pPort->area != NULL)
- {
- xf86FreeOffscreenArea(pPort->area);
- pPort->area = NULL;
- }
+ }
+ if (pPort->video_memory != NULL) {
+ SMI_FreeMemory(pScrn, pPort->video_memory);
+ pPort->video_memory = NULL;
+ }
pPort->videoStatus = 0;
/* pPort->i2cDevice = 0;aaa*/
- }
- else
- {
- if (pPort->videoStatus & CLIENT_VIDEO_ON)
- {
+ } else {
+ if (pPort->videoStatus & CLIENT_VIDEO_ON) {
pPort->videoStatus |= OFF_TIMER;
pPort->offTime = currentTime.milliseconds + OFF_DELAY;
- }
}
+ }
LEAVE_PROC("SMI_StopVideo");
}
-
static int
SMI_SetPortAttribute(
ScrnInfoPtr pScrn,
@@ -1451,63 +1385,51 @@ SMI_SetPortAttribute(
{
int res;
SMI_PortPtr pPort = (SMI_PortPtr) data;
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_SetPortAttribute");
+ ENTER_PROC("SMI_SetPortAttribute");
if (attribute == xvColorKey) {
- int r, g, b;
+ int r, g, b;
pPort->Attribute[XV_COLORKEY] = value;
- switch (pScrn->depth)
- {
- case 8:
- SetKeyReg(pSmi, FPR04, value & 0x00FF);
- break;
-
- case 15:
- case 16:
- SetKeyReg(pSmi, FPR04, value & 0xFFFF);
- break;
-
- default:
- r = (value & pScrn->mask.red) >> pScrn->offset.red;
- g = (value & pScrn->mask.green) >> pScrn->offset.green;
- b = (value & pScrn->mask.blue) >> pScrn->offset.blue;
- SetKeyReg(pSmi, FPR04,
- ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3));
- break;
- }
- res = Success;
+ switch (pScrn->depth) {
+ case 8:
+ SetKeyReg(pSmi, FPR04, value & 0x00FF);
+ break;
+ case 15:
+ case 16:
+ SetKeyReg(pSmi, FPR04, value & 0xFFFF);
+ break;
+ default:
+ r = (value & pScrn->mask.red) >> pScrn->offset.red;
+ g = (value & pScrn->mask.green) >> pScrn->offset.green;
+ b = (value & pScrn->mask.blue) >> pScrn->offset.blue;
+ SetKeyReg(pSmi, FPR04, ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3));
+ break;
}
- else if (attribute == xvInterlaced) {
+ res = Success;
+ } else if (attribute == xvInterlaced) {
pPort->Attribute[XV_INTERLACED] = (value != 0);
res = Success;
- }
- else if (attribute == xvEncoding) {
+ } else if (attribute == xvEncoding) {
res = SetAttr(pScrn, XV_ENCODING, value);
- }
- else if (attribute == xvBrightness) {
+ } else if (attribute == xvBrightness) {
res = SetAttr(pScrn, XV_BRIGHTNESS, value);
- }
- else if (attribute == xvCapBrightness) {
+ } else if (attribute == xvCapBrightness) {
res = SetAttr(pScrn, XV_CAPTURE_BRIGHTNESS, value);
- }
- else if (attribute == xvContrast) {
+ } else if (attribute == xvContrast) {
res = SetAttr(pScrn, XV_CONTRAST, value);
- }
- else if (attribute == xvSaturation) {
+ } else if (attribute == xvSaturation) {
res = SetAttr(pScrn, XV_SATURATION, value);
- }
- else if (attribute == xvHue) {
+ } else if (attribute == xvHue) {
res = SetAttr(pScrn, XV_HUE, value);
- }
- else {
+ } else {
res = BadMatch;
- }
+ }
- LEAVE_PROC("SMI_SetPortAttribute");
- return(res);
+ LEAVE_PROC("SMI_SetPortAttribute");
+ return res;
}
@@ -1521,7 +1443,7 @@ SMI_GetPortAttribute(
{
SMI_PortPtr pPort = (SMI_PortPtr) data;
- ENTER_PROC("SMI_GetPortAttribute");
+ ENTER_PROC("SMI_GetPortAttribute");
if (attribute == xvEncoding)
*value = pPort->Attribute[XV_ENCODING];
else if (attribute == xvBrightness)
@@ -1536,15 +1458,13 @@ SMI_GetPortAttribute(
*value = pPort->Attribute[XV_HUE];
else if (attribute == xvColorKey)
*value = pPort->Attribute[XV_COLORKEY];
-
- else
- {
- LEAVE_PROC("SMI_GetPortAttribute");
- return(BadMatch);
- }
-
+ else {
LEAVE_PROC("SMI_GetPortAttribute");
- return(Success);
+ return BadMatch;
+ }
+
+ LEAVE_PROC("SMI_GetPortAttribute");
+ return Success;
}
@@ -1561,14 +1481,14 @@ SMI_QueryBestSize(
pointer data
)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- ENTER_PROC("SMI_QueryBestSize");
+ ENTER_PROC("SMI_QueryBestSize");
- *p_w = min(drw_w, pSmi->lcdWidth);
- *p_h = min(drw_h, pSmi->lcdHeight);
+ *p_w = min(drw_w, pSmi->lcdWidth);
+ *p_h = min(drw_h, pSmi->lcdHeight);
- LEAVE_PROC("SMI_QueryBestSize");
+ LEAVE_PROC("SMI_QueryBestSize");
}
@@ -1593,113 +1513,97 @@ SMI_PutImage(
DrawablePtr pDraw
)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr;
- INT32 x1, y1, x2, y2;
- int bpp = 0;
- int fbPitch, srcPitch, srcPitch2 = 0, dstPitch, areaHeight;
- BoxRec dstBox;
- CARD32 offset, offset2 = 0, offset3 = 0, tmp;
- int left, top, nPixels, nLines;
- unsigned char *dstStart;
-
- ENTER_PROC("SMI_PutImage");
-
- x1 = src_x;
- y1 = src_y;
- x2 = src_x + src_w;
- y2 = src_y + src_h;
-
- dstBox.x1 = drw_x;
- dstBox.y1 = drw_y;
- dstBox.x2 = drw_x + drw_w;
- dstBox.y2 = drw_y + drw_h;
-
- if (!SMI_ClipVideo(pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes, width,
- height))
- {
- LEAVE_PROC("SMI_PutImage");
- return(Success);
- }
+ INT32 x1, y1, x2, y2;
+ int bpp = 0;
+ int srcPitch, srcPitch2 = 0, dstPitch, size;
+ BoxRec dstBox;
+ CARD32 offset, offset2 = 0, offset3 = 0, tmp;
+ int left, top, nPixels, nLines;
+ unsigned char *dstStart;
+
+ ENTER_PROC("SMI_PutImage");
+
+ x1 = src_x;
+ y1 = src_y;
+ x2 = src_x + src_w;
+ y2 = src_y + src_h;
+
+ dstBox.x1 = drw_x;
+ dstBox.y1 = drw_y;
+ dstBox.x2 = drw_x + drw_w;
+ dstBox.y2 = drw_y + drw_h;
+
+ if (!SMI_ClipVideo(pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes, width, height)) {
+ LEAVE_PROC("SMI_PutImage");
+ return Success;
+ }
- dstBox.x1 -= pScrn->frameX0;
- dstBox.y1 -= pScrn->frameY0;
- dstBox.x2 -= pScrn->frameX0;
- dstBox.y2 -= pScrn->frameY0;
+ dstBox.x1 -= pScrn->frameX0;
+ dstBox.y1 -= pScrn->frameY0;
+ dstBox.x2 -= pScrn->frameX0;
+ dstBox.y2 -= pScrn->frameY0;
- if (pSmi->Bpp == 3)
- {
- fbPitch = pSmi->Stride;
- }
- else
- {
- fbPitch = pSmi->Stride * pSmi->Bpp;
- }
- switch (id)
- {
- case FOURCC_YV12:
- srcPitch = (width + 3) & ~3;
- offset2 = srcPitch * height;
- srcPitch2 = ((width >> 1) + 3) & ~3;
- offset3 = offset2 + (srcPitch2 * (height >> 1));
- dstPitch = ((width << 1) + 15) & ~15;
- break;
-
- case FOURCC_I420:
- srcPitch = (width + 3) & ~3;
- offset3 = srcPitch * height;
- srcPitch2 = ((width >> 1) + 3) & ~3;
- offset2 = offset3 + (srcPitch2 * (height >> 1));
- dstPitch = ((width << 1) + 15) & ~15;
- break;
-
- case FOURCC_RV24:
- bpp = 3;
- srcPitch = width * bpp;
- dstPitch = (srcPitch + 15) & ~15;
- break;
-
- case FOURCC_RV32:
- bpp = 4;
- srcPitch = width * bpp;
- dstPitch = (srcPitch + 15) & ~15;
- break;
-
- case FOURCC_YUY2:
- case FOURCC_RV15:
- case FOURCC_RV16:
- default:
- bpp = 2;
- srcPitch = width * bpp;
- dstPitch = (srcPitch + 15) & ~15;
- break;
- }
+ switch (id) {
+ case FOURCC_YV12:
+ srcPitch = (width + 3) & ~3;
+ offset2 = srcPitch * height;
+ srcPitch2 = ((width >> 1) + 3) & ~3;
+ offset3 = offset2 + (srcPitch2 * (height >> 1));
+ dstPitch = ((width << 1) + 15) & ~15;
+ break;
+ case FOURCC_I420:
+ srcPitch = (width + 3) & ~3;
+ offset3 = srcPitch * height;
+ srcPitch2 = ((width >> 1) + 3) & ~3;
+ offset2 = offset3 + (srcPitch2 * (height >> 1));
+ dstPitch = ((width << 1) + 15) & ~15;
+ break;
+ case FOURCC_RV24:
+ bpp = 3;
+ srcPitch = width * bpp;
+ dstPitch = (srcPitch + 15) & ~15;
+ break;
+ case FOURCC_RV32:
+ bpp = 4;
+ srcPitch = width * bpp;
+ dstPitch = (srcPitch + 15) & ~15;
+ break;
+ case FOURCC_YUY2:
+ case FOURCC_RV15:
+ case FOURCC_RV16:
+ default:
+ bpp = 2;
+ srcPitch = width * bpp;
+ dstPitch = (srcPitch + 15) & ~15;
+ break;
+ }
- areaHeight = ((dstPitch * height) + fbPitch - 1) / fbPitch;
- pPort->area = SMI_AllocateMemory(pScrn, pPort->area, areaHeight);
- if (pPort->area == NULL)
- {
- LEAVE_PROC("SMI_PutImage");
- return(BadAlloc);
- }
+ size = dstPitch * height;
+ pPort->video_offset = SMI_AllocateMemory(pScrn, &pPort->video_memory, size);
+ if (pPort->video_offset == 0) {
+ LEAVE_PROC("SMI_PutImage");
+ return BadAlloc;
+ }
- top = y1 >> 16;
- left = (x1 >> 16) & ~1;
- nPixels = ((((x2 + 0xFFFF) >> 16) + 1) & ~1) - left;
- left *= bpp;
+ top = y1 >> 16;
+ left = (x1 >> 16) & ~1;
+ nPixels = ((((x2 + 0xFFFF) >> 16) + 1) & ~1) - left;
+ left *= bpp;
- offset = (pPort->area->box.y1 * fbPitch) + (top * dstPitch);
- dstStart = pSmi->FBBase + offset + left;
+ offset = pPort->video_offset + (top * dstPitch);
+ dstStart = pSmi->FBBase + offset + left;
- switch(id) {
+ switch(id) {
case FOURCC_YV12:
case FOURCC_I420:
top &= ~1;
tmp = ((top >> 1) * srcPitch2) + (left >> 2);
offset2 += tmp;
offset3 += tmp;
- if(id == FOURCC_I420) {
+ if (id == FOURCC_I420) {
tmp = offset2;
offset2 = offset3;
offset3 = tmp;
@@ -1723,125 +1627,111 @@ SMI_PutImage(
#else
if (!REGION_EQUAL(pScrn->pScreen, &pPort->clip, clipBoxes))
#endif
- {
+ {
REGION_COPY(pScrn->pScreen, &pPort->clip, clipBoxes);
xf86XVFillKeyHelper(pScrn->pScreen, pPort->Attribute[XV_COLORKEY],
clipBoxes);
- }
+ }
- if (pSmi->Chipset != SMI_COUGAR3DR)
- SMI_DisplayVideo(pScrn, id, offset, width, height, dstPitch, x1, y1, x2, y2,
- &dstBox, src_w, src_h, drw_w, drw_h);
- else
- SMI_DisplayVideo0730(pScrn, id, offset, width, height, dstPitch, x1, y1, x2, y2,
- &dstBox, src_w, src_h, drw_w, drw_h);
+ if (pSmi->Chipset != SMI_COUGAR3DR)
+ SMI_DisplayVideo(pScrn, id, offset, width, height, dstPitch, x1, y1, x2, y2,
+ &dstBox, src_w, src_h, drw_w, drw_h);
+ else
+ SMI_DisplayVideo0730(pScrn, id, offset, width, height, dstPitch, x1, y1, x2, y2,
+ &dstBox, src_w, src_h, drw_w, drw_h);
pPort->videoStatus = CLIENT_VIDEO_ON;
- LEAVE_PROC("SMI_PutImage");
- return(Success);
+ LEAVE_PROC("SMI_PutImage");
+ return Success;
}
static int
SMI_QueryImageAttributes(
- ScrnInfoPtr pScrn,
- int id,
+ ScrnInfoPtr pScrn,
+ int id,
unsigned short *width,
unsigned short *height,
- int *pitches,
- int *offsets
+ int *pitches,
+ int *offsets
)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- int size, tmp;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int size, tmp;
- ENTER_PROC("SMI_QueryImageAttributes");
+ ENTER_PROC("SMI_QueryImageAttributes");
- if (*width > pSmi->lcdWidth)
- {
- *width = pSmi->lcdWidth;
+ if (*width > pSmi->lcdWidth) {
+ *width = pSmi->lcdWidth;
+ }
+ if (*height > pSmi->lcdHeight) {
+ *height = pSmi->lcdHeight;
+ }
+
+ *width = (*width + 1) & ~1;
+ if (offsets != NULL) {
+ offsets[0] = 0;
+ }
+
+ switch (id) {
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ *height = (*height + 1) & ~1;
+ size = (*width + 3) & ~3;
+ if (pitches != NULL) {
+ pitches[0] = size;
}
- if (*height > pSmi->lcdHeight)
- {
- *height = pSmi->lcdHeight;
+ size *= *height;
+ if (offsets != NULL) {
+ offsets[1] = size;
}
-
- *width = (*width + 1) & ~1;
- if (offsets != NULL)
- {
- offsets[0] = 0;
+ tmp = ((*width >> 1) + 3) & ~3;
+ if (pitches != NULL) {
+ pitches[1] = pitches[2] = tmp;
}
-
- switch (id)
- {
- case FOURCC_YV12:
- case FOURCC_I420:
- *height = (*height + 1) & ~1;
- size = (*width + 3) & ~3;
- if (pitches != NULL)
- {
- pitches[0] = size;
- }
- size *= *height;
- if (offsets != NULL)
- {
- offsets[1] = size;
- }
- tmp = ((*width >> 1) + 3) & ~3;
- if (pitches != NULL)
- {
- pitches[1] = pitches[2] = tmp;
- }
- tmp *= (*height >> 1);
- size += tmp;
- if (offsets != NULL)
- {
- offsets[2] = size;
- }
- size += tmp;
- break;
-
- case FOURCC_YUY2:
- case FOURCC_RV15:
- case FOURCC_RV16:
- default:
- size = *width * 2;
- if (pitches != NULL)
- {
- pitches[0] = size;
- }
- size *= *height;
- break;
-
- case FOURCC_RV24:
- size = *width * 3;
- if (pitches != NULL)
- {
- pitches[0] = size;
- }
- size *= *height;
- break;
-
- case FOURCC_RV32:
- size = *width * 4;
- if (pitches != NULL)
- {
- pitches[0] = size;
- }
- size *= *height;
- break;
+ tmp *= (*height >> 1);
+ size += tmp;
+ if (offsets != NULL) {
+ offsets[2] = size;
+ }
+ size += tmp;
+ break;
+ case FOURCC_YUY2:
+ case FOURCC_RV15:
+ case FOURCC_RV16:
+ default:
+ size = *width * 2;
+ if (pitches != NULL) {
+ pitches[0] = size;
}
+ size *= *height;
+ break;
+ case FOURCC_RV24:
+ size = *width * 3;
+ if (pitches != NULL) {
+ pitches[0] = size;
+ }
+ size *= *height;
+ break;
+ case FOURCC_RV32:
+ size = *width * 4;
+ if (pitches != NULL) {
+ pitches[0] = size;
+ }
+ size *= *height;
+ break;
+ }
- LEAVE_PROC("SMI_QueryImageAttributes");
- return(size);
+ LEAVE_PROC("SMI_QueryImageAttributes");
+ return size;
}
/******************************************************************************\
-** **
-** S U P P O R T F U N C T I O N S **
-** **
+** **
+** S U P P O R T F U N C T I O N S **
+** **
\******************************************************************************/
#if 0
static void
@@ -1874,67 +1764,61 @@ SMI_ClipVideo(
{
ScreenPtr pScreen = pScrn->pScreen;
INT32 vscale, hscale;
- BoxPtr extents = REGION_EXTENTS(pScreen, reg);
- int diff;
+ BoxPtr extents = REGION_EXTENTS(pScreen, reg);
+ int diff;
- ENTER_PROC("SMI_ClipVideo");
+ ENTER_PROC("SMI_ClipVideo");
DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16));
- /* PDR#941 */
- extents->x1 = max(extents->x1, pScrn->frameX0);
- extents->y1 = max(extents->y1, pScrn->frameY0);
+ /* PDR#941 */
+ extents->x1 = max(extents->x1, pScrn->frameX0);
+ extents->y1 = max(extents->y1, pScrn->frameY0);
- hscale = ((*x2 - *x1) << 16) / (dst->x2 - dst->x1);
- vscale = ((*y2 - *y1) << 16) / (dst->y2 - dst->y1);
+ hscale = ((*x2 - *x1) << 16) / (dst->x2 - dst->x1);
+ vscale = ((*y2 - *y1) << 16) / (dst->y2 - dst->y1);
- *x1 <<= 16; *y1 <<= 16;
- *x2 <<= 16; *y2 <<= 16;
+ *x1 <<= 16; *y1 <<= 16;
+ *x2 <<= 16; *y2 <<= 16;
DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16));
- diff = extents->x1 - dst->x1;
- if (diff > 0)
- {
- dst->x1 = extents->x1;
- *x1 += diff * hscale;
- }
+ diff = extents->x1 - dst->x1;
+ if (diff > 0) {
+ dst->x1 = extents->x1;
+ *x1 += diff * hscale;
+ }
- diff = extents->y1 - dst->y1;
- if (diff > 0)
- {
- dst->y1 = extents->y1;
- *y1 += diff * vscale;
- }
+ diff = extents->y1 - dst->y1;
+ if (diff > 0) {
+ dst->y1 = extents->y1;
+ *y1 += diff * vscale;
+ }
- diff = dst->x2 - extents->x2;
- if (diff > 0)
- {
- dst->x2 = extents->x2; /* PDR#687 */
- *x2 -= diff * hscale;
- }
+ diff = dst->x2 - extents->x2;
+ if (diff > 0) {
+ dst->x2 = extents->x2; /* PDR#687 */
+ *x2 -= diff * hscale;
+ }
- diff = dst->y2 - extents->y2;
- if (diff > 0)
- {
- dst->y2 = extents->y2;
- *y2 -= diff * vscale;
- }
+ diff = dst->y2 - extents->y2;
+ if (diff > 0) {
+ dst->y2 = extents->y2;
+ *y2 -= diff * vscale;
+ }
DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16));
- if (*x1 < 0)
- {
- diff = (-*x1 + hscale - 1) / hscale;
- dst->x1 += diff;
- *x1 += diff * hscale;
- }
+ if (*x1 < 0) {
+ diff = (-*x1 + hscale - 1) / hscale;
+ dst->x1 += diff;
+ *x1 += diff * hscale;
+ }
- if (*y1 < 0)
- {
- diff = (-*y1 + vscale - 1) / vscale;
- dst->y1 += diff;
- *y1 += diff * vscale;
- }
+ if (*y1 < 0) {
+ diff = (-*y1 + vscale - 1) / vscale;
+ dst->y1 += diff;
+ *y1 += diff * vscale;
+ }
DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16));
@@ -1958,40 +1842,37 @@ SMI_ClipVideo(
DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16));
- if ((*x1 >= *x2) || (*y1 >= *y2))
- {
- LEAVE_PROC("SMI_ClipVideo");
- return(FALSE);
- }
+ if ((*x1 >= *x2) || (*y1 >= *y2)) {
+ LEAVE_PROC("SMI_ClipVideo");
+ return FALSE;
+ }
- if ( (dst->x1 != extents->x1) || (dst->y1 != extents->y1)
- || (dst->x2 != extents->x2) || (dst->y2 != extents->y2)
- )
- {
- RegionRec clipReg;
- REGION_INIT(pScreen, &clipReg, dst, 1);
- REGION_INTERSECT(pScreen, reg, reg, &clipReg);
- REGION_UNINIT(pScreen, &clipReg);
- }
+ if ((dst->x1 != extents->x1) || (dst->y1 != extents->y1) ||
+ (dst->x2 != extents->x2) || (dst->y2 != extents->y2)) {
+ RegionRec clipReg;
+ REGION_INIT(pScreen, &clipReg, dst, 1);
+ REGION_INTERSECT(pScreen, reg, reg, &clipReg);
+ REGION_UNINIT(pScreen, &clipReg);
+ }
DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16));
- LEAVE_PROC("SMI_ClipVideo");
- return(TRUE);
+ LEAVE_PROC("SMI_ClipVideo");
+ return TRUE;
}
static void
SMI_DisplayVideo(
ScrnInfoPtr pScrn,
- int id,
- int offset,
+ int id,
+ int offset,
short width,
short height,
- int pitch,
- int x1,
- int y1,
- int x2,
- int y2,
+ int pitch,
+ int x1,
+ int y1,
+ int x2,
+ int y2,
BoxPtr dstBox,
short vid_w,
short vid_h,
@@ -1999,83 +1880,71 @@ SMI_DisplayVideo(
short drw_h
)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- CARD32 vpr00;
- int hstretch, vstretch;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ CARD32 vpr00;
+ int hstretch, vstretch;
- ENTER_PROC("SMI_DisplayVideo");
+ ENTER_PROC("SMI_DisplayVideo");
- vpr00 = READ_VPR(pSmi, 0x00) & ~0x0CB800FF;
+ vpr00 = READ_VPR(pSmi, 0x00) & ~0x0CB800FF;
- switch (id)
- {
- case FOURCC_YV12:
- case FOURCC_I420:
- case FOURCC_YUY2:
- vpr00 |= 0x6;
- break;
-
- case FOURCC_RV15:
- vpr00 |= 0x1;
- break;
-
- case FOURCC_RV16:
- vpr00 |= 0x2;
- break;
-
- case FOURCC_RV24:
- vpr00 |= 0x4;
- break;
-
- case FOURCC_RV32:
- vpr00 |= 0x3;
- break;
- }
+ switch (id) {
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ case FOURCC_YUY2:
+ vpr00 |= 0x6;
+ break;
+ case FOURCC_RV15:
+ vpr00 |= 0x1;
+ break;
+ case FOURCC_RV16:
+ vpr00 |= 0x2;
+ break;
+ case FOURCC_RV24:
+ vpr00 |= 0x4;
+ break;
+ case FOURCC_RV32:
+ vpr00 |= 0x3;
+ break;
+ }
-
- if (drw_w > vid_w)
- {
- hstretch = (2560 * vid_w / drw_w + 5) / 10;
- }
- else
- {
- hstretch = 0;
- }
+ if (drw_w > vid_w) {
+ hstretch = (2560 * vid_w / drw_w + 5) / 10;
+ } else {
+ hstretch = 0;
+ }
- if (drw_h > vid_h)
- {
- vstretch = (2560 * vid_h / drw_h + 5) / 10;
- vpr00 |= 1 << 21;
- }
- else
- {
- vstretch = 0;
- }
+ if (drw_h > vid_h) {
+ vstretch = (2560 * vid_h / drw_h + 5) / 10;
+ vpr00 |= 1 << 21;
+ } else {
+ vstretch = 0;
+ }
#if 0
- SMI_WaitForSync(pScrn);
+ SMI_WaitForSync(pScrn);
#endif
- WRITE_VPR(pSmi, 0x00, vpr00 | (1 << 3) | (1 << 20));
- WRITE_VPR(pSmi, 0x14, (dstBox->x1) | (dstBox->y1 << 16));
- WRITE_VPR(pSmi, 0x18, (dstBox->x2) | (dstBox->y2 << 16));
- WRITE_VPR(pSmi, 0x1C, offset >> 3);
- WRITE_VPR(pSmi, 0x20, (pitch >> 3) | ((pitch >> 3) << 16));
- WRITE_VPR(pSmi, 0x24, (hstretch << 8) | vstretch);
-
- LEAVE_PROC("SMI_DisplayVideo");
+ WRITE_VPR(pSmi, 0x00, vpr00 | (1 << 3) | (1 << 20));
+ WRITE_VPR(pSmi, 0x14, (dstBox->x1) | (dstBox->y1 << 16));
+ WRITE_VPR(pSmi, 0x18, (dstBox->x2) | (dstBox->y2 << 16));
+ WRITE_VPR(pSmi, 0x1C, offset >> 3);
+ WRITE_VPR(pSmi, 0x20, (pitch >> 3) | ((pitch >> 3) << 16));
+ WRITE_VPR(pSmi, 0x24, (hstretch << 8) | vstretch);
+
+ LEAVE_PROC("SMI_DisplayVideo");
}
static void
SMI_DisplayVideo0730(
ScrnInfoPtr pScrn,
- int id,
- int offset,
+ int id,
+ int offset,
short width,
short height,
- int pitch,
- int x1,
- int y1,
- int x2,
- int y2,
+ int pitch,
+ int x1,
+ int y1,
+ int x2,
+ int y2,
BoxPtr dstBox,
short vid_w,
short vid_h,
@@ -2083,117 +1952,96 @@ SMI_DisplayVideo0730(
short drw_h
)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- CARD32 fpr00;
- int hstretch, vstretch;
+ SMIPtr pSmi = SMIPTR(pScrn);
+ CARD32 fpr00;
+ int hstretch, vstretch;
- ENTER_PROC("SMI_DisplayVideo0730");
+ ENTER_PROC("SMI_DisplayVideo0730");
- fpr00 = READ_FPR(pSmi, 0x00) & ~(FPR00_MASKBITS);
+ fpr00 = READ_FPR(pSmi, 0x00) & ~(FPR00_MASKBITS);
- switch (id)
- {
- case FOURCC_YV12:
- case FOURCC_I420:
- case FOURCC_YUY2:
- fpr00 |= FPR00_FMT_YUV422;
- break;
-
- case FOURCC_RV15:
- fpr00 |= FPR00_FMT_15P;
- break;
-
- case FOURCC_RV16:
- fpr00 |= FPR00_FMT_16P;
- break;
-
- case FOURCC_RV24:
- fpr00 |= FPR00_FMT_24P;
- break;
-
- case FOURCC_RV32:
- fpr00 |= FPR00_FMT_32P;
- break;
- }
+ switch (id) {
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ case FOURCC_YUY2:
+ fpr00 |= FPR00_FMT_YUV422;
+ break;
+ case FOURCC_RV15:
+ fpr00 |= FPR00_FMT_15P;
+ break;
+ case FOURCC_RV16:
+ fpr00 |= FPR00_FMT_16P;
+ break;
+ case FOURCC_RV24:
+ fpr00 |= FPR00_FMT_24P;
+ break;
+ case FOURCC_RV32:
+ fpr00 |= FPR00_FMT_32P;
+ break;
+ }
- /* the formulas for calculating the stretch values do not match the
- documentation, but they're the same as the ddraw driver and they work */
- if (drw_w > vid_w)
- {
- hstretch = (8192 * vid_w / drw_w);
- }
- else
- {
- hstretch = 0;
- }
+ /* the formulas for calculating the stretch values do not match the
+ documentation, but they're the same as the ddraw driver and they work */
+ if (drw_w > vid_w) {
+ hstretch = (8192 * vid_w / drw_w);
+ } else {
+ hstretch = 0;
+ }
- if (drw_h > vid_h)
- {
- vstretch = (8192 * vid_h / drw_h);
- }
- else
- {
- vstretch = 0;
- }
-
+ if (drw_h > vid_h) {
+ vstretch = (8192 * vid_h / drw_h);
+ } else {
+ vstretch = 0;
+ }
- WRITE_FPR(pSmi, FPR00, fpr00 | FPR00_VWIENABLE | FPR00_VWIKEYENABLE);
- WRITE_FPR(pSmi, FPR14, (dstBox->x1) | (dstBox->y1 << 16));
- WRITE_FPR(pSmi, FPR18, (dstBox->x2) | (dstBox->y2 << 16));
- WRITE_FPR(pSmi, FPR1C, offset >> 3);
- WRITE_FPR(pSmi, FPR20, (pitch >> 3) | ((pitch >> 3) << 16));
- WRITE_FPR(pSmi, FPR24, (hstretch & 0xFF00) | ((vstretch & 0xFF00)>>8));
- WRITE_FPR(pSmi, FPR68, ((hstretch & 0x00FF)<<8) | (vstretch & 0x00FF));
+ WRITE_FPR(pSmi, FPR00, fpr00 | FPR00_VWIENABLE | FPR00_VWIKEYENABLE);
+ WRITE_FPR(pSmi, FPR14, (dstBox->x1) | (dstBox->y1 << 16));
+ WRITE_FPR(pSmi, FPR18, (dstBox->x2) | (dstBox->y2 << 16));
+ WRITE_FPR(pSmi, FPR1C, offset >> 3);
+ WRITE_FPR(pSmi, FPR20, (pitch >> 3) | ((pitch >> 3) << 16));
+ WRITE_FPR(pSmi, FPR24, (hstretch & 0xFF00) | ((vstretch & 0xFF00)>>8));
+ WRITE_FPR(pSmi, FPR68, ((hstretch & 0x00FF)<<8) | (vstretch & 0x00FF));
- LEAVE_PROC("SMI_DisplayVideo0730");
+ LEAVE_PROC("SMI_DisplayVideo0730");
}
static void
SMI_BlockHandler(
- int i,
+ int i,
pointer blockData,
pointer pTimeout,
pointer pReadMask
)
{
- ScreenPtr pScreen = screenInfo.screens[i];
- ScrnInfoPtr pScrn = xf86Screens[i];
- SMIPtr pSmi = SMIPTR(pScrn);
+ ScreenPtr pScreen = screenInfo.screens[i];
+ ScrnInfoPtr pScrn = xf86Screens[i];
+ SMIPtr pSmi = SMIPTR(pScrn);
SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr;
- pScreen->BlockHandler = pSmi->BlockHandler;
- (*pScreen->BlockHandler)(i, blockData, pTimeout, pReadMask);
- pScreen->BlockHandler = SMI_BlockHandler;
+ pScreen->BlockHandler = pSmi->BlockHandler;
+ (*pScreen->BlockHandler)(i, blockData, pTimeout, pReadMask);
+ pScreen->BlockHandler = SMI_BlockHandler;
- if (pPort->videoStatus & TIMER_MASK)
- {
- UpdateCurrentTime();
- if (pPort->videoStatus & OFF_TIMER)
- {
- if (pPort->offTime < currentTime.milliseconds)
- {
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
- WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE));
- }
- else
- {
- WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x00000008);
- }
+ if (pPort->videoStatus & TIMER_MASK) {
+ UpdateCurrentTime();
+ if (pPort->videoStatus & OFF_TIMER) {
+ if (pPort->offTime < currentTime.milliseconds) {
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
+ WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE));
+ } else {
+ WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x00000008);
+ }
pPort->videoStatus = FREE_TIMER;
pPort->freeTime = currentTime.milliseconds + FREE_DELAY;
- }
- }
- else
- {
- if (pPort->freeTime < currentTime.milliseconds)
- {
- xf86FreeOffscreenArea(pPort->area);
- pPort->area = NULL;
- }
+ }
+ } else {
+ if (pPort->freeTime < currentTime.milliseconds) {
+ SMI_FreeMemory(pScrn, pPort->video_memory);
+ pPort->video_memory = NULL;
+ }
pPort->videoStatus = 0;
- }
}
+ }
}
#if 0
@@ -2251,9 +2099,9 @@ SMI_SendI2C(
#endif
/******************************************************************************\
-** **
-** O F F S C R E E N M E M O R Y M A N A G E R **
-** **
+** **
+** O F F S C R E E N M E M O R Y M A N A G E R **
+** **
\******************************************************************************/
static void
@@ -2261,204 +2109,242 @@ SMI_InitOffscreenImages(
ScreenPtr pScreen
)
{
- XF86OffscreenImagePtr offscreenImages;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- SMIPtr pSmi = SMIPTR(pScrn);
- SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr;
+ XF86OffscreenImagePtr offscreenImages;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr;
- ENTER_PROC("SMI_InitOffscreenImages");
+ ENTER_PROC("SMI_InitOffscreenImages");
- offscreenImages = xalloc(sizeof(XF86OffscreenImageRec));
- if (offscreenImages == NULL)
- {
- LEAVE_PROC("SMI_InitOffscreenImages");
- return;
- }
+ offscreenImages = xalloc(sizeof(XF86OffscreenImageRec));
+ if (offscreenImages == NULL) {
+ LEAVE_PROC("SMI_InitOffscreenImages");
+ return;
+ }
- offscreenImages->image = SMI_VideoImages;
- offscreenImages->flags = VIDEO_OVERLAID_IMAGES
- | VIDEO_CLIP_TO_VIEWPORT;
- offscreenImages->alloc_surface = SMI_AllocSurface;
- offscreenImages->free_surface = SMI_FreeSurface;
- offscreenImages->display = SMI_DisplaySurface;
- offscreenImages->stop = SMI_StopSurface;
- offscreenImages->getAttribute = SMI_GetSurfaceAttribute;
- offscreenImages->setAttribute = SMI_SetSurfaceAttribute;
- offscreenImages->max_width = pSmi->lcdWidth;
- offscreenImages->max_height = pSmi->lcdHeight;
- if (!pPort->I2CDev.SlaveAddr) {
- offscreenImages->num_attributes = nElems(SMI_VideoAttributes);
- offscreenImages->attributes = SMI_VideoAttributes;
- } else {
- offscreenImages->num_attributes =
- nElems(SMI_VideoAttributesSAA711x);
- offscreenImages->attributes = SMI_VideoAttributesSAA711x;
- }
- xf86XVRegisterOffscreenImages(pScreen, offscreenImages, 1);
+ offscreenImages->image = SMI_VideoImages;
+ offscreenImages->flags = VIDEO_OVERLAID_IMAGES
+ | VIDEO_CLIP_TO_VIEWPORT;
+ offscreenImages->alloc_surface = SMI_AllocSurface;
+ offscreenImages->free_surface = SMI_FreeSurface;
+ offscreenImages->display = SMI_DisplaySurface;
+ offscreenImages->stop = SMI_StopSurface;
+ offscreenImages->getAttribute = SMI_GetSurfaceAttribute;
+ offscreenImages->setAttribute = SMI_SetSurfaceAttribute;
+ offscreenImages->max_width = pSmi->lcdWidth;
+ offscreenImages->max_height = pSmi->lcdHeight;
+ if (!pPort->I2CDev.SlaveAddr) {
+ offscreenImages->num_attributes = nElems(SMI_VideoAttributes);
+ offscreenImages->attributes = SMI_VideoAttributes;
+ } else {
+ offscreenImages->num_attributes = nElems(SMI_VideoAttributesSAA711x);
+ offscreenImages->attributes = SMI_VideoAttributesSAA711x;
+ }
+ xf86XVRegisterOffscreenImages(pScreen, offscreenImages, 1);
- LEAVE_PROC("SMI_InitOffscreenImages");
+ LEAVE_PROC("SMI_InitOffscreenImages");
+}
+
+static void
+SMI_VideoSave(ScreenPtr pScreen, ExaOffscreenArea *area)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ SMI_PortPtr pPort = pSmi->ptrAdaptor->pPortPrivates[0].ptr;
+
+ ENTER_PROC("SMI_VideoSave");
+
+ if (pPort->video_memory == area)
+ pPort->video_memory = NULL;
+
+ LEAVE_PROC("SMI_VideoSave");
}
-static FBAreaPtr
+static CARD32
SMI_AllocateMemory(
ScrnInfoPtr pScrn,
- FBAreaPtr area,
- int numLines
+ void **mem_struct,
+ int size
)
{
- ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
+ ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int offset = 0;
- ENTER_PROC("SMI_AllocateMemory");
+ ENTER_PROC("SMI_AllocateMemory");
- if (area != NULL)
- {
- if ((area->box.y2 - area->box.y1) >= numLines)
- {
- LEAVE_PROC("SMI_AllocateMemory (area->box.y2 - area->box.y1) >= numLines ok");
- return(area);
- }
+ if (pSmi->useEXA) {
+ ExaOffscreenArea *area = *mem_struct;
- if (xf86ResizeOffscreenArea(area, pScrn->displayWidth, numLines))
- {
- LEAVE_PROC("SMI_AllocateMemory xf86ResizeOffscreenArea ok");
- return(area);
- }
+ if (area != NULL) {
+ if (area->size >= size)
+ return area->offset;
- xf86FreeOffscreenArea(area);
+ exaOffscreenFree(pScrn->pScreen, area);
}
- area = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth, numLines, 0,
- NULL, NULL, NULL);
+ area = exaOffscreenAlloc(pScrn->pScreen, size, 64, TRUE, SMI_VideoSave, NULL);
+ *mem_struct = area;
if (area == NULL)
- {
- int maxW, maxH;
+ return 0;
+ offset = area->offset;
+ } else {
+ FBLinearPtr linear = *mem_struct;
- xf86QueryLargestOffscreenArea(pScreen, &maxW, &maxH, 0,
- FAVOR_WIDTH_THEN_AREA, PRIORITY_EXTREME);
+ /* XAA allocates in units of pixels at the screen bpp,
+ * so adjust size appropriately.
+ */
+ size = (size + pSmi->Bpp - 1) / pSmi->Bpp;
- DEBUG((VERBLEV, "QueryLargestOffscreenArea maxW=%d maxH=%d displayWidth=%d numlines=%d\n",
- maxW, maxH, pScrn->displayWidth, numLines));
- if ((maxW < pScrn->displayWidth) || (maxH < numLines))
- {
- LEAVE_PROC("SMI_AllocateMemory (maxW < pScrn->displayWidth) || (maxH < numLines)");
- return(NULL);
- }
+ if (linear) {
+ if (linear->size >= size)
+ return linear->offset * pSmi->Bpp;
+ if (xf86ResizeOffscreenLinear(linear, size))
+ return linear->offset * pSmi->Bpp;
+
+ xf86FreeOffscreenLinear(linear);
+ }
+
+ linear = xf86AllocateOffscreenLinear(pScreen, size, 16, NULL, NULL, NULL);
+ *mem_struct = linear;
+
+ if (!linear) {
+ int max_size;
+
+ xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16, PRIORITY_EXTREME);
+ if (max_size < size)
+ return 0;
+
xf86PurgeUnlockedOffscreenAreas(pScreen);
- area = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth, numLines,
- 0, NULL, NULL, NULL);
+
+ linear = xf86AllocateOffscreenLinear(pScreen, size, 16, NULL, NULL, NULL);
+ *mem_struct = linear;
+
+ if (!linear)
+ return 0;
}
+ DEBUG((VERBLEV, "offset = %p\n", offset));
+ }
+
DEBUG((VERBLEV, "area = %p\n", area));
- LEAVE_PROC("SMI_AllocateMemory");
- return(area);
+ LEAVE_PROC("SMI_AllocateMemory");
+ return offset;
+}
+
+static void
+SMI_FreeMemory(
+ ScrnInfoPtr pScrn,
+ void *mem_struct
+)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_FreeMemory");
+
+ if (pSmi->useEXA) {
+ ExaOffscreenArea *area = mem_struct;
+
+ if (area != NULL)
+ exaOffscreenFree(pScrn->pScreen, area);
+ } else {
+ FBLinearPtr linear = mem_struct;
+
+ if (linear != NULL)
+ xf86FreeOffscreenLinear(linear);
+ }
+
+ LEAVE_PROC("SMI_FreeMemory");
}
static int
SMI_AllocSurface(
- ScrnInfoPtr pScrn,
- int id,
+ ScrnInfoPtr pScrn,
+ int id,
unsigned short width,
unsigned short height,
XF86SurfacePtr surface
)
{
- SMIPtr pSmi = SMIPTR(pScrn);
- int numLines, pitch, fbPitch, bpp;
- SMI_OffscreenPtr ptrOffscreen;
- FBAreaPtr area;
-
- ENTER_PROC("SMI_AllocSurface");
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int pitch, bpp, offset, size;
+ void *surface_memory = NULL;
+ SMI_OffscreenPtr ptrOffscreen;
- if ((width > pSmi->lcdWidth) || (height > pSmi->lcdHeight))
- {
- LEAVE_PROC("SMI_AllocSurface");
- return(BadAlloc);
- }
+ ENTER_PROC("SMI_AllocSurface");
- if (pSmi->Bpp == 3)
- {
- fbPitch = pSmi->Stride;
- }
- else
- {
- fbPitch = pSmi->Stride * pSmi->Bpp;
- }
+ if ((width > pSmi->lcdWidth) || (height > pSmi->lcdHeight)) {
+ LEAVE_PROC("SMI_AllocSurface");
+ return BadAlloc;
+ }
- width = (width + 1) & ~1;
- switch (id)
- {
- case FOURCC_YV12:
- case FOURCC_I420:
- case FOURCC_YUY2:
- case FOURCC_RV15:
- case FOURCC_RV16:
- bpp = 2;
- break;
-
- case FOURCC_RV24:
- bpp = 3;
- break;
-
- case FOURCC_RV32:
- bpp = 4;
- break;
-
- default:
- LEAVE_PROC("SMI_AllocSurface");
- return(BadAlloc);
- }
- pitch = (width * bpp + 15) & ~15;
+ switch (id) {
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ case FOURCC_YUY2:
+ case FOURCC_RV15:
+ case FOURCC_RV16:
+ bpp = 2;
+ break;
+ case FOURCC_RV24:
+ bpp = 3;
+ break;
+ case FOURCC_RV32:
+ bpp = 4;
+ break;
+ default:
+ LEAVE_PROC("SMI_AllocSurface");
+ return BadAlloc;
+ }
- numLines = ((height * pitch) + fbPitch - 1) / fbPitch;
+ width = (width + 1) & ~1;
+ pitch = (width * bpp + 15) & ~15;
+ size = pitch * height;
- area = SMI_AllocateMemory(pScrn, NULL, numLines);
- if (area == NULL)
- {
- LEAVE_PROC("SMI_AllocSurface");
- return(BadAlloc);
- }
+ offset = SMI_AllocateMemory(pScrn, &surface_memory, size);
+ if (offset == 0) {
+ LEAVE_PROC("SMI_AllocSurface");
+ return BadAlloc;
+ }
- surface->pitches = xalloc(sizeof(int));
- if (surface->pitches == NULL)
- {
- xf86FreeOffscreenArea(area);
- LEAVE_PROC("SMI_AllocSurface");
- return(BadAlloc);
- }
- surface->offsets = xalloc(sizeof(int));
- if (surface->offsets == NULL)
- {
- xfree(surface->pitches);
- xf86FreeOffscreenArea(area);
- LEAVE_PROC("SMI_AllocSurface");
- return(BadAlloc);
- }
+ surface->pitches = xalloc(sizeof(int));
+ if (surface->pitches == NULL) {
+ SMI_FreeMemory(pScrn, surface_memory);
+ LEAVE_PROC("SMI_AllocSurface");
+ return BadAlloc;
+ }
+ surface->offsets = xalloc(sizeof(int));
+ if (surface->offsets == NULL) {
+ xfree(surface->pitches);
+ SMI_FreeMemory(pScrn, surface_memory);
+ LEAVE_PROC("SMI_AllocSurface");
+ return BadAlloc;
+ }
- ptrOffscreen = xalloc(sizeof(SMI_OffscreenRec));
- if (ptrOffscreen == NULL)
- {
- xfree(surface->offsets);
- xfree(surface->pitches);
- xf86FreeOffscreenArea(area);
- LEAVE_PROC("SMI_AllocSurface");
- return(BadAlloc);
- }
+ ptrOffscreen = xalloc(sizeof(SMI_OffscreenRec));
+ if (ptrOffscreen == NULL) {
+ xfree(surface->offsets);
+ xfree(surface->pitches);
+ SMI_FreeMemory(pScrn, surface_memory);
+ LEAVE_PROC("SMI_AllocSurface");
+ return BadAlloc;
+ }
- surface->pScrn = pScrn;
- surface->id = id;
- surface->width = width;
- surface->height = height;
- surface->pitches[0] = pitch;
- surface->offsets[0] = area->box.y1 * fbPitch;
- surface->devPrivate.ptr = (pointer) ptrOffscreen;
+ surface->pScrn = pScrn;
+ surface->id = id;
+ surface->width = width;
+ surface->height = height;
+ surface->pitches[0] = pitch;
+ surface->offsets[0] = offset;
+ surface->devPrivate.ptr = (pointer) ptrOffscreen;
- ptrOffscreen->area = area;
- ptrOffscreen->isOn = FALSE;
+ ptrOffscreen->surface_memory = surface_memory;
+ ptrOffscreen->isOn = FALSE;
- LEAVE_PROC("SMI_AllocSurface");
- return(Success);
+ LEAVE_PROC("SMI_AllocSurface");
+ return Success;
}
static int
@@ -2466,97 +2352,92 @@ SMI_FreeSurface(
XF86SurfacePtr surface
)
{
- SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr;
+ ScrnInfoPtr pScrn = surface->pScrn;
+ SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr;
- ENTER_PROC("SMI_FreeSurface");
+ ENTER_PROC("SMI_FreeSurface");
- if (ptrOffscreen->isOn)
- {
- SMI_StopSurface(surface);
- }
+ if (ptrOffscreen->isOn) {
+ SMI_StopSurface(surface);
+ }
- xf86FreeOffscreenArea(ptrOffscreen->area);
- xfree(surface->pitches);
- xfree(surface->offsets);
- xfree(surface->devPrivate.ptr);
+ SMI_FreeMemory(pScrn, ptrOffscreen->surface_memory);
+ xfree(surface->pitches);
+ xfree(surface->offsets);
+ xfree(surface->devPrivate.ptr);
- LEAVE_PROC("SMI_FreeSurface");
- return(Success);
+ LEAVE_PROC("SMI_FreeSurface");
+ return Success;
}
static int
SMI_DisplaySurface(
XF86SurfacePtr surface,
- short vid_x,
- short vid_y,
- short drw_x,
- short drw_y,
- short vid_w,
- short vid_h,
- short drw_w,
- short drw_h,
- RegionPtr clipBoxes
+ short vid_x,
+ short vid_y,
+ short drw_x,
+ short drw_y,
+ short vid_w,
+ short vid_h,
+ short drw_w,
+ short drw_h,
+ RegionPtr clipBoxes
)
{
- SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr;
- SMIPtr pSmi = SMIPTR(surface->pScrn);
+ SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr;
+ SMIPtr pSmi = SMIPTR(surface->pScrn);
SMI_PortPtr pPort = pSmi->ptrAdaptor->pPortPrivates[0].ptr;
- INT32 x1, y1, x2, y2;
- BoxRec dstBox;
+ INT32 x1, y1, x2, y2;
+ BoxRec dstBox;
- ENTER_PROC("SMI_DisplaySurface");
+ ENTER_PROC("SMI_DisplaySurface");
- x1 = vid_x;
- x2 = vid_x + vid_w;
- y1 = vid_y;
- y2 = vid_y + vid_h;
+ x1 = vid_x;
+ x2 = vid_x + vid_w;
+ y1 = vid_y;
+ y2 = vid_y + vid_h;
- dstBox.x1 = drw_x;
- dstBox.x2 = drw_x + drw_w;
- dstBox.y1 = drw_y;
- dstBox.y2 = drw_y + drw_h;
+ dstBox.x1 = drw_x;
+ dstBox.x2 = drw_x + drw_w;
+ dstBox.y1 = drw_y;
+ dstBox.y2 = drw_y + drw_h;
- if (!SMI_ClipVideo(surface->pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes,
- surface->width, surface->height))
- {
- LEAVE_PROC("SMI_DisplaySurface");
- return(Success);
- }
-
- dstBox.x1 -= surface->pScrn->frameX0;
- dstBox.y1 -= surface->pScrn->frameY0;
- dstBox.x2 -= surface->pScrn->frameX0;
- dstBox.y2 -= surface->pScrn->frameY0;
-
- xf86XVFillKeyHelper(surface->pScrn->pScreen,
- pPort->Attribute[XV_COLORKEY], clipBoxes);
+ if (!SMI_ClipVideo(surface->pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes,
+ surface->width, surface->height)) {
+ LEAVE_PROC("SMI_DisplaySurface");
+ return Success;
+ }
- if (pSmi->Chipset != SMI_COUGAR3DR)
- {
- SMI_ResetVideo(surface->pScrn);
- SMI_DisplayVideo(surface->pScrn, surface->id, surface->offsets[0],
- surface->width, surface->height, surface->pitches[0], x1, y1, x2,
- y2, &dstBox, vid_w, vid_h, drw_w, drw_h);
- }
- else
- {
- SMI_ResetVideo(surface->pScrn);
- SMI_DisplayVideo0730(surface->pScrn, surface->id, surface->offsets[0],
- surface->width, surface->height, surface->pitches[0], x1, y1, x2,
- y2, &dstBox, vid_w, vid_h, drw_w, drw_h);
- }
+ dstBox.x1 -= surface->pScrn->frameX0;
+ dstBox.y1 -= surface->pScrn->frameY0;
+ dstBox.x2 -= surface->pScrn->frameX0;
+ dstBox.y2 -= surface->pScrn->frameY0;
+
+ xf86XVFillKeyHelper(surface->pScrn->pScreen,
+ pPort->Attribute[XV_COLORKEY], clipBoxes);
+
+ if (pSmi->Chipset != SMI_COUGAR3DR) {
+ SMI_ResetVideo(surface->pScrn);
+ SMI_DisplayVideo(surface->pScrn, surface->id, surface->offsets[0],
+ surface->width, surface->height, surface->pitches[0], x1, y1, x2,
+ y2, &dstBox, vid_w, vid_h, drw_w, drw_h);
+ } else {
+ SMI_ResetVideo(surface->pScrn);
+ SMI_DisplayVideo0730(surface->pScrn, surface->id, surface->offsets[0],
+ surface->width, surface->height, surface->pitches[0], x1, y1, x2,
+ y2, &dstBox, vid_w, vid_h, drw_w, drw_h);
+ }
- ptrOffscreen->isOn = TRUE;
- if (pPort->videoStatus & CLIENT_VIDEO_ON)
- {
+ ptrOffscreen->isOn = TRUE;
+ if (pPort->videoStatus & CLIENT_VIDEO_ON) {
REGION_EMPTY(surface->pScrn->pScreen, &pPort->clip);
- UpdateCurrentTime();
+ UpdateCurrentTime();
pPort->videoStatus = FREE_TIMER;
pPort->freeTime = currentTime.milliseconds + FREE_DELAY;
- }
+ }
- LEAVE_PROC("SMI_DisplaySurface");
- return(Success);
+ LEAVE_PROC("SMI_DisplaySurface");
+ return Success;
}
static int
@@ -2564,27 +2445,23 @@ SMI_StopSurface(
XF86SurfacePtr surface
)
{
- SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr;
-
- ENTER_PROC("SMI_StopSurface");
+ SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr;
- if (ptrOffscreen->isOn)
- {
- SMIPtr pSmi = SMIPTR(surface->pScrn);
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
- WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE));
- }
- else
- {
- WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x00000008);
- }
+ ENTER_PROC("SMI_StopSurface");
- ptrOffscreen->isOn = FALSE;
+ if (ptrOffscreen->isOn) {
+ SMIPtr pSmi = SMIPTR(surface->pScrn);
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
+ WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE));
+ } else {
+ WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x00000008);
}
- LEAVE_PROC("SMI_StopSurface");
- return(Success);
+ ptrOffscreen->isOn = FALSE;
+ }
+
+ LEAVE_PROC("SMI_StopSurface");
+ return Success;
}
static int
@@ -2594,10 +2471,10 @@ SMI_GetSurfaceAttribute(
INT32 *value
)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- return(SMI_GetPortAttribute(pScrn, attr, value,
- (pointer) pSmi->ptrAdaptor->pPortPrivates[0].ptr));
+ return SMI_GetPortAttribute(pScrn, attr, value,
+ (pointer) pSmi->ptrAdaptor->pPortPrivates[0].ptr);
}
static int
@@ -2607,23 +2484,20 @@ SMI_SetSurfaceAttribute(
INT32 value
)
{
- SMIPtr pSmi = SMIPTR(pScrn);
+ SMIPtr pSmi = SMIPTR(pScrn);
- return(SMI_SetPortAttribute(pScrn, attr, value,
- (pointer) pSmi->ptrAdaptor->pPortPrivates[0].ptr));
+ return SMI_SetPortAttribute(pScrn, attr, value,
+ (pointer) pSmi->ptrAdaptor->pPortPrivates[0].ptr);
}
static void
SetKeyReg(SMIPtr pSmi, int reg, int value)
{
- if (pSmi->Chipset == SMI_COUGAR3DR)
- {
- WRITE_FPR(pSmi, reg, value);
- }
- else
- {
- WRITE_VPR(pSmi, reg, value);
- }
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
+ WRITE_FPR(pSmi, reg, value);
+ } else {
+ WRITE_VPR(pSmi, reg, value);
+ }
}
#else /* SMI_USE_VIDEO */
diff --git a/driver/xf86-video-siliconmotion/src/smi_video.h b/driver/xf86-video-siliconmotion/src/smi_video.h
index b63e4bc75..03195a7a7 100644
--- a/driver/xf86-video-siliconmotion/src/smi_video.h
+++ b/driver/xf86-video-siliconmotion/src/smi_video.h
@@ -26,7 +26,6 @@ Silicon Motion 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 and silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.h,v 1.4 2002/09/16 18:06:01 eich Exp $ */
#ifndef _SMI_VIDEO_H
#define _SMI_VIDEO_H
@@ -69,34 +68,39 @@ authorization from the XFree86 Project and silicon Motion.
typedef struct
{
- FBAreaPtr area;
RegionRec clip;
/* Attributes */
CARD32 Attribute[N_ATTRS];
- CARD32 videoStatus;
- Time offTime;
- Time freeTime;
+ CARD32 videoStatus;
+ Time offTime;
+ Time freeTime;
I2CDevRec I2CDev;
+ /* Memory */
+ int size;
+ void *video_memory;
+ int video_offset;
+
/* Encodings */
XF86VideoEncodingPtr enc;
int *input;
int *norm;
int *channel;
int nenc,cenc;
+
} SMI_PortRec, *SMI_PortPtr;
typedef struct
{
- FBAreaPtr area;
- Bool isOn;
+ void *surface_memory;
+ Bool isOn;
} SMI_OffscreenRec, *SMI_OffscreenPtr;
typedef struct
{
- CARD8 address;
- CARD8 data;
+ CARD8 address;
+ CARD8 data;
} SMI_I2CDataRec, *SMI_I2CDataPtr;
diff --git a/driver/xf86-video-siliconmotion/src/smi_xaa.c b/driver/xf86-video-siliconmotion/src/smi_xaa.c
new file mode 100644
index 000000000..190b62e4a
--- /dev/null
+++ b/driver/xf86-video-siliconmotion/src/smi_xaa.c
@@ -0,0 +1,844 @@
+/*
+Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved.
+Copyright (C) 2000 Silicon Motion, 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, 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 CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the names of the XFree86 Project and
+Silicon Motion 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 and silicon Motion.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "smi.h"
+
+#include "miline.h"
+#include "xaalocal.h"
+#include "xaarop.h"
+#include "servermd.h"
+
+static void SMI_SetupForScreenToScreenCopy(ScrnInfoPtr, int, int, int,
+ unsigned int, int);
+static void SMI_SubsequentScreenToScreenCopy(ScrnInfoPtr, int, int, int, int,
+ int, int);
+static void SMI_SetupForSolidFill(ScrnInfoPtr, int, int, unsigned);
+static void SMI_SubsequentSolidFillRect(ScrnInfoPtr, int, int, int, int);
+static void SMI_SubsequentSolidHorVertLine(ScrnInfoPtr, int, int, int, int);
+static void SMI_SetupForCPUToScreenColorExpandFill(ScrnInfoPtr, int, int, int,
+ unsigned int);
+static void SMI_SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr, int, int, int,
+ int, int);
+static void SMI_SetupForMono8x8PatternFill(ScrnInfoPtr, int, int, int, int, int,
+ unsigned int);
+static void SMI_SubsequentMono8x8PatternFillRect(ScrnInfoPtr, int, int, int,
+ int, int, int);
+static void SMI_SetupForColor8x8PatternFill(ScrnInfoPtr, int, int, int,
+ unsigned int, int);
+static void SMI_SubsequentColor8x8PatternFillRect(ScrnInfoPtr, int, int, int,
+ int, int, int);
+#if SMI_USE_IMAGE_WRITES
+static void SMI_SetupForImageWrite(ScrnInfoPtr, int, unsigned int, int, int,
+ int);
+static void SMI_SubsequentImageWriteRect(ScrnInfoPtr, int, int, int, int, int);
+#endif
+/* #671 */
+static void SMI_ValidatePolylines(GCPtr, unsigned long, DrawablePtr);
+static void SMI_Polylines(DrawablePtr, GCPtr, int, int, DDXPointPtr);
+
+
+Bool
+SMI_XAAInit(ScreenPtr pScreen)
+{
+ XAAInfoRecPtr infoPtr;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ SMIPtr pSmi = SMIPTR(pScrn);
+ /*BoxRec AvailFBArea;*/
+ Bool ret;
+ /*int numLines, maxLines;*/
+
+ ENTER_PROC("SMI_XAAInit");
+
+ pSmi->XAAInfoRec = infoPtr = XAACreateInfoRec();
+ if (infoPtr == NULL) {
+ LEAVE_PROC("SMI_AccelInit");
+ return FALSE;
+ }
+
+ infoPtr->Flags = PIXMAP_CACHE
+ | LINEAR_FRAMEBUFFER
+ | OFFSCREEN_PIXMAPS;
+
+ infoPtr->Sync = SMI_AccelSync;
+
+ /* Screen to screen copies */
+ infoPtr->ScreenToScreenCopyFlags = NO_PLANEMASK
+ | ONLY_TWO_BITBLT_DIRECTIONS;
+ infoPtr->SetupForScreenToScreenCopy = SMI_SetupForScreenToScreenCopy;
+ infoPtr->SubsequentScreenToScreenCopy = SMI_SubsequentScreenToScreenCopy;
+ if (pScrn->bitsPerPixel == 24) {
+ infoPtr->ScreenToScreenCopyFlags |= NO_TRANSPARENCY;
+ }
+ if ((pSmi->Chipset == SMI_LYNX3D) && (pScrn->bitsPerPixel == 8)) {
+ infoPtr->ScreenToScreenCopyFlags |= GXCOPY_ONLY;
+ }
+
+ /* Solid Fills */
+ infoPtr->SolidFillFlags = NO_PLANEMASK;
+ infoPtr->SetupForSolidFill = SMI_SetupForSolidFill;
+ infoPtr->SubsequentSolidFillRect = SMI_SubsequentSolidFillRect;
+
+ /* Solid Lines */
+ infoPtr->SolidLineFlags = NO_PLANEMASK;
+ infoPtr->SetupForSolidLine = SMI_SetupForSolidFill;
+ infoPtr->SubsequentSolidHorVertLine = SMI_SubsequentSolidHorVertLine;
+
+ /* Color Expansion Fills */
+ infoPtr->CPUToScreenColorExpandFillFlags = ROP_NEEDS_SOURCE
+ | NO_PLANEMASK
+ | BIT_ORDER_IN_BYTE_MSBFIRST
+ | LEFT_EDGE_CLIPPING
+ | CPU_TRANSFER_PAD_DWORD
+ | SCANLINE_PAD_DWORD;
+ infoPtr->ColorExpandBase = pSmi->DataPortBase;
+ infoPtr->ColorExpandRange = pSmi->DataPortSize;
+ infoPtr->SetupForCPUToScreenColorExpandFill =
+ SMI_SetupForCPUToScreenColorExpandFill;
+ infoPtr->SubsequentCPUToScreenColorExpandFill =
+ SMI_SubsequentCPUToScreenColorExpandFill;
+
+ /* 8x8 Mono Pattern Fills */
+ infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK
+ | HARDWARE_PATTERN_PROGRAMMED_BITS
+ | HARDWARE_PATTERN_SCREEN_ORIGIN
+ | BIT_ORDER_IN_BYTE_MSBFIRST;
+ infoPtr->SetupForMono8x8PatternFill = SMI_SetupForMono8x8PatternFill;
+ infoPtr->SubsequentMono8x8PatternFillRect =
+ SMI_SubsequentMono8x8PatternFillRect;
+
+ /* 8x8 Color Pattern Fills */
+ if (!SMI_LYNX3D_SERIES(pSmi->Chipset) || (pScrn->bitsPerPixel != 24)) {
+ infoPtr->Color8x8PatternFillFlags = NO_PLANEMASK
+ | HARDWARE_PATTERN_SCREEN_ORIGIN;
+ infoPtr->SetupForColor8x8PatternFill =
+ SMI_SetupForColor8x8PatternFill;
+ infoPtr->SubsequentColor8x8PatternFillRect =
+ SMI_SubsequentColor8x8PatternFillRect;
+ }
+
+#if SMI_USE_IMAGE_WRITES
+ /* Image Writes */
+ infoPtr->ImageWriteFlags = ROP_NEEDS_SOURCE
+ | NO_PLANEMASK
+ | CPU_TRANSFER_PAD_DWORD
+ | SCANLINE_PAD_DWORD;
+ infoPtr->ImageWriteBase = pSmi->DataPortBase;
+ infoPtr->ImageWriteRange = pSmi->DataPortSize;
+ infoPtr->SetupForImageWrite = SMI_SetupForImageWrite;
+ infoPtr->SubsequentImageWriteRect = SMI_SubsequentImageWriteRect;
+#endif
+
+ /* Clipping */
+ infoPtr->ClippingFlags = HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY
+ | HARDWARE_CLIP_MONO_8x8_FILL
+ | HARDWARE_CLIP_COLOR_8x8_FILL
+ | HARDWARE_CLIP_SOLID_FILL
+ | HARDWARE_CLIP_SOLID_LINE
+ | HARDWARE_CLIP_DASHED_LINE;
+ infoPtr->SetClippingRectangle = SMI_SetClippingRectangle;
+ infoPtr->DisableClipping = SMI_DisableClipping;
+
+ /* Pixmap Cache */
+ if (pScrn->bitsPerPixel == 24) {
+ infoPtr->CachePixelGranularity = 16;
+ } else {
+ infoPtr->CachePixelGranularity = 128 / pScrn->bitsPerPixel;
+ }
+
+ /* Offscreen Pixmaps */
+ infoPtr->maxOffPixWidth = 4096;
+ infoPtr->maxOffPixHeight = 4096;
+ if (pScrn->bitsPerPixel == 24) {
+ infoPtr->maxOffPixWidth = 4096 / 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ infoPtr->maxOffPixHeight = 4096 / 3;
+ }
+ }
+
+ SMI_EngineReset(pScrn);
+
+
+ /* CZ 18.06.2001: moved to smi_driver.c before the NoAccel question
+ to have offscreen framebuffer in NoAccel mode */
+#if 0
+ maxLines = pSmi->FBReserved / (pSmi->width * pSmi->Bpp);
+ if (pSmi->rotate) {
+ numLines = maxLines;
+ } else {
+#if SMI_USE_VIDEO
+ numLines = ((pSmi->FBReserved - pSmi->width * pSmi->Bpp * pSmi->height)
+ * 25 / 100 + pSmi->width * pSmi->Bpp - 1)
+ / (pSmi->width * pSmi->Bpp);
+ numLines += pSmi->height;
+#else
+ numLines = maxLines;
+#endif
+ }
+
+ AvailFBArea.x1 = 0;
+ AvailFBArea.y1 = 0;
+ AvailFBArea.x2 = pSmi->width;
+ AvailFBArea.y2 = numLines;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FrameBuffer Box: %d,%d - %d,%d\n",
+ AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2);
+ xf86InitFBManager(pScreen, &AvailFBArea);
+#endif
+
+ ret = XAAInit(pScreen, infoPtr);
+ if (ret && pSmi->shadowFB) /* #671 */ {
+ pSmi->ValidatePolylines = infoPtr->ValidatePolylines;
+ infoPtr->ValidatePolylines = SMI_ValidatePolylines;
+ }
+
+ LEAVE_PROC("SMI_XAAInit");
+ return ret;
+}
+
+/******************************************************************************/
+/* Screen to Screen Copies */
+/******************************************************************************/
+
+static void
+SMI_SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop,
+ unsigned int planemask, int trans)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SetupForScreenToScreenCopy");
+ DEBUG((VERBLEV, "xdir=%d ydir=%d rop=%02X trans=%08X\n", xdir, ydir,
+ rop, trans));
+
+ pSmi->AccelCmd = XAAGetCopyROP(rop)
+ | SMI_BITBLT
+ | SMI_START_ENGINE;
+
+ if ((xdir == -1) || (ydir == -1)) {
+ pSmi->AccelCmd |= SMI_RIGHT_TO_LEFT;
+ }
+
+ if (trans != -1) {
+ pSmi->AccelCmd |= SMI_TRANSPARENT_SRC | SMI_TRANSPARENT_PXL;
+ WaitQueue(1);
+ WRITE_DPR(pSmi, 0x20, trans);
+ }
+
+ if (pSmi->ClipTurnedOn) {
+ WaitQueue(1);
+ WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
+ pSmi->ClipTurnedOn = FALSE;
+ }
+
+ LEAVE_PROC("SMI_SetupForScreenToScreenCopy");
+}
+
+static void
+SMI_SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2,
+ int y2, int w, int h)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SubsequentScreenToScreenCopy");
+ DEBUG((VERBLEV, "x1=%d y1=%d x2=%d y2=%d w=%d h=%d\n", x1, y1, x2, y2, w, h));
+
+ if (pSmi->AccelCmd & SMI_RIGHT_TO_LEFT) {
+ x1 += w - 1;
+ y1 += h - 1;
+ x2 += w - 1;
+ y2 += h - 1;
+ }
+
+ if (pScrn->bitsPerPixel == 24) {
+ x1 *= 3;
+ x2 *= 3;
+ w *= 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ y1 *= 3;
+ y2 *= 3;
+ }
+
+ if (pSmi->AccelCmd & SMI_RIGHT_TO_LEFT) {
+ x1 += 2;
+ x2 += 2;
+ }
+ }
+
+ WaitQueue(4);
+ WRITE_DPR(pSmi, 0x00, (x1 << 16) + (y1 & 0xFFFF));
+ WRITE_DPR(pSmi, 0x04, (x2 << 16) + (y2 & 0xFFFF));
+ WRITE_DPR(pSmi, 0x08, (w << 16) + (h & 0xFFFF));
+ WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
+
+ LEAVE_PROC("SMI_SubsequentScreenToScreenCopy");
+}
+
+/******************************************************************************/
+/* Solid Fills */
+/******************************************************************************/
+
+static void
+SMI_SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
+ unsigned int planemask)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SetupForSolidFill");
+ DEBUG((VERBLEV, "color=%08X rop=%02X\n", color, rop));
+
+ pSmi->AccelCmd = XAAGetPatternROP(rop)
+ | SMI_BITBLT
+ | SMI_START_ENGINE;
+
+ if (pSmi->ClipTurnedOn) {
+ WaitQueue(4);
+ WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
+ pSmi->ClipTurnedOn = FALSE;
+ } else {
+ WaitQueue(3);
+ }
+ WRITE_DPR(pSmi, 0x14, color);
+ WRITE_DPR(pSmi, 0x34, 0xFFFFFFFF);
+ WRITE_DPR(pSmi, 0x38, 0xFFFFFFFF);
+
+ LEAVE_PROC("SMI_SetupForSolidFill");
+}
+
+void
+SMI_SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SubsequentSolidFillRect");
+ DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", x, y, w, h));
+
+ if (pScrn->bitsPerPixel == 24) {
+ x *= 3;
+ w *= 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ y *= 3;
+ }
+ }
+
+ WaitQueue(3);
+ WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF));
+ WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
+ WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
+
+ LEAVE_PROC("SMI_SubsequentSolidFillRect");
+}
+
+/******************************************************************************/
+/* Solid Lines */
+/******************************************************************************/
+
+static void
+SMI_SubsequentSolidHorVertLine(ScrnInfoPtr pScrn, int x, int y, int len,
+ int dir)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+ int w, h;
+
+ ENTER_PROC("SMI_SubsequentSolidHorVertLine");
+ DEBUG((VERBLEV, "x=%d y=%d len=%d dir=%d\n", x, y, len, dir));
+
+ if (dir == DEGREES_0) {
+ w = len;
+ h = 1;
+ } else {
+ w = 1;
+ h = len;
+ }
+
+ if (pScrn->bitsPerPixel == 24) {
+ x *= 3;
+ w *= 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ y *= 3;
+ }
+ }
+
+ WaitQueue(3);
+ WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF));
+ WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
+ WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
+
+ LEAVE_PROC("SMI_SubsequentSolidHorVertLine");
+}
+
+/******************************************************************************/
+/* Color Expansion Fills */
+/******************************************************************************/
+
+static void
+SMI_SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg, int bg,
+ int rop, unsigned int planemask)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SetupForCPUToScreenColorExpandFill");
+ DEBUG((VERBLEV, "fg=%08X bg=%08X rop=%02X\n", fg, bg, rop));
+
+ pSmi->AccelCmd = XAAGetCopyROP(rop)
+ | SMI_HOSTBLT_WRITE
+ | SMI_SRC_MONOCHROME
+ | SMI_START_ENGINE;
+
+ if (bg == -1) {
+ pSmi->AccelCmd |= SMI_TRANSPARENT_SRC;
+
+ WaitQueue(3);
+ WRITE_DPR(pSmi, 0x14, fg);
+ WRITE_DPR(pSmi, 0x18, ~fg);
+ WRITE_DPR(pSmi, 0x20, fg);
+ } else {
+ WaitQueue(2);
+ WRITE_DPR(pSmi, 0x14, fg);
+ WRITE_DPR(pSmi, 0x18, bg);
+ }
+
+ LEAVE_PROC("SMI_SetupForCPUToScreenColorExpandFill");
+}
+
+void
+SMI_SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int x, int y, int w,
+ int h, int skipleft)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SubsequentCPUToScreenColorExpandFill");
+ DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d skipleft=%d\n", x, y, w, h, skipleft));
+
+ if (pScrn->bitsPerPixel == 24) {
+ x *= 3;
+ w *= 3;
+ skipleft *= 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ y *= 3;
+ }
+ }
+
+ if (skipleft) {
+ WaitQueue(5);
+ WRITE_DPR(pSmi, 0x2C, (pSmi->ScissorsLeft & 0xFFFF0000)
+ | (x + skipleft) | 0x2000);
+ pSmi->ClipTurnedOn = TRUE;
+ } else {
+ if (pSmi->ClipTurnedOn) {
+ WaitQueue(5);
+ WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
+ pSmi->ClipTurnedOn = FALSE;
+ } else {
+ WaitQueue(4);
+ }
+ }
+ WRITE_DPR(pSmi, 0x00, 0);
+ WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF));
+ WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
+ WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
+
+ LEAVE_PROC("SMI_SubsequentCPUToScreenColorExpandFill");
+}
+
+/******************************************************************************/
+/* 8x8 Mono Pattern Fills */
+/******************************************************************************/
+
+static void
+SMI_SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, int fg,
+ int bg, int rop, unsigned int planemask)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SetupForMono8x8PatternFill");
+ DEBUG((VERBLEV, "patx=%08X paty=%08X fg=%08X bg=%08X rop=%02X\n", patx,
+ paty, fg, bg, rop));
+
+ pSmi->AccelCmd = XAAGetPatternROP(rop)
+ | SMI_BITBLT
+ | SMI_START_ENGINE;
+
+ if (pSmi->ClipTurnedOn) {
+ WaitQueue(1);
+ WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
+ pSmi->ClipTurnedOn = FALSE;
+ }
+
+ if (bg == -1) {
+ WaitQueue(5);
+ WRITE_DPR(pSmi, 0x14, fg);
+ WRITE_DPR(pSmi, 0x18, ~fg);
+ WRITE_DPR(pSmi, 0x20, fg);
+ WRITE_DPR(pSmi, 0x34, patx);
+ WRITE_DPR(pSmi, 0x38, paty);
+ } else {
+ WaitQueue(4);
+ WRITE_DPR(pSmi, 0x14, fg);
+ WRITE_DPR(pSmi, 0x18, bg);
+ WRITE_DPR(pSmi, 0x34, patx);
+ WRITE_DPR(pSmi, 0x38, paty);
+ }
+
+ LEAVE_PROC("SMI_SetupForMono8x8PatternFill");
+}
+
+static void
+SMI_SubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty,
+ int x, int y, int w, int h)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SubsequentMono8x8PatternFillRect");
+ DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", x, y, w, h));
+
+ if (pScrn->bitsPerPixel == 24) {
+ x *= 3;
+ w *= 3;
+ if (pSmi->Chipset == SMI_LYNX) {
+ y *= 3;
+ }
+ }
+
+ WaitQueue(3);
+ WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF));
+ WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
+ WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
+
+ LEAVE_PROC("SMI_SubsequentMono8x8PatternFillRect");
+}
+
+/******************************************************************************/
+/* 8x8 Color Pattern Fills */
+/******************************************************************************/
+
+static void
+SMI_SetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, int rop,
+ unsigned int planemask, int trans_color)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SetupForColor8x8PatternFill");
+ DEBUG((VERBLEV, "patx=%d paty=%d rop=%02X trans_color=%08X\n", patx, paty,
+ rop, trans_color));
+
+ pSmi->AccelCmd = XAAGetPatternROP(rop)
+ | SMI_BITBLT
+ | SMI_COLOR_PATTERN
+ | SMI_START_ENGINE;
+
+ if (pScrn->bitsPerPixel <= 16) {
+ /* PDR#950 */
+ CARD8* pattern = pSmi->FBBase + (patx + paty * pSmi->Stride) * pSmi->Bpp;
+
+ WaitIdleEmpty();
+ WRITE_DPR(pSmi, 0x0C, SMI_BITBLT | SMI_COLOR_PATTERN);
+ memcpy(pSmi->DataPortBase, pattern, 8 * pSmi->Bpp * 8);
+ } else {
+ if (pScrn->bitsPerPixel == 24) {
+ patx *= 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ paty *= 3;
+ }
+ }
+
+ WaitQueue(1);
+ WRITE_DPR(pSmi, 0x00, (patx << 16) | (paty & 0xFFFF));
+ }
+
+ if (trans_color == -1) {
+ pSmi->AccelCmd |= SMI_TRANSPARENT_SRC | SMI_TRANSPARENT_PXL;
+
+ WaitQueue(1);
+ WRITE_DPR(pSmi, 0x20, trans_color);
+ }
+
+ if (pSmi->ClipTurnedOn) {
+ WaitQueue(1);
+ WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
+ pSmi->ClipTurnedOn = FALSE;
+ }
+
+ LEAVE_PROC("SMI_SetupForColor8x8PatternFill");
+}
+
+static void
+SMI_SubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty,
+ int x, int y, int w, int h)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SubsequentColor8x8PatternFillRect");
+ DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", x, y, w, h));
+
+ if (pScrn->bitsPerPixel == 24) {
+ x *= 3;
+ w *= 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ y *= 3;
+ }
+ }
+
+ WaitQueue(3);
+ WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF));
+ WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF)); /* PDR#950 */
+ WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
+
+ LEAVE_PROC("SMI_SubsequentColor8x8PatternFillRect");
+}
+
+#if SMI_USE_IMAGE_WRITES
+/******************************************************************************/
+/* Image Writes */
+/******************************************************************************/
+
+static void
+SMI_SetupForImageWrite(ScrnInfoPtr pScrn, int rop, unsigned int planemask,
+ int trans_color, int bpp, int depth)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SetupForImageWrite");
+ DEBUG((VERBLEV, "rop=%02X trans_color=%08X bpp=%d depth=%d\n", rop,
+ trans_color, bpp, depth));
+
+ pSmi->AccelCmd = XAAGetCopyROP(rop)
+ | SMI_HOSTBLT_WRITE
+ | SMI_START_ENGINE;
+
+ if (trans_color != -1) {
+ pSmi->AccelCmd |= SMI_TRANSPARENT_SRC | SMI_TRANSPARENT_PXL;
+
+ WaitQueue(1);
+ WRITE_DPR(pSmi, 0x20, trans_color);
+ }
+
+ LEAVE_PROC("SMI_SetupForImageWrite");
+}
+
+static void
+SMI_SubsequentImageWriteRect(ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ int skipleft)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_SubsequentImageWriteRect");
+ DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d skipleft=%d\n", x, y, w, h, skipleft));
+
+ if (pScrn->bitsPerPixel == 24) {
+ x *= 3;
+ w *= 3;
+ skipleft *= 3;
+
+ if (pSmi->Chipset == SMI_LYNX) {
+ y *= 3;
+ }
+ }
+
+ if (skipleft) {
+ WaitQueue(5);
+ WRITE_DPR(pSmi, 0x2C, (pSmi->ScissorsLeft & 0xFFFF0000) |
+ (x + skipleft) | 0x2000);
+ pSmi->ClipTurnedOn = TRUE;
+ } else {
+ if (pSmi->ClipTurnedOn) {
+ WaitQueue(5);
+ WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft);
+ pSmi->ClipTurnedOn = FALSE;
+ } else {
+ WaitQueue(4);
+ }
+ }
+ WRITE_DPR(pSmi, 0x00, 0);
+ WRITE_DPR(pSmi, 0x04, (x << 16) | (y * 0xFFFF));
+ WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF));
+ WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
+
+ LEAVE_PROC("SMI_SubsequentImageWriteRect");
+}
+#endif
+
+/******************************************************************************/
+/* Polylines #671 */
+/******************************************************************************/
+
+/*
+
+In order to speed up the "logout" screen in rotated modes, we need to intercept
+the Polylines function. Normally, the polylines are drawn and the shadowFB is
+then sending a request of the bounding rectangle of those poylines. This should
+be okay, if it weren't for the fact that the Gnome logout screen is drawing
+polylines in rectangles and this asks for a rotation of the entire rectangle.
+This is very slow.
+
+To circumvent this slowness, we intercept the ValidatePolylines function and
+override the default "Fallback" Polylines with our own Polylines function. Our
+Polylines function first draws the polylines through the original Fallback
+function and then rotates the lines, line by line. We then set a flag and
+return control to the shadowFB which will try to rotate the bounding rectangle.
+However, the flag has been set and the RefreshArea function does nothing but
+clear the flag so the next Refresh that comes in shoiuld be handled correctly.
+
+All this code improves the speed quite a bit.
+
+*/
+
+#define IS_VISIBLE(pWin) \
+( \
+ pScrn->vtSema \
+ && (((WindowPtr) pWin)->visibility != VisibilityFullyObscured) \
+)
+
+#define TRIM_BOX(box, pGC) \
+{ \
+ BoxPtr extents = &pGC->pCompositeClip->extents; \
+ if (box.x1 < extents->x1) box.x1 = extents->x1; \
+ if (box.y1 < extents->y1) box.y1 = extents->y1; \
+ if (box.x2 > extents->x2) box.x2 = extents->x2; \
+ if (box.y2 > extents->y2) box.y2 = extents->y2; \
+}
+
+#define TRANSLATE_BOX(box, pDraw) \
+{ \
+ box.x1 += pDraw->x; \
+ box.y1 += pDraw->y; \
+ box.x2 += pDraw->x; \
+ box.y2 += pDraw->y; \
+}
+
+#define BOX_NOT_EMPTY(box) \
+ ((box.x2 > box.x1) && (box.y2 > box.y1))
+
+static void
+SMI_ValidatePolylines(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ SMIPtr pSmi = SMIPTR(infoRec->pScrn);
+
+ ENTER_PROC("SMI_ValidatePolylines");
+
+ pSmi->ValidatePolylines(pGC, changes, pDraw);
+ if (pGC->ops->Polylines == XAAGetFallbackOps()->Polylines) {
+ /* Override the Polylines function with our own Polylines function. */
+ pGC->ops->Polylines = SMI_Polylines;
+ }
+
+ LEAVE_PROC("SMI_ValidatePolylines");
+}
+
+static void
+SMI_Polylines(DrawablePtr pDraw, GCPtr pGC, int mode, int npt,
+ DDXPointPtr pptInit)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ ScrnInfoPtr pScrn = infoRec->pScrn;
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ ENTER_PROC("SMI_Polylines");
+
+ /* Call the original Polylines function. */
+ pGC->ops->Polylines = XAAGetFallbackOps()->Polylines;
+ (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
+ pGC->ops->Polylines = SMI_Polylines;
+
+ if (IS_VISIBLE(pDraw) && npt) {
+ /* Allocate a temporary buffer for all segments of the polyline. */
+ BoxPtr pBox = xnfcalloc(sizeof(BoxRec), npt);
+ int extra = pGC->lineWidth >> 1, box;
+
+ if (npt > 1) {
+ /* Adjust the extra space required per polyline segment. */
+ if (pGC->joinStyle == JoinMiter) {
+ extra = 6 * pGC->lineWidth;
+ } else if (pGC->capStyle == CapProjecting) {
+ extra = pGC->lineWidth;
+ }
+ }
+
+ for (box = 0; --npt;) {
+ /* Setup the bounding box for one polyline segment. */
+ pBox[box].x1 = pptInit->x;
+ pBox[box].y1 = pptInit->y;
+ pptInit++;
+ pBox[box].x2 = pptInit->x;
+ pBox[box].y2 = pptInit->y;
+ if (mode == CoordModePrevious) {
+ pBox[box].x2 += pBox[box].x1;
+ pBox[box].y2 += pBox[box].y1;
+ }
+
+ /* Sort coordinates. */
+ if (pBox[box].x1 > pBox[box].x2) {
+ int tmp = pBox[box].x1;
+ pBox[box].x1 = pBox[box].x2;
+ pBox[box].x2 = tmp;
+ }
+ if (pBox[box].y1 > pBox[box].y2) {
+ int tmp = pBox[box].y1;
+ pBox[box].y1 = pBox[box].y2;
+ pBox[box].y2 = tmp;
+ }
+
+ /* Add extra space required for each polyline segment. */
+ pBox[box].x1 -= extra;
+ pBox[box].y1 -= extra;
+ pBox[box].x2 += extra + 1;
+ pBox[box].y2 += extra + 1;
+
+ /* See if we need to draw this polyline segment. */
+ TRANSLATE_BOX(pBox[box], pDraw);
+ TRIM_BOX(pBox[box], pGC);
+ if (BOX_NOT_EMPTY(pBox[box])) {
+ box++;
+ }
+ }
+
+ if (box) {
+ /* Refresh all polyline segments now. */
+ if (pSmi->Chipset == SMI_COUGAR3DR) {
+ SMI_RefreshArea730(pScrn, box, pBox);
+ } else {
+ SMI_RefreshArea(pScrn, box, pBox);
+ }
+ }
+
+ /* Free the temporary buffer. */
+ xfree(pBox);
+ }
+
+ pSmi->polyLines = TRUE;
+ LEAVE_PROC("SMI_Polylines");
+}
+