xf86-video-sis-0.10.7/0000775000076400007640000000000012001203066011273 500000000000000xf86-video-sis-0.10.7/aclocal.m40000664000076400007640000147303512001203050013061 00000000000000# generated automatically by aclocal 1.11.3 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # 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 sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # 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 setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_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* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_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 -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) 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. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* 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" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # 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" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_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_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_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_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}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_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_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 ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`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 "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # 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.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|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" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *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" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # 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 *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) 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. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" 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 if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone 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` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) 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 # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` 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 ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) 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="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [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="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out 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 # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # 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; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' 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' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor 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' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # 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>/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;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx 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='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no 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" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; 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)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; 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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" 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 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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 m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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 m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in 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 # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # 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_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= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_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~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; 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. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # 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 # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # 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]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_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' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # 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?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests 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);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests 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); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; 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. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # 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]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_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' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_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' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$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; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_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 -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_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_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_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$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; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= 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 dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in 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_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_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_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # 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. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests 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) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests 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" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # 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 # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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 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 # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT]) ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [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. _PKG_TEXT To get pkg-config, see .]) ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), dnl to deal in the Software without restriction, including without limitation dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, dnl and/or sell copies of the Software, and to permit persons to whom the dnl Software is furnished to do so, subject to the following conditions: dnl dnl The above copyright notice and this permission notice (including the next dnl paragraph) shall be included in all copies or substantial portions of the dnl Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER dnl DEALINGS IN THE SOFTWARE. # XORG_MACROS_VERSION(required-version) # ------------------------------------- # Minimum version: 1.1.0 # # If you're using a macro added in Version 1.1 or newer, include this in # your configure.ac with the minimum required version, such as: # XORG_MACROS_VERSION(1.1) # # To ensure that this macro is defined, also add: # m4_ifndef([XORG_MACROS_VERSION], # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) # # # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ m4_define([vers_have], [1.17]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) m4_if(m4_version_compare(vers_have, [$1]), -1, [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) m4_undefine([vers_have]) m4_undefine([maj_have]) m4_undefine([maj_needed]) ]) # XORG_MACROS_VERSION # XORG_PROG_RAWCPP() # ------------------ # Minimum version: 1.0.0 # # Find cpp program and necessary flags for use in pre-processing text files # such as man pages and config files AC_DEFUN([XORG_PROG_RAWCPP],[ AC_REQUIRE([AC_PROG_CPP]) AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) # Check for flag to avoid builtin definitions - assumes unix is predefined, # which is not the best choice for supporting other OS'es, but covers most # of the ones we need for now. AC_MSG_CHECKING([if $RAWCPP requires -undef]) AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])]) if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then AC_MSG_RESULT([no]) else if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then RAWCPPFLAGS=-undef AC_MSG_RESULT([yes]) # under Cygwin unix is still defined even with -undef elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then RAWCPPFLAGS="-undef -ansi" AC_MSG_RESULT([yes, with -ansi]) else AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) fi fi rm -f conftest.$ac_ext AC_MSG_CHECKING([if $RAWCPP requires -traditional]) AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])]) if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then AC_MSG_RESULT([no]) else if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" AC_MSG_RESULT([yes]) else AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) fi fi rm -f conftest.$ac_ext AC_SUBST(RAWCPPFLAGS) ]) # XORG_PROG_RAWCPP # XORG_MANPAGE_SECTIONS() # ----------------------- # Minimum version: 1.0.0 # # Determine which sections man pages go in for the different man page types # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. # Not sure if there's any better way than just hardcoding by OS name. # Override default settings by setting environment variables # Added MAN_SUBSTS in version 1.8 # Added AC_PROG_SED in version 1.8 AC_DEFUN([XORG_MANPAGE_SECTIONS],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_SED]) if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi if test x$APP_MAN_DIR = x ; then APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' fi if test x$LIB_MAN_SUFFIX = x ; then LIB_MAN_SUFFIX=3 fi if test x$LIB_MAN_DIR = x ; then LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' fi if test x$FILE_MAN_SUFFIX = x ; then case $host_os in solaris*) FILE_MAN_SUFFIX=4 ;; *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' fi if test x$MISC_MAN_SUFFIX = x ; then case $host_os in solaris*) MISC_MAN_SUFFIX=5 ;; *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' fi if test x$DRIVER_MAN_SUFFIX = x ; then case $host_os in solaris*) DRIVER_MAN_SUFFIX=7 ;; *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' fi if test x$ADMIN_MAN_SUFFIX = x ; then case $host_os in solaris*) ADMIN_MAN_SUFFIX=1m ;; *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' fi AC_SUBST([APP_MAN_SUFFIX]) AC_SUBST([LIB_MAN_SUFFIX]) AC_SUBST([FILE_MAN_SUFFIX]) AC_SUBST([MISC_MAN_SUFFIX]) AC_SUBST([DRIVER_MAN_SUFFIX]) AC_SUBST([ADMIN_MAN_SUFFIX]) AC_SUBST([APP_MAN_DIR]) AC_SUBST([LIB_MAN_DIR]) AC_SUBST([FILE_MAN_DIR]) AC_SUBST([MISC_MAN_DIR]) AC_SUBST([DRIVER_MAN_DIR]) AC_SUBST([ADMIN_MAN_DIR]) XORG_MAN_PAGE="X Version 11" AC_SUBST([XORG_MAN_PAGE]) MAN_SUBSTS="\ -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xservername__|Xorg|g' \ -e 's|__xconfigfile__|xorg.conf|g' \ -e 's|__projectroot__|\$(prefix)|g' \ -e 's|__apploaddir__|\$(appdefaultdir)|g' \ -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" AC_SUBST([MAN_SUBSTS]) ]) # XORG_MANPAGE_SECTIONS # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) # ------------------------ # Minimum version: 1.7.0 # # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent # provided by xorg-sgml-doctools, if installed. AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) XORG_SGML_PATH= PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], [m4_ifval([$1],[:], [if test x"$cross_compiling" != x"yes" ; then AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], [XORG_SGML_PATH=$prefix/share/sgml]) fi]) ]) # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing # the path and the name of the doc stylesheet if test "x$XORG_SGML_PATH" != "x" ; then AC_MSG_RESULT([$XORG_SGML_PATH]) STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl else AC_MSG_RESULT([no]) fi AC_SUBST(XORG_SGML_PATH) AC_SUBST(STYLESHEET_SRCDIR) AC_SUBST(XSL_STYLESHEET) AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) ]) # XORG_CHECK_SGML_DOCTOOLS # XORG_CHECK_LINUXDOC # ------------------- # Minimum version: 1.0.0 # # Defines the variable MAKE_TEXT if the necessary tools and # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. # Whether or not the necessary tools and files are found can be checked # with the AM_CONDITIONAL "BUILD_LINUXDOC" AC_DEFUN([XORG_CHECK_LINUXDOC],[ AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) AC_REQUIRE([XORG_WITH_PS2PDF]) AC_PATH_PROG(LINUXDOC, linuxdoc) AC_MSG_CHECKING([whether to build documentation]) if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then BUILDDOC=yes else BUILDDOC=no fi AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) AC_MSG_RESULT([$BUILDDOC]) AC_MSG_CHECKING([whether to build pdf documentation]) if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then BUILDPDFDOC=yes else BUILDPDFDOC=no fi AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) AC_MSG_RESULT([$BUILDPDFDOC]) MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" MAKE_PDF="$PS2PDF" MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" AC_SUBST(MAKE_TEXT) AC_SUBST(MAKE_PS) AC_SUBST(MAKE_PDF) AC_SUBST(MAKE_HTML) ]) # XORG_CHECK_LINUXDOC # XORG_CHECK_DOCBOOK # ------------------- # Minimum version: 1.0.0 # # Checks for the ability to build output formats from SGML DocBook source. # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" # indicates whether the necessary tools and files are found and, if set, # $(MAKE_XXX) blah.sgml will produce blah.xxx. AC_DEFUN([XORG_CHECK_DOCBOOK],[ AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) BUILDTXTDOC=no BUILDPDFDOC=no BUILDPSDOC=no BUILDHTMLDOC=no AC_PATH_PROG(DOCBOOKPS, docbook2ps) AC_PATH_PROG(DOCBOOKPDF, docbook2pdf) AC_PATH_PROG(DOCBOOKHTML, docbook2html) AC_PATH_PROG(DOCBOOKTXT, docbook2txt) AC_MSG_CHECKING([whether to build text documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && test x$BUILD_TXTDOC != xno; then BUILDTXTDOC=yes fi AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) AC_MSG_RESULT([$BUILDTXTDOC]) AC_MSG_CHECKING([whether to build PDF documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && test x$BUILD_PDFDOC != xno; then BUILDPDFDOC=yes fi AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) AC_MSG_RESULT([$BUILDPDFDOC]) AC_MSG_CHECKING([whether to build PostScript documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && test x$BUILD_PSDOC != xno; then BUILDPSDOC=yes fi AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) AC_MSG_RESULT([$BUILDPSDOC]) AC_MSG_CHECKING([whether to build HTML documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && test x$BUILD_HTMLDOC != xno; then BUILDHTMLDOC=yes fi AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) AC_MSG_RESULT([$BUILDHTMLDOC]) MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" AC_SUBST(MAKE_TEXT) AC_SUBST(MAKE_PS) AC_SUBST(MAKE_PDF) AC_SUBST(MAKE_HTML) ]) # XORG_CHECK_DOCBOOK # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) # ---------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-xmlto option, it allows maximum flexibilty in making decisions # as whether or not to use the xmlto package. When DEFAULT is not specified, # --with-xmlto assumes 'auto'. # # Interface to module: # HAVE_XMLTO: used in makefiles to conditionally generate documentation # XMLTO: returns the path of the xmlto program found # returns the path set by the user in the environment # --with-xmlto: 'yes' user instructs the module to use xmlto # 'no' user instructs the module not to use xmlto # # Added in version 1.10.0 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation # xmlto for text output requires either lynx, links, or w3m browsers # # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_XMLTO],[ AC_ARG_VAR([XMLTO], [Path to xmlto command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(xmlto, AS_HELP_STRING([--with-xmlto], [Use xmlto to regenerate documentation (default: ]_defopt[)]), [use_xmlto=$withval], [use_xmlto=]_defopt) m4_undefine([_defopt]) if test "x$use_xmlto" = x"auto"; then AC_PATH_PROG([XMLTO], [xmlto]) if test "x$XMLTO" = "x"; then AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) have_xmlto=no else have_xmlto=yes fi elif test "x$use_xmlto" = x"yes" ; then AC_PATH_PROG([XMLTO], [xmlto]) if test "x$XMLTO" = "x"; then AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) fi have_xmlto=yes elif test "x$use_xmlto" = x"no" ; then if test "x$XMLTO" != "x"; then AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) fi have_xmlto=no else AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) fi # Test for a minimum version of xmlto, if provided. m4_ifval([$1], [if test "$have_xmlto" = yes; then # scrape the xmlto version AC_MSG_CHECKING([the xmlto version]) xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` AC_MSG_RESULT([$xmlto_version]) AS_VERSION_COMPARE([$xmlto_version], [$1], [if test "x$use_xmlto" = xauto; then AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) have_xmlto=no else AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) fi]) fi]) # Test for the ability of xmlto to generate a text target have_xmlto_text=no cat > conftest.xml << "EOF" EOF AS_IF([test "$have_xmlto" = yes], [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], [have_xmlto_text=yes], [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) rm -f conftest.xml AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) ]) # XORG_WITH_XMLTO # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT]) # -------------------------------------------- # Minimum version: 1.12.0 # Minimum version for optional DEFAULT argument: 1.12.0 # # XSLT (Extensible Stylesheet Language Transformations) is a declarative, # XML-based language used for the transformation of XML documents. # The xsltproc command line tool is for applying XSLT stylesheets to XML documents. # It is used under the cover by xmlto to generate html files from DocBook/XML. # The XSLT processor is often used as a standalone tool for transformations. # It should not be assumed that this tool is used only to work with documnetation. # When DEFAULT is not specified, --with-xsltproc assumes 'auto'. # # Interface to module: # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation # XSLTPROC: returns the path of the xsltproc program found # returns the path set by the user in the environment # --with-xsltproc: 'yes' user instructs the module to use xsltproc # 'no' user instructs the module not to use xsltproc # have_xsltproc: returns yes if xsltproc found in PATH or no # # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_XSLTPROC],[ AC_ARG_VAR([XSLTPROC], [Path to xsltproc command]) # Preserves the interface, should it be implemented later m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(xsltproc, AS_HELP_STRING([--with-xsltproc], [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]), [use_xsltproc=$withval], [use_xsltproc=]_defopt) m4_undefine([_defopt]) if test "x$use_xsltproc" = x"auto"; then AC_PATH_PROG([XSLTPROC], [xsltproc]) if test "x$XSLTPROC" = "x"; then AC_MSG_WARN([xsltproc not found - cannot transform XML documents]) have_xsltproc=no else have_xsltproc=yes fi elif test "x$use_xsltproc" = x"yes" ; then AC_PATH_PROG([XSLTPROC], [xsltproc]) if test "x$XSLTPROC" = "x"; then AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH]) fi have_xsltproc=yes elif test "x$use_xsltproc" = x"no" ; then if test "x$XSLTPROC" != "x"; then AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified]) fi have_xsltproc=no else AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes]) ]) # XORG_WITH_XSLTPROC # XORG_WITH_PERL([MIN-VERSION], [DEFAULT]) # ---------------------------------------- # Minimum version: 1.15.0 # # PERL (Practical Extraction and Report Language) is a language optimized for # scanning arbitrary text files, extracting information from those text files, # and printing reports based on that information. # # When DEFAULT is not specified, --with-perl assumes 'auto'. # # Interface to module: # HAVE_PERL: used in makefiles to conditionally scan text files # PERL: returns the path of the perl program found # returns the path set by the user in the environment # --with-perl: 'yes' user instructs the module to use perl # 'no' user instructs the module not to use perl # have_perl: returns yes if perl found in PATH or no # # If the user sets the value of PERL, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_PERL],[ AC_ARG_VAR([PERL], [Path to perl command]) # Preserves the interface, should it be implemented later m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(perl, AS_HELP_STRING([--with-perl], [Use perl for extracting information from files (default: ]_defopt[)]), [use_perl=$withval], [use_perl=]_defopt) m4_undefine([_defopt]) if test "x$use_perl" = x"auto"; then AC_PATH_PROG([PERL], [perl]) if test "x$PERL" = "x"; then AC_MSG_WARN([perl not found - cannot extract information and report]) have_perl=no else have_perl=yes fi elif test "x$use_perl" = x"yes" ; then AC_PATH_PROG([PERL], [perl]) if test "x$PERL" = "x"; then AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH]) fi have_perl=yes elif test "x$use_perl" = x"no" ; then if test "x$PERL" != "x"; then AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified]) fi have_perl=no else AC_MSG_ERROR([--with-perl expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes]) ]) # XORG_WITH_PERL # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) # ---------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-asciidoc option, it allows maximum flexibilty in making decisions # as whether or not to use the asciidoc package. When DEFAULT is not specified, # --with-asciidoc assumes 'auto'. # # Interface to module: # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation # ASCIIDOC: returns the path of the asciidoc program found # returns the path set by the user in the environment # --with-asciidoc: 'yes' user instructs the module to use asciidoc # 'no' user instructs the module not to use asciidoc # # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_ASCIIDOC],[ AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(asciidoc, AS_HELP_STRING([--with-asciidoc], [Use asciidoc to regenerate documentation (default: ]_defopt[)]), [use_asciidoc=$withval], [use_asciidoc=]_defopt) m4_undefine([_defopt]) if test "x$use_asciidoc" = x"auto"; then AC_PATH_PROG([ASCIIDOC], [asciidoc]) if test "x$ASCIIDOC" = "x"; then AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) have_asciidoc=no else have_asciidoc=yes fi elif test "x$use_asciidoc" = x"yes" ; then AC_PATH_PROG([ASCIIDOC], [asciidoc]) if test "x$ASCIIDOC" = "x"; then AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) fi have_asciidoc=yes elif test "x$use_asciidoc" = x"no" ; then if test "x$ASCIIDOC" != "x"; then AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) fi have_asciidoc=no else AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) fi m4_ifval([$1], [if test "$have_asciidoc" = yes; then # scrape the asciidoc version AC_MSG_CHECKING([the asciidoc version]) asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` AC_MSG_RESULT([$asciidoc_version]) AS_VERSION_COMPARE([$asciidoc_version], [$1], [if test "x$use_asciidoc" = xauto; then AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) have_asciidoc=no else AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) fi]) fi]) AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) ]) # XORG_WITH_ASCIIDOC # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) # -------------------------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-doxygen option, it allows maximum flexibilty in making decisions # as whether or not to use the doxygen package. When DEFAULT is not specified, # --with-doxygen assumes 'auto'. # # Interface to module: # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation # DOXYGEN: returns the path of the doxygen program found # returns the path set by the user in the environment # --with-doxygen: 'yes' user instructs the module to use doxygen # 'no' user instructs the module not to use doxygen # # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_DOXYGEN],[ AC_ARG_VAR([DOXYGEN], [Path to doxygen command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(doxygen, AS_HELP_STRING([--with-doxygen], [Use doxygen to regenerate documentation (default: ]_defopt[)]), [use_doxygen=$withval], [use_doxygen=]_defopt) m4_undefine([_defopt]) if test "x$use_doxygen" = x"auto"; then AC_PATH_PROG([DOXYGEN], [doxygen]) if test "x$DOXYGEN" = "x"; then AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) have_doxygen=no else have_doxygen=yes fi elif test "x$use_doxygen" = x"yes" ; then AC_PATH_PROG([DOXYGEN], [doxygen]) if test "x$DOXYGEN" = "x"; then AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) fi have_doxygen=yes elif test "x$use_doxygen" = x"no" ; then if test "x$DOXYGEN" != "x"; then AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) fi have_doxygen=no else AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) fi m4_ifval([$1], [if test "$have_doxygen" = yes; then # scrape the doxygen version AC_MSG_CHECKING([the doxygen version]) doxygen_version=`$DOXYGEN --version 2>/dev/null` AC_MSG_RESULT([$doxygen_version]) AS_VERSION_COMPARE([$doxygen_version], [$1], [if test "x$use_doxygen" = xauto; then AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) have_doxygen=no else AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) fi]) fi]) AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) ]) # XORG_WITH_DOXYGEN # XORG_WITH_GROFF([DEFAULT]) # ---------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-groff option, it allows maximum flexibilty in making decisions # as whether or not to use the groff package. When DEFAULT is not specified, # --with-groff assumes 'auto'. # # Interface to module: # HAVE_GROFF: used in makefiles to conditionally generate documentation # HAVE_GROFF_MM: the memorandum macros (-mm) package # HAVE_GROFF_MS: the -ms macros package # GROFF: returns the path of the groff program found # returns the path set by the user in the environment # --with-groff: 'yes' user instructs the module to use groff # 'no' user instructs the module not to use groff # # Added in version 1.9.0: # HAVE_GROFF_HTML: groff has dependencies to output HTML format: # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. # psselect from the psutils package. # the ghostcript package. Refer to the grohtml man pages # # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. # # OS and distros often splits groff in a basic and full package, the former # having the groff program and the later having devices, fonts and macros # Checking for the groff executable is not enough. # # If macros are missing, we cannot assume that groff is useless, so we don't # unset HAVE_GROFF or GROFF env variables. # HAVE_GROFF_?? can never be true while HAVE_GROFF is false. # AC_DEFUN([XORG_WITH_GROFF],[ AC_ARG_VAR([GROFF], [Path to groff command]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_WITH(groff, AS_HELP_STRING([--with-groff], [Use groff to regenerate documentation (default: ]_defopt[)]), [use_groff=$withval], [use_groff=]_defopt) m4_undefine([_defopt]) if test "x$use_groff" = x"auto"; then AC_PATH_PROG([GROFF], [groff]) if test "x$GROFF" = "x"; then AC_MSG_WARN([groff not found - documentation targets will be skipped]) have_groff=no else have_groff=yes fi elif test "x$use_groff" = x"yes" ; then AC_PATH_PROG([GROFF], [groff]) if test "x$GROFF" = "x"; then AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) fi have_groff=yes elif test "x$use_groff" = x"no" ; then if test "x$GROFF" != "x"; then AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) fi have_groff=no else AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) fi # We have groff, test for the presence of the macro packages if test "x$have_groff" = x"yes"; then AC_MSG_CHECKING([for ${GROFF} -ms macros]) if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then groff_ms_works=yes else groff_ms_works=no fi AC_MSG_RESULT([$groff_ms_works]) AC_MSG_CHECKING([for ${GROFF} -mm macros]) if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then groff_mm_works=yes else groff_mm_works=no fi AC_MSG_RESULT([$groff_mm_works]) fi # We have groff, test for HTML dependencies, one command per package if test "x$have_groff" = x"yes"; then AC_PATH_PROGS(GS_PATH, [gs gswin32c]) AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) AC_PATH_PROG(PSSELECT_PATH, [psselect]) if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then have_groff_html=yes else have_groff_html=no AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) fi fi # Set Automake conditionals for Makefiles AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) ]) # XORG_WITH_GROFF # XORG_WITH_FOP([MIN-VERSION], [DEFAULT]) # --------------------------------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # Minimum version for optional MIN-VERSION argument: 1.15.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-fop option, it allows maximum flexibilty in making decisions # as whether or not to use the fop package. When DEFAULT is not specified, # --with-fop assumes 'auto'. # # Interface to module: # HAVE_FOP: used in makefiles to conditionally generate documentation # FOP: returns the path of the fop program found # returns the path set by the user in the environment # --with-fop: 'yes' user instructs the module to use fop # 'no' user instructs the module not to use fop # # If the user sets the value of FOP, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_FOP],[ AC_ARG_VAR([FOP], [Path to fop command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(fop, AS_HELP_STRING([--with-fop], [Use fop to regenerate documentation (default: ]_defopt[)]), [use_fop=$withval], [use_fop=]_defopt) m4_undefine([_defopt]) if test "x$use_fop" = x"auto"; then AC_PATH_PROG([FOP], [fop]) if test "x$FOP" = "x"; then AC_MSG_WARN([fop not found - documentation targets will be skipped]) have_fop=no else have_fop=yes fi elif test "x$use_fop" = x"yes" ; then AC_PATH_PROG([FOP], [fop]) if test "x$FOP" = "x"; then AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) fi have_fop=yes elif test "x$use_fop" = x"no" ; then if test "x$FOP" != "x"; then AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) fi have_fop=no else AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) fi # Test for a minimum version of fop, if provided. m4_ifval([$1], [if test "$have_fop" = yes; then # scrape the fop version AC_MSG_CHECKING([for fop minimum version]) fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3` AC_MSG_RESULT([$fop_version]) AS_VERSION_COMPARE([$fop_version], [$1], [if test "x$use_fop" = xauto; then AC_MSG_WARN([fop version $fop_version found, but $1 needed]) have_fop=no else AC_MSG_ERROR([fop version $fop_version found, but $1 needed]) fi]) fi]) AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) ]) # XORG_WITH_FOP # XORG_WITH_PS2PDF([DEFAULT]) # ---------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-ps2pdf option, it allows maximum flexibilty in making decisions # as whether or not to use the ps2pdf package. When DEFAULT is not specified, # --with-ps2pdf assumes 'auto'. # # Interface to module: # HAVE_PS2PDF: used in makefiles to conditionally generate documentation # PS2PDF: returns the path of the ps2pdf program found # returns the path set by the user in the environment # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf # 'no' user instructs the module not to use ps2pdf # # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_PS2PDF],[ AC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_WITH(ps2pdf, AS_HELP_STRING([--with-ps2pdf], [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) m4_undefine([_defopt]) if test "x$use_ps2pdf" = x"auto"; then AC_PATH_PROG([PS2PDF], [ps2pdf]) if test "x$PS2PDF" = "x"; then AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) have_ps2pdf=no else have_ps2pdf=yes fi elif test "x$use_ps2pdf" = x"yes" ; then AC_PATH_PROG([PS2PDF], [ps2pdf]) if test "x$PS2PDF" = "x"; then AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) fi have_ps2pdf=yes elif test "x$use_ps2pdf" = x"no" ; then if test "x$PS2PDF" != "x"; then AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) fi have_ps2pdf=no else AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) ]) # XORG_WITH_PS2PDF # XORG_ENABLE_DOCS (enable_docs=yes) # ---------------- # Minimum version: 1.6.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a builder to skip all # documentation targets except traditional man pages. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_DOCS: used in makefiles to conditionally generate documentation # --enable-docs: 'yes' user instructs the module to generate docs # 'no' user instructs the module not to generate docs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_DOCS],[ m4_define([docs_default], m4_default([$1], [yes])) AC_ARG_ENABLE(docs, AS_HELP_STRING([--enable-docs], [Enable building the documentation (default: ]docs_default[)]), [build_docs=$enableval], [build_docs=]docs_default) m4_undefine([docs_default]) AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) AC_MSG_CHECKING([whether to build documentation]) AC_MSG_RESULT([$build_docs]) ]) # XORG_ENABLE_DOCS # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) # ---------------- # Minimum version: 1.6.0 # # This macro enables a builder to skip all developer documentation. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs # --enable-devel-docs: 'yes' user instructs the module to generate developer docs # 'no' user instructs the module not to generate developer docs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ m4_define([devel_default], m4_default([$1], [yes])) AC_ARG_ENABLE(devel-docs, AS_HELP_STRING([--enable-devel-docs], [Enable building the developer documentation (default: ]devel_default[)]), [build_devel_docs=$enableval], [build_devel_docs=]devel_default) m4_undefine([devel_default]) AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) AC_MSG_CHECKING([whether to build developer documentation]) AC_MSG_RESULT([$build_devel_docs]) ]) # XORG_ENABLE_DEVEL_DOCS # XORG_ENABLE_SPECS (enable_specs=yes) # ---------------- # Minimum version: 1.6.0 # # This macro enables a builder to skip all functional specification targets. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_SPECS: used in makefiles to conditionally generate specs # --enable-specs: 'yes' user instructs the module to generate specs # 'no' user instructs the module not to generate specs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_SPECS],[ m4_define([spec_default], m4_default([$1], [yes])) AC_ARG_ENABLE(specs, AS_HELP_STRING([--enable-specs], [Enable building the specs (default: ]spec_default[)]), [build_specs=$enableval], [build_specs=]spec_default) m4_undefine([spec_default]) AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) AC_MSG_CHECKING([whether to build functional specifications]) AC_MSG_RESULT([$build_specs]) ]) # XORG_ENABLE_SPECS # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) # ---------------------------------------------- # Minimum version: 1.13.0 # # This macro enables a builder to enable/disable unit testing # It makes no assumption about the test cases implementation # Test cases may or may not use Automake "Support for test suites" # They may or may not use the software utility library GLib # # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. # The variable enable_unit_tests is used by other macros in this file. # # Interface to module: # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests # enable_unit_tests: used in configure.ac for additional configuration # --enable-unit-tests: 'yes' user instructs the module to build tests # 'no' user instructs the module not to build tests # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[ AC_BEFORE([$0], [XORG_WITH_GLIB]) AC_BEFORE([$0], [XORG_LD_WRAP]) AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], [Enable building unit test cases (default: ]_defopt[)]), [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt) m4_undefine([_defopt]) AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno]) AC_MSG_CHECKING([whether to build unit test cases]) AC_MSG_RESULT([$enable_unit_tests]) ]) # XORG_ENABLE_UNIT_TESTS # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto) # ------------------------------------------------------ # Minimum version: 1.17.0 # # This macro enables a builder to enable/disable integration testing # It makes no assumption about the test cases' implementation # Test cases may or may not use Automake "Support for test suites" # # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support # usually requires less dependencies and may be built and run under less # stringent environments than integration tests. # # Interface to module: # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests # enable_integration_tests: used in configure.ac for additional configuration # --enable-integration-tests: 'yes' user instructs the module to build tests # 'no' user instructs the module not to build tests # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[ AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests], [Enable building integration test cases (default: ]_defopt[)]), [enable_integration_tests=$enableval], [enable_integration_tests=]_defopt) m4_undefine([_defopt]) AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], [test "x$enable_integration_tests" != xno]) AC_MSG_CHECKING([whether to build unit test cases]) AC_MSG_RESULT([$enable_integration_tests]) ]) # XORG_ENABLE_INTEGRATION_TESTS # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT]) # ---------------------------------------- # Minimum version: 1.13.0 # # GLib is a library which provides advanced data structures and functions. # This macro enables a module to test for the presence of Glib. # # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. # Otherwise the value of $enable_unit_tests is blank. # # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit # test support usually requires less dependencies and may be built and run under # less stringent environments than integration tests. # # Interface to module: # HAVE_GLIB: used in makefiles to conditionally build targets # with_glib: used in configure.ac to know if GLib has been found # --with-glib: 'yes' user instructs the module to use glib # 'no' user instructs the module not to use glib # AC_DEFUN([XORG_WITH_GLIB],[ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], [Use GLib library for unit testing (default: ]_defopt[)]), [with_glib=$withval], [with_glib=]_defopt) m4_undefine([_defopt]) have_glib=no # Do not probe GLib if user explicitly disabled unit testing if test "x$enable_unit_tests" != x"no"; then # Do not probe GLib if user explicitly disabled it if test "x$with_glib" != x"no"; then m4_ifval( [$1], [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])], [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])] ) fi fi # Not having GLib when unit testing has been explicitly requested is an error if test "x$enable_unit_tests" = x"yes"; then if test "x$have_glib" = x"no"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) fi fi # Having unit testing disabled when GLib has been explicitly requested is an error if test "x$enable_unit_tests" = x"no"; then if test "x$with_glib" = x"yes"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) fi fi # Not having GLib when it has been explicitly requested is an error if test "x$with_glib" = x"yes"; then if test "x$have_glib" = x"no"; then AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found]) fi fi AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) ]) # XORG_WITH_GLIB # XORG_LD_WRAP([required|optional]) # --------------------------------- # Minimum version: 1.13.0 # # Check if linker supports -wrap, passed via compiler flags # # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. # Otherwise the value of $enable_unit_tests is blank. # # Argument added in 1.16.0 - default is "required", to match existing behavior # of returning an error if enable_unit_tests is yes, and ld -wrap is not # available, an argument of "optional" allows use when some unit tests require # ld -wrap and others do not. # AC_DEFUN([XORG_LD_WRAP],[ XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no], [AC_LANG_PROGRAM([#include void __wrap_exit(int status) { return; }], [exit(0);])]) # Not having ld wrap when unit testing has been explicitly requested is an error if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then if test "x$have_ld_wrap" = x"no"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available]) fi fi AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) # ]) # XORG_LD_WRAP # XORG_CHECK_LINKER_FLAGS # ----------------------- # SYNOPSIS # # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE]) # # DESCRIPTION # # Check whether the given linker FLAGS work with the current language's # linker, or whether they give an error. # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # PROGRAM-SOURCE is the program source to link with, if needed # # NOTE: Based on AX_CHECK_COMPILER_FLAGS. # # LICENSE # # Copyright (c) 2009 Mike Frysinger # Copyright (c) 2009 Steven G. Johnson # Copyright (c) 2009 Matteo Frigo # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well.# AC_DEFUN([XORG_CHECK_LINKER_FLAGS], [AC_MSG_CHECKING([whether the linker accepts $1]) dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: AS_LITERAL_IF([$1], [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ ax_save_FLAGS=$LDFLAGS LDFLAGS="$1" AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])], AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, AS_TR_SH(xorg_cv_linker_flags_[$1])=no) LDFLAGS=$ax_save_FLAGS])], [ax_save_FLAGS=$LDFLAGS LDFLAGS="$1" AC_LINK_IFELSE([AC_LANG_PROGRAM()], eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no) LDFLAGS=$ax_save_FLAGS]) eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1]) AC_MSG_RESULT($xorg_check_linker_flags) if test "x$xorg_check_linker_flags" = xyes; then m4_default([$2], :) else m4_default([$3], :) fi ]) # XORG_CHECK_LINKER_FLAGS # XORG_MEMORY_CHECK_FLAGS # ----------------------- # Minimum version: 1.16.0 # # This macro attempts to find appropriate memory checking functionality # for various platforms which unit testing code may use to catch various # forms of memory allocation and access errors in testing. # # Interface to module: # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging # Usually added to TESTS_ENVIRONMENT in Makefile.am # # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim. # AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV], [Environment variables to enable memory checking in tests]) # Check for different types of support on different platforms case $host_os in solaris*) AC_CHECK_LIB([umem], [umem_alloc], [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default']) ;; *-gnu*) # GNU libc - Value is used as a single byte bit pattern, # both directly and inverted, so should not be 0 or 255. malloc_debug_env='MALLOC_PERTURB_=15' ;; darwin*) malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' ;; *bsd*) malloc_debug_env='MallocPreScribble=1 MallocScribble=1' ;; esac # User supplied flags override default flags if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" fi AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env]) ]) # XORG_WITH_LINT # XORG_CHECK_MALLOC_ZERO # ---------------------- # Minimum version: 1.0.0 # # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if # malloc(0) returns NULL. Packages should add one of these cflags to # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ AC_ARG_ENABLE(malloc0returnsnull, AS_HELP_STRING([--enable-malloc0returnsnull], [malloc(0) returns NULL (default: auto)]), [MALLOC_ZERO_RETURNS_NULL=$enableval], [MALLOC_ZERO_RETURNS_NULL=auto]) AC_MSG_CHECKING([whether malloc(0) returns NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then AC_RUN_IFELSE([AC_LANG_PROGRAM([ #include ],[ char *m0, *r0, *c0, *p; m0 = malloc(0); p = malloc(10); r0 = realloc(p,0); c0 = calloc(0,10); exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); ])], [MALLOC_ZERO_RETURNS_NULL=yes], [MALLOC_ZERO_RETURNS_NULL=no], [MALLOC_ZERO_RETURNS_NULL=yes]) fi AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" else MALLOC_ZERO_CFLAGS="" XMALLOC_ZERO_CFLAGS="" XTMALLOC_ZERO_CFLAGS="" fi AC_SUBST([MALLOC_ZERO_CFLAGS]) AC_SUBST([XMALLOC_ZERO_CFLAGS]) AC_SUBST([XTMALLOC_ZERO_CFLAGS]) ]) # XORG_CHECK_MALLOC_ZERO # XORG_WITH_LINT() # ---------------- # Minimum version: 1.1.0 # # This macro enables the use of a tool that flags some suspicious and # non-portable constructs (likely to be bugs) in C language source code. # It will attempt to locate the tool and use appropriate options. # There are various lint type tools on different platforms. # # Interface to module: # LINT: returns the path to the tool found on the platform # or the value set to LINT on the configure cmd line # also an Automake conditional # LINT_FLAGS: an Automake variable with appropriate flags # # --with-lint: 'yes' user instructs the module to use lint # 'no' user instructs the module not to use lint (default) # # If the user sets the value of LINT, AC_PATH_PROG skips testing the path. # If the user sets the value of LINT_FLAGS, they are used verbatim. # AC_DEFUN([XORG_WITH_LINT],[ AC_ARG_VAR([LINT], [Path to a lint-style command]) AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], [Use a lint-style source code checker (default: disabled)])], [use_lint=$withval], [use_lint=no]) # Obtain platform specific info like program name and options # The lint program on FreeBSD and NetBSD is different from the one on Solaris case $host_os in *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) lint_name=splint lint_options="-badflag" ;; *freebsd* | *netbsd*) lint_name=lint lint_options="-u -b" ;; *solaris*) lint_name=lint lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" ;; esac # Test for the presence of the program (either guessed by the code or spelled out by the user) if test "x$use_lint" = x"yes" ; then AC_PATH_PROG([LINT], [$lint_name]) if test "x$LINT" = "x"; then AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) fi elif test "x$use_lint" = x"no" ; then if test "x$LINT" != "x"; then AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) fi else AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) fi # User supplied flags override default flags if test "x$LINT_FLAGS" != "x"; then lint_options=$LINT_FLAGS fi AC_SUBST([LINT_FLAGS],[$lint_options]) AM_CONDITIONAL(LINT, [test "x$LINT" != x]) ]) # XORG_WITH_LINT # XORG_LINT_LIBRARY(LIBNAME) # -------------------------- # Minimum version: 1.1.0 # # Sets up flags for building lint libraries for checking programs that call # functions in the library. # # Interface to module: # LINTLIB - Automake variable with the name of lint library file to make # MAKE_LINT_LIB - Automake conditional # # --enable-lint-library: - 'yes' user instructs the module to created a lint library # - 'no' user instructs the module not to create a lint library (default) AC_DEFUN([XORG_LINT_LIBRARY],[ AC_REQUIRE([XORG_WITH_LINT]) AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], [Create lint library (default: disabled)])], [make_lint_lib=$enableval], [make_lint_lib=no]) if test "x$make_lint_lib" = x"yes" ; then LINTLIB=llib-l$1.ln if test "x$LINT" = "x"; then AC_MSG_ERROR([Cannot make lint library without --with-lint]) fi elif test "x$make_lint_lib" != x"no" ; then AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) fi AC_SUBST(LINTLIB) AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) ]) # XORG_LINT_LIBRARY # XORG_COMPILER_BRAND # ------------------- # Minimum version: 1.14.0 # # Checks for various brands of compilers and sets flags as appropriate: # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes" # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes" # clang compiler - sets CLANGCC to "yes" # Intel compiler - sets INTELCC to "yes" # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes" # AC_DEFUN([XORG_COMPILER_BRAND], [ AC_LANG_CASE( [C], [ AC_REQUIRE([AC_PROG_CC_C99]) ], [C++], [ AC_REQUIRE([AC_PROG_CXX]) ] ) AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"]) AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) ]) # XORG_COMPILER_BRAND # XORG_TESTSET_CFLAG(, , [, ...]) # --------------- # Minimum version: 1.16.0 # # Test if the compiler works when passed the given flag as a command line argument. # If it succeeds, the flag is appeneded to the given variable. If not, it tries the # next flag in the list until there are no more options. # # Note that this does not guarantee that the compiler supports the flag as some # compilers will simply ignore arguments that they do not understand, but we do # attempt to weed out false positives by using -Werror=unknown-warning-option and # -Werror=unused-command-line-argument # AC_DEFUN([XORG_TESTSET_CFLAG], [ m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) AC_LANG_COMPILER_REQUIRE AC_LANG_CASE( [C], [ AC_REQUIRE([AC_PROG_CC_C99]) define([PREFIX], [C]) define([CACHE_PREFIX], [cc]) define([COMPILER], [$CC]) ], [C++], [ define([PREFIX], [CXX]) define([CACHE_PREFIX], [cxx]) define([COMPILER], [$CXX]) ] ) [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]" if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option], AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no])) [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option] PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" fi if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" fi PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument], AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no])) [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument] PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" fi found="no" m4_foreach([flag], m4_cdr($@), [ if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" fi PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag[" dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[]) cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[]) AC_CACHE_VAL($cacheid, [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], [eval $cacheid=yes], [eval $cacheid=no])]) PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" eval supported=\$$cacheid AC_MSG_RESULT([$supported]) if test "$supported" = "yes" ; then $1="$$1 ]flag[" found="yes" fi fi ]) ]) # XORG_TESTSET_CFLAG # XORG_COMPILER_FLAGS # --------------- # Minimum version: 1.16.0 # # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line # arguments supported by the selected compiler which do NOT alter the generated # code. These arguments will cause the compiler to print various warnings # during compilation AND turn a conservative set of warnings into errors. # # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in # future versions of util-macros as options are added to new compilers. # AC_DEFUN([XORG_COMPILER_FLAGS], [ AC_REQUIRE([XORG_COMPILER_BRAND]) AC_ARG_ENABLE(selective-werror, AS_HELP_STRING([--disable-selective-werror], [Turn off selective compiler errors. (default: enabled)]), [SELECTIVE_WERROR=$enableval], [SELECTIVE_WERROR=yes]) AC_LANG_CASE( [C], [ define([PREFIX], [C]) ], [C++], [ define([PREFIX], [CXX]) ] ) # -v is too short to test reliably with XORG_TESTSET_CFLAG if test "x$SUNCC" = "xyes"; then [BASE_]PREFIX[FLAGS]="-v" else [BASE_]PREFIX[FLAGS]="" fi # This chunk of warnings were those that existed in the legacy CWARNFLAGS XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat]) AC_LANG_CASE( [C], [ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement]) ] ) # This chunk adds additional warnings that could catch undesired effects. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION else AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast]) fi AC_SUBST([BASE_]PREFIX[FLAGS]) ]) # XORG_COMPILER_FLAGS # XORG_CWARNFLAGS # --------------- # Minimum version: 1.2.0 # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) # # Defines CWARNFLAGS to enable C compiler warnings. # # This function is deprecated because it defines -fno-strict-aliasing # which alters the code generated by the compiler. If -fno-strict-aliasing # is needed, then it should be added explicitly in the module when # it is updated to use BASE_CFLAGS. # AC_DEFUN([XORG_CWARNFLAGS], [ AC_REQUIRE([XORG_COMPILER_FLAGS]) AC_REQUIRE([XORG_COMPILER_BRAND]) AC_LANG_CASE( [C], [ CWARNFLAGS="$BASE_CFLAGS" if test "x$GCC" = xyes ; then CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" fi AC_SUBST(CWARNFLAGS) ] ) ]) # XORG_CWARNFLAGS # XORG_STRICT_OPTION # ----------------------- # Minimum version: 1.3.0 # # Add configure option to enable strict compilation flags, such as treating # warnings as fatal errors. # If --enable-strict-compilation is passed to configure, adds strict flags to # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS. # # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or # when strict compilation is unconditionally desired. AC_DEFUN([XORG_STRICT_OPTION], [ AC_REQUIRE([XORG_CWARNFLAGS]) AC_REQUIRE([XORG_COMPILER_FLAGS]) AC_ARG_ENABLE(strict-compilation, AS_HELP_STRING([--enable-strict-compilation], [Enable all warnings from compiler and make them errors (default: disabled)]), [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) AC_LANG_CASE( [C], [ define([PREFIX], [C]) ], [C++], [ define([PREFIX], [CXX]) ] ) [STRICT_]PREFIX[FLAGS]="" XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic]) XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn]) # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not # activate it with -Werror, so we add it here explicitly. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes]) if test "x$STRICT_COMPILE" = "xyes"; then [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]" AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"]) fi AC_SUBST([STRICT_]PREFIX[FLAGS]) AC_SUBST([BASE_]PREFIX[FLAGS]) AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS])) ]) # XORG_STRICT_OPTION # XORG_DEFAULT_OPTIONS # -------------------- # Minimum version: 1.3.0 # # Defines default options for X.Org modules. # AC_DEFUN([XORG_DEFAULT_OPTIONS], [ AC_REQUIRE([AC_PROG_INSTALL]) XORG_COMPILER_FLAGS XORG_CWARNFLAGS XORG_STRICT_OPTION XORG_RELEASE_VERSION XORG_CHANGELOG XORG_INSTALL XORG_MANPAGE_SECTIONS m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) ]) # XORG_DEFAULT_OPTIONS # XORG_INSTALL() # ---------------- # Minimum version: 1.4.0 # # Defines the variable INSTALL_CMD as the command to copy # INSTALL from $prefix/share/util-macros. # AC_DEFUN([XORG_INSTALL], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" AC_SUBST([INSTALL_CMD]) ]) # XORG_INSTALL dnl Copyright 2005 Red Hat, Inc dnl dnl Permission to use, copy, modify, distribute, and sell this software and its dnl documentation for any purpose is hereby granted without fee, provided that dnl the above copyright notice appear in all copies and that both that dnl copyright notice and this permission notice appear in supporting dnl documentation. dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or substantial portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR dnl OTHER DEALINGS IN THE SOFTWARE. dnl dnl Except as contained in this notice, the name of the copyright holders shall dnl not be used in advertising or otherwise to promote the sale, use or dnl other dealings in this Software without prior written authorization dnl from the copyright holders. dnl # XORG_RELEASE_VERSION # -------------------- # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 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 | 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 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], [$PVP], [Patch version of this package]) ]) # XORG_CHANGELOG() # ---------------- # Minimum version: 1.2.0 # # Defines the variable CHANGELOG_CMD as the command to generate # ChangeLog from git. # # AC_DEFUN([XORG_CHANGELOG], [ CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ echo 'git directory not found: installing possibly empty changelog.' >&2)" AC_SUBST([CHANGELOG_CMD]) ]) # XORG_CHANGELOG dnl Copyright 2005 Red Hat, Inc dnl dnl Permission to use, copy, modify, distribute, and sell this software and its dnl documentation for any purpose is hereby granted without fee, provided that dnl the above copyright notice appear in all copies and that both that dnl copyright notice and this permission notice appear in supporting dnl documentation. dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or substantial portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR dnl OTHER DEALINGS IN THE SOFTWARE. dnl dnl Except as contained in this notice, the name of the copyright holders shall dnl not be used in advertising or otherwise to promote the sale, use or dnl other dealings in this Software without prior written authorization dnl from the copyright holders. dnl # XORG_DRIVER_CHECK_EXT() # -------------------------- # Checks for the $1 define in xorg-server.h (from the sdk). If it # is defined, then add $1 to $REQUIRED_MODULES. AC_DEFUN([XORG_DRIVER_CHECK_EXT],[ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "xorg-server.h" #if !defined $1 #error $1 not defined #endif ]])], [_EXT_CHECK=yes], [_EXT_CHECK=no]) CFLAGS="$SAVE_CFLAGS" AC_MSG_CHECKING([if $1 is defined]) AC_MSG_RESULT([$_EXT_CHECK]) if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES $2" fi ]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2009, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # (`yes' being less verbose, `no' or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [ --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0')]) case $enable_silent_rules in yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few `make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using `$V' instead of `$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR xf86-video-sis-0.10.7/config.sub0000755000076400007640000010471611763612270013224 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-01-01' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xf86-video-sis-0.10.7/ChangeLog0000664000076400007640000021331312001203066012770 00000000000000commit 8c5127a6815935635b84835055bf4c2501c0bf6e Author: Dave Airlie Date: Tue Jul 17 16:05:09 2012 +1000 xf86-video-sis: bump to version 0.10.7 Signed-off-by: Dave Airlie commit c3d8d70edd06b8ecedd341df8b33ba71c01e64b3 Author: Dave Airlie Date: Sun Jul 15 19:55:19 2012 +1000 sis: add xaa configure support SIS is already plumbed to not need XAA, just hook it up. Signed-off-by: Dave Airlie commit 314d56d0addfaa5c24d14de675416b3aca7f4a19 Author: Alan Coopersmith Date: Fri Jun 29 20:40:01 2012 -0700 Make SiSRegInit & SiSSetLVDSetc args match in both headers that define them Adds include of "sis_dac.h" to init.c to force compilers to compare the definitions, making it obvious that sis_dac.h defined an extra argument to SiSSetLVDSetc that the function itself didn't have, and that SiSRegInit expected an unsigned long (in the form of SISIOADDRESS), not the unsigned short that sis_dac.h claimed to pass it. Found by the Parfait 1.0 bug checking tool: Error: Function Call Mismatch Function call with extra args: Forward declaration of function 'SiSSetLVDSetc' does not match its definition Function expects 1 argument (SiS_Private*); given 2 (SiS_Private*, unsigned short) at line 604 of driver/xf86-video-sis/src/sis_dac.c in function 'SiS300Restore'. Function defined at line 1153 of driver/xf86-video-sis/src/init.c. [repeated for each call] Signed-off-by: Alan Coopersmith commit aa79b0f5dbbeda194916365539d06c3c090b80d2 Author: Dave Airlie Date: Mon Jul 2 13:19:04 2012 +0100 sis 0.10.6 release. Signed-off-by: Dave Airlie commit df17d3039e856c13b0476122a01b8c20f7d2de88 Author: Dave Airlie Date: Mon Jul 2 13:16:26 2012 +0100 sis: fix build against older servers. Signed-off-by: Dave Airlie commit 331c276b47af1140a64125bff39901f8a8271eb7 Author: Dave Airlie Date: Mon Jul 2 13:13:42 2012 +0100 sis: 0.10.5 release Signed-off-by: Dave Airlie commit f6d49466ca538c65fa8c66352e421c2624e204f1 Author: Dave Airlie Date: Wed Jun 6 09:50:31 2012 +0100 sis: drop xf86PciInfo.h Signed-off-by: Dave Airlie commit 1b20cd63a974f792bd15e13d1c6caa3bbabbe106 Author: Dave Airlie Date: Wed Jun 6 09:46:42 2012 +0100 sis: port to new compat API. Signed-off-by: Dave Airlie commit e067fc080c653a5d47cd319ca1a7afeebe6c7c4e Author: Alan Coopersmith Date: Fri Mar 23 19:52:38 2012 -0700 xf86-video-sis 0.10.4 Signed-off-by: Alan Coopersmith commit f5dafa24d825a7d279c8177422c66b997b82d240 Author: Johannes Obermayr Date: Mon Feb 6 23:15:31 2012 +0100 Fix build with XInput version 12. Signed-off-by: Peter Hutterer commit bdaf1ba97cf8b0abb5aeee97a822ee466bf8f5f5 Author: Peter Hutterer Date: Tue Jan 17 15:21:26 2012 +1000 Undo typos from last commit Reported-by: Tormod Volden Signed-off-by: Peter Hutterer commit 9c1f8f775ca692858fd88e325ef815cc49e55805 Author: Peter Hutterer Date: Wed Jan 4 13:58:01 2012 +1000 Untangle XF86DRI from the driver-specific DRI define XF86DRI is defined by xorg-server.h, so --disable-dri in the sis driver itself does exactly nothing other than not fill in the CFLAGS and thus stop the driver from compiling. Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston commit 16724f3ecd322c64d9ee164fb122d4285d9cef08 Author: Peter Hutterer Date: Mon Oct 31 15:03:21 2011 +1000 Use miPointerSetPosition, not miPointerAbsoluteCursor miPointerAbsoluteCursor was removed in '09. Technically this shouldn't just work on the VCP since any master pointer may end up in the dead area. However, I suspect the Venn diagramm of MPX users and sis merged framebuffer users shows little overlap. miPointerSetPosition's prototype changed a few times, these are a bunch of untested ifdefs that should be correct according to the git history. Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston commit 3e0d8e11927b8c68f6531eef39eb5bca557e887b Author: Adam Jackson Date: Mon Dec 19 17:28:33 2011 -0500 Fall back to shadowfb if XAA is unavailable Signed-off-by: Adam Jackson commit 2b459f385dc2f1b5e769e2ce84b6f4ec099c0a23 Author: Jeremy Huddleston Date: Mon Oct 31 11:57:49 2011 -0700 Build fix for older servers (error: conflicting types for 'pciTag') /usr/include/xorg/xf86Pci.h:254:25: note: previous declaration of 'pciTag' was here Reported-by: Johannes Obermayr Signed-off-by: Jeremy Huddleston commit 0ab07a477a4916923a13c073c3fd6e575e79f725 Author: Jeremy Huddleston Date: Sun Oct 30 11:09:30 2011 -0700 Use pci_device_map_legacy rather than xf86MapDomainMemory on newer servers Signed-off-by: Jeremy Huddleston commit 77046f9be08295dbca69b51987df3308a284d87e Author: Jeremy Huddleston Date: Sat Oct 29 17:44:55 2011 -0700 Convert use of LookupWindow to dixLookupWindow Signed-off-by: Jeremy Huddleston commit 06f8213bffd27360d5cc3df0cad19b102cc928e2 Author: Jeremy Huddleston Date: Sat Oct 29 17:32:21 2011 -0700 pciTag was removed from xorg-server, so provide it in-driver until this is updated to use libpciaccess Signed-off-by: Jeremy Huddleston commit 03644653d051e4f5b8498c790626a9bed2756a89 Author: Jeremy Huddleston Date: Sat Oct 29 17:25:18 2011 -0700 Silence warnings by using newer xf86dgaproto Signed-off-by: Jeremy Huddleston commit 4b0aab53a1e8500578f86178761f4c805b2a5990 Author: Jeremy Huddleston Date: Wed Oct 19 00:40:32 2011 -0700 Build fix for ABI Version 12 ABI Version 12 removes support for multiple PCI domains. If you need to use this driver on a system with more than one PCI domain, you should either port this driver to using libpciaccess directly or stick with an older server. Signed-off-by: Jeremy Huddleston commit 69aa104ed064ca08196e7310e232ddb5c9a590bd Author: Jeremy Huddleston Date: Wed Oct 19 00:35:02 2011 -0700 Use unsigned long rather than deprecated IOADDRESS Signed-off-by: Jeremy Huddleston commit 28f3a899a1e317b665cc1925ce7a4e34818cfd1f Author: Jeremy Huddleston Date: Fri Oct 7 12:32:22 2011 -0700 Use malloc/calloc/realloc/free directly Signed-off-by: Jeremy Huddleston commit c530ebb5d4ad0663838a0132e3610d713eaaa640 Author: Jeremy Huddleston Date: Fri Oct 7 12:24:40 2011 -0700 Fix build failures with recent server changes to swapl and swaps Signed-off-by: Jeremy Huddleston commit 89e9a38f0ccda9b9ee973f5cd5e57cad73eb7421 Author: Matt Turner Date: Sun Sep 25 12:32:08 2011 -0400 Fix wrong-sized swaps Signed-off-by: Matt Turner commit 94f23a5672ebeac61cc32e34882d637aa0c7f2f4 Author: Alan Coopersmith Date: Sat Jun 4 21:00:03 2011 -0700 Convert sis.man from XORG_RAWCPP to using sed like other drivers Upgrade to util-macros 1.8 for additional man page support Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS The value of MAN_SUBST is the same for all X.Org packages. Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS The existing statement can now be removed from the configuration file. Use automake provided $(AM_V_GEN) and XORG_DEFAULT_OPTIONS provided $(SED) Enables silent rule and use platform appropriate version of sed. Signed-off-by: Alan Coopersmith Reviewed-by: Gaetan Nadon commit b3368984ae83355d70e06eedefff28c1b84eb16c Author: Jesse Adkins Date: Tue Sep 28 13:29:51 2010 -0700 Purge cvs tags. Signed-off-by: Jesse Adkins Signed-off-by: Alan Coopersmith commit c2a6ffda81b343d09dfae6ef68983bf28194a00c Author: Gaetan Nadon Date: Wed Jul 21 16:49:04 2010 -0400 config: add comments for main statements commit ae7ac7fe58a1311544b9d0091614a61d29eef171 Author: Gaetan Nadon Date: Wed Jul 21 16:07:00 2010 -0400 config: replace deprecated use of AC_OUTPUT with AC_CONFIG_FILES Signed-off-by: Gaetan Nadon commit fe34acc246e938bd190af11a0361a2541fcc590c Author: Gaetan Nadon Date: Wed Jul 21 14:37:41 2010 -0400 config: replace deprecated AC_HELP_STRING with AS_HELP_STRING Signed-off-by: Gaetan Nadon commit 4d77c76f9c94804efd942328722fb1262df74f5a Author: Gaetan Nadon Date: Wed Jul 21 14:05:23 2010 -0400 config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS Signed-off-by: Gaetan Nadon commit 2a3e9ff44670c0763557ce9c87b9946bd4349027 Author: Gaetan Nadon Date: Wed Jul 21 09:27:42 2010 -0400 config: complete AC_INIT m4 quoting Signed-off-by: Gaetan Nadon commit 00d2b8790a0aa732d0abb4688330749a1c44763d Author: Gaetan Nadon Date: Tue Jul 20 21:54:12 2010 -0400 config: remove unrequired AC_SUBST([DRI_CFLAGS]) This macro is called by PKG_CHECK_MODULES Signed-off-by: Gaetan Nadon commit ca0dd9ac3d78991f20e19e9b1cbb06b8707698bd Author: Gaetan Nadon Date: Tue Jul 20 21:44:58 2010 -0400 config: remove unrequired AC_SUBST([XORG_CFLAGS]) This macro is called by PKG_CHECK_MODULES Signed-off-by: Gaetan Nadon commit 96daa64b9ce5a44474fa0c62c5cc5971496120ee Author: Gaetan Nadon Date: Tue Jul 20 20:24:42 2010 -0400 config: remove unrequired AC_HEADER_STDC Autoconf says: "This macro is obsolescent, as current systems have conforming header files. New programs need not use this macro". Signed-off-by: Gaetan Nadon commit 517a7563c43841ecb1cb00577540118f93856df8 Author: Gaetan Nadon Date: Tue Jul 20 19:41:31 2010 -0400 config: remove AC_PROG_CC as it overrides AC_PROG_C_C99 XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls AC_PROG_C_C99. This sets gcc with -std=gnu99. If AC_PROG_CC macro is called afterwards, it resets CC to gcc. Signed-off-by: Gaetan Nadon commit 494ce36b3bf1cfffb12c70ea969381766b46e622 Author: Gaetan Nadon Date: Tue Jul 20 18:45:19 2010 -0400 config: update AC_PREREQ statement to 2.60 Unrelated to the previous patches, the new value simply reflects the reality that the minimum level for autoconf to configure all x.org modules is 2.60 dated June 2006. ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz Signed-off-by: Gaetan Nadon commit 519a4653ffdd5b643b6f3c0f38eb2cad8366215b Author: Fernando Carrijo Date: Thu Jul 1 07:16:18 2010 -0300 Purge macros NEED_EVENTS and NEED_REPLIES Signed-off-by: Fernando Carrijo Acked-by: Tiago Vignatti Reviewed-by: Alan Coopersmith commit 75a8a7c51547805358ced39e1a04820e17133264 Author: Dave Airlie Date: Mon Jul 5 14:23:33 2010 +1000 sis 0.10.3 commit ac05588db7da21d1ff2cb13bba11b66bb5d5c38b Author: Julien Cristau Date: Tue Jun 29 21:37:50 2010 +0100 Replace some broken URLs with winishhofer.eu The old one seems to be a casino web site nowadays. Debian bug#517075 Reported-by: Nigel Tamplin Signed-off-by: Julien Cristau commit 116d40678dfbb851fd401103f9b7447f4d47eb7c Author: Gaetan Nadon Date: Mon Jun 14 08:14:30 2010 -0400 README: keep the text version of README, discard the sgml version The linuxdoc doc tool is deprecated. README files are exclusively text files. Signed-off-by: Gaetan Nadon commit 5f9fd07d54b8bc26c0403e1b46acce23db1365d9 Author: Gaetan Nadon Date: Mon Jun 14 07:58:26 2010 -0400 README: fix linuxdoc content defs.ent are located under X11 directory ident tag is not a Linuxdoc tag replace docbook email tag with linuxdoc email tag Signed-off-by: Gaetan Nadon commit 1bec9268f503e249cf1a20f2597f3f6c78a13af4 Author: Gaetan Nadon Date: Sun Jun 13 10:56:05 2010 -0400 COPYING: replace stub file with actual Copyright notices. Signed-off-by: Gaetan Nadon commit 13583aba3e2abafd55fc894070cf5f050bbea4f2 Author: Adam Jackson Date: Tue May 18 13:11:01 2010 -0400 Remove mibank.h reference Signed-off-by: Adam Jackson commit 47233238a659318cae6b7d0f71ee44b689e249c3 Author: david@fries.net Date: Tue Sep 15 22:32:45 2009 -0500 SISVGABlankScreen: only update the hardware if we're changing the state The command `xset s reset` will reset the X server screensaver to reset the timer for the screensaver and dpms. If the display is already on, it should do nothing as far as the hardware goes. In the SISVGABlankScreen routine it requires as reset to update the register, but that will disrupt the VGA signal and cause the monitor to resync leaving the screen blank for a couple seconds. I have a program that wants to keep the screensaver from coming on, but allow normal operation when it isn't running. Debian bug#546838 Signed-off-by: Julien Cristau commit dff79298ae04cec6233cd043cbf3aeda6db67d42 Author: Tiago Vignatti Date: Thu May 6 20:15:04 2010 +0300 Document better the resource access hack Signed-off-by: Tiago Vignatti commit d33e45dcaee511d5f09ac5f68680e96f3ad60076 Author: Alan Coopersmith Date: Fri Jan 15 13:55:44 2010 -0800 Update Sun license notices to current X.Org standard form Signed-off-by: Alan Coopersmith commit 2c9baaaa8ace01d94e95ca4ad7216146339940dd Author: Gaetan Nadon Date: Tue Dec 15 21:47:35 2009 -0500 configure.ac: use backticks rather than $() for cmd subs Use "$PKG_CONFIG" rather than hard coded "pkg-config" Acked-by: Dan Nicholson Acked-by: Daniel Stone Signed-off-by: Gaetan Nadon commit cbfa94ccb1ee6213342014f3c7063362acb274ff Author: Gaetan Nadon Date: Mon Nov 23 09:25:05 2009 -0500 Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES Now that the INSTALL file is generated. Allows running make maintainer-clean. commit a69569c72ea19d4d76c57a8077542fee4aeb501a Author: Gaetan Nadon Date: Wed Oct 28 14:41:41 2009 -0400 INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206 Automake 'foreign' option is specified in configure.ac. Remove from Makefile.am commit 8d766ddd89a4d9d5c02ad186b049cca2d806a3d8 Author: Gaetan Nadon Date: Wed Oct 28 14:09:09 2009 -0400 INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206 Add missing INSTALL file. Use standard GNU file on building tarball README may have been updated Remove AUTHORS file as it is empty and no content available yet. Remove NEWS file as it is empty and no content available yet. commit b92482e522d3b8a6526c05bf491d3e768f282714 Author: Gaetan Nadon Date: Mon Oct 26 12:54:22 2009 -0400 Several driver modules do not have a ChangeLog target in Makefile.am #23814 The git generated ChangeLog replaces the hand written one. Update configure.ac to xorg-macros level 1.3. Use XORG_DEFAULT_OPTIONS which replaces four XORG_* macros Update Makefile.am to add ChangeLog target if missing Remove ChangeLog from EXTRA_DIST or *CLEAN variables This is a pre-req for the INSTALL_CMD commit 8655ebf788bb281f3f566d6335943527155b91a5 Author: Gaetan Nadon Date: Thu Oct 22 13:04:14 2009 -0400 .gitignore: use common defaults with custom section # 24239 Using common defaults will reduce errors and maintenance. Only the very small or inexistent custom section need periodic maintenance when the structure of the component changes. Do not edit defaults. commit ef03b3abab51a5bf81813a524d177370053ddfa0 Author: Gaetan Nadon Date: Thu Oct 22 12:34:18 2009 -0400 .gitignore: use common defaults with custom section # 24239 Using common defaults will reduce errors and maintenance. Only the very small or inexistent custom section need periodic maintenance when the structure of the component changes. Do not edit defaults. commit 8370499d4035ec7a5c8e1f1b04d5a6c404883442 Author: Matteo Delfino Date: Wed Oct 21 10:26:45 2009 -0400 Fix BIOS read on 650 and 760. (#19070) Signed-off-by: Matteo Delfino Signed-off-by: Adam Jackson commit 9e50319293b10508bba4e3acef4a2851e7ab1f7a Author: Dave Airlie Date: Thu Jul 30 12:04:29 2009 +1000 sis: bump for release 0.10.2 commit 8c3eca873717e877048c2bde345c02b1e9099e50 Author: Dave Airlie Date: Tue Jul 28 15:22:41 2009 +1000 sis: change to using ABI version check commit 9e1ebb9530bbb71be7fcab9e6f8f9a475be72efe Author: Dave Airlie Date: Tue Jul 28 13:32:37 2009 +1000 sis: update for resources/RAC API removal commit 59ea80738d22c69a2850fd7ff89bd75330cc310b Author: Peter Hutterer Date: Thu Jul 16 11:55:25 2009 +1000 Update to xextproto 7.1 support. DPMS header was split into dpms.h (client) and dpmsconst.h (server). Drivers need to include dpmsconst.h if xextproto 7.1 is available. Signed-off-by: Peter Hutterer commit 74553b5ee476a0dd28e136f5a33a546ea0c3ef28 Author: Adam Jackson Date: Thu May 28 15:19:25 2009 -0400 Remove useless loader symbol lists. commit 933dd8f860883c613acb5bcdf6b66100dbdfa952 Author: Alan Coopersmith Date: Fri May 1 16:57:22 2009 -0700 Correct bounds check of blitClip array access Array is defined as blitClip[NUM_BLIT_PORTS], so invalid indexes are >= NUM_BLIT_PORTS, not just > NUM_BLIT_PORTS [This bug was found by the Parfait bug checking tool. For more information see http://research.sun.com/projects/parfait ] Signed-off-by: Alan Coopersmith commit 49c641b638ac36d2a559555c04a3bd2777c8d071 Author: Alan Coopersmith Date: Fri May 1 16:52:10 2009 -0700 Make sisRegs3D4 big enough to hold all values written to it Increase size from 0xff to 0x100 since SiS315Save (sis_dac.c line 752) writes values into sisRegs3D4[0x00..0xff] if ChipType >= XGI_20 [This bug was found by the Parfait bug checking tool. For more information see http://research.sun.com/projects/parfait ] Signed-off-by: Alan Coopersmith commit 5583c2342d873c0998ae73828246356867285460 Author: Chris Ball Date: Fri Feb 27 10:57:35 2009 -0500 Revert "Build fixes for EXA3" This reverts commit 7adc184e5e0f3df00423ea99b325d24764c1c067. The EXA developers have backed out this ABI bump. Signed-off-by: Chris Ball commit 7adc184e5e0f3df00423ea99b325d24764c1c067 Author: Chris Ball Date: Tue Feb 24 12:32:01 2009 -0500 Build fixes for EXA3 * EXA in xserver head now requires -DEXA_DRIVER_KNOWN_MAJOR=3 * EXA3 drops the UploadToScratch hook, so guard it for < 3 only. Signed-off-by: Chris Ball commit e4f6a2fcd5712d0f994d3719b9c6c13f5b02bc7c Author: Alan Coopersmith Date: Fri Jan 9 16:34:01 2009 -0800 Remove xorgconfig & xorgcfg from See Also list in man page commit 6ab99d8d66ccd77314760edcb6110db924be3dcf Author: Dave Airlie Date: Mon Dec 22 14:38:17 2008 +1000 sis 0.10.1 commit 7ae731c269a13613eed5ee8bef6cb9b6e82b74c6 Author: Matthieu Herrb Date: Thu Nov 6 23:40:34 2008 +0100 Fix build on alpha. commit 31509152757643b32f42fe0a21d3b00137540e40 Author: Daniel Stone Date: Sun Jul 20 04:15:52 2008 +0300 Remove XFree86-Misc (PassMessage) support The driver used PassMessage/HandleMessage from XFree86-Misc to ... just return BadMatch. So how about we drop this bit of code, including an additional dependency? commit 70ccce405b2134e7548a4a3660f9cff9fc306780 Author: Adam Jackson Date: Wed Mar 19 15:31:27 2008 -0400 sis 0.10.0 commit 3aff2a77c9c6bfff543195dc8908e422793a8f37 Author: Adam Jackson Date: Wed Mar 19 15:29:30 2008 -0400 Fix distcheck commit be77b71c3614e5b926caf3a177f6d5b7ef8d528b Author: Adam Jackson Date: Wed Mar 19 15:28:09 2008 -0400 Death to RCS tags. commit 6c7f2d4d2d1e89255007033be0f56a8cbe27397f Author: Matthieu Herrb Date: Sat Mar 8 23:51:57 2008 +0100 Makefile.am: nuke RCS Id commit be954beff0c1e7942845ff4c055e183784dddad9 Author: Julien Cristau Date: Fri Mar 7 17:09:35 2008 +0100 fixup pciaccess version detect commit f43247d383de0f4753db019482149ff923d884b0 Author: Julien Cristau Date: Wed Feb 27 14:10:17 2008 +0100 Require pciaccess >= 0.10.0 for pci_device_map_range() commit 36ed5521afb524f49bde348775be2bdd78fa0383 Author: Dave Airlie Date: Thu Jan 17 15:49:41 2008 +1000 fix some thinkos in the pciaccess patch, this now works on real hardware commit 797e6215ad9039ebbab547581c8ab3c143afb14f Author: Dave Airlie Date: Wed Jan 16 17:46:06 2008 +1000 fixup unmap memory commit 992f586cbf85d9d99059209afc66e62ee5eb80ce Author: Dave Airlie Date: Wed Jan 16 17:42:44 2008 +1000 use map domain memory with pciinfo commit 0e4dc89b7f00d1453d5c81be36c3d5ea39e3caad Author: Pete Zaitcev Date: Wed Jan 16 13:39:01 2008 +1000 switch vga over to pciaccess commit 585e03e6878dd257c694517be9ea231a6b3cfb66 Author: Dave Airlie Date: Wed Jan 16 13:34:58 2008 +1000 switch bios reading over commit ef98280b03318ae39d9b8ba45b13a9e27f520107 Author: Dave Airlie Date: Tue Jan 8 17:01:53 2008 +1000 finish off read/write long conversion commit e2cb9fa30350ee0c08469ad6ea7f34cecf106e33 Author: Dave Airlie Date: Tue Jan 8 16:45:49 2008 +1000 convert all hostbridge read/writes to accessor functions commit 77641c76963bbfea8914092ee65f116ba6d23967 Author: Dave Airlie Date: Tue Jan 8 16:14:07 2008 +1000 fixup type punning commit 08cfb9c048a33df584354a42093aeaf73db8e4d4 Author: Dave Airlie Date: Tue Jan 8 16:09:04 2008 +1000 another open/fopen confusion commit 6753430565085c88f2a26009b75d92fbd1e8d598 Author: Dave Airlie Date: Tue Jan 8 16:06:47 2008 +1000 fix thinko between open/fopen commit 70989db1c4e9465a7dd39f5d06edfc24a67d9ad6 Author: Dave Airlie Date: Tue Jan 8 16:01:09 2008 +1000 fix warnings in build commit d94a2efa2ea26c4fbb246ea93e9cc10b97cf3ea3 Author: Dave Airlie Date: Tue Jan 8 14:38:04 2008 +1000 inital SiS pci access patch commit 14d6555419ca3ab2ab58afe0ba1fc40038a69caa Author: Julien Cristau Date: Fri Nov 16 12:39:15 2007 +0100 Bump to 0.9.4. commit 748df8070893675ad3839fff295bec913be876f2 Author: James Cloos Date: Mon Sep 3 05:52:43 2007 -0400 Add *~ to .gitignore to skip patch/emacs droppings commit f269b388cb8853b4eabfe8c42e03baf4caa32ad8 Author: James Cloos Date: Thu Aug 23 19:25:55 2007 -0400 Rename .cvsignore to .gitignore commit ba3c4d45d6e8f04536e6512103db820f0d21b77a Author: Julien Cristau Date: Thu Aug 9 03:36:07 2007 +0200 Get rid of the XFree86Server macro. It's not exported by xserver these days, so don't test it. commit 391dad44fa305be4cded31cf2f9a4fba7420af99 Author: Julien Cristau Date: Thu Aug 9 03:35:12 2007 +0200 Fix xserver version detection. Newer xserver releases report a version of 1.x, which is smaller than 6.8.99.900. commit 89d2f2118a2409d1bf0239448a4e3d2f6e7a1919 Author: Brice Goglin Date: Tue Aug 7 12:57:23 2007 +0200 Define SIS_*_VERSION using PACKAGE_VERSION* commit 346693719a49cf50ff62cb25b09d433d2d8db9ea Author: Alex Deucher Date: Tue Feb 27 20:35:35 2007 -0500 bump Xv image height up from 1080 to 1088 for 315 chips fixes bug 10075 commit be1d494e0921d234918c899c6fe833c5d74b16fd Author: Eamon Walsh Date: Mon Dec 18 14:09:45 2006 -0500 Revert "Convert callers of LookupWindow() to dixLookupWindow()." This reverts commit e3070bc4832d4f1e00f16591cba35776d9a87f2d. commit e3070bc4832d4f1e00f16591cba35776d9a87f2d Author: Eamon Walsh Date: Fri Dec 15 17:46:03 2006 -0500 Convert callers of LookupWindow() to dixLookupWindow(). commit 07ca144f29e7038a0bd83c31783b134e57471b8b Author: Daniel Stone Date: Thu Nov 30 19:58:16 2006 +0200 bump to 0.9.3 commit 27299b5af820e91c14529f5c3486d1018e99b6c4 Author: Daniel Stone Date: Thu Nov 30 16:10:57 2006 +0200 include stdlib.h for strtod Calling strtod() without including stdlib.h leads to unspecified results. https://launchpad.net/distros/ubuntu/+source/xserver-xorg-video-sis/+bug/56649 commit 115106f042ff5cdad1675c030f0731f0d4559434 Author: Adam Jackson Date: Fri Oct 13 18:43:53 2006 -0400 Bump to 0.9.2 commit 7a38608cd4cae811d12b7424f19af6d732a52f03 Author: Donnie Berkholz Date: Tue Jun 6 16:09:54 2006 +0000 Add missing #include . commit f16c4ee67f57bea639fb3dfab0cf09c4cd981183 Author: Alex Deucher Date: Sun Apr 30 18:17:18 2006 +0000 - fix minor typo commit 7e88ed4b04b993a39edf2a19df34e5f3fb4b10f7 Author: Adam Jackson Date: Sat Apr 8 01:47:22 2006 +0000 Bump to 0.9.1 for Xv changes. commit e7f05c6510a08abdc5e67c8d4b1c6041ea992287 Author: Aaron Plattner Date: Fri Apr 7 23:14:46 2006 +0000 Add a DrawablePtr argument to the XV functions to pave the way for redirected video. commit fe557561f9fd14ac1d44dbb6ecce28e22076ccef Author: Adam Jackson Date: Fri Apr 7 21:05:21 2006 +0000 Unlibcwrap. Bump server version requirement. Bump to 0.9.0. commit 1b851e8180dcb4795b82f28cf1e3c15f6d6210a1 Author: Eric Anholt Date: Fri Apr 7 04:15:34 2006 +0000 Don't forget to zero the xf86ModReqInfo before using it. Noticed by Alex Deucher. commit 7d9999fa8433a9966b55cf0ee0db9d25ef71f535 Author: Eric Anholt Date: Thu Mar 9 06:06:25 2006 +0000 Update drivers that support EXA for the new EXA ABI. This consists of moving all the accel and card members into the driver ptr, filling in the exa_major/ exa_minor fields, and always using LoadSubModule so we can check the module version up front. Only tested on ATI. commit 79bb52873a62dabd02a61ab18b1892cb3772e652 Author: Kevin E Martin Date: Wed Dec 21 02:30:02 2005 +0000 Update package version for X11R7 release. commit ce0bbcb4672c44c15e2c493ed4ac59caedabce9f Author: Adam Jackson Date: Mon Dec 19 16:25:54 2005 +0000 Stub COPYING files commit 6dfa26038c7b35af2a1fd5ee2e8ab7ceb85fd061 Author: Kevin E Martin Date: Thu Dec 15 00:24:19 2005 +0000 Update package version number for final X11R7 release candidate. commit 2c57a2f4c0308ac555d8cd963c9a2dd6bcf73987 Author: Kevin E Martin Date: Tue Dec 6 22:48:37 2005 +0000 Change *man_SOURCES ==> *man_PRE to fix autotools warnings. commit 252f54c2307c143b4621ea34cc014cec67c94a8f Author: Kevin E Martin Date: Sat Dec 3 05:49:35 2005 +0000 Update package version number for X11R7 RC3 release. commit 1b0b4dbcd85ed63cacef9312f3c669be8877db97 Author: Kevin E Martin Date: Fri Dec 2 02:16:10 2005 +0000 Remove extraneous AC_MSG_RESULT. commit b09bab0ff389770010f86d5f1614c6146403353b Author: Adam Jackson Date: Thu Dec 1 20:29:43 2005 +0000 Bug #5207: Enable EXA. (Thomas Winischofer) commit 4fd5c122ea54cad8a1242e1be4aa97b55f556477 Author: Adam Jackson Date: Wed Nov 30 18:51:46 2005 +0000 Bump libdrm dep to 2.0. commit 374156d3cf58ce7690cb2465b18dc28365ba54d0 Author: Adam Jackson Date: Tue Nov 29 23:30:03 2005 +0000 Only build dlloader modules by default. commit 82f9c39f69c7c56e060938836205ad6744b7be39 Author: Alan Coopersmith Date: Mon Nov 28 22:04:10 2005 +0000 Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4 update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir) commit 80bfbc8b3336211b724f252db71e865b7b61be7b Author: Eric Anholt Date: Mon Nov 21 10:49:18 2005 +0000 Add .cvsignores for drivers. commit d59932a8d9d0d8559cbe9a1631f6a26ccba491f9 Author: Kevin E Martin Date: Wed Nov 9 21:31:21 2005 +0000 Bump version numbers for X11R6.9/X11R7 RC2. commit 61a128fb20b54f91680e2e6d2827250eb857a3e5 Author: Kevin E Martin Date: Wed Nov 9 21:15:20 2005 +0000 Update package version number for X11R7 RC2 release. commit 0081e372f6c0990930f8b8d41ef41384af5fc73f Author: Matthias Hopf Date: Wed Nov 9 17:42:58 2005 +0000 Bug #4998: Add ';' and ',' as valid separators for MetaModes as well. commit d7a277fadf8686c5c37cb5ce782a73180bbe8ac3 Author: Kevin E Martin Date: Tue Nov 1 15:08:54 2005 +0000 Update pkgcheck depedencies to work with separate build roots. commit f544e67b005f2b70a27c0f29b782ab11758cf9aa Author: Thomas Winischhofer Date: Tue Nov 1 12:45:54 2005 +0000 SiS driver: Fix EDID->ranges conversion commit c63936bf30c8ce196761a6758ee395e0c65ca679 Author: Thomas Winischhofer Date: Sat Oct 29 10:10:09 2005 +0000 SiS driver: Fix static build commit 634177ea66815843928b292316309ad37b0daf4c Author: Adam Jackson Date: Fri Oct 21 18:40:19 2005 +0000 Bug #4829: Remove some useless DRI symbol checks. commit 8c17b504dabc00744342af45865b5ef4ecba3d84 Author: Kevin E Martin Date: Wed Oct 19 02:48:04 2005 +0000 Update package version number for RC1 release. commit e4d73b86424b72db22bd9e91d43a5e2aad958f18 Author: Alan Coopersmith Date: Tue Oct 18 00:01:54 2005 +0000 Use @DRIVER_MAN_SUFFIX@ instead of $(DRIVER_MAN_SUFFIX) in macro substitutions to work better with BSD make commit 5d201158177e51f171e196148186106282ee5220 Author: Adam Jackson Date: Mon Oct 17 22:57:35 2005 +0000 More 1.7 braindamage: define EXTRA_DIST in terms of @DRIVER_NAME@ instead of indirectly commit be5a30fa3e3c731d69c4003beb28f22f0335e781 Author: Alan Coopersmith Date: Mon Oct 17 00:09:05 2005 +0000 Use sed & cpp to substitute variables in driver man pages commit 5461be0c1969120b3e5f610bc5d8abc2c00259eb Author: Thomas Winischhofer Date: Sun Oct 16 18:12:32 2005 +0000 SiS driver: Fix MIPS linking error commit a8ebd720f7c56ac9181eab1e68d2d2c5a9ac96da Author: Søren Sandmann Pedersen Date: Tue Oct 4 20:01:03 2005 +0000 Check in generated README files commit 60b23a8cd5eefd77b64c84ab4de478420ae58f07 Author: Søren Sandmann Pedersen Date: Mon Oct 3 21:22:08 2005 +0000 - For all drivers that have a .sgml file, add code in their build system to build the README file at make dist time - in util/macros/xorg-macros.m4, add a new XORG_CHECK_LINUXDOC macro that will check if the required tools and files exist, and if so set a conditional. - util/modular/symlink.sh - Link all the .sgml to xf86-video-/README.sgml - Add all the README. to the list of excluded files - xc/programs/Xserver/hw/xfree86/doc/sgml/SiS.sgml: Various changes to make it spew less warnings when the text file is built. commit abd9f7422059b9bb6c2a5bcdb8bca9d21882d3de Author: Thomas Winischhofer Date: Wed Sep 28 23:12:53 2005 +0000 SiS driver: SiS301 supports 1024x768 in Hivision; exclude 512x384 commit bfb25dcbb943995febcbab411d9f93df6d04c8a4 Author: Thomas Winischhofer Date: Fri Sep 23 16:34:04 2005 +0000 SiS driver: Fix Xv in MergedFB mode on SiS760 with hybrid memory commit 27583a4cccbccf5c06b7bdc48b00f638d6c1174f Author: Thomas Winischhofer Date: Wed Sep 21 23:50:13 2005 +0000 SiS driver: Fix a possible crash in case EXA killed our allocated areas commit 0cb78509d1b353512fba4a11fc233ee11eaccd77 Author: Thomas Winischhofer Date: Tue Sep 20 16:38:53 2005 +0000 SiS driver: Remove debug output commit 2b7817e6be3b6befd58bd70a3d8d68eca9a73389 Author: Thomas Winischhofer Date: Tue Sep 20 16:34:32 2005 +0000 SiS driver: Color saturation for newer chipsets commit 9db2013e9c8f55245ed6d33a2dcf34c7f5be0574 Author: Eric Anholt Date: Sun Sep 18 02:32:23 2005 +0000 Break EXA ABI while we still can. Add coordinates to the UploadToScreen hook so we can upload a subset of a pixmap, and convert the current drivers to respect that. Use this support to directly UploadToScreen in exaGlyphs, providing a 47.4% +/-2.4% decrease in wall time for ls -lR programs/Xserver in an antialiased gnome-terminal on an M6 (n=3, caches hot). I would have bumped major version, only I can't tell what the EXA_VERSION_* is supposed to be doing as opposed to the module version. commit 6cf261a522aec729c644e4d4999f7d22860e48a6 Author: Thomas Winischhofer Date: Sat Sep 17 23:07:17 2005 +0000 SiS driver: Improve vertical scaling for TV output on 301C commit a08a3a729bef52a6ae2f969c6d491372e126332f Author: Thomas Winischhofer Date: Fri Sep 16 13:46:39 2005 +0000 SiS driver: Fix dual-pointer issue in dual head mode (really this time) Calculate 4-tap scaler data instead of using tables sisfb: if not loaded, it can't have POSTed cards... commit 1c03c71b29ea4e6d9e2513fe84e9be9cf8f3c19f Author: Thomas Winischhofer Date: Fri Sep 16 00:24:24 2005 +0000 SiS driver: Fixed "double" cursor in dual head mode after mode switch commit eed6bccec235201b17fab39fbb9be962e26128ec Author: Thomas Winischhofer Date: Thu Sep 15 21:23:59 2005 +0000 SiS driver: - Fix (gamma) brightness and add contrast - EXA fixes (Eric Anholt) commit 08c93fc60cd7ec2aede27558f9e853905b87a28b Author: Eric Anholt Date: Wed Sep 14 09:12:17 2005 +0000 Test the right variables for turning on DRI support. commit f6def46f0bc61e5c16f3022b2c4449214384b6a7 Author: Thomas Winischhofer Date: Wed Sep 7 19:44:14 2005 +0000 SiS driver: Make remaining TV modes vertically scalable Add 960x540 for 1080i commit 13335937b6a4d3957d684e5a841f3726001a4619 Author: Thomas Winischhofer Date: Mon Sep 5 14:26:16 2005 +0000 SiS driver: Add support for 576P/625P and 576I/625I YPbPr (HDTV) output Add 720x576 and 768x576 for NTSC TV output commit be4ce634381f347540a241f85b1e6c74eab3ef02 Author: Thomas Winischhofer Date: Fri Sep 2 17:10:36 2005 +0000 SiS driver: Make YPbPr output vertically scalable; improve horizontal scaling commit 8f09b03e8d0d282e87164ed735dc38ac1f44288e Author: Thomas Winischhofer Date: Tue Aug 30 00:12:58 2005 +0000 SiS driver: Fix TV locking issue commit ce2c312e8c9b9ebac5107007242942727b7acf2a Author: Thomas Winischhofer Date: Mon Aug 29 23:27:32 2005 +0000 SiS driver: HDTV fixes commit 569f355e7d1a67a83bee2760bfb67e53446ed3bd Author: Thomas Winischhofer Date: Wed Aug 24 23:15:23 2005 +0000 SiS driver: Additional EXA fixes commit bcb0c36df6d1e98a17549fc3e4425dda37d4aeb7 Author: Eric Anholt Date: Wed Aug 24 22:43:27 2005 +0000 Bugzilla #4090: Introduce getters for pixmap pitch and offset, to simplify/clarify it for driver writers who probably don't want to know what pPixmap->devPrivate.ptr or pPixmap->devKind mean. Converts the sis driver to use them, and bumps the EXA module minor version. commit 9616898015b61535ddf9422bd6eb6f1206a96028 Author: Matthieu Herrb Date: Sun Aug 21 15:25:30 2005 +0000 Build fix for systems with BuildXF86DRI = NO commit ef1e03be0222b300da441decf7914345d207be25 Author: Daniel Stone Date: Thu Aug 18 09:03:49 2005 +0000 Update autogen.sh to one that does objdir != srcdir. commit 533aef9ba51cc3db1cf19ce91007b670e5ba6b21 Author: Thomas Winischhofer Date: Tue Aug 16 22:17:01 2005 +0000 SiS driver: My version number commit c11eed9f742e1599f7e120c211a3434e45653c88 Author: Thomas Winischhofer Date: Tue Aug 16 22:08:50 2005 +0000 Hm, might have forgotten the headers commit 8a7568031b5641c0437ba24ae9a2fa80af95d64b Author: Thomas Winischhofer Date: Tue Aug 16 22:06:59 2005 +0000 SiS driver: Fix small glitch in mode switching for 302LV bridge commit 1b66e83ad6316ce383b60cc91d0a503709e252ed Author: Alan Hourihane Date: Mon Aug 15 07:30:05 2005 +0000 Egbert's 64bit fixes for mixed 32/64bit clients commit 50de2d7e58f20936af579cfde5e96f4a4b98a4df Author: Eric Anholt Date: Sun Aug 14 19:46:55 2005 +0000 - Fix the exa pixmap offset/pitch alignment to deal with non-POT alignment requirements. MGA, notably, uses a multiple of 3 in some cases. - Rename the pixmap offset/pitch alignment fields to more clearly state their meaning. commit ad62f278ffd4bdd80c862ca9066165bde8183f9b Author: Thomas Winischhofer Date: Thu Aug 11 12:59:18 2005 +0000 SiS driver: ARGH.... search/replace stupidity commit c018df356027d79324aacf7731c398bb2d40676f Author: Thomas Winischhofer Date: Thu Aug 11 12:57:12 2005 +0000 SiS driver: Rename BUFSIZ to something else to avoid confusion with stdio's BUFSIZ commit 102ff29c6aa8765fdc823a1c7a1c82d273f2f7a7 Author: Thomas Winischhofer Date: Mon Aug 8 11:40:36 2005 +0000 SiS driver: Add some convenience for SiSCtrl commit bbf8a8e8dbef247b4f8d42c527b83d0b0bad61bf Author: Adam Jackson Date: Sun Jul 31 17:19:29 2005 +0000 Post-merge fixups: - Disable building the gamma driver - Fix numerous Imakefiles to get header paths and subdirs right - Symlink client-side GLX lib source from Mesa - Add new shader subdirs to the Mesa core build - Tweak the DDX drivers to not ask for "xf86dri.h"; they don't need it, since they don't generate protocol, and it was breaking the build. commit 5567e32b617bbaac92286b67f8c504385a34958b Author: Kevin E Martin Date: Fri Jul 29 21:22:44 2005 +0000 Various changes preparing packages for RC0: - Verify and update package version numbers as needed - Implement versioning scheme - Change bug address to point to bugzilla bug entry form - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to reenable it) - Fix makedepend to use pkgconfig and pass distcheck - Update build script to build macros first - Update modular Xorg version commit abd40577c5af78078c1342242b9e4af4c79329a6 Author: Søren Sandmann Pedersen Date: Wed Jul 27 21:23:29 2005 +0000 Add xf86driproto to dependencies for drivers with DRI support. Patch from Donnie Berkholz commit 183bef925915e3e918fcbf12fac17db73bb55bab Author: Søren Sandmann Pedersen Date: Tue Jul 26 22:25:09 2005 +0000 Tue Jul 26 18:24:45 2005 Søren Sandmann Include instead of "X.h" commit c8836bb0f42e38bd896b062fb1abb2663af4f59e Author: Søren Sandmann Pedersen Date: Tue Jul 26 22:24:10 2005 +0000 Build system for sis commit 5be938441d8c42bd57b68d6759e25b0e25659988 Author: Thomas Winischhofer Date: Tue Jul 19 23:31:49 2005 +0000 SiS driver: Some fixes for multiple cards. Small fix for mode switching on newer machines. Prepare for Dave's PCI cleanup. commit 1d4febacb8f831d540470622289149088799dd54 Author: Thomas Winischhofer Date: Mon Jul 18 21:00:57 2005 +0000 SiS driver: Fix xv offscreen memory allocation for Xv etc. commit 73fbbff220d196e173c8da4b81bbe1bf3bf0dccb Author: Thomas Winischhofer Date: Fri Jul 15 15:35:18 2005 +0000 SiS driver: Minor fixes commit e1915b0015c10bfdbf72aa6f1ccbe25a92a628a6 Author: Thomas Winischhofer Date: Wed Jul 13 17:17:00 2005 +0000 SiS driver: Some minor fixes (mainly for XGI) commit 22885ed4d5f8da3db4a1fe99dd9f9d4f7da1592b Author: Adam Jackson Date: Mon Jul 11 02:29:59 2005 +0000 Prep for modular builds by adding guarded #include "config.h" everywhere. commit fe03307e6ab31ab7e05074da7429ccfa355e83af Author: Thomas Winischhofer Date: Fri Jul 8 16:32:14 2005 +0000 SiS driver: Clean up VBFlags mess, part 2 commit e4491adfaec96ba07915b23aa331b1003463f974 Author: Thomas Winischhofer Date: Fri Jul 8 15:31:53 2005 +0000 SiS driver: Clean up VBFlags mess commit 9a7d20ffb18915a4f5c6252eac6942932d91bcc7 Author: Thomas Winischhofer Date: Thu Jul 7 00:46:09 2005 +0000 SiS driver: Distinguish between XGI V3XT A01 and A02 boards commit 9e4d62bad9627bd40e184a29953a3956939a3f5c Author: Thomas Winischhofer Date: Wed Jul 6 14:58:42 2005 +0000 Doc update commit 5d40b107007537d71917767c18b796dfcc6b8138 Author: Thomas Winischhofer Date: Wed Jul 6 10:49:01 2005 +0000 SiS driver: Use a reasonable MaxXFBMem setting if the user didn't supply one. (Closes #2098, #2783) commit 1f9a85f42971ec674ff805773f340d9bf7f18c90 Author: Thomas Winischhofer Date: Tue Jul 5 17:32:05 2005 +0000 SiS driver: Sanitize log output commit 8c1c7fe9124b9dd0bc64a37ac02c08fbf359ebe8 Author: Thomas Winischhofer Date: Tue Jul 5 14:00:53 2005 +0000 SiS driver: Another update of the manpage commit 1fbbaec0415a7ebde1d99ff82f27b524f8487200 Author: Thomas Winischhofer Date: Tue Jul 5 13:49:15 2005 +0000 SiS driver: Remove debug output from previous commit which also fixed the PCI device probing/initialisation for using SiS and XGI cards at the same time. commit afc2bfcc4fddece54b32f9b837ee1d7d0f89cc76 Author: Thomas Winischhofer Date: Tue Jul 5 13:45:40 2005 +0000 SiS driver: Update driver date commit 4b4121955fe91c07ce905cab01598ec3b86e5df3 Author: Thomas Winischhofer Date: Tue Jul 5 13:43:28 2005 +0000 SiS driver: Fix for mode-restoring if more than one cards are used. (Don't read/write BIOS scratch area of non-primary cards) commit 6597121283a951a63f5b65f5a545da2a860c09b9 Author: Thomas Winischhofer Date: Tue Jul 5 13:09:54 2005 +0000 SiS driver: Fixes for XGI Z7 (No Xv, no ARGB cursors, lower dotclock) commit 66b8354a10ef73a07c3ebb4c5358b6333167a187 Author: Thomas Winischhofer Date: Mon Jul 4 17:36:07 2005 +0000 SiS driver: Sync accel before UploadTo/DownloadFromScreen commit 286dc28ce8db8f787c1ed67f0ef4b82c74c9ae8d Author: Thomas Winischhofer Date: Mon Jul 4 15:45:11 2005 +0000 SiS driver: Some further small fixes for XGI commit f834d1f1af7e2cf511f8a5e7c55587a6af6144f1 Author: Thomas Winischhofer Date: Mon Jul 4 14:42:37 2005 +0000 SiS driver: Fixes for XGI Z7 commit 5fd45266fe40c70406f07b3ac6d84900b9b6679c Author: Thomas Winischhofer Date: Mon Jul 4 12:24:55 2005 +0000 SiS driver: Update manpage commit 76ced1d6167c231e5afd743fc67fbc91dcb8c5e5 Author: Thomas Winischhofer Date: Mon Jul 4 12:07:07 2005 +0000 SiS driver: Some small additions/fixes commit c8abdb74f9ac272d6ea6c6e7c037c55875fda065 Author: Thomas Winischhofer Date: Mon Jul 4 10:57:08 2005 +0000 SiS driver: - Added initial support for XGI chipsets (V3XT, V5, V8, Z7). Z7 and V5 are untested. All features supported (Xv, HWCursor, DPMS, etc.). The binary XGI DRI driver is not supported. - Ported driver to EXA 0.1.0. Known problems still to solve at this time are: EXA's deinitialisation routine "DriverFini()" does not unwrap pScreen->DestroyPixmap (and others), leading to a crash on machines where the SWCursor is being used (SWCursor pixmaps are destroyed after EXA has destroyed the offscreen memory manager). EXA does not work correctly with 24bpp framebuffers. For some reason, all pixmaps handed to the drawing primitives are 32bpp, despite the correct 24bpp-flag handed to xf86SetDepthBpp(). commit 1db609b22e77b09a132bbc7e94256a7edfa592b3 Author: Daniel Stone Date: Fri Jul 1 22:43:13 2005 +0000 Change all misc.h and os.h references to . commit 9edddc6e948eda5b3045bceac8f9a741dccfdea6 Author: Thomas Winischhofer Date: Wed Jun 29 23:06:12 2005 +0000 SiS driver: Missing declaration commit 8e36e074e6bf10ad3c8e4c72f364390cccafb7c4 Author: Thomas Winischhofer Date: Wed Jun 29 22:35:58 2005 +0000 SIS driver: Small fix for non-rectangular MergedFB layouts commit f13a87835401edd7800615457cf6ed37cf992021 Author: Thomas Winischhofer Date: Wed Jun 29 22:11:28 2005 +0000 SiS driver: Make >=6.9 stuff work with >=6.8.99.13 commit 0b4aa8f28a8490ce6be45577cbfd1ae592327cb3 Author: Thomas Winischhofer Date: Mon Jun 27 17:18:06 2005 +0000 SiS driver: Some further small fixes commit 705433d3d2bd2cc4ab824a88c1f98132631f8665 Author: Thomas Winischhofer Date: Mon Jun 27 15:56:53 2005 +0000 SiS driver: - Fix 512x384 TV/PAL mode - Major code cleanup commit c0691e73cf0020e7e1486f8c064205c44ac58fa9 Author: Adam Jackson Date: Sat Jun 25 21:16:56 2005 +0000 Bug #3626: _X_EXPORT tags for video and input drivers. commit 100eac71b853150bb88d7f06fd5fb777f7f78032 Author: Thomas Winischhofer Date: Tue Jun 21 11:18:51 2005 +0000 SiS driver: Add support for 1280x854 panels Fix Xv for 300 series to support a width of 768 (prev. 720) commit 89d489c67ca63c2397789e227e35e5886721df13 Author: Adam Jackson Date: Wed May 18 17:47:36 2005 +0000 Bug #3163: Create new DRIINFO_*_VERSION macros to indicate the version number of the DRIInfoRec, disambiguating it from the XF86DRI protocol version number. Modify DRIQueryVersion to return the libdri version number, which all DDXes were requesting implicitly. Fix the DDXes to check for the DRIINFO version they were compiled against. commit 0fec79e5d207ae114f5fc60d98841d6a33615bc9 Author: Thomas Winischhofer Date: Thu Apr 21 21:45:36 2005 +0000 SiS driver: - Favour MMX2 over SSE as memcpy() method when benchmark is impossible commit 45590c76ac23e6a854c580fbf30fba4cd3d9aae7 Author: Thomas Winischhofer Date: Thu Apr 21 21:30:56 2005 +0000 SiS driver: - Add SISCTRL extension - Xv interface for SiSCtrl is now deprecated (will be removed soon) - Remove useless GammaPreBrightness feature - Fix LCD+TV mode for dual link panels - Add support for LCD-via-CRT1 for 315PRO - Add "TVBlueWorkAround" option - Various minor fixes commit 2c42d13b63f6798cf4d01e6e556b02169bacabb4 Author: Daniel Stone Date: Wed Apr 20 12:25:29 2005 +0000 Fix includes right throughout the Xserver tree: change "foo.h" to for core headers, e.g. X.h, Xpoll.h; change "foo.h", "extensions/foo.h" and "X11/foo.h" to for extension headers, e.g. Xv.h; change "foo.[ch]" to for Xtrans files. commit 2d51792a3cf3f4f87d596aba78f8dacc5b62254a Author: Thomas Winischhofer Date: Fri Mar 11 14:39:48 2005 +0000 SiS driver: - MergedFB/Xinerama: Added support for non-rectangular layouts (no panning into dead areas, mouse restriced to accessible areas) - MergedFB/Xinerama: Added support for RandR. Current window managers are smart enough to update their Xinerama-info on RandR events. This practically allows switching from dual-head operation to single-head operation (by switching to a clone mode and simultaniously resizing the desktop) and vice versa. - MergedFB: Improved "physical alignment compensation" Offset by disallowing panning and mouse movements into dead areas. (However, RandR is disabled if that Offset is used.) - MergedFB: Made identically looking MetaModes work with RandR. (by supplying a fake rate.) - Added "Reflect" feature: Reflect screen in x, y or x+y direction (Uses shadow framebuffer; no accel, no Xv, no HWCursor.) - Added aspect ratio detection for analog (VGA) devices. Produces different default modes for 800x480, 1024x576, 1280x720, 1280x768 and 1280x800 depending on the aspect ratio. Options exist to overrule this for each output device. - Fixed FSTN support on SiS55x (for 320x240 xSTN panels) - Workaround for SiS76x memory access latency issues if no local framebuffer memory is present. Driver now allows only one video overlay and assumes a quite restricted memory bandwidth. This chip is really crippled. / If in hybrid mode, the driver only uses the LFB memory (required changes in the video memory layout) - Minor fix for machines with Trumpion Zurac LVDS scalers. - Fixed bug in SaveScreen() causing a sig 11 sometimes. - Added screen blanking for TV output - Added two widescreen modes for PAL/NTSC TV output - Numerous minor fixes and clean-ups. - Numerous whitespace cleanups. Sorry for the noise. commit 291fc2d3ae3112b8f5d8a3836446da17d496b58c Author: Thomas Winischhofer Date: Mon Feb 14 19:07:41 2005 +0000 Build fix for non-gcc compilers commit 102152c143e1553431fcee8c7c37602fad617e30 Author: Thomas Winischhofer Date: Mon Jan 31 23:37:02 2005 +0000 SiS driver: Fix fast memcpy() for AMD64; fix mode restoring on AMD64 commit a9decf9003afacc661ce7a08e1a534cbc1f2eea6 Author: Thomas Winischhofer Date: Tue Jan 25 16:14:01 2005 +0000 SiS driver: Update manpage commit 5466b280021e22c24780f4c3e4560c5045c29118 Author: Thomas Winischhofer Date: Tue Jan 25 15:00:20 2005 +0000 Copy/paste error commit 5a253b1f4f639b8a49d9458e44af63e58c5a7965 Author: Thomas Winischhofer Date: Wed Jan 19 16:19:40 2005 +0000 SiS driver: - Fix off-by-one error in setting up offscreen-images - Fix for retrieval of mode timing from BIOS for LCD - Fix for DGA in MergedFB mode - Code size reduction by more calculations, less tables - ShadowFB uses fast memcpy (correctly) now - Prefer user given modes over default ones - Add ForcePanelRGB option commit 4f3671640befe65334ebdfa5aef4bc2716f0aa61 Author: Thomas Winischhofer Date: Mon Dec 6 15:58:20 2004 +0000 SiS driver: - Fix for 1600x1200 LCD panels - Fix DGA in MergedFB mode commit 6ef9f9d26ae21f074055333d25689272c8299cd7 Author: Thomas Winischhofer Date: Fri Dec 3 15:57:59 2004 +0000 SiS driver: - Clean up option handling - Add separate gamma correction/brightness for CRT2 - Add "offset" for MergedFB mode for allowing non-rectangular desktops - Clean up and fix a off-by-one error in CRTC programming (old series) - Fix low-resolution (xres <= 512) and doublescan user modes for CRT2 commit c1031b87580a7d5d1babfebdf07842635d4b3195 Author: Thomas Winischhofer Date: Thu Nov 25 15:29:37 2004 +0000 SiS driver: Clarify log in MergedFB mode commit b41edc0ad1ecd95fc6c0a52d4ab0edb55ae4d323 Author: Thomas Winischhofer Date: Wed Nov 24 01:05:02 2004 +0000 SiS driver: Renamed options "XvBenchmarkMemcpy" to "BenchmarkMemcpy" and "XvSSECopy" to "UseSSE". Fix crash on machines with two or more physical SiS cards. Enhanced logic to overrule monitor timings. Make driver independent of vgaHW module. Use /dev/port instead of inX/outX on ARM and MIPS (untested yet). Fix SiS301 panel misdetection (due to very old, buggy BIOS). Clean up. commit 08079cea18f5ba79f6aaf6e7312e50120b1ae648 Author: Matthieu Herrb Date: Sun Nov 7 17:18:41 2004 +0000 build fix for static server commit 128cf1448f44214acf01e20c1e517dfc6fe2959e Author: Thomas Winischhofer Date: Fri Nov 5 09:28:42 2004 +0000 SiS driver: Reverse log-verbosity logic at output device detection commit 39ded003ab27112e3d8152a57fc96a49549e7854 Author: Thomas Winischhofer Date: Thu Nov 4 14:39:56 2004 +0000 SiS driver: Warning fix commit 2619e2709b6be7f7340b055f8c99a360f31e250f Author: Thomas Winischhofer Date: Thu Nov 4 11:50:40 2004 +0000 SiS driver: Fix compilation on non-x86 platforms (#1780) Separate CPU detection from memcpy() benchmark Initialize FB memory manager regardless of NoAccel commit 86846ea06b512a352a6215b3559a01bee37dbc2e Author: Thomas Winischhofer Date: Fri Oct 29 13:16:28 2004 +0000 SiS driver: Change 6.8.2 conditions to 6.9.0 commit 7c39b4436b874cc1fd401c2387d41d3290963cf1 Author: Thomas Winischhofer Date: Fri Oct 29 10:44:26 2004 +0000 SiS driver: Fix XvSSEMemcpy option handling for <6.8.2 commit c7737cae58cdbfc9578100c4be8e2411caba1b46 Author: Thomas Winischhofer Date: Fri Oct 29 10:38:47 2004 +0000 SIS driver: Fix compilation for pre-6.8.2 commit 43f68e100d126c8cc9c78bbacd60e4e9c9452dc3 Author: Thomas Winischhofer Date: Fri Oct 29 10:35:16 2004 +0000 SiS driver: Fix compilation with -fPIC; implement sane OS check for SSE support. commit 64bfe79b6af999994063a65199cb971044f2df7e Author: Thomas Winischhofer Date: Fri Oct 29 00:24:56 2004 +0000 SiS driver: Fix memcpy() acceleration for AMD Duron CPUs (which do not support SSE; falsely executed an SSE instruction if only mmxext is supported by the CPU) TODO: Fix OS check for SSE instructions. Need to find a way to install a signal handler for SIGILL since that stupid xf86sighandler plainly "return"s and causes an immediate second SIGILL as the "return" returns to the illegal instruction itself. commit e78fcc7a7c48a725db5c6ff149e1ea1d56aa6e21 Author: Thomas Winischhofer Date: Thu Oct 28 22:14:59 2004 +0000 SiS driver: Clean up; remove unneccessary register writes in Xv code; add gamma brightness features. commit b69ddb60c9304eb9ed40ae60a5441ea72378751b Author: Thomas Winischhofer Date: Wed Oct 27 14:31:45 2004 +0000 SiS driver: Enhanced memcpy() stuff; added optimized memcpy() for AMD64 (AMD64 code is entirely untested yet - anybody?) commit 19e825ebc821fcb5f08d702f6ec1cb33c091bacf Author: Thomas Winischhofer Date: Fri Oct 22 00:09:43 2004 +0000 SiS driver: Another fix for asm memcpy() commit 0c2896f826eaddf6ff51555d1a51c52fbc4e4b65 Author: Thomas Winischhofer Date: Thu Oct 21 23:49:58 2004 +0000 SiS driver: Fix for asm memcpy commit ac38a1285425c7146886c1f26d2d920c7ead4925 Author: Thomas Winischhofer Date: Thu Oct 21 23:41:14 2004 +0000 SiS driver: Add sis_memcpy.c commit 5170023bcf698192b2dc92402168c47fff9ef8dc Author: Thomas Winischhofer Date: Thu Oct 21 23:36:13 2004 +0000 SiS driver: Add assembler memcpy() routines for Xv commit f27d162b322707c6d2546b1aacffcec8e1637c4d Author: Thomas Winischhofer Date: Fri Oct 15 17:47:55 2004 +0000 SiS driver: MergedFB mode fix/enhancement: - Make merged modes look really different for vidmod ext (by providing a fake dotclock) - Add "+"-notation for clone modes; used instead of "-" if two different modes are to be merged for cloning. commit 4c5d71a3b62eea258051dfcf7ca1cad2a1978b10 Author: Thomas Winischhofer Date: Wed Oct 13 18:14:07 2004 +0000 SiS driver: Fix false comment commit 46d0b00694b350740189ae4dbec35b419868ac4e Author: Thomas Winischhofer Date: Wed Oct 13 18:08:12 2004 +0000 SiS driver: - Update driver date - Add support for Panasonic AE700 projector (1280x720 50/60Hz native modes for HDMI/DVI-D (why don't these stupid devices propagate these modes in their EDID?!) commit e311b3b1c95530fc51d65d8260525b0c561c3b28 Author: Thomas Winischhofer Date: Wed Oct 13 18:00:37 2004 +0000 SiS driver: Fix VB PRG CLK for actually released pre-released BIOSes for 661 series. commit 5887d36e9d511332404c15e427e85e8723763041 Author: Thomas Winischhofer Date: Sat Oct 2 11:22:29 2004 +0000 SiS driver: Loosen DDC-check and don't bail out if devices wrongly report being "non-RGB-multicolor" type. (For Panasonic AE500 projector and some DVI-to-VGA adaptors) commit 1429e451ec91ce01d6969ace30ebe3047ad9cf29 Author: Adam Jackson Date: Wed Sep 22 04:38:03 2004 +0000 Bug #1252, #1253, #1255, #1256: Various typo fixes from Dave Jones. commit 1b6d87873247f252c1e656ad3bba44d460c25497 Author: Kevin E Martin Date: Fri Aug 20 18:57:06 2004 +0000 Support for Sis 1280x800 panels (Bug #1139, Thomas Winischhofer). commit b94ee52295375ff43d5e12469e2aad86c678328b Author: Thomas Winischhofer Date: Sat Aug 14 15:35:49 2004 +0000 SiS driver: Additional bytes->pixel conversions for AllocateLinear commit 55215274191df6baedb199e580e2fadf66ebd0c4 Author: Thomas Winischhofer Date: Sat Aug 14 15:26:51 2004 +0000 SiS driver: - RENDER acceleration now supports more PictOps (Clear, Src, Dst) - Linear offscreen manager counts in PIXELS, not BYTES - fix video code not to allocate too much - Kill compiler warning for DRI commit 9d509f63ee3c048a25a7d72790c93f314bc09373 Author: Thomas Winischhofer Date: Thu Aug 12 12:59:25 2004 +0000 SiS driver: Add 960x600 as built-in mode (1080i, LCD, VGA) commit 5a5956a8b9ff9ed1c285f152cdb4c0fe4ef117a5 Author: Thomas Winischhofer Date: Wed Aug 11 19:01:33 2004 +0000 SiS driver: Remove unneeded statement commit 32f31c8443272db98d82743708d3f22213ec1926 Author: Thomas Winischhofer Date: Wed Aug 11 18:54:36 2004 +0000 SiS driver: Adapt mode numbers to new BIOS scheme and provide translation commit 813ad3aea67f8d7816fd2cbddc832908a6b7105d Author: Thomas Winischhofer Date: Wed Aug 11 00:45:43 2004 +0000 SiS driver: - Small fix for 1280x720 on larger panels - Small fix for built-in modes on non-standard panels commit 7266df7537cf2132145605404ebcdc5dad3aa77b Author: Thomas Winischhofer Date: Tue Aug 10 22:49:42 2004 +0000 SiS driver: Additional fixes for LCD commit 1a5d711d1ef175bcda964ee37829b6ca63a3c8d7 Author: Thomas Winischhofer Date: Tue Aug 10 21:57:20 2004 +0000 SiS driver: - update timing for 1280x800, 1280x720 and 1280x768 panels - allow more modes for LCD (just don't scale them if we can't) - cleanup commit 079bf141c47ddcf7226807ef1b60670c2e9b843e Author: Thomas Winischhofer Date: Mon Aug 9 13:55:06 2004 +0000 SiS driver: - Add support for UMC-made video bridges - Add support for centering screen on non-standard panels commit 69289fc61ece99106d893de4ccd0137c46043046 Author: Thomas Winischhofer Date: Sat Aug 7 18:05:05 2004 +0000 SiS driver: Warning fix commit 169822a2d23e30c2230b0fec9f12d9e7f56eb282 Author: Thomas Winischhofer Date: Fri Aug 6 13:08:21 2004 +0000 SiS driver: - Clean up version printing commit b36c10f803e0be73689b6dae08ca3c7d96fac4ec Author: Thomas Winischhofer Date: Fri Aug 6 08:52:07 2004 +0000 SiS driver: - enable new RENDER code (despite the X.org version number for now) commit 4fe1e616a285ad9dddc35c08903e87f2d16f89d1 Author: Thomas Winischhofer Date: Thu Aug 5 15:35:30 2004 +0000 SiS driver: - warning fixes for SunOS cc - documentation update commit c22f737fd67ca47b8a51cbe6bfa74ffad1d7ebd8 Author: Thomas Winischhofer Date: Wed Aug 4 15:46:34 2004 +0000 SiS driver: - Adapt to new RENDER hooks (will be used if X.org version is > 6.7.0.0) - Use drmCommandWrite instead of compat-layer if drmWriteCommend exists - Unify driver after changes for dlloader commit c7bcee0dc08d56af4b9e42a184686ef1710bfc10 Author: Adam Jackson Date: Fri Jul 30 20:30:54 2004 +0000 Bug #400 (partial): Driver fixes for the dlloader. When using dlloader, all framebuffer formats except cfb and the overlay modes should work, and r128 and radeon need to be loaded from the ati driver (both issues to be fixed soon). Tested on i740, s3virge, mach64, tdfx, vesa, and vga drivers. elfloader users shouldn't be affected. commit 725276d251ef0e27307dd1b865c8d3cb7393f104 Author: Thomas Winischhofer Date: Mon Jul 26 22:40:56 2004 +0000 SiS driver: Fix for 650/740 new BIOS data layout commit 4b2c04c9f18eae06919d0096dfa70ac234a6a61a Author: Thomas Winischhofer Date: Wed Jul 7 21:14:45 2004 +0000 SiS driver, vacation time edition: - Overrule bogus HSync/VRefresh ranges for LCD and TV - Fix for videobridgeless systems commit 1d8c6bd12b70f49cbb4944194c14b94d1dc42c05 Author: Thomas Winischhofer Date: Tue Jun 29 10:09:58 2004 +0000 SiS driver: - Fix detection of non-standard panels - Support Sanyo PLV-Z2 in non-HDCP mode - Rework mode validation (map unsupported modes for TV to modes with same resolution) commit f112c72223b4964b0f8f2a510e323fee55742d3e Author: Thomas Winischhofer Date: Wed Jun 23 21:35:45 2004 +0000 SiS driver: - Use sane HSync/VRefresh ranges for LCD and TV if the user didn't specify any in xorg.conf - Use PAL by default of TV output forced (and TV not detected) commit a8ea3115164f845246e9b3f935238499b1b62531 Author: Thomas Winischhofer Date: Mon Jun 21 00:38:20 2004 +0000 SiS driver: Fix LCD support for ECS 90x; Work-around broken BIOS reporting wrong LCD size. commit 870c22fd4254ee5623dbf82289d1e03edf609bb7 Author: Thomas Winischhofer Date: Thu Jun 17 16:33:26 2004 +0000 Load glx module automatically if DRI is enabled Make DRI wrapper compile on older versions, too Bump driver version to correct date commit ff1eae67139b7a815ea3d13847d59d04236b3b10 Author: Thomas Winischhofer Date: Thu Jun 17 14:25:51 2004 +0000 Add missed DRI change commit 515b943c4413e15d368ed9b585dbf3cec7c4db5d Author: Thomas Winischhofer Date: Thu Jun 17 13:20:14 2004 +0000 SiS driver update 2004/06/17 commit dccd124b50c6d6e8dd29278b87c4ae9d14ae678a Author: Eric Anholt Date: Wed Jun 16 09:44:00 2004 +0000 Merge DRI-trunk-20040613 changes in programs/Xserver/hw/xfree86/drivers, with the following notes: - Savage and Mach64 (= ati/ati*.[ch] changes) DRI not merged due to insecurity. - VIA driver converted to new drmContext and drmHandle names. - Radeon driver merge conflicted in many places, and MergedFB at least could probably use some checking at this point. commit ad305d6d4414b860c7caf1650d046a71aed7766f Author: Eric Anholt Date: Wed Jun 16 09:27:09 2004 +0000 DRI trunk-20040613 import commit 5880d0f36b7f79b650ff56914db769327fb38cc9 Author: Eric Anholt Date: Wed Jun 16 09:23:54 2004 +0000 DRI XFree86-4_3_99_12-merge import commit 2a8d0bc1b050224139cf787946d2e433481b2e17 Author: Egbert Eich Date: Fri Apr 23 19:45:40 2004 +0000 Merging XORG-CURRENT into trunk commit 36986a29abd7777a7f5aed82c8a5a277c33c456e Author: Egbert Eich Date: Sun Mar 14 08:33:36 2004 +0000 Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 commit edfb01cf07a716123a4969c2532d64bd7e381472 Author: Egbert Eich Date: Wed Mar 3 12:12:25 2004 +0000 Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 commit 07d847169b5a54e459b42679e989af5eb6a5973d Author: Egbert Eich Date: Thu Feb 26 13:35:55 2004 +0000 readding XFree86's cvs IDs commit a2b4d6323e7e72857ba17d28eece772135635d34 Author: Egbert Eich Date: Thu Feb 26 09:23:24 2004 +0000 Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 commit bb935a32bb5c9d0dd01be3b93decfdbcb2e0ab21 Author: Kaleb Keithley Date: Mon Feb 23 20:35:11 2004 +0000 Import most of XFree86 4.4RC3. This import excludes files which have the new license. If we want to, later we can import 4.4RC3 again and pick up the files that have the new license, but for now the vendor branch is "pure." commit 10c83bf291a62e9b14699dc2f158a30fbe2d1b2d Author: Egbert Eich Date: Thu Jan 29 08:08:37 2004 +0000 Importing vendor version xf86-012804-2330 on Thu Jan 29 00:06:33 PST 2004 commit 546c4f291a92b5b5b7812196b0a4dc44ce5e7ddb Author: Kaleb Keithley Date: Fri Dec 19 20:55:16 2003 +0000 XFree86 4.3.99.902 (RC 2) commit ebde9d1780cc6bb9307fa6639246764262738696 Author: Kaleb Keithley Date: Thu Dec 4 22:03:25 2003 +0000 XFree86 4.3.99.901 (RC 1) commit abe805c8c549fc02efebcfbbfa30ef69c4690b89 Author: Kaleb Keithley Date: Tue Nov 25 19:28:40 2003 +0000 XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks commit 4a0967d910ff0c18285dd01cc0409a51ace0e6c4 Author: Kaleb Keithley Date: Tue Nov 25 19:28:39 2003 +0000 Initial revision commit 3eb5a12d4f37e6262b7e20a85e4620ed1d01efd8 Author: Kaleb Keithley Date: Fri Nov 14 16:48:55 2003 +0000 XFree86 4.3.0.1 commit d1473b7bcf205215781d461eb62f8dba0fb78931 Author: Kaleb Keithley Date: Fri Nov 14 16:48:55 2003 +0000 Initial revision commit 727bfe5d006d0e5c0167c2472af9d8ba69c9e109 Author: Kaleb Keithley Date: Fri Nov 14 15:54:49 2003 +0000 R6.6 is the Xorg base-line xf86-video-sis-0.10.7/COPYING0000664000076400007640000001662211763612170012273 00000000000000Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3) The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright (C) 1998, 1999 by Alan Hourihane, Wigan, England. Parts Copyright (C) 2001-2005 Thomas Winischhofer, Vienna, Austria. Licensed under the following terms: Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and and that the name of the copyright holder not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The copyright holder makes no representations about the suitability of this software for any purpose. It is provided "as is" without expressed or implied warranty. THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Copyright (C) 2003 Eric Anholt Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and and that the name of the copyright holder not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The copyright holder makes no representations about the suitability of this software for any purpose. It is provided "as is" without expressed or implied warranty. THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Copyright (C) 2000 by Alan Hourihane, Sychdyn, North Wales, UK. Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria Portions from radeon_dga.c which is Copyright 2000 ATI Technologies Inc., Markham, Ontario, and VA Linux Systems Inc., Fremont, California. Licensed under the following terms: Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the providers not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The providers make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE PROVIDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE PROVIDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 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. Copyright (C) 1999-2004 by The XFree86 Project, Inc. based on code written by Mark Vojkovich Copyright (C) 2003-2005 Thomas Winischhofer Licensed under the following terms: Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and and that the name of the copyright holder not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The copyright holder makes no representations about the suitability of this software for any purpose. It is provided "as is" without expressed or implied warranty. THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. xf86-video-sis-0.10.7/config.h.in0000664000076400007640000000412612001203066013241 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ #include "xorg-server.h" /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_XAA_H /* xextproto 7.1 available */ #undef HAVE_XEXTPROTO_71 /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Major version of this package */ #undef PACKAGE_VERSION_MAJOR /* Minor version of this package */ #undef PACKAGE_VERSION_MINOR /* Patch version of this package */ #undef PACKAGE_VERSION_PATCHLEVEL /* Enable DRI driver support */ #undef SISDRI /* Enable developmental DRI driver support */ #undef SISDRI_DEVEL /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Build support for Exa */ #undef XF86EXA xf86-video-sis-0.10.7/install-sh0000755000076400007640000003325611763612270013245 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xf86-video-sis-0.10.7/Makefile.am0000664000076400007640000000241611763612170013270 00000000000000# Copyright 2005 Adam Jackson. # # 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 # on the rights to use, copy, modify, merge, publish, distribute, sub # license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON 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. SUBDIRS = src man MAINTAINERCLEANFILES = ChangeLog INSTALL .PHONY: ChangeLog INSTALL INSTALL: $(INSTALL_CMD) ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL xf86-video-sis-0.10.7/man/0000775000076400007640000000000012001203066012046 500000000000000xf86-video-sis-0.10.7/man/sis.man0000664000076400007640000003550611763612170013310 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH SIS __drivermansuffix__ __vendorversion__ .SH NAME sis \- SiS and XGI video driver .SH SYNOPSIS .nf .B "Section \*qDevice\*q" .BI " Identifier \*q" devname \*q .B " Driver \*qsis\*q" \ \ ... .B EndSection .fi .SH DESCRIPTION .B sis is an __xservername__ driver for SiS (Silicon Integrated Systems) and XGI video chips. The driver is accelerated and provides support for colordepths of 8, 16 and 24 bpp. XVideo, Render and other extensions are supported as well. .SH SUPPORTED HARDWARE The .B sis driver supports PCI, AGP and PCIe video cards based on the following chipsets: .PP .B SiS5597/5598 .B SiS530/620 .B SiS6326/AGP/DVD .B SiS300/305 .B SiS540 .B SiS630/730 .B SiS315/E/H/PRO .B SiS550/551/552 .B SiS650/651/661/741 .B SiS330 (Xabre) .B SiS760/761 .B XGI Volari V3/V5/V8 .B XGI Volari Z7 .PP In the following text, the following terms are used: .PP .B old series for SiS5597/5598, 530/620 and 6326/AGP/DVD .PP .B 300 series for SiS300/305, 540 and 630/730 .PP .B 315/330/340 series for SiS315, 55x, 330, 661/741/76x (plus M, FX, MX, GX variants thereof), 340 and all XGI chips. .PP .SH CONFIGURATION DETAILS Please refer to __xconfigfile__(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this driver. .PP Detailed information on all supported options can be obtained at http://www.winischhofer.eu/linuxsisvga.shtml .PP This manpage only covers a subset of the supported options. .PP .I "1. For all supported chipsets" .PP The following driver .B options are supported on all chipsets: .TP .BI "Option \*qNoAccel\*q \*q" boolean \*q Disable or enable 2D acceleration. Default: acceleration is enabled. .TP .BI "Option \*qHWCursor\*q \*q" boolean \*q Enable or disable the HW cursor. Default: HWCursor is on. .TP .BI "Option \*qSWCursor\*q \*q" boolean \*q The opposite of HWCursor. Default: SWCursor is off. .TP .BI "Option \*qRotate\*q \*q" string \*q Rotate the display clockwise ("CW") or counter-clockwise ("CCW"). This mode is unaccelerated. Using this option disables XVideo and the Resize and Rotate extension (RandR). Rotation and reflection (see below) are mutually exclusive. Default: no rotation. .TP .BI "Option \*qReflect\*q \*q" string \*q Reflect (mirror) the display horizontally ("X"), vertically ("Y") or both ("XY"). This mode is unaccelerated. Using this option disables XVideo and the Resize and Rotate extension (RandR). Rotation (see above) and reflection are mutually exclusive. Default: no reflection. .TP .BI "Option \*qCRT1Gamma\*q \*q" boolean \*q Enable or disable gamma correction. (On the 300 and 315/330/340 series, this option only affects CRT1 output). Default: Gamma correction is enabled. .PP .I "2. Old series specific information" .PP The driver will auto-detect the amount of video memory present for all these chips, but in the case of the 6326, it will limit the memory size to 4MB. This is because the 6326's 2D engine can only address 4MB. The remaining memory seems to be intended for 3D texture data, since only the 3D engine can address RAM above 4MB. However, you can override this limitation using the .B \*qVideoRAM\*q option in the Device section if your board has more than 4MB and you need to use it. However, 2D acceleration, XVideo and the HWCursor will be disabled in this case. .PP For the 6326, the driver has two built-in modes for high resolutions which you should use instead of the default ones. These are named .B \*qSIS1280x1024-75\*q and .B \*qSIS1600x1200-60\*q and they will be added to the list of default modes. To use these modes, just place them in your Screen section. Example: .PP .BI "Modes \*qSIS1600x1200-60\*q \*qSIS1280x1024x75\*q \*q1024x768\*q ... .PP Of these modes, 1280x1024 is only available at 8, 15 and 16bpp. 1600x1200 is available at 8bpp only. .PP TV support for the 6326 .PP TV output is supported for the 6326. The driver will auto detect a connected TV and in this case add the following display modes to the list of available display modes: "PAL800x600", "PAL800x600U", "PAL720x540", "PAL640x480", "NTSC640x480", "NTSC640x480U" and "NTSC640x400". Use these modes like the hi-res modes described above. .PP The following driver .B Options are supported on the old series: .TP .BI "Option \*qTurboQueue\*q \*q" boolean \*q Enable or disable TurboQueue mode. Default: off for SIS530/620, on for the others .TP .BI "Option \*qFastVram\*q \*q" boolean \*q Enable or disable FastVram mode. Enabling this sets the video RAM timing to one cycle per read operation instead of two cycles. Disabling this will set two cycles for read and write operations. Leaving this option out uses the default, which varies depending on the chipset. .TP .BI "Option \*qNoHostBus\*q \*q" boolean \*q (SiS5597/5598 only). Disable CPU-to-VGA host bus support. This speeds up CPU to video RAM transfers. Default: Host bus is enabled. .TP .BI "Option \*qNoXVideo\*q \*q" boolean \*q Disable XV (XVideo) extension support. Default: XVideo is on. .TP .BI "Option \*qNoYV12\*q \*q" boolean \*q Disable YV12 Xv support. This might me required due to hardware bugs in some chipsets. Disabling YV12 support forces Xv-aware applications to use YUV2 or XShm for video output. Default: YV12 support is on. .TP .BI "Option \*qTVStandard\*q \*q" string \*q (6326 only) Valid parameters are .B PAL or .B NTSC. The default is set by a jumper on the card. .TP .BI "Option \*qTVXPosOffset\*q \*q" integer \*q (6326 only) This option allows tuning the horizontal position of the image for TV output. The range is from -16 to 16. Default: 0 .TP .BI "Option \*qTVYPosOffset\*q \*q" integer \*q (6326 only) This option allows tuning the vertical position of the image for TV output. The range is from -16 to 16. Default: 0 .TP .BI "Option \*qSIS6326TVEnableYFilter\*q \*q" boolean \*q (6326 only) This option allows enabling/disabling the Y (chroma) filter for TV output. .TP .BI "Option \*qSIS6326TVAntiFlicker\*q \*q" string \*q (6326 only) This option allow enabling/disabling the anti flicker facility for TV output. Possible parameters are .B OFF, LOW, MED, HIGH or .B ADAPTIVE. By experience, .B ADAPTIVE yields the best results, hence it is the default. .PP .I "2. 300 and 315/330/340 series specific information" .PP The 300 and 315/330/340 series, except the XGI Z7, feature two CRT controllers and very often come with a video bridge for controlling LCD and TV output. Hereinafter, the term .B CRT1 refers to the VGA output of the chip, and .B CRT2 refers to either LCD, TV or secondary VGA. Due to timing reasons, only one CRT2 output can be active at the same time. But this limitation does not apply to using CRT1 and CRT2 at the same time which makes it possible to run the driver in dual head mode. .PP The driver supports the following video bridges: .PP .B SiS301 .B SiS301B(-DH) .B SiS301C .B SiS301LV .B SiS302(E)LV .PP Instead of a video bridge, some machines have a third party .B LVDS transmitter to control LCD panels, and/or a .B "Chrontel 7005" or .B "7019" for TV output. All these are supported as well. .PP About TV output .PP The driver fully supports standard (PAL, NTSC, PAL-N, PAL-M) S-video or composite output as well as high definition TV (HDTV) output via YPbPr plugs. For more information on HDTV, please consult the author's website. .PP As regards S-video and CVBS output, the SiS301 and the Chrontel 7005 only support resolutions up to 800x600. All others support resolutions up to 1024x768. However, due to a hardware bug, Xvideo might be distorted on SiS video bridges if running NTSC or PAL-M at 1024x768. .PP About XVideo support .PP XVideo is supported on all chipsets of both families (except the XGI Volari Z7 which lacks hardware support for video overlays). However, there are some differences in hardware features which cause limitations. The 300 series as well as the SiS55x, M650, 651, 661FX, M661FX, M661MX, 741, 741GX, M741, 76x, M76x support two video overlays. The SiS315/H/PRO, 650/740, 330, 340 and the XGI Volari V3, V5 and V8 chips support only one such overlay. On chips with two overlays, one overlay is used for CRT1, the other for CRT2. On the other chipsets, the option .B \*qXvOnCRT2\*q can be used to select the desired output device (CRT1 or CRT2). .PP About Merged Framebuffer support .PP Merged framebuffer mode is similar to dual head/Xinerama mode (for using two output devices of one card at the same time), but has a few advantages which make me recommend it strongly over Xinerama. Please see http://www.winischhofer.eu/linuxsisvga.shtml for detailed information. .PP About dual-head support .PP Dual head mode with or without Xinerama is fully supported, be it with one card driving two outputs, be it two cards. Note that colordepth 8 is not supported in dual head mode if run on one card with two outputs. .PP The following driver .B Options are supported on the 300 and 315/330/340 series: .TP .BI "Option \*qNoXVideo\*q \*q" boolean \*q Disable XV (XVideo) extension support. Default: XVideo is on. .TP .BI "Option \*qXvOnCRT2\*q \*q" boolean \*q On chipsets with only one video overlay, this option can used to bind the overlay to CRT1 ( if a monitor is detected and if this option is either unset or set to .B false ) or CRT2 ( if a CRT2 device is detected or forced, and if this option is set to .B true ). If either only CRT1 or CRT2 is detected, the driver decides automatically. In Merged Framebuffer mode, this option is ignored. Default: overlay is used on CRT1 .TP .BI "Option \*qForceCRT1\*q \*q" boolean \*q Force CRT1 to be on of off. If a monitor is connected, it will be detected during server start. However, some old monitors are not detected correctly. In such cases, you may set this option to .B on in order to make the driver initialize CRT1 anyway. If this option is set to .B off , the driver will switch off CRT1. Default: auto-detect .TP .BI "Option \*qForceCRT2Type\*q \*q" string \*q Force display type to one of: .B NONE , .B TV , .B SVIDEO , .B COMPOSITE , .B SVIDEO+COMPOSITE , .B SCART , .B LCD , .B VGA ; .B NONE will disable CRT2. The SVIDEO, COMPOSITE, SVIDEO+COMPOSITE and SCART parameters are for SiS video bridges only and can be used to force the driver to use a specific TV output connector (if present). For further parameters, see the author's website. Default: auto detect. .TP .BI "Option \*qCRT2Gamma\*q \*q" boolean \*q Enable or disable gamma correction for CRT2. Only supported for SiS video bridges. Default: Gamma correction for CRT2 is on. .TP .BI "Option \*qTVStandard\*q \*q" string \*q Force the TV standard to either .B PAL or .B NTSC. On some machines with 630, 730 and the 315/330/340 series, .B PALM , .B PALN and .B NTSCJ are supported as well. Default: BIOS setting. .TP .BI "Option \*qTVXPosOffset\*q \*q" integer \*q This option allows tuning the horizontal position of the image for TV output. The range is from -32 to 32. Not supported on the Chrontel 7019. Default: 0 .TP .BI "Option \*qTVYPosOffset\*q \*q" integer \*q This option allows tuning the vertical position of the image for TV output. The range is from -32 to 32. Not supported on the Chrontel 7019. Default: 0 .TP .BI "Option \*qSISTVXScale\*q \*q" integer \*q This option selects the horizontal zooming level for TV output. The range is from -16 to 16. Only supported on SiS video bridges. Default: 0 .TP .BI "Option \*qSISTVYScale\*q \*q" integer \*q This option selects the vertical zooming level for TV output in the following modes: 640x480, 800x600. On the 315/330/340 series, also 720x480, 720x576 and 768x576. The range is from -4 to 3. Only supported on SiS video bridges. Default: 0 .TP .BI "Option \*qCHTVOverscan\*q \*q" boolean \*q On machines with a Chrontel TV encoder, this can be used to force the TV mode to overscan or underscan. .B on means overscan, .B off means underscan. Default: BIOS setting. .TP .BI "Option \*qCHTVSuperOverscan\*q \*q" boolean \*q On machines with a Chrontel 7005 TV encoder, this option enables a super-overscan mode. This is only supported if the TV standard is PAL. Super overscan will produce an image on the TV which is larger than the viewable area. .PP The driver supports many more options. Please see http://www.winischhofer.eu/linuxsisvga.shtml for more information. .PP .I "3. 300 series specific information" .PP DRI is supported on the 300 series only. On Linux, prior to kernel 2.6.3, DRI requires the kernel's SiS framebuffer driver ( .B sisfb ). The SiS DRM kernel driver as well as the SiS DRI client driver are required in any case. .PP Sisfb, if installed and running, takes care of memory management for texture data. In order to prevent the X Server and sisfb from overwriting each other's data, sisfb reserves an amount of video memory for the X driver. This amount can either be selected using sisfb's mem parameter, or auto-selected depending on the amount of total video RAM available. .PP Sisfb can be used for memory management only, or as a complete framebuffer driver. If you start sisfb with a valid mode (ie you gain a graphical console), the X driver can communicate with sisfb and doesn't require any manual configuration for finding out about the video memory it is allowed to use. .PP However, if you are running a 2.4 series Linux kernel and use sisfb for video memory management only, ie you started sisfb with mode=none and still have a text mode console, there is no communication between sisfb and the X driver. For this purpose, the .TP .BI "Option \*qMaxXFBMem\*q \*q" integer \*q .PP exists. This option must be set to the same value as given to sisfb through its "mem" parameter, ie the amount of memory to use for X in kilobytes. .PP If you started sisfb without the mem argument, sisfb will reserve .TP 12288KB if more than 16MB of total video RAM is available, .TP 8192KB if between 12 and 16MB of video RAM is available, .TP 4096KB in all other cases. .PP If you intend to use DRI on an integrated chipset (540, 630, 730), I recommend setting the total video memory in the BIOS setup utility to 64MB. .PP PLEASE NOTE: As of Linux 2.6.3 and under *BSD, sisfb is not required for memory management. Hence, this option is mandatory on such systems not running sisfb to decide how much memory X should reserve for DRI. If the option is omitted, DRI will have no memory assigned, and all DRI applications will quit with errors like "failed to allocate Z-buffer" or the like. .TP .BI "Option \*qDRI\*q \*q" boolean \*q This option allows enabling or disabling DRI. By default, DRI is on. .TP .BI "Option \*qAGPSize\*q \*q" integer \*q This option allows selecting the amount of AGP memory to be used for DRI. The amount is to be specified in megabyte, the default is 8. .SH "KNOWN BUGS" none. .SH "SEE ALSO" __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) .PP .B "http://www.winischhofer.eu/linuxsisvga.shtml" for more information and updates .SH AUTHORS Author: Thomas Winischhofer. Formerly based on code by Alan Hourihane, Mike Chapman, Juanjo Santamarta, Mitani Hiroshi, David Thomas, Sung-Ching Lin, Ademar Reis. xf86-video-sis-0.10.7/man/Makefile.am0000664000076400007640000000300411763612170014035 00000000000000# # Copyright 2005 Sun Microsystems, 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 (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. # drivermandir = $(DRIVER_MAN_DIR) driverman_PRE = @DRIVER_NAME@.man driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) EXTRA_DIST = @DRIVER_NAME@.man CLEANFILES = $(driverman_DATA) SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man # String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ xf86-video-sis-0.10.7/man/Makefile.in0000664000076400007640000003445112001203052014035 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # Copyright 2005 Sun Microsystems, 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 (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. # VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = man DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(drivermandir)" DATA = $(driverman_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASE_CFLAGS = @BASE_CFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ DRI_CFLAGS = @DRI_CFLAGS@ DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ PCIACCESS_LIBS = @PCIACCESS_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ XEXT_CFLAGS = @XEXT_CFLAGS@ XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ drivermandir = $(DRIVER_MAN_DIR) driverman_PRE = @DRIVER_NAME@.man driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) EXTRA_DIST = @DRIVER_NAME@.man CLEANFILES = $(driverman_DATA) SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man all: all-am .SUFFIXES: .SUFFIXES: .$(DRIVER_MAN_SUFFIX) .man $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) test -z "$(drivermandir)" || $(MKDIR_P) "$(DESTDIR)$(drivermandir)" @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ done uninstall-drivermanDATA: @$(NORMAL_UNINSTALL) @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(drivermandir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-drivermanDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-drivermanDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-drivermanDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-drivermanDATA # String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xf86-video-sis-0.10.7/INSTALL0000644000076400007640000002622212001203066012246 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 6. Often, you can also type `make uninstall' to remove the installed files again. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *Note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. xf86-video-sis-0.10.7/ltmain.sh0000644000076400007640000105152211763612262013057 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 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. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # Be 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 # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= 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_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -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 -export-symbols-regex 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 -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -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 -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -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] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables 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 else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" 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%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $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";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result 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" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be 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 relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -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 ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -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 # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result 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}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { 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. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result 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) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -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 tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" 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 "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 xf86-video-sis-0.10.7/depcomp0000755000076400007640000004755611763612270012626 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2011-12-04.11; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/ \1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/ / G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xf86-video-sis-0.10.7/missing0000755000076400007640000002415211763612270012633 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xf86-video-sis-0.10.7/configure.ac0000664000076400007640000001254412001177560013520 00000000000000# Copyright 2005 Adam Jackson. # # 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 # on the rights to use, copy, modify, merge, publish, distribute, sub # license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON 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. # # Process this file with autoconf to produce a configure script # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-sis], [0.10.7], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-video-sis]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR(.) # Initialize Automake AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS m4_ifndef([XORG_MACROS_VERSION], [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) XORG_MACROS_VERSION(1.8) XORG_DEFAULT_OPTIONS # Initialize libtool AC_DISABLE_STATIC AC_PROG_LIBTOOL AH_TOP([#include "xorg-server.h"]) # Define a configure option for an alternate module directory AC_ARG_WITH(xorg-module-dir, AS_HELP_STRING([--with-xorg-module-dir=DIR], [Default xorg module directory [[default=$libdir/xorg/modules]]]), [moduledir="$withval"], [moduledir="$libdir/xorg/modules"]) AC_ARG_ENABLE(dri, AS_HELP_STRING([--disable-dri], [Disable DRI support [[default=auto]]]), [DRI="$enableval"], [DRI=auto]) # Store the list of server defined optional extensions in REQUIRED_MODULES XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto) XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(RENDER, renderproto) XORG_DRIVER_CHECK_EXT(XV, videoproto) XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) # Obtain compiler/linker options for the driver dependencies PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto >= 2.1 $REQUIRED_MODULES]) PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1], HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]), HAVE_XEXTPROTO_71="no") AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ]) sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server` # Checks for libraries. if test "$DRI" != no; then AC_CHECK_FILE([${sdkdir}/dri.h], [have_dri_h="yes"], [have_dri_h="no"]) AC_CHECK_FILE([${sdkdir}/sarea.h], [have_sarea_h="yes"], [have_sarea_h="no"]) AC_CHECK_FILE([${sdkdir}/dristruct.h], [have_dristruct_h="yes"], [have_dristruct_h="no"]) fi AC_MSG_CHECKING([whether to include DRI support]) if test x$DRI = xauto; then if test "$have_dri_h" = yes -a \ "$have_sarea_h" = yes -a \ "$have_dristruct_h" = yes; then DRI="yes" else DRI="no" fi fi AC_MSG_RESULT([$DRI]) AM_CONDITIONAL(DRI, test x$DRI = xyes) if test "$DRI" = yes; then PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto]) AC_DEFINE(SISDRI,1,[Enable DRI driver support]) AC_DEFINE(SISDRI_DEVEL,1,[Enable developmental DRI driver support]) fi AC_ARG_ENABLE(xaa, AS_HELP_STRING([--enable-xaa], [Enable legacy X Acceleration Architecture (XAA) [default=auto]]), [XAA="$enableval"], [XAA=auto]) if test "x$XAA" != xno; then save_CFLAGS=$CFLAGS save_CPPFLAGS=$CPPFLAGS CFLAGS=$XORG_CFLAGS CPPFLAGS="$XORG_CFLAGS" AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no) CFLAGS=$save_CFLAGS CPPFLAGS=$save_CPPFLAGS fi AC_MSG_CHECKING([whether to include XAA support]) AM_CONDITIONAL(XAA, test "x$XAA" = xyes) AC_MSG_RESULT([$XAA]) # technically this should be a configure flag. meh. AC_DEFINE(XF86EXA, 1, [Build support for Exa]) 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" if test "x$XSERVER_LIBPCIACCESS" = xyes; then PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.12.901]) XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" fi AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes) AC_SUBST([moduledir]) DRIVER_NAME=sis AC_SUBST([DRIVER_NAME]) AC_CONFIG_FILES([ Makefile src/Makefile man/Makefile ]) AC_OUTPUT xf86-video-sis-0.10.7/README0000664000076400007640000002623111763612170012115 00000000000000 Information for SiS and XGI Users Thomas Winischhofer (thomas@winischhofer.net) 6 July 2005 ____________________________________________________________ Table of Contents 1. Introduction 2. xorg.conf Options 2.1 For all chipsets 2.2 Old series specific options 2.3 300/315/330/340 series specific options 2.4 300 series specific options 2.5 315/330/340 series specific options ______________________________________________________________________ 1. Introduction This driver is written by Thomas Winischhofer and is a (nearly) complete re-write of a driver written for the SiS6326 and SiS530 by Alan Hourihane and others. It currently supports the following chipsets: o old series: SiS 5597/5598, 6236/AGP/DVD, 530/620 o 300 series: SiS 300/305, 540, 630/730 o 315 series: SiS 315/E/PRO, 55x, 650, 651, M650, 740, [M]661&[F/M/G]X, [M]741[GX] o 330 series: SiS 330 ("Xabre"), [M]760[GX], [M]761[GX] o 340 series: SiS 34x, XGI Volari Z7, V3XT, V5, V8 Among other features, the driver supports o 8/16/24 bits color depth; old series also 15 o Hardware cursor; 315/330/340 series: Color HW cursor o XAA; EXA; XVideo (Xv); RENDER and other extensions o 6326: TV output o 300/315/330/340 series: TV output via Chrontel TV encoders or SiS video bridges o 300/315/330/340 series: LCD output via LVDS transmitters or SiS video bridges o 300/315/330/340 series: Dual head mode; Xinerama; Merged framebuffer mode o 300/315/330/340 series: Interface for SiSCtrl (see below) This document provides a brief overview over the driver's features and configuration options. Please see http://www.winischhofer.eu/linuxsisvga.shtml for detailed documentation and updates. 2. xorg.conf Options The following options are of particular interest for the SiS driver. Each of them must be specified in the Device section of the xorg.conf file for this card. In the list below, the options' arguments are described by type. For "boolean", the keywords "on", "true" and "yes", as well as "off", "false" and "no" respectively have the same meaning. 2.1. For all chipsets Option > Option These options select whether the software (SW) or hardware (HW) cursor should be used. The default is using the hardware cursor. Option Disables 2D acceleration. By default, 2D acceleration is enabled. Option Determines which acceleration architecture should be used. Possible arguments are "XAA" or "EXA". As of this writing, EXA is still experimental and it is not recommended to be used on production machines. By default, XAA will be used. Option This option enables clockwise ("CW") or counter-clockwise ("CCW") rotation of the display. Enabling either CW or CCW rotation disables the RandR extension as well as all 2D acceleration and Xv support. Default: no rotation. Option This option enables reflecting the display horizontally ("X"), vertically ("Y") or in both directions ("XY"). Enabling reflection disables the RandR extension as well as all 2D acceleration and Xv support. Default: no rotation. Option This option enables the shadow framebuffer layer. By default, it is disabled. Option Disables the XVideo (Xv) support. Apart from the XGI Volari Z7, all chipsets support Xv. By default, XVideo support is enabled. Option Enables or disables gamma correction. Default: gamma correction is enabled. 2.2. Old series specific options Option Enables 1 cycle memory access for read and write operations. The default depends on the chipset used. Option SiS chipsets have the ability to extend the engine command queue in video RAM. This concept is called "TurboQueue" and gives some performance improvement. Due to hardware bugs, the TurboQueue is disabled on the 530/620, otherwise enabled by default. Option For 5597/5598 only. This option, if set, disables the CPU to VGA host bus. Disabling the host bus will result in a severe performance regression. VideoRAM [size] The SiS 6326 can only directly address 4096K bytes of video RAM. However, there are some cards out there featuring 8192K (8MB) of video RAM. This RAM is not addressable by the engines. Therefore, by default, the driver will only use 4096K. This behavior can be overridden by specifying the amount of video RAM using the VideoRAM keyword. If more than 4096K is specified, the driver will disable 2D acceleration, Xv and the HW cursor. On all other chipsets, this keyword is ignored. The size argument is expected in KB, but without "KB". Option Due to hardware bugs, XVideo may display a corrupt image when using YV12 encoded material. This option, if set, disables support for YV12 and hence forces the Xv-aware application to use either YUV2 or XShm for video output. Option (6326 only) Selects the TV output standard. May be PAL or NTSC. By default, this is selected by a jumper on the card. 2.3. 300/315/330/340 series specific options Option This option enables/disables the driver's interface for the SiSCtrl utility. Please see http://www.winischhofer.eu/linuxsisvga.shtml for more information. Option (300 series only) SiS chipsets have the ability to extend the engine command queue in video RAM. This concept is called "TurboQueue" and gives some performance improvement. The TurboQueue is enabled by default. Option Enables or disables CRT1 (= the external VGA monitor). By default, the driver will use CRT1 if a monitor is detected during server start. Some older monitors can't be detected, so they may require setting this option to true. To disable CRT1 output, set this option to false. Option (For SiS 650, M650, 651, 661, 741, 760 with either SiS 301LV, 302LV or SiS 301C video bridge only) The argument may be "VGA", "LCD" or "OFF". Specifying LCD will force the driver to use the VGA controller's CRT1 channel for driving the LCD while CRT2 is free for TV usage. "OFF" is the same as setting the option ForceCRT1 to "false". Default is VGA. Option Selects the CRT2 output device type. Valid parameters are "LCD", "TV", "SVIDEO", "COMPOSITE", "SVIDEO+COMPOSITE", "SCART", "VGA", "YPBPR480I", "YPBPR480P", "YPBPR720P", "YPBPR1080I" or "NONE". NONE disables CRT2. SVIDEO, COMPOSITE, SVIDEO+COMPOSITE, SCART and all the YPBPR alternatives are only for systems with a SiS video bridge and select the desired plug or TV standard type. For Chrontel systems, TV should be used instead. VGA means secondary VGA and is only available on some SiS video bridges (301, 301B, 301C). Option (For SiS video bridges only) This option enables or disables gamma correction for CRT2. Default: gamma correction for CRT2 is enabled. Option Although this option is accepted for all chipsets, it currently only makes sense on the 300 series; DRI is only supported on these chipsets. This option enables/disables DRI. Option Selects the TV output standard. May be PAL or NTSC, on some machines (depending on the hardware) also PALM and PALN. Default: BIOS setting. Option > Option These options allow relocating the image on your TV. Both options take an integer within the range of -16 to 16. Default: 0. Not supported for Chrontel 7019. Option (For Chrontel TV encoders only) Selects whether TV output should be overscan or underscan. Option (For Chrontel 7005 TV encoders in PAL mode only) Selects whether TV output should be super-overscan (slightly larger than the viewable area) or not. Option > Option (For SiS video bridges only) These options allow zooming the image on your TV. SISTVXScale takes an integer within the range of -16 to 16. SISTVYScale accepts -4 to 3. Default: 0. Not all modes can be scaled. 2.4. 300 series specific options Option This option might only be needed if you are running X on a Linux 2.4 series kernel. This option is not needed and should be omitted on Linux 2.6 and *BSD. The Linux kernel features a framebuffer driver named "sisfb" which takes care of memory management for DRI/DRM (such as for 3D texture data). In order to keep the X driver and sisfb from overwriting each other's video memory, sisfb reserves a certain amount of video memory for the X driver. Reserved memory is for X 2D, pixmap cache and video data only. Sisfb will not present this memory to the DRI. The amount of reserved memory can either be selected using sisfb's mem parameter or auto-selected depending on the total amount of video RAM available. Fact of the matter is, the X driver needs to know about the amount of RAM sisfb reserved. For this purpose, the Option "MaxXFBMem" exists. If you start sisfb with a valid mode (ie you run a graphical console), the X driver can communicate with sisfb and doesn't require setting the MaxXFBMem option at all. The X driver will receive enough information from sisfb in this case. If you, on the other hand, use sisfb for memory management only, ie you started sisfb with mode=none and still have a text mode console, there is no communication between sisfb and the X driver. In this - and ONLY this - case, you need to set MaxXFBMem to the same value as you gave sisfb with its mem parameter. If you didn't specify any mem parameter, sisfb will reserve (and you will have to specify by MaxXFBMem) 12288KB if more than 16MB of total video RAM is available, 8192KB if between 12 and 16MB of video RAM is available, 4096KB in all other cases. The size is expected in KB, without the "KB". Final word of advice: If you intend to use DRI on an integrated chipset (such as the 540/630/730), it is recommended to set the total video memory in the BIOS setup utility to 64MB. 2.5. 315/330/340 series specific options Option Enables or disables RENDER acceleration. This feature, for instance, accelerates output of anti-aliased text. By default, RENDER acceleration is enabled. RENDER acceleration is currently only supported for XAA, not EXA. Option (For 315, 650, 740, 330, 340 and XGI chips only) This option selects whether the XVideo (Xv) overlay should be displayed on CRT1 or CRT2. Setting this option means CRT2. The other CRT will only display the (by default: blue) color key or a black/red pattern. xf86-video-sis-0.10.7/config.guess0000755000076400007640000012716111763612270013560 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xf86-video-sis-0.10.7/configure0000775000076400007640000225010412001203053013122 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for xf86-video-sis 0.10.7. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do 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 as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do 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 " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xf86-video-sis' PACKAGE_TARNAME='xf86-video-sis' PACKAGE_VERSION='0.10.7' PACKAGE_STRING='xf86-video-sis 0.10.7' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' ac_unique_file="Makefile.am" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS DRIVER_NAME moduledir XSERVER_LIBPCIACCESS_FALSE XSERVER_LIBPCIACCESS_TRUE PCIACCESS_LIBS PCIACCESS_CFLAGS XAA_FALSE XAA_TRUE DRI_LIBS DRI_CFLAGS DRI_FALSE DRI_TRUE HAVE_XEXTPROTO_71_FALSE HAVE_XEXTPROTO_71_TRUE XEXT_LIBS XEXT_CFLAGS XORG_LIBS XORG_CFLAGS OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP LIBTOOL AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V MAN_SUBSTS XORG_MAN_PAGE ADMIN_MAN_DIR DRIVER_MAN_DIR MISC_MAN_DIR FILE_MAN_DIR LIB_MAN_DIR APP_MAN_DIR ADMIN_MAN_SUFFIX DRIVER_MAN_SUFFIX MISC_MAN_SUFFIX FILE_MAN_SUFFIX LIB_MAN_SUFFIX APP_MAN_SUFFIX SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build INSTALL_CMD PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG CHANGELOG_CMD STRICT_CFLAGS CWARNFLAGS BASE_CFLAGS EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_dependency_tracking enable_selective_werror enable_strict_compilation enable_silent_rules enable_static enable_shared with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_xorg_module_dir enable_dri enable_xaa ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR XORG_CFLAGS XORG_LIBS XEXT_CFLAGS XEXT_LIBS DRI_CFLAGS DRI_LIBS PCIACCESS_CFLAGS PCIACCESS_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # 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-sis 0.10.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/xf86-video-sis] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of xf86-video-sis 0.10.7:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-selective-werror Turn off selective compiler errors. (default: enabled) --enable-strict-compilation Enable all warnings from compiler and make them errors (default: disabled) --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0') --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-dri Disable DRI support [[default=auto]] --enable-xaa Enable legacy X Acceleration Architecture (XAA) [default=auto] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-xorg-module-dir=DIR Default xorg module directory [[default=$libdir/xorg/modules]] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path XORG_CFLAGS C compiler flags for XORG, overriding pkg-config XORG_LIBS linker flags for XORG, overriding pkg-config XEXT_CFLAGS C compiler flags for XEXT, overriding pkg-config XEXT_LIBS linker flags for XEXT, overriding pkg-config DRI_CFLAGS C compiler flags for DRI, overriding pkg-config DRI_LIBS linker flags for DRI, overriding pkg-config PCIACCESS_CFLAGS C compiler flags for PCIACCESS, overriding pkg-config PCIACCESS_LIBS linker flags for PCIACCESS, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF xf86-video-sis configure 0.10.7 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------------------------------------------- ## ## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg ## ## ---------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_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-sis $as_me 0.10.7, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_aux_dir= for ac_dir in . "$srcdir"/.; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Initialize Automake am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='xf86-video-sis' VERSION='0.10.7' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_decl "$LINENO" "__clang__" "ac_cv_have_decl___clang__" "$ac_includes_default" if test "x$ac_cv_have_decl___clang__" = xyes; then : CLANGCC="yes" else CLANGCC="no" fi ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default" if test "x$ac_cv_have_decl___INTEL_COMPILER" = xyes; then : INTELCC="yes" else INTELCC="no" fi ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default" if test "x$ac_cv_have_decl___SUNPRO_C" = xyes; then : SUNCC="yes" else SUNCC="no" fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed # Check whether --enable-selective-werror was given. if test "${enable_selective_werror+set}" = set; then : enableval=$enable_selective_werror; SELECTIVE_WERROR=$enableval else SELECTIVE_WERROR=yes fi # -v is too short to test reliably with XORG_TESTSET_CFLAG if test "x$SUNCC" = "xyes"; then BASE_CFLAGS="-v" else BASE_CFLAGS="" fi # This chunk of warnings were those that existed in the legacy CWARNFLAGS xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wall" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wall" >&5 $as_echo_n "checking if $CC supports -Wall... " >&6; } cacheid=xorg_cv_cc_flag__Wall if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wall" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wpointer-arith" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wpointer-arith" >&5 $as_echo_n "checking if $CC supports -Wpointer-arith... " >&6; } cacheid=xorg_cv_cc_flag__Wpointer_arith if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wpointer-arith" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-declarations" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-declarations" >&5 $as_echo_n "checking if $CC supports -Wmissing-declarations... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_declarations if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-declarations" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wformat=2" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wformat=2" >&5 $as_echo_n "checking if $CC supports -Wformat=2... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Wformat=2" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wformat=2" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wformat" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wformat" >&5 $as_echo_n "checking if $CC supports -Wformat... " >&6; } cacheid=xorg_cv_cc_flag__Wformat if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wformat" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wstrict-prototypes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wstrict-prototypes" >&5 $as_echo_n "checking if $CC supports -Wstrict-prototypes... " >&6; } cacheid=xorg_cv_cc_flag__Wstrict_prototypes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wstrict-prototypes" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-prototypes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-prototypes" >&5 $as_echo_n "checking if $CC supports -Wmissing-prototypes... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_prototypes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-prototypes" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wnested-externs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wnested-externs" >&5 $as_echo_n "checking if $CC supports -Wnested-externs... " >&6; } cacheid=xorg_cv_cc_flag__Wnested_externs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wnested-externs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wbad-function-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wbad-function-cast" >&5 $as_echo_n "checking if $CC supports -Wbad-function-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wbad_function_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wbad-function-cast" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wold-style-definition" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wold-style-definition" >&5 $as_echo_n "checking if $CC supports -Wold-style-definition... " >&6; } cacheid=xorg_cv_cc_flag__Wold_style_definition if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wold-style-definition" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wdeclaration-after-statement" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wdeclaration-after-statement" >&5 $as_echo_n "checking if $CC supports -Wdeclaration-after-statement... " >&6; } cacheid=xorg_cv_cc_flag__Wdeclaration_after_statement if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wdeclaration-after-statement" found="yes" fi fi # This chunk adds additional warnings that could catch undesired effects. xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wunused" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wunused" >&5 $as_echo_n "checking if $CC supports -Wunused... " >&6; } cacheid=xorg_cv_cc_flag__Wunused if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wunused" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wuninitialized" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wuninitialized" >&5 $as_echo_n "checking if $CC supports -Wuninitialized... " >&6; } cacheid=xorg_cv_cc_flag__Wuninitialized if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wuninitialized" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wshadow" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wshadow" >&5 $as_echo_n "checking if $CC supports -Wshadow... " >&6; } cacheid=xorg_cv_cc_flag__Wshadow if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wshadow" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wcast-qual" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wcast-qual" >&5 $as_echo_n "checking if $CC supports -Wcast-qual... " >&6; } cacheid=xorg_cv_cc_flag__Wcast_qual if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wcast-qual" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-noreturn" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-noreturn" >&5 $as_echo_n "checking if $CC supports -Wmissing-noreturn... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_noreturn if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-noreturn" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-format-attribute" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-format-attribute" >&5 $as_echo_n "checking if $CC supports -Wmissing-format-attribute... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_format_attribute if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-format-attribute" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wredundant-decls" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wredundant-decls" >&5 $as_echo_n "checking if $CC supports -Wredundant-decls... " >&6; } cacheid=xorg_cv_cc_flag__Wredundant_decls if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wredundant-decls" found="yes" fi fi # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=implicit" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=implicit" >&5 $as_echo_n "checking if $CC supports -Werror=implicit... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=implicit" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=implicit" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" >&5 $as_echo_n "checking if $CC supports -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=nonnull" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=nonnull" >&5 $as_echo_n "checking if $CC supports -Werror=nonnull... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=nonnull" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=nonnull" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=init-self" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=init-self" >&5 $as_echo_n "checking if $CC supports -Werror=init-self... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=init-self" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=init-self" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=main" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=main" >&5 $as_echo_n "checking if $CC supports -Werror=main... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=main" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=main" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=missing-braces" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=missing-braces" >&5 $as_echo_n "checking if $CC supports -Werror=missing-braces... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=missing-braces" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=missing-braces" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=sequence-point" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=sequence-point" >&5 $as_echo_n "checking if $CC supports -Werror=sequence-point... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=sequence-point" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=sequence-point" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=return-type" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=return-type" >&5 $as_echo_n "checking if $CC supports -Werror=return-type... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=return-type" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=return-type" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_FUNC_HAS_NO_RETURN_STMT" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_FUNC_HAS_NO_RETURN_STMT" >&5 $as_echo_n "checking if $CC supports -errwarn=E_FUNC_HAS_NO_RETURN_STMT... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-errwarn=E_FUNC_HAS_NO_RETURN_STMT" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_FUNC_HAS_NO_RETURN_STMT" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=trigraphs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=trigraphs" >&5 $as_echo_n "checking if $CC supports -Werror=trigraphs... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=trigraphs" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=trigraphs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=array-bounds" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=array-bounds" >&5 $as_echo_n "checking if $CC supports -Werror=array-bounds... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=array-bounds" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=array-bounds" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=write-strings" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=write-strings" >&5 $as_echo_n "checking if $CC supports -Werror=write-strings... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=write-strings" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=write-strings" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=address" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=address" >&5 $as_echo_n "checking if $CC supports -Werror=address... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=address" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=address" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=int-to-pointer-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=int-to-pointer-cast" >&5 $as_echo_n "checking if $CC supports -Werror=int-to-pointer-cast... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=int-to-pointer-cast" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=int-to-pointer-cast" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_BAD_PTR_INT_COMBINATION" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_BAD_PTR_INT_COMBINATION" >&5 $as_echo_n "checking if $CC supports -errwarn=E_BAD_PTR_INT_COMBINATION... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-errwarn=E_BAD_PTR_INT_COMBINATION" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_BAD_PTR_INT_COMBINATION" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=pointer-to-int-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=pointer-to-int-cast" >&5 $as_echo_n "checking if $CC supports -Werror=pointer-to-int-cast... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=pointer-to-int-cast" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=pointer-to-int-cast" found="yes" fi fi # Also -errwarn=E_BAD_PTR_INT_COMBINATION else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT" >&5 $as_echo "$as_me: WARNING: You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT" >&2;} xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wimplicit" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wimplicit" >&5 $as_echo_n "checking if $CC supports -Wimplicit... " >&6; } cacheid=xorg_cv_cc_flag__Wimplicit if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wimplicit" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wnonnull" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wnonnull" >&5 $as_echo_n "checking if $CC supports -Wnonnull... " >&6; } cacheid=xorg_cv_cc_flag__Wnonnull if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wnonnull" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Winit-self" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Winit-self" >&5 $as_echo_n "checking if $CC supports -Winit-self... " >&6; } cacheid=xorg_cv_cc_flag__Winit_self if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Winit-self" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmain" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmain" >&5 $as_echo_n "checking if $CC supports -Wmain... " >&6; } cacheid=xorg_cv_cc_flag__Wmain if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmain" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-braces" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-braces" >&5 $as_echo_n "checking if $CC supports -Wmissing-braces... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_braces if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-braces" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wsequence-point" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wsequence-point" >&5 $as_echo_n "checking if $CC supports -Wsequence-point... " >&6; } cacheid=xorg_cv_cc_flag__Wsequence_point if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wsequence-point" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wreturn-type" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wreturn-type" >&5 $as_echo_n "checking if $CC supports -Wreturn-type... " >&6; } cacheid=xorg_cv_cc_flag__Wreturn_type if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wreturn-type" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wtrigraphs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wtrigraphs" >&5 $as_echo_n "checking if $CC supports -Wtrigraphs... " >&6; } cacheid=xorg_cv_cc_flag__Wtrigraphs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wtrigraphs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Warray-bounds" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Warray-bounds" >&5 $as_echo_n "checking if $CC supports -Warray-bounds... " >&6; } cacheid=xorg_cv_cc_flag__Warray_bounds if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Warray-bounds" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wwrite-strings" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wwrite-strings" >&5 $as_echo_n "checking if $CC supports -Wwrite-strings... " >&6; } cacheid=xorg_cv_cc_flag__Wwrite_strings if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wwrite-strings" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Waddress" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Waddress" >&5 $as_echo_n "checking if $CC supports -Waddress... " >&6; } cacheid=xorg_cv_cc_flag__Waddress if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Waddress" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wint-to-pointer-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wint-to-pointer-cast" >&5 $as_echo_n "checking if $CC supports -Wint-to-pointer-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wint_to_pointer_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wint-to-pointer-cast" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wpointer-to-int-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wpointer-to-int-cast" >&5 $as_echo_n "checking if $CC supports -Wpointer-to-int-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wpointer_to_int_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wpointer-to-int-cast" found="yes" fi fi fi CWARNFLAGS="$BASE_CFLAGS" if test "x$GCC" = xyes ; then CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" fi # Check whether --enable-strict-compilation was given. if test "${enable_strict_compilation+set}" = set; then : enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval else STRICT_COMPILE=no fi STRICT_CFLAGS="" xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -pedantic" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -pedantic" >&5 $as_echo_n "checking if $CC supports -pedantic... " >&6; } cacheid=xorg_cv_cc_flag__pedantic if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -pedantic" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror" >&5 $as_echo_n "checking if $CC supports -Werror... " >&6; } cacheid=xorg_cv_cc_flag__Werror if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -Werror" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn" >&5 $as_echo_n "checking if $CC supports -errwarn... " >&6; } cacheid=xorg_cv_cc_flag__errwarn if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -errwarn" found="yes" fi fi # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not # activate it with -Werror, so we add it here explicitly. xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=attributes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=attributes" >&5 $as_echo_n "checking if $CC supports -Werror=attributes... " >&6; } cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=attributes" | $as_tr_sh` if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes" found="yes" fi fi if test "x$STRICT_COMPILE" = "xyes"; then BASE_CFLAGS="$BASE_CFLAGS $STRICT_CFLAGS" CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` _ACEOF PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MINOR $PVM _ACEOF PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_PATCHLEVEL $PVP _ACEOF CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ echo 'git directory not found: installing possibly empty changelog.' >&2)" macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi if test x$APP_MAN_DIR = x ; then APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' fi if test x$LIB_MAN_SUFFIX = x ; then LIB_MAN_SUFFIX=3 fi if test x$LIB_MAN_DIR = x ; then LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' fi if test x$FILE_MAN_SUFFIX = x ; then case $host_os in solaris*) FILE_MAN_SUFFIX=4 ;; *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' fi if test x$MISC_MAN_SUFFIX = x ; then case $host_os in solaris*) MISC_MAN_SUFFIX=5 ;; *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' fi if test x$DRIVER_MAN_SUFFIX = x ; then case $host_os in solaris*) DRIVER_MAN_SUFFIX=7 ;; *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' fi if test x$ADMIN_MAN_SUFFIX = x ; then case $host_os in solaris*) ADMIN_MAN_SUFFIX=1m ;; *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' fi XORG_MAN_PAGE="X Version 11" MAN_SUBSTS="\ -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xservername__|Xorg|g' \ -e 's|__xconfigfile__|xorg.conf|g' \ -e 's|__projectroot__|\$(prefix)|g' \ -e 's|__apploaddir__|\$(appdefaultdir)|g' \ -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' # Initialize libtool # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" 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 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone 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` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) 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 # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` 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 fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; 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', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && 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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; 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)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; 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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *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" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&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. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # 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" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests 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);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code 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* 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 -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext 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. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # 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='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext 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. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } 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" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" 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 if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out 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 # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out 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 # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # 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_|_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= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' 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' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' 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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; 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. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # 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 # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # 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].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_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 "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_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 "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # 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' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all 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 ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" 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 if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes 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 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # 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?) 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 ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; 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 runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # 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; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # 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>/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;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx 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='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no 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" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: # Define a configure option for an alternate module directory # Check whether --with-xorg-module-dir was given. if test "${with_xorg_module_dir+set}" = set; then : withval=$with_xorg_module_dir; moduledir="$withval" else moduledir="$libdir/xorg/modules" fi # Check whether --enable-dri was given. if test "${enable_dri+set}" = set; then : enableval=$enable_dri; DRI="$enableval" else DRI=auto fi # Store the list of server defined optional extensions in REQUIRED_MODULES SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "xorg-server.h" #if !defined XINERAMA #error XINERAMA not defined #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : _EXT_CHECK=yes else _EXT_CHECK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if XINERAMA is defined" >&5 $as_echo_n "checking if XINERAMA is defined... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 $as_echo "$_EXT_CHECK" >&6; } if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES xineramaproto" fi SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "xorg-server.h" #if !defined RANDR #error RANDR not defined #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : _EXT_CHECK=yes else _EXT_CHECK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RANDR is defined" >&5 $as_echo_n "checking if RANDR is defined... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 $as_echo "$_EXT_CHECK" >&6; } if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES randrproto" fi SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "xorg-server.h" #if !defined RENDER #error RENDER not defined #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : _EXT_CHECK=yes else _EXT_CHECK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RENDER is defined" >&5 $as_echo_n "checking if RENDER is defined... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 $as_echo "$_EXT_CHECK" >&6; } if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES renderproto" fi SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "xorg-server.h" #if !defined XV #error XV not defined #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : _EXT_CHECK=yes else _EXT_CHECK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if XV is defined" >&5 $as_echo_n "checking if XV is defined... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 $as_echo "$_EXT_CHECK" >&6; } if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES videoproto" fi SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "xorg-server.h" #if !defined DPMSExtension #error DPMSExtension not defined #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : _EXT_CHECK=yes else _EXT_CHECK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if DPMSExtension is defined" >&5 $as_echo_n "checking if DPMSExtension is defined... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 $as_echo "$_EXT_CHECK" >&6; } if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES xextproto" fi # Obtain compiler/linker options for the driver dependencies pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XORG" >&5 $as_echo_n "checking for XORG... " >&6; } if test -n "$XORG_CFLAGS"; then pkg_cv_XORG_CFLAGS="$XORG_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto >= 2.1 \$REQUIRED_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto >= 2.1 $REQUIRED_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XORG_CFLAGS=`$PKG_CONFIG --cflags "xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto >= 2.1 $REQUIRED_MODULES" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XORG_LIBS"; then pkg_cv_XORG_LIBS="$XORG_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto >= 2.1 \$REQUIRED_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto >= 2.1 $REQUIRED_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XORG_LIBS=`$PKG_CONFIG --libs "xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto >= 2.1 $REQUIRED_MODULES" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XORG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto >= 2.1 $REQUIRED_MODULES" 2>&1` else XORG_PKG_ERRORS=`$PKG_CONFIG --print-errors "xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto >= 2.1 $REQUIRED_MODULES" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XORG_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto >= 2.1 $REQUIRED_MODULES) were not met: $XORG_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 XORG_CFLAGS and XORG_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_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 XORG_CFLAGS and XORG_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else XORG_CFLAGS=$pkg_cv_XORG_CFLAGS XORG_LIBS=$pkg_cv_XORG_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XEXT" >&5 $as_echo_n "checking for XEXT... " >&6; } if test -n "$XEXT_CFLAGS"; then pkg_cv_XEXT_CFLAGS="$XEXT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xextproto >= 7.0.99.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "xextproto >= 7.0.99.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XEXT_CFLAGS=`$PKG_CONFIG --cflags "xextproto >= 7.0.99.1" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XEXT_LIBS"; then pkg_cv_XEXT_LIBS="$XEXT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xextproto >= 7.0.99.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "xextproto >= 7.0.99.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XEXT_LIBS=`$PKG_CONFIG --libs "xextproto >= 7.0.99.1" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 XEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xextproto >= 7.0.99.1" 2>&1` else XEXT_PKG_ERRORS=`$PKG_CONFIG --print-errors "xextproto >= 7.0.99.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XEXT_PKG_ERRORS" >&5 HAVE_XEXTPROTO_71="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_XEXTPROTO_71="no" else XEXT_CFLAGS=$pkg_cv_XEXT_CFLAGS XEXT_LIBS=$pkg_cv_XEXT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_XEXTPROTO_71="yes"; $as_echo "#define HAVE_XEXTPROTO_71 1" >>confdefs.h fi if test "$HAVE_XEXTPROTO_71" = "yes" ; then HAVE_XEXTPROTO_71_TRUE= HAVE_XEXTPROTO_71_FALSE='#' else HAVE_XEXTPROTO_71_TRUE='#' HAVE_XEXTPROTO_71_FALSE= fi sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server` # Checks for libraries. if test "$DRI" != no; then as_ac_File=`$as_echo "ac_cv_file_${sdkdir}/dri.h" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${sdkdir}/dri.h" >&5 $as_echo_n "checking for ${sdkdir}/dri.h... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "${sdkdir}/dri.h"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : have_dri_h="yes" else have_dri_h="no" fi as_ac_File=`$as_echo "ac_cv_file_${sdkdir}/sarea.h" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${sdkdir}/sarea.h" >&5 $as_echo_n "checking for ${sdkdir}/sarea.h... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "${sdkdir}/sarea.h"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : have_sarea_h="yes" else have_sarea_h="no" fi as_ac_File=`$as_echo "ac_cv_file_${sdkdir}/dristruct.h" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${sdkdir}/dristruct.h" >&5 $as_echo_n "checking for ${sdkdir}/dristruct.h... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "${sdkdir}/dristruct.h"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : have_dristruct_h="yes" else have_dristruct_h="no" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include DRI support" >&5 $as_echo_n "checking whether to include DRI support... " >&6; } if test x$DRI = xauto; then if test "$have_dri_h" = yes -a \ "$have_sarea_h" = yes -a \ "$have_dristruct_h" = yes; then DRI="yes" else DRI="no" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DRI" >&5 $as_echo "$DRI" >&6; } if test x$DRI = xyes; then DRI_TRUE= DRI_FALSE='#' else DRI_TRUE='#' DRI_FALSE= fi if test "$DRI" = yes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRI" >&5 $as_echo_n "checking for DRI... " >&6; } if test -n "$DRI_CFLAGS"; then pkg_cv_DRI_CFLAGS="$DRI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm >= 2.0 xf86driproto\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm >= 2.0 xf86driproto") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRI_CFLAGS=`$PKG_CONFIG --cflags "libdrm >= 2.0 xf86driproto" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DRI_LIBS"; then pkg_cv_DRI_LIBS="$DRI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm >= 2.0 xf86driproto\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm >= 2.0 xf86driproto") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRI_LIBS=`$PKG_CONFIG --libs "libdrm >= 2.0 xf86driproto" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 DRI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libdrm >= 2.0 xf86driproto" 2>&1` else DRI_PKG_ERRORS=`$PKG_CONFIG --print-errors "libdrm >= 2.0 xf86driproto" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DRI_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libdrm >= 2.0 xf86driproto) were not met: $DRI_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 DRI_CFLAGS and DRI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_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 DRI_CFLAGS and DRI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DRI_CFLAGS=$pkg_cv_DRI_CFLAGS DRI_LIBS=$pkg_cv_DRI_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define SISDRI 1" >>confdefs.h $as_echo "#define SISDRI_DEVEL 1" >>confdefs.h fi # Check whether --enable-xaa was given. if test "${enable_xaa+set}" = set; then : enableval=$enable_xaa; XAA="$enableval" else XAA=auto fi if test "x$XAA" != xno; then save_CFLAGS=$CFLAGS save_CPPFLAGS=$CPPFLAGS CFLAGS=$XORG_CFLAGS CPPFLAGS="$XORG_CFLAGS" for ac_header in xaa.h do : ac_fn_c_check_header_mongrel "$LINENO" "xaa.h" "ac_cv_header_xaa_h" "$ac_includes_default" if test "x$ac_cv_header_xaa_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_XAA_H 1 _ACEOF XAA=yes else XAA=no fi done CFLAGS=$save_CFLAGS CPPFLAGS=$save_CPPFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include XAA support" >&5 $as_echo_n "checking whether to include XAA support... " >&6; } if test "x$XAA" = xyes; then XAA_TRUE= XAA_FALSE='#' else XAA_TRUE='#' XAA_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XAA" >&5 $as_echo "$XAA" >&6; } # technically this should be a configure flag. meh. $as_echo "#define XF86EXA 1" >>confdefs.h SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" ac_fn_c_check_decl "$LINENO" "XSERVER_LIBPCIACCESS" "ac_cv_have_decl_XSERVER_LIBPCIACCESS" "#include \"xorg-server.h\" " if test "x$ac_cv_have_decl_XSERVER_LIBPCIACCESS" = xyes; then : XSERVER_LIBPCIACCESS=yes else XSERVER_LIBPCIACCESS=no fi CPPFLAGS="$SAVE_CPPFLAGS" if test "x$XSERVER_LIBPCIACCESS" = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCIACCESS" >&5 $as_echo_n "checking for PCIACCESS... " >&6; } if test -n "$PCIACCESS_CFLAGS"; then pkg_cv_PCIACCESS_CFLAGS="$PCIACCESS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.12.901\""; } >&5 ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.12.901") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PCIACCESS_CFLAGS=`$PKG_CONFIG --cflags "pciaccess >= 0.12.901" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PCIACCESS_LIBS"; then pkg_cv_PCIACCESS_LIBS="$PCIACCESS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.12.901\""; } >&5 ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.12.901") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PCIACCESS_LIBS=`$PKG_CONFIG --libs "pciaccess >= 0.12.901" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 --print-errors "pciaccess >= 0.12.901" 2>&1` else PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --print-errors "pciaccess >= 0.12.901" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PCIACCESS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (pciaccess >= 0.12.901) 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." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_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 . See \`config.log' for more details" "$LINENO" 5; } else PCIACCESS_CFLAGS=$pkg_cv_PCIACCESS_CFLAGS PCIACCESS_LIBS=$pkg_cv_PCIACCESS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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 DRIVER_NAME=sis ac_config_files="$ac_config_files Makefile src/Makefile man/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_XEXTPROTO_71_TRUE}" && test -z "${HAVE_XEXTPROTO_71_FALSE}"; then as_fn_error $? "conditional \"HAVE_XEXTPROTO_71\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DRI_TRUE}" && test -z "${DRI_FALSE}"; then as_fn_error $? "conditional \"DRI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XAA_TRUE}" && test -z "${XAA_FALSE}"; then as_fn_error $? "conditional \"XAA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XSERVER_LIBPCIACCESS_TRUE}" && test -z "${XSERVER_LIBPCIACCESS_FALSE}"; then as_fn_error $? "conditional \"XSERVER_LIBPCIACCESS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do 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 as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by xf86-video-sis $as_me 0.10.7, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ xf86-video-sis config.status 0.10.7 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # 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 sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # 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 setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Whether or not to build static libraries. build_old_libs=$enable_static # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi xf86-video-sis-0.10.7/src/0000775000076400007640000000000012001203066012062 500000000000000xf86-video-sis-0.10.7/src/sis_driver.c0000664000076400007640000150257112001173034014333 00000000000000/* * SiS driver main code * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * - driver entirely rewritten since 2001, only basic structure taken from * old code (except sis_dri.c, sis_shadow.c, sis_accel.c and parts of * sis_dga.c; these were mostly taken over; sis_dri.c was changed for * new versions of the DRI layer) * * This notice covers the entire driver code unless indicated otherwise. * * Formerly based on code which was * Copyright (C) 1998, 1999 by Alan Hourihane, Wigan, England. * Written by: * Alan Hourihane , * Mike Chapman , * Juanjo Santamarta , * Mitani Hiroshi , * David Thomas . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "sis.h" #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86RAC.h" #endif #include "dixstruct.h" #include "shadowfb.h" #include "fb.h" #include "micmap.h" #include "mipointer.h" #include "mibstore.h" #include "edid.h" #define SIS_NEED_inSISREG #define SIS_NEED_inSISIDXREG #define SIS_NEED_outSISIDXREG #define SIS_NEED_orSISIDXREG #define SIS_NEED_andSISIDXREG #define SIS_NEED_setSISIDXREG #define SIS_NEED_outSISREG #define SIS_NEED_MYMMIO #define SIS_NEED_sisclearvram #include "sis_regs.h" #include "sis_dac.h" #include "sis_driver.h" #include #include "globals.h" #ifdef HAVE_XEXTPROTO_71 #include #else #define DPMS_SERVER #include #endif #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5 #include /* for inputInfo */ #endif #ifdef SISDRI #include "dri.h" #endif /* * LookupWindow was removed with video abi 11. */ #if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4) #ifndef DixGetAttrAccess #define DixGetAttrAccess (1<<4) #endif #endif #if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 2) static inline int dixLookupWindow(WindowPtr *pWin, XID id, ClientPtr client, Mask access) { *pWin = LookupWindow(id, client); if (!*pWin) return BadWindow; return Success; } #endif /* Globals (yes, these ARE really required to be global) */ #ifdef SISUSEDEVPORT int sisdevport = 0; #endif #ifdef SISDUALHEAD static int SISEntityIndex = -1; #endif #ifdef SISMERGED #ifdef SISXINERAMA static Bool SiSnoPanoramiXExtension = TRUE; static int SiSXineramaNumScreens = 0; static SiSXineramaData *SiSXineramadataPtr = NULL; static int SiSXineramaGeneration; static int SiSProcXineramaQueryVersion(ClientPtr client); static int SiSProcXineramaGetState(ClientPtr client); static int SiSProcXineramaGetScreenCount(ClientPtr client); static int SiSProcXineramaGetScreenSize(ClientPtr client); static int SiSProcXineramaIsActive(ClientPtr client); static int SiSProcXineramaQueryScreens(ClientPtr client); static int SiSSProcXineramaDispatch(ClientPtr client); #endif #endif /* * This is intentionally screen-independent. It indicates the binding * choice made in the first PreInit. */ static int pix24bpp = 0; /* * This contains the functions needed by the server after loading the driver * module. It must be supplied, and gets passed back by the SetupProc * function in the dynamic case. In the static case, a reference to this * is compiled in, and this requires that the name of this DriverRec be * an upper-case version of the driver name. */ #ifdef _X_EXPORT _X_EXPORT #endif DriverRec SIS = { SIS_CURRENT_VERSION, SIS_DRIVER_NAME, SISIdentify, SISProbe, SISAvailableOptions, NULL, 0 #ifdef SIS_HAVE_DRIVER_FUNC , SISDriverFunc #endif }; static SymTabRec SISChipsets[] = { { PCI_CHIP_SIS5597, "SIS5597/5598" }, { PCI_CHIP_SIS530, "SIS530/620" }, { PCI_CHIP_SIS6326, "SIS6326/AGP/DVD" }, { PCI_CHIP_SIS300, "SIS300/305" }, { PCI_CHIP_SIS630, "SIS630/730" }, { PCI_CHIP_SIS540, "SIS540" }, { PCI_CHIP_SIS315, "SIS315" }, { PCI_CHIP_SIS315H, "SIS315H" }, { PCI_CHIP_SIS315PRO, "SIS315PRO/E" }, { PCI_CHIP_SIS550, "SIS550" }, { PCI_CHIP_SIS650, "SIS650/M650/651/740" }, { PCI_CHIP_SIS330, "SIS330(Xabre)" }, { PCI_CHIP_SIS660, "SIS660/[M]661[F|M]X/[M]670/[M]741[GX]/[M]760[GX]/[M]761[GX]/[M]770[GX]" }, { PCI_CHIP_SIS340, "SIS340" }, { -1, NULL } }; static PciChipsets SISPciChipsets[] = { { PCI_CHIP_SIS5597, PCI_CHIP_SIS5597, RES_SHARED_VGA }, { PCI_CHIP_SIS530, PCI_CHIP_SIS530, RES_SHARED_VGA }, { PCI_CHIP_SIS6326, PCI_CHIP_SIS6326, RES_SHARED_VGA }, { PCI_CHIP_SIS300, PCI_CHIP_SIS300, RES_SHARED_VGA }, { PCI_CHIP_SIS630, PCI_CHIP_SIS630, RES_SHARED_VGA }, { PCI_CHIP_SIS540, PCI_CHIP_SIS540, RES_SHARED_VGA }, { PCI_CHIP_SIS550, PCI_CHIP_SIS550, RES_SHARED_VGA }, { PCI_CHIP_SIS315, PCI_CHIP_SIS315, RES_SHARED_VGA }, { PCI_CHIP_SIS315H, PCI_CHIP_SIS315H, RES_SHARED_VGA }, { PCI_CHIP_SIS315PRO, PCI_CHIP_SIS315PRO, RES_SHARED_VGA }, { PCI_CHIP_SIS650, PCI_CHIP_SIS650, RES_SHARED_VGA }, { PCI_CHIP_SIS330, PCI_CHIP_SIS330, RES_SHARED_VGA }, { PCI_CHIP_SIS660, PCI_CHIP_SIS660, RES_SHARED_VGA }, { PCI_CHIP_SIS340, PCI_CHIP_SIS340, RES_SHARED_VGA }, { -1, -1, RES_UNDEFINED } }; static SymTabRec XGIChipsets[] = { { PCI_CHIP_XGIXG20, "Volari Z7 (XG20)" }, { PCI_CHIP_XGIXG40, "Volari V3XT/V5/V8/Duo (XG40)" }, { -1, NULL } }; static PciChipsets XGIPciChipsets[] = { { PCI_CHIP_XGIXG20, PCI_CHIP_XGIXG20, RES_SHARED_VGA }, { PCI_CHIP_XGIXG40, PCI_CHIP_XGIXG40, RES_SHARED_VGA }, { -1, -1, RES_UNDEFINED } }; #ifdef XFree86LOADER static MODULESETUPPROTO(sisSetup); static XF86ModuleVersionInfo sisVersRec = { SIS_DRIVER_NAME, MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, #ifdef XORG_VERSION_CURRENT XORG_VERSION_CURRENT, #else XF86_VERSION_CURRENT, #endif SIS_MAJOR_VERSION, SIS_MINOR_VERSION, SIS_PATCHLEVEL, ABI_CLASS_VIDEODRV, /* This is a video driver */ ABI_VIDEODRV_VERSION, MOD_CLASS_VIDEODRV, {0,0,0,0} }; #ifdef _X_EXPORT _X_EXPORT #endif XF86ModuleData sisModuleData = { &sisVersRec, sisSetup, NULL }; pointer sisSetup(pointer module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; if(!setupDone) { setupDone = TRUE; xf86AddDriver(&SIS, module, SIS_HaveDriverFuncs); return (pointer)TRUE; } if(errmaj) *errmaj = LDR_ONCEONLY; return NULL; } #endif /* XFree86LOADER */ /* Mandatory */ static void SISIdentify(int flags) { xf86PrintChipsets(SIS_NAME, "driver for SiS chipsets", SISChipsets); xf86PrintChipsets(SIS_NAME, "driver for XGI chipsets", XGIChipsets); } #ifdef SIS_HAVE_DRIVER_FUNC static Bool SISDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr) { CARD32 *flag; switch(op) { case RR_GET_INFO: break; case RR_SET_CONFIG: break; case GET_REQUIRED_HW_INTERFACES: break; } return TRUE; } #endif static Bool SISGetRec(ScrnInfoPtr pScrn) { /* Allocate an SISRec, 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) return TRUE; pScrn->driverPrivate = xnfcalloc(sizeof(SISRec), 1); /* Initialise it to 0 */ memset(pScrn->driverPrivate, 0, sizeof(SISRec)); return TRUE; } static void SISFreeRec(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = NULL; #endif /* Just to make sure... */ if(!pSiS) return; #ifdef SISDUALHEAD pSiSEnt = pSiS->entityPrivate; #endif if(pSiS->pstate) free(pSiS->pstate); pSiS->pstate = NULL; if(pSiS->fonts) free(pSiS->fonts); pSiS->fonts = NULL; #ifdef SISDUALHEAD if(pSiSEnt) { if(!pSiS->SecondHead) { /* Free memory only if we are first head; in case of an error * during init of the second head, the server will continue - * and we need the BIOS image and SiS_Private for the first * head. */ if(pSiSEnt->BIOS) free(pSiSEnt->BIOS); pSiSEnt->BIOS = pSiS->BIOS = NULL; if(pSiSEnt->SiS_Pr) free(pSiSEnt->SiS_Pr); pSiSEnt->SiS_Pr = pSiS->SiS_Pr = NULL; if(pSiSEnt->RenderAccelArray) free(pSiSEnt->RenderAccelArray); pSiSEnt->RenderAccelArray = pSiS->RenderAccelArray = NULL; pSiSEnt->pScrn_1 = NULL; } else { pSiS->BIOS = NULL; pSiS->SiS_Pr = NULL; pSiS->RenderAccelArray = NULL; pSiSEnt->pScrn_2 = NULL; } } else { #endif if(pSiS->BIOS) free(pSiS->BIOS); pSiS->BIOS = NULL; if(pSiS->SiS_Pr) free(pSiS->SiS_Pr); pSiS->SiS_Pr = NULL; if(pSiS->RenderAccelArray) free(pSiS->RenderAccelArray); pSiS->RenderAccelArray = NULL; #ifdef SISDUALHEAD } #endif #ifdef SISMERGED if(pSiS->CRT2HSync) free(pSiS->CRT2HSync); pSiS->CRT2HSync = NULL; if(pSiS->CRT2VRefresh) free(pSiS->CRT2VRefresh); pSiS->CRT2VRefresh = NULL; if(pSiS->MetaModes) free(pSiS->MetaModes); pSiS->MetaModes = NULL; if(pSiS->CRT2pScrn) { if(pSiS->CRT2pScrn->modes) { while(pSiS->CRT2pScrn->modes) xf86DeleteMode(&pSiS->CRT2pScrn->modes, pSiS->CRT2pScrn->modes); } if(pSiS->CRT2pScrn->monitor) { if(pSiS->CRT2pScrn->monitor->Modes) { while(pSiS->CRT2pScrn->monitor->Modes) xf86DeleteMode(&pSiS->CRT2pScrn->monitor->Modes, pSiS->CRT2pScrn->monitor->Modes); } if(pSiS->CRT2pScrn->monitor->DDC) free(pSiS->CRT2pScrn->monitor->DDC); free(pSiS->CRT2pScrn->monitor); } free(pSiS->CRT2pScrn); pSiS->CRT2pScrn = NULL; } if(pSiS->CRT1Modes) { if(pSiS->CRT1Modes != pScrn->modes) { if(pScrn->modes) { pScrn->currentMode = pScrn->modes; do { DisplayModePtr p = pScrn->currentMode->next; if(pScrn->currentMode->Private) free(pScrn->currentMode->Private); free(pScrn->currentMode); pScrn->currentMode = p; } while(pScrn->currentMode != pScrn->modes); } pScrn->currentMode = pSiS->CRT1CurrentMode; pScrn->modes = pSiS->CRT1Modes; pSiS->CRT1CurrentMode = NULL; pSiS->CRT1Modes = NULL; } } #endif while(pSiS->SISVESAModeList) { sisModeInfoPtr mp = pSiS->SISVESAModeList->next; free(pSiS->SISVESAModeList); pSiS->SISVESAModeList = mp; } if(pSiS->pVbe) vbeFree(pSiS->pVbe); pSiS->pVbe = NULL; #ifdef SISUSEDEVPORT if(pSiS->sisdevportopen) close(sisdevport); #endif if(pScrn->driverPrivate == NULL) return; free(pScrn->driverPrivate); pScrn->driverPrivate = NULL; } static void SISErrorLog(ScrnInfoPtr pScrn, const char *format, ...) { va_list ap; static const char *str = "**************************************************\n"; va_start(ap, format); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, " ERROR:\n"); xf86VDrvMsgVerb(pScrn->scrnIndex, X_ERROR, 1, format, ap); va_end(ap); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, " END OF MESSAGE\n"); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str); } static void SiS_SiSFB_Lock(ScrnInfoPtr pScrn, Bool lock) { SISPtr pSiS = SISPTR(pScrn); int fd; CARD32 parm; if(!pSiS->sisfbfound) return; if(!pSiS->sisfb_havelock) return; if((fd = open(pSiS->sisfbdevname, O_RDONLY)) != -1) { parm = lock ? 1 : 0; ioctl(fd, SISFB_SET_LOCK, &parm); close(fd); } } /* Probe() * * Mandatory */ static Bool SISProbe(DriverPtr drv, int flags) { int i; GDevPtr *devSections; int *usedChipsSiS, *usedChipsXGI; int numDevSections; int numUsed, numUsedSiS, numUsedXGI; Bool foundScreen = FALSE; /* * The aim here is to find all cards that this driver can handle, * and for the ones not already claimed by another driver, claim the * slot, and allocate a ScrnInfoRec. * * This should be a minimal probe, and it should under no circumstances * change the state of the hardware. Because a device is found, don't * assume that it will be used. Don't do any initialisations other than * the required ScrnInfoRec initialisations. Don't allocate any new * data structures. * */ /* * Next we check, if there has been a chipset override in the config file. * For this we must find out if there is an active device section which * is relevant, i.e., which has no driver specified or has THIS driver * specified. */ if((numDevSections = xf86MatchDevice(SIS_DRIVER_NAME, &devSections)) <= 0) { /* * There's no matching device section in the config file, so quit * now. */ return FALSE; } /* * We need to probe the hardware first. We then need to see how this * fits in with what is given in the config file, and allow the config * file info to override any contradictions. */ /* * All of the cards this driver supports are PCI, so the "probing" just * amounts to checking the PCI data that the server has already collected. */ #ifndef XSERVER_LIBPCIACCESS if(xf86GetPciVideoInfo() == NULL) { /* * We won't let anything in the config file override finding no * PCI video cards at all. */ return FALSE; } #endif numUsedSiS = xf86MatchPciInstances(SIS_NAME, PCI_VENDOR_SIS, SISChipsets, SISPciChipsets, devSections, numDevSections, drv, &usedChipsSiS); numUsedXGI = xf86MatchPciInstances(SIS_NAME, PCI_VENDOR_XGI, XGIChipsets, XGIPciChipsets, devSections, numDevSections, drv, &usedChipsXGI); /* Free it since we don't need that list after this */ free(devSections); numUsed = numUsedSiS + numUsedXGI; if(numUsed <= 0) return FALSE; if(flags & PROBE_DETECT) { foundScreen = TRUE; } else for(i = 0; i < numUsed; i++) { ScrnInfoPtr pScrn; #ifdef SISDUALHEAD EntityInfoPtr pEnt; #endif /* Allocate a ScrnInfoRec and claim the slot */ pScrn = NULL; if((pScrn = xf86ConfigPciEntity(pScrn, 0, (i < numUsedSiS) ? usedChipsSiS[i] : usedChipsXGI[i-numUsedSiS], (i < numUsedSiS) ? SISPciChipsets : XGIPciChipsets, NULL, NULL, NULL, NULL, NULL))) { /* Fill in what we can of the ScrnInfoRec */ pScrn->driverVersion = SIS_CURRENT_VERSION; pScrn->driverName = SIS_DRIVER_NAME; pScrn->name = SIS_NAME; pScrn->Probe = SISProbe; pScrn->PreInit = SISPreInit; pScrn->ScreenInit = SISScreenInit; pScrn->SwitchMode = SISSwitchMode; pScrn->AdjustFrame = SISAdjustFrame; pScrn->EnterVT = SISEnterVT; pScrn->LeaveVT = SISLeaveVT; pScrn->FreeScreen = SISFreeScreen; pScrn->ValidMode = SISValidMode; foundScreen = TRUE; } #ifdef SISDUALHEAD pEnt = xf86GetEntityInfo((i < numUsedSiS) ? usedChipsSiS[i] : usedChipsXGI[i-numUsedSiS]); if(pEnt->chipset == PCI_CHIP_SIS630 || pEnt->chipset == PCI_CHIP_SIS540 || pEnt->chipset == PCI_CHIP_SIS650 || pEnt->chipset == PCI_CHIP_SIS550 || pEnt->chipset == PCI_CHIP_SIS315 || pEnt->chipset == PCI_CHIP_SIS315H || pEnt->chipset == PCI_CHIP_SIS315PRO || pEnt->chipset == PCI_CHIP_SIS330 || pEnt->chipset == PCI_CHIP_SIS300 || pEnt->chipset == PCI_CHIP_SIS660 || pEnt->chipset == PCI_CHIP_SIS340 || pEnt->chipset == PCI_CHIP_XGIXG40) { SISEntPtr pSiSEnt = NULL; DevUnion *pPriv; xf86SetEntitySharable((i < numUsedSiS) ? usedChipsSiS[i] : usedChipsXGI[i-numUsedSiS]); if(SISEntityIndex < 0) { SISEntityIndex = xf86AllocateEntityPrivateIndex(); } pPriv = xf86GetEntityPrivate(pScrn->entityList[0], SISEntityIndex); if(!pPriv->ptr) { pPriv->ptr = xnfcalloc(sizeof(SISEntRec), 1); pSiSEnt = pPriv->ptr; memset(pSiSEnt, 0, sizeof(SISEntRec)); pSiSEnt->lastInstance = -1; } else { pSiSEnt = pPriv->ptr; } pSiSEnt->lastInstance++; xf86SetEntityInstanceForScreen(pScrn, pScrn->entityList[0], pSiSEnt->lastInstance); } #endif /* DUALHEAD */ } if(usedChipsSiS) free(usedChipsSiS); if(usedChipsXGI) free(usedChipsXGI); return foundScreen; } /* Various helpers */ static unsigned short calcgammaval(int j, int nramp, float invgamma, float bri, float c) { float k = (float)j; float nrm1 = (float)(nramp - 1); float con = c * nrm1 / 3.0; float l, v; if(con != 0.0) { l = nrm1 / 2.0; if(con <= 0.0) { k -= l; k *= (l + con) / l; } else { l -= 1.0; k -= l; k *= l / (l - con); } k += l; if(k < 0.0) k = 0.0; } if(invgamma == 1.0) { v = k / nrm1 * 65535.0; } else { v = pow(k / nrm1, invgamma) * 65535.0 + 0.5; } v += (bri * (65535.0 / 3.0)) ; if(v < 0.0) v = 0.0; else if(v > 65535.0) v = 65535.0; return (unsigned short)v; } #ifdef SISGAMMARAMP void SISCalculateGammaRamp(ScreenPtr pScreen, ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int i, j, nramp; UShort *ramp[3]; float gamma_max[3], framp; Bool newmethod = FALSE; if(!(pSiS->SiS_SD3_Flags & SiS_SD3_OLDGAMMAINUSE)) { newmethod = TRUE; } else { gamma_max[0] = (float)pSiS->GammaBriR / 1000; gamma_max[1] = (float)pSiS->GammaBriG / 1000; gamma_max[2] = (float)pSiS->GammaBriB / 1000; } if(!(nramp = xf86GetGammaRampSize(pScreen))) return; for(i=0; i<3; i++) { ramp[i] = (UShort *)malloc(nramp * sizeof(UShort)); if(!ramp[i]) { if(ramp[0]) { free(ramp[0]); ramp[0] = NULL; } if(ramp[1]) { free(ramp[1]); ramp[1] = NULL; } return; } } if(newmethod) { for(i = 0; i < 3; i++) { float invgamma = 0.0, bri = 0.0, con = 0.0; switch(i) { case 0: invgamma = 1. / pScrn->gamma.red; bri = pSiS->NewGammaBriR; con = pSiS->NewGammaConR; break; case 1: invgamma = 1. / pScrn->gamma.green; bri = pSiS->NewGammaBriG; con = pSiS->NewGammaConG; break; case 2: invgamma = 1. / pScrn->gamma.blue; bri = pSiS->NewGammaBriB; con = pSiS->NewGammaConB; break; } for(j = 0; j < nramp; j++) { ramp[i][j] = calcgammaval(j, nramp, invgamma, bri, con); } } } else { for(i = 0; i < 3; i++) { int fullscale = 65535 * gamma_max[i]; float dramp = 1. / (nramp - 1); float invgamma = 0.0, v; switch(i) { case 0: invgamma = 1. / pScrn->gamma.red; break; case 1: invgamma = 1. / pScrn->gamma.green; break; case 2: invgamma = 1. / pScrn->gamma.blue; break; } for(j = 0; j < nramp; j++) { framp = pow(j * dramp, invgamma); v = (fullscale < 0) ? (65535 + fullscale * framp) : fullscale * framp; if(v < 0) v = 0; else if(v > 65535) v = 65535; ramp[i][j] = (UShort)v; } } } xf86ChangeGammaRamp(pScreen, nramp, ramp[0], ramp[1], ramp[2]); free(ramp[0]); free(ramp[1]); free(ramp[2]); ramp[0] = ramp[1] = ramp[2] = NULL; } #endif void SISCalculateGammaRampCRT2(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int i; int myshift = 16 - pScrn->rgbBits; int maxvalue = (1 << pScrn->rgbBits) - 1; int reds = pScrn->mask.red >> pScrn->offset.red; int greens = pScrn->mask.green >> pScrn->offset.green; int blues = pScrn->mask.blue >> pScrn->offset.blue; float framp, invgamma1, invgamma2, invgamma3, v; invgamma1 = 1. / pSiS->GammaR2; invgamma2 = 1. / pSiS->GammaG2; invgamma3 = 1. / pSiS->GammaB2; if(!(pSiS->SiS_SD3_Flags & SiS_SD3_OLDGAMMAINUSE)) { for(i = 0; i < pSiS->CRT2ColNum; i++) { pSiS->crt2gcolortable[i].red = calcgammaval(i, pSiS->CRT2ColNum, invgamma1, pSiS->NewGammaBriR2, pSiS->NewGammaConR2) >> myshift; pSiS->crt2gcolortable[i].green = calcgammaval(i, pSiS->CRT2ColNum, invgamma2, pSiS->NewGammaBriG2, pSiS->NewGammaConG2) >> myshift; pSiS->crt2gcolortable[i].blue = calcgammaval(i, pSiS->CRT2ColNum, invgamma3, pSiS->NewGammaBriB2, pSiS->NewGammaConB2) >> myshift; } } else { int fullscale1 = 65536 * (float)pSiS->GammaBriR2 / 1000; int fullscale2 = 65536 * (float)pSiS->GammaBriG2 / 1000; int fullscale3 = 65536 * (float)pSiS->GammaBriB2 / 1000; float dramp = 1. / (pSiS->CRT2ColNum - 1); for(i = 0; i < pSiS->CRT2ColNum; i++) { framp = pow(i * dramp, invgamma1); v = (fullscale1 < 0) ? (65535 + fullscale1 * framp) : fullscale1 * framp; if(v < 0) v = 0; else if(v > 65535) v = 65535; pSiS->crt2gcolortable[i].red = ((UShort)v) >> myshift; framp = pow(i * dramp, invgamma2); v = (fullscale2 < 0) ? (65535 + fullscale2 * framp) : fullscale2 * framp; if(v < 0) v = 0; else if(v > 65535) v = 65535; pSiS->crt2gcolortable[i].green = ((UShort)v) >> myshift; framp = pow(i * dramp, invgamma3); v = (fullscale3 < 0) ? (65535 + fullscale3 * framp) : fullscale3 * framp; if(v < 0) v = 0; else if(v > 65535) v = 65535; pSiS->crt2gcolortable[i].blue = ((UShort)v) >> myshift; } } for(i = 0; i < pSiS->CRT2ColNum; i++) { pSiS->crt2colors[i].red = pSiS->crt2gcolortable[i * maxvalue / reds].red; pSiS->crt2colors[i].green = pSiS->crt2gcolortable[i * maxvalue / greens].green; pSiS->crt2colors[i].blue = pSiS->crt2gcolortable[i * maxvalue / blues].blue; } } /* If monitor section has no HSync/VRefresh data, * derive it from DDC data. */ static void SiSSetSyncRangeFromEdid(ScrnInfoPtr pScrn, int flag) { MonPtr mon = pScrn->monitor; xf86MonPtr ddc = mon->DDC; float myhhigh = 0.0, myhlow = 0.0, htest; int myvhigh = 0, myvlow = 0, vtest, i; UChar temp; const myhddctiming myhtiming[12] = { { 1, 0x20, 31.6 }, /* rounded up by .1 */ { 1, 0x80, 31.6 }, { 1, 0x02, 35.3 }, { 1, 0x04, 37.6 }, { 1, 0x08, 38.0 }, { 1, 0x01, 38.0 }, { 2, 0x40, 47.0 }, { 2, 0x80, 48.2 }, { 2, 0x08, 48.5 }, { 2, 0x04, 56.6 }, { 2, 0x02, 60.1 }, { 2, 0x01, 80.1 } }; const myvddctiming myvtiming[11] = { { 1, 0x02, 56 }, { 1, 0x01, 60 }, { 2, 0x08, 60 }, { 2, 0x04, 70 }, { 1, 0x80, 71 }, { 1, 0x08, 72 }, { 2, 0x80, 72 }, { 1, 0x04, 75 }, { 2, 0x40, 75 }, { 2, 0x02, 75 }, { 2, 0x01, 75 } }; if(flag) { /* HSync */ for(i = 0; i < 4; i++) { if(ddc->det_mon[i].type == DS_RANGES) { mon->nHsync = 1; mon->hsync[0].lo = ddc->det_mon[i].section.ranges.min_h; mon->hsync[0].hi = ddc->det_mon[i].section.ranges.max_h; if(mon->hsync[0].lo > 32.0 || mon->hsync[0].hi < 31.0) { if(ddc->timings1.t1 & 0x80) { mon->nHsync++; mon->hsync[1].lo = 31.0; mon->hsync[1].hi = 32.0; } } return; } } /* If no sync ranges detected in detailed timing table, we * derive them from supported VESA modes. */ for(i = 0; i < 12; i++) { if(myhtiming[i].whichone == 1) temp = ddc->timings1.t1; else temp = ddc->timings1.t2; if(temp & myhtiming[i].mask) { if((i == 0) || (myhlow > myhtiming[i].rate)) myhlow = myhtiming[i].rate; } if(myhtiming[11-i].whichone == 1) temp = ddc->timings1.t1; else temp = ddc->timings1.t2; if(temp & myhtiming[11-i].mask) { if((i == 0) || (myhhigh < myhtiming[11-i].rate)) myhhigh = myhtiming[11-i].rate; } } for(i = 0; i < STD_TIMINGS; i++) { if(ddc->timings2[i].hsize > 256) { htest = ddc->timings2[i].refresh * 1.05 * ddc->timings2[i].vsize / 1000.0; if(htest < myhlow) myhlow = htest; if(htest > myhhigh) myhhigh = htest; } } if((myhhigh > 0.0) && (myhlow > 0.0)) { mon->nHsync = 1; mon->hsync[0].lo = myhlow - 0.1; mon->hsync[0].hi = myhhigh; } } else { /* Vrefresh */ for(i = 0; i < 4; i++) { if(ddc->det_mon[i].type == DS_RANGES) { mon->nVrefresh = 1; mon->vrefresh[0].lo = ddc->det_mon[i].section.ranges.min_v; mon->vrefresh[0].hi = ddc->det_mon[i].section.ranges.max_v; if(mon->vrefresh[0].lo > 72 || mon->vrefresh[0].hi < 70) { if(ddc->timings1.t1 & 0x80) { mon->nVrefresh++; mon->vrefresh[1].lo = 71; mon->vrefresh[1].hi = 71; } } return; } } for(i = 0; i < 11; i++) { if(myvtiming[i].whichone == 1) temp = ddc->timings1.t1; else temp = ddc->timings1.t2; if(temp & myvtiming[i].mask) { if((i == 0) || (myvlow > myvtiming[i].rate)) myvlow = myvtiming[i].rate; } if(myvtiming[10-i].whichone == 1) temp = ddc->timings1.t1; else temp = ddc->timings1.t2; if(temp & myvtiming[10-i].mask) { if((i == 0) || (myvhigh < myvtiming[10-i].rate)) myvhigh = myvtiming[10-i].rate; } } for(i = 0; i < STD_TIMINGS; i++) { if(ddc->timings2[i].hsize > 256) { vtest = ddc->timings2[i].refresh; if(vtest < myvlow) myvlow = vtest; if(vtest > myvhigh) myvhigh = vtest; } } if((myvhigh > 0) && (myvlow > 0)) { mon->nVrefresh = 1; mon->vrefresh[0].lo = myvlow; mon->vrefresh[0].hi = myvhigh; } } } static Bool SiSAllowSyncOverride(SISPtr pSiS, Bool fromDDC) { if(!(pSiS->VBFlags2 & VB2_VIDEOBRIDGE)) return FALSE; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiS->SecondHead) { if((pSiS->VBFlags & CRT1_LCDA) && (!fromDDC)) return TRUE; } else { if((pSiS->VBFlags & CRT2_TV) || ((pSiS->VBFlags & CRT2_LCD) && (!fromDDC))) return TRUE; } return FALSE; } #endif #ifdef SISMERGED if(pSiS->MergedFB) { if((pSiS->VBFlags & CRT1_LCDA) && (!fromDDC)) return TRUE; return FALSE; } #endif if(!(pSiS->VBFlags & DISPTYPE_CRT1)) { if( (pSiS->VBFlags & CRT2_TV) || ((pSiS->VBFlags & CRT2_LCD) && (!fromDDC)) ) return TRUE; } else if((pSiS->VBFlags & CRT1_LCDA) && (!fromDDC)) return TRUE; return FALSE; } static Bool SiSCheckForH(float hsync, MonPtr monitor) { int i; for(i = 0; i < monitor->nHsync; i++) { if((hsync > monitor->hsync[i].lo * (1.0 - SYNC_TOLERANCE)) && (hsync < monitor->hsync[i].hi * (1.0 + SYNC_TOLERANCE))) break; } if(i == monitor->nHsync) return FALSE; return TRUE; } static Bool SiSCheckForV(float vrefresh, MonPtr monitor) { int i; for(i = 0; i < monitor->nVrefresh; i++) { if((vrefresh > monitor->vrefresh[i].lo * (1.0 - SYNC_TOLERANCE)) && (vrefresh < monitor->vrefresh[i].hi * (1.0 + SYNC_TOLERANCE))) break; } if(i == monitor->nVrefresh) return FALSE; return TRUE; } static Bool CheckAndOverruleH(ScrnInfoPtr pScrn, MonPtr monitor) { DisplayModePtr mode = monitor->Modes; float mymin = 30.0, mymax = 80.0, hsync; Bool doit = FALSE; for(hsync = mymin; hsync <= mymax; hsync += .5) { if(!SiSCheckForH(hsync, monitor)) doit = TRUE; } if(mode) { do { if(mode->type & M_T_BUILTIN) { hsync = (float)mode->Clock / (float)mode->HTotal; if(!SiSCheckForH(hsync, monitor)) { doit = TRUE; if(hsync < mymin) mymin = hsync; if(hsync > mymax) mymax = hsync; } } } while((mode = mode->next)); } if(doit) { monitor->nHsync = 1; monitor->hsync[0].lo = mymin; monitor->hsync[0].hi = mymax; return TRUE; } return FALSE; } static Bool CheckAndOverruleV(ScrnInfoPtr pScrn, MonPtr monitor) { DisplayModePtr mode = monitor->Modes; float mymin = 59.0, mymax = 61.0, vrefresh; Bool doit = FALSE, ret = FALSE; for(vrefresh = mymin; vrefresh <= mymax; vrefresh += 1.0) { if(!SiSCheckForV(vrefresh, monitor)) doit = TRUE; } if(mode) { do { if(mode->type & M_T_BUILTIN) { vrefresh = mode->Clock * 1000.0 / (mode->HTotal * mode->VTotal); if(mode->Flags & V_INTERLACE) vrefresh *= 2.0; if(mode->Flags & V_DBLSCAN) vrefresh /= 2.0; if(!SiSCheckForH(vrefresh, monitor)) { doit = TRUE; if(vrefresh < mymin) mymin = vrefresh; if(vrefresh > mymax) mymax = vrefresh; } } } while((mode = mode->next)); } if(doit) { monitor->nVrefresh = 1; monitor->vrefresh[0].lo = mymin; monitor->vrefresh[0].hi = mymax; ret = TRUE; } /* special for 640x400/320x200/@70Hz (VGA/IBM 720x480) */ if( (!SiSCheckForV(71, monitor)) && (monitor->nVrefresh < MAX_VREFRESH) ) { monitor->vrefresh[monitor->nVrefresh].lo = 71; monitor->vrefresh[monitor->nVrefresh].hi = 71; monitor->nVrefresh++; ret = TRUE; } return ret; } /* Some helper functions for MergedFB mode */ #ifdef SISMERGED /* Helper function for CRT2 monitor vrefresh/hsync options * (Code base from mga driver) */ static int SiSStrToRanges(range *r, char *s, int max) { float num = 0.0; int rangenum = 0; Bool gotdash = FALSE; Bool nextdash = FALSE; char *strnum = NULL; do { switch(*s) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '.': if(strnum == NULL) { strnum = s; gotdash = nextdash; nextdash = FALSE; } break; case '-': case ' ': case 0: if(strnum == NULL) break; sscanf(strnum, "%f", &num); strnum = NULL; if(gotdash) { r[rangenum - 1].hi = num; } else { r[rangenum].lo = num; r[rangenum].hi = num; rangenum++; } if(*s == '-') nextdash = (rangenum != 0); else if(rangenum >= max) return rangenum; break; default: return 0; } } while(*(s++) != 0); return rangenum; } /* Copy and link two modes (i, j) for mergedfb mode * (Code base taken from mga driver) * * - Copy mode i, merge j to copy of i, link the result to dest * - Link i and j in private record. * - If dest is NULL, return value is copy of i linked to itself. * - For mergedfb auto-config, we only check the dimension * against virtualX/Y, if they were user-provided. * - No special treatment required for CRTxxOffs. * - Provide fake dotclock in order to distinguish between similar * looking MetaModes (for RandR and VidMode extensions) * - Set unique VRefresh of dest mode for RandR */ static DisplayModePtr SiSCopyModeNLink(ScrnInfoPtr pScrn, DisplayModePtr dest, DisplayModePtr i, DisplayModePtr j, SiSScrn2Rel srel) { SISPtr pSiS = SISPTR(pScrn); DisplayModePtr mode; int dx = 0,dy = 0; if(!((mode = malloc(sizeof(DisplayModeRec))))) return dest; memcpy(mode, i, sizeof(DisplayModeRec)); if(!((mode->Private = malloc(sizeof(SiSMergedDisplayModeRec))))) { free(mode); return dest; } ((SiSMergedDisplayModePtr)mode->Private)->CRT1 = i; ((SiSMergedDisplayModePtr)mode->Private)->CRT2 = j; ((SiSMergedDisplayModePtr)mode->Private)->CRT2Position = srel; mode->PrivSize = 0; switch(srel) { case sisLeftOf: case sisRightOf: if(!(pScrn->display->virtualX)) { dx = i->HDisplay + j->HDisplay; } else { dx = min(pScrn->virtualX, i->HDisplay + j->HDisplay); } dx -= mode->HDisplay; if(!(pScrn->display->virtualY)) { dy = max(i->VDisplay, j->VDisplay); } else { dy = min(pScrn->virtualY, max(i->VDisplay, j->VDisplay)); } dy -= mode->VDisplay; break; case sisAbove: case sisBelow: if(!(pScrn->display->virtualY)) { dy = i->VDisplay + j->VDisplay; } else { dy = min(pScrn->virtualY, i->VDisplay + j->VDisplay); } dy -= mode->VDisplay; if(!(pScrn->display->virtualX)) { dx = max(i->HDisplay, j->HDisplay); } else { dx = min(pScrn->virtualX, max(i->HDisplay, j->HDisplay)); } dx -= mode->HDisplay; break; case sisClone: if(!(pScrn->display->virtualX)) { dx = max(i->HDisplay, j->HDisplay); } else { dx = min(pScrn->virtualX, max(i->HDisplay, j->HDisplay)); } dx -= mode->HDisplay; if(!(pScrn->display->virtualY)) { dy = max(i->VDisplay, j->VDisplay); } else { dy = min(pScrn->virtualY, max(i->VDisplay, j->VDisplay)); } dy -= mode->VDisplay; break; } mode->HDisplay += dx; mode->HSyncStart += dx; mode->HSyncEnd += dx; mode->HTotal += dx; mode->VDisplay += dy; mode->VSyncStart += dy; mode->VSyncEnd += dy; mode->VTotal += dy; mode->type = M_T_DEFAULT; #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,2,99,2,0) /* Set up as user defined (ie fake that the mode has been named in the * Modes-list in the screen section; corrects cycling with CTRL-ALT-[-+] * when source mode has not been listed there.) */ mode->type |= M_T_USERDEF; #endif /* Set the VRefresh field (in order to make RandR use it for the rates). We * simply set this to the refresh rate for the CRT1 mode (since CRT2 will * mostly be LCD or TV anyway). */ mode->VRefresh = SiSCalcVRate(i); if( ((mode->HDisplay * ((pScrn->bitsPerPixel + 7) / 8) * mode->VDisplay) > pSiS->maxxfbmem) || (mode->HDisplay > 4088) || (mode->VDisplay > 4096) ) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Skipped \"%s\" (%dx%d), not enough video RAM or beyond hardware specs\n", mode->name, mode->HDisplay, mode->VDisplay); free(mode->Private); free(mode); return dest; } #ifdef SISXINERAMA if(srel != sisClone) { pSiS->AtLeastOneNonClone = TRUE; } #endif /* Now see if the resulting mode would be discarded as a "size" by the * RandR extension, and increase its clock by 1000 in case it does. */ if(dest) { DisplayModePtr t = dest; do { if((t->HDisplay == mode->HDisplay) && (t->VDisplay == mode->VDisplay) && ((int)(t->VRefresh + .5) == (int)(mode->VRefresh + .5))) { mode->VRefresh += 1000.0; } t = t->next; } while((t) && (t != dest)); } /* Provide a fake but unique DotClock in order to trick the vidmode * extension to allow selecting among a number of modes whose merged result * looks identical but consists of different modes for CRT1 and CRT2 */ mode->Clock = (int)(mode->VRefresh * 1000.0); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Merged \"%s\" (%dx%d) and \"%s\" (%dx%d) to %dx%d (%d)%s\n", i->name, i->HDisplay, i->VDisplay, j->name, j->HDisplay, j->VDisplay, mode->HDisplay, mode->VDisplay, (int)mode->VRefresh, (srel == sisClone) ? " (Clone)" : ""); mode->next = mode; mode->prev = mode; if(dest) { mode->next = dest->next; /* Insert node after "dest" */ dest->next->prev = mode; mode->prev = dest; dest->next = mode; } return mode; } /* Helper function to find a mode from a given name * (Code base taken from mga driver) */ static DisplayModePtr SiSGetModeFromName(char* str, DisplayModePtr i) { DisplayModePtr c = i; if(!i) return NULL; do { if(strcmp(str, c->name) == 0) return c; c = c->next; } while(c != i); return NULL; } static DisplayModePtr SiSFindWidestTallestMode(DisplayModePtr i, Bool tallest) { DisplayModePtr c = i, d = NULL; int max = 0; if(!i) return NULL; do { if(tallest) { if(c->VDisplay > max) { max = c->VDisplay; d = c; } } else { if(c->HDisplay > max) { max = c->HDisplay; d = c; } } c = c->next; } while(c != i); return d; } static void SiSFindWidestTallestCommonMode(DisplayModePtr i, DisplayModePtr j, Bool tallest, DisplayModePtr *a, DisplayModePtr *b) { DisplayModePtr c = i, d; int max = 0; Bool foundone; (*a) = (*b) = NULL; if(!i || !j) return; do { d = j; foundone = FALSE; do { if( (c->HDisplay == d->HDisplay) && (c->VDisplay == d->VDisplay) ) { foundone = TRUE; break; } d = d->next; } while(d != j); if(foundone) { if(tallest) { if(c->VDisplay > max) { max = c->VDisplay; (*a) = c; (*b) = d; } } else { if(c->HDisplay > max) { max = c->HDisplay; (*a) = c; (*b) = d; } } } c = c->next; } while(c != i); } static DisplayModePtr SiSGenerateModeListFromLargestModes(ScrnInfoPtr pScrn, DisplayModePtr i, DisplayModePtr j, SiSScrn2Rel srel) { #ifdef SISXINERAMA SISPtr pSiS = SISPTR(pScrn); #endif DisplayModePtr mode1 = NULL; DisplayModePtr mode2 = NULL; DisplayModePtr mode3 = NULL; DisplayModePtr mode4 = NULL; DisplayModePtr result = NULL; #ifdef SISXINERAMA pSiS->AtLeastOneNonClone = FALSE; #endif /* Now build a default list of MetaModes. * - Non-clone: If the user enabled NonRectangular, we use the * largest mode for each CRT1 and CRT2. If not, we use the largest * common mode for CRT1 and CRT2 (if available). Additionally, and * regardless if the above, we produce a clone mode consisting of * the largest common mode (if available) in order to use DGA. * - Clone: If the (global) CRT2Position is Clone, we use the * largest common mode if available, otherwise the first two modes * in each list. */ switch(srel) { case sisLeftOf: case sisRightOf: mode1 = SiSFindWidestTallestMode(i, FALSE); mode2 = SiSFindWidestTallestMode(j, FALSE); SiSFindWidestTallestCommonMode(i, j, FALSE, &mode3, &mode4); break; case sisAbove: case sisBelow: mode1 = SiSFindWidestTallestMode(i, TRUE); mode2 = SiSFindWidestTallestMode(j, TRUE); SiSFindWidestTallestCommonMode(i, j, TRUE, &mode3, &mode4); break; case sisClone: SiSFindWidestTallestCommonMode(i, j, FALSE, &mode3, &mode4); if(mode3 && mode4) { mode1 = mode3; mode2 = mode4; } else { mode1 = i; mode2 = j; } } if(srel != sisClone) { if(mode3 && mode4 && !pSiS->NonRect) { mode1 = mode3; mode2 = mode2; } } if(mode1 && mode2) { result = SiSCopyModeNLink(pScrn, result, mode1, mode2, srel); } if(srel != sisClone) { if(mode3 && mode4) { result = SiSCopyModeNLink(pScrn, result, mode3, mode4, sisClone); } } return result; } /* Generate the merged-fb mode modelist * (Taken from mga driver) */ static DisplayModePtr SiSGenerateModeListFromMetaModes(ScrnInfoPtr pScrn, char* str, DisplayModePtr i, DisplayModePtr j, SiSScrn2Rel srel) { #ifdef SISXINERAMA SISPtr pSiS = SISPTR(pScrn); #endif char* strmode = str; char modename[256]; Bool gotdash = FALSE; char gotsep = 0; SiSScrn2Rel sr; DisplayModePtr mode1 = NULL; DisplayModePtr mode2 = NULL; DisplayModePtr result = NULL; int myslen; #ifdef SISXINERAMA pSiS->AtLeastOneNonClone = FALSE; #endif do { switch(*str) { case 0: case '-': case '+': case ' ': case ',': case ';': if(strmode != str) { myslen = str - strmode; if(myslen > 255) myslen = 255; strncpy(modename, strmode, myslen); modename[myslen] = 0; if(gotdash) { if(mode1 == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Error parsing MetaModes parameter\n"); return NULL; } mode2 = SiSGetModeFromName(modename, j); if(!mode2) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Mode \"%s\" is not a supported mode for CRT2\n", modename); xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "\t(Skipping metamode \"%s%c%s\")\n", mode1->name, gotsep, modename); mode1 = NULL; gotsep = 0; } } else { mode1 = SiSGetModeFromName(modename, i); if(!mode1) { char* tmps = str; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Mode \"%s\" is not a supported mode for CRT1\n", modename); while(*tmps == ' ' || *tmps == ';') tmps++; /* skip the next mode */ if(*tmps == '-' || *tmps == '+' || *tmps == ',') { tmps++; /* skip spaces */ while(*tmps == ' ' || *tmps == ';') tmps++; /* skip modename */ while(*tmps && *tmps != ' ' && *tmps != ';' && *tmps != '-' && *tmps != '+' && *tmps != ',') tmps++; myslen = tmps - strmode; if(myslen > 255) myslen = 255; strncpy(modename,strmode,myslen); modename[myslen] = 0; str = tmps - 1; } xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "\t(Skipping metamode \"%s\")\n", modename); mode1 = NULL; gotsep = 0; } } gotdash = FALSE; } strmode = str + 1; gotdash |= (*str == '-' || *str == '+' || *str == ','); if (*str == '-' || *str == '+' || *str == ',') gotsep = *str; if(*str != 0) break; /* Fall through otherwise */ default: if(!gotdash && mode1) { sr = srel; if(gotsep == '+') sr = sisClone; if(!mode2) { mode2 = SiSGetModeFromName(mode1->name, j); sr = sisClone; } if(!mode2) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Mode \"%s\" is not a supported mode for CRT2\n", mode1->name); xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "\t(Skipping metamode \"%s\")\n", modename); mode1 = NULL; } else { result = SiSCopyModeNLink(pScrn, result, mode1, mode2, sr); mode1 = NULL; mode2 = NULL; } gotsep = 0; } break; } } while(*(str++) != 0); return result; } static DisplayModePtr SiSGenerateModeList(ScrnInfoPtr pScrn, char* str, DisplayModePtr i, DisplayModePtr j, SiSScrn2Rel srel) { SISPtr pSiS = SISPTR(pScrn); if(str != NULL) { return(SiSGenerateModeListFromMetaModes(pScrn, str, i, j, srel)); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No MetaModes given, linking %s modes by default\n", (srel == sisClone) ? "largest common" : (pSiS->NonRect ? (((srel == sisLeftOf) || (srel == sisRightOf)) ? "widest" : "tallest") : (((srel == sisLeftOf) || (srel == sisRightOf)) ? "widest common" : "tallest common")) ); return(SiSGenerateModeListFromLargestModes(pScrn, i, j, srel)); } } static void SiSRecalcDefaultVirtualSize(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); DisplayModePtr mode, bmode; int maxh, maxv; static const char *str = "MergedFB: Virtual %s %d\n"; static const char *errstr = "Virtual %s to small for given CRT2Position offset\n"; mode = bmode = pScrn->modes; maxh = maxv = 0; do { if(mode->HDisplay > maxh) maxh = mode->HDisplay; if(mode->VDisplay > maxv) maxv = mode->VDisplay; mode = mode->next; } while(mode != bmode); maxh += pSiS->CRT1XOffs + pSiS->CRT2XOffs; maxv += pSiS->CRT1YOffs + pSiS->CRT2YOffs; if(!(pScrn->display->virtualX)) { if(maxh > 4088) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Virtual width with CRT2Position offset beyond hardware specs\n"); pSiS->CRT1XOffs = pSiS->CRT2XOffs = 0; maxh -= (pSiS->CRT1XOffs + pSiS->CRT2XOffs); } pScrn->virtualX = maxh; pScrn->displayWidth = maxh; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, str, "width", maxh); } else { if(maxh < pScrn->display->virtualX) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, errstr, "width"); pSiS->CRT1XOffs = pSiS->CRT2XOffs = 0; } } if(!(pScrn->display->virtualY)) { pScrn->virtualY = maxv; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, str, "height", maxv); } else { if(maxv < pScrn->display->virtualY) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, errstr, "height"); pSiS->CRT1YOffs = pSiS->CRT2YOffs = 0; } } } static void SiSMergedFBSetDpi(ScrnInfoPtr pScrn1, ScrnInfoPtr pScrn2, SiSScrn2Rel srel) { SISPtr pSiS = SISPTR(pScrn1); MessageType from = X_DEFAULT; xf86MonPtr DDC1 = (xf86MonPtr)(pScrn1->monitor->DDC); xf86MonPtr DDC2 = (xf86MonPtr)(pScrn2->monitor->DDC); int ddcWidthmm = 0, ddcHeightmm = 0; const char *dsstr = "MergedFB: Display dimensions: (%d, %d) mm\n"; /* This sets the DPI for MergedFB mode. The problem is that * this can never be exact, because the output devices may * have different dimensions. This function tries to compromise * through a few assumptions, and it just calculates an average DPI * value for both monitors. */ /* Given DisplaySize should regard BOTH monitors */ pScrn1->widthmm = pScrn1->monitor->widthmm; pScrn1->heightmm = pScrn1->monitor->heightmm; /* Get DDC display size; if only either CRT1 or CRT2 provided these, * assume equal dimensions for both, otherwise add dimensions */ if( (DDC1 && (DDC1->features.hsize > 0 && DDC1->features.vsize > 0)) && (DDC2 && (DDC2->features.hsize > 0 && DDC2->features.vsize > 0)) ) { ddcWidthmm = max(DDC1->features.hsize, DDC2->features.hsize) * 10; ddcHeightmm = max(DDC1->features.vsize, DDC2->features.vsize) * 10; switch(srel) { case sisLeftOf: case sisRightOf: ddcWidthmm = (DDC1->features.hsize + DDC2->features.hsize) * 10; break; case sisAbove: case sisBelow: ddcHeightmm = (DDC1->features.vsize + DDC2->features.vsize) * 10; default: break; } } else if(DDC1 && (DDC1->features.hsize > 0 && DDC1->features.vsize > 0)) { ddcWidthmm = DDC1->features.hsize * 10; ddcHeightmm = DDC1->features.vsize * 10; switch(srel) { case sisLeftOf: case sisRightOf: ddcWidthmm *= 2; break; case sisAbove: case sisBelow: ddcHeightmm *= 2; default: break; } } else if(DDC2 && (DDC2->features.hsize > 0 && DDC2->features.vsize > 0) ) { ddcWidthmm = DDC2->features.hsize * 10; ddcHeightmm = DDC2->features.vsize * 10; switch(srel) { case sisLeftOf: case sisRightOf: ddcWidthmm *= 2; break; case sisAbove: case sisBelow: ddcHeightmm *= 2; default: break; } } if(monitorResolution > 0) { /* Set command line given values (overrules given options) */ pScrn1->xDpi = monitorResolution; pScrn1->yDpi = monitorResolution; from = X_CMDLINE; } else if(pSiS->MergedFBXDPI) { /* Set option-wise given values (overrule DisplaySize) */ pScrn1->xDpi = pSiS->MergedFBXDPI; pScrn1->yDpi = pSiS->MergedFBYDPI; from = X_CONFIG; } else if(pScrn1->widthmm > 0 || pScrn1->heightmm > 0) { /* Set values calculated from given DisplaySize */ from = X_CONFIG; if(pScrn1->widthmm > 0) { pScrn1->xDpi = (int)((double)pScrn1->virtualX * 25.4 / pScrn1->widthmm); } if(pScrn1->heightmm > 0) { pScrn1->yDpi = (int)((double)pScrn1->virtualY * 25.4 / pScrn1->heightmm); } xf86DrvMsg(pScrn1->scrnIndex, from, dsstr, pScrn1->widthmm, pScrn1->heightmm); } else if(ddcWidthmm && ddcHeightmm) { /* Set values from DDC-provided display size */ from = X_PROBED; xf86DrvMsg(pScrn1->scrnIndex, from, dsstr, ddcWidthmm, ddcHeightmm ); pScrn1->widthmm = ddcWidthmm; pScrn1->heightmm = ddcHeightmm; if(pScrn1->widthmm > 0) { pScrn1->xDpi = (int)((double)pScrn1->virtualX * 25.4 / pScrn1->widthmm); } if(pScrn1->heightmm > 0) { pScrn1->yDpi = (int)((double)pScrn1->virtualY * 25.4 / pScrn1->heightmm); } } else { pScrn1->xDpi = pScrn1->yDpi = DEFAULT_DPI; } /* Sanity check */ if(pScrn1->xDpi > 0 && pScrn1->yDpi <= 0) pScrn1->yDpi = pScrn1->xDpi; if(pScrn1->yDpi > 0 && pScrn1->xDpi <= 0) pScrn1->xDpi = pScrn1->yDpi; pScrn2->xDpi = pScrn1->xDpi; pScrn2->yDpi = pScrn1->yDpi; xf86DrvMsg(pScrn1->scrnIndex, from, "MergedFB: DPI set to (%d, %d)\n", pScrn1->xDpi, pScrn1->yDpi); } /* Pseudo-Xinerama extension for MergedFB mode */ #ifdef SISXINERAMA static void SiSUpdateXineramaScreenInfo(ScrnInfoPtr pScrn1) { SISPtr pSiS = SISPTR(pScrn1); int crt1scrnnum = 0, crt2scrnnum = 1; int x1=0, x2=0, y1=0, y2=0, h1=0, h2=0, w1=0, w2=0; int realvirtX, realvirtY; DisplayModePtr currentMode, firstMode; Bool infochanged = FALSE; Bool usenonrect = pSiS->NonRect; const char *rectxine = "\t... setting up rectangular Xinerama layout\n"; pSiS->MBXNR1XMAX = pSiS->MBXNR1YMAX = pSiS->MBXNR2XMAX = pSiS->MBXNR2YMAX = 65536; pSiS->HaveNonRect = pSiS->HaveOffsRegions = FALSE; if(!pSiS->MergedFB) return; if(SiSnoPanoramiXExtension) return; if(!SiSXineramadataPtr) return; if(pSiS->CRT2IsScrn0) { crt1scrnnum = 1; crt2scrnnum = 0; } /* Attention: Usage of RandR may lead to virtual X and Y dimensions * actually smaller than our MetaModes. To avoid this, we calculate * the maxCRT fields here (and not somewhere else, like in CopyNLink) * * *** Note: RandR is disabled if one of CRTxxOffs is non-zero. */ /* "Real" virtual: Virtual without the Offset */ realvirtX = pScrn1->virtualX - pSiS->CRT1XOffs - pSiS->CRT2XOffs; realvirtY = pScrn1->virtualY - pSiS->CRT1YOffs - pSiS->CRT2YOffs; if((pSiS->SiSXineramaVX != pScrn1->virtualX) || (pSiS->SiSXineramaVY != pScrn1->virtualY)) { if(!(pScrn1->modes)) return; pSiS->maxCRT1_X1 = pSiS->maxCRT1_X2 = 0; pSiS->maxCRT1_Y1 = pSiS->maxCRT1_Y2 = 0; pSiS->maxCRT2_X1 = pSiS->maxCRT2_X2 = 0; pSiS->maxCRT2_Y1 = pSiS->maxCRT2_Y2 = 0; pSiS->maxClone_X1 = pSiS->maxClone_X2 = 0; pSiS->maxClone_Y1 = pSiS->maxClone_Y2 = 0; currentMode = firstMode = pScrn1->modes; do { DisplayModePtr p = currentMode->next; DisplayModePtr i = ((SiSMergedDisplayModePtr)currentMode->Private)->CRT1; DisplayModePtr j = ((SiSMergedDisplayModePtr)currentMode->Private)->CRT2; SiSScrn2Rel srel = ((SiSMergedDisplayModePtr)currentMode->Private)->CRT2Position; if((currentMode->HDisplay <= realvirtX) && (currentMode->VDisplay <= realvirtY) && (i->HDisplay <= realvirtX) && (j->HDisplay <= realvirtX) && (i->VDisplay <= realvirtY) && (j->VDisplay <= realvirtY)) { if(srel != sisClone) { if(pSiS->maxCRT1_X1 == i->HDisplay) { if(pSiS->maxCRT1_X2 < j->HDisplay) { pSiS->maxCRT1_X2 = j->HDisplay; /* Widest CRT2 mode displayed with widest CRT1 mode */ } } else if(pSiS->maxCRT1_X1 < i->HDisplay) { pSiS->maxCRT1_X1 = i->HDisplay; /* Widest CRT1 mode */ pSiS->maxCRT1_X2 = j->HDisplay; } if(pSiS->maxCRT2_X2 == j->HDisplay) { if(pSiS->maxCRT2_X1 < i->HDisplay) { pSiS->maxCRT2_X1 = i->HDisplay; /* Widest CRT1 mode displayed with widest CRT2 mode */ } } else if(pSiS->maxCRT2_X2 < j->HDisplay) { pSiS->maxCRT2_X2 = j->HDisplay; /* Widest CRT2 mode */ pSiS->maxCRT2_X1 = i->HDisplay; } if(pSiS->maxCRT1_Y1 == i->VDisplay) { /* Same as above, but tallest instead of widest */ if(pSiS->maxCRT1_Y2 < j->VDisplay) { pSiS->maxCRT1_Y2 = j->VDisplay; } } else if(pSiS->maxCRT1_Y1 < i->VDisplay) { pSiS->maxCRT1_Y1 = i->VDisplay; pSiS->maxCRT1_Y2 = j->VDisplay; } if(pSiS->maxCRT2_Y2 == j->VDisplay) { if(pSiS->maxCRT2_Y1 < i->VDisplay) { pSiS->maxCRT2_Y1 = i->VDisplay; } } else if(pSiS->maxCRT2_Y2 < j->VDisplay) { pSiS->maxCRT2_Y2 = j->VDisplay; pSiS->maxCRT2_Y1 = i->VDisplay; } } else { if(pSiS->maxClone_X1 < i->HDisplay) { pSiS->maxClone_X1 = i->HDisplay; } if(pSiS->maxClone_X2 < j->HDisplay) { pSiS->maxClone_X2 = j->HDisplay; } if(pSiS->maxClone_Y1 < i->VDisplay) { pSiS->maxClone_Y1 = i->VDisplay; } if(pSiS->maxClone_Y2 < j->VDisplay) { pSiS->maxClone_Y2 = j->VDisplay; } } } currentMode = p; } while((currentMode) && (currentMode != firstMode)); pSiS->SiSXineramaVX = pScrn1->virtualX; pSiS->SiSXineramaVY = pScrn1->virtualY; infochanged = TRUE; } if((usenonrect) && (pSiS->CRT2Position != sisClone) && pSiS->maxCRT1_X1) { switch(pSiS->CRT2Position) { case sisLeftOf: case sisRightOf: if((pSiS->maxCRT1_Y1 != realvirtY) && (pSiS->maxCRT2_Y2 != realvirtY)) { usenonrect = FALSE; } break; case sisAbove: case sisBelow: if((pSiS->maxCRT1_X1 != realvirtX) && (pSiS->maxCRT2_X2 != realvirtX)) { usenonrect = FALSE; } break; case sisClone: break; } if(infochanged && !usenonrect) { xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "Virtual screen size does not match maximum display modes...\n"); xf86DrvMsg(pScrn1->scrnIndex, X_INFO, rectxine); } } else if(infochanged && usenonrect) { usenonrect = FALSE; xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "Only clone modes available for this virtual screen size...\n"); xf86DrvMsg(pScrn1->scrnIndex, X_INFO, rectxine); } if(pSiS->maxCRT1_X1) { /* Means we have at least one non-clone mode */ switch(pSiS->CRT2Position) { case sisLeftOf: x1 = min(pSiS->maxCRT1_X2, pScrn1->virtualX - pSiS->maxCRT1_X1); if(x1 < 0) x1 = 0; y1 = pSiS->CRT1YOffs; w1 = pScrn1->virtualX - x1; h1 = realvirtY; if((usenonrect) && (pSiS->maxCRT1_Y1 != realvirtY)) { h1 = pSiS->MBXNR1YMAX = pSiS->maxCRT1_Y1; pSiS->NonRectDead.x0 = x1; pSiS->NonRectDead.x1 = x1 + w1 - 1; pSiS->NonRectDead.y0 = y1 + h1; pSiS->NonRectDead.y1 = pScrn1->virtualY - 1; pSiS->HaveNonRect = TRUE; } x2 = 0; y2 = pSiS->CRT2YOffs; w2 = max(pSiS->maxCRT2_X2, pScrn1->virtualX - pSiS->maxCRT2_X1); if(w2 > pScrn1->virtualX) w2 = pScrn1->virtualX; h2 = realvirtY; if((usenonrect) && (pSiS->maxCRT2_Y2 != realvirtY)) { h2 = pSiS->MBXNR2YMAX = pSiS->maxCRT2_Y2; pSiS->NonRectDead.x0 = x2; pSiS->NonRectDead.x1 = x2 + w2 - 1; pSiS->NonRectDead.y0 = y2 + h2; pSiS->NonRectDead.y1 = pScrn1->virtualY - 1; pSiS->HaveNonRect = TRUE; } break; case sisRightOf: x1 = 0; y1 = pSiS->CRT1YOffs; w1 = max(pSiS->maxCRT1_X1, pScrn1->virtualX - pSiS->maxCRT1_X2); if(w1 > pScrn1->virtualX) w1 = pScrn1->virtualX; h1 = realvirtY; if((usenonrect) && (pSiS->maxCRT1_Y1 != realvirtY)) { h1 = pSiS->MBXNR1YMAX = pSiS->maxCRT1_Y1; pSiS->NonRectDead.x0 = x1; pSiS->NonRectDead.x1 = x1 + w1 - 1; pSiS->NonRectDead.y0 = y1 + h1; pSiS->NonRectDead.y1 = pScrn1->virtualY - 1; pSiS->HaveNonRect = TRUE; } x2 = min(pSiS->maxCRT2_X1, pScrn1->virtualX - pSiS->maxCRT2_X2); if(x2 < 0) x2 = 0; y2 = pSiS->CRT2YOffs; w2 = pScrn1->virtualX - x2; h2 = realvirtY; if((usenonrect) && (pSiS->maxCRT2_Y2 != realvirtY)) { h2 = pSiS->MBXNR2YMAX = pSiS->maxCRT2_Y2; pSiS->NonRectDead.x0 = x2; pSiS->NonRectDead.x1 = x2 + w2 - 1; pSiS->NonRectDead.y0 = y2 + h2; pSiS->NonRectDead.y1 = pScrn1->virtualY - 1; pSiS->HaveNonRect = TRUE; } break; case sisAbove: x1 = pSiS->CRT1XOffs; y1 = min(pSiS->maxCRT1_Y2, pScrn1->virtualY - pSiS->maxCRT1_Y1); if(y1 < 0) y1 = 0; w1 = realvirtX; h1 = pScrn1->virtualY - y1; if((usenonrect) && (pSiS->maxCRT1_X1 != realvirtX)) { w1 = pSiS->MBXNR1XMAX = pSiS->maxCRT1_X1; pSiS->NonRectDead.x0 = x1 + w1; pSiS->NonRectDead.x1 = pScrn1->virtualX - 1; pSiS->NonRectDead.y0 = y1; pSiS->NonRectDead.y1 = y1 + h1 - 1; pSiS->HaveNonRect = TRUE; } x2 = pSiS->CRT2XOffs; y2 = 0; w2 = realvirtX; h2 = max(pSiS->maxCRT2_Y2, pScrn1->virtualY - pSiS->maxCRT2_Y1); if(h2 > pScrn1->virtualY) h2 = pScrn1->virtualY; if((usenonrect) && (pSiS->maxCRT2_X2 != realvirtX)) { w2 = pSiS->MBXNR2XMAX = pSiS->maxCRT2_X2; pSiS->NonRectDead.x0 = x2 + w2; pSiS->NonRectDead.x1 = pScrn1->virtualX - 1; pSiS->NonRectDead.y0 = y2; pSiS->NonRectDead.y1 = y2 + h2 - 1; pSiS->HaveNonRect = TRUE; } break; case sisBelow: x1 = pSiS->CRT1XOffs; y1 = 0; w1 = realvirtX; h1 = max(pSiS->maxCRT1_Y1, pScrn1->virtualY - pSiS->maxCRT1_Y2); if(h1 > pScrn1->virtualY) h1 = pScrn1->virtualY; if((usenonrect) && (pSiS->maxCRT1_X1 != realvirtX)) { w1 = pSiS->MBXNR1XMAX = pSiS->maxCRT1_X1; pSiS->NonRectDead.x0 = x1 + w1; pSiS->NonRectDead.x1 = pScrn1->virtualX - 1; pSiS->NonRectDead.y0 = y1; pSiS->NonRectDead.y1 = y1 + h1 - 1; pSiS->HaveNonRect = TRUE; } x2 = pSiS->CRT2XOffs; y2 = min(pSiS->maxCRT2_Y1, pScrn1->virtualY - pSiS->maxCRT2_Y2); if(y2 < 0) y2 = 0; w2 = realvirtX; h2 = pScrn1->virtualY - y2; if((usenonrect) && (pSiS->maxCRT2_X2 != realvirtX)) { w2 = pSiS->MBXNR2XMAX = pSiS->maxCRT2_X2; pSiS->NonRectDead.x0 = x2 + w2; pSiS->NonRectDead.x1 = pScrn1->virtualX - 1; pSiS->NonRectDead.y0 = y2; pSiS->NonRectDead.y1 = y2 + h2 - 1; pSiS->HaveNonRect = TRUE; } default: break; } switch(pSiS->CRT2Position) { case sisLeftOf: case sisRightOf: if(pSiS->CRT1YOffs) { pSiS->OffDead1.x0 = x1; pSiS->OffDead1.x1 = x1 + w1 - 1; pSiS->OffDead1.y0 = 0; pSiS->OffDead1.y1 = y1 - 1; pSiS->OffDead2.x0 = x2; pSiS->OffDead2.x1 = x2 + w2 - 1; pSiS->OffDead2.y0 = y2 + h2; pSiS->OffDead2.y1 = pScrn1->virtualY - 1; pSiS->HaveOffsRegions = TRUE; } else if(pSiS->CRT2YOffs) { pSiS->OffDead1.x0 = x2; pSiS->OffDead1.x1 = x2 + w2 - 1; pSiS->OffDead1.y0 = 0; pSiS->OffDead1.y1 = y2 - 1; pSiS->OffDead2.x0 = x1; pSiS->OffDead2.x1 = x1 + w1 - 1; pSiS->OffDead2.y0 = y1 + h1; pSiS->OffDead2.y1 = pScrn1->virtualY - 1; pSiS->HaveOffsRegions = TRUE; } break; case sisAbove: case sisBelow: if(pSiS->CRT1XOffs) { pSiS->OffDead1.x0 = x2 + w2; pSiS->OffDead1.x1 = pScrn1->virtualX - 1; pSiS->OffDead1.y0 = y2; pSiS->OffDead1.y1 = y2 + h2 - 1; pSiS->OffDead2.x0 = 0; pSiS->OffDead2.x1 = x1 - 1; pSiS->OffDead2.y0 = y1; pSiS->OffDead2.y1 = y1 + h1 - 1; pSiS->HaveOffsRegions = TRUE; } else if(pSiS->CRT2XOffs) { pSiS->OffDead1.x0 = x1 + w1; pSiS->OffDead1.x1 = pScrn1->virtualX - 1; pSiS->OffDead1.y0 = y1; pSiS->OffDead1.y1 = y1 + h1 - 1; pSiS->OffDead2.x0 = 0; pSiS->OffDead2.x1 = x2 - 1; pSiS->OffDead2.y0 = y2; pSiS->OffDead2.y1 = y2 + h2 - 1; pSiS->HaveOffsRegions = TRUE; } default: break; } } else { /* Only clone-modes left */ x1 = x2 = 0; y1 = y2 = 0; w1 = w2 = max(pSiS->maxClone_X1, pSiS->maxClone_X2); h1 = h2 = max(pSiS->maxClone_Y1, pSiS->maxClone_Y2); } SiSXineramadataPtr[crt1scrnnum].x = x1; SiSXineramadataPtr[crt1scrnnum].y = y1; SiSXineramadataPtr[crt1scrnnum].width = w1; SiSXineramadataPtr[crt1scrnnum].height = h1; SiSXineramadataPtr[crt2scrnnum].x = x2; SiSXineramadataPtr[crt2scrnnum].y = y2; SiSXineramadataPtr[crt2scrnnum].width = w2; SiSXineramadataPtr[crt2scrnnum].height = h2; if(infochanged) { xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "Pseudo-Xinerama: CRT1 (Screen %d) (%d,%d)-(%d,%d)\n", crt1scrnnum, x1, y1, w1+x1-1, h1+y1-1); xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "Pseudo-Xinerama: CRT2 (Screen %d) (%d,%d)-(%d,%d)\n", crt2scrnnum, x2, y2, w2+x2-1, h2+y2-1); if(pSiS->HaveNonRect) { xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "Pseudo-Xinerama: Inaccessible area (%d,%d)-(%d,%d)\n", pSiS->NonRectDead.x0, pSiS->NonRectDead.y0, pSiS->NonRectDead.x1, pSiS->NonRectDead.y1); } if(pSiS->HaveOffsRegions) { xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "Pseudo-Xinerama: Inaccessible offset area (%d,%d)-(%d,%d)\n", pSiS->OffDead1.x0, pSiS->OffDead1.y0, pSiS->OffDead1.x1, pSiS->OffDead1.y1); xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "Pseudo-Xinerama: Inaccessible offset area (%d,%d)-(%d,%d)\n", pSiS->OffDead2.x0, pSiS->OffDead2.y0, pSiS->OffDead2.x1, pSiS->OffDead2.y1); } if(pSiS->HaveNonRect || pSiS->HaveOffsRegions) { xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "Mouse restriction for inaccessible areas is %s\n", pSiS->MouseRestrictions ? "enabled" : "disabled"); } } } /* Proc */ int SiSProcXineramaQueryVersion(ClientPtr client) { xPanoramiXQueryVersionReply rep; register int n; REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; rep.majorVersion = SIS_XINERAMA_MAJOR_VERSION; rep.minorVersion = SIS_XINERAMA_MINOR_VERSION; if(client->swapped) { _swaps(&rep.sequenceNumber, n); _swapl(&rep.length, n); _swaps(&rep.majorVersion, n); _swaps(&rep.minorVersion, n); } WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep); return (client->noClientException); } int SiSProcXineramaGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); WindowPtr pWin; xPanoramiXGetStateReply rep; register int n; int rc; REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; rep.state = !SiSnoPanoramiXExtension; if(client->swapped) { _swaps (&rep.sequenceNumber, n); _swapl (&rep.length, n); } WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep); return client->noClientException; } int SiSProcXineramaGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); WindowPtr pWin; xPanoramiXGetScreenCountReply rep; register int n; int rc; REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; rep.ScreenCount = SiSXineramaNumScreens; if(client->swapped) { _swaps(&rep.sequenceNumber, n); _swapl(&rep.length, n); } WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); return client->noClientException; } int SiSProcXineramaGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); WindowPtr pWin; xPanoramiXGetScreenSizeReply rep; register int n; int rc; REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; rep.width = SiSXineramadataPtr[stuff->screen].width; rep.height = SiSXineramadataPtr[stuff->screen].height; if(client->swapped) { _swaps(&rep.sequenceNumber, n); _swapl(&rep.length, n); _swapl(&rep.width, n); _swapl(&rep.height, n); } WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); return client->noClientException; } int SiSProcXineramaIsActive(ClientPtr client) { xXineramaIsActiveReply rep; REQUEST_SIZE_MATCH(xXineramaIsActiveReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; rep.state = !SiSnoPanoramiXExtension; if(client->swapped) { register int n; _swaps(&rep.sequenceNumber, n); _swapl(&rep.length, n); _swapl(&rep.state, n); } WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); return client->noClientException; } int SiSProcXineramaQueryScreens(ClientPtr client) { xXineramaQueryScreensReply rep; REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.number = (SiSnoPanoramiXExtension) ? 0 : SiSXineramaNumScreens; rep.length = rep.number * sz_XineramaScreenInfo >> 2; if(client->swapped) { register int n; _swaps(&rep.sequenceNumber, n); _swapl(&rep.length, n); _swapl(&rep.number, n); } WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *)&rep); if(!SiSnoPanoramiXExtension) { xXineramaScreenInfo scratch; int i; for(i = 0; i < SiSXineramaNumScreens; i++) { scratch.x_org = SiSXineramadataPtr[i].x; scratch.y_org = SiSXineramadataPtr[i].y; scratch.width = SiSXineramadataPtr[i].width; scratch.height = SiSXineramadataPtr[i].height; if(client->swapped) { register int n; _swaps(&scratch.x_org, n); _swaps(&scratch.y_org, n); _swaps(&scratch.width, n); _swaps(&scratch.height, n); } WriteToClient(client, sz_XineramaScreenInfo, (char *)&scratch); } } return client->noClientException; } static int SiSProcXineramaDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_PanoramiXQueryVersion: return SiSProcXineramaQueryVersion(client); case X_PanoramiXGetState: return SiSProcXineramaGetState(client); case X_PanoramiXGetScreenCount: return SiSProcXineramaGetScreenCount(client); case X_PanoramiXGetScreenSize: return SiSProcXineramaGetScreenSize(client); case X_XineramaIsActive: return SiSProcXineramaIsActive(client); case X_XineramaQueryScreens: return SiSProcXineramaQueryScreens(client); } return BadRequest; } /* SProc */ static int SiSSProcXineramaQueryVersion (ClientPtr client) { REQUEST(xPanoramiXQueryVersionReq); register int n; _swaps(&stuff->length,n); REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); return SiSProcXineramaQueryVersion(client); } static int SiSSProcXineramaGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); register int n; _swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); return SiSProcXineramaGetState(client); } static int SiSSProcXineramaGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); register int n; _swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); return SiSProcXineramaGetScreenCount(client); } static int SiSSProcXineramaGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); register int n; _swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); return SiSProcXineramaGetScreenSize(client); } static int SiSSProcXineramaIsActive(ClientPtr client) { REQUEST(xXineramaIsActiveReq); register int n; _swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xXineramaIsActiveReq); return SiSProcXineramaIsActive(client); } static int SiSSProcXineramaQueryScreens(ClientPtr client) { REQUEST(xXineramaQueryScreensReq); register int n; _swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); return SiSProcXineramaQueryScreens(client); } int SiSSProcXineramaDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { case X_PanoramiXQueryVersion: return SiSSProcXineramaQueryVersion(client); case X_PanoramiXGetState: return SiSSProcXineramaGetState(client); case X_PanoramiXGetScreenCount: return SiSSProcXineramaGetScreenCount(client); case X_PanoramiXGetScreenSize: return SiSSProcXineramaGetScreenSize(client); case X_XineramaIsActive: return SiSSProcXineramaIsActive(client); case X_XineramaQueryScreens: return SiSSProcXineramaQueryScreens(client); } return BadRequest; } static void SiSXineramaResetProc(ExtensionEntry* extEntry) { /* Called by CloseDownExtensions() */ if(SiSXineramadataPtr) { free(SiSXineramadataPtr); SiSXineramadataPtr = NULL; } } static void SiSXineramaExtensionInit(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); Bool success = FALSE; if(!(SiSXineramadataPtr)) { if(!pSiS->MergedFB) { SiSnoPanoramiXExtension = TRUE; pSiS->MouseRestrictions = FALSE; return; } #ifdef PANORAMIX if(!noPanoramiXExtension) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Xinerama active, not initializing SiS Pseudo-Xinerama\n"); SiSnoPanoramiXExtension = TRUE; pSiS->MouseRestrictions = FALSE; return; } #endif if(SiSnoPanoramiXExtension) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SiS Pseudo-Xinerama disabled\n"); pSiS->MouseRestrictions = FALSE; return; } if(pSiS->CRT2Position == sisClone) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Running MergedFB in Clone mode, SiS Pseudo-Xinerama disabled\n"); SiSnoPanoramiXExtension = TRUE; pSiS->MouseRestrictions = FALSE; return; } if(!(pSiS->AtLeastOneNonClone)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Only Clone modes defined, SiS Pseudo-Xinerama disabled\n"); SiSnoPanoramiXExtension = TRUE; pSiS->MouseRestrictions = FALSE; return; } SiSXineramaNumScreens = 2; while(SiSXineramaGeneration != serverGeneration) { pSiS->XineramaExtEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0,0, SiSProcXineramaDispatch, SiSSProcXineramaDispatch, SiSXineramaResetProc, StandardMinorOpcode); if(!pSiS->XineramaExtEntry) break; if(!(SiSXineramadataPtr = (SiSXineramaData *) calloc(SiSXineramaNumScreens, sizeof(SiSXineramaData)))) break; SiSXineramaGeneration = serverGeneration; success = TRUE; } if(!success) { SISErrorLog(pScrn, "Failed to initialize SiS Pseudo-Xinerama extension\n"); SiSnoPanoramiXExtension = TRUE; pSiS->MouseRestrictions = FALSE; return; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SiS Pseudo-Xinerama extension initialized\n"); pSiS->SiSXineramaVX = 0; pSiS->SiSXineramaVY = 0; } SiSUpdateXineramaScreenInfo(pScrn); } #endif /* End of PseudoXinerama */ static void SiSFreeCRT2Structs(SISPtr pSiS) { if(pSiS->CRT2pScrn) { if(pSiS->CRT2pScrn->modes) { while(pSiS->CRT2pScrn->modes) xf86DeleteMode(&pSiS->CRT2pScrn->modes, pSiS->CRT2pScrn->modes); } if(pSiS->CRT2pScrn->monitor) { if(pSiS->CRT2pScrn->monitor->Modes) { while(pSiS->CRT2pScrn->monitor->Modes) xf86DeleteMode(&pSiS->CRT2pScrn->monitor->Modes, pSiS->CRT2pScrn->monitor->Modes); } if(pSiS->CRT2pScrn->monitor->DDC) free(pSiS->CRT2pScrn->monitor->DDC); free(pSiS->CRT2pScrn->monitor); } free(pSiS->CRT2pScrn); pSiS->CRT2pScrn = NULL; } } #endif /* End of MergedFB helpers */ static xf86MonPtr SiSInternalDDC(ScrnInfoPtr pScrn, int crtno) { SISPtr pSiS = SISPTR(pScrn); xf86MonPtr pMonitor = NULL; UShort temp = 0xffff, temp1, i, realcrtno = crtno; UChar buffer[256]; /* If CRT1 is off, skip DDC */ if((pSiS->CRT1off) && (!crtno)) return NULL; if(crtno) { if(pSiS->VBFlags & CRT2_LCD) realcrtno = 1; else if(pSiS->VBFlags & CRT2_VGA) realcrtno = 2; else return NULL; if(pSiS->SiS_Pr->DDCPortMixup) realcrtno = 0; } else { /* If CRT1 is LCDA, skip DDC (except 301C: DDC allowed, but uses CRT2 port!) */ if(pSiS->VBFlags & CRT1_LCDA) { if(pSiS->VBFlags2 & VB2_SISTMDSLCDABRIDGE) realcrtno = 1; else return NULL; } } i = 3; /* Number of retrys */ do { temp1 = SiS_HandleDDC(pSiS->SiS_Pr, pSiS->VBFlags, pSiS->VGAEngine, realcrtno, 0, &buffer[0], pSiS->VBFlags2); if((temp1) && (temp1 != 0xffff)) temp = temp1; } while((temp == 0xffff) && i--); if(temp != 0xffff) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CRT%d DDC supported\n", crtno + 1); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CRT%d DDC level: %s%s%s%s\n", crtno + 1, (temp & 0x1a) ? "" : "[none of the supported]", (temp & 0x02) ? "2 " : "", (temp & 0x08) ? "D&P" : "", (temp & 0x10) ? "FPDI-2" : ""); if(temp & 0x02) { i = 5; /* Number of retrys */ do { temp = SiS_HandleDDC(pSiS->SiS_Pr, pSiS->VBFlags, pSiS->VGAEngine, realcrtno, 1, &buffer[0], pSiS->VBFlags2); } while((temp) && i--); if(!temp) { if((pMonitor = xf86InterpretEDID(pScrn->scrnIndex, &buffer[0]))) { int tempvgagamma = 0, templcdgamma = 0; if(buffer[0x14] & 0x80) { templcdgamma = (buffer[0x17] + 100) * 10; } else { tempvgagamma = (buffer[0x17] + 100) * 10;; } if(crtno == 0) { if(tempvgagamma) pSiS->CRT1VGAMonitorGamma = tempvgagamma; /* LCD never via (demanded) CRT1 DDC port */ } else { if(tempvgagamma) pSiS->CRT2VGAMonitorGamma = tempvgagamma; if(templcdgamma) pSiS->CRT2LCDMonitorGamma = templcdgamma; } return(pMonitor); } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "CRT%d DDC EDID corrupt\n", crtno + 1); } } else if(temp == 0xFFFE) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "CRT%d DDC data is from wrong device type (%s)\n", crtno + 1, (realcrtno == 1) ? "analog instead of digital" : "digital instead of analog"); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CRT%d DDC reading failed\n", crtno + 1); } } else if(temp & 0x18) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DDC for VESA D&P and FPDI-2 not supported yet.\n"); } } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CRT%d DDC probing failed\n", crtno + 1); } return(NULL); } static xf86MonPtr SiSDoPrivateDDC(ScrnInfoPtr pScrn, int *crtnum) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiS->SecondHead) { *crtnum = 1; return(SiSInternalDDC(pScrn, 0)); } else { *crtnum = 2; return(SiSInternalDDC(pScrn, 1)); } } else #endif if((pSiS->CRT1off) || (!pSiS->CRT1Detected)) { *crtnum = 2; return(SiSInternalDDC(pScrn, 1)); } else { *crtnum = 1; return(SiSInternalDDC(pScrn, 0)); } } static void SiSFindAspect(ScrnInfoPtr pScrn, xf86MonPtr pMonitor, int crtnum) { SISPtr pSiS = SISPTR(pScrn); int UseWide = 0; int aspect = 0; Bool fromdim = FALSE; if((pSiS->VGAEngine == SIS_315_VGA) && (!DIGITAL(pMonitor->features.input_type))) { if(pMonitor->features.hsize && pMonitor->features.vsize) { aspect = (pMonitor->features.hsize * 1000) / pMonitor->features.vsize; if(aspect >= 1400) UseWide = 1; fromdim = TRUE; } else if((PREFERRED_TIMING_MODE(pMonitor->features.msc)) && (pMonitor->det_mon[0].type == DT)) { aspect = (pMonitor->det_mon[0].section.d_timings.h_active * 1000) / pMonitor->det_mon[0].section.d_timings.v_active; if(aspect >= 1400) UseWide = 1; } if(aspect) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "According to %s, CRT%d aspect ratio is %.2f:1 (%s)\n", fromdim ? "DDC size" : "preferred mode", crtnum, (float)aspect / 1000.0, UseWide ? "wide" : "normal"); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Unable to determine CRT%d aspect ratio, assuming \"normal\"\n", crtnum); } } if((crtnum == 1) && (pSiS->SiS_Pr->SiS_UseWide == -1)) { pSiS->SiS_Pr->SiS_UseWide = UseWide; } else if((crtnum == 2) && (pSiS->SiS_Pr->SiS_UseWideCRT2 == -1)) { pSiS->SiS_Pr->SiS_UseWideCRT2 = UseWide; } } static Bool SiSMakeOwnModeList(ScrnInfoPtr pScrn, Bool acceptcustommodes, Bool includelcdmodes, Bool isfordvi, Bool *havecustommodes, Bool fakecrt2modes, Bool IsForCRT2) { DisplayModePtr tempmode, delmode, mymodes; if((mymodes = SiSBuildBuiltInModeList(pScrn, includelcdmodes, isfordvi, fakecrt2modes, IsForCRT2))) { if(!acceptcustommodes) { while(pScrn->monitor->Modes) xf86DeleteMode(&pScrn->monitor->Modes, pScrn->monitor->Modes); pScrn->monitor->Modes = mymodes; } else { delmode = pScrn->monitor->Modes; while(delmode) { if(delmode->type & M_T_DEFAULT) { tempmode = delmode->next; xf86DeleteMode(&pScrn->monitor->Modes, delmode); delmode = tempmode; } else { delmode = delmode->next; } } /* Link default modes AFTER user ones */ if((tempmode = pScrn->monitor->Modes)) { *havecustommodes = TRUE; while(tempmode) { if(!tempmode->next) break; else tempmode = tempmode->next; } tempmode->next = mymodes; mymodes->prev = tempmode; } else { pScrn->monitor->Modes = mymodes; } #if 0 pScrn->monitor->Modes = mymodes; while(mymodes) { if(!mymodes->next) break; else mymodes = mymodes->next; } mymodes->next = tempmode; if(tempmode) { tempmode->prev = mymodes; } #endif } return TRUE; } else return FALSE; } static void SiSPrintModes(ScrnInfoPtr pScrn) { DisplayModePtr p; float hsync, refresh = 0.0; char *desc, *desc2, *prefix, *uprefix, *output; xf86DrvMsg(pScrn->scrnIndex, pScrn->virtualFrom, "Virtual size is %dx%d " "(pitch %d)\n", pScrn->virtualX, pScrn->virtualY, pScrn->displayWidth); if((p = pScrn->modes) == NULL) return; do { desc = desc2 = ""; uprefix = " "; prefix = "Mode"; output = "For CRT device: "; if(p->HSync > 0.0) hsync = p->HSync; else if (p->HTotal > 0) hsync = (float)p->Clock / (float)p->HTotal; else hsync = 0.0; refresh = 0.0; if(p->VRefresh > 0.0) refresh = p->VRefresh; else if (p->HTotal > 0 && p->VTotal > 0) { refresh = p->Clock * 1000.0 / p->HTotal / p->VTotal; if(p->Flags & V_INTERLACE) refresh *= 2.0; if(p->Flags & V_DBLSCAN) refresh /= 2.0; if(p->VScan > 1) refresh /= p->VScan; } if(p->Flags & V_INTERLACE) desc = " (I)"; if(p->Flags & V_DBLSCAN) desc = " (D)"; if(p->VScan > 1) desc2 = " (VScan)"; #ifdef M_T_USERDEF if(p->type & M_T_USERDEF) uprefix = "*"; #endif if(p->type & M_T_BUILTIN) { prefix = "Built-in mode"; output = ""; } else if (p->type & M_T_DEFAULT) { prefix = "Default mode"; } else { output = ""; } xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "%s%s \"%s\" (%dx%d) (%s%.1f MHz, %.1f kHz, %.1f Hz%s%s)\n", uprefix, prefix, p->name, p->HDisplay, p->VDisplay, output, p->Clock / 1000.0, hsync, refresh, desc, desc2); p = p->next; } while (p != NULL && p != pScrn->modes); } Bool SISDetermineLCDACap(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); if( ((pSiS->ChipType == SIS_650) || (pSiS->ChipType == SIS_315PRO) || (pSiS->ChipType >= SIS_661)) && (pSiS->ChipType != XGI_20) && (pSiS->VBFlags2 & VB2_SISLCDABRIDGE) && (pSiS->VESA != 1) ) { return TRUE; } return FALSE; } void SISSaveDetectedDevices(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); /* Backup detected CRT2 devices */ pSiS->detectedCRT2Devices = pSiS->VBFlags & (CRT2_LCD|CRT2_TV|CRT2_VGA|TV_AVIDEO|TV_SVIDEO| TV_SCART|TV_HIVISION|TV_YPBPR); } static Bool SISCheckBIOS(SISPtr pSiS, UShort mypciid, UShort mypcivendor, int biossize) { UShort romptr, pciid; if(!pSiS->BIOS) return FALSE; if((pSiS->BIOS[0] != 0x55) || (pSiS->BIOS[1] != 0xaa)) return FALSE; romptr = pSiS->BIOS[0x18] | (pSiS->BIOS[0x19] << 8); if(romptr > (biossize - 8)) return FALSE; if((pSiS->BIOS[romptr] != 'P') || (pSiS->BIOS[romptr+1] != 'C') || (pSiS->BIOS[romptr+2] != 'I') || (pSiS->BIOS[romptr+3] != 'R')) return FALSE; pciid = pSiS->BIOS[romptr+4] | (pSiS->BIOS[romptr+5] << 8); if(pciid != mypcivendor) return FALSE; pciid = pSiS->BIOS[romptr+6] | (pSiS->BIOS[romptr+7] << 8); if(pciid != mypciid) return FALSE; return TRUE; } static void SiS_LoadInitVBE(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); /* Don't load the VBE module for secondary * cards which sisfb POSTed. We don't want * int10 to overwrite our set up (such as * disabled a0000 memory address decoding). * We don't need the VBE anyway because * the card will never be in text mode, * and we can restore graphics modes just * perfectly. */ if( !pSiS->Primary && pSiS->sisfbcardposted) return; if(pSiS->pVbe) return; if(xf86LoadSubModule(pScrn, "vbe")) { #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) pSiS->pVbe = VBEInit(pSiS->pInt, pSiS->pEnt->index); #else pSiS->pVbe = VBEExtendedInit(pSiS->pInt, pSiS->pEnt->index, SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH); #endif } if(!pSiS->pVbe) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to load/initialize vbe module\n"); } } #ifdef SIS_PC_PLATFORM static void SiS_MapVGAMem(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); /* Map 64k VGA window for saving/restoring CGA fonts */ pSiS->VGAMapSize = 0x10000; pSiS->VGAMapPhys = 0; /* Default */ if((!pSiS->Primary) || (!pSiS->VGADecodingEnabled)) { /* If card is secondary or if a0000-address decoding * is disabled, set Phys to beginning of our video RAM. */ pSiS->VGAMapPhys = PCI_REGION_BASE(pSiS->PciInfo, 0, REGION_MEM); } if(!SiSVGAMapMem(pScrn)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to map VGA memory (0x%lx), can't save/restore console fonts\n", pSiS->VGAMapPhys); } } #endif static void SiS_CheckKernelFB(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int fd, i; CARD32 sisfbinfosize = 0, sisfbversion; sisfb_info *mysisfbinfo; char name[16]; pSiS->donttrustpdc = FALSE; pSiS->sisfbpdc = 0xff; pSiS->sisfbpdca = 0xff; pSiS->sisfblcda = 0xff; pSiS->sisfbscalelcd = -1; pSiS->sisfbspecialtiming = CUT_NONE; pSiS->sisfb_haveemi = FALSE; pSiS->sisfbfound = FALSE; pSiS->sisfb_tvposvalid = FALSE; pSiS->sisfbdevname[0] = 0; pSiS->sisfb_havelock = FALSE; pSiS->sisfbHaveNewHeapDef = FALSE; pSiS->sisfbHeapSize = 0; pSiS->sisfbVideoOffset = 0; pSiS->sisfbxSTN = FALSE; pSiS->sisfbcanpost = FALSE; /* (Old) sisfb can't POST card */ pSiS->sisfbcardposted = TRUE; /* If (old) sisfb is running, card must have been POSTed */ pSiS->sisfbprimary = FALSE; /* (Old) sisfb doesn't know */ if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { i = 0; do { if(i <= 7) { sprintf(name, "/dev/fb%1d", i); } else { sprintf(name, "/dev/fb/%1d", (i - 8)); } if((fd = open(name, O_RDONLY)) != -1) { Bool gotit = FALSE; if(!ioctl(fd, SISFB_GET_INFO_SIZE, &sisfbinfosize)) { if((mysisfbinfo = malloc(sisfbinfosize))) { if(!ioctl(fd, (SISFB_GET_INFO | (sisfbinfosize << 16)), mysisfbinfo)) { gotit = TRUE; } else { free(mysisfbinfo); mysisfbinfo = NULL; } } } else { if((mysisfbinfo = malloc(sizeof(*mysisfbinfo) + 16))) { if(!ioctl(fd, SISFB_GET_INFO_OLD, mysisfbinfo)) { gotit = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Possibly old version of sisfb detected. Please update.\n"); } else { free(mysisfbinfo); mysisfbinfo = NULL; } } } if(gotit) { if(mysisfbinfo->sisfb_id == SISFB_ID) { sisfbversion = (mysisfbinfo->sisfb_version << 16) | (mysisfbinfo->sisfb_revision << 8) | (mysisfbinfo->sisfb_patchlevel); if(sisfbversion >= SISFB_VERSION(1, 5, 8)) { /* Added PCI bus/slot/func into in sisfb Version 1.5.08. * Check this to make sure we run on the same card as sisfb */ if((mysisfbinfo->sisfb_pcibus == pSiS->PciBus) && (mysisfbinfo->sisfb_pcislot == pSiS->PciDevice) && (mysisfbinfo->sisfb_pcifunc == pSiS->PciFunc)) { pSiS->sisfbfound = TRUE; } } else pSiS->sisfbfound = TRUE; if(pSiS->sisfbfound) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "%s: SiS kernel fb driver (sisfb) %d.%d.%d detected (PCI:%02d:%02d.%d)\n", &name[5], mysisfbinfo->sisfb_version, mysisfbinfo->sisfb_revision, mysisfbinfo->sisfb_patchlevel, pSiS->PciBus, pSiS->PciDevice, pSiS->PciFunc); /* Added version/rev/pl in sisfb 1.4.0 */ if(mysisfbinfo->sisfb_version == 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Old version of sisfb found. Please update.\n"); } /* Basically, we can't trust the pdc register if sisfb is loaded */ pSiS->donttrustpdc = TRUE; pSiS->sisfbHeapStart = mysisfbinfo->heapstart; if(sisfbversion >= SISFB_VERSION(1, 7, 20)) { pSiS->sisfbHeapSize = mysisfbinfo->sisfb_heapsize; pSiS->sisfbVideoOffset = mysisfbinfo->sisfb_videooffset; pSiS->sisfbHaveNewHeapDef = TRUE; pSiS->sisfbFSTN = mysisfbinfo->sisfb_curfstn; pSiS->sisfbDSTN = mysisfbinfo->sisfb_curdstn; pSiS->sisfbxSTN = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "sisfb: memory heap at %dKB, size %dKB, viewport at %dKB\n", (int)pSiS->sisfbHeapStart, (int)pSiS->sisfbHeapSize, (int)pSiS->sisfbVideoOffset/1024); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "sisfb: memory heap at %dKB\n", (int)pSiS->sisfbHeapStart); } xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "sisfb: using video mode 0x%02x\n", mysisfbinfo->fbvidmode); pSiS->OldMode = mysisfbinfo->fbvidmode; if(sisfbversion >= SISFB_VERSION(1, 5, 6)) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "sisfb: using %s, reserved %dK\n", (mysisfbinfo->sisfb_caps & 0x40) ? "SiS300 series Turboqueue" : (mysisfbinfo->sisfb_caps & 0x20) ? "SiS315/330/340 series AGP command queue" : (mysisfbinfo->sisfb_caps & 0x10) ? "SiS315/330/340 series VRAM command queue" : (mysisfbinfo->sisfb_caps & 0x08) ? "SiS315/330/340 series MMIO mode" : "no command queue", (int)mysisfbinfo->sisfb_tqlen); } if(sisfbversion >= SISFB_VERSION(1, 5, 10)) { /* We can trust the pdc value if sisfb is of recent version */ if(pSiS->VGAEngine == SIS_300_VGA) pSiS->donttrustpdc = FALSE; } if(sisfbversion >= SISFB_VERSION(1, 5, 11)) { if(pSiS->VGAEngine == SIS_300_VGA) { /* As of 1.5.11, sisfb saved the register for us (300 series) */ pSiS->sisfbpdc = mysisfbinfo->sisfb_lcdpdc; if(!pSiS->sisfbpdc) pSiS->sisfbpdc = 0xff; } } if(sisfbversion >= SISFB_VERSION(1, 5, 14)) { if(pSiS->VGAEngine == SIS_315_VGA) { pSiS->sisfblcda = mysisfbinfo->sisfb_lcda; } } if(sisfbversion >= SISFB_VERSION(1, 6, 13)) { pSiS->sisfbscalelcd = mysisfbinfo->sisfb_scalelcd; pSiS->sisfbspecialtiming = mysisfbinfo->sisfb_specialtiming; } if(sisfbversion >= SISFB_VERSION(1, 6, 16)) { if(pSiS->VGAEngine == SIS_315_VGA) { pSiS->donttrustpdc = FALSE; pSiS->sisfbpdc = mysisfbinfo->sisfb_lcdpdc; if(sisfbversion >= SISFB_VERSION(1, 6, 24)) { pSiS->sisfb_haveemi = mysisfbinfo->sisfb_haveemi ? TRUE : FALSE; pSiS->sisfb_haveemilcd = TRUE; /* will match most cases */ pSiS->sisfb_emi30 = mysisfbinfo->sisfb_emi30; pSiS->sisfb_emi31 = mysisfbinfo->sisfb_emi31; pSiS->sisfb_emi32 = mysisfbinfo->sisfb_emi32; pSiS->sisfb_emi33 = mysisfbinfo->sisfb_emi33; } if(sisfbversion >= SISFB_VERSION(1, 6, 25)) { pSiS->sisfb_haveemilcd = mysisfbinfo->sisfb_haveemilcd ? TRUE : FALSE; } if(sisfbversion >= SISFB_VERSION(1, 6, 31)) { pSiS->sisfbpdca = mysisfbinfo->sisfb_lcdpdca; } else { if(pSiS->sisfbpdc) { pSiS->sisfbpdca = (pSiS->sisfbpdc & 0xf0) >> 3; pSiS->sisfbpdc = (pSiS->sisfbpdc & 0x0f) << 1; } else { pSiS->sisfbpdca = pSiS->sisfbpdc = 0xff; } } } } if(sisfbversion >= SISFB_VERSION(1, 7, 0)) { pSiS->sisfb_havelock = TRUE; if(sisfbversion >= SISFB_VERSION(1, 7, 1)) { pSiS->sisfb_tvxpos = mysisfbinfo->sisfb_tvxpos; pSiS->sisfb_tvypos = mysisfbinfo->sisfb_tvypos; pSiS->sisfb_tvposvalid = TRUE; } } if(sisfbversion >= SISFB_VERSION(1, 8, 7)) { pSiS->sisfbcanpost = (mysisfbinfo->sisfb_can_post) ? TRUE : FALSE; pSiS->sisfbcardposted = (mysisfbinfo->sisfb_card_posted) ? TRUE : FALSE; pSiS->sisfbprimary = (mysisfbinfo->sisfb_was_boot_device) ? TRUE : FALSE; /* Validity check */ if(!pSiS->sisfbcardposted) { pSiS->sisfbprimary = FALSE; } } } } free(mysisfbinfo); mysisfbinfo = NULL; } close (fd); } i++; } while((i <= 15) && (!pSiS->sisfbfound)); if(pSiS->sisfbfound) { strncpy(pSiS->sisfbdevname, name, 15); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "sisfb not found\n"); } } if(!pSiS->sisfbfound) { pSiS->sisfbcardposted = FALSE; } } static void SiSPseudo(ScrnInfoPtr pScrn) { } /* PreInit() * * Mandatory */ static Bool SISPreInit(ScrnInfoPtr pScrn, int flags) { SISPtr pSiS; #ifdef SISDUALHEAD SISEntPtr pSiSEnt = NULL; #endif MessageType from; UChar usScratchCR17, usScratchCR32, usScratchCR63; UChar usScratchSR1F, srlockReg, crlockReg; unsigned int i; int pix24flags, temp; ClockRangePtr clockRanges; xf86MonPtr pMonitor = NULL; Bool didddc2, fromDDC, crt1freqoverruled = FALSE; UChar CR5F, tempreg; #if defined(SISMERGED) || defined(SISDUALHEAD) DisplayModePtr first, p, n; #endif #ifdef SISMERGED Bool crt2freqoverruled = FALSE; #endif static const char *ddcsstr = "CRT%d DDC monitor info: *******************************************\n"; static const char *ddcestr = "End of CRT%d DDC monitor info *************************************\n"; static const char *subshstr = "Substituting missing CRT%d monitor HSync range by DDC data\n"; static const char *subsvstr = "Substituting missing CRT%d monitor VRefresh range by DDC data\n"; static const char *saneh = "Correcting %s CRT%d monitor HSync range\n"; static const char *sanev = "Correcting %s CRT%d monitor VRefresh range\n"; #ifdef SISMERGED static const char *mergednocrt1 = "CRT1 not detected or forced off. %s.\n"; static const char *mergednocrt2 = "No CRT2 output selected or no video bridge detected. %s.\n"; static const char *mergeddisstr = "MergedFB mode disabled"; static const char *modesforstr = "Modes for CRT%d: **************************************************\n"; static const char *crtsetupstr = "*************************** CRT%d setup ***************************\n"; static const char *crt2monname = "CRT2"; #endif #if defined(SISDUALHEAD) || defined(SISMERGED) static const char *notsuitablestr = "Not using mode \"%s\" (not suitable for %s mode)\n"; #endif if(flags & PROBE_DETECT) { vbeInfoPtr pVbe; if(xf86LoadSubModule(pScrn, "vbe")) { int index = xf86GetEntityInfo(pScrn->entityList[0])->index; #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) if((pVbe = VBEInit(NULL, index))) #else if((pVbe = VBEExtendedInit(NULL, index, 0))) #endif { ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); } } return TRUE; } /* * Note: This function is only called once at server startup, and * not at the start of each server generation. This means that * only things that are persistent across server generations can * be initialised here. xf86Screens[] is the array of all screens, * (pScrn is a pointer to one of these). Privates allocated using * xf86AllocateScrnInfoPrivateIndex() are too, and should be used * for data that must persist across server generations. * * Per-generation data should be allocated with * AllocateScreenPrivateIndex() from the ScreenInit() function. */ /* Check the number of entities, and fail if it isn't one. */ if(pScrn->numEntities != 1) { SISErrorLog(pScrn, "Number of entities is not 1\n"); return FALSE; } /* Due to the liberal license terms this is needed for * keeping the copyright notice readable and intact in * binary distributions. Removing this is a copyright * infringement. Please read the license terms above. */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SiS driver (%d/%02d/%02d-%d, compiled for " SISMYSERVERNAME " %d.%d.%d.%d)\n", SISDRIVERVERSIONYEAR + 2000, SISDRIVERVERSIONMONTH, SISDRIVERVERSIONDAY, SISDRIVERREVISION, #ifdef XORG_VERSION_CURRENT XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP #else XF86_VERSION_MAJOR, XF86_VERSION_MINOR, XF86_VERSION_PATCH, XF86_VERSION_SNAP #endif ); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Copyright (C) 2001-2005 Thomas Winischhofer and others\n"); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "*** See http://www.winischhofer.eu/linuxsisvga.shtml\n"); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "*** for documentation and updates.\n"); #ifdef XORG_VERSION_CURRENT #if 0 /* no prototype yet */ if(xorgGetVersion() != XORG_VERSION_CURRENT) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "This driver binary is not compiled for this version of " SISMYSERVERNAME "\n"); } #endif #else #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,2,99,0,0) if(xf86GetVersion() != XF86_VERSION_CURRENT) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "This driver binary is not compiled for this version of " SISMYSERVERNAME "\n"); } #endif #endif /* Allocate the SISRec driverPrivate */ if(!SISGetRec(pScrn)) { SISErrorLog(pScrn, "Could not allocate memory for pSiS private\n"); return FALSE; } pSiS = SISPTR(pScrn); pSiS->pScrn = pScrn; pSiS->pInt = NULL; /* Save PCI Domain Base */ #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) || GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 12 pSiS->IODBase = 0; #else pSiS->IODBase = pScrn->domainIOBase; #endif /* Get the entity, and make sure it is PCI. */ pSiS->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); if(pSiS->pEnt->location.type != BUS_PCI) { SISErrorLog(pScrn, "Entity's bus type is not PCI\n"); goto my_error_0; } #ifdef SISDUALHEAD /* Allocate an entity private if necessary */ if(xf86IsEntityShared(pScrn->entityList[0])) { pSiSEnt = xf86GetEntityPrivate(pScrn->entityList[0], SISEntityIndex)->ptr; pSiS->entityPrivate = pSiSEnt; /* If something went wrong, quit here */ if((pSiSEnt->DisableDual) || (pSiSEnt->ErrorAfterFirst)) { SISErrorLog(pScrn, "First head encountered fatal error, aborting...\n"); goto my_error_0; } } #endif /* Find the PCI info for this screen */ pSiS->PciInfo = xf86GetPciInfoForEntity(pSiS->pEnt->index); pSiS->PciBus = PCI_CFG_BUS(pSiS->PciInfo); /*SIS_PCI_BUS(pSiS->PciInfo);*/ pSiS->PciDevice = PCI_CFG_DEV(pSiS->PciInfo); /*SIS_PCI_DEVICE(pSiS->PciInfo);*/ pSiS->PciFunc = PCI_CFG_FUNC(pSiS->PciInfo); /*SIS_PCI_FUNC(pSiS->PciInfo);*/ pSiS->PciTag = pciTag(PCI_DEV_BUS(pSiS->PciInfo), PCI_DEV_DEV(pSiS->PciInfo), PCI_DEV_FUNC(pSiS->PciInfo)); #ifdef SIS_NEED_MAP_IOP /********************************************/ /* THIS IS BROKEN AND WON'T WORK */ /* Reasons: */ /* 1) MIPS and ARM have no i/o ports but */ /* use memory mapped i/o only. The inX/outX */ /* macros in compiler.h are smart enough to */ /* add "IOPortBase" to the port number, but */ /* "IOPortBase" is never initialized. */ /* 2) IOPortBase is declared in compiler.h */ /* itself. So until somebody fixes all */ /* modules that #include compiler.h to set */ /* IOPortBase, vga support for MIPS and ARM */ /* is unusable. */ /* (In this driver this is solvable because */ /* we have our own vgaHW routines. However, */ /* we use /dev/port for now instead.) */ /********************************************/ pSiS->IOPAddress = pSiS->IODBase + pSiS->PciInfo->ioBase[2]; if(!SISMapIOPMem(pScrn)) { SISErrorLog(pScrn, "Could not map I/O port area at 0x%x\n", pSiS->IOPAddress); goto my_error_0; } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "I/O port area mapped to %p, size 128\n", pSiS->IOPBase); #if defined(__mips__) || defined(__arm32__) /* inX/outX macros on these use IOPortBase as offset */ /* This is entirely skrewed. */ IOPortBase = (unsigned int)pSiS->IOPBase; #endif } #endif /* Set up i/o port access (for non-x86) */ #ifdef SISUSEDEVPORT if((sisdevport = open("/dev/port", O_RDWR, 0)) == -1) { SISErrorLog(pScrn, "Failed to open /dev/port for read/write\n"); goto my_error_0; } pSiS->sisdevportopen = TRUE; #endif /* * Set the Chipset and ChipRev, allowing config file entries to * override. DANGEROUS! */ { SymTabRec *myChipsets = SISChipsets; if(PCI_DEV_VENDOR_ID(pSiS->PciInfo) == PCI_VENDOR_XGI) { myChipsets = XGIChipsets; } if(pSiS->pEnt->device->chipset && *pSiS->pEnt->device->chipset) { pScrn->chipset = pSiS->pEnt->device->chipset; pSiS->Chipset = xf86StringToToken(myChipsets, pScrn->chipset); } else if(pSiS->pEnt->device->chipID >= 0) { pSiS->Chipset = pSiS->pEnt->device->chipID; pScrn->chipset = (char *)xf86TokenToString(myChipsets, pSiS->Chipset); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n", pSiS->Chipset); } else { pSiS->Chipset = PCI_DEV_DEVICE_ID(pSiS->PciInfo); pScrn->chipset = (char *)xf86TokenToString(myChipsets, pSiS->Chipset); } } if(pSiS->pEnt->device->chipRev >= 0) { pSiS->ChipRev = pSiS->pEnt->device->chipRev; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", pSiS->ChipRev); } else { pSiS->ChipRev = PCI_DEV_REVISION(pSiS->PciInfo); } /* * This shouldn't happen because such problems should be caught in * SISProbe(), but check it just in case the user has overridden them. */ if(pScrn->chipset == NULL) { SISErrorLog(pScrn, "ChipID 0x%04X is not recognised\n", pSiS->Chipset); goto my_error_0; } if(pSiS->Chipset < 0) { SISErrorLog(pScrn, "Chipset \"%s\" is not recognised\n", pScrn->chipset); goto my_error_0; } pSiS->SiS6326Flags = 0; /* Determine VGA engine generation */ switch(pSiS->Chipset) { case PCI_CHIP_SIS300: case PCI_CHIP_SIS540: case PCI_CHIP_SIS630: /* 630 + 730 */ pSiS->VGAEngine = SIS_300_VGA; break; case PCI_CHIP_SIS315H: case PCI_CHIP_SIS315: case PCI_CHIP_SIS315PRO: case PCI_CHIP_SIS550: case PCI_CHIP_SIS650: /* 650 + 740 */ case PCI_CHIP_SIS330: case PCI_CHIP_SIS660: /* 660, 661, 741, 760, 761, 670(?), 770 */ case PCI_CHIP_SIS340: case PCI_CHIP_XGIXG20: case PCI_CHIP_XGIXG40: pSiS->VGAEngine = SIS_315_VGA; break; case PCI_CHIP_SIS530: pSiS->VGAEngine = SIS_530_VGA; break; case PCI_CHIP_SIS6326: /* Determine SiS6326 revision. According to SiS the differences are: * Chip name Chip type TV-Out MPEG II decoder * 6326 AGP Rev. G0/H0 no no * 6326 DVD Rev. D2 yes yes * 6326 Rev. Cx yes yes */ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Chipset is SiS6326 %s (revision 0x%02x)\n", (pSiS->ChipRev == 0xaf) ? "(Ax)" : ((pSiS->ChipRev == 0x0a) ? "AGP (G0)" : ((pSiS->ChipRev == 0x0b) ? "AGP (H0)" : (((pSiS->ChipRev & 0xf0) == 0xd0) ? "DVD (Dx/H0)" : (((pSiS->ChipRev & 0xf0) == 0x90) ? "(9x)" : (((pSiS->ChipRev & 0xf0) == 0xc0) ? "(Cx)" : "(unknown)"))))), pSiS->ChipRev); if((pSiS->ChipRev != 0x0a) && (pSiS->ChipRev != 0x0b)) { pSiS->SiS6326Flags |= SIS6326_HASTV; } /* fall through */ default: pSiS->VGAEngine = SIS_OLD_VGA; } /* We don't know about the current mode yet */ pSiS->OldMode = 0; /* Determine whether this is the primary or a secondary * display adapter. And right here the problem starts: * On machines with integrated SiS chipsets, the system BIOS * usually sets VGA_EN on all PCI-to-PCI bridges in the system * (of which there usually are two: PCI and AGP). This and * the fact that any PCI card POSTed by sisfb naturally has * its PCI resources enabled, leads to X assuming that * there are more than one "primary" cards in the system. * In this case, X treats ALL cards as "secondary" - * which by no means is desireable. If sisfb is running, * we can determine which card really is "primary" (in * terms of if it's the one that occupies the A0000 area * etc.) in a better way (Linux 2.6.12 or later). See below. */ if(!(pSiS->Primary = xf86IsPrimaryPci(pSiS->PciInfo))) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, SISMYSERVERNAME " assumes this adapter to be secondary\n"); } /* Now check if sisfb is running, and if so, retrieve * all possible info from it. This also resets all * sisfb_* entries in pSiS regardless of the chipset. */ SiS_CheckKernelFB(pScrn); /* Now for that primary/secondary mess: Linux kernel * 2.6.12 and later knows what card is primary, and so * does any recent version of sisfb. XFree86/X.org takes * all adapters as "secondary" if more than one card's * memory and i/o resources are enabled, and more than * one PCI bridge in the system has VGA_EN set at server * start. So, let's start thinking: What is this * primary/secondary classification needed for anyway? * (This list might be incomplete for the entire server * infrastructure, but it's complete as regards the driver's * purposes of primary/secondary classification.) * 1) VGA/console font restoring: Here it's irrelevant * whether more than one card's resources are enabled * at server start or not. Relevant is whether the card * occupies the A0000 area at this time. Assuming (?) * that this does not change during machine up-time, * it suffices to know which device was the boot video * device (as determined by Linux 2.6.12 and later). * Also, this is only relevant if the card is in text * mode; if it's in graphics mode, fonts aren't saved * or restored anyway. * sisfb tells us if that card is considered the boot * video device. The hardware registers tell us if * the card's A0000 address decoding is enabled, and if * the card currently is in text mode. These three bits * of information are enough to decide on whether or not * to save/restore fonts. * 2) POSTing. Same here. Relevant is only whether or not * the card has been POSTed once before. POSTing cards * on every server start is pretty ugly, especially * if a framebuffer driver is already handling it. * SiS/XGI cards POSTed by sisfb can coexist well with other * active adapters. So we trust sisfb's information more * than X's (especially as we only use this information for * console font restoring and eventual POSTing.) * What we still need is a way to find out about all this if * sisfb is not running.... */ if(!pSiS->Primary && pSiS->sisfbprimary) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "sisfb reports this adapter to be primary. Seems more reliable.\n"); pSiS->Primary = TRUE; } /* If the card is "secondary" and has not been * POSTed by sisfb, POST it now through int10. * For cards POSTed by sisfb, we definitely don't * want that as it messes up our set up (eg. the * disabled A0000 area). * The int10 module decides on its own if the * card is primary or secondary. Since it uses * the generic technique described above, and since * for "secondary" cards it needs a real PCI BIOS * ROM, and since integrated chips don't have such * a PCI BIOS ROM, int10 will naturally fail to * find/read the BIOS on such machines. Great. * Using the integrated graphics as "secondary" * (which it will be as soon as X finds more than * one card's mem and i/o resources enabled, and more * than one PCI bridge's VGA_EN bit set during server * start) will therefore prevent us from restoring * the mode using the VBE. That means real fun if * the integrated chip is set up to use the video * bridge output for text mode (which is something * the driver doesn't really support since it's done * pretty much differently on every machine.) */ #if !defined(__alpha__) if(!pSiS->Primary) { if(!pSiS->sisfbcardposted) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing adapter through int10\n"); if(xf86LoadSubModule(pScrn, "int10")) { pSiS->pInt = xf86InitInt10(pSiS->pEnt->index); } else { SISErrorLog(pScrn, "Failed to load int10 module\n"); } } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Adapter already initialized by sisfb\n"); } } #endif /* Get the address of our relocated IO registers. * These are enabled by the hardware during cold boot, and * by the BIOS. So we can pretty much rely on that these * are enabled. */ pSiS->RelIO = (SISIOADDRESS)(PCI_REGION_BASE(pSiS->PciInfo, 2, REGION_IO) + pSiS->IODBase); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Relocated I/O registers at 0x%lX\n", (ULong)pSiS->RelIO); /* Unlock extended registers */ sisSaveUnlockExtRegisterLock(pSiS, &srlockReg, &crlockReg); /* Is a0000 memory address decoding enabled? */ pSiS->VGADecodingEnabled = TRUE; switch(pSiS->VGAEngine) { case SIS_OLD_VGA: /* n/a */ break; case SIS_530_VGA: inSISIDXREG(SISSR, 0x3d, tempreg); if(tempreg & 0x04) pSiS->VGADecodingEnabled = FALSE; break; case SIS_300_VGA: case SIS_315_VGA: inSISIDXREG(SISSR, 0x20, tempreg); if(tempreg & 0x04) pSiS->VGADecodingEnabled = FALSE; break; } if(!pSiS->VGADecodingEnabled) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Standard VGA (0xA0000) memory address decoding is disabled\n"); } #ifdef SIS_PC_PLATFORM /* Map 64k VGA window for saving/restoring CGA fonts. * For secondary cards or if A0000 address decoding * is disabled, this will map the beginning of the * linear (PCI) video RAM instead. */ SiS_MapVGAMem(pScrn); #endif #ifndef XSERVER_LIBPCIACCESS /* Set operating state */ /* 1. memory */ /* [ResUnusedOpr: Resource decoded by hw, but not used] * [ResDisableOpr: Resource is not decoded by hw] * So, if a0000 memory decoding is disabled, one could * argue that we may say so, too. Hm. Quite likely that * the VBE (via int10) will eventually enable it. So we * cowardly say unused instead. */ xf86SetOperatingState(resVgaMem, pSiS->pEnt->index, ResUnusedOpr); /* 2. i/o */ /* Although we only use the relocated i/o ports, the hardware * also decodes the standard VGA port range. This could in * theory be disabled, but I don't dare to do this; in case of * a server crash, the card would be entirely dead. Also, this * would prevent int10 and the VBE from working at all. Generic * access control through the PCI configuration registers does * nicely anyway. */ xf86SetOperatingState(resVgaIo, pSiS->pEnt->index, ResUnusedOpr); /* Operations for which memory access is required */ pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT; /* Operations for which I/O access is required */ pScrn->racIoFlags = RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT; #endif /* Load ramdac module */ if(!xf86LoadSubModule(pScrn, "ramdac")) { SISErrorLog(pScrn, "Could not load ramdac module\n"); goto my_error_1; } /* Set pScrn->monitor */ pScrn->monitor = pScrn->confScreen->monitor; /* Reset some entries */ pSiS->SiSFastVidCopy = SiSVidCopyGetDefault(); pSiS->SiSFastMemCopy = SiSVidCopyGetDefault(); pSiS->SiSFastVidCopyFrom = SiSVidCopyGetDefault(); pSiS->SiSFastMemCopyFrom = SiSVidCopyGetDefault(); pSiS->SiSFastVidCopyDone = FALSE; #ifdef SIS_USE_XAA pSiS->RenderCallback = NULL; #endif #ifdef SIS_USE_EXA pSiS->ExaRenderCallback = NULL; #endif pSiS->InitAccel = SiSPseudo; pSiS->SyncAccel = SiSPseudo; pSiS->FillRect = NULL; pSiS->BlitRect = NULL; /* Always do a ValidMode() inside Switchmode() */ pSiS->skipswitchcheck = FALSE; /* Determine chipset and its capabilities in detail */ pSiS->ChipFlags = 0; pSiS->SiS_SD_Flags = pSiS->SiS_SD2_Flags = 0; pSiS->SiS_SD3_Flags = pSiS->SiS_SD4_Flags = 0; pSiS->HWCursorMBufNum = pSiS->HWCursorCBufNum = 0; pSiS->NeedFlush = FALSE; pSiS->NewCRLayout = FALSE; pSiS->mmioSize = 64; switch(pSiS->Chipset) { case PCI_CHIP_SIS530: pSiS->ChipType = SIS_530; break; case PCI_CHIP_SIS300: pSiS->ChipType = SIS_300; pSiS->SiS_SD_Flags |= SiS_SD_IS300SERIES; break; case PCI_CHIP_SIS540: pSiS->ChipType = SIS_540; pSiS->SiS_SD_Flags |= SiS_SD_IS300SERIES; break; case PCI_CHIP_SIS630: /* 630 + 730 */ pSiS->ChipType = SIS_630; if(sis_pci_read_host_bridge_u32(0x00) == 0x07301039) { pSiS->ChipType = SIS_730; } pSiS->SiS_SD_Flags |= SiS_SD_IS300SERIES; break; case PCI_CHIP_SIS315H: pSiS->ChipType = SIS_315H; pSiS->ChipFlags |= (SiSCF_315Core | SiSCF_MMIOPalette); pSiS->SiS_SD_Flags |= SiS_SD_IS315SERIES; pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPORTXVHUESAT; pSiS->myCR63 = 0x63; break; case PCI_CHIP_SIS315: /* Override for simplicity */ pSiS->Chipset = PCI_CHIP_SIS315H; pSiS->ChipType = SIS_315; pSiS->ChipFlags |= (SiSCF_315Core | SiSCF_MMIOPalette); pSiS->SiS_SD_Flags |= SiS_SD_IS315SERIES; pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPORTXVHUESAT; pSiS->myCR63 = 0x63; break; case PCI_CHIP_SIS315PRO: /* Override for simplicity */ pSiS->Chipset = PCI_CHIP_SIS315H; pSiS->ChipType = SIS_315PRO; pSiS->ChipFlags |= (SiSCF_315Core | SiSCF_MMIOPalette); pSiS->SiS_SD_Flags |= SiS_SD_IS315SERIES; pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPORTXVHUESAT; pSiS->myCR63 = 0x63; break; case PCI_CHIP_SIS550: pSiS->ChipType = SIS_550; pSiS->ChipFlags |= (SiSCF_Integrated | SiSCF_MMIOPalette); pSiS->SiS_SD_Flags |= SiS_SD_IS315SERIES; pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPORTXVHUESAT; pSiS->myCR63 = 0x63; break; case PCI_CHIP_SIS650: /* 650 + 740 */ pSiS->ChipType = SIS_650; if(sis_pci_read_host_bridge_u32(0x00) == 0x07401039) { pSiS->ChipType = SIS_740; } pSiS->ChipFlags |= (SiSCF_Integrated | SiSCF_Real256ECore | SiSCF_MMIOPalette); pSiS->SiS_SD_Flags |= SiS_SD_IS315SERIES; pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPORTXVHUESAT; pSiS->myCR63 = 0x63; break; case PCI_CHIP_SIS330: pSiS->ChipType = SIS_330; pSiS->ChipFlags |= (SiSCF_XabreCore | SiSCF_MMIOPalette); pSiS->SiS_SD_Flags |= SiS_SD_IS330SERIES; pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPORTXVHUESAT; pSiS->SiS_SD3_Flags |= SiS_SD3_CRT1SATGAIN; /* FIXME ? */ pSiS->myCR63 = 0x53; /* sic! */ break; case PCI_CHIP_SIS660: /* 660, 661, 741, 760, 761, 670(?) */ { ULong hpciid = sis_pci_read_host_bridge_u32(0x00); switch(hpciid) { case 0x06601039: pSiS->ChipType = SIS_660; pSiS->ChipFlags |= SiSCF_Ultra256Core; pSiS->NeedFlush = TRUE; break; case 0x07601039: pSiS->ChipType = SIS_760; pSiS->ChipFlags |= SiSCF_Ultra256Core; pSiS->NeedFlush = TRUE; break; case 0x07611039: pSiS->ChipType = SIS_761; pSiS->ChipFlags |= SiSCF_Ultra256Core; pSiS->NeedFlush = TRUE; break; case 0x07701039: pSiS->ChipType = SIS_770; pSiS->ChipFlags |= SiSCF_Ultra256Core; pSiS->NeedFlush = TRUE; break; case 0x07411039: pSiS->ChipType = SIS_741; pSiS->ChipFlags |= SiSCF_Real256ECore; break; case 0x06611039: default: pSiS->ChipType = SIS_661; pSiS->ChipFlags |= SiSCF_Real256ECore; break; case 0x06701039: pSiS->ChipType = SIS_670; pSiS->ChipFlags |= SiSCF_Real256ECore; } /* Detection could also be done by CR5C & 0xf8: * 0x10 = 661 (CR5F & 0xc0: 0x00 both A0 and A1) * 0x80 = 760 (CR5F & 0xc0: 0x00 A0, 0x40 A1) * 0x90 = 741 (CR5F & 0xc0: 0x00 A0,A1 0x40 A2) * other: 660 (CR5F & 0xc0: 0x00 A0 0x40 A1) (DOA?) */ pSiS->ChipFlags |= (SiSCF_Integrated | SiSCF_MMIOPalette); pSiS->SiS_SD_Flags |= SiS_SD_IS330SERIES; pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPORTXVHUESAT; pSiS->SiS_SD3_Flags |= SiS_SD3_CRT1SATGAIN; pSiS->myCR63 = 0x53; /* sic! */ pSiS->NewCRLayout = TRUE; } break; case PCI_CHIP_SIS340: pSiS->ChipType = SIS_340; pSiS->ChipFlags |= (SiSCF_XabreCore | SiSCF_MMIOPalette); pSiS->SiS_SD_Flags |= SiS_SD_IS340SERIES; pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPORTXVHUESAT; pSiS->SiS_SD3_Flags |= SiS_SD3_CRT1SATGAIN; pSiS->myCR63 = 0x53; pSiS->NewCRLayout = TRUE; break; case PCI_CHIP_XGIXG20: pSiS->ChipType = XGI_20; pSiS->ChipFlags |= (SiSCF_XabreCore | SiSCF_MMIOPalette | SiSCF_IsXGI); pSiS->SiS_SD2_Flags |= (SiS_SD2_NOOVERLAY | SiS_SD2_ISXGI); pSiS->myCR63 = 0x53; pSiS->NewCRLayout = TRUE; break; case PCI_CHIP_XGIXG40: pSiS->ChipType = XGI_40; pSiS->ChipFlags |= (SiSCF_XabreCore | SiSCF_MMIOPalette | SiSCF_IsXGI); pSiS->SiS_SD2_Flags |= (SiS_SD2_SUPPORTXVHUESAT | SiS_SD2_ISXGI); pSiS->SiS_SD3_Flags |= SiS_SD3_CRT1SATGAIN; pSiS->myCR63 = 0x53; pSiS->NewCRLayout = TRUE; if(pSiS->ChipRev == 2) pSiS->ChipFlags |= SiSCF_IsXGIV3; break; default: pSiS->ChipType = SIS_OLD; break; } /* * Now back to real business: Figure out the depth, bpp, etc. * Set SupportConvert... flags since we use the fb layer which * supports this conversion. (24to32 seems not implemented though) * Additionally, determine the size of the HWCursor memory area. */ switch(pSiS->VGAEngine) { case SIS_300_VGA: pSiS->CursorSize = 4096; pix24flags = Support32bppFb; break; case SIS_315_VGA: pSiS->CursorSize = 16384; pix24flags = Support32bppFb; break; case SIS_530_VGA: pSiS->CursorSize = 2048; pix24flags = Support32bppFb | Support24bppFb | SupportConvert32to24; break; default: pSiS->CursorSize = 2048; pix24flags = Support24bppFb | SupportConvert32to24 | PreferConvert32to24; break; } #ifdef SISDUALHEAD /* In case of Dual Head, we need to determine if we are the "master" head or * the "slave" head. In order to do that, we set PrimInit to DONE in the * shared entity at the end of the first initialization. The second * initialization then knows that some things have already been done. THIS * ALWAYS ASSUMES THAT THE FIRST DEVICE INITIALIZED IS THE MASTER! */ if(xf86IsEntityShared(pScrn->entityList[0])) { if(pSiSEnt->lastInstance > 0) { if(!xf86IsPrimInitDone(pScrn->entityList[0])) { /* First Head (always CRT2) */ pSiS->SecondHead = FALSE; pSiSEnt->pScrn_1 = pScrn; pSiSEnt->CRT1ModeNo = pSiSEnt->CRT2ModeNo = -1; pSiSEnt->CRT2ModeSet = FALSE; pSiS->DualHeadMode = TRUE; pSiSEnt->DisableDual = FALSE; pSiSEnt->BIOS = NULL; pSiSEnt->ROM661New = FALSE; pSiSEnt->HaveXGIBIOS = FALSE; pSiSEnt->SiS_Pr = NULL; pSiSEnt->RenderAccelArray = NULL; pSiSEnt->SiSFastVidCopy = pSiSEnt->SiSFastMemCopy = NULL; pSiSEnt->SiSFastVidCopyFrom = pSiSEnt->SiSFastMemCopyFrom = NULL; } else { /* Second Head (always CRT1) */ pSiS->SecondHead = TRUE; pSiSEnt->pScrn_2 = pScrn; pSiS->DualHeadMode = TRUE; } } else { /* Only one screen in config file - disable dual head mode */ pSiS->SecondHead = FALSE; pSiS->DualHeadMode = FALSE; pSiSEnt->DisableDual = TRUE; } } else { /* Entity is not shared - disable dual head mode */ pSiS->SecondHead = FALSE; pSiS->DualHeadMode = FALSE; } #endif /* Save the name of our Device section for SiSCtrl usage */ { int ttt = 0; GDevPtr device = xf86GetDevFromEntity(pScrn->entityList[0], pScrn->entityInstanceList[0]); if(device && device->identifier) { if((ttt = strlen(device->identifier)) > 31) ttt = 31; strncpy(&pSiS->devsectname[0], device->identifier, 31); } pSiS->devsectname[ttt] = 0; } pSiS->ForceCursorOff = FALSE; /* Allocate SiS_Private (for mode switching code) and initialize it */ pSiS->SiS_Pr = NULL; #ifdef SISDUALHEAD if(pSiSEnt) { if(pSiSEnt->SiS_Pr) pSiS->SiS_Pr = pSiSEnt->SiS_Pr; } #endif if(!pSiS->SiS_Pr) { if(!(pSiS->SiS_Pr = xnfcalloc(sizeof(struct SiS_Private), 1))) { SISErrorLog(pScrn, "Could not allocate memory for SiS_Pr structure\n"); goto my_error_1; } #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->SiS_Pr = pSiS->SiS_Pr; #endif memset(pSiS->SiS_Pr, 0, sizeof(struct SiS_Private)); pSiS->SiS_Pr->PciTag = pSiS->PciTag; pSiS->SiS_Pr->ChipType = pSiS->ChipType; pSiS->SiS_Pr->ChipRevision = pSiS->ChipRev; pSiS->SiS_Pr->SiS_Backup70xx = 0xff; pSiS->SiS_Pr->SiS_CHOverScan = -1; pSiS->SiS_Pr->SiS_ChSW = FALSE; pSiS->SiS_Pr->SiS_CustomT = CUT_NONE; pSiS->SiS_Pr->SiS_UseWide = -1; pSiS->SiS_Pr->SiS_UseWideCRT2 = -1; pSiS->SiS_Pr->SiS_TVBlue = -1; pSiS->SiS_Pr->PanelSelfDetected = FALSE; pSiS->SiS_Pr->UsePanelScaler = -1; pSiS->SiS_Pr->CenterScreen = -1; pSiS->SiS_Pr->CRT1UsesCustomMode = FALSE; pSiS->SiS_Pr->PDC = pSiS->SiS_Pr->PDCA = -1; pSiS->SiS_Pr->LVDSHL = -1; pSiS->SiS_Pr->HaveEMI = FALSE; pSiS->SiS_Pr->HaveEMILCD = FALSE; pSiS->SiS_Pr->OverruleEMI = FALSE; pSiS->SiS_Pr->SiS_SensibleSR11 = FALSE; if(pSiS->ChipType >= SIS_661) { pSiS->SiS_Pr->SiS_SensibleSR11 = TRUE; } pSiS->SiS_Pr->SiS_MyCR63 = pSiS->myCR63; pSiS->SiS_Pr->DDCPortMixup = FALSE; } /* Copy IO address to SiS_Pr and init the structure for * routines inside init.c/init301.c */ pSiS->SiS_Pr->IOAddress = (SISIOADDRESS)(pSiS->RelIO + 0x30); SiSRegInit(pSiS->SiS_Pr, pSiS->RelIO + 0x30); /* The following identifies the old chipsets. This is only * partly used since the really old chips are not supported, * but I keep it here for future use. * 205, 215 and 225 are to be treated the same way, 201 and 202 * are different. */ if(pSiS->VGAEngine == SIS_OLD_VGA || pSiS->VGAEngine == SIS_530_VGA) { switch(pSiS->Chipset) { case PCI_CHIP_SG86C201: pSiS->oldChipset = OC_SIS86201; break; case PCI_CHIP_SG86C202: pSiS->oldChipset = OC_SIS86202; break; case PCI_CHIP_SG86C205: inSISIDXREG(SISSR, 0x10, tempreg); if(tempreg & 0x80) pSiS->oldChipset = OC_SIS6205B; else pSiS->oldChipset = (pSiS->ChipRev == 0x11) ? OC_SIS6205C : OC_SIS6205A; break; case PCI_CHIP_SIS82C204: pSiS->oldChipset = OC_SIS82204; break; case 0x6225: pSiS->oldChipset = OC_SIS6225; break; case PCI_CHIP_SIS5597: pSiS->oldChipset = OC_SIS5597; break; case PCI_CHIP_SIS6326: pSiS->oldChipset = OC_SIS6326; break; case PCI_CHIP_SIS530: if(sis_pci_read_host_bridge_u32(0x00) == 0x06201039) { pSiS->oldChipset = OC_SIS620; } else { if((pSiS->ChipRev & 0x0f) < 0x0a) pSiS->oldChipset = OC_SIS530A; else pSiS->oldChipset = OC_SIS530B; } break; default: pSiS->oldChipset = OC_UNKNOWN; } } if(!xf86SetDepthBpp(pScrn, 0, 0, 0, pix24flags)) { SISErrorLog(pScrn, "xf86SetDepthBpp() error\n"); goto my_error_1; } /* Check that the returned depth is one we support */ temp = 0; switch(pScrn->depth) { case 8: case 16: case 24: break; case 15: if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { temp = 1; } break; default: temp = 1; } if(temp) { SISErrorLog(pScrn, "Given color depth (%d) is not supported by this driver/chipset\n", pScrn->depth); goto my_error_1; } xf86PrintDepthBpp(pScrn); if( (((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) && (pScrn->bitsPerPixel == 24)) || ((pSiS->VGAEngine == SIS_OLD_VGA) && (pScrn->bitsPerPixel == 32)) ) { SISErrorLog(pScrn, "Framebuffer bpp %d not supported for this chipset\n", pScrn->bitsPerPixel); goto my_error_1; } /* Get the depth24 pixmap format */ if(pScrn->depth == 24 && pix24bpp == 0) { pix24bpp = xf86GetBppFromDepth(pScrn, 24); } /* * 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)) { SISErrorLog(pScrn, "xf86SetWeight() error\n"); goto my_error_1; } else { Bool ret = FALSE; switch(pScrn->depth) { case 15: if((pScrn->weight.red != 5) || (pScrn->weight.green != 5) || (pScrn->weight.blue != 5)) ret = TRUE; break; case 16: if((pScrn->weight.red != 5) || (pScrn->weight.green != 6) || (pScrn->weight.blue != 5)) ret = TRUE; break; case 24: if((pScrn->weight.red != 8) || (pScrn->weight.green != 8) || (pScrn->weight.blue != 8)) ret = TRUE; break; } if(ret) { SISErrorLog(pScrn, "RGB weight %d%d%d at depth %d not supported by hardware\n", (int)pScrn->weight.red, (int)pScrn->weight.green, (int)pScrn->weight.blue, pScrn->depth); goto my_error_1; } } } /* Set the current layout parameters */ pSiS->CurrentLayout.bitsPerPixel = pScrn->bitsPerPixel; pSiS->CurrentLayout.depth = pScrn->depth; /* (Inside this function, we can use pScrn's contents anyway) */ if(!xf86SetDefaultVisual(pScrn, -1)) { SISErrorLog(pScrn, "xf86SetDefaultVisual() error\n"); goto my_error_1; } else { /* We don't support DirectColor at > 8bpp */ if(pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) { SISErrorLog(pScrn, "Given default visual (%s) is not supported at depth %d\n", xf86GetVisualName(pScrn->defaultVisual), pScrn->depth); goto my_error_1; } } #ifdef SISDUALHEAD /* Due to palette & timing problems we don't support 8bpp in DHM */ if((pSiS->DualHeadMode) && (pScrn->bitsPerPixel <= 8)) { SISErrorLog(pScrn, "Color depth %d not supported in Dual Head mode.\n", pScrn->bitsPerPixel); goto my_error_1; } #endif /* Read BIOS for 300/315/330/340 series customization */ pSiS->SiS_Pr->VirtualRomBase = NULL; pSiS->BIOS = NULL; pSiS->SiS_Pr->UseROM = FALSE; pSiS->ROM661New = FALSE; pSiS->HaveXGIBIOS = FALSE; if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { #ifdef SISDUALHEAD if(pSiSEnt) { if(pSiSEnt->BIOS) { pSiS->BIOS = pSiSEnt->BIOS; pSiS->SiS_Pr->VirtualRomBase = pSiS->BIOS; pSiS->ROM661New = pSiSEnt->ROM661New; pSiS->HaveXGIBIOS = pSiSEnt->HaveXGIBIOS; } } #endif if(!pSiS->BIOS) { if(!(pSiS->BIOS = calloc(1, BIOS_SIZE))) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Could not allocate memory for video BIOS image\n"); } else { UShort mypciid = pSiS->Chipset; UShort mypcivendor = (pSiS->ChipFlags & SiSCF_IsXGI) ? PCI_VENDOR_XGI : PCI_VENDOR_SIS; Bool found = FALSE, readpci = FALSE; int biossize = BIOS_SIZE; switch(pSiS->ChipType) { case SIS_315: mypciid = PCI_CHIP_SIS315; readpci = TRUE; break; case SIS_315PRO: mypciid = PCI_CHIP_SIS315PRO; readpci = TRUE; break; case SIS_300: case SIS_315H: case SIS_330: case SIS_340: case SIS_650: case SIS_760: case XGI_40: readpci = TRUE; break; case XGI_20: readpci = TRUE; biossize = 0x8000; break; } #if XSERVER_LIBPCIACCESS if(readpci) { pSiS->PciInfo->rom_size = biossize; pci_device_read_rom(pSiS->PciInfo, pSiS->BIOS); if(SISCheckBIOS(pSiS, mypciid, mypcivendor, biossize)) { found = TRUE; } } #else if(readpci) { xf86ReadPciBIOS(0, pSiS->PciTag, 0, pSiS->BIOS, biossize); if(SISCheckBIOS(pSiS, mypciid, mypcivendor, biossize)) { found = TRUE; } } if(!found) { ULong segstart; for(segstart = BIOS_BASE; segstart < 0x000f0000; segstart += 0x00001000) { #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) if(xf86ReadBIOS(segstart, 0, pSiS->BIOS, biossize) != biossize) continue; #else if(xf86ReadDomainMemory(pSiS->PciTag, segstart, biossize, pSiS->BIOS) != biossize) continue; #endif if(!SISCheckBIOS(pSiS, mypciid, mypcivendor, biossize)) continue; found = TRUE; break; } } #endif if(found) { UShort romptr = pSiS->BIOS[0x16] | (pSiS->BIOS[0x17] << 8); pSiS->SiS_Pr->VirtualRomBase = pSiS->BIOS; if(pSiS->ChipFlags & SiSCF_IsXGI) { pSiS->HaveXGIBIOS = pSiS->SiS_Pr->SiS_XGIROM = TRUE; pSiS->SiS_Pr->UseROM = FALSE; if(pSiS->ChipFlags & SiSCF_IsXGIV3) { if(!(pSiS->BIOS[0x1d1] & 0x01)) { pSiS->SiS_Pr->DDCPortMixup = TRUE; } } } else { pSiS->ROM661New = SiSDetermineROMLayout661(pSiS->SiS_Pr); } xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Video BIOS version \"%7s\" found (%s data layout)\n", &pSiS->BIOS[romptr], pSiS->ROM661New ? "new SiS" : (pSiS->HaveXGIBIOS ? "XGI" : "old SiS")); if(pSiS->SiS_Pr->DDCPortMixup) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "*** Buggy XGI V3XT card detected: If VGA and DVI are connected at the\n"); xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "*** same time, BIOS and driver will be unable to detect DVI connection.\n"); } #ifdef SISDUALHEAD if(pSiSEnt) { pSiSEnt->BIOS = pSiS->BIOS; pSiSEnt->ROM661New = pSiS->ROM661New; pSiSEnt->HaveXGIBIOS = pSiS->HaveXGIBIOS; } #endif } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Could not find/read video BIOS\n"); free(pSiS->BIOS); pSiS->BIOS = NULL; } } } if(!(pSiS->ChipFlags & SiSCF_IsXGI)) { if(pSiS->BIOS) pSiS->SiS_Pr->UseROM = TRUE; else pSiS->SiS_Pr->UseROM = FALSE; } } /* Evaluate options */ SiSOptions(pScrn); #ifdef SISMERGED /* Due to palette & timing problems we don't support 8bpp in MFBM */ if((pSiS->MergedFB) && (pScrn->bitsPerPixel <= 8)) { SISErrorLog(pScrn, "MergedFB: Color depth %d not supported, %s\n", pScrn->bitsPerPixel, mergeddisstr); pSiS->MergedFB = pSiS->MergedFBAuto = FALSE; } #endif /* Probe CPU features */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiS->CPUFlags = pSiSEnt->CPUFlags; } #endif if(!pSiS->CPUFlags) { pSiS->CPUFlags = SiSGetCPUFlags(pScrn); pSiS->CPUFlags |= SIS_CPUFL_FLAG; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) pSiSEnt->CPUFlags = pSiS->CPUFlags; #endif } /* We use a programamble clock */ pScrn->progClock = TRUE; /* Set the bits per RGB for 8bpp mode */ if(pScrn->depth == 8) pScrn->rgbBits = 8; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(!pSiS->SecondHead) { /* Copy some option settings to entity private */ pSiSEnt->HWCursor = pSiS->HWCursor; pSiSEnt->NoAccel = pSiS->NoAccel; pSiSEnt->useEXA = pSiS->useEXA; pSiSEnt->restorebyset = pSiS->restorebyset; pSiSEnt->OptROMUsage = pSiS->OptROMUsage; pSiSEnt->OptUseOEM = pSiS->OptUseOEM; pSiSEnt->TurboQueue = pSiS->TurboQueue; pSiSEnt->forceCRT1 = pSiS->forceCRT1; pSiSEnt->ForceCRT1Type = pSiS->ForceCRT1Type; pSiSEnt->CRT1TypeForced = pSiS->CRT1TypeForced; pSiSEnt->ForceCRT2Type = pSiS->ForceCRT2Type; pSiSEnt->ForceTVType = pSiS->ForceTVType; pSiSEnt->ForceYPbPrType = pSiS->ForceYPbPrType; pSiSEnt->ForceYPbPrAR = pSiS->ForceYPbPrAR; pSiSEnt->UsePanelScaler = pSiS->UsePanelScaler; pSiSEnt->CenterLCD = pSiS->CenterLCD; pSiSEnt->DSTN = pSiS->DSTN; pSiSEnt->FSTN = pSiS->FSTN; pSiSEnt->OptTVStand = pSiS->OptTVStand; pSiSEnt->NonDefaultPAL = pSiS->NonDefaultPAL; pSiSEnt->NonDefaultNTSC = pSiS->NonDefaultNTSC; pSiSEnt->chtvtype = pSiS->chtvtype; pSiSEnt->OptTVOver = pSiS->OptTVOver; pSiSEnt->OptTVSOver = pSiS->OptTVSOver; pSiSEnt->chtvlumabandwidthcvbs = pSiS->chtvlumabandwidthcvbs; pSiSEnt->chtvlumabandwidthsvideo = pSiS->chtvlumabandwidthsvideo; pSiSEnt->chtvlumaflickerfilter = pSiS->chtvlumaflickerfilter; pSiSEnt->chtvchromabandwidth = pSiS->chtvchromabandwidth; pSiSEnt->chtvchromaflickerfilter = pSiS->chtvchromaflickerfilter; pSiSEnt->chtvtextenhance = pSiS->chtvtextenhance; pSiSEnt->chtvcontrast = pSiS->chtvcontrast; pSiSEnt->chtvcvbscolor = pSiS->chtvcvbscolor; pSiSEnt->sistvedgeenhance = pSiS->sistvedgeenhance; pSiSEnt->sistvantiflicker = pSiS->sistvantiflicker; pSiSEnt->sistvsaturation = pSiS->sistvsaturation; pSiSEnt->sistvcfilter = pSiS->sistvcfilter; pSiSEnt->sistvyfilter = pSiS->sistvyfilter; pSiSEnt->sistvcolcalibc = pSiS->sistvcolcalibc; pSiSEnt->sistvcolcalibf = pSiS->sistvcolcalibf; pSiSEnt->tvxpos = pSiS->tvxpos; pSiSEnt->tvypos = pSiS->tvypos; pSiSEnt->tvxscale = pSiS->tvxscale; pSiSEnt->tvyscale = pSiS->tvyscale; pSiSEnt->siscrt1satgain = pSiS->siscrt1satgain; pSiSEnt->crt1satgaingiven = pSiS->crt1satgaingiven; pSiSEnt->CRT1gamma = pSiS->CRT1gamma; pSiSEnt->CRT1gammaGiven = pSiS->CRT1gammaGiven; pSiSEnt->XvGammaRed = pSiS->XvGammaRed; pSiSEnt->XvGammaGreen = pSiS->XvGammaGreen; pSiSEnt->XvGammaBlue = pSiS->XvGammaBlue; pSiSEnt->XvGamma = pSiS->XvGamma; pSiSEnt->XvGammaGiven = pSiS->XvGammaGiven; pSiSEnt->CRT2gamma = pSiS->CRT2gamma; pSiSEnt->XvOnCRT2 = pSiS->XvOnCRT2; pSiSEnt->AllowHotkey = pSiS->AllowHotkey; pSiSEnt->enablesisctrl = pSiS->enablesisctrl; pSiSEnt->SenseYPbPr = pSiS->SenseYPbPr; pSiSEnt->XvUseMemcpy = pSiS->XvUseMemcpy; pSiSEnt->BenchMemCpy = pSiS->BenchMemCpy; #ifdef SIS_CP SIS_CP_DRIVER_COPYOPTIONSENT #endif } else { /* We always use same cursor type on both screens */ pSiS->HWCursor = pSiSEnt->HWCursor; /* We need identical NoAccel setting */ pSiS->NoAccel = pSiSEnt->NoAccel; pSiS->useEXA = pSiSEnt->useEXA; pSiS->TurboQueue = pSiSEnt->TurboQueue; pSiS->restorebyset = pSiSEnt->restorebyset; pSiS->AllowHotkey = pSiS->AllowHotkey; pSiS->OptROMUsage = pSiSEnt->OptROMUsage; pSiS->OptUseOEM = pSiSEnt->OptUseOEM; pSiS->forceCRT1 = pSiSEnt->forceCRT1; pSiS->nocrt2ddcdetection = FALSE; pSiS->forcecrt2redetection = FALSE; pSiS->ForceCRT1Type = pSiSEnt->ForceCRT1Type; pSiS->ForceCRT2Type = pSiSEnt->ForceCRT2Type; pSiS->CRT1TypeForced = pSiSEnt->CRT1TypeForced; pSiS->UsePanelScaler = pSiSEnt->UsePanelScaler; pSiS->CenterLCD = pSiSEnt->CenterLCD; pSiS->DSTN = pSiSEnt->DSTN; pSiS->FSTN = pSiSEnt->FSTN; pSiS->OptTVStand = pSiSEnt->OptTVStand; pSiS->NonDefaultPAL = pSiSEnt->NonDefaultPAL; pSiS->NonDefaultNTSC = pSiSEnt->NonDefaultNTSC; pSiS->chtvtype = pSiSEnt->chtvtype; pSiS->ForceTVType = pSiSEnt->ForceTVType; pSiS->ForceYPbPrType = pSiSEnt->ForceYPbPrType; pSiS->ForceYPbPrAR = pSiSEnt->ForceYPbPrAR; pSiS->OptTVOver = pSiSEnt->OptTVOver; pSiS->OptTVSOver = pSiSEnt->OptTVSOver; pSiS->chtvlumabandwidthcvbs = pSiSEnt->chtvlumabandwidthcvbs; pSiS->chtvlumabandwidthsvideo = pSiSEnt->chtvlumabandwidthsvideo; pSiS->chtvlumaflickerfilter = pSiSEnt->chtvlumaflickerfilter; pSiS->chtvchromabandwidth = pSiSEnt->chtvchromabandwidth; pSiS->chtvchromaflickerfilter = pSiSEnt->chtvchromaflickerfilter; pSiS->chtvcvbscolor = pSiSEnt->chtvcvbscolor; pSiS->chtvtextenhance = pSiSEnt->chtvtextenhance; pSiS->chtvcontrast = pSiSEnt->chtvcontrast; pSiS->sistvedgeenhance = pSiSEnt->sistvedgeenhance; pSiS->sistvantiflicker = pSiSEnt->sistvantiflicker; pSiS->sistvsaturation = pSiSEnt->sistvsaturation; pSiS->sistvcfilter = pSiSEnt->sistvcfilter; pSiS->sistvyfilter = pSiSEnt->sistvyfilter; pSiS->sistvcolcalibc = pSiSEnt->sistvcolcalibc; pSiS->sistvcolcalibf = pSiSEnt->sistvcolcalibf; pSiS->tvxpos = pSiSEnt->tvxpos; pSiS->tvypos = pSiSEnt->tvypos; pSiS->tvxscale = pSiSEnt->tvxscale; pSiS->tvyscale = pSiSEnt->tvyscale; pSiS->SenseYPbPr = pSiSEnt->SenseYPbPr; if(!pSiS->CRT1gammaGiven) { if(pSiSEnt->CRT1gammaGiven) pSiS->CRT1gamma = pSiSEnt->CRT1gamma; } pSiS->CRT2gamma = pSiSEnt->CRT2gamma; if(!pSiS->XvGammaGiven) { if(pSiSEnt->XvGammaGiven) { pSiS->XvGamma = pSiSEnt->XvGamma; pSiS->XvGammaRed = pSiS->XvGammaRedDef = pSiSEnt->XvGammaRed; pSiS->XvGammaGreen = pSiS->XvGammaGreenDef = pSiSEnt->XvGammaGreen; pSiS->XvGammaBlue = pSiS->XvGammaBlueDef = pSiSEnt->XvGammaBlue; } } if(!pSiS->crt1satgaingiven) { if(pSiSEnt->crt1satgaingiven) pSiS->siscrt1satgain = pSiSEnt->siscrt1satgain; } pSiS->XvOnCRT2 = pSiSEnt->XvOnCRT2; pSiS->enablesisctrl = pSiSEnt->enablesisctrl; pSiS->XvUseMemcpy = pSiSEnt->XvUseMemcpy; pSiS->BenchMemCpy = pSiSEnt->BenchMemCpy; /* Copy gamma brightness to Ent (sic!) for Xinerama */ pSiSEnt->GammaBriR = pSiS->GammaBriR; pSiSEnt->GammaBriG = pSiS->GammaBriG; pSiSEnt->GammaBriB = pSiS->GammaBriB; pSiSEnt->NewGammaBriR = pSiS->NewGammaBriR; pSiSEnt->NewGammaBriG = pSiS->NewGammaBriG; pSiSEnt->NewGammaBriB = pSiS->NewGammaBriB; pSiSEnt->NewGammaConR = pSiS->NewGammaConR; pSiSEnt->NewGammaConG = pSiS->NewGammaConG; pSiSEnt->NewGammaConB = pSiS->NewGammaConB; #ifdef SIS_CP SIS_CP_DRIVER_COPYOPTIONS #endif } } #endif /* Handle UseROMData, NoOEM and UsePanelScaler options */ if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { from = X_PROBED; if(pSiS->OptROMUsage == 0) { pSiS->SiS_Pr->UseROM = FALSE; from = X_CONFIG; xf86DrvMsg(pScrn->scrnIndex, from, "Video ROM data usage is disabled\n"); } if(!pSiS->OptUseOEM) { xf86DrvMsg(pScrn->scrnIndex, from, "Internal OEM LCD/TV/VGA2 data usage is disabled\n"); } pSiS->SiS_Pr->UsePanelScaler = pSiS->UsePanelScaler; pSiS->SiS_Pr->CenterScreen = pSiS->CenterLCD; } /* Do some HW configuration detection (memory amount & type, clock, etc) */ SiSSetup(pScrn); /* Get framebuffer address */ if(pSiS->pEnt->device->MemBase != 0) { /* * XXX Should check that the config file value matches one of the * PCI base address values. */ pSiS->FbAddress = pSiS->pEnt->device->MemBase; from = X_CONFIG; } else { pSiS->FbAddress = PCI_REGION_BASE(pSiS->PciInfo, 0, REGION_MEM) & 0xFFFFFFF0; from = X_PROBED; } #ifdef SISDUALHEAD if(pSiS->DualHeadMode) xf86DrvMsg(pScrn->scrnIndex, from, "Global linear framebuffer at 0x%lX\n", (ULong)pSiS->FbAddress); else #endif xf86DrvMsg(pScrn->scrnIndex, from, "Linear framebuffer at 0x%lX\n", (ULong)pSiS->FbAddress); pSiS->realFbAddress = pSiS->FbAddress; /* Get MMIO address */ if(pSiS->pEnt->device->IOBase != 0) { /* * XXX Should check that the config file value matches one of the * PCI base address values. */ pSiS->IOAddress = pSiS->pEnt->device->IOBase; from = X_CONFIG; } else { pSiS->IOAddress = PCI_REGION_BASE(pSiS->PciInfo, 1, REGION_MEM) & 0xFFFFFFF0; from = X_PROBED; } xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%lX (size %ldK)\n", (ULong)pSiS->IOAddress, pSiS->mmioSize); #ifndef XSERVER_LIBPCIACCESS /* Register the PCI-assigned resources */ if(xf86RegisterResources(pSiS->pEnt->index, NULL, ResExclusive)) { SISErrorLog(pScrn, "PCI resource conflicts detected\n"); #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->ErrorAfterFirst = TRUE; #endif sisRestoreExtRegisterLock(pSiS,srlockReg,crlockReg); if(pSiS->pInt) xf86FreeInt10(pSiS->pInt); SISFreeRec(pScrn); return FALSE; } #endif from = X_PROBED; if(pSiS->pEnt->device->videoRam != 0) { if(pSiS->Chipset == PCI_CHIP_SIS6326) { pScrn->videoRam = pSiS->pEnt->device->videoRam; from = X_CONFIG; } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Option \"VideoRAM\" ignored\n"); } } pSiS->RealVideoRam = pScrn->videoRam; if((pSiS->Chipset == PCI_CHIP_SIS6326) && (pScrn->videoRam > 4096) && (from != X_CONFIG)) { pScrn->videoRam = 4096; xf86DrvMsg(pScrn->scrnIndex, from, "SiS6326: Detected %d KB VideoRAM, limiting to %d KB\n", pSiS->RealVideoRam, pScrn->videoRam); } else { xf86DrvMsg(pScrn->scrnIndex, from, "VideoRAM: %d KB\n", pScrn->videoRam); } if((pSiS->Chipset == PCI_CHIP_SIS6326) && (pScrn->videoRam > 4096)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SiS6326 engines do not support more than 4096KB RAM, therefore\n"); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TurboQueue, HWCursor, 2D acceleration and XVideo are disabled.\n"); pSiS->TurboQueue = FALSE; pSiS->HWCursor = FALSE; pSiS->NoXvideo = TRUE; pSiS->NoAccel = TRUE; } pSiS->FbMapSize = pSiS->availMem = pScrn->videoRam * 1024; /* Calculate real availMem according to Accel/TurboQueue and * HWCursur setting. Also, initialize some variables used * in other modules. */ pSiS->cursorOffset = 0; pSiS->CurARGBDest = NULL; pSiS->CurMonoSrc = NULL; pSiS->CurFGCol = pSiS->CurBGCol = 0; pSiS->FbBaseOffset = 0; switch(pSiS->VGAEngine) { case SIS_300_VGA: pSiS->TurboQueueLen = 512; if(pSiS->TurboQueue) { pSiS->availMem -= (pSiS->TurboQueueLen*1024); pSiS->cursorOffset = 512; } if(pSiS->HWCursor) { pSiS->availMem -= pSiS->CursorSize; if(pSiS->OptUseColorCursor) pSiS->availMem -= pSiS->CursorSize; } pSiS->CmdQueLenMask = 0xFFFF; pSiS->CmdQueLenFix = 0; pSiS->cursorBufferNum = 0; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->cursorBufferNum = 0; #endif break; case SIS_315_VGA: #ifdef SISVRAMQ /* VRAM queue */ pSiS->cmdQueueSizeMask = pSiS->cmdQueueSize - 1; /* VRAM Command Queue is variable (in therory) */ pSiS->cmdQueueOffset = (pScrn->videoRam * 1024) - pSiS->cmdQueueSize; pSiS->cmdQueueLen = 0; pSiS->cmdQueueSize_div2 = pSiS->cmdQueueSize / 2; pSiS->cmdQueueSize_div4 = pSiS->cmdQueueSize / 4; pSiS->cmdQueueSize_4_3 = (pSiS->cmdQueueSize / 4) * 3; pSiS->availMem -= pSiS->cmdQueueSize; pSiS->cursorOffset = (pSiS->cmdQueueSize / 1024); /* Set up shared pointer to current offset */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) pSiS->cmdQ_SharedWritePort = &(pSiSEnt->cmdQ_SharedWritePort_2D); else #endif pSiS->cmdQ_SharedWritePort = &(pSiS->cmdQ_SharedWritePort_2D); #else /* MMIO */ if(pSiS->TurboQueue) { pSiS->availMem -= (512*1024); /* MMIO Command Queue is 512k (variable in theory) */ pSiS->cursorOffset = 512; } #endif if(pSiS->HWCursor) { pSiS->availMem -= (pSiS->CursorSize * 2); if(pSiS->OptUseColorCursor) pSiS->availMem -= (pSiS->CursorSize * 2); } pSiS->cursorBufferNum = 0; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->cursorBufferNum = 0; #endif if((pSiS->SiS76xLFBSize) && (pSiS->SiS76xUMASize)) { pSiS->availMem -= pSiS->SiS76xUMASize; pSiS->FbBaseOffset = pSiS->SiS76xUMASize; } break; default: /* cursorOffset not used in cursor functions for 530 and * older chips, because the cursor is *above* the TQ. * On 5597 and older revisions of the 6326, the TQ is * max 32K, on newer 6326 revisions and the 530 either 30 * (or 32?) or 62K (or 64?). However, to make sure, we * use only 30K (or 32?), but reduce the available memory * by 64, and locate the TQ at the beginning of this last * 64K block. (We do this that way even when using the * HWCursor, because the cursor only takes 2K and the * queue does not seem to last that far anyway.) * The TQ must be located at 32KB boundaries. */ if(pSiS->RealVideoRam < 3072) { if(pSiS->TurboQueue) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Not enough video RAM for TurboQueue. TurboQueue disabled\n"); pSiS->TurboQueue = FALSE; } } pSiS->CmdQueMaxLen = 32; if(pSiS->TurboQueue) { pSiS->availMem -= (64*1024); pSiS->CmdQueMaxLen = 900; /* To make sure; should be 992 */ } else if(pSiS->HWCursor) { pSiS->availMem -= pSiS->CursorSize; } if(pSiS->Chipset == PCI_CHIP_SIS530) { /* Check if Flat Panel is enabled */ inSISIDXREG(SISSR, 0x0e, tempreg); if(!(tempreg & 0x04)) pSiS->availMem -= pSiS->CursorSize; /* Set up mask for MMIO register */ pSiS->CmdQueLenMask = (pSiS->TurboQueue) ? 0x1FFF : 0x00FF; } else { /* TQ is never used on 6326/5597, because the accelerator * always Syncs. So this is just cosmentic work. (And I * am not even sure that 0x7fff is correct. MMIO 0x83a8 * holds 0xec0 if (30k) TQ is enabled, 0x20 if TQ disabled. * The datasheet has no real explanation on the queue length * if the TQ is enabled. Not syncing and waiting for a * suitable queue length instead does not work. */ pSiS->CmdQueLenMask = (pSiS->TurboQueue) ? 0x7FFF : 0x003F; } /* This is to be subtracted from MMIO queue length register contents * for getting the real Queue length. */ pSiS->CmdQueLenFix = (pSiS->TurboQueue) ? 32 : 0; } #ifdef SISDUALHEAD /* In dual head mode, we share availMem equally - so align it * to 8KB; this way, the address of the FB of the second * head is aligned to 4KB for mapping. */ if(pSiS->DualHeadMode) pSiS->availMem &= 0xFFFFE000; #endif /* Check MaxXFBMem setting */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { /* 1. Since DRI is not supported in dual head mode, we * don't need the MaxXFBMem setting - ignore it. */ if(pSiS->maxxfbmem) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MaxXFBMem ignored in Dual Head mode\n"); } pSiS->maxxfbmem = pSiS->availMem; } else #endif if((pSiS->sisfbHeapStart) || (pSiS->sisfbHaveNewHeapDef)) { /* * 2. We have memory layout info from sisfb - ignore MaxXFBMem */ if(pSiS->maxxfbmem) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Got memory layout info from sisfb, ignoring MaxXFBMem option\n"); } if((pSiS->FbBaseOffset) && (!pSiS->sisfbHaveNewHeapDef)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Incompatible sisfb version detected, DRI disabled\n"); pSiS->loadDRI = FALSE; pSiS->maxxfbmem = pSiS->availMem; } else { if(pSiS->FbBaseOffset) { /* Revert our changes to FbBaseOffset and availMem; use sisfb's info */ pSiS->availMem += pSiS->FbBaseOffset; pSiS->FbBaseOffset = 0; } if(pSiS->sisfbVideoOffset) { /* a. DRI heap BELOW framebuffer */ pSiS->FbBaseOffset = pSiS->sisfbVideoOffset; pSiS->availMem -= pSiS->FbBaseOffset; pSiS->maxxfbmem = pSiS->availMem; } else { /* b. DRI heap ABOVE framebuffer (traditional layout) */ if(pSiS->availMem < (pSiS->sisfbHeapStart * 1024)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error - sisfb memory layout corrupt\n"); pSiS->loadDRI = FALSE; pSiS->maxxfbmem = pSiS->availMem; } else { pSiS->maxxfbmem = pSiS->sisfbHeapStart * 1024; } } } } else if(pSiS->maxxfbmem) { /* * 3. No sisfb, but user gave "MaxXFBMem" */ if(pSiS->FbBaseOffset) { /* a. DRI heap BELOW framebuffer */ if(pSiS->maxxfbmem > (pSiS->availMem + pSiS->FbBaseOffset - pSiS->SiS76xUMASize)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid MaxXFBMem setting\n"); pSiS->maxxfbmem = pSiS->availMem; } else { /* Revert our changes */ pSiS->availMem += pSiS->FbBaseOffset; /* Use user's MaxXFBMem setting */ pSiS->FbBaseOffset = pSiS->availMem - pSiS->maxxfbmem; pSiS->availMem -= pSiS->FbBaseOffset; } } else { /* b. DRI heap ABOVE framebuffer (traditional layout) */ if(pSiS->maxxfbmem > pSiS->availMem) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Invalid MaxXFBMem setting.\n"); pSiS->maxxfbmem = pSiS->availMem; } } } else { /* * 4. No MaxXFBMem, no sisfb: Use all memory */ pSiS->maxxfbmem = pSiS->availMem; /* ... except on chipsets, for which DRI is * supported: If DRI is enabled, we now limit * ourselves to a reasonable default: */ if(pSiS->loadDRI) { if(pSiS->FbBaseOffset) { /* a. DRI heap BELOW framebuffer */ /* See how much UMA and LFB memory we have, * and calculate a reasonable default. We * use more vram for ourselves because these * chips are eg. capable of larger Xv * overlays, etc. */ unsigned long total = (pSiS->SiS76xLFBSize + pSiS->SiS76xUMASize) / 1024; unsigned long mymax; if(total <= 16384) /* <= 16MB: Use 8MB for X */ mymax = 8192 * 1024; else if(total <= 32768) /* <= 32MB: Use 16MB for X */ mymax = 16384 * 1024; else /* Otherwise: Use 20MB for X */ mymax = 20 * 1024 * 1024; /* availMem is right now adjusted to not use the UMA * area. Make sure that our default doesn't reach * into the UMA area either. */ if(pSiS->availMem > mymax) { /* Write our default to maxxfbmem */ pSiS->maxxfbmem = mymax; /* Revert our changes to availMem */ pSiS->availMem += pSiS->FbBaseOffset; /* Use our default setting */ pSiS->FbBaseOffset = pSiS->availMem - pSiS->maxxfbmem; pSiS->availMem -= pSiS->FbBaseOffset; } } else { /* b. DRI heap ABOVE framebuffer (traditional layout) */ /* See how much video memory we have, and calculate * a reasonable default. * Since DRI is pointless with less than 4MB of total * video RAM, we disable it in that case. */ if(pScrn->videoRam <= 4096) pSiS->loadDRI = FALSE; else if(pScrn->videoRam <= 8192) /* <= 8MB: Use 4MB for X */ pSiS->maxxfbmem = 4096 * 1024; else if(pScrn->videoRam <= 16384) /* <= 16MB: Use 8MB for X */ pSiS->maxxfbmem = 8192 * 1024; #ifdef SISMERGED /* Otherwise: --- */ else if(pSiS->MergedFB) { if(pScrn->videoRam <= 65536) pSiS->maxxfbmem = 16384 * 1024; /* If MergedFB and <=64MB, use 16MB for X */ else pSiS->maxxfbmem = 20 * 1024 * 1024; /* If MergedFB and > 64MB, use 20MB for X */ } #endif else if(pSiS->VGAEngine == SIS_315_VGA) { if(pScrn->videoRam <= 65536) pSiS->maxxfbmem = 16384 * 1024; /* On >=315 series and <=64MB, use 16MB */ else pSiS->maxxfbmem = 20 * 1024 * 1024; /* On >=315 series and > 64MB, use 20MB */ } else pSiS->maxxfbmem = 12288 * 1024; /* On <315 series, use 12MB */ /* A final check */ if(pSiS->maxxfbmem > pSiS->availMem) { pSiS->maxxfbmem = pSiS->availMem; pSiS->loadDRI = FALSE; } } } } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using %dK of framebuffer memory at offset %dK\n", pSiS->maxxfbmem / 1024, pSiS->FbBaseOffset / 1024); /* Find out about sub-classes of some chipsets and check * if the chipset supports two video overlays */ if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA || pSiS->Chipset == PCI_CHIP_SIS530 || pSiS->Chipset == PCI_CHIP_SIS6326 || pSiS->Chipset == PCI_CHIP_SIS5597) { pSiS->hasTwoOverlays = FALSE; switch(pSiS->Chipset) { case PCI_CHIP_SIS300: case PCI_CHIP_SIS540: /* ? (If not, need to add the SwitchCRT Xv attribute!) */ case PCI_CHIP_SIS630: case PCI_CHIP_SIS550: pSiS->hasTwoOverlays = TRUE; pSiS->SiS_SD_Flags |= SiS_SD_SUPPORT2OVL; break; case PCI_CHIP_SIS315PRO: pSiS->ChipFlags |= SiSCF_LARGEOVERLAY; break; case PCI_CHIP_SIS330: pSiS->ChipFlags |= (SiSCF_CRT2HWCKaputt | SiSCF_LARGEOVERLAY); break; case PCI_CHIP_SIS340: case PCI_CHIP_XGIXG40: /* Verified: only 1 overlay */ pSiS->ChipFlags |= SiSCF_LARGEOVERLAY; break; case PCI_CHIP_SIS650: { UChar tempreg1, tempreg2; static const char *id650str[] = { "650", "650", "650", "650", "650 A0 AA", "650 A2 CA", "650", "650", "M650 A0", "M650 A1 AA","651 A0 AA", "651 A1 AA", "M650", "65?", "651", "65?" }; pSiS->ChipFlags |= SiSCF_LARGEOVERLAY; if(pSiS->ChipType == SIS_650) { inSISIDXREG(SISCR, 0x5f, CR5F); CR5F &= 0xf0; andSISIDXREG(SISCR, 0x5c, 0x07); inSISIDXREG(SISCR, 0x5c, tempreg1); tempreg1 &= 0xf8; orSISIDXREG(SISCR, 0x5c, 0xf8); inSISIDXREG(SISCR, 0x5c, tempreg2); tempreg2 &= 0xf8; if((!tempreg1) || (tempreg2)) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "SiS650 revision ID %x (%s)\n", CR5F, id650str[CR5F >> 4]); if(CR5F & 0x80) { pSiS->hasTwoOverlays = TRUE; /* M650 or 651 */ pSiS->SiS_SD_Flags |= SiS_SD_SUPPORT2OVL; } switch(CR5F) { case 0xa0: case 0xb0: case 0xe0: pSiS->ChipFlags |= SiSCF_Is651; break; case 0x80: case 0x90: case 0xc0: pSiS->ChipFlags |= SiSCF_IsM650; break; } } else { pSiS->hasTwoOverlays = TRUE; pSiS->SiS_SD_Flags |= SiS_SD_SUPPORT2OVL; switch(CR5F) { case 0x90: inSISIDXREG(SISCR, 0x5c, tempreg1); tempreg1 &= 0xf8; switch(tempreg1) { case 0x00: pSiS->ChipFlags |= SiSCF_IsM652; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "SiSM652 revision ID %x\n", CR5F); break; case 0x40: pSiS->ChipFlags |= SiSCF_IsM653; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "SiSM653 revision ID %x\n", CR5F); break; default: pSiS->ChipFlags |= SiSCF_IsM650; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "SiSM650 revision ID %x\n", CR5F); break; } break; case 0xb0: pSiS->ChipFlags |= SiSCF_Is652; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "SiS652 revision ID %x\n", CR5F); break; default: pSiS->ChipFlags |= SiSCF_IsM650; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "SiSM650 revision ID %x\n", CR5F); break; } } } break; } case PCI_CHIP_SIS660: { pSiS->ChipFlags |= SiSCF_LARGEOVERLAY; pSiS->hasTwoOverlays = TRUE; pSiS->SiS_SD_Flags |= SiS_SD_SUPPORT2OVL; /* 760/761: - UMA only: one/two overlays - dotclock dependent - UMA+LFB: two overlays if video data in LFB - LFB only: two overlays If UMA only: Must switch between one/two overlays on the fly (done in PostSetMode()) If LFB+UMA: We use LFB memory only and leave UMA to an eventually written DRI driver. */ break; } } if(!(pSiS->SiS_SD2_Flags & SiS_SD2_NOOVERLAY)) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Hardware supports %s video overlay%s\n", pSiS->hasTwoOverlays ? "two" : "one", pSiS->hasTwoOverlays ? "s" : ""); } if(pSiS->SiS_SD2_Flags & SiS_SD2_SUPPORT760OO) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\n\tDear SiS76x user, your machine is using a shared memory framebuffer.\n" "\tDue to hardware limitations of the SiS chip in combination with the\n" "\tAMD CPU, video overlay support is very limited on this machine. If you\n" "\texperience flashing lines in the video and/or the graphics display\n" "\tduring video playback, reduce the color depth and/or the resolution\n" "\tand/or the refresh rate. Alternatively, use the video blitter.\n"); } } /* Backup VB connection and CRT1 on/off register */ if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { inSISIDXREG(SISSR, 0x1f, pSiS->oldSR1F); inSISIDXREG(SISCR, 0x17, pSiS->oldCR17); inSISIDXREG(SISCR, 0x32, pSiS->oldCR32); inSISIDXREG(SISCR, 0x36, pSiS->oldCR36); inSISIDXREG(SISCR, 0x37, pSiS->oldCR37); if(pSiS->VGAEngine == SIS_315_VGA) { inSISIDXREG(SISCR, pSiS->myCR63, pSiS->oldCR63); } pSiS->postVBCR32 = pSiS->oldCR32; } /* There are some machines out there which require a special * setup of the GPIO registers in order to make the Chrontel * work. Try to find out if we're running on such a machine. * Furthermore, there is some highly customized hardware, * which requires some non-standard LVDS timing. Since the * vendors don't seem to care about PCI subsystem ID's we * need to find out using the BIOS version and date strings. */ pSiS->SiS_Pr->SiS_ChSW = FALSE; if(pSiS->Chipset == PCI_CHIP_SIS630) { int i = 0; do { if(mychswtable[i].subsysVendor == PCI_SUB_VENDOR_ID(pSiS->PciInfo) && mychswtable[i].subsysCard == PCI_SUB_DEVICE_ID(pSiS->PciInfo)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PCI subsystem ID found in list for Chrontel/GPIO setup:\n"); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "\tVendor/Card: %s %s (ID %04x)\n", mychswtable[i].vendorName, mychswtable[i].cardName, PCI_SUB_DEVICE_ID(pSiS->PciInfo)); pSiS->SiS_Pr->SiS_ChSW = TRUE; break; } i++; } while(mychswtable[i].subsysVendor != 0); } if(pSiS->SiS_Pr->SiS_CustomT == CUT_NONE) { int i = 0, j; UShort bversptr = 0; Bool footprint; CARD32 chksum = 0; if(pSiS->SiS_Pr->UseROM) { bversptr = pSiS->BIOS[0x16] | (pSiS->BIOS[0x17] << 8); for(i=0; i<32768; i++) chksum += pSiS->BIOS[i]; } i = 0; do { if( (SiS_customttable[i].chipID == pSiS->ChipType) && ((!strlen(SiS_customttable[i].biosversion)) || (pSiS->SiS_Pr->UseROM && (!strncmp(SiS_customttable[i].biosversion, (char *)&pSiS->BIOS[bversptr], strlen(SiS_customttable[i].biosversion))))) && ((!strlen(SiS_customttable[i].biosdate)) || (pSiS->SiS_Pr->UseROM && (!strncmp(SiS_customttable[i].biosdate, (char *)&pSiS->BIOS[0x2c], strlen(SiS_customttable[i].biosdate))))) && ((!SiS_customttable[i].bioschksum) || (pSiS->SiS_Pr->UseROM && (SiS_customttable[i].bioschksum == chksum))) && (SiS_customttable[i].pcisubsysvendor == PCI_SUB_VENDOR_ID(pSiS->PciInfo)) && (SiS_customttable[i].pcisubsyscard == PCI_SUB_DEVICE_ID(pSiS->PciInfo)) ) { footprint = TRUE; for(j=0; j<5; j++) { if(SiS_customttable[i].biosFootprintAddr[j]) { if(pSiS->SiS_Pr->UseROM) { if(pSiS->BIOS[SiS_customttable[i].biosFootprintAddr[j]] != SiS_customttable[i].biosFootprintData[j]) footprint = FALSE; } else footprint = FALSE; } } if(footprint) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Identified %s %s, special timing applies\n", SiS_customttable[i].vendorName, SiS_customttable[i].cardName); pSiS->SiS_Pr->SiS_CustomT = SiS_customttable[i].SpecialID; break; } } i++; } while(SiS_customttable[i].chipID); } /* Handle ForceCRT1 option */ if(pSiS->forceCRT1 != -1) { if(pSiS->forceCRT1) pSiS->CRT1off = 0; else pSiS->CRT1off = 1; } else pSiS->CRT1off = -1; /* Detect video bridge and sense TV/VGA2 */ SISVGAPreInit(pScrn); /* Detect CRT1 (via DDC1 and DDC2, hence via VGA port; regardless of LCDA) */ SISCRT1PreInit(pScrn); /* Detect LCD (connected via CRT2, regardless of LCDA) and LCD resolution */ SISLCDPreInit(pScrn, FALSE); /* LCDA only supported under these conditions: */ if(pSiS->ForceCRT1Type == CRT1_LCDA) { if(!SISDetermineLCDACap(pScrn)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Chipset/Video bridge does not support LCD-via-CRT1\n"); pSiS->ForceCRT1Type = CRT1_VGA; } else if(!(pSiS->VBFlags & CRT2_LCD)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "No digital LCD panel found, LCD-via-CRT1 disabled\n"); pSiS->ForceCRT1Type = CRT1_VGA; } } /* Setup SD flags */ pSiS->SiS_SD_Flags |= SiS_SD_ADDLSUPFLAG; pSiS->SiS_SD2_Flags |= SiS_SD2_MERGEDUCLOCK; pSiS->SiS_SD2_Flags |= SiS_SD2_USEVBFLAGS2; pSiS->SiS_SD2_Flags |= SiS_SD2_VBINVB2ONLY; pSiS->SiS_SD2_Flags |= SiS_SD2_HAVESD34; pSiS->SiS_SD2_Flags |= SiS_SD2_NEWGAMMABRICON; pSiS->SiS_SD3_Flags |= SiS_SD3_MFBALLOWOFFCL; if(pSiS->VBFlags2 & VB2_VIDEOBRIDGE) { pSiS->SiS_SD2_Flags |= SiS_SD2_VIDEOBRIDGE; if(pSiS->VBFlags2 & VB2_SISBRIDGE) { pSiS->SiS_SD2_Flags |= ( SiS_SD2_SISBRIDGE | SiS_SD2_SUPPORTGAMMA2 ); if(pSiS->VBFlags2 & VB2_SISLVDSBRIDGE) { pSiS->SiS_SD2_Flags |= ( SiS_SD2_LCDLVDS | SiS_SD2_SUPPORTLCD ); } else if(pSiS->VBFlags2 & VB2_SISTMDSBRIDGE) { if(!(pSiS->VBFlags2 & VB2_30xBDH)) { pSiS->SiS_SD2_Flags |= ( SiS_SD2_LCDTMDS | SiS_SD2_SUPPORTLCD ); } else if(pSiS->VBFlags & CRT2_LCD) { pSiS->SiS_SD2_Flags |= ( SiS_SD2_THIRDPARTYLVDS | SiS_SD2_SUPPORTLCD ); } } } else if(pSiS->VBFlags2 & VB2_LVDS) { pSiS->SiS_SD2_Flags |= ( SiS_SD2_THIRDPARTYLVDS | SiS_SD2_SUPPORTLCD ); } if(pSiS->VBFlags2 & (VB2_SISTVBRIDGE | VB2_CHRONTEL)) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTTV; if(pSiS->VBFlags2 & VB2_SISBRIDGE) { pSiS->SiS_SD2_Flags |= ( SiS_SD2_SUPPORTTVTYPE | SiS_SD2_SUPPORTTVSIZE ); if(!(pSiS->VBFlags2 & VB2_301)) { pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPTVSAT; } else { pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPTVEDGE; } } } } #ifdef ENABLE_YPBPR if((pSiS->VGAEngine == SIS_315_VGA) && (pSiS->VBFlags2 & VB2_SISYPBPRBRIDGE)) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTYPBPR; pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPORT625I; pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPORT625P; if(pSiS->VBFlags2 & VB2_SISYPBPRARBRIDGE) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTYPBPRAR; } } if(pSiS->VBFlags2 & VB2_SISHIVISIONBRIDGE) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTHIVISION; } #endif if((pSiS->VGAEngine != SIS_300_VGA) || (!(pSiS->VBFlags2 & VB2_TRUMPION))) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTSCALE; if((pSiS->VBFlags2 & VB2_SISTMDSBRIDGE) && (!(pSiS->VBFlags2 & VB2_30xBDH))) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTCENTER; } } #ifdef SISDUALHEAD if(!pSiS->DualHeadMode) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTREDETECT; } #endif #ifndef SISCHECKOSSSE pSiS->SiS_SD2_Flags |= SiS_SD2_NEEDUSESSE; #endif #ifdef TWDEBUG /* FOR TESTING */ pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTYPBPRAR; xf86DrvMsg(0, X_INFO, "TEST: Support Aspect Ratio\n"); #endif /* Detect CRT2-TV and PAL/NTSC mode */ SISTVPreInit(pScrn, FALSE); /* Detect CRT2-VGA */ SISCRT2PreInit(pScrn, FALSE); /* Backup detected CRT2 devices */ SISSaveDetectedDevices(pScrn); if(!(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTYPBPR)) { if((pSiS->ForceTVType != -1) && (pSiS->ForceTVType & TV_YPBPR)) { pSiS->ForceTVType = -1; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "YPbPr TV output not supported\n"); } } if(!(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTHIVISION)) { if((pSiS->ForceTVType != -1) && (pSiS->ForceTVType & TV_HIVISION)) { pSiS->ForceTVType = -1; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "HiVision TV output not supported\n"); } } if((pSiS->VBFlags2 & VB2_SISTVBRIDGE) || ((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->ChrontelType == CHRONTEL_701x))) { pSiS->SiS_SD_Flags |= (SiS_SD_SUPPORTPALMN | SiS_SD_SUPPORTNTSCJ); } if((pSiS->VBFlags2 & VB2_SISTVBRIDGE) || ((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->ChrontelType == CHRONTEL_700x))) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTTVPOS; } if(pSiS->VBFlags2 & VB2_SISVGA2BRIDGE) { pSiS->SiS_SD_Flags |= (SiS_SD_SUPPORTSCART | SiS_SD_SUPPORTVGA2); } if(pSiS->VBFlags2 & VB2_CHRONTEL) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTOVERSCAN; pSiS->SiS_SD2_Flags |= SiS_SD2_CHRONTEL; if(pSiS->ChrontelType == CHRONTEL_700x) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTSOVER; } } /* Determine if chipset LCDA-capable */ pSiS->SiS_SD_Flags &= ~SiS_SD_SUPPORTLCDA; if(SISDetermineLCDACap(pScrn)) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTLCDA; } /* Default to LCDA if LCD detected and * - TV detected (hence default to LCDA+TV), or * - in single head mode, on LCD panels with xres > 1600 * (Don't do this in MergedFB or DHM; LCDA and CRT1/VGA * are mutually exclusive; if no TV is detected, the * code below will default to VGA+LCD, so LCD is driven * via CRT2.) * (TODO: This might need some modification for the * 307 bridges, if these are capable of driving * LCDs > 1600 via channel B) */ if((pSiS->SiS_SD_Flags & SiS_SD_SUPPORTLCDA) && (pSiS->VBFlags & CRT2_LCD) && (pSiS->SiS_Pr->SiS_CustomT != CUT_UNKNOWNLCD)) { if((!pSiS->CRT1TypeForced) && (pSiS->ForceCRT2Type == CRT2_DEFAULT)) { if(pSiS->VBFlags & CRT2_TV) { /* If both LCD and TV present, default to LCDA+TV */ pSiS->ForceCRT1Type = CRT1_LCDA; pSiS->ForceCRT2Type = CRT2_TV; } else if(pSiS->LCDwidth > 1600) { /* If LCD is > 1600, default to LCDA if we don't need CRT1/VGA for other head */ Bool NeedCRT1VGA = FALSE; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) NeedCRT1VGA = TRUE; #endif #ifdef SISMERGED if(pSiS->MergedFB && (!pSiS->MergedFBAuto || pSiS->CRT1Detected)) NeedCRT1VGA = TRUE; #endif if(!NeedCRT1VGA) { pSiS->ForceCRT1Type = CRT1_LCDA; } } } } /* Set up pseudo-panel if LCDA forced on TMDS bridges */ if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTLCDA) { if(pSiS->ForceCRT1Type == CRT1_LCDA) { if(pSiS->VBFlags2 & VB2_SISTMDSLCDABRIDGE) { if(!(pSiS->VBLCDFlags)) { SiSSetupPseudoPanel(pScrn); pSiS->detectedCRT2Devices |= CRT2_LCD; } } else if(!(pSiS->VBLCDFlags)) { pSiS->ForceCRT1Type = CRT1_VGA; } } } else { pSiS->ForceCRT1Type = CRT1_VGA; } pSiS->VBFlags |= pSiS->ForceCRT1Type; #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "SDFlags %lx\n", pSiS->SiS_SD_Flags); #endif /* Eventually overrule detected CRT2 type * If no type forced, use the detected devices in the order TV->LCD->VGA2 * Since the Chrontel 7005 sometimes delivers wrong detection results, * we use a different order on such machines (LCD->TV) */ if(pSiS->ForceCRT2Type == CRT2_DEFAULT) { if((pSiS->VBFlags & CRT2_TV) && (!((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->VGAEngine == SIS_300_VGA)))) pSiS->ForceCRT2Type = CRT2_TV; else if((pSiS->VBFlags & CRT2_LCD) && (pSiS->ForceCRT1Type == CRT1_VGA)) pSiS->ForceCRT2Type = CRT2_LCD; else if(pSiS->VBFlags & CRT2_TV) pSiS->ForceCRT2Type = CRT2_TV; else if((pSiS->VBFlags & CRT2_VGA) && (pSiS->ForceCRT1Type == CRT1_VGA)) pSiS->ForceCRT2Type = CRT2_VGA; } switch(pSiS->ForceCRT2Type) { case CRT2_TV: pSiS->VBFlags &= ~(CRT2_LCD | CRT2_VGA); if(pSiS->VBFlags2 & (VB2_SISTVBRIDGE | VB2_CHRONTEL)) { pSiS->VBFlags |= CRT2_TV; } else { pSiS->VBFlags &= ~(CRT2_TV); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware does not support TV output\n"); } break; case CRT2_LCD: pSiS->VBFlags &= ~(CRT2_TV | CRT2_VGA); if((pSiS->VBFlags2 & VB2_VIDEOBRIDGE) && (pSiS->VBLCDFlags)) { pSiS->VBFlags |= CRT2_LCD; } else if((pSiS->VBFlags2 & VB2_SISTMDSBRIDGE) && (!(pSiS->VBFlags2 & VB2_30xBDH))) { SiSSetupPseudoPanel(pScrn); pSiS->detectedCRT2Devices |= CRT2_LCD; } else { pSiS->VBFlags &= ~(CRT2_LCD); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Can't force CRT2 to LCD, no LCD detected\n"); } break; case CRT2_VGA: pSiS->VBFlags &= ~(CRT2_TV | CRT2_LCD); if(pSiS->VBFlags2 & VB2_SISVGA2BRIDGE) { pSiS->VBFlags |= CRT2_VGA; } else { pSiS->VBFlags &= ~(CRT2_VGA); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware does not support secondary VGA\n"); } break; default: pSiS->VBFlags &= ~(CRT2_TV | CRT2_LCD | CRT2_VGA); } /* Setup gamma (the cmap layer needs this to be initialised) */ /* (Do this after evaluating options) */ { Gamma zeros = {0.0, 0.0, 0.0}; xf86SetGamma(pScrn, zeros); } #ifdef SISDUALHEAD if((!pSiS->DualHeadMode) || (pSiS->SecondHead)) { #endif xf86DrvMsg(pScrn->scrnIndex, pSiS->CRT1gammaGiven ? X_CONFIG : X_INFO, "%samma correction is %s\n", (pSiS->VBFlags2 & VB2_VIDEOBRIDGE) ? "CRT1 g" : "G", pSiS->CRT1gamma ? "enabled" : "disabled"); if((pSiS->VGAEngine == SIS_315_VGA) && (!(pSiS->NoXvideo)) && (!(pSiS->SiS_SD2_Flags & SiS_SD2_NOOVERLAY))) { xf86DrvMsg(pScrn->scrnIndex, pSiS->XvGammaGiven ? X_CONFIG : X_INFO, "Separate Xv gamma correction %sis %s\n", (pSiS->VBFlags2 & VB2_VIDEOBRIDGE) ? "for CRT1 " : "", pSiS->XvGamma ? "enabled" : "disabled"); if(pSiS->XvGamma) { xf86DrvMsg(pScrn->scrnIndex, pSiS->XvGammaGiven ? X_CONFIG : X_INFO, "Xv gamma correction: %.3f %.3f %.3f\n", (float)((float)pSiS->XvGammaRed / 1000), (float)((float)pSiS->XvGammaGreen / 1000), (float)((float)pSiS->XvGammaBlue / 1000)); if(!pSiS->CRT1gamma) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Xv gamma correction requires %samma correction enabled\n", (pSiS->VBFlags2 & VB2_VIDEOBRIDGE) ? "CRT1 g" : "G"); } } } #ifdef SISDUALHEAD } #endif #ifdef SISDUALHEAD if(pSiS->DualHeadMode) pSiS->CRT2SepGamma = FALSE; #endif #ifdef SISDUALHEAD if((!pSiS->DualHeadMode) || (!pSiS->SecondHead)) #endif { Bool isDH = FALSE; if(pSiS->CRT2gamma) { if( ((pSiS->VGAEngine != SIS_300_VGA) && (pSiS->VGAEngine != SIS_315_VGA)) || (!(pSiS->VBFlags2 & VB2_SISBRIDGE)) ) { if(pSiS->VBFlags2 & VB2_VIDEOBRIDGE) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CRT2 gamma correction not supported by hardware\n"); } pSiS->CRT2gamma = pSiS->CRT2SepGamma = FALSE; } else if((pSiS->VBFlags2 & VB2_30xBDH) && (pSiS->VBFlags & CRT2_LCD)) { isDH = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CRT2 gamma correction not supported for LCD\n"); /* But leave it on, will be caught in LoadPalette */ } } if(pSiS->VBFlags2 & VB2_SISBRIDGE) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CRT2 gamma correction is %s%s%s\n", pSiS->CRT2gamma ? "enabled" : "disabled", isDH ? " (for TV and VGA2) " : "", pSiS->CRT2SepGamma ? " (separate from CRT1)" : ""); } } /* Eventually overrule TV Type (SVIDEO, COMPOSITE, SCART, HIVISION, YPBPR) */ if(pSiS->VBFlags2 & VB2_SISTVBRIDGE) { if(pSiS->ForceTVType != -1) { pSiS->VBFlags &= ~(TV_INTERFACE); if(!(pSiS->VBFlags2 & VB2_CHRONTEL)) { pSiS->VBFlags &= ~(TV_CHSCART | TV_CHYPBPR525I); } pSiS->VBFlags |= pSiS->ForceTVType; if(pSiS->VBFlags & TV_YPBPR) { pSiS->VBFlags &= ~(TV_STANDARD); pSiS->VBFlags &= ~(TV_YPBPRAR); pSiS->VBFlags |= pSiS->ForceYPbPrType; pSiS->VBFlags |= pSiS->ForceYPbPrAR; } } } /* Handle ForceCRT1 option (part 2) */ pSiS->CRT1changed = FALSE; if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { usScratchCR17 = pSiS->oldCR17; usScratchCR63 = pSiS->oldCR63; usScratchSR1F = pSiS->oldSR1F; usScratchCR32 = pSiS->postVBCR32; if(pSiS->VESA != 1) { /* Copy forceCRT1 option to CRT1off if option is given */ #ifdef SISDUALHEAD /* In DHM, handle this option only for master head, not the slave */ if( (pSiS->forceCRT1 != -1) && (!(pSiS->DualHeadMode && pSiS->SecondHead)) ) { #else if(pSiS->forceCRT1 != -1) { #endif xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "CRT1 detection overruled by ForceCRT1 option\n"); if(pSiS->forceCRT1) { pSiS->CRT1off = 0; if(pSiS->VGAEngine == SIS_300_VGA) { if(!(usScratchCR17 & 0x80)) pSiS->CRT1changed = TRUE; } else { if(usScratchCR63 & 0x40) pSiS->CRT1changed = TRUE; } usScratchCR17 |= 0x80; usScratchCR32 |= 0x20; usScratchCR63 &= ~0x40; usScratchSR1F &= ~0xc0; } else { if( ! ( (pScrn->bitsPerPixel == 8) && ( (pSiS->VBFlags2 & (VB2_LVDS | VB2_CHRONTEL)) || ((pSiS->VBFlags2 & VB2_30xBDH) && (pSiS->VBFlags & CRT2_LCD)) ) ) ) { pSiS->CRT1off = 1; if(pSiS->VGAEngine == SIS_300_VGA) { if(usScratchCR17 & 0x80) pSiS->CRT1changed = TRUE; } else { if(!(usScratchCR63 & 0x40)) pSiS->CRT1changed = TRUE; } usScratchCR32 &= ~0x20; /* We must not actually switch off CRT1 before we changed the mode! */ } } /* Here we can write to CR17 even on 315 series as we only ENABLE * the bit here */ outSISIDXREG(SISCR, 0x17, usScratchCR17); if(pSiS->VGAEngine == SIS_315_VGA) { outSISIDXREG(SISCR, pSiS->myCR63, usScratchCR63); } outSISIDXREG(SISCR, 0x32, usScratchCR32); if(pSiS->CRT1changed) { outSISIDXREG(SISSR, 0x00, 0x01); /* Synchronous Reset */ usleep(10000); outSISIDXREG(SISSR, 0x00, 0x03); /* End Reset */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CRT1 status changed by ForceCRT1 option\n"); } outSISIDXREG(SISSR, 0x1f, usScratchSR1F); } } /* Store the new VB connection register contents for later mode changes */ pSiS->newCR32 = usScratchCR32; } /* Check if CRT1 used (or needed; this eg. if no CRT2 detected) */ if(pSiS->VBFlags2 & VB2_VIDEOBRIDGE) { /* No CRT2 output? Then we NEED CRT1! * We also need CRT1 if depth = 8 and bridge=LVDS|301B-DH */ if( (!(pSiS->VBFlags & (CRT2_VGA | CRT2_LCD | CRT2_TV))) || ( (pScrn->bitsPerPixel == 8) && ( (pSiS->VBFlags2 & (VB2_LVDS | VB2_CHRONTEL)) || ((pSiS->VBFlags2 & VB2_30xBDH) && (pSiS->VBFlags & CRT2_LCD)) ) ) ) { pSiS->CRT1off = 0; } /* No CRT2 output? Then we can't use Xv on CRT2 */ if(!(pSiS->VBFlags & (CRT2_VGA | CRT2_LCD | CRT2_TV))) { pSiS->XvOnCRT2 = FALSE; } } else { /* no video bridge? */ /* Then we NEED CRT1... */ pSiS->CRT1off = 0; /* ... and can't use CRT2 for Xv output */ pSiS->XvOnCRT2 = FALSE; } /* LCDA? Then we don't switch off CRT1 */ if(pSiS->VBFlags & CRT1_LCDA) pSiS->CRT1off = 0; /* Handle TVStandard option */ if((pSiS->NonDefaultPAL != -1) || (pSiS->NonDefaultNTSC != -1)) { if( (!(pSiS->VBFlags2 & VB2_SISTVBRIDGE)) && (!((pSiS->VBFlags2 & VB2_CHRONTEL)) && (pSiS->ChrontelType == CHRONTEL_701x)) ) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PALM, PALN and NTSCJ not supported on this hardware\n"); pSiS->NonDefaultPAL = pSiS->NonDefaultNTSC = -1; pSiS->VBFlags &= ~(TV_PALN | TV_PALM | TV_NTSCJ); pSiS->SiS_SD_Flags &= ~(SiS_SD_SUPPORTPALMN | SiS_SD_SUPPORTNTSCJ); } } if(pSiS->OptTVStand != -1) { if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { if( (!((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->VBFlags & (TV_CHSCART | TV_CHYPBPR525I)))) && (!(pSiS->VBFlags & (TV_HIVISION | TV_YPBPR))) ) { pSiS->VBFlags &= ~(TV_PAL | TV_NTSC | TV_PALN | TV_PALM | TV_NTSCJ); if(pSiS->OptTVStand) { pSiS->VBFlags |= TV_PAL; if(pSiS->NonDefaultPAL == 1) pSiS->VBFlags |= TV_PALM; else if(!pSiS->NonDefaultPAL) pSiS->VBFlags |= TV_PALN; } else { pSiS->VBFlags |= TV_NTSC; if(pSiS->NonDefaultNTSC == 1) pSiS->VBFlags |= TV_NTSCJ; } } else { pSiS->OptTVStand = pSiS->NonDefaultPAL = -1; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Option TVStandard ignored for YPbPr, HiVision and Chrontel-SCART\n"); } } else if(pSiS->Chipset == PCI_CHIP_SIS6326) { pSiS->SiS6326Flags &= ~SIS6326_TVPAL; if(pSiS->OptTVStand) pSiS->SiS6326Flags |= SIS6326_TVPAL; } } if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { /* Default to PAL */ if(pSiS->VBFlags & (TV_SVIDEO | TV_AVIDEO)) { if(!(pSiS->VBFlags & (TV_PAL | TV_NTSC))) { pSiS->VBFlags &= ~(TV_PAL | TV_NTSC | TV_PALN | TV_PALM | TV_NTSCJ); pSiS->VBFlags |= TV_PAL; } } /* SCART only supported for PAL */ if((pSiS->VBFlags2 & VB2_SISBRIDGE) && (pSiS->VBFlags & TV_SCART)) { pSiS->VBFlags &= ~(TV_NTSC | TV_PALN | TV_PALM | TV_NTSCJ); pSiS->VBFlags |= TV_PAL; pSiS->OptTVStand = 1; pSiS->NonDefaultPAL = pSiS->NonDefaultNTSC = -1; } } #ifdef SIS_CP SIS_CP_DRIVER_RECONFIGOPT #endif if((pSiS->Chipset == PCI_CHIP_SIS6326) && (pSiS->SiS6326Flags & SIS6326_HASTV)) { if(pSiS->sis6326tvplug != -1) { pSiS->SiS6326Flags &= ~(SIS6326_TVSVIDEO | SIS6326_TVCVBS); pSiS->SiS6326Flags |= SIS6326_TVDETECTED; if(pSiS->sis6326tvplug == 1) pSiS->SiS6326Flags |= SIS6326_TVCVBS; else pSiS->SiS6326Flags |= SIS6326_TVSVIDEO; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "SiS6326 TV plug type detection overruled by %s\n", (pSiS->SiS6326Flags & SIS6326_TVCVBS) ? "COMPOSITE" : "SVIDEO"); } } /* Do some checks */ if(pSiS->OptTVOver != -1) { if(pSiS->VBFlags2 & VB2_CHRONTEL) { pSiS->UseCHOverScan = pSiS->OptTVOver; } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CHTVOverscan only supported on CHRONTEL 70xx\n"); pSiS->UseCHOverScan = -1; } } else pSiS->UseCHOverScan = -1; if(pSiS->sistvedgeenhance != -1) { if(!(pSiS->VBFlags2 & VB2_301)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SISTVEdgeEnhance only supported on SiS301\n"); pSiS->sistvedgeenhance = -1; } } if(pSiS->sistvsaturation != -1) { if(pSiS->VBFlags2 & VB2_301) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SISTVSaturation not supported on SiS301\n"); pSiS->sistvsaturation = -1; } } /* Do some MergedFB mode initialisation */ #ifdef SISMERGED if(pSiS->MergedFB) { pSiS->CRT2pScrn = malloc(sizeof(ScrnInfoRec)); if(!pSiS->CRT2pScrn) { SISErrorLog(pScrn, "Failed to allocate memory for 2nd pScrn, %s\n", mergeddisstr); pSiS->MergedFB = FALSE; } else { memcpy(pSiS->CRT2pScrn, pScrn, sizeof(ScrnInfoRec)); } } #endif /* Determine CRT1<>CRT2 mode * Note: When using VESA or if the bridge is in slavemode, display * is ALWAYS in MIRROR_MODE! * This requires extra checks in functions using this flag! * (see sis_video.c for example) */ if(pSiS->VBFlags & DISPTYPE_DISP2) { if(pSiS->CRT1off) { /* CRT2 only ------------------------------- */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { SISErrorLog(pScrn, "CRT1 not detected or forced off. Dual Head mode can't initialize.\n"); if(pSiSEnt) pSiSEnt->DisableDual = TRUE; goto my_error_1; } #endif #ifdef SISMERGED if(pSiS->MergedFB) { if(pSiS->MergedFBAuto) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, mergednocrt1, mergeddisstr); } else { SISErrorLog(pScrn, mergednocrt1, mergeddisstr); } if(pSiS->CRT2pScrn) free(pSiS->CRT2pScrn); pSiS->CRT2pScrn = NULL; pSiS->MergedFB = FALSE; } #endif pSiS->VBFlags |= VB_DISPMODE_SINGLE; /* No CRT1? Then we use the video overlay on CRT2 */ pSiS->XvOnCRT2 = TRUE; } else /* CRT1 and CRT2 - mirror or dual head ----- */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiS->VBFlags |= (VB_DISPMODE_DUAL | DISPTYPE_CRT1); if(pSiS->VESA != -1) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VESA option not used in Dual Head mode. VESA disabled.\n"); } if(pSiSEnt) pSiSEnt->DisableDual = FALSE; pSiS->VESA = 0; } else #endif #ifdef SISMERGED if(pSiS->MergedFB) { pSiS->VBFlags |= (VB_DISPMODE_MIRROR | DISPTYPE_CRT1); if(pSiS->VESA != -1) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VESA option not used in MergedFB mode. VESA disabled.\n"); } pSiS->VESA = 0; } else #endif pSiS->VBFlags |= (VB_DISPMODE_MIRROR | DISPTYPE_CRT1); } else { /* CRT1 only ------------------------------- */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { SISErrorLog(pScrn, "No CRT2 output selected or no bridge detected. " "Dual Head mode can't initialize.\n"); goto my_error_1; } #endif #ifdef SISMERGED if(pSiS->MergedFB) { if(pSiS->MergedFBAuto) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, mergednocrt2, mergeddisstr); } else { SISErrorLog(pScrn, mergednocrt2, mergeddisstr); } if(pSiS->CRT2pScrn) free(pSiS->CRT2pScrn); pSiS->CRT2pScrn = NULL; pSiS->MergedFB = FALSE; } #endif pSiS->VBFlags |= (VB_DISPMODE_SINGLE | DISPTYPE_CRT1); } if((pSiS->VGAEngine == SIS_315_VGA) || (pSiS->VGAEngine == SIS_300_VGA)) { if((!pSiS->NoXvideo) && (!pSiS->hasTwoOverlays) && (!(pSiS->SiS_SD2_Flags & SiS_SD2_NOOVERLAY))) { xf86DrvMsg(pScrn->scrnIndex, from, "Using Xv overlay by default on CRT%d\n", pSiS->XvOnCRT2 ? 2 : 1); } } /* Init ptrs for Save/Restore functions and calc MaxClock */ SISDACPreInit(pScrn); /* ********** end of VBFlags setup ********** */ /* VBFlags are initialized now. Back them up for SlaveMode modes. */ pSiS->VBFlags_backup = pSiS->VBFlags; /* Backup CR32,36,37 (in order to write them back after a VT switch) */ if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { inSISIDXREG(SISCR,0x32,pSiS->myCR32); inSISIDXREG(SISCR,0x36,pSiS->myCR36); inSISIDXREG(SISCR,0x37,pSiS->myCR37); } /* Find out about paneldelaycompensation and evaluate option */ #ifdef SISDUALHEAD if((!pSiS->DualHeadMode) || (!pSiS->SecondHead)) { #endif if(pSiS->VGAEngine == SIS_300_VGA) { if(pSiS->VBFlags2 & (VB2_LVDS | VB2_30xBDH)) { /* Save the current PDC if the panel is used at the moment. * This seems by far the safest way to find out about it. * If the system is using an old version of sisfb, we can't * trust the pdc register value. If sisfb saved the pdc for * us, use it. */ if(pSiS->sisfbpdc != 0xff) { pSiS->SiS_Pr->PDC = pSiS->sisfbpdc; } else { if(!(pSiS->donttrustpdc)) { UChar tmp; inSISIDXREG(SISCR, 0x30, tmp); if(tmp & 0x20) { inSISIDXREG(SISPART1, 0x13, pSiS->SiS_Pr->PDC); } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unable to detect LCD PanelDelayCompensation, LCD is not active\n"); } } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unable to detect LCD PanelDelayCompensation, please update sisfb\n"); } } if(pSiS->SiS_Pr->PDC != -1) { pSiS->SiS_Pr->PDC &= 0x3c; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected LCD PanelDelayCompensation 0x%02x\n", pSiS->SiS_Pr->PDC); } /* If we haven't been able to find out, use our other methods */ if(pSiS->SiS_Pr->PDC == -1) { int i=0; do { if(mypdctable[i].subsysVendor == PCI_SUB_VENDOR_ID(pSiS->PciInfo) && mypdctable[i].subsysCard == PCI_SUB_DEVICE_ID(pSiS->PciInfo)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PCI card/vendor identified for non-default PanelDelayCompensation\n"); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Vendor: %s, card: %s (ID %04x), PanelDelayCompensation: 0x%02x\n", mypdctable[i].vendorName, mypdctable[i].cardName, PCI_SUB_DEVICE_ID(pSiS->PciInfo), mypdctable[i].pdc); if(pSiS->PDC == -1) { pSiS->PDC = mypdctable[i].pdc; } else { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PanelDelayCompensation overruled by option\n"); } break; } i++; } while(mypdctable[i].subsysVendor != 0); } if(pSiS->PDC != -1) { if(pSiS->BIOS) { if(pSiS->VBFlags2 & VB2_LVDS) { if(pSiS->BIOS[0x220] & 0x80) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "BIOS uses OEM LCD Panel Delay Compensation 0x%02x\n", pSiS->BIOS[0x220] & 0x3c); pSiS->BIOS[0x220] &= 0x7f; } } if(pSiS->VBFlags2 & (VB2_301B | VB2_302B)) { if(pSiS->BIOS[0x220] & 0x80) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "BIOS uses OEM LCD Panel Delay Compensation 0x%02x\n", ( (pSiS->VBLCDFlags & VB_LCD_1280x1024) ? pSiS->BIOS[0x223] : pSiS->BIOS[0x224] ) & 0x3c); pSiS->BIOS[0x220] &= 0x7f; } } } pSiS->SiS_Pr->PDC = (pSiS->PDC & 0x3c); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using LCD Panel Delay Compensation 0x%02x\n", pSiS->SiS_Pr->PDC); } } } /* SIS_300_VGA */ if(pSiS->VGAEngine == SIS_315_VGA) { UChar tmp, tmp2; inSISIDXREG(SISCR, 0x30, tmp); /* Save the current PDC if the panel is used at the moment. */ if(pSiS->VBFlags2 & VB2_SISLVDSBRIDGE) { if(pSiS->sisfbpdc != 0xff) { pSiS->SiS_Pr->PDC = pSiS->sisfbpdc; } if(pSiS->sisfbpdca != 0xff) { pSiS->SiS_Pr->PDCA = pSiS->sisfbpdca; } if(!pSiS->donttrustpdc) { if((pSiS->sisfbpdc == 0xff) && (pSiS->sisfbpdca == 0xff)) { CARD16 tempa, tempb; inSISIDXREG(SISPART1,0x2d,tmp2); tempa = (tmp2 & 0xf0) >> 3; tempb = (tmp2 & 0x0f) << 1; inSISIDXREG(SISPART1,0x20,tmp2); tempa |= ((tmp2 & 0x40) >> 6); inSISIDXREG(SISPART1,0x35,tmp2); tempb |= ((tmp2 & 0x80) >> 7); inSISIDXREG(SISPART1,0x13,tmp2); if(!pSiS->ROM661New) { if((tmp2 & 0x04) || (tmp & 0x20)) { pSiS->SiS_Pr->PDCA = tempa; pSiS->SiS_Pr->PDC = tempb; } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unable to detect PanelDelayCompensation, LCD is not active\n"); } } else { if(tmp2 & 0x04) { pSiS->SiS_Pr->PDCA = tempa; } else if(tmp & 0x20) { pSiS->SiS_Pr->PDC = tempb; } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unable to detect PanelDelayCompensation, LCD is not active\n"); } } } } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unable to detect PanelDelayCompensation, please update sisfb\n"); } if(pSiS->SiS_Pr->PDC != -1) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected LCD PanelDelayCompensation 0x%02x (for LCD=CRT2)\n", pSiS->SiS_Pr->PDC); } if(pSiS->SiS_Pr->PDCA != -1) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected LCD PanelDelayCompensation1 0x%02x (for LCD=CRT1)\n", pSiS->SiS_Pr->PDCA); } } /* Let user override (for all bridges) */ if(pSiS->VBFlags2 & VB2_30xBLV) { if(pSiS->PDC != -1) { pSiS->SiS_Pr->PDC = pSiS->PDC & 0x1f; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using LCD PanelDelayCompensation 0x%02x (for LCD=CRT2)\n", pSiS->SiS_Pr->PDC); } if(pSiS->PDCA != -1) { pSiS->SiS_Pr->PDCA = pSiS->PDCA & 0x1f; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using LCD PanelDelayCompensation1 0x%02x (for LCD=CRT1)\n", pSiS->SiS_Pr->PDCA); } } /* Read the current EMI (if not overruled) */ if(pSiS->VBFlags2 & VB2_SISEMIBRIDGE) { MessageType from = X_PROBED; if(pSiS->EMI != -1) { pSiS->SiS_Pr->EMI_30 = (pSiS->EMI >> 24) & 0x60; pSiS->SiS_Pr->EMI_31 = (pSiS->EMI >> 16) & 0xff; pSiS->SiS_Pr->EMI_32 = (pSiS->EMI >> 8) & 0xff; pSiS->SiS_Pr->EMI_33 = pSiS->EMI & 0xff; pSiS->SiS_Pr->HaveEMI = pSiS->SiS_Pr->HaveEMILCD = TRUE; pSiS->SiS_Pr->OverruleEMI = TRUE; from = X_CONFIG; } else if((pSiS->sisfbfound) && (pSiS->sisfb_haveemi)) { pSiS->SiS_Pr->EMI_30 = pSiS->sisfb_emi30; pSiS->SiS_Pr->EMI_31 = pSiS->sisfb_emi31; pSiS->SiS_Pr->EMI_32 = pSiS->sisfb_emi32; pSiS->SiS_Pr->EMI_33 = pSiS->sisfb_emi33; pSiS->SiS_Pr->HaveEMI = TRUE; if(pSiS->sisfb_haveemilcd) pSiS->SiS_Pr->HaveEMILCD = TRUE; pSiS->SiS_Pr->OverruleEMI = FALSE; } else { inSISIDXREG(SISPART4, 0x30, pSiS->SiS_Pr->EMI_30); inSISIDXREG(SISPART4, 0x31, pSiS->SiS_Pr->EMI_31); inSISIDXREG(SISPART4, 0x32, pSiS->SiS_Pr->EMI_32); inSISIDXREG(SISPART4, 0x33, pSiS->SiS_Pr->EMI_33); pSiS->SiS_Pr->HaveEMI = TRUE; if(tmp & 0x20) pSiS->SiS_Pr->HaveEMILCD = TRUE; pSiS->SiS_Pr->OverruleEMI = FALSE; } xf86DrvMsg(pScrn->scrnIndex, from, "302LV/302ELV: Using EMI 0x%02x%02x%02x%02x%s\n", pSiS->SiS_Pr->EMI_30,pSiS->SiS_Pr->EMI_31, pSiS->SiS_Pr->EMI_32,pSiS->SiS_Pr->EMI_33, pSiS->SiS_Pr->HaveEMILCD ? " (LCD)" : ""); } } /* SIS_315_VGA */ #ifdef SISDUALHEAD } #endif /* In dual head mode, both heads (currently) share the maxxfbmem equally. * If memory sharing is done differently, the following has to be changed; * the other modules (eg. accel and Xv) use dhmOffset for hardware * pointer settings relative to VideoRAM start and won't need to be changed. * * Addendum: dhmoffset is also used for skipping the UMA area on SiS76x. */ pSiS->dhmOffset = pSiS->FbBaseOffset; pSiS->FbAddress += pSiS->dhmOffset; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiS->FbAddress = pSiS->realFbAddress; if(!pSiS->SecondHead) { /* ===== First head (always CRT2) ===== */ /* We use only half of the memory available */ pSiS->maxxfbmem /= 2; /* dhmOffset is 0 (or LFB-base for SiS76x UMA skipping) */ pSiS->FbAddress += pSiS->dhmOffset; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "%dKB video RAM at 0x%lx available for master head (CRT2)\n", pSiS->maxxfbmem/1024, pSiS->FbAddress); } else { /* ===== Second head (always CRT1) ===== */ /* We use only half of the memory available */ pSiS->maxxfbmem /= 2; /* Initialize dhmOffset */ pSiS->dhmOffset += pSiS->maxxfbmem; /* Adapt FBAddress */ pSiS->FbAddress += pSiS->dhmOffset; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "%dKB video RAM at 0x%lx available for slave head (CRT1)\n", pSiS->maxxfbmem/1024, pSiS->FbAddress); } } #endif /* Note: Do not use availMem for anything from now. Use * maxxfbmem instead. (availMem does not take dual head * mode into account.) */ if(pSiS->FbBaseOffset) { /* Doubt that the DRM memory manager can deal * with a heap start of 0... */ pSiS->DRIheapstart = 16; pSiS->DRIheapend = pSiS->FbBaseOffset; } else { pSiS->DRIheapstart = pSiS->maxxfbmem; pSiS->DRIheapend = pSiS->availMem; } #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiS->DRIheapstart = pSiS->DRIheapend = 0; } else #endif if(pSiS->DRIheapstart >= pSiS->DRIheapend) { #if 0 /* For future use */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No memory for DRI heap. Please set the option \"MaxXFBMem\" to\n" "\tlimit the memory X should use and leave the rest to DRI\n"); #endif pSiS->DRIheapstart = pSiS->DRIheapend = 0; } /* Now for something completely different: DDC. * For 300 and 315/330/340 series, we provide our * own functions (in order to probe CRT2 as well) * If these fail, use the VBE. * All other chipsets will use VBE. No need to re-invent * the wheel there. */ pSiS->pVbe = NULL; didddc2 = FALSE; if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { if(xf86LoadSubModule(pScrn, "ddc")) { int crtnum = 0; if((pMonitor = SiSDoPrivateDDC(pScrn, &crtnum))) { didddc2 = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, ddcsstr, crtnum); xf86PrintEDID(pMonitor); xf86SetDDCproperties(pScrn, pMonitor); pScrn->monitor->DDC = pMonitor; /* Now try to find out aspect ratio */ SiSFindAspect(pScrn, pMonitor, crtnum); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, ddcestr, crtnum); } } } #ifdef SISDUALHEAD /* In dual head mode, probe DDC using VBE only for CRT1 (second head) */ if((pSiS->DualHeadMode) && (!didddc2) && (!pSiS->SecondHead)) { didddc2 = TRUE; } #endif if(!didddc2) { /* If CRT1 is off or LCDA, skip DDC via VBE */ if((pSiS->CRT1off) || (pSiS->VBFlags & CRT1_LCDA)) { didddc2 = TRUE; } } /* Now (re-)load and initialize the DDC module */ if(!didddc2) { if(xf86LoadSubModule(pScrn, "ddc")) { /* Now load and initialize VBE module. */ SiS_LoadInitVBE(pScrn); if(pSiS->pVbe) { if((pMonitor = vbeDoEDID(pSiS->pVbe,NULL))) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VBE CRT1 DDC monitor info:\n"); xf86SetDDCproperties(pScrn, xf86PrintEDID(pMonitor)); pScrn->monitor->DDC = pMonitor; /* Now try to find out aspect ratio */ SiSFindAspect(pScrn, pMonitor, 1); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "End of VBE CRT1 DDC monitor info\n"); } } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Failed to read DDC data\n"); } } } #ifdef SISMERGED if(pSiS->MergedFB) { pSiS->CRT2pScrn->monitor = malloc(sizeof(MonRec)); if(pSiS->CRT2pScrn->monitor) { DisplayModePtr tempm = NULL, currentm = NULL, newm = NULL; memcpy(pSiS->CRT2pScrn->monitor, pScrn->monitor, sizeof(MonRec)); pSiS->CRT2pScrn->monitor->DDC = NULL; pSiS->CRT2pScrn->monitor->Modes = NULL; pSiS->CRT2pScrn->monitor->id = (char *)crt2monname; tempm = pScrn->monitor->Modes; while(tempm) { if(!(newm = malloc(sizeof(DisplayModeRec)))) break; memcpy(newm, tempm, sizeof(DisplayModeRec)); if(!(newm->name = malloc(strlen(tempm->name) + 1))) { free(newm); break; } strcpy(newm->name, tempm->name); if(!pSiS->CRT2pScrn->monitor->Modes) pSiS->CRT2pScrn->monitor->Modes = newm; if(currentm) { currentm->next = newm; newm->prev = currentm; } currentm = newm; tempm = tempm->next; } if(pSiS->CRT2HSync) { pSiS->CRT2pScrn->monitor->nHsync = SiSStrToRanges(pSiS->CRT2pScrn->monitor->hsync, pSiS->CRT2HSync, MAX_HSYNC); } if(pSiS->CRT2VRefresh) { pSiS->CRT2pScrn->monitor->nVrefresh = SiSStrToRanges(pSiS->CRT2pScrn->monitor->vrefresh, pSiS->CRT2VRefresh, MAX_VREFRESH); } if((pMonitor = SiSInternalDDC(pSiS->CRT2pScrn, 1))) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, ddcsstr, 2); xf86PrintEDID(pMonitor); xf86SetDDCproperties(pSiS->CRT2pScrn, pMonitor); pSiS->CRT2pScrn->monitor->DDC = pMonitor; /* Now try to find out aspect ratio */ SiSFindAspect(pScrn, pMonitor, 2); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, ddcestr, 2); /* use DDC data if no ranges in config file */ if(!pSiS->CRT2HSync) { pSiS->CRT2pScrn->monitor->nHsync = 0; } if(!pSiS->CRT2VRefresh) { pSiS->CRT2pScrn->monitor->nVrefresh = 0; } } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Failed to read DDC data for CRT2\n"); } } else { SISErrorLog(pScrn, "Failed to allocate memory for CRT2 monitor, %s.\n", mergeddisstr); if(pSiS->CRT2pScrn) free(pSiS->CRT2pScrn); pSiS->CRT2pScrn = NULL; pSiS->MergedFB = FALSE; } } #endif /* Copy our detected monitor gammas, part 1. Note that device redetection * is not supported in DHM, so there is no need to do that anytime later. */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(!pSiS->SecondHead) { /* CRT2: Got gamma for LCD or VGA2 */ pSiSEnt->CRT2VGAMonitorGamma = pSiS->CRT2VGAMonitorGamma; } else { /* CRT1: Got gamma for LCD or VGA */ pSiSEnt->CRT1VGAMonitorGamma = pSiS->CRT1VGAMonitorGamma; } if(pSiS->CRT2LCDMonitorGamma) pSiSEnt->CRT2LCDMonitorGamma = pSiS->CRT2LCDMonitorGamma; } #endif /* end of DDC */ /* From here, we mainly deal with clocks and modes */ #ifdef SISMERGED if(pSiS->MergedFB) xf86DrvMsg(pScrn->scrnIndex, X_INFO, crtsetupstr, 1); #endif /* Set the min pixel clock */ pSiS->MinClock = 5000; if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { pSiS->MinClock = 10000; } xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Min pixel clock is %d MHz\n", pSiS->MinClock / 1000); /* If the user has specified ramdac speed in the config * file, we respect that setting. */ from = X_PROBED; if(pSiS->pEnt->device->dacSpeeds[0]) { int speed = 0; switch(pScrn->bitsPerPixel) { case 8: speed = pSiS->pEnt->device->dacSpeeds[DAC_BPP8]; break; case 16: speed = pSiS->pEnt->device->dacSpeeds[DAC_BPP16]; break; case 24: speed = pSiS->pEnt->device->dacSpeeds[DAC_BPP24]; break; case 32: speed = pSiS->pEnt->device->dacSpeeds[DAC_BPP32]; break; } if(speed == 0) pSiS->MaxClock = pSiS->pEnt->device->dacSpeeds[0]; else pSiS->MaxClock = speed; from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "Max pixel clock is %d MHz\n", pSiS->MaxClock / 1000); /* * 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 = pSiS->MinClock; clockRanges->maxClock = pSiS->MaxClock; clockRanges->clockIndex = -1; /* programmable */ clockRanges->interlaceAllowed = TRUE; clockRanges->doubleScanAllowed = TRUE; /* * Since we have lots of built-in modes for 300/315/330/340 series * with vb support, we replace the given default mode list with our * own. In case the video bridge is to be used, we only allow other * modes if * -) vbtype is 301, 301B, 301C or 302B, and * -) crt2 device is not TV, and * -) crt1 is not LCDA, unless bridge is TMDS/LCDA capable (301C) */ if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { if(!(pSiS->noInternalModes)) { Bool acceptcustommodes = TRUE; /* Accept user modelines */ Bool includelcdmodes = TRUE; /* Include modes reported by DDC */ Bool isfordvi = FALSE; /* Is for digital DVI output */ Bool fakecrt2modes = FALSE; /* Fake some modes for CRT2 */ Bool IsForCRT2 = FALSE; if(pSiS->UseVESA) { acceptcustommodes = FALSE; includelcdmodes = FALSE; } #ifdef SISDUALHEAD /* Dual head is static. Output devices will not change. */ if(pSiS->DualHeadMode) { if(!pSiS->SecondHead) { /* CRT2: */ if(pSiS->VBFlags2 & VB2_SISTMDSBRIDGE) { if(!(pSiS->VBFlags2 & VB2_30xBDH)) { if(!(pSiS->VBFlags & (CRT2_LCD|CRT2_VGA))) includelcdmodes = FALSE; if(pSiS->VBFlags & CRT2_LCD) isfordvi = TRUE; if(pSiS->VBFlags & CRT2_TV) acceptcustommodes = FALSE; } else { if(pSiS->VBFlags & (CRT2_TV|CRT2_LCD)) { acceptcustommodes = FALSE; includelcdmodes = FALSE; fakecrt2modes = TRUE; } } } else { acceptcustommodes = FALSE; includelcdmodes = FALSE; if(pSiS->VBFlags & (CRT2_TV|CRT2_LCD)) { fakecrt2modes = TRUE; } } clockRanges->interlaceAllowed = FALSE; IsForCRT2 = TRUE; } else { /* CRT1: */ if(pSiS->VBFlags & CRT1_LCDA) { if(!(pSiS->VBFlags2 & VB2_SISTMDSLCDABRIDGE)) { acceptcustommodes = FALSE; includelcdmodes = FALSE; fakecrt2modes = TRUE; /* Will handle i-lace in mode-switching code */ } else { isfordvi = TRUE; /* Don't allow i-lace modes */ clockRanges->interlaceAllowed = FALSE; } } else { includelcdmodes = FALSE; } } } else #endif #ifdef SISMERGED /* MergedFB mode is not static. Output devices may change. */ if(pSiS->MergedFB) { if(pSiS->VBFlags & CRT1_LCDA) { if(!(pSiS->VBFlags2 & VB2_SISTMDSLCDABRIDGE)) { acceptcustommodes = FALSE; includelcdmodes = FALSE; fakecrt2modes = TRUE; /* Will handle i-lace in mode-switching code */ } else { isfordvi = TRUE; /* Don't allow i-lace custom modes */ clockRanges->interlaceAllowed = FALSE; } } else { includelcdmodes = FALSE; } } else #endif /* Mirror mode is not static. Output devices may change. */ if(pSiS->VBFlags2 & VB2_SISTMDSBRIDGE) { if(!(pSiS->VBFlags2 & VB2_30xBDH)) { if(!(pSiS->VBFlags2 & VB2_SISTMDSLCDABRIDGE)) { if(!(pSiS->VBFlags & (CRT2_LCD|CRT2_VGA))) includelcdmodes = FALSE; if(pSiS->VBFlags & CRT2_LCD) isfordvi = TRUE; } else { if(!(pSiS->VBFlags & (CRT2_LCD|CRT2_VGA|CRT1_LCDA))) includelcdmodes = FALSE; if(pSiS->VBFlags & (CRT2_LCD|CRT1_LCDA)) isfordvi = TRUE; } if((!(pSiS->VBFlags & DISPTYPE_CRT1)) && (!(pSiS->VBFlags & CRT1_LCDA))) { IsForCRT2 = TRUE; } /* Allow user modes, even if CRT2 is TV. Will be filtered through ValidMode(); * leaving the user modes here might have the advantage that such a mode, if * it matches in resolution with a supported TV mode, allows us to drive eg. * non standard panels, and still permits switching to TV. This mode will be * "mapped" to a supported mode of identical resolution for TV. All this is * taken care of by ValidMode() and ModeInit()/PresetMode(). */ } else { if(pSiS->VBFlags & (CRT2_TV|CRT2_LCD)) { acceptcustommodes = FALSE; includelcdmodes = FALSE; if(!(pSiS->VBFlags & DISPTYPE_CRT1)) { fakecrt2modes = TRUE; IsForCRT2 = TRUE; } } } } else if(pSiS->VBFlags & (CRT2_ENABLE | CRT1_LCDA)) { acceptcustommodes = FALSE; includelcdmodes = FALSE; if((pSiS->VBFlags & CRT1_LCDA) || (!(pSiS->VBFlags & DISPTYPE_CRT1))) { fakecrt2modes = TRUE; IsForCRT2 = TRUE; } } else { includelcdmodes = FALSE; } /* Ignore interlace, mode switching code will handle this */ pSiS->HaveCustomModes = FALSE; if(SiSMakeOwnModeList(pScrn, acceptcustommodes, includelcdmodes, isfordvi, &pSiS->HaveCustomModes, FALSE /*fakecrt2modes*/, IsForCRT2)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Replaced %s mode list with built-in modes\n", pSiS->HaveCustomModes ? "default" : "entire"); if(pSiS->VGAEngine == SIS_315_VGA) { int UseWide = pSiS->SiS_Pr->SiS_UseWide; if(IsForCRT2) UseWide = pSiS->SiS_Pr->SiS_UseWideCRT2; if((!IsForCRT2) || (pSiS->VBFlags2 & VB2_SISVGA2BRIDGE)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using %s widescreen modes for CRT%d VGA devices\n", UseWide ? "real" : "fake", IsForCRT2 ? 2 : 1); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\tUse option \"ForceCRT%dVGAAspect\" to overrule\n", IsForCRT2 ? 2 : 1); } } #ifdef TWDEBUG pScrn->modes = pScrn->monitor->Modes; xf86PrintModes(pScrn); pScrn->modes = NULL; #endif } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Building list of built-in modes failed, using server defaults\n"); } } else { pSiS->HaveCustomModes = TRUE; } } /* Add our built-in hi-res and TV modes on the 6326 */ if(pSiS->Chipset == PCI_CHIP_SIS6326) { if(pScrn->bitsPerPixel == 8) { SiS6326SIS1600x1200_60Mode.next = pScrn->monitor->Modes; pScrn->monitor->Modes = &SiS6326SIS1600x1200_60Mode; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Adding mode \"SIS1600x1200-60\" (depth 8 only)\n"); } if(pScrn->bitsPerPixel <= 16) { SiS6326SIS1280x1024_75Mode.next = pScrn->monitor->Modes; pScrn->monitor->Modes = &SiS6326SIS1280x1024_75Mode; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Adding mode \"SIS1280x1024-75\" (depths 8, 15 and 16 only)\n"); } if((pSiS->SiS6326Flags & SIS6326_HASTV) && (pSiS->SiS6326Flags & SIS6326_TVDETECTED)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Adding %s TV modes to mode list:\n", (pSiS->SiS6326Flags & SIS6326_TVPAL) ? "PAL" : "NTSC"); if(pSiS->SiS6326Flags & SIS6326_TVPAL) { SiS6326PAL800x600Mode.next = pScrn->monitor->Modes; pScrn->monitor->Modes = &SiS6326PAL640x480Mode; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\t\"PAL800x600\" \"PAL800x600U\" \"PAL720x540\" \"PAL640x480\"\n"); } else { SiS6326NTSC640x480Mode.next = pScrn->monitor->Modes; pScrn->monitor->Modes = &SiS6326NTSC640x400Mode; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\t\"NTSC640x480\" \"NTSC640x480U\" \"NTSC640x400\"\n"); } } } /* If there is no HSync or VRefresh data for the monitor, * derive it from DDC data. Essentially done by common layer * since 4.3.99.14, but this is not usable since it is done * too late (in ValidateModes()). * Addendum: I overrule the ranges now in any case unless * it would affect a CRT output device or DDC data is available. * Hence, for LCD(A) and TV, we always get proper ranges. This * is entirely harmless. However, option "NoOverruleRanges" will * disable this behavior. * This should "fix" the - by far - most common configuration * mistakes. */ crt1freqoverruled = FALSE; fromDDC = FALSE; if((pScrn->monitor->nHsync <= 0) || (pSiS->OverruleRanges)) { if((pScrn->monitor->nHsync <= 0) && (pScrn->monitor->DDC)) { SiSSetSyncRangeFromEdid(pScrn, 1); if(pScrn->monitor->nHsync > 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, subshstr, #ifdef SISDUALHEAD pSiS->DualHeadMode ? (pSiS->SecondHead ? 1 : 2) : #endif pSiS->CRT1off ? 2 : 1); fromDDC = TRUE; } } if((pScrn->monitor->nHsync <= 0) || (pSiS->OverruleRanges)) { if(SiSAllowSyncOverride(pSiS, fromDDC)) { Bool HaveNoRanges = (pScrn->monitor->nHsync <= 0); /* Set sane ranges for LCD and TV * (our strict checking will filter out invalid ones anyway) */ if((crt1freqoverruled = CheckAndOverruleH(pScrn, pScrn->monitor))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, saneh, HaveNoRanges ? "missing" : "bogus", #ifdef SISDUALHEAD pSiS->DualHeadMode ? (pSiS->SecondHead ? 1 : 2) : #endif pSiS->CRT1off ? 2 : 1); } } } } fromDDC = FALSE; if((pScrn->monitor->nVrefresh <= 0) || (pSiS->OverruleRanges)) { if((pScrn->monitor->nVrefresh <= 0) && (pScrn->monitor->DDC)) { SiSSetSyncRangeFromEdid(pScrn, 0); if(pScrn->monitor->nVrefresh > 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, subsvstr, #ifdef SISDUALHEAD pSiS->DualHeadMode ? (pSiS->SecondHead ? 1 : 2) : #endif pSiS->CRT1off ? 2 : 1); fromDDC = TRUE; } } if((pScrn->monitor->nVrefresh <= 0) || (pSiS->OverruleRanges)) { if(SiSAllowSyncOverride(pSiS, fromDDC)) { Bool HaveNoRanges = (pScrn->monitor->nVrefresh <= 0); /* Set sane ranges for LCD and TV */ if((crt1freqoverruled = CheckAndOverruleV(pScrn, pScrn->monitor))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, sanev, HaveNoRanges ? "missing" : "bogus", #ifdef SISDUALHEAD pSiS->DualHeadMode ? (pSiS->SecondHead ? 1 : 2) : #endif pSiS->CRT1off ? 2 : 1); } } } } if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\"Unknown reason\" in the following list means that the mode\n"); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "is not supported on the chipset/bridge/current output device.\n"); } /* * xf86ValidateModes will check that the mode HTotal and VTotal values * don't exceed the chipset's limit if pScrn->maxHValue and * pScrn->maxVValue are set. Since our SISValidMode() already takes * care of this, we don't worry about setting them here. */ /* Select valid modes from those available */ /* * Assuming min pitch 256, min height 128 */ { int minpitch, maxpitch, minheight, maxheight; pointer backupddc = pScrn->monitor->DDC; minpitch = 256; minheight = 128; switch(pSiS->VGAEngine) { case SIS_OLD_VGA: case SIS_530_VGA: maxpitch = 2040; maxheight = 2048; break; case SIS_300_VGA: case SIS_315_VGA: maxpitch = 4088; maxheight = 4096; break; default: maxpitch = 2048; maxheight = 2048; break; } #ifdef SISMERGED pSiS->CheckForCRT2 = FALSE; #endif /* Suppress bogus DDC warning */ if(crt1freqoverruled) pScrn->monitor->DDC = NULL; i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, pScrn->display->modes, clockRanges, NULL, minpitch, maxpitch, pScrn->bitsPerPixel * 8, minheight, maxheight, pScrn->display->virtualX, pScrn->display->virtualY, pSiS->maxxfbmem, LOOKUP_BEST_REFRESH); pScrn->monitor->DDC = backupddc; } if(i == -1) { SISErrorLog(pScrn, "xf86ValidateModes() error\n"); goto my_error_1; } /* Check the virtual screen against the available memory */ { ULong memreq = (pScrn->virtualX * ((pScrn->bitsPerPixel + 7) / 8)) * pScrn->virtualY; if(memreq > pSiS->maxxfbmem) { SISErrorLog(pScrn, "Virtual screen too big for memory; %ldK needed, %ldK available\n", memreq/1024, pSiS->maxxfbmem/1024); goto my_error_1; } } /* Dual Head: * -) Go through mode list and mark all those modes as bad, * which are unsuitable for dual head mode. * -) Find the highest used pixelclock on the master head. */ #ifdef SISDUALHEAD if((pSiS->DualHeadMode) && (!pSiS->SecondHead)) { pSiSEnt->maxUsedClock = 0; if((p = first = pScrn->modes)) { do { n = p->next; /* Modes that require the bridge to operate in SlaveMode * are not suitable for Dual Head mode. */ if( (pSiS->VGAEngine == SIS_300_VGA) && ( (strcmp(p->name, "320x200") == 0) || (strcmp(p->name, "320x240") == 0) || (strcmp(p->name, "400x300") == 0) || (strcmp(p->name, "512x384") == 0) || (strcmp(p->name, "640x400") == 0) ) ) { p->status = MODE_BAD; xf86DrvMsg(pScrn->scrnIndex, X_INFO, notsuitablestr, p->name, "dual head"); } /* Search for the highest clock on first head in order to calculate * max clock for second head (CRT1) */ if((p->status == MODE_OK) && (p->Clock > pSiSEnt->maxUsedClock)) { pSiSEnt->maxUsedClock = p->Clock; } p = n; } while (p != NULL && p != first); } } #endif /* Prune the modes marked as invalid */ xf86PruneDriverModes(pScrn); if(i == 0 || pScrn->modes == NULL) { SISErrorLog(pScrn, "No valid modes found - check VertRefresh/HorizSync\n"); goto my_error_1; } xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V); /* Set the current mode to the first in the list */ pScrn->currentMode = pScrn->modes; /* Copy to CurrentLayout */ pSiS->CurrentLayout.mode = pScrn->currentMode; pSiS->CurrentLayout.displayWidth = pScrn->displayWidth; pSiS->CurrentLayout.displayHeight = pScrn->virtualY; #ifdef SISMERGED if(pSiS->MergedFB) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, modesforstr, 1); } #endif /* Print the list of modes being used */ { Bool usemyprint = FALSE; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiS->SecondHead) { if(pSiS->VBFlags & CRT1_LCDA) usemyprint = TRUE; } else { if(pSiS->VBFlags & (CRT2_LCD | CRT2_TV)) usemyprint = TRUE; } } else #endif #ifdef SISMERGED if(pSiS->MergedFB) { if(pSiS->VBFlags & CRT1_LCDA) usemyprint = TRUE; } else #endif { if( (pSiS->VBFlags & (CRT2_LCD | CRT2_TV)) && (!(pSiS->VBFlags & DISPTYPE_DISP1)) ) usemyprint = TRUE; } if(usemyprint) { SiSPrintModes(pScrn); } else { xf86PrintModes(pScrn); } } #ifdef SISMERGED if(pSiS->MergedFB) { Bool acceptcustommodes = TRUE; Bool includelcdmodes = TRUE; Bool isfordvi = FALSE; Bool fakecrt2modes = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, crtsetupstr, 2); clockRanges->next = NULL; clockRanges->minClock = pSiS->MinClock; clockRanges->maxClock = SiSMemBandWidth(pSiS->CRT2pScrn, TRUE); clockRanges->clockIndex = -1; clockRanges->interlaceAllowed = FALSE; clockRanges->doubleScanAllowed = FALSE; if(pSiS->VGAEngine == SIS_315_VGA) { clockRanges->doubleScanAllowed = TRUE; } xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Min pixel clock for CRT2 is %d MHz\n", clockRanges->minClock / 1000); xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Max pixel clock for CRT2 is %d MHz\n", clockRanges->maxClock / 1000); if(pSiS->VBFlags2 & VB2_SISTMDSBRIDGE) { if(!(pSiS->VBFlags2 & VB2_30xBDH)) { if(!(pSiS->VBFlags & (CRT2_LCD|CRT2_VGA))) includelcdmodes = FALSE; if(pSiS->VBFlags & CRT2_LCD) isfordvi = TRUE; /* See above for a remark on handling CRT2 = TV */ } else { if(pSiS->VBFlags & (CRT2_LCD|CRT2_TV)) { includelcdmodes = FALSE; acceptcustommodes = FALSE; fakecrt2modes = TRUE; } } } else { includelcdmodes = FALSE; acceptcustommodes = FALSE; if(pSiS->VBFlags & (CRT2_LCD|CRT2_TV)) { fakecrt2modes = TRUE; } } pSiS->HaveCustomModes2 = FALSE; if(!SiSMakeOwnModeList(pSiS->CRT2pScrn, acceptcustommodes, includelcdmodes, isfordvi, &pSiS->HaveCustomModes2, FALSE /* fakecrt2modes */, TRUE )) { SISErrorLog(pScrn, "Building list of built-in modes for CRT2 failed, %s\n", mergeddisstr); SiSFreeCRT2Structs(pSiS); pSiS->MergedFB = FALSE; } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Replaced %s mode list for CRT2 with built-in modes\n", pSiS->HaveCustomModes2 ? "default" : "entire"); if((pSiS->VGAEngine == SIS_315_VGA) && (pSiS->VBFlags2 & VB2_SISVGA2BRIDGE)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using %s widescreen modes for CRT2 VGA devices\n", pSiS->SiS_Pr->SiS_UseWideCRT2 ? "real" : "fake"); } else pSiS->SiS_Pr->SiS_UseWideCRT2 = 0; } } if(pSiS->MergedFB) { pointer backupddc; crt2freqoverruled = FALSE; fromDDC = FALSE; if((pSiS->CRT2pScrn->monitor->nHsync <= 0) || (pSiS->OverruleRanges)) { if((pSiS->CRT2pScrn->monitor->nHsync <= 0) && (pSiS->CRT2pScrn->monitor->DDC)) { SiSSetSyncRangeFromEdid(pSiS->CRT2pScrn, 1); if(pSiS->CRT2pScrn->monitor->nHsync > 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, subshstr, 2); fromDDC = TRUE; } } if((pSiS->CRT2pScrn->monitor->nHsync <= 0) || (pSiS->OverruleRanges)) { if( (pSiS->VBFlags & CRT2_TV) || ((pSiS->VBFlags & CRT2_LCD) && (!fromDDC)) ) { Bool HaveNoRanges = (pSiS->CRT2pScrn->monitor->nHsync <= 0); /* Set sane ranges for LCD and TV */ if((crt2freqoverruled = CheckAndOverruleH(pScrn, pSiS->CRT2pScrn->monitor))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, saneh, HaveNoRanges ? "missing" : "bogus", 2); } } } } fromDDC = FALSE; if((pSiS->CRT2pScrn->monitor->nVrefresh <= 0) || (pSiS->OverruleRanges)) { if((pSiS->CRT2pScrn->monitor->nVrefresh <= 0) && (pSiS->CRT2pScrn->monitor->DDC)) { SiSSetSyncRangeFromEdid(pSiS->CRT2pScrn, 0); if(pSiS->CRT2pScrn->monitor->nVrefresh > 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, subsvstr, 2); fromDDC = TRUE; } } if((pSiS->CRT2pScrn->monitor->nVrefresh <= 0) || (pSiS->OverruleRanges)) { if( (pSiS->VBFlags & CRT2_TV) || ((pSiS->VBFlags & CRT2_LCD) && (!fromDDC)) ) { Bool HaveNoRanges = (pSiS->CRT2pScrn->monitor->nVrefresh <= 0); /* Set sane ranges for LCD and TV */ if((crt2freqoverruled = CheckAndOverruleV(pScrn, pSiS->CRT2pScrn->monitor))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, sanev, HaveNoRanges ? "missing" : "bogus", 2); } } } } backupddc = pSiS->CRT2pScrn->monitor->DDC; /* Suppress bogus DDC warning */ if(crt2freqoverruled) pSiS->CRT2pScrn->monitor->DDC = NULL; pSiS->CheckForCRT2 = TRUE; i = xf86ValidateModes(pSiS->CRT2pScrn, pSiS->CRT2pScrn->monitor->Modes, pSiS->CRT2pScrn->display->modes, clockRanges, NULL, 256, 4088, pSiS->CRT2pScrn->bitsPerPixel * 8, 128, 4096, pScrn->display->virtualX ? pScrn->virtualX : 0, pScrn->display->virtualY ? pScrn->virtualY : 0, pSiS->maxxfbmem, LOOKUP_BEST_REFRESH); pSiS->CheckForCRT2 = FALSE; pSiS->CRT2pScrn->monitor->DDC = backupddc; if(i == -1) { SISErrorLog(pScrn, "xf86ValidateModes() error, %s.\n", mergeddisstr); SiSFreeCRT2Structs(pSiS); pSiS->MergedFB = FALSE; } } if(pSiS->MergedFB) { if((p = first = pSiS->CRT2pScrn->modes)) { do { n = p->next; if( (pSiS->VGAEngine == SIS_300_VGA) && ( (strcmp(p->name, "320x200") == 0) || (strcmp(p->name, "320x240") == 0) || (strcmp(p->name, "400x300") == 0) || (strcmp(p->name, "512x384") == 0) || (strcmp(p->name, "640x400") == 0) ) ) { p->status = MODE_BAD; xf86DrvMsg(pScrn->scrnIndex, X_INFO, notsuitablestr, p->name, "MergedFB"); } p = n; } while (p != NULL && p != first); } xf86PruneDriverModes(pSiS->CRT2pScrn); if(i == 0 || pSiS->CRT2pScrn->modes == NULL) { SISErrorLog(pScrn, "No valid modes found for CRT2; %s\n", mergeddisstr); SiSFreeCRT2Structs(pSiS); pSiS->MergedFB = FALSE; } } if(pSiS->MergedFB) { xf86SetCrtcForModes(pSiS->CRT2pScrn, INTERLACE_HALVE_V); xf86DrvMsg(pScrn->scrnIndex, X_INFO, modesforstr, 2); if(pSiS->VBFlags & (CRT2_LCD | CRT2_TV)) { SiSPrintModes(pSiS->CRT2pScrn); } else { xf86PrintModes(pSiS->CRT2pScrn); } pSiS->CRT1Modes = pScrn->modes; pSiS->CRT1CurrentMode = pScrn->currentMode; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MergedFB: Generating mode list\n"); pScrn->modes = SiSGenerateModeList(pScrn, pSiS->MetaModes, pSiS->CRT1Modes, pSiS->CRT2pScrn->modes, pSiS->CRT2Position); if(!pScrn->modes) { SISErrorLog(pScrn, "Failed to parse MetaModes or no modes found. %s.\n", mergeddisstr); SiSFreeCRT2Structs(pSiS); pScrn->modes = pSiS->CRT1Modes; pSiS->CRT1Modes = NULL; pSiS->MergedFB = FALSE; } } if(pSiS->MergedFB) { /* If no virtual dimension was given by the user, * calculate a sane one now. Adapts pScrn->virtualX, * pScrn->virtualY and pScrn->displayWidth. */ SiSRecalcDefaultVirtualSize(pScrn); pScrn->modes = pScrn->modes->next; /* We get the last from GenerateModeList(), skip to first */ pScrn->currentMode = pScrn->modes; /* Update CurrentLayout */ pSiS->CurrentLayout.mode = pScrn->currentMode; pSiS->CurrentLayout.displayWidth = pScrn->displayWidth; pSiS->CurrentLayout.displayHeight = pScrn->virtualY; } #endif /* Set display resolution */ #ifdef SISMERGED if(pSiS->MergedFB) { SiSMergedFBSetDpi(pScrn, pSiS->CRT2pScrn, pSiS->CRT2Position); } else #endif xf86SetDpi(pScrn, 0, 0); /* Load fb module */ switch(pScrn->bitsPerPixel) { case 8: case 16: case 24: case 32: if(!xf86LoadSubModule(pScrn, "fb")) { SISErrorLog(pScrn, "Failed to load fb module"); goto my_error_1; } break; default: SISErrorLog(pScrn, "Unsupported framebuffer bpp (%d)\n", pScrn->bitsPerPixel); goto my_error_1; } /* Load XAA/EXA (if needed) */ if(!pSiS->NoAccel) { #ifdef SIS_USE_XAA if(!pSiS->useEXA) { if (!xf86LoadSubModule(pScrn, "xaa")) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Falling back to shadowfb\n"); pSiS->NoAccel = 1; pSiS->ShadowFB = 1; } } #endif #ifdef SIS_USE_EXA if(pSiS->useEXA) { XF86ModReqInfo req; int errmaj, errmin; memset(&req, 0, sizeof(req)); req.majorversion = 2; req.minorversion = 0; if (!LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL, &req, &errmaj, &errmin)) { LoaderErrorMsg(NULL, "exa", errmaj, errmin); goto my_error_1; } } #endif } /* Load shadowfb (if needed) */ if(pSiS->ShadowFB) { if(!xf86LoadSubModule(pScrn, "shadowfb")) { SISErrorLog(pScrn, "Could not load shadowfb module\n"); goto my_error_1; } } /* Load the dri and glx modules if requested. */ #ifdef SISDRI if(pSiS->loadDRI) { if(!xf86LoaderCheckSymbol("DRIScreenInit")) { if(xf86LoadSubModule(pScrn, "dri")) { if(!xf86LoaderCheckSymbol("GlxSetVisualConfigs")) { if(!xf86LoadSubModule(pScrn, "glx")) { SISErrorLog(pScrn, "Failed to load glx module\n"); } } } else { SISErrorLog(pScrn, "Failed to load dri module\n"); } } } #endif /* Now load and initialize VBE module for VESA mode switching */ pSiS->UseVESA = 0; if(pSiS->VESA == 1) { SiS_LoadInitVBE(pScrn); if(pSiS->pVbe) { VbeInfoBlock *vbe; if((vbe = VBEGetVBEInfo(pSiS->pVbe))) { pSiS->vesamajor = (unsigned)(vbe->VESAVersion >> 8); pSiS->vesaminor = vbe->VESAVersion & 0xff; SiSBuildVesaModeList(pScrn, pSiS->pVbe, vbe); VBEFreeVBEInfo(vbe); pSiS->UseVESA = 1; } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to read VBE Info Block\n"); } } if(pSiS->UseVESA == 0) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "VESA mode switching disabled.\n"); } } if(pSiS->pVbe) { vbeFree(pSiS->pVbe); pSiS->pVbe = NULL; } #ifdef SISDUALHEAD xf86SetPrimInitDone(pScrn->entityList[0]); #endif sisRestoreExtRegisterLock(pSiS,srlockReg,crlockReg); if(pSiS->pInt) xf86FreeInt10(pSiS->pInt); pSiS->pInt = NULL; if(pSiS->VGAEngine == SIS_315_VGA) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTXVGAMMA1; } #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiS->SiS_SD_Flags |= SiS_SD_ISDUALHEAD; if(pSiS->SecondHead) pSiS->SiS_SD_Flags |= SiS_SD_ISDHSECONDHEAD; else pSiS->SiS_SD_Flags &= ~(SiS_SD_SUPPORTXVGAMMA1); #ifdef PANORAMIX if(!noPanoramiXExtension) { pSiS->SiS_SD_Flags |= SiS_SD_ISDHXINERAMA; /* pSiS->SiS_SD_Flags &= ~(SiS_SD_SUPPORTXVGAMMA1); */ } #endif } #endif #ifdef SISMERGED if(pSiS->MergedFB) pSiS->SiS_SD_Flags |= SiS_SD_ISMERGEDFB; #endif /* Try to determine if this is a laptop */ /* (only used for SiSCtrl visualisations) */ pSiS->SiS_SD2_Flags |= SiS_SD2_SUPPLTFLAG; pSiS->SiS_SD2_Flags &= ~SiS_SD2_ISLAPTOP; if(pSiS->detectedCRT2Devices & CRT2_LCD) { if(pSiS->VBFlags2 & (VB2_SISLVDSBRIDGE | VB2_LVDS | VB2_30xBDH)) { /* 1. By bridge type: LVDS in 99% of all cases; * exclude unusual setups like Barco projectors * and parallel flat panels. TODO: Exclude * Sony W1, V1. */ if((pSiS->SiS_Pr->SiS_CustomT != CUT_BARCO1366) && (pSiS->SiS_Pr->SiS_CustomT != CUT_BARCO1024) && (pSiS->SiS_Pr->SiS_CustomT != CUT_PANEL848) && (pSiS->SiS_Pr->SiS_CustomT != CUT_PANEL856) && (pSiS->SiS_Pr->SiS_CustomT != CUT_AOP8060) && ( (pSiS->ChipType != SIS_550) || (!pSiS->DSTN && !pSiS->FSTN) ) ) { pSiS->SiS_SD2_Flags |= SiS_SD2_ISLAPTOP; } } else if((pSiS->VBFlags2 & (VB2_301 | VB2_301C)) && (pSiS->VBLCDFlags & (VB_LCD_1280x960 | VB_LCD_1400x1050 | VB_LCD_1024x600 | VB_LCD_1280x800 | VB_LCD_1280x854))) { /* 2. By (odd) LCD resolutions on TMDS bridges * (eg Averatec). TODO: Exclude IBM Netvista. */ pSiS->SiS_SD2_Flags |= SiS_SD2_ISLAPTOP; } } if(pSiS->enablesisctrl) pSiS->SiS_SD_Flags |= SiS_SD_ENABLED; pSiS->currentModeLast = pScrn->currentMode; pSiS->VBFlagsInit = pSiS->VBFlags; return TRUE; /* ---- */ my_error_1: sisRestoreExtRegisterLock(pSiS, srlockReg, crlockReg); my_error_0: #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->ErrorAfterFirst = TRUE; #endif if(pSiS->pInt) xf86FreeInt10(pSiS->pInt); pSiS->pInt = NULL; SISFreeRec(pScrn); return FALSE; } /* * Map I/O port area for non-PC platforms */ #ifdef SIS_NEED_MAP_IOP static Bool SISMapIOPMem(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiS->DualHeadMode) { pSiSEnt->MapCountIOPBase++; if(!(pSiSEnt->IOPBase)) { /* Only map if not mapped previously */ #ifndef XSERVER_LIBPCIACCESS pSiSEnt->IOPBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pSiS->PciTag, pSiS->IOPAddress, 128); #else { void **result = (void **)&pSiSEnt->IOPBase; int err = pci_device_map_range(pSiS->PciInfo, pSiS->IOPAddress, 128, PCI_DEV_MAP_FLAG_WRITABLE, result); if (err) { xf86DrvMsg (pScrn->scrnIndex, X_ERROR, "Unable to map IO aperture. %s (%d)\n", strerror (err), err); } } #endif } pSiS->IOPBase = pSiSEnt->IOPBase; } else #endif #ifndef XSERVER_LIBPCIACCESS pSiS->IOPBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pSiS->PciTag, pSiS->IOPAddress, 128); #else { void **result = (void **)&pSiS->IOPBase; int err = pci_device_map_range(pSiS->PciInfo, pSiS->IOPAddress, 128, PCI_DEV_MAP_FLAG_WRITABLE, result); if (err) { xf86DrvMsg (pScrn->scrnIndex, X_ERROR, "Unable to map IO aperture. %s (%d)\n", strerror (err), err); } } #endif if(pSiS->IOPBase == NULL) { SISErrorLog(pScrn, "Could not map I/O port area\n"); return FALSE; } return TRUE; } static Bool SISUnmapIOPMem(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate;; #endif /* In dual head mode, we must not unmap if the other head still * assumes memory as mapped */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiSEnt->MapCountIOPBase) { pSiSEnt->MapCountIOPBase--; if((pSiSEnt->MapCountIOPBase == 0) || (pSiSEnt->forceUnmapIOPBase)) { xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOPBase, 2048); pSiSEnt->IOPBase = NULL; pSiSEnt->MapCountIOPBase = 0; pSiSEnt->forceUnmapIOPBase = FALSE; } pSiS->IOPBase = NULL; } } else { #endif xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->IOPBase, 2048); pSiS->IOPBase = NULL; #ifdef SISDUALHEAD } #endif return TRUE; } #endif /* * Map the framebuffer and MMIO memory */ static Bool SISMapMem(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int mmioFlags = VIDMEM_MMIO; #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif /* * Map IO registers to virtual address space * (For Alpha, we need to map SPARSE memory, since we need * byte/short access.) */ #if defined(__alpha__) mmioFlags |= VIDMEM_SPARSE; #endif #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiSEnt->MapCountIOBase++; if(!(pSiSEnt->IOBase)) { /* Only map if not mapped previously */ #ifndef XSERVER_LIBPCIACCESS pSiSEnt->IOBase = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pSiS->PciTag, pSiS->IOAddress, (pSiS->mmioSize * 1024)); #else void **result = (void **)&pSiSEnt->IOBase; int err = pci_device_map_range(pSiS->PciInfo, pSiS->IOAddress, (pSiS->mmioSize * 1024), PCI_DEV_MAP_FLAG_WRITABLE, result); if (err) { xf86DrvMsg (pScrn->scrnIndex, X_ERROR, "Unable to map IO aperture. %s (%d)\n", strerror (err), err); } #endif } pSiS->IOBase = pSiSEnt->IOBase; } else #endif #ifndef XSERVER_LIBPCIACCESS pSiS->IOBase = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pSiS->PciTag, pSiS->IOAddress, (pSiS->mmioSize * 1024)); #else { void **result = (void **)&pSiS->IOBase; int err = pci_device_map_range(pSiS->PciInfo, pSiS->IOAddress, (pSiS->mmioSize * 1024), PCI_DEV_MAP_FLAG_WRITABLE, result); if (err) { xf86DrvMsg (pScrn->scrnIndex, X_ERROR, "Unable to map IO aperture. %s (%d)\n", strerror (err), err); } } #endif if(pSiS->IOBase == NULL) { SISErrorLog(pScrn, "Could not map MMIO area\n"); return FALSE; } #ifdef __alpha__ /* * for Alpha, we need to map DENSE memory as well, for * setting CPUToScreenColorExpandBase. */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiSEnt->MapCountIOBaseDense++; if(!(pSiSEnt->IOBaseDense)) { /* Only map if not mapped previously */ #ifndef XSERVER_LIBPCIACCESS pSiSEnt->IOBaseDense = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pSiS->PciTag, pSiS->IOAddress, (pSiS->mmioSize * 1024)); #else void **result = (void **)&pSiSEnt->IOBaseDense; int err = pci_device_map_range(pSiS->PciInfo, pSiS->IOAddress, (pSiS->mmioSize * 1024), PCI_DEV_MAP_FLAG_WRITABLE, result); if (err) { xf86DrvMsg (pScrn->scrnIndex, X_ERROR, "Unable to map IO dense aperture. %s (%d)\n", strerror (err), err); } #endif /* XSERVER_LIBPCIACCESS */ } pSiS->IOBaseDense = pSiSEnt->IOBaseDense; } else { #endif /* SISDUALHEAD */ #ifndef XSERVER_LIBPCIACCESS pSiS->IOBaseDense = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pSiS->PciTag, pSiS->IOAddress, (pSiS->mmioSize * 1024)); #else void **result = (void **)&pSiS->IOBaseDense; int err = pci_device_map_range(pSiS->PciInfo, pSiS->IOAddress, (pSiS->mmioSize * 1024), PCI_DEV_MAP_FLAG_WRITABLE, result); if (err) { xf86DrvMsg (pScrn->scrnIndex, X_ERROR, "Unable to map IO dense aperture. %s (%d)\n", strerror (err), err); } #endif /* XSERVER_LIBPCIACCESS */ #ifdef SISDUALHEAD } #endif if(pSiS->IOBaseDense == NULL) { SISErrorLog(pScrn, "Could not map MMIO dense area\n"); return FALSE; } #endif /* __alpha__ */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiSEnt->MapCountFbBase++; if(!(pSiSEnt->FbBase)) { /* Only map if not mapped previously */ #ifndef XSERVER_LIBPCIACCESS pSiSEnt->FbBase = pSiSEnt->RealFbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, pSiS->PciTag, (ULong)pSiS->realFbAddress, pSiS->FbMapSize); #else int err = pci_device_map_range(pSiS->PciInfo, (ULong)pSiS->realFbAddress, pSiS->FbMapSize, PCI_DEV_MAP_FLAG_WRITABLE | PCI_DEV_MAP_FLAG_WRITE_COMBINE, (void *)&pSiSEnt->FbBase); if (err) { xf86DrvMsg (pScrn->scrnIndex, X_ERROR, "Unable to map FB aperture. %s (%d)\n", strerror (err), err); return FALSE; } pSiSEnt->RealFbBase = pSiSEnt->FbBase; #endif } pSiS->FbBase = pSiS->RealFbBase = pSiSEnt->FbBase; /* Adapt FbBase (for DHM and SiS76x UMA skipping; dhmOffset is 0 otherwise) */ pSiS->FbBase += pSiS->dhmOffset; } else { #endif #ifndef XSERVER_LIBPCIACCESS pSiS->FbBase = pSiS->RealFbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, pSiS->PciTag, (ULong)pSiS->realFbAddress, pSiS->FbMapSize); #else int err = pci_device_map_range(pSiS->PciInfo, (ULong)pSiS->realFbAddress, pSiS->FbMapSize, PCI_DEV_MAP_FLAG_WRITABLE | PCI_DEV_MAP_FLAG_WRITE_COMBINE, (void *)&pSiS->FbBase); if (err) { xf86DrvMsg (pScrn->scrnIndex, X_ERROR, "Unable to map FB aperture. %s (%d)\n", strerror (err), err); return FALSE; } pSiS->RealFbBase = pSiS->FbBase; #endif pSiS->FbBase += pSiS->dhmOffset; #ifdef SISDUALHEAD } #endif if(pSiS->FbBase == NULL) { SISErrorLog(pScrn, "Could not map framebuffer area\n"); return FALSE; } #ifdef TWDEBUG xf86DrvMsg(0, 0, "Framebuffer mapped to %p\n", pSiS->FbBase); #endif return TRUE; } /* * Unmap the framebuffer and MMIO memory. */ static Bool SISUnmapMem(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif /* In dual head mode, we must not unmap if the other head still * assumes memory as mapped */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiSEnt->MapCountIOBase) { pSiSEnt->MapCountIOBase--; if((pSiSEnt->MapCountIOBase == 0) || (pSiSEnt->forceUnmapIOBase)) { xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOBase, (pSiS->mmioSize * 1024)); pSiSEnt->IOBase = NULL; pSiSEnt->MapCountIOBase = 0; pSiSEnt->forceUnmapIOBase = FALSE; } pSiS->IOBase = NULL; } #ifdef __alpha__ if(pSiSEnt->MapCountIOBaseDense) { pSiSEnt->MapCountIOBaseDense--; if((pSiSEnt->MapCountIOBaseDense == 0) || (pSiSEnt->forceUnmapIOBaseDense)) { xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOBaseDense, (pSiS->mmioSize * 1024)); pSiSEnt->IOBaseDense = NULL; pSiSEnt->MapCountIOBaseDense = 0; pSiSEnt->forceUnmapIOBaseDense = FALSE; } pSiS->IOBaseDense = NULL; } #endif /* __alpha__ */ if(pSiSEnt->MapCountFbBase) { pSiSEnt->MapCountFbBase--; if((pSiSEnt->MapCountFbBase == 0) || (pSiSEnt->forceUnmapFbBase)) { xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->RealFbBase, pSiS->FbMapSize); pSiSEnt->FbBase = pSiSEnt->RealFbBase = NULL; pSiSEnt->MapCountFbBase = 0; pSiSEnt->forceUnmapFbBase = FALSE; } pSiS->FbBase = pSiS->RealFbBase = NULL; } } else { #endif xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->IOBase, (pSiS->mmioSize * 1024)); pSiS->IOBase = NULL; #ifdef __alpha__ xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->IOBaseDense, (pSiS->mmioSize * 1024)); pSiS->IOBaseDense = NULL; #endif xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->RealFbBase, pSiS->FbMapSize); pSiS->FbBase = pSiS->RealFbBase = NULL; #ifdef SISDUALHEAD } #endif return TRUE; } /* * This function saves the video state. */ static void SISSave(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); SISRegPtr sisReg; int flags; #ifdef SISDUALHEAD /* We always save master & slave */ if(pSiS->DualHeadMode && pSiS->SecondHead) return; #endif sisReg = &pSiS->SavedReg; if( ((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) && ((pSiS->VBFlags2 & VB2_VIDEOBRIDGE) && (SiSBridgeIsInSlaveMode(pScrn))) ) { SiSVGASave(pScrn, sisReg, SISVGA_SR_CMAP | SISVGA_SR_MODE); #ifdef SIS_PC_PLATFORM if(pSiS->VGAMemBase) { SiSRegInit(pSiS->SiS_Pr, pSiS->RelIO+0x30); SiSSetLVDSetc(pSiS->SiS_Pr); SiS_GetVBType(pSiS->SiS_Pr); SiS_DisableBridge(pSiS->SiS_Pr); SiSVGASave(pScrn, sisReg, SISVGA_SR_FONTS); SiS_EnableBridge(pSiS->SiS_Pr); } #endif } else { flags = SISVGA_SR_CMAP | SISVGA_SR_MODE; #ifdef SIS_PC_PLATFORM if(pSiS->VGAMemBase) flags |= SISVGA_SR_FONTS; #endif SiSVGASave(pScrn, sisReg, flags); } sisSaveUnlockExtRegisterLock(pSiS, &sisReg->sisRegs3C4[0x05], &sisReg->sisRegs3D4[0x80]); (*pSiS->SiSSave)(pScrn, sisReg); if(pSiS->UseVESA) SISVESASaveRestore(pScrn, MODE_SAVE); /* "Save" these again as they may have been changed prior to SISSave() call */ if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { sisReg->sisRegs3C4[0x1f] = pSiS->oldSR1F; sisReg->sisRegs3D4[0x17] = pSiS->oldCR17; sisReg->sisRegs3D4[0x32] = pSiS->oldCR32; sisReg->sisRegs3D4[0x36] = pSiS->oldCR36; sisReg->sisRegs3D4[0x37] = pSiS->oldCR37; if(pSiS->VGAEngine == SIS_315_VGA) { sisReg->sisRegs3D4[pSiS->myCR63] = pSiS->oldCR63; } } } /* VESASaveRestore taken from vesa driver */ static void SISVESASaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function) { SISPtr pSiS = SISPTR(pScrn); /* Query amount of memory to save state */ if((function == MODE_QUERY) || (function == MODE_SAVE && pSiS->state == NULL)) { /* Make sure we save at least this information in case of failure */ (void)VBEGetVBEMode(pSiS->pVbe, &pSiS->stateMode); SiSVGASaveFonts(pScrn); if(pSiS->vesamajor > 1) { if(!VBESaveRestore(pSiS->pVbe, function, (pointer)&pSiS->state, &pSiS->stateSize, &pSiS->statePage)) { return; } } } /* Save/Restore Super VGA state */ if(function != MODE_QUERY) { if(pSiS->vesamajor > 1) { if(function == MODE_RESTORE) { memcpy(pSiS->state, pSiS->pstate, pSiS->stateSize); } if(VBESaveRestore(pSiS->pVbe,function,(pointer)&pSiS->state, &pSiS->stateSize,&pSiS->statePage) && (function == MODE_SAVE)) { /* don't rely on the memory not being touched */ if(!pSiS->pstate) { pSiS->pstate = malloc(pSiS->stateSize); } memcpy(pSiS->pstate, pSiS->state, pSiS->stateSize); } } if(function == MODE_RESTORE) { VBESetVBEMode(pSiS->pVbe, pSiS->stateMode, NULL); SiSVGARestoreFonts(pScrn); } } } /* * Initialise a new mode. This is currently done using the * "initialise struct, restore/write struct to HW" model for * the old chipsets (5597/530/6326). For newer chipsets, * we use our own mode switching code. */ static Bool SISModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) { SISPtr pSiS = SISPTR(pScrn); SISRegPtr sisReg; #ifdef SISDUALHEAD SISEntPtr pSiSEnt = NULL; #endif andSISIDXREG(SISCR,0x11,0x7f); /* Unlock CRTC registers */ SISModifyModeInfo(mode); /* Quick check of the mode parameters */ if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { SiSRegInit(pSiS->SiS_Pr, pSiS->RelIO+0x30); } if(pSiS->UseVESA) { /* With VESA: */ #ifdef SISDUALHEAD /* No dual head mode when using VESA */ if(pSiS->SecondHead) return TRUE; #endif pScrn->vtSema = TRUE; /* * This order is required: * The video bridge needs to be adjusted before the * BIOS is run as the BIOS sets up CRT2 according to * these register settings. * After the BIOS is run, the bridges and turboqueue * registers need to be readjusted as the BIOS may * very probably have messed them up. */ if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { SiSPreSetMode(pScrn, mode, SIS_MODE_SIMU); } if(!SiSSetVESAMode(pScrn, mode)) { SISErrorLog(pScrn, "SiSSetVESAMode() failed\n"); return FALSE; } sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { SiSPreSetMode(pScrn, mode, SIS_MODE_SIMU); SiSPostSetMode(pScrn, &pSiS->ModeReg); } #ifdef TWDEBUG xf86DrvMsg(pScrn->scrnIndex, X_INFO, "REAL REGISTER CONTENTS AFTER SETMODE:\n"); #endif if(!(*pSiS->ModeInit)(pScrn, mode)) { SISErrorLog(pScrn, "ModeInit() failed\n"); return FALSE; } SiSVGAProtect(pScrn, TRUE); (*pSiS->SiSRestore)(pScrn, &pSiS->ModeReg); SiSVGAProtect(pScrn, FALSE); } else { /* Without VESA: */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(!(*pSiS->ModeInit)(pScrn, mode)) { SISErrorLog(pScrn, "ModeInit() failed\n"); return FALSE; } pScrn->vtSema = TRUE; pSiSEnt = pSiS->entityPrivate; if(!(pSiS->SecondHead)) { /* Head 1 (master) is always CRT2 */ SiSPreSetMode(pScrn, mode, SIS_MODE_CRT2); if(!SiSBIOSSetModeCRT2(pSiS->SiS_Pr, pScrn, mode, pSiS->IsCustom)) { SISErrorLog(pScrn, "SiSBIOSSetModeCRT2() failed\n"); return FALSE; } SiSPostSetMode(pScrn, &pSiS->ModeReg); if(pSiSEnt->pScrn_2) { SISAdjustFrame(ADJUST_FRAME_ARGS(pSiSEnt->pScrn_2, pSiSEnt->pScrn_2->frameX0, pSiSEnt->pScrn_2->frameY0)); } } else { /* Head 2 (slave) is always CRT1 */ SiSPreSetMode(pScrn, mode, SIS_MODE_CRT1); if(!SiSBIOSSetModeCRT1(pSiS->SiS_Pr, pScrn, mode, pSiS->IsCustom)) { SISErrorLog(pScrn, "SiSBIOSSetModeCRT1() failed\n"); return FALSE; } SiSPostSetMode(pScrn, &pSiS->ModeReg); if(pSiSEnt->pScrn_1) { SISAdjustFrame(ADJUST_FRAME_ARGS(pSiSEnt->pScrn_1, pSiSEnt->pScrn_1->frameX0, pSiSEnt->pScrn_1->frameY0)); } } } else { #endif if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { if(!(*pSiS->ModeInit)(pScrn, mode)) { SISErrorLog(pScrn, "ModeInit() failed\n"); return FALSE; } pScrn->vtSema = TRUE; #ifdef SISMERGED if(pSiS->MergedFB) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting MergedFB mode %dx%d\n", mode->HDisplay, mode->VDisplay); SiSPreSetMode(pScrn, mode, SIS_MODE_CRT1); if(!SiSBIOSSetModeCRT1(pSiS->SiS_Pr, pScrn, ((SiSMergedDisplayModePtr)mode->Private)->CRT1, pSiS->IsCustom)) { SISErrorLog(pScrn, "SiSBIOSSetModeCRT1() failed\n"); return FALSE; } SiSPreSetMode(pScrn, mode, SIS_MODE_CRT2); if(!SiSBIOSSetModeCRT2(pSiS->SiS_Pr, pScrn, ((SiSMergedDisplayModePtr)mode->Private)->CRT2, pSiS->IsCustom)) { SISErrorLog(pScrn, "SiSBIOSSetModeCRT2() failed\n"); return FALSE; } } else { #endif if((pSiS->VBFlags & CRT1_LCDA) || (!(mode->type & M_T_DEFAULT))) { SiSPreSetMode(pScrn, mode, SIS_MODE_CRT1); if(!SiSBIOSSetModeCRT1(pSiS->SiS_Pr, pScrn, mode, pSiS->IsCustom)) { SISErrorLog(pScrn, "SiSBIOSSetModeCRT1() failed\n"); return FALSE; } SiSPreSetMode(pScrn, mode, SIS_MODE_CRT2); if(!SiSBIOSSetModeCRT2(pSiS->SiS_Pr, pScrn, mode, pSiS->IsCustom)) { SISErrorLog(pScrn, "SiSBIOSSetModeCRT2() failed\n"); return FALSE; } } else { SiSPreSetMode(pScrn, mode, SIS_MODE_SIMU); if(!SiSBIOSSetMode(pSiS->SiS_Pr, pScrn, mode, pSiS->IsCustom)) { SISErrorLog(pScrn, "SiSBIOSSetMode() failed\n"); return FALSE; } } #ifdef SISMERGED } #endif SiSPostSetMode(pScrn, &pSiS->ModeReg); #ifdef TWDEBUG xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VBFlags %lx\n", pSiS->VBFlags); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "REAL REGISTER CONTENTS AFTER SETMODE:\n"); (*pSiS->ModeInit)(pScrn, mode); #endif } else { /* For other chipsets, use the old method */ /* Prepare the register contents */ if(!(*pSiS->ModeInit)(pScrn, mode)) { SISErrorLog(pScrn, "ModeInit() failed\n"); return FALSE; } pScrn->vtSema = TRUE; /* Program the registers */ SiSVGAProtect(pScrn, TRUE); sisReg = &pSiS->ModeReg; sisReg->sisRegsATTR[0x10] = 0x01; if(pScrn->bitsPerPixel > 8) { sisReg->sisRegsGR[0x05] = 0x00; } SiSVGARestore(pScrn, sisReg, SISVGA_SR_MODE); (*pSiS->SiSRestore)(pScrn, sisReg); if((pSiS->Chipset == PCI_CHIP_SIS6326) && (pSiS->SiS6326Flags & SIS6326_HASTV)) { SiS6326PostSetMode(pScrn, &pSiS->ModeReg); } #ifdef TWDEBUG xf86DrvMsg(pScrn->scrnIndex, X_INFO, "REAL REGISTER CONTENTS AFTER SETMODE:\n"); (*pSiS->ModeInit)(pScrn, mode); #endif SiSVGAProtect(pScrn, FALSE); } #ifdef SISDUALHEAD } #endif } /* Update Currentlayout */ pSiS->CurrentLayout.mode = pSiS->currentModeLast = mode; return TRUE; } static Bool SiSSetVESAMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) { SISPtr pSiS; int mode; pSiS = SISPTR(pScrn); if(!(mode = SiSCalcVESAModeIndex(pScrn, pMode))) return FALSE; mode |= (1 << 15); /* Don't clear framebuffer */ mode |= (1 << 14); /* Use linear adressing */ if(VBESetVBEMode(pSiS->pVbe, mode, NULL) == FALSE) { SISErrorLog(pScrn, "Setting VESA mode 0x%x failed\n", mode & 0x0fff); return (FALSE); } if(pMode->HDisplay != pScrn->virtualX) { VBESetLogicalScanline(pSiS->pVbe, pScrn->virtualX); } xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Setting VESA mode 0x%x succeeded\n", mode & 0x0fff); return (TRUE); } static void SISSpecialRestore(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); SISRegPtr sisReg = &pSiS->SavedReg; UChar temp; int i; /* 1.11.04 and later for 651 and 301B(DH) do strange register * fiddling after the usual mode change. This happens * depending on the result of a call of int 2f (with * ax=0x1680) and if modeno <= 0x13. I have no idea if * that is specific for the 651 or that very machine. * So this perhaps requires some more checks in the beginning * (although it should not do any harm on other chipsets/bridges * etc.) However, even if I call the VBE to restore mode 0x03, * these registers don't get restored correctly, possibly * because that int-2f-call for some reason results non-zero. So * what I do here is to restore these few registers * manually. */ if(!(pSiS->ChipFlags & SiSCF_Is65x)) return; inSISIDXREG(SISCR, 0x34, temp); temp &= 0x7f; if(temp > 0x13) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif SiS_UnLockCRT2(pSiS->SiS_Pr); outSISIDXREG(SISCAP, 0x3f, sisReg->sisCapt[0x3f]); outSISIDXREG(SISCAP, 0x00, sisReg->sisCapt[0x00]); for(i = 0; i < 0x4f; i++) { outSISIDXREG(SISCAP, i, sisReg->sisCapt[i]); } outSISIDXREG(SISVID, 0x32, (sisReg->sisVid[0x32] & ~0x05)); outSISIDXREG(SISVID, 0x30, sisReg->sisVid[0x30]); outSISIDXREG(SISVID, 0x32, ((sisReg->sisVid[0x32] & ~0x04) | 0x01)); outSISIDXREG(SISVID, 0x30, sisReg->sisVid[0x30]); if(!(pSiS->ChipFlags & SiSCF_Is651)) return; if(!(pSiS->VBFlags2 & VB2_SISBRIDGE)) return; inSISIDXREG(SISCR, 0x30, temp); if(temp & 0x40) { UChar myregs[] = { 0x2f, 0x08, 0x09, 0x03, 0x0a, 0x0c, 0x0b, 0x0d, 0x0e, 0x12, 0x0f, 0x10, 0x11, 0x04, 0x05, 0x06, 0x07, 0x00, 0x2e }; for(i = 0; i <= 18; i++) { outSISIDXREG(SISPART1, myregs[i], sisReg->VBPart1[myregs[i]]); } } else if((temp & 0x20) || (temp & 0x9c)) { UChar myregs[] = { 0x04, 0x05, 0x06, 0x07, 0x00, 0x2e }; for(i = 0; i <= 5; i++) { outSISIDXREG(SISPART1, myregs[i], sisReg->VBPart1[myregs[i]]); } } } /* Fix SR11 for 661 and later */ static void SiSFixupSR11(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); CARD8 tmpreg; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif if(pSiS->ChipType >= SIS_661) { inSISIDXREG(SISSR,0x11,tmpreg); if(tmpreg & 0x20) { inSISIDXREG(SISSR,0x3e,tmpreg); tmpreg = (tmpreg + 1) & 0xff; outSISIDXREG(SISSR,0x3e,tmpreg); } inSISIDXREG(SISSR,0x11,tmpreg); if(tmpreg & 0xf0) { andSISIDXREG(SISSR,0x11,0x0f); } } } /* Subroutine for restoring sisfb's TV parameters (used by SiSRestore()) */ static void SiSRestore_SiSFB_TVParms(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int fd; CARD32 parm; if(!pSiS->sisfbfound) return; if(!pSiS->sisfb_tvposvalid) return; if(!(pSiS->sisfbdevname[0])) return; if((fd = open(pSiS->sisfbdevname, O_RDONLY)) != -1) { parm = (CARD32)((pSiS->sisfb_tvxpos << 16) | (pSiS->sisfb_tvypos & 0xffff)); ioctl(fd, SISFB_SET_TVPOSOFFSET, &parm); close(fd); } } /* * Restore the initial mode. To be used internally only! */ static void SISRestore(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); SISRegPtr sisReg = &pSiS->SavedReg; Bool doit = FALSE, doitlater = FALSE; Bool vesasuccess = FALSE; int flags; /* WARNING: Don't ever touch this. It now seems to work on * all chipset/bridge combinations - but finding out the * correct combination was pure hell. */ /* Wait for the accelerators */ (*pSiS->SyncAccel)(pScrn); /* Set up restore flags */ flags = SISVGA_SR_MODE | SISVGA_SR_CMAP; #ifdef SIS_PC_PLATFORM /* We now restore ALL to overcome the vga=extended problem */ if(pSiS->VGAMemBase) flags |= SISVGA_SR_FONTS; #endif if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { #ifdef SISDUALHEAD /* We always restore master AND slave */ if(pSiS->DualHeadMode && pSiS->SecondHead) return; #endif #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif /* We must not disable the sequencer if the bridge is in SlaveMode! */ if(!(SiSBridgeIsInSlaveMode(pScrn))) { SiSVGAProtect(pScrn, TRUE); } /* First, restore CRT1 on/off and VB connection registers */ outSISIDXREG(SISCR, 0x32, pSiS->oldCR32); if(!(pSiS->oldCR17 & 0x80)) { /* CRT1 was off */ if(!(SiSBridgeIsInSlaveMode(pScrn))) { /* Bridge is NOT in SlaveMode now -> do it */ doit = TRUE; } else { doitlater = TRUE; } } else { /* CRT1 was on -> do it now */ doit = TRUE; } if(doit) { outSISIDXREG(SISCR, 0x17, pSiS->oldCR17); } if(pSiS->VGAEngine == SIS_315_VGA) { outSISIDXREG(SISCR, pSiS->myCR63, pSiS->oldCR63); } outSISIDXREG(SISSR, 0x1f, pSiS->oldSR1F); /* For 30xB/LV, restoring the registers does not * work. We "manually" set the old mode, instead. * The same applies for SiS730 machines with LVDS. * Finally, this behavior can be forced by setting * the option RestoreBySetMode. */ if( ( (pSiS->restorebyset) || (pSiS->VBFlags2 & VB2_30xBLV) || ((pSiS->ChipType == SIS_730) && (pSiS->VBFlags2 & VB2_LVDS)) ) && (pSiS->OldMode) ) { Bool changedmode = FALSE; xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Restoring by setting old mode 0x%02x\n", pSiS->OldMode); if(((pSiS->OldMode <= 0x13) || (!pSiS->sisfbfound)) && (pSiS->pVbe)) { int vmode = SiSTranslateToVESA(pScrn, pSiS->OldMode); if(vmode > 0) { if(vmode > 0x13) vmode |= ((1 << 15) | (1 << 14)); if(VBESetVBEMode(pSiS->pVbe, vmode, NULL) == TRUE) { SISSpecialRestore(pScrn); SiS_GetSetModeID(pScrn,pSiS->OldMode); vesasuccess = TRUE; } else { xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "VBE failed to restore mode 0x%x\n", pSiS->OldMode); } } else { xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Can't identify VESA mode number for mode 0x%x\n", pSiS->OldMode); } } if(vesasuccess == FALSE) { int backupscaler = pSiS->SiS_Pr->UsePanelScaler; int backupcenter = pSiS->SiS_Pr->CenterScreen; ULong backupspecialtiming = pSiS->SiS_Pr->SiS_CustomT; int mymode = pSiS->OldMode; if((pSiS->VGAEngine == SIS_315_VGA) && ((pSiS->ROM661New) || (pSiS->ChipFlags & SiSCF_IsXGI)) && (!pSiS->sisfbfound)) { /* New SiS BIOS or XGI BIOS has set mode, therefore eventually translate number */ mymode = SiSTranslateToOldMode(mymode); } if((pSiS->VBFlags2 & VB2_30xBLV)) { /* !!! REQUIRED for 630+301B-DH, otherwise the text modes * will not be restored correctly !!! * !!! Do this ONLY for LCD; VGA2 will not be restored * correctly otherwise. */ UChar temp; inSISIDXREG(SISCR, 0x30, temp); if(temp & 0x20) { if(mymode == 0x03) { mymode = 0x13; changedmode = TRUE; } } } pSiS->SiS_Pr->UseCustomMode = FALSE; pSiS->SiS_Pr->CRT1UsesCustomMode = FALSE; pSiS->SiS_Pr->CenterScreen = 0; if(pSiS->sisfbfound) { pSiS->SiS_Pr->UsePanelScaler = pSiS->sisfbscalelcd; pSiS->SiS_Pr->SiS_CustomT = pSiS->sisfbspecialtiming; } else { pSiS->SiS_Pr->UsePanelScaler = -1; /* Leave CustomT as it is */ } SiS_SetEnableDstn(pSiS->SiS_Pr, FALSE); SiS_SetEnableFstn(pSiS->SiS_Pr, FALSE); if((pSiS->ChipType == SIS_550) && (pSiS->sisfbfound)) { if(pSiS->sisfbxSTN) { SiS_SetEnableDstn(pSiS->SiS_Pr, pSiS->sisfbDSTN); SiS_SetEnableFstn(pSiS->SiS_Pr, pSiS->sisfbFSTN); } else if(mymode == 0x5a || mymode == 0x5b) { SiS_SetEnableFstn(pSiS->SiS_Pr, TRUE); } } SiSSetMode(pSiS->SiS_Pr, pScrn, mymode, FALSE); if(changedmode) { outSISIDXREG(SISCR,0x34,0x03); } SISSpecialRestore(pScrn); SiS_GetSetModeID(pScrn, pSiS->OldMode); /* NOT mymode! */ pSiS->SiS_Pr->UsePanelScaler = backupscaler; pSiS->SiS_Pr->CenterScreen = backupcenter; pSiS->SiS_Pr->SiS_CustomT = backupspecialtiming; SiS_SiSFB_Lock(pScrn, FALSE); SiSRestore_SiSFB_TVParms(pScrn); SiS_SiSFB_Lock(pScrn, TRUE); } /* Restore CRT1 status */ if(pSiS->VGAEngine == SIS_315_VGA) { outSISIDXREG(SISCR, pSiS->myCR63, pSiS->oldCR63); } outSISIDXREG(SISSR, 0x1f, pSiS->oldSR1F); #ifdef SISVRAMQ /* Restore queue mode registers on 315/330/340 series */ /* (This became necessary due to the switch to VRAM queue) */ SiSRestoreQueueMode(pSiS, sisReg); #endif } else { if(pSiS->VBFlags2 & VB2_VIDEOBRIDGE) { /* If a video bridge is present, we need to restore * non-extended (=standard VGA) SR and CR registers * before restoring the extended ones and the bridge * registers. */ if(!(SiSBridgeIsInSlaveMode(pScrn))) { SiSVGAProtect(pScrn, TRUE); SiSVGARestore(pScrn, sisReg, SISVGA_SR_MODE); } } (*pSiS->SiSRestore)(pScrn, sisReg); } if(doitlater) { outSISIDXREG(SISCR, 0x17, pSiS->oldCR17); } if((pSiS->VBFlags2 & VB2_VIDEOBRIDGE) && (SiSBridgeIsInSlaveMode(pScrn))) { /* IMPORTANT: The 30xLV does not handle well being disabled if in * LCDA mode! In LCDA mode, the bridge is NOT in slave mode, * so this is the only safe way: Disable the bridge ONLY if * in Slave Mode, and don't bother if not. */ if(flags & SISVGA_SR_FONTS) { SiSRegInit(pSiS->SiS_Pr, pSiS->RelIO+0x30); SiSSetLVDSetc(pSiS->SiS_Pr); SiS_GetVBType(pSiS->SiS_Pr); SiS_DisableBridge(pSiS->SiS_Pr); SiSVGAProtect(pScrn, TRUE); } SiSVGARestore(pScrn, sisReg, flags); if(flags & SISVGA_SR_FONTS) { SiSVGAProtect(pScrn, FALSE); SiS_EnableBridge(pSiS->SiS_Pr); andSISIDXREG(SISSR, 0x01, ~0x20); /* Display on */ } } else { SiSVGAProtect(pScrn, TRUE); SiSVGARestore(pScrn, sisReg, flags); SiSVGAProtect(pScrn, FALSE); } SiSFixupSR11(pScrn); #ifdef TWDEBUG { SISRegPtr pReg = &pSiS->ModeReg; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "REAL REGISTER CONTENTS AFTER RESTORE BY SETMODE:\n"); (*pSiS->SiSSave)(pScrn, pReg); } #endif sisRestoreExtRegisterLock(pSiS,sisReg->sisRegs3C4[0x05],sisReg->sisRegs3D4[0x80]); } else { /* All other chipsets */ SiSVGAProtect(pScrn, TRUE); #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif (*pSiS->SiSRestore)(pScrn, sisReg); SiSVGAProtect(pScrn, TRUE); SiSVGARestore(pScrn, sisReg, flags); /* Restore TV. This is rather complicated, but if we don't do it, * TV output will flicker terribly */ if((pSiS->Chipset == PCI_CHIP_SIS6326) && (pSiS->SiS6326Flags & SIS6326_HASTV)) { if(sisReg->sis6326tv[0] & 0x04) { UChar tmp; int val; orSISIDXREG(SISSR, 0x01, 0x20); tmp = SiS6326GetTVReg(pScrn,0x00); tmp &= ~0x04; while(!(inSISREG(SISINPSTAT) & 0x08)); /* Wait while NOT vb */ SiS6326SetTVReg(pScrn,0x00,tmp); for(val=0; val < 2; val++) { while(!(inSISREG(SISINPSTAT) & 0x08)); /* Wait while NOT vb */ while(inSISREG(SISINPSTAT) & 0x08); /* wait while vb */ } SiS6326SetTVReg(pScrn, 0x00, sisReg->sis6326tv[0]); tmp = inSISREG(SISINPSTAT); outSISREG(SISAR, 0x20); tmp = inSISREG(SISINPSTAT); while(inSISREG(SISINPSTAT) & 0x01); while(!(inSISREG(SISINPSTAT) & 0x01)); andSISIDXREG(SISSR, 0x01, ~0x20); for(val=0; val < 10; val++) { while(!(inSISREG(SISINPSTAT) & 0x08)); /* Wait while NOT vb */ while(inSISREG(SISINPSTAT) & 0x08); /* wait while vb */ } andSISIDXREG(SISSR, 0x01, ~0x20); } } sisRestoreExtRegisterLock(pSiS,sisReg->sisRegs3C4[5],sisReg->sisRegs3D4[0x80]); SiSVGAProtect(pScrn, FALSE); } } static void SISVESARestore(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISVRAMQ SISRegPtr sisReg = &pSiS->SavedReg; #endif if(pSiS->UseVESA) { SISVESASaveRestore(pScrn, MODE_RESTORE); #ifdef SISVRAMQ /* Restore queue mode registers on 315/330/340 series */ /* (This became necessary due to the switch to VRAM queue) */ SiSRestoreQueueMode(pSiS, sisReg); #endif } } /* Restore bridge config registers - to be called BEFORE VESARestore */ static void SISBridgeRestore(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD /* We only restore for master head */ if(pSiS->DualHeadMode && pSiS->SecondHead) return; #endif if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { SiSRestoreBridge(pScrn, &pSiS->SavedReg); } } /* Our BlockHandler */ static void SISBlockHandler(BLOCKHANDLER_ARGS_DECL) { SCREEN_PTR(arg); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); pScreen->BlockHandler = pSiS->BlockHandler; (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS); pScreen->BlockHandler = SISBlockHandler; #ifdef SISDUALHEAD if(pSiS->NeedCopyFastVidCpy) { SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt->HaveFastVidCpy) { pSiS->NeedCopyFastVidCpy = FALSE; pSiS->SiSFastVidCopy = pSiSEnt->SiSFastVidCopy; pSiS->SiSFastMemCopy = pSiSEnt->SiSFastMemCopy; pSiS->SiSFastVidCopyFrom = pSiSEnt->SiSFastVidCopyFrom; pSiS->SiSFastMemCopyFrom = pSiSEnt->SiSFastMemCopyFrom; } } #endif if(pSiS->VideoTimerCallback) { (*pSiS->VideoTimerCallback)(pScrn, currentTime.milliseconds); } #ifdef SIS_USE_XAA if(pSiS->RenderCallback) { (*pSiS->RenderCallback)(pScrn); } #endif #ifdef SIS_USE_EXA if(pSiS->ExaRenderCallback) { (*pSiS->ExaRenderCallback)(pScrn); } #endif } /* Do screen blanking; DPMS handling * * Mandatory; latter optional */ static void SiSHandleBackLight(SISPtr pSiS, Bool blon) { UChar sr11mask = (pSiS->SiS_Pr->SiS_SensibleSR11) ? 0x03 : 0xf3; if(pSiS->VBFlags2 & VB2_SISLVDSBRIDGE) { if(!blon) { SiS_SiS30xBLOff(pSiS->SiS_Pr); } else { SiS_SiS30xBLOn(pSiS->SiS_Pr); } } else if( ((pSiS->VGAEngine == SIS_300_VGA) && (pSiS->VBFlags2 & (VB2_LVDS | VB2_30xBDH))) || ((pSiS->VGAEngine == SIS_315_VGA) && ((pSiS->VBFlags2 & (VB2_LVDS | VB2_CHRONTEL)) == VB2_LVDS)) ) { if(!blon) { setSISIDXREG(SISSR, 0x11, sr11mask, 0x08); } else { setSISIDXREG(SISSR, 0x11, sr11mask, 0x00); } } else if((pSiS->VGAEngine == SIS_315_VGA) && (pSiS->VBFlags2 & VB2_CHRONTEL)) { if(!blon) { SiS_Chrontel701xBLOff(pSiS->SiS_Pr); } else { SiS_Chrontel701xBLOn(pSiS->SiS_Pr); } } } static Bool SISSaveScreen(ScreenPtr pScreen, int mode) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS; Bool IsUnblank = xf86IsUnblank(mode) ? TRUE : FALSE; if((pScrn == NULL) || (!pScrn->vtSema)) return TRUE; pSiS = SISPTR(pScrn); #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif if(pSiS->VBFlags & (CRT2_LCD | CRT1_LCDA)) { SiSHandleBackLight(pSiS, IsUnblank); } if(!SiSBridgeIsInSlaveMode(pScrn)) { return SiSVGASaveScreen(pScreen, mode); } return TRUE; } #ifdef SISDUALHEAD /* SaveScreen for dual head mode */ static Bool SISSaveScreenDH(ScreenPtr pScreen, int mode) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS; Bool IsUnblank = xf86IsUnblank(mode) ? TRUE : FALSE; if((pScrn == NULL) || (!pScrn->vtSema)) return TRUE; pSiS = SISPTR(pScrn); if( (pSiS->SecondHead) && ((!(pSiS->VBFlags & CRT1_LCDA)) || (pSiS->VBFlags2 & VB2_SISTMDSLCDABRIDGE)) ) { /* Slave head is always CRT1 */ /* (No backlight handling on TMDS bridges) */ return SiSVGASaveScreen(pScreen, mode); } else { /* Master head is always CRT2 */ /* But we land here for LCDA, too (if bridge is SiS LVDS type) */ /* We can only blank LCD, not other CRT2 devices */ if(pSiS->VBFlags & (CRT2_LCD|CRT1_LCDA)) { #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif SiSHandleBackLight(pSiS, IsUnblank); } } return TRUE; } #endif static void SISDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags) { SISPtr pSiS = SISPTR(pScrn); Bool docrt1 = TRUE, docrt2 = TRUE, backlight = TRUE; UChar sr1=0, cr17=0, cr63=0, pmreg=0, sr7=0; UChar p1_13=0, p2_0=0, oldpmreg=0; if(!pScrn->vtSema) return; xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4, "SISDisplayPowerManagementSet(%d)\n", PowerManagementMode); #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiS->SecondHead) docrt2 = FALSE; else docrt1 = FALSE; } #endif /* FIXME: in old servers, DPMSSet was supposed to be called without open * the correct PCI bridges before access the hardware. Now we have this * hook wrapped by the vga arbiter which should do all the work, in * kernels that implement it. For this case we might not want this hack * bellow. */ outSISIDXREG(SISSR,0x05,0x86); inSISIDXREG(SISSR,0x05,pmreg); if(pmreg != 0xa1) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(PowerManagementMode) { case DPMSModeOn: /* HSync: On, VSync: On */ sr1 = 0x00; cr17 = 0x80; pmreg = 0x00; cr63 = 0x00; sr7 = 0x10; p2_0 = 0x20; p1_13 = 0x00; backlight = TRUE; break; case DPMSModeSuspend: /* HSync: On, VSync: Off */ sr1 = 0x20; cr17 = 0x80; pmreg = 0x80; cr63 = 0x40; sr7 = 0x00; p2_0 = 0x40; p1_13 = 0x80; backlight = FALSE; break; case DPMSModeStandby: /* HSync: Off, VSync: On */ sr1 = 0x20; cr17 = 0x80; pmreg = 0x40; cr63 = 0x40; sr7 = 0x00; p2_0 = 0x80; p1_13 = 0x40; backlight = FALSE; break; case DPMSModeOff: /* HSync: Off, VSync: Off */ sr1 = 0x20; cr17 = 0x00; pmreg = 0xc0; cr63 = 0x40; sr7 = 0x00; p2_0 = 0xc0; p1_13 = 0xc0; backlight = FALSE; break; default: return; } oldpmreg = pmreg; if((docrt2 && (pSiS->VBFlags & CRT2_LCD)) || (docrt1 && (pSiS->VBFlags & CRT1_LCDA))) { SiSHandleBackLight(pSiS, backlight); } if(docrt1) { switch(pSiS->VGAEngine) { case SIS_OLD_VGA: case SIS_530_VGA: setSISIDXREG(SISSR, 0x01, ~0x20, sr1); /* Set/Clear "Display On" bit */ inSISIDXREG(SISSR, 0x11, oldpmreg); setSISIDXREG(SISCR, 0x17, 0x7f, cr17); setSISIDXREG(SISSR, 0x11, 0x3f, pmreg); break; case SIS_315_VGA: if( (!pSiS->CRT1off) && ((!(pSiS->VBFlags & CRT1_LCDA)) || (pSiS->VBFlags2 & VB2_SISTMDSLCDABRIDGE)) ) { setSISIDXREG(SISCR, pSiS->myCR63, 0xbf, cr63); setSISIDXREG(SISSR, 0x07, 0xef, sr7); } /* fall through */ default: if(!SiSBridgeIsInSlaveMode(pScrn)) { setSISIDXREG(SISSR, 0x01, ~0x20, sr1); /* Set/Clear "Display On" bit */ } if((!(pSiS->VBFlags & CRT1_LCDA)) || (pSiS->VBFlags2 & VB2_SISTMDSLCDABRIDGE)) { inSISIDXREG(SISSR, 0x1f, oldpmreg); if((!pSiS->CRT1off) && (!SiSBridgeIsInSlaveMode(pScrn))) { setSISIDXREG(SISSR, 0x1f, 0x3f, pmreg); } } } oldpmreg &= 0xc0; } if(docrt2) { if(pSiS->VBFlags & CRT2_LCD) { if((pSiS->VBFlags2 & VB2_SISBRIDGE) && (!(pSiS->VBFlags2 & VB2_30xBDH))) { if(pSiS->VGAEngine == SIS_300_VGA) { SiS_UnLockCRT2(pSiS->SiS_Pr); setSISIDXREG(SISPART1, 0x13, 0x3f, p1_13); } if(pSiS->VBFlags2 & VB2_SISLVDSBRIDGE) p2_0 |= 0x20; setSISIDXREG(SISPART2, 0x00, 0x1f, p2_0); } } else if(pSiS->VBFlags & (CRT2_VGA | CRT2_TV)) { if(pSiS->VBFlags2 & VB2_SISBRIDGE) { setSISIDXREG(SISPART2, 0x00, 0x1f, p2_0); } } } if( (docrt1) && (pmreg != oldpmreg) && ((!(pSiS->VBFlags & CRT1_LCDA)) || (pSiS->VBFlags2 & VB2_SISTMDSLCDABRIDGE)) ) { outSISIDXREG(SISSR, 0x00, 0x01); /* Synchronous Reset */ usleep(10000); outSISIDXREG(SISSR, 0x00, 0x03); /* End Reset */ } } /* Mandatory * This gets called at the start of each server generation * * We use pScrn and not CurrentLayout here, because the * properties we use have not changed (displayWidth, * depth, bitsPerPixel) */ static Bool SISScreenInit(SCREEN_INIT_ARGS_DECL) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); VisualPtr visual; ULong OnScreenSize; int ret, height, width, displayWidth; UChar *FBStart; #ifdef SISDUALHEAD SISEntPtr pSiSEnt = NULL; #endif #ifdef SISDUALHEAD if((!pSiS->DualHeadMode) || (!pSiS->SecondHead)) { #endif SiS_LoadInitVBE(pScrn); #ifdef SISDUALHEAD } #endif #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiSEnt = pSiS->entityPrivate; pSiSEnt->refCount++; } #endif #ifdef SIS_PC_PLATFORM /* Map 64k VGA window for saving/restoring CGA fonts */ SiS_MapVGAMem(pScrn); #endif /* Map the SiS memory and MMIO areas */ if(!SISMapMem(pScrn)) { SISErrorLog(pScrn, "SiSMapMem() failed\n"); return FALSE; } SiS_SiSFB_Lock(pScrn, TRUE); #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif /* Enable TurboQueue so that SISSave() saves it in enabled * state. If we don't do this, X will hang after a restart! * (Happens for some unknown reason only when using VESA * for mode switching; assumingly a BIOS issue.) * This is done on 300 and 315 series only. */ if(pSiS->UseVESA) { #ifdef SISVRAMQ if(pSiS->VGAEngine != SIS_315_VGA) #endif SiSEnableTurboQueue(pScrn); } /* Save the current state */ SISSave(pScrn); if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { if(!pSiS->OldMode) { /* Try to find out current (=old) mode number * (Do this only if not sisfb has told us its mode yet) */ /* Read 0:449 which the BIOS sets to the current mode number * Unfortunately, this not reliable since the int10 emulation * does not change this. So if we call the VBE later, this * byte won't be touched (which is why we set this manually * then). */ UChar myoldmode = SiS_GetSetModeID(pScrn, 0xFF); UChar cr30, cr31; /* Read CR34 which the BIOS sets to the current mode number for CRT2 * This is - of course - not reliable if the machine has no video * bridge... */ inSISIDXREG(SISCR, 0x34, pSiS->OldMode); inSISIDXREG(SISCR, 0x30, cr30); inSISIDXREG(SISCR, 0x31, cr31); /* What if CR34 is different from the BIOS scratch byte? */ if(pSiS->OldMode != myoldmode) { /* If no bridge output is active, trust the BIOS scratch byte */ if( (!(pSiS->VBFlags2 & VB2_VIDEOBRIDGE)) || (pSiS->OldMode == 0) || (!cr31 && !cr30) || (cr31 & 0x20) ) { pSiS->OldMode = myoldmode; } /* ..else trust CR34 */ } /* Newer 650 BIOSes set CR34 to 0xff if the mode has been * "patched", for instance for 80x50 text mode. (That mode * has no number of its own, it's 0x03 like 80x25). In this * case, we trust the BIOS scratch byte (provided that any * of these two is valid). */ if(pSiS->OldMode > 0x7f) { pSiS->OldMode = myoldmode; } } #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(!pSiS->SecondHead) pSiSEnt->OldMode = pSiS->OldMode; else pSiS->OldMode = pSiSEnt->OldMode; } #endif } /* RandR resets screen mode and size in CloseScreen(), hence * we need to adapt our VBFlags to the initial state if the * current mode has changed since closescreen() (or Screeninit() * for the first instance) */ if(pScrn->currentMode != pSiS->currentModeLast) { pSiS->VBFlags = pSiS->VBFlags_backup = pSiS->VBFlagsInit; } /* Copy our detected monitor gammas, part 2. Note that device redetection * is not supported in DHM, so there is no need to do that anytime later. */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(!pSiS->SecondHead) { /* CRT2 */ pSiS->CRT1VGAMonitorGamma = pSiSEnt->CRT1VGAMonitorGamma; } else { /* CRT1 */ pSiS->CRT2VGAMonitorGamma = pSiSEnt->CRT2VGAMonitorGamma; } if(!pSiS->CRT2LCDMonitorGamma) pSiS->CRT2LCDMonitorGamma = pSiSEnt->CRT2LCDMonitorGamma; } #endif /* Initialize the first mode */ if(!SISModeInit(pScrn, pScrn->currentMode)) { SISErrorLog(pScrn, "SiSModeInit() failed\n"); return FALSE; } /* Darken the screen for aesthetic reasons */ /* Not using Dual Head variant on purpose; we darken * the screen for both displays, and un-darken * it when the second head is finished */ SISSaveScreen(pScreen, SCREEN_SAVER_ON); /* Set the viewport */ SISAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); /* Reset visual list. */ miClearVisualTypes(); /* Setup the visuals we support. */ /* * For bpp > 8, the default visuals are not acceptable because we only * support TrueColor and not DirectColor. */ if(!miSetVisualTypes(pScrn->depth, (pScrn->bitsPerPixel > 8) ? TrueColorMask : miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) { SISSaveScreen(pScreen, SCREEN_SAVER_OFF); SISErrorLog(pScrn, "miSetVisualTypes() failed (bpp %d)\n", pScrn->bitsPerPixel); return FALSE; } width = pScrn->virtualX; height = pScrn->virtualY; displayWidth = pScrn->displayWidth; if(pSiS->Rotate) { height = pScrn->virtualX; width = pScrn->virtualY; } if(pSiS->ShadowFB) { pSiS->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); pSiS->ShadowPtr = malloc(pSiS->ShadowPitch * height); displayWidth = pSiS->ShadowPitch / (pScrn->bitsPerPixel >> 3); FBStart = pSiS->ShadowPtr; } else { pSiS->ShadowPtr = NULL; FBStart = pSiS->FbBase; } if(!miSetPixmapDepths()) { SISSaveScreen(pScreen, SCREEN_SAVER_OFF); SISErrorLog(pScrn, "miSetPixmapDepths() failed\n"); return FALSE; } /* Point cmdQueuePtr to pSiSEnt for shared usage * (same technique is then eventually used in DRIScreeninit) * For 315/330 series, this is done in EnableTurboQueue * which has already been called during ModeInit(). */ #ifdef SISDUALHEAD if(pSiS->SecondHead) pSiS->cmdQueueLenPtr = &(SISPTR(pSiSEnt->pScrn_1)->cmdQueueLen); else #endif pSiS->cmdQueueLenPtr = &(pSiS->cmdQueueLen); pSiS->cmdQueueLen = 0; /* Force an EngineIdle() at start */ #ifdef SISDRI if(pSiS->loadDRI) { #ifdef SISDUALHEAD /* No DRI in dual head mode */ if(pSiS->DualHeadMode) { pSiS->directRenderingEnabled = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DRI not supported in Dual Head mode\n"); } else #endif if(pSiS->VGAEngine != SIS_315_VGA) { /* Force the initialization of the context */ pSiS->directRenderingEnabled = SISDRIScreenInit(pScreen); } else { xf86DrvMsg(pScrn->scrnIndex, X_NOT_IMPLEMENTED, "DRI not supported on this chipset\n"); pSiS->directRenderingEnabled = FALSE; } } #endif /* Call the framebuffer layer's ScreenInit function and fill in other * pScreen fields. */ switch(pScrn->bitsPerPixel) { case 24: if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { ret = FALSE; break; } /* fall through */ case 8: case 16: case 32: ret = fbScreenInit(pScreen, FBStart, width, height, pScrn->xDpi, pScrn->yDpi, displayWidth, pScrn->bitsPerPixel); break; default: ret = FALSE; break; } if(!ret) { SISErrorLog(pScrn, "Unsupported bpp (%d) or fbScreenInit() failed\n", pScrn->bitsPerPixel); SISSaveScreen(pScreen, SCREEN_SAVER_OFF); return FALSE; } /* Fixup RGB ordering */ if(pScrn->bitsPerPixel > 8) { 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; } } } /* Initialize RENDER extension (must be after RGB ordering fixed) */ fbPictureInit(pScreen, 0, 0); /* Hardware cursor needs to wrap this layer */ if(!pSiS->ShadowFB) SISDGAInit(pScreen); xf86SetBlackWhitePixels(pScreen); /* Initialize the accelerators */ switch(pSiS->VGAEngine) { case SIS_530_VGA: case SIS_300_VGA: SiS300AccelInit(pScreen); break; case SIS_315_VGA: SiS315AccelInit(pScreen); break; default: SiSAccelInit(pScreen); } #ifdef TWDEBUG xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CPUFlags %x\n", pSiS->CPUFlags); #endif /* Benchmark memcpy() methods (needs FB manager initialized) */ /* Dual head: Do this AFTER the mode for CRT1 has been set */ pSiS->NeedCopyFastVidCpy = FALSE; if(!pSiS->SiSFastVidCopyDone) { #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiS->SecondHead) { pSiSEnt->SiSFastVidCopy = SiSVidCopyInit(pScreen, &pSiSEnt->SiSFastMemCopy, FALSE); pSiSEnt->SiSFastVidCopyFrom = SiSVidCopyGetDefault(); pSiSEnt->SiSFastMemCopyFrom = SiSVidCopyGetDefault(); #ifdef SIS_USE_EXA if(pSiS->useEXA) { pSiSEnt->SiSFastVidCopyFrom = SiSVidCopyInit(pScreen, &pSiSEnt->SiSFastMemCopyFrom, TRUE); } #endif /* EXA */ pSiSEnt->HaveFastVidCpy = TRUE; pSiS->SiSFastVidCopy = pSiSEnt->SiSFastVidCopy; pSiS->SiSFastMemCopy = pSiSEnt->SiSFastMemCopy; pSiS->SiSFastVidCopyFrom = pSiSEnt->SiSFastVidCopyFrom; pSiS->SiSFastMemCopyFrom = pSiSEnt->SiSFastMemCopyFrom; } else { pSiS->NeedCopyFastVidCpy = TRUE; } } else { #endif pSiS->SiSFastVidCopy = SiSVidCopyInit(pScreen, &pSiS->SiSFastMemCopy, FALSE); pSiS->SiSFastVidCopyFrom = SiSVidCopyGetDefault(); pSiS->SiSFastMemCopyFrom = SiSVidCopyGetDefault(); #ifdef SIS_USE_EXA if(pSiS->useEXA) { pSiS->SiSFastVidCopyFrom = SiSVidCopyInit(pScreen, &pSiS->SiSFastMemCopyFrom, TRUE); } #endif /* EXA */ #ifdef SISDUALHEAD } #endif } pSiS->SiSFastVidCopyDone = TRUE; miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); xf86SetSilkenMouse(pScreen); /* Initialise cursor functions */ miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); if(pSiS->HWCursor) { SiSHWCursorInit(pScreen); } #ifdef SISDUALHEAD if(!pSiS->DualHeadMode) { #endif if((pSiS->VBFlags2 & VB2_SISBRIDGE) && (pScrn->depth > 8)) { pSiS->CRT2ColNum = 1 << pScrn->rgbBits; if((pSiS->crt2gcolortable = malloc(pSiS->CRT2ColNum * 2 * sizeof(LOCO)))) { pSiS->crt2colors = &pSiS->crt2gcolortable[pSiS->CRT2ColNum]; if((pSiS->crt2cindices = malloc(256 * sizeof(int)))) { int i = pSiS->CRT2ColNum; SISCalculateGammaRampCRT2(pScrn); while(i--) pSiS->crt2cindices[i] = i; } else { free(pSiS->crt2gcolortable); pSiS->crt2gcolortable = NULL; pSiS->CRT2SepGamma = FALSE; } } else { pSiS->CRT2SepGamma = FALSE; } if(!pSiS->crt2cindices) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to allocate cmap for CRT2, separate gamma correction disabled\n"); } } #ifdef SISDUALHEAD } else pSiS->CRT2SepGamma = FALSE; #endif /* Initialise default colormap */ if(!miCreateDefColormap(pScreen)) { SISSaveScreen(pScreen, SCREEN_SAVER_OFF); SISErrorLog(pScrn, "miCreateDefColormap() failed\n"); return FALSE; } if(!xf86HandleColormaps(pScreen, 256, (pScrn->depth == 8) ? 8 : pScrn->rgbBits, SISLoadPalette, NULL, CMAP_PALETTED_TRUECOLOR | CMAP_RELOAD_ON_MODE_SWITCH)) { SISSaveScreen(pScreen, SCREEN_SAVER_OFF); SISErrorLog(pScrn, "xf86HandleColormaps() failed\n"); return FALSE; } /* Recalculate our gamma ramp for brightness feature */ #ifdef SISGAMMARAMP if((pSiS->GammaBriR != 1000) || (pSiS->GammaBriB != 1000) || (pSiS->GammaBriG != 1000) || (pSiS->NewGammaBriR != 0.0) || (pSiS->NewGammaBriG != 0.0) || (pSiS->NewGammaBriB != 0.0) || (pSiS->NewGammaConR != 0.0) || (pSiS->NewGammaConG != 0.0) || (pSiS->NewGammaConB != 0.0)) { SISCalculateGammaRamp(pScreen, pScrn); } #endif /* Initialize Shadow framebuffer and screen rotation/reflection */ if(pSiS->ShadowFB) { RefreshAreaFuncPtr refreshArea = SISRefreshArea; if(pSiS->Rotate) { if(!pSiS->PointerMoved) pSiS->PointerMoved = pScrn->PointerMoved; pScrn->PointerMoved = SISPointerMoved; switch(pScrn->bitsPerPixel) { case 8: refreshArea = SISRefreshArea8; break; case 16: refreshArea = SISRefreshArea16; break; case 24: refreshArea = SISRefreshArea24; break; case 32: refreshArea = SISRefreshArea32; break; } #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0) xf86DisableRandR(); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Driver rotation enabled, disabling RandR\n"); #endif } else if(pSiS->Reflect) { switch(pScrn->bitsPerPixel) { case 8: case 16: case 32: if(!pSiS->PointerMoved) pSiS->PointerMoved = pScrn->PointerMoved; pScrn->PointerMoved = SISPointerMovedReflect; refreshArea = SISRefreshAreaReflect; #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0) xf86DisableRandR(); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Driver reflection enabled, disabling RandR\n"); #endif break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Reflection not supported at this framebuffer depth\n"); } } ShadowFBInit(pScreen, refreshArea); } xf86DPMSInit(pScreen, (DPMSSetProcPtr)SISDisplayPowerManagementSet, 0); /* Init memPhysBase and fbOffset in pScrn */ pScrn->memPhysBase = pSiS->FbAddress; pScrn->fbOffset = 0; /* Initialize Xv */ pSiS->ResetXv = pSiS->ResetXvGamma = pSiS->ResetXvDisplay = NULL; #if (XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,99,0,0)) || (defined(XvExtension)) if((!pSiS->NoXvideo) && (!(pSiS->SiS_SD2_Flags & SiS_SD2_NOOVERLAY))) { if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { const char *using = "Using SiS300/315/330/340 series HW Xv"; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s on CRT%d\n", using, (pSiS->SecondHead ? 1 : 2)); if(!pSiS->hasTwoOverlays) { if( (pSiS->XvOnCRT2 && pSiS->SecondHead) || (!pSiS->XvOnCRT2 && !pSiS->SecondHead) ) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "However, video overlay will by default only be visible on CRT%d\n", pSiS->XvOnCRT2 ? 2 : 1); } } } else { #endif if(pSiS->hasTwoOverlays) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s\n", using); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s by default on CRT%d\n", using, (pSiS->XvOnCRT2 ? 2 : 1)); } #ifdef SISDUALHEAD } #endif SISInitVideo(pScreen); if(pSiS->blitadaptor) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default Xv adaptor is Video %s\n", pSiS->XvDefAdaptorBlit ? "Blitter" : "Overlay"); } } else if(pSiS->Chipset == PCI_CHIP_SIS530 || pSiS->Chipset == PCI_CHIP_SIS6326 || pSiS->Chipset == PCI_CHIP_SIS5597) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using SiS5597/5598/6326/530/620 HW Xv\n" ); SIS6326InitVideo(pScreen); } else { /* generic Xv */ XF86VideoAdaptorPtr *ptr; int n = xf86XVListGenericAdaptors(pScrn, &ptr); if(n) { xf86XVScreenInit(pScreen, ptr, n); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using generic Xv\n" ); } } } #endif #ifdef SISDRI if(pSiS->loadDRI) { if(pSiS->directRenderingEnabled) { /* Now that mi, drm and others have done their thing, * complete the DRI setup. */ pSiS->directRenderingEnabled = SISDRIFinishScreenInit(pScreen); } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Direct rendering %s\n", pSiS->directRenderingEnabled ? "enabled" : "disabled"); /* TODO */ /* if(pSiS->directRenderingEnabled) SISSetLFBConfig(pSiS); */ } #endif /* Wrap some funcs, initialize pseudo-Xinerama and setup remaining SD flags */ pSiS->SiS_SD_Flags &= ~(SiS_SD_PSEUDOXINERAMA); #ifdef SISMERGED if(pSiS->MergedFB) { pSiS->PointerMoved = pScrn->PointerMoved; pScrn->PointerMoved = SISMergedPointerMoved; pSiS->Rotate = 0; pSiS->Reflect = 0; pSiS->ShadowFB = FALSE; #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0) if(pSiS->CRT1XOffs || pSiS->CRT1YOffs || pSiS->CRT2XOffs || pSiS->CRT2YOffs) { xf86DisableRandR(); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MergedFB: CRT2Position offset used, disabling RandR\n"); } #endif #ifdef SISXINERAMA if(pSiS->UseSiSXinerama) { SiSnoPanoramiXExtension = FALSE; SiSXineramaExtensionInit(pScrn); if(!SiSnoPanoramiXExtension) { pSiS->SiS_SD_Flags |= SiS_SD_PSEUDOXINERAMA; if(pSiS->HaveNonRect) { /* Reset the viewport (now eventually non-recangular) */ SISAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); } } } else { pSiS->MouseRestrictions = FALSE; } #endif } #endif /* Wrap CloseScreen and set up SaveScreen */ pSiS->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = SISCloseScreen; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) pScreen->SaveScreen = SISSaveScreenDH; else #endif pScreen->SaveScreen = SISSaveScreen; /* Install BlockHandler */ pSiS->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = SISBlockHandler; /* Report any unused options (only for the first generation) */ if(serverGeneration == 1) { xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); } /* Clear frame buffer */ /* For CRT2, we don't do that at this point in dual head * mode since the mode isn't switched at this time (it will * be reset when setting the CRT1 mode). Hence, we just * save the necessary data and clear the screen when * going through this for CRT1. */ OnScreenSize = pScrn->displayWidth * pScrn->currentMode->VDisplay * (pScrn->bitsPerPixel >> 3); /* Turn on the screen now */ /* We do this in dual head mode after second head is finished */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiS->SecondHead) { sisclearvram(pSiS->FbBase, OnScreenSize); sisclearvram(pSiSEnt->FbBase1, pSiSEnt->OnScreenSize1); SISSaveScreen(pScreen, SCREEN_SAVER_OFF); } else { pSiSEnt->FbBase1 = pSiS->FbBase; pSiSEnt->OnScreenSize1 = OnScreenSize; } } else { #endif SISSaveScreen(pScreen, SCREEN_SAVER_OFF); sisclearvram(pSiS->FbBase, OnScreenSize); #ifdef SISDUALHEAD } #endif pSiS->SiS_SD_Flags &= ~SiS_SD_SUPPORTSGRCRT2; #ifdef SISDUALHEAD if(!pSiS->DualHeadMode) { #endif if(pSiS->VBFlags2 & VB2_SISBRIDGE) { if((pSiS->crt2cindices) && (pSiS->crt2gcolortable)) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTSGRCRT2; } } #ifdef SISDUALHEAD } #endif pSiS->SiS_SD_Flags &= ~SiS_SD_ISDEPTH8; if(pSiS->CurrentLayout.bitsPerPixel == 8) { pSiS->SiS_SD_Flags |= SiS_SD_ISDEPTH8; pSiS->SiS_SD_Flags &= ~SiS_SD_SUPPORTXVGAMMA1; pSiS->SiS_SD_Flags &= ~SiS_SD_SUPPORTSGRCRT2; } #ifdef SISGAMMARAMP pSiS->SiS_SD_Flags |= SiS_SD_CANSETGAMMA; #else pSiS->SiS_SD_Flags &= ~SiS_SD_CANSETGAMMA; #endif SiSCtrlExtInit(pScrn); return TRUE; } /* Usually mandatory */ Bool SISSwitchMode(SWITCH_MODE_ARGS_DECL) { SCRN_INFO_PTR(arg); SISPtr pSiS = SISPTR(pScrn); if(!pSiS->skipswitchcheck) { if(SISValidMode(arg, mode, TRUE, 0) != MODE_OK) { return FALSE; } } (*pSiS->SyncAccel)(pScrn); if(!(SISModeInit(pScrn, mode))) return FALSE; /* Since RandR (indirectly) uses SwitchMode(), we need to * update our Xinerama info here, too, in case of resizing */ #ifdef SISMERGED #ifdef SISXINERAMA if(pSiS->MergedFB) { SiSUpdateXineramaScreenInfo(pScrn); } #endif #endif return TRUE; } static void SISSetStartAddressCRT1(SISPtr pSiS, ULong base) { UChar cr11backup; inSISIDXREG(SISCR, 0x11, cr11backup); /* Unlock CRTC registers */ andSISIDXREG(SISCR, 0x11, 0x7F); outSISIDXREG(SISCR, 0x0D, base & 0xFF); outSISIDXREG(SISCR, 0x0C, (base >> 8) & 0xFF); outSISIDXREG(SISSR, 0x0D, (base >> 16) & 0xFF); if(pSiS->VGAEngine == SIS_315_VGA) { setSISIDXREG(SISSR, 0x37, 0xFE, (base >> 24) & 0x01); } /* Eventually lock CRTC registers */ setSISIDXREG(SISCR, 0x11, 0x7F,(cr11backup & 0x80)); } static void SISSetStartAddressCRT2(SISPtr pSiS, ULong base) { SiS_UnLockCRT2(pSiS->SiS_Pr); outSISIDXREG(SISPART1, 0x06, GETVAR8(base)); outSISIDXREG(SISPART1, 0x05, GETBITS(base, 15:8)); outSISIDXREG(SISPART1, 0x04, GETBITS(base, 23:16)); if(pSiS->VGAEngine == SIS_315_VGA) { setSISIDXREG(SISPART1, 0x02, 0x7F, ((base >> 24) & 0x01) << 7); } SiS_LockCRT2(pSiS->SiS_Pr); } #ifdef SISMERGED static Bool InRegion(int x, int y, region r) { return (r.x0 <= x) && (x <= r.x1) && (r.y0 <= y) && (y <= r.y1); } static void SISAdjustFrameHW_CRT1(ScrnInfoPtr pScrn, int x, int y) { SISPtr pSiS = SISPTR(pScrn); ULong base; base = y * pSiS->CurrentLayout.displayWidth + x; switch(pSiS->CurrentLayout.bitsPerPixel) { case 16: base >>= 1; break; case 32: break; default: base >>= 2; } base += (pSiS->dhmOffset/4); SISSetStartAddressCRT1(pSiS, base); } static void SISAdjustFrameHW_CRT2(ScrnInfoPtr pScrn, int x, int y) { SISPtr pSiS = SISPTR(pScrn); ULong base; base = y * pSiS->CurrentLayout.displayWidth + x; switch(pSiS->CurrentLayout.bitsPerPixel) { case 16: base >>= 1; break; case 32: break; default: base >>= 2; } base += (pSiS->dhmOffset/4); SISSetStartAddressCRT2(pSiS, base); } static void SISMergedPointerMoved(SCRN_ARG_TYPE arg, int x, int y) { SCRN_INFO_PTR(arg); ScrnInfoPtr pScrn1 = pScrn; SISPtr pSiS = SISPTR(pScrn1); ScrnInfoPtr pScrn2 = pSiS->CRT2pScrn; region out, in1, in2, f2, f1; int deltax, deltay; int temp1, temp2; int old1x0, old1y0, old2x0, old2y0; int CRT1XOffs = 0, CRT1YOffs = 0, CRT2XOffs = 0, CRT2YOffs = 0; int HVirt = pScrn1->virtualX; int VVirt = pScrn1->virtualY; int sigstate; Bool doit = FALSE, HaveNonRect = FALSE, HaveOffsRegions = FALSE; SiSScrn2Rel srel = ((SiSMergedDisplayModePtr)pSiS->CurrentLayout.mode->Private)->CRT2Position; if(pSiS->DGAactive) { return; /* DGA: There is no cursor and no panning while DGA is active. */ /* If it were, we would need to do: */ /* HVirt = pSiS->CurrentLayout.displayWidth; VVirt = pSiS->CurrentLayout.displayHeight; BOUND(x, pSiS->CurrentLayout.DGAViewportX, HVirt); BOUND(y, pSiS->CurrentLayout.DGAViewportY, VVirt); */ } else { CRT1XOffs = pSiS->CRT1XOffs; CRT1YOffs = pSiS->CRT1YOffs; CRT2XOffs = pSiS->CRT2XOffs; CRT2YOffs = pSiS->CRT2YOffs; HaveNonRect = pSiS->HaveNonRect; HaveOffsRegions = pSiS->HaveOffsRegions; } /* Check if the pointer is inside our dead areas */ if((pSiS->MouseRestrictions) && (srel != sisClone) && !SiSnoPanoramiXExtension) { if(HaveNonRect) { if(InRegion(x, y, pSiS->NonRectDead)) { switch(srel) { case sisLeftOf: case sisRightOf: y = pSiS->NonRectDead.y0 - 1; doit = TRUE; break; case sisAbove: case sisBelow: x = pSiS->NonRectDead.x0 - 1; doit = TRUE; default: break; } } } if(HaveOffsRegions) { if(InRegion(x, y, pSiS->OffDead1)) { switch(srel) { case sisLeftOf: case sisRightOf: y = pSiS->OffDead1.y1; doit = TRUE; break; case sisAbove: case sisBelow: x = pSiS->OffDead1.x1; doit = TRUE; default: break; } } else if(InRegion(x, y, pSiS->OffDead2)) { switch(srel) { case sisLeftOf: case sisRightOf: y = pSiS->OffDead2.y0 - 1; doit = TRUE; break; case sisAbove: case sisBelow: x = pSiS->OffDead2.x0 - 1; doit = TRUE; default: break; } } } if(doit) { sigstate = xf86BlockSIGIO(); #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 15 { double dx = x, dy = y; miPointerSetPosition(inputInfo.pointer, Absolute, &dx, &dy); x = (int)dx; y = (int)dy; } #elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 13 miPointerSetPosition(inputInfo.pointer, Absolute, x, y); #elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5 miPointerSetPosition(inputInfo.pointer, x, y); #else UpdateCurrentTime(); miPointerAbsoluteCursor(x, y, currentTime.milliseconds); #endif xf86UnblockSIGIO(sigstate); return; } } f1.x0 = old1x0 = pSiS->CRT1frameX0; f1.x1 = pSiS->CRT1frameX1; f1.y0 = old1y0 = pSiS->CRT1frameY0; f1.y1 = pSiS->CRT1frameY1; f2.x0 = old2x0 = pScrn2->frameX0; f2.x1 = pScrn2->frameX1; f2.y0 = old2y0 = pScrn2->frameY0; f2.y1 = pScrn2->frameY1; /* Define the outer region. Crossing this causes all frames to move */ out.x0 = pScrn1->frameX0; out.x1 = pScrn1->frameX1; out.y0 = pScrn1->frameY0; out.y1 = pScrn1->frameY1; /* * Define the inner sliding window. Being outsize both frames but * inside the outer clipping window will slide corresponding frame */ in1 = out; in2 = out; switch(srel) { case sisLeftOf: in1.x0 = f1.x0; in2.x1 = f2.x1; break; case sisRightOf: in1.x1 = f1.x1; in2.x0 = f2.x0; break; case sisBelow: in1.y1 = f1.y1; in2.y0 = f2.y0; break; case sisAbove: in1.y0 = f1.y0; in2.y1 = f2.y1; break; case sisClone: break; } deltay = 0; deltax = 0; if(InRegion(x, y, out)) { /* inside outer region */ if(InRegion(x, y, in1) && !InRegion(x, y, f1)) { REBOUND(f1.x0, f1.x1, x); REBOUND(f1.y0, f1.y1, y); deltax = 1; } if(InRegion(x, y, in2) && !InRegion(x, y, f2)) { REBOUND(f2.x0, f2.x1, x); REBOUND(f2.y0, f2.y1, y); deltax = 1; } } else { /* outside outer region */ if(out.x0 > x) { deltax = x - out.x0; } if(out.x1 < x) { deltax = x - out.x1; } if(deltax) { pScrn1->frameX0 += deltax; pScrn1->frameX1 += deltax; f1.x0 += deltax; f1.x1 += deltax; f2.x0 += deltax; f2.x1 += deltax; } if(out.y0 > y) { deltay = y - out.y0; } if(out.y1 < y) { deltay = y - out.y1; } if(deltay) { pScrn1->frameY0 += deltay; pScrn1->frameY1 += deltay; f1.y0 += deltay; f1.y1 += deltay; f2.y0 += deltay; f2.y1 += deltay; } switch(srel) { case sisLeftOf: if(x >= f1.x0) { REBOUND(f1.y0, f1.y1, y); } if(x <= f2.x1) { REBOUND(f2.y0, f2.y1, y); } break; case sisRightOf: if(x <= f1.x1) { REBOUND(f1.y0, f1.y1, y); } if(x >= f2.x0) { REBOUND(f2.y0, f2.y1, y); } break; case sisBelow: if(y <= f1.y1) { REBOUND(f1.x0, f1.x1, x); } if(y >= f2.y0) { REBOUND(f2.x0, f2.x1, x); } break; case sisAbove: if(y >= f1.y0) { REBOUND(f1.x0, f1.x1, x); } if(y <= f2.y1) { REBOUND(f2.x0, f2.x1, x); } break; case sisClone: break; } } if(deltax || deltay) { pSiS->CRT1frameX0 = f1.x0; pSiS->CRT1frameY0 = f1.y0; pScrn2->frameX0 = f2.x0; pScrn2->frameY0 = f2.y0; switch(srel) { case sisLeftOf: case sisRightOf: if(CRT1YOffs || CRT2YOffs || HaveNonRect) { if(pSiS->CRT1frameY0 != old1y0) { if(pSiS->CRT1frameY0 < CRT1YOffs) pSiS->CRT1frameY0 = CRT1YOffs; temp1 = pSiS->CRT1frameY0 + CDMPTR->CRT1->VDisplay; temp2 = min((VVirt - CRT2YOffs), (CRT1YOffs + pSiS->MBXNR1YMAX)); if(temp1 > temp2) pSiS->CRT1frameY0 -= (temp1 - temp2); } if(pScrn2->frameY0 != old2y0) { if(pScrn2->frameY0 < CRT2YOffs) pScrn2->frameY0 = CRT2YOffs; temp1 = pScrn2->frameY0 + CDMPTR->CRT2->VDisplay; temp2 = min((VVirt - CRT1YOffs), (CRT2YOffs + pSiS->MBXNR2YMAX)); if(temp1 > temp2) pScrn2->frameY0 -= (temp1 - temp2); } } break; case sisBelow: case sisAbove: if(CRT1XOffs || CRT2XOffs || HaveNonRect) { if(pSiS->CRT1frameX0 != old1x0) { if(pSiS->CRT1frameX0 < CRT1XOffs) pSiS->CRT1frameX0 = CRT1XOffs; temp1 = pSiS->CRT1frameX0 + CDMPTR->CRT1->HDisplay; temp2 = min((HVirt - CRT2XOffs), (CRT1XOffs + pSiS->MBXNR1XMAX)); if(temp1 > temp2) pSiS->CRT1frameX0 -= (temp1 - temp2); } if(pScrn2->frameX0 != old2x0) { if(pScrn2->frameX0 < CRT2XOffs) pScrn2->frameX0 = CRT2XOffs; temp1 = pScrn2->frameX0 + CDMPTR->CRT2->HDisplay; temp2 = min((HVirt - CRT1XOffs), (CRT2XOffs + pSiS->MBXNR2XMAX)); if(temp1 > temp2) pScrn2->frameX0 -= (temp1 - temp2); } } break; case sisClone: break; } pSiS->CRT1frameX1 = pSiS->CRT1frameX0 + CDMPTR->CRT1->HDisplay - 1; pSiS->CRT1frameY1 = pSiS->CRT1frameY0 + CDMPTR->CRT1->VDisplay - 1; pScrn2->frameX1 = pScrn2->frameX0 + CDMPTR->CRT2->HDisplay - 1; pScrn2->frameY1 = pScrn2->frameY0 + CDMPTR->CRT2->VDisplay - 1; /* No need to update pScrn1->frame?1, done above */ SISAdjustFrameHW_CRT1(pScrn1, pSiS->CRT1frameX0, pSiS->CRT1frameY0); SISAdjustFrameHW_CRT2(pScrn1, pScrn2->frameX0, pScrn2->frameY0); } } static void SISAdjustFrameMerged(ADJUST_FRAME_ARGS_DECL) { SCRN_INFO_PTR(arg); ScrnInfoPtr pScrn1 = pScrn; SISPtr pSiS = SISPTR(pScrn1); ScrnInfoPtr pScrn2 = pSiS->CRT2pScrn; int HTotal = pSiS->CurrentLayout.mode->HDisplay; int VTotal = pSiS->CurrentLayout.mode->VDisplay; int HMax = HTotal; int VMax = VTotal; int HVirt = pScrn1->virtualX; int VVirt = pScrn1->virtualY; int x1 = x, x2 = x; int y1 = y, y2 = y; int CRT1XOffs = 0, CRT1YOffs = 0, CRT2XOffs = 0, CRT2YOffs = 0; int MBXNR1XMAX = 65536, MBXNR1YMAX = 65536, MBXNR2XMAX = 65536, MBXNR2YMAX = 65536; if(pSiS->DGAactive) { HVirt = pSiS->CurrentLayout.displayWidth; VVirt = pSiS->CurrentLayout.displayHeight; } else { CRT1XOffs = pSiS->CRT1XOffs; CRT1YOffs = pSiS->CRT1YOffs; CRT2XOffs = pSiS->CRT2XOffs; CRT2YOffs = pSiS->CRT2YOffs; MBXNR1XMAX = pSiS->MBXNR1XMAX; MBXNR1YMAX = pSiS->MBXNR1YMAX; MBXNR2XMAX = pSiS->MBXNR2XMAX; MBXNR2YMAX = pSiS->MBXNR2YMAX; } BOUND(x, 0, HVirt - HTotal); BOUND(y, 0, VVirt - VTotal); if(SDMPTR(pScrn1)->CRT2Position != sisClone) { BOUND(x1, CRT1XOffs, min(HVirt, MBXNR1XMAX + CRT1XOffs) - min(HTotal, MBXNR1XMAX) - CRT2XOffs); BOUND(y1, CRT1YOffs, min(VVirt, MBXNR1YMAX + CRT1YOffs) - min(VTotal, MBXNR1YMAX) - CRT2YOffs); BOUND(x2, CRT2XOffs, min(HVirt, MBXNR2XMAX + CRT2XOffs) - min(HTotal, MBXNR2XMAX) - CRT1XOffs); BOUND(y2, CRT2YOffs, min(VVirt, MBXNR2YMAX + CRT2YOffs) - min(VTotal, MBXNR2YMAX) - CRT1YOffs); } switch(SDMPTR(pScrn1)->CRT2Position) { case sisLeftOf: pScrn2->frameX0 = x2; BOUND(pScrn2->frameY0, y2, y2 + min(VMax, MBXNR2YMAX) - CDMPTR->CRT2->VDisplay); pSiS->CRT1frameX0 = x1 + CDMPTR->CRT2->HDisplay; BOUND(pSiS->CRT1frameY0, y1, y1 + min(VMax, MBXNR1YMAX) - CDMPTR->CRT1->VDisplay); break; case sisRightOf: pSiS->CRT1frameX0 = x1; BOUND(pSiS->CRT1frameY0, y1, y1 + min(VMax, MBXNR1YMAX) - CDMPTR->CRT1->VDisplay); pScrn2->frameX0 = x2 + CDMPTR->CRT1->HDisplay; BOUND(pScrn2->frameY0, y2, y2 + min(VMax, MBXNR2YMAX) - CDMPTR->CRT2->VDisplay); break; case sisAbove: BOUND(pScrn2->frameX0, x2, x2 + min(HMax, MBXNR2XMAX) - CDMPTR->CRT2->HDisplay); pScrn2->frameY0 = y2; BOUND(pSiS->CRT1frameX0, x1, x1 + min(HMax, MBXNR1XMAX) - CDMPTR->CRT1->HDisplay); pSiS->CRT1frameY0 = y1 + CDMPTR->CRT2->VDisplay; break; case sisBelow: BOUND(pSiS->CRT1frameX0, x1, x1 + min(HMax, MBXNR1XMAX) - CDMPTR->CRT1->HDisplay); pSiS->CRT1frameY0 = y1; BOUND(pScrn2->frameX0, x2, x2 + min(HMax, MBXNR2XMAX) - CDMPTR->CRT2->HDisplay); pScrn2->frameY0 = y2 + CDMPTR->CRT1->VDisplay; break; case sisClone: BOUND(pSiS->CRT1frameX0, x, x + HMax - CDMPTR->CRT1->HDisplay); BOUND(pSiS->CRT1frameY0, y, y + VMax - CDMPTR->CRT1->VDisplay); BOUND(pScrn2->frameX0, x, x + HMax - CDMPTR->CRT2->HDisplay); BOUND(pScrn2->frameY0, y, y + VMax - CDMPTR->CRT2->VDisplay); break; } BOUND(pSiS->CRT1frameX0, 0, HVirt - CDMPTR->CRT1->HDisplay); BOUND(pSiS->CRT1frameY0, 0, VVirt - CDMPTR->CRT1->VDisplay); BOUND(pScrn2->frameX0, 0, HVirt - CDMPTR->CRT2->HDisplay); BOUND(pScrn2->frameY0, 0, VVirt - CDMPTR->CRT2->VDisplay); pScrn1->frameX0 = x; pScrn1->frameY0 = y; pSiS->CRT1frameX1 = pSiS->CRT1frameX0 + CDMPTR->CRT1->HDisplay - 1; pSiS->CRT1frameY1 = pSiS->CRT1frameY0 + CDMPTR->CRT1->VDisplay - 1; pScrn2->frameX1 = pScrn2->frameX0 + CDMPTR->CRT2->HDisplay - 1; pScrn2->frameY1 = pScrn2->frameY0 + CDMPTR->CRT2->VDisplay - 1; pScrn1->frameX1 = pScrn1->frameX0 + pSiS->CurrentLayout.mode->HDisplay - 1; pScrn1->frameY1 = pScrn1->frameY0 + pSiS->CurrentLayout.mode->VDisplay - 1; if(SDMPTR(pScrn1)->CRT2Position != sisClone) { pScrn1->frameX1 += CRT1XOffs + CRT2XOffs; pScrn1->frameY1 += CRT1YOffs + CRT2YOffs; } SISAdjustFrameHW_CRT1(pScrn1, pSiS->CRT1frameX0, pSiS->CRT1frameY0); SISAdjustFrameHW_CRT2(pScrn1, pScrn2->frameX0, pScrn2->frameY0); } #endif /* * This function is used to initialize the Start Address - the first * displayed location in the video memory. * * Usually mandatory */ void SISAdjustFrame(ADJUST_FRAME_ARGS_DECL) { SCRN_INFO_PTR(arg); SISPtr pSiS = SISPTR(pScrn); ULong base; UChar temp, cr11backup; #ifdef SISMERGED if(pSiS->MergedFB) { SISAdjustFrameMerged(ADJUST_FRAME_ARGS(pScrn, x, y)); return; } #endif if(pSiS->UseVESA) { VBESetDisplayStart(pSiS->pVbe, x, y, TRUE); return; } if(pScrn->bitsPerPixel < 8) { base = (y * pSiS->CurrentLayout.displayWidth + x + 3) >> 3; } else { base = y * pSiS->CurrentLayout.displayWidth + x; /* calculate base bpp dep. */ switch(pSiS->CurrentLayout.bitsPerPixel) { case 16: base >>= 1; break; case 24: base = ((base * 3)) >> 2; base -= base % 6; break; case 32: break; default: /* 8bpp */ base >>= 2; break; } } #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif base += (pSiS->dhmOffset/4); #ifdef TWDEBUG xf86DrvMsg(0, 0, "AdjustFrame: x %d y %d bpp %d dw %d base %d, dhmOffset %d\n", x, y, pSiS->CurrentLayout.bitsPerPixel, pSiS->CurrentLayout.displayWidth, base, pSiS->dhmOffset); #endif #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(!pSiS->SecondHead) { /* Head 1 (master) is always CRT2 */ SISSetStartAddressCRT2(pSiS, base); } else { /* Head 2 (slave) is always CRT1 */ SISSetStartAddressCRT1(pSiS, base); } } else { #endif switch(pSiS->VGAEngine) { case SIS_300_VGA: case SIS_315_VGA: SISSetStartAddressCRT1(pSiS, base); if(pSiS->VBFlags & CRT2_ENABLE) { if(!SiSBridgeIsInSlaveMode(pScrn)) { SISSetStartAddressCRT2(pSiS, base); } } break; default: /* Unlock CRTC registers */ inSISIDXREG(SISCR, 0x11, cr11backup); andSISIDXREG(SISCR, 0x11, 0x7F); outSISIDXREG(SISCR, 0x0D, base & 0xFF); outSISIDXREG(SISCR, 0x0C, (base >> 8) & 0xFF); inSISIDXREG(SISSR, 0x27, temp); temp &= 0xF0; temp |= (base & 0x0F0000) >> 16; outSISIDXREG(SISSR, 0x27, temp); /* Eventually lock CRTC registers */ setSISIDXREG(SISCR, 0x11, 0x7F, (cr11backup & 0x80)); } #ifdef SISDUALHEAD } #endif } /* * This is called when VT switching back to the X server. Its job is * to reinitialise the video mode. * Mandatory! */ static Bool SISEnterVT(VT_FUNC_ARGS_DECL) { SCRN_INFO_PTR(arg); SISPtr pSiS = SISPTR(pScrn); SiS_SiSFB_Lock(pScrn, TRUE); sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { outSISIDXREG(SISCR,0x32,pSiS->myCR32); outSISIDXREG(SISCR,0x36,pSiS->myCR36); outSISIDXREG(SISCR,0x37,pSiS->myCR37); } if(!SISModeInit(pScrn, pScrn->currentMode)) { SISErrorLog(pScrn, "SiSEnterVT: SISModeInit() failed\n"); return FALSE; } SISAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); #ifdef SISDRI if(pSiS->directRenderingEnabled) { DRIUnlock(xf86ScrnToScreen(pScrn)); } #endif #ifdef SISDUALHEAD if((!pSiS->DualHeadMode) || (!pSiS->SecondHead)) #endif if(pSiS->ResetXv) { (pSiS->ResetXv)(pScrn); } return TRUE; } /* * This is called when VT switching away from the X server. Its job is * to restore the previous (text) mode. * Mandatory! */ static void SISLeaveVT(VT_FUNC_ARGS_DECL) { SCRN_INFO_PTR(arg); SISPtr pSiS = SISPTR(pScrn); #ifdef SISDRI ScreenPtr pScreen; if(pSiS->directRenderingEnabled) { pScreen = xf86ScrnToScreen(pScrn); DRILock(pScreen, 0); } #endif #ifdef SISDUALHEAD if(pSiS->DualHeadMode && pSiS->SecondHead) return; #endif if(pSiS->CursorInfoPtr) { #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(!pSiS->SecondHead) { pSiS->ForceCursorOff = TRUE; pSiS->CursorInfoPtr->HideCursor(pScrn); SISWaitVBRetrace(pScrn); pSiS->ForceCursorOff = FALSE; } } else { #endif pSiS->CursorInfoPtr->HideCursor(pScrn); SISWaitVBRetrace(pScrn); #ifdef SISDUALHEAD } #endif } SISBridgeRestore(pScrn); if(pSiS->UseVESA) { /* This is a q&d work-around for a BIOS bug. In case we disabled CRT2, * VBESaveRestore() does not restore CRT1. So we set any mode now, * because VBESetVBEMode correctly restores CRT1. Afterwards, we * can call VBESaveRestore to restore original mode. */ if((pSiS->VBFlags2 & VB2_VIDEOBRIDGE) && (!(pSiS->VBFlags & DISPTYPE_DISP2))) VBESetVBEMode(pSiS->pVbe, (pSiS->SISVESAModeList->n) | 0xc000, NULL); SISVESARestore(pScrn); } else { SISRestore(pScrn); } /* We use (otherwise unused) bit 7 to indicate that we are running * to keep sisfb to change the displaymode (this would result in * lethal display corruption upon quitting X or changing to a VT * until a reboot) */ if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { orSISIDXREG(SISCR,0x34,0x80); } SISVGALock(pSiS); SiS_SiSFB_Lock(pScrn, FALSE); } /* * This is called at the end of each server generation. It restores the * original (text) mode. It should really also unmap the video memory too. * Mandatory! */ static Bool SISCloseScreen(CLOSE_SCREEN_ARGS_DECL) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif if(pSiS->SiSCtrlExtEntry) { SiSCtrlExtUnregister(pSiS, pScrn->scrnIndex); } #ifdef SISDRI if(pSiS->directRenderingEnabled) { SISDRICloseScreen(pScreen); pSiS->directRenderingEnabled = FALSE; } #endif if(pScrn->vtSema) { if(pSiS->CursorInfoPtr) { #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(!pSiS->SecondHead) { pSiS->ForceCursorOff = TRUE; pSiS->CursorInfoPtr->HideCursor(pScrn); SISWaitVBRetrace(pScrn); pSiS->ForceCursorOff = FALSE; } } else { #endif pSiS->CursorInfoPtr->HideCursor(pScrn); SISWaitVBRetrace(pScrn); #ifdef SISDUALHEAD } #endif } SISBridgeRestore(pScrn); if(pSiS->UseVESA) { /* This is a q&d work-around for a BIOS bug. In case we disabled CRT2, * VBESaveRestore() does not restore CRT1. So we set any mode now, * because VBESetVBEMode correctly restores CRT1. Afterwards, we * can call VBESaveRestore to restore original mode. */ if((pSiS->VBFlags2 & VB2_VIDEOBRIDGE) && (!(pSiS->VBFlags & DISPTYPE_DISP2))) VBESetVBEMode(pSiS->pVbe, (pSiS->SISVESAModeList->n) | 0xc000, NULL); SISVESARestore(pScrn); } else { SISRestore(pScrn); } SISVGALock(pSiS); } SiS_SiSFB_Lock(pScrn, FALSE); /* We should restore the mode number in case vtsema = false as well, * but since we haven't register access then we can't do it. I think * I need to rework the save/restore stuff, like saving the video * status when returning to the X server and by that save me the * trouble if sisfb was started from a textmode VT while X was on. */ SISUnmapMem(pScrn); #ifdef SIS_PC_PLATFORM SiSVGAUnmapMem(pScrn); #endif #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiSEnt = pSiS->entityPrivate; pSiSEnt->refCount--; } #endif if(pSiS->pInt) { xf86FreeInt10(pSiS->pInt); pSiS->pInt = NULL; } #ifdef SIS_USE_XAA if(!pSiS->useEXA) { if(pSiS->AccelLinearScratch) { xf86FreeOffscreenLinear(pSiS->AccelLinearScratch); pSiS->AccelLinearScratch = NULL; } if(pSiS->AccelInfoPtr) { XAADestroyInfoRec(pSiS->AccelInfoPtr); pSiS->AccelInfoPtr = NULL; } } #endif #ifdef SIS_USE_EXA if(pSiS->useEXA) { if(pSiS->EXADriverPtr) { exaDriverFini(pScreen); free(pSiS->EXADriverPtr); pSiS->EXADriverPtr = NULL; pSiS->exa_scratch = NULL; } } #endif if(pSiS->CursorInfoPtr) { xf86DestroyCursorInfoRec(pSiS->CursorInfoPtr); pSiS->CursorInfoPtr = NULL; } if(pSiS->ShadowPtr) { free(pSiS->ShadowPtr); pSiS->ShadowPtr = NULL; } if(pSiS->DGAModes) { free(pSiS->DGAModes); pSiS->DGAModes = NULL; } if(pSiS->adaptor) { free(pSiS->adaptor); pSiS->adaptor = NULL; pSiS->ResetXv = pSiS->ResetXvGamma = pSiS->ResetXvDisplay = NULL; } if(pSiS->blitadaptor) { free(pSiS->blitadaptor); pSiS->blitadaptor = NULL; } if(pSiS->crt2gcolortable) { free(pSiS->crt2gcolortable); pSiS->crt2gcolortable = NULL; } if(pSiS->crt2cindices) { free(pSiS->crt2cindices); pSiS->crt2cindices = NULL; } pScrn->vtSema = FALSE; /* Restore Blockhandler */ pScreen->BlockHandler = pSiS->BlockHandler; pScreen->CloseScreen = pSiS->CloseScreen; return(*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS); } /* Free up any per-generation data structures */ /* Optional */ static void SISFreeScreen(FREE_SCREEN_ARGS_DECL) { SCRN_INFO_PTR(arg); #ifdef SIS_NEED_MAP_IOP SISPtr pSiS = SISPTR(pScrn); if(pSiS) { #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt) { pSiSEnt->forceUnmapIOPBase = TRUE; } #endif SISUnmapIOPMem(pScrn); } #endif SISFreeRec(pScrn); } /* Checks if a mode is suitable for the selected chipset. */ static ModeStatus SISValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) { SCRN_INFO_PTR(arg); SISPtr pSiS = SISPTR(pScrn); if(pSiS->UseVESA) { if(SiSCalcVESAModeIndex(pScrn, mode)) return(MODE_OK); else return(MODE_BAD); } if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiS->SecondHead) { if(SiS_CheckModeCRT1(pScrn, mode, pSiS->VBFlags, pSiS->HaveCustomModes) < 0x14) return(MODE_BAD); } else { if(SiS_CheckModeCRT2(pScrn, mode, pSiS->VBFlags, pSiS->HaveCustomModes) < 0x14) return(MODE_BAD); } } else #endif #ifdef SISMERGED if(pSiS->MergedFB) { if(!mode->Private) { if(!pSiS->CheckForCRT2) { if(SiS_CheckModeCRT1(pScrn, mode, pSiS->VBFlags, pSiS->HaveCustomModes) < 0x14) return(MODE_BAD); } else { if(SiS_CheckModeCRT2(pScrn, mode, pSiS->VBFlags, pSiS->HaveCustomModes2) < 0x14) return(MODE_BAD); } } else { if(SiS_CheckModeCRT1(pScrn, ((SiSMergedDisplayModePtr)mode->Private)->CRT1, pSiS->VBFlags, pSiS->HaveCustomModes) < 0x14) return(MODE_BAD); if(SiS_CheckModeCRT2(pScrn, ((SiSMergedDisplayModePtr)mode->Private)->CRT2, pSiS->VBFlags, pSiS->HaveCustomModes2) < 0x14) return(MODE_BAD); } } else #endif { if(SiS_CheckModeCRT1(pScrn, mode, pSiS->VBFlags, pSiS->HaveCustomModes) < 0x14) return(MODE_BAD); if(SiS_CheckModeCRT2(pScrn, mode, pSiS->VBFlags, pSiS->HaveCustomModes) < 0x14) return(MODE_BAD); } } return(MODE_OK); } #ifdef DEBUG static void SiSDumpModeInfo(ScrnInfoPtr pScrn, DisplayModePtr mode) { xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Clock : %x\n", mode->Clock); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Hz Display : %x\n", mode->CrtcHDisplay); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Hz Blank Start : %x\n", mode->CrtcHBlankStart); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Hz Sync Start : %x\n", mode->CrtcHSyncStart); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Hz Sync End : %x\n", mode->CrtcHSyncEnd); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Hz Blank End : %x\n", mode->CrtcHBlankEnd); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Hz Total : %x\n", mode->CrtcHTotal); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Hz Skew : %x\n", mode->CrtcHSkew); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Hz HAdjusted : %x\n", mode->CrtcHAdjusted); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Vt Display : %x\n", mode->CrtcVDisplay); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Vt Blank Start : %x\n", mode->CrtcVBlankStart); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Vt Sync Start : %x\n", mode->CrtcVSyncStart); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Vt Sync End : %x\n", mode->CrtcVSyncEnd); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Vt Blank End : %x\n", mode->CrtcVBlankEnd); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Vt Total : %x\n", mode->CrtcVTotal); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Vt VAdjusted : %x\n", mode->CrtcVAdjusted); } #endif static void SISModifyModeInfo(DisplayModePtr mode) { if(mode->CrtcHBlankStart == mode->CrtcHDisplay) mode->CrtcHBlankStart++; if(mode->CrtcHBlankEnd == mode->CrtcHTotal) mode->CrtcHBlankEnd--; if(mode->CrtcVBlankStart == mode->CrtcVDisplay) mode->CrtcVBlankStart++; if(mode->CrtcVBlankEnd == mode->CrtcVTotal) mode->CrtcVBlankEnd--; } /* Enable the Turboqueue/Commandqueue (For 300 and 315/330/340 series only) */ static void SiSEnableTurboQueue(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); UShort SR26, SR27; ULong temp; switch(pSiS->VGAEngine) { case SIS_300_VGA: if((!pSiS->NoAccel) && (pSiS->TurboQueue)) { /* TQ size is always 512k */ temp = (pScrn->videoRam/64) - 8; SR26 = temp & 0xFF; inSISIDXREG(SISSR, 0x27, SR27); SR27 &= 0xFC; SR27 |= (0xF0 | ((temp >> 8) & 3)); outSISIDXREG(SISSR, 0x26, SR26); outSISIDXREG(SISSR, 0x27, SR27); } break; case SIS_315_VGA: if(!pSiS->NoAccel) { /* On 315/330/340 series, there are three queue modes available * which are chosen by setting bits 7:5 in SR26: * 1. MMIO queue mode (bit 5, 0x20). The hardware will keep * track of the queue, the FIFO, command parsing and so * on. This is the one comparable to the 300 series. * 2. VRAM queue mode (bit 6, 0x40). In this case, one will * have to do queue management himself. * 3. AGP queue mode (bit 7, 0x80). Works as 2., but keeps the * queue in AGP memory space. * We go VRAM or MMIO here. * SR26 bit 4 is called "Bypass H/W queue". * SR26 bit 1 is called "Enable Command Queue Auto Correction" * SR26 bit 0 resets the queue * Size of queue memory is encoded in bits 3:2 like this: * 00 (0x00) 512K * 01 (0x04) 1M * 10 (0x08) 2M * 11 (0x0C) 4M * The queue location is to be written to 0x85C0. */ #ifdef SISVRAMQ /* We use VRAM Cmd Queue, not MMIO or AGP */ UChar tempCR55 = 0; /* Set Command Queue Threshold to max value 11111b (?) */ outSISIDXREG(SISSR, 0x27, 0x1F); /* Disable queue flipping */ inSISIDXREG(SISCR, 0x55, tempCR55); andSISIDXREG(SISCR, 0x55, 0x33); /* Synchronous reset for Command Queue */ outSISIDXREG(SISSR, 0x26, 0x01); SIS_MMIO_OUT32(pSiS->IOBase, 0x85c4, 0); /* Enable VRAM Command Queue mode */ if(pSiS->ChipType == XGI_20) { /* On XGI_20, always 128K */ SR26 = 0x40 | 0x04 | 0x01; } else { switch(pSiS->cmdQueueSize) { case 1*1024*1024: SR26 = (0x40 | 0x04 | 0x01); break; case 2*1024*1024: SR26 = (0x40 | 0x08 | 0x01); break; case 4*1024*1024: SR26 = (0x40 | 0x0C | 0x01); break; default: pSiS->cmdQueueSize = 512 * 1024; case 512*1024: SR26 = (0x40 | 0x00 | 0x01); } } outSISIDXREG(SISSR, 0x26, SR26); SR26 &= 0xfe; outSISIDXREG(SISSR, 0x26, SR26); *(pSiS->cmdQ_SharedWritePort) = (unsigned int)(SIS_MMIO_IN32(pSiS->IOBase, 0x85c8)); SIS_MMIO_OUT32(pSiS->IOBase, 0x85c4, (CARD32)(*(pSiS->cmdQ_SharedWritePort))); SIS_MMIO_OUT32(pSiS->IOBase, 0x85C0, pSiS->cmdQueueOffset); temp = (ULong)pSiS->RealFbBase; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { SISEntPtr pSiSEnt = pSiS->entityPrivate; temp = (ULong)pSiSEnt->RealFbBase; } #endif temp += pSiS->cmdQueueOffset; pSiS->cmdQueueBase = (unsigned int *)temp; outSISIDXREG(SISCR, 0x55, tempCR55); #ifdef TWDEBUG xf86DrvMsg(0, 0, "CmdQueueOffs 0x%x, CmdQueueAdd %p, shwrp 0x%x, status %x, base %p\n", pSiS->cmdQueueOffset, pSiS->cmdQueueBase, *(pSiS->cmdQ_SharedWritePort), SIS_MMIO_IN32(pSiS->IOBase, 0x85cc), (ULong *)temp); #endif #else /* For MMIO */ /* Syncronous reset for Command Queue */ orSISIDXREG(SISSR, 0x26, 0x01); /* Set Command Queue Threshold to max value 11111b */ outSISIDXREG(SISSR, 0x27, 0x1F); /* Do some magic (cp readport to writeport) */ temp = SIS_MMIO_IN32(pSiS->IOBase, 0x85C8); SIS_MMIO_OUT32(pSiS->IOBase, 0x85C4, temp); /* Enable MMIO Command Queue mode (0x20), * Enable_command_queue_auto_correction (0x02) * (no idea, but sounds good, so use it) * 512k (0x00) (does this apply to MMIO mode?) */ outSISIDXREG(SISSR, 0x26, 0x22); /* Calc Command Queue position (Q is always 512k)*/ temp = (pScrn->videoRam - 512) * 1024; /* Set Q position */ SIS_MMIO_OUT32(pSiS->IOBase, 0x85C0, temp); #endif } break; default: break; } } #ifdef SISVRAMQ static void SiSRestoreQueueMode(SISPtr pSiS, SISRegPtr sisReg) { UChar tempCR55=0; if(pSiS->VGAEngine == SIS_315_VGA) { inSISIDXREG(SISCR,0x55,tempCR55); andSISIDXREG(SISCR,0x55,0x33); outSISIDXREG(SISSR,0x26,0x01); SIS_MMIO_OUT32(pSiS->IOBase, 0x85c4, 0); outSISIDXREG(SISSR,0x27,sisReg->sisRegs3C4[0x27]); outSISIDXREG(SISSR,0x26,sisReg->sisRegs3C4[0x26]); SIS_MMIO_OUT32(pSiS->IOBase, 0x85C0, sisReg->sisMMIO85C0); outSISIDXREG(SISCR,0x55,tempCR55); } } #endif /* Things to do before a ModeSwitch. We set up the * video bridge configuration and the TurboQueue. */ void SiSPreSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int viewmode) { SISPtr pSiS = SISPTR(pScrn); UChar CR30, CR31, CR32, CR33; UChar CR39 = 0, CR3B = 0; UChar CR17, CR38 = 0; UChar CR35 = 0, CR79 = 0; int temp = 0, crt1rateindex = 0; ULong vbflag = pSiS->VBFlags; Bool hcm = pSiS->HaveCustomModes; DisplayModePtr mymode = mode; pSiS->IsCustom = FALSE; /* NEVER call this with viewmode = SIS_MODE_SIMU * if mode->type is not M_T_DEFAULT! */ #ifdef SISMERGED if(pSiS->MergedFB) { switch(viewmode) { case SIS_MODE_CRT1: mymode = ((SiSMergedDisplayModePtr)mode->Private)->CRT1; break; case SIS_MODE_CRT2: mymode = ((SiSMergedDisplayModePtr)mode->Private)->CRT2; hcm = pSiS->HaveCustomModes2; } } #endif switch(viewmode) { case SIS_MODE_CRT1: if(SiS_CheckModeCRT1(pScrn, mymode, vbflag, hcm) == 0xfe) { pSiS->IsCustom = TRUE; } break; case SIS_MODE_CRT2: if(vbflag & CRT2_ENABLE) { if(SiS_CheckModeCRT2(pScrn, mymode, vbflag, hcm) == 0xfe) { pSiS->IsCustom = TRUE; } } else { /* This can only happen in mirror mode */ if(SiS_CheckModeCRT1(pScrn, mymode, vbflag, hcm) == 0xfe) { pSiS->IsCustom = TRUE; } } } #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); /* Unlock Registers */ #endif inSISIDXREG(SISCR, 0x30, CR30); inSISIDXREG(SISCR, 0x31, CR31); CR32 = pSiS->newCR32; inSISIDXREG(SISCR, 0x33, CR33); if(pSiS->NewCRLayout) { inSISIDXREG(SISCR, 0x35, CR35); inSISIDXREG(SISCR, 0x38, CR38); inSISIDXREG(SISCR, 0x39, CR39); xf86DrvMsgVerb(pScrn->scrnIndex, X_PROBED, SISVERBLEVEL, "Before: CR30=0x%02x,CR31=0x%02x,CR32=0x%02x,CR33=0x%02x,CR35=0x%02x,CR38=0x%02x\n", CR30, CR31, CR32, CR33, CR35, CR38); CR38 &= ~0x07; } else { if(pSiS->Chipset != PCI_CHIP_SIS300) { switch(pSiS->VGAEngine) { case SIS_300_VGA: temp = 0x35; break; case SIS_315_VGA: temp = 0x38; break; } if(temp) inSISIDXREG(SISCR, temp, CR38); } if(pSiS->VGAEngine == SIS_315_VGA) { inSISIDXREG(SISCR, 0x79, CR79); CR38 &= ~0x3b; /* Clear LCDA/DualEdge and YPbPr bits */ } inSISIDXREG(SISCR, 0x3b, CR3B); xf86DrvMsgVerb(pScrn->scrnIndex, X_PROBED, SISVERBLEVEL, "Before: CR30=0x%02x, CR31=0x%02x, CR32=0x%02x, CR33=0x%02x, CR%02x=0x%02x\n", CR30, CR31, CR32, CR33, temp, CR38); } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, SISVERBLEVEL, "VBFlags=0x%x\n", pSiS->VBFlags); CR30 = 0x00; CR31 &= ~0x60; /* Clear VB_Drivermode & VB_OutputDisable */ CR31 |= 0x04; /* Set VB_NotSimuMode (not for 30xB/1400x1050?) */ CR35 = 0x00; if(!pSiS->NewCRLayout) { if(!pSiS->AllowHotkey) { CR31 |= 0x80; /* Disable hotkey-switch */ } CR79 &= ~0x10; /* Enable Backlight control on 315 series */ } SiS_SetEnableDstn(pSiS->SiS_Pr, FALSE); SiS_SetEnableFstn(pSiS->SiS_Pr, FALSE); if((vbflag & CRT1_LCDA) && (viewmode == SIS_MODE_CRT1)) { CR38 |= 0x02; } else { switch(vbflag & (CRT2_TV|CRT2_LCD|CRT2_VGA)) { case CRT2_TV: CR38 &= ~0xC0; /* Clear Pal M/N bits */ if((pSiS->VBFlags2 & VB2_CHRONTEL) && (vbflag & TV_CHSCART)) { /* Chrontel */ CR30 |= 0x10; CR38 |= 0x04; CR38 &= ~0x08; CR31 |= 0x01; } else if((pSiS->VBFlags2 & VB2_CHRONTEL) && (vbflag & TV_CHYPBPR525I)) { /* Chrontel */ CR38 |= 0x08; CR38 &= ~0x04; CR31 &= ~0x01; } else if(vbflag & TV_HIVISION) { /* SiS bridge */ if(pSiS->NewCRLayout) { CR38 |= 0x04; CR35 |= 0x60; } else { CR30 |= 0x80; if(pSiS->VGAEngine == SIS_315_VGA) { if(pSiS->VBFlags2 & VB2_SISYPBPRBRIDGE) { CR38 |= (0x08 | 0x30); } } } CR31 |= 0x01; CR35 |= 0x01; } else if(vbflag & TV_YPBPR) { /* SiS bridge */ if(pSiS->NewCRLayout) { CR38 |= 0x04; CR31 &= ~0x01; CR35 &= ~0x01; if(vbflag & (TV_YPBPR525P | TV_YPBPR625P)) CR35 |= 0x20; else if(vbflag & TV_YPBPR750P) CR35 |= 0x40; else if(vbflag & TV_YPBPR1080I) CR35 |= 0x60; if(vbflag & (TV_YPBPR625I | TV_YPBPR625P)) { CR31 |= 0x01; CR35 |= 0x01; } CR39 &= ~0x03; if((vbflag & TV_YPBPRAR) == TV_YPBPR43LB) CR39 |= 0x00; else if((vbflag & TV_YPBPRAR) == TV_YPBPR43) CR39 |= 0x01; else if((vbflag & TV_YPBPRAR) == TV_YPBPR169) CR39 |= 0x02; else CR39 |= 0x03; } else if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTYPBPR) { CR30 |= 0x80; CR38 |= 0x08; CR31 &= ~0x01; if(vbflag & (TV_YPBPR525P|TV_YPBPR625P)) CR38 |= 0x10; else if(vbflag & TV_YPBPR750P) CR38 |= 0x20; else if(vbflag & TV_YPBPR1080I) CR38 |= 0x30; if(vbflag & (TV_YPBPR625I | TV_YPBPR625P)) CR31 |= 0x01; if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTYPBPRAR) { CR3B &= ~0x03; if((vbflag & TV_YPBPRAR) == TV_YPBPR43LB) CR3B |= 0x00; else if((vbflag & TV_YPBPRAR) == TV_YPBPR43) CR3B |= 0x03; else if((vbflag & TV_YPBPRAR) == TV_YPBPR169) CR3B |= 0x01; else CR3B |= 0x03; } } } else { /* All */ if(vbflag & TV_SCART) CR30 |= 0x10; if(vbflag & TV_SVIDEO) CR30 |= 0x08; if(vbflag & TV_AVIDEO) CR30 |= 0x04; if(!(CR30 & 0x1C)) CR30 |= 0x08; /* default: SVIDEO */ if(vbflag & TV_PAL) { CR31 |= 0x01; CR35 |= 0x01; if( (pSiS->VBFlags2 & VB2_SISBRIDGE) || ((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->ChrontelType == CHRONTEL_701x)) ) { if(vbflag & TV_PALM) { CR38 |= 0x40; CR35 |= 0x04; } else if(vbflag & TV_PALN) { CR38 |= 0x80; CR35 |= 0x08; } } } else { CR31 &= ~0x01; CR35 &= ~0x01; if(vbflag & TV_NTSCJ) { CR38 |= 0x40; /* TW, not BIOS */ CR35 |= 0x02; } } if(vbflag & TV_SCART) { CR31 |= 0x01; CR35 |= 0x01; } } CR31 &= ~0x04; /* Clear NotSimuMode */ pSiS->SiS_Pr->SiS_CHOverScan = pSiS->UseCHOverScan; if((pSiS->OptTVSOver == 1) && (pSiS->ChrontelType == CHRONTEL_700x)) { pSiS->SiS_Pr->SiS_CHSOverScan = TRUE; } else { pSiS->SiS_Pr->SiS_CHSOverScan = FALSE; } #ifdef SIS_CP SIS_CP_DRIVER_CONFIG #endif break; case CRT2_LCD: CR30 |= 0x20; SiS_SetEnableDstn(pSiS->SiS_Pr, pSiS->DSTN); SiS_SetEnableFstn(pSiS->SiS_Pr, pSiS->FSTN); break; case CRT2_VGA: CR30 |= 0x40; break; default: CR30 |= 0x00; CR31 |= 0x20; /* VB_OUTPUT_DISABLE */ if(pSiS->UseVESA) { crt1rateindex = SISSearchCRT1Rate(pScrn, mymode); } } } if(vbflag & CRT1_LCDA) { switch(viewmode) { case SIS_MODE_CRT1: CR38 |= 0x01; break; case SIS_MODE_CRT2: if(vbflag & (CRT2_TV|CRT2_VGA)) { CR30 |= 0x02; CR38 |= 0x01; } else { CR38 |= 0x03; } break; case SIS_MODE_SIMU: default: if(vbflag & (CRT2_TV|CRT2_LCD|CRT2_VGA)) { CR30 |= 0x01; } break; } } else { if(vbflag & (CRT2_TV|CRT2_LCD|CRT2_VGA)) { CR30 |= 0x01; } } if(pSiS->UseVESA) { CR31 &= ~0x40; /* Clear Drivermode */ CR31 |= 0x06; /* Set SlaveMode, Enable SimuMode in Slavemode */ #ifdef TWDEBUG CR31 |= 0x40; /* DEBUG (for non-slave mode VESA) */ crt1rateindex = SISSearchCRT1Rate(pScrn, mymode); #endif } else { CR31 |= 0x40; /* Set Drivermode */ CR31 &= ~0x06; /* Disable SlaveMode, disable SimuMode in SlaveMode */ if(!pSiS->IsCustom) { crt1rateindex = SISSearchCRT1Rate(pScrn, mymode); } } switch(viewmode) { case SIS_MODE_SIMU: CR33 = 0; if(!(vbflag & CRT1_LCDA)) { CR33 |= (crt1rateindex & 0x0f); } if(vbflag & CRT2_VGA) { CR33 |= ((crt1rateindex & 0x0f) << 4); } break; case SIS_MODE_CRT1: CR33 &= 0xf0; if(!(vbflag & CRT1_LCDA)) { CR33 |= (crt1rateindex & 0x0f); } break; case SIS_MODE_CRT2: CR33 &= 0x0f; if(vbflag & CRT2_VGA) { CR33 |= ((crt1rateindex & 0x0f) << 4); } break; } if((!pSiS->UseVESA) && (vbflag & CRT2_ENABLE)) { if(pSiS->CRT1off) CR33 &= 0xf0; } if(pSiS->NewCRLayout) { CR31 &= 0xfe; /* Clear PAL flag (now in CR35) */ CR38 &= 0x07; /* Use only LCDA and HiVision/YPbPr bits */ outSISIDXREG(SISCR, 0x30, CR30); outSISIDXREG(SISCR, 0x31, CR31); outSISIDXREG(SISCR, 0x33, CR33); outSISIDXREG(SISCR, 0x35, CR35); setSISIDXREG(SISCR, 0x38, 0xf8, CR38); outSISIDXREG(SISCR, 0x39, CR39); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, SISVERBLEVEL, "After: CR30=0x%02x,CR31=0x%02x,CR33=0x%02x,CR35=0x%02x,CR38=%02x\n", CR30, CR31, CR33, CR35, CR38); } else { outSISIDXREG(SISCR, 0x30, CR30); outSISIDXREG(SISCR, 0x31, CR31); outSISIDXREG(SISCR, 0x33, CR33); if(temp) { outSISIDXREG(SISCR, temp, CR38); } if(pSiS->VGAEngine == SIS_315_VGA) { outSISIDXREG(SISCR, 0x3b, CR3B); outSISIDXREG(SISCR, 0x79, CR79); } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, SISVERBLEVEL, "After: CR30=0x%02x,CR31=0x%02x,CR33=0x%02x,CR%02x=%02x\n", CR30, CR31, CR33, temp, CR38); } pSiS->SiS_Pr->SiS_UseOEM = pSiS->OptUseOEM; /* Enable TurboQueue */ #ifdef SISVRAMQ if(pSiS->VGAEngine != SIS_315_VGA) #endif SiSEnableTurboQueue(pScrn); if((!pSiS->UseVESA) && (pSiS->VBFlags & CRT2_ENABLE)) { /* Switch on CRT1 for modes that require the bridge in SlaveMode */ andSISIDXREG(SISSR,0x1f,0x3f); inSISIDXREG(SISCR, 0x17, CR17); if(!(CR17 & 0x80)) { orSISIDXREG(SISCR, 0x17, 0x80); outSISIDXREG(SISSR, 0x00, 0x01); usleep(10000); outSISIDXREG(SISSR, 0x00, 0x03); } } } /* Functions for adjusting various TV settings */ /* These are used by the PostSetMode() functions as well as * the display properties tool SiSCtrl. * * There is each a Set and a Get routine. The Set functions * take a value of the same range as the corresponding option. * The Get routines return a value of the same range (although * not necessarily the same value as previously set because * of the lower resolution of the respective setting compared * to the valid range). * The Get routines return -2 on error (eg. hardware does not * support this setting). * Note: The x and y positioning routines accept a position * RELATIVE to the default position. All other routines * take ABSOLUTE values. * * The Set functions will store the property regardless if TV is * currently used or not and if the hardware supports the property * or not. The Get routines will return this stored * value if TV is not currently used (because the register does * not contain the correct value then) or if the hardware supports * the respective property. This should make it easier for the * display property tool because it does not have to know the * hardware features. * * All the routines are dual head aware. It does not matter * if the function is called from the CRT1 or CRT2 session. * The values will be in pSiSEnt anyway, and read from there * if we're running dual head. */ void SiS_SetCHTVlumabandwidthcvbs(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->chtvlumabandwidthcvbs = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->chtvlumabandwidthcvbs = val; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_CHRONTEL)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: val /= 8; if((val == 0) || (val == 1)) { SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x03, val, 0xFE); } break; case CHRONTEL_701x: val /= 4; if((val >= 0) && (val <= 3)) { SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x02, val, 0xFC); } break; } } int SiS_GetCHTVlumabandwidthcvbs(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif if(!((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->VBFlags & CRT2_TV))) { #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->chtvlumabandwidthcvbs; else #endif return (int)pSiS->chtvlumabandwidthcvbs; } else { #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: return (int)((SiS_GetCH70xx(pSiS->SiS_Pr, 0x03) & 0x01) * 8); case CHRONTEL_701x: return (int)((SiS_GetCH70xx(pSiS->SiS_Pr, 0x02) & 0x03) * 4); default: return (int)pSiS->chtvlumabandwidthcvbs; } } } void SiS_SetCHTVlumabandwidthsvideo(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->chtvlumabandwidthsvideo = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->chtvlumabandwidthsvideo = val; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_CHRONTEL)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: val /= 6; if((val >= 0) && (val <= 2)) { SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x03, (val << 1), 0xF9); } break; case CHRONTEL_701x: val /= 4; if((val >= 0) && (val <= 3)) { SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x02, (val << 2), 0xF3); } break; } } int SiS_GetCHTVlumabandwidthsvideo(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif if(!((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->VBFlags & CRT2_TV))) { #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->chtvlumabandwidthsvideo; else #endif return (int)pSiS->chtvlumabandwidthsvideo; } else { #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: return (int)(((SiS_GetCH70xx(pSiS->SiS_Pr, 0x03) & 0x06) >> 1) * 6); case CHRONTEL_701x: return (int)(((SiS_GetCH70xx(pSiS->SiS_Pr, 0x02) & 0x0c) >> 2) * 4); default: return (int)pSiS->chtvlumabandwidthsvideo; } } } void SiS_SetCHTVlumaflickerfilter(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->chtvlumaflickerfilter = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->chtvlumaflickerfilter = val; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_CHRONTEL)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: val /= 6; if((val >= 0) && (val <= 2)) { UShort reg = 0; reg = SiS_GetCH70xx(pSiS->SiS_Pr, 0x01); reg = (reg & 0xf0) | ((reg & 0x0c) >> 2) | (val << 2); SiS_SetCH70xx(pSiS->SiS_Pr, 0x01, reg); } break; case CHRONTEL_701x: val /= 4; if((val >= 0) && (val <= 3)) { SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x01, (val << 2), 0xF3); } break; } } int SiS_GetCHTVlumaflickerfilter(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif if(!((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->VBFlags & CRT2_TV))) { #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->chtvlumaflickerfilter; else #endif return (int)pSiS->chtvlumaflickerfilter; } else { #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: return (int)((SiS_GetCH70xx(pSiS->SiS_Pr, 0x01) & 0x03) * 6); case CHRONTEL_701x: return (int)(((SiS_GetCH70xx(pSiS->SiS_Pr, 0x01) & 0x0c) >> 2) * 4); default: return (int)pSiS->chtvlumaflickerfilter; } } } void SiS_SetCHTVchromabandwidth(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->chtvchromabandwidth = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->chtvchromabandwidth = val; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_CHRONTEL)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: val /= 4; if((val >= 0) && (val <= 3)) { SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x03, (val << 4), 0xCF); } break; case CHRONTEL_701x: val /= 8; if((val >= 0) && (val <= 1)) { SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x02, (val << 4), 0xEF); } break; } } int SiS_GetCHTVchromabandwidth(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif if(!((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->VBFlags & CRT2_TV))) { #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->chtvchromabandwidth; else #endif return (int)pSiS->chtvchromabandwidth; } else { #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: return (int)(((SiS_GetCH70xx(pSiS->SiS_Pr, 0x03) & 0x30) >> 4) * 4); case CHRONTEL_701x: return (int)(((SiS_GetCH70xx(pSiS->SiS_Pr, 0x02) & 0x10) >> 4) * 8); default: return (int)pSiS->chtvchromabandwidth; } } } void SiS_SetCHTVchromaflickerfilter(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->chtvchromaflickerfilter = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->chtvchromaflickerfilter = val; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_CHRONTEL)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: val /= 6; if((val >= 0) && (val <= 2)) { UShort reg = 0; reg = SiS_GetCH70xx(pSiS->SiS_Pr, 0x01); reg = (reg & 0xc0) | ((reg & 0x0c) >> 2) | ((reg & 0x03) << 2) | (val << 4); SiS_SetCH70xx(pSiS->SiS_Pr, 0x01, reg); } break; case CHRONTEL_701x: val /= 4; if((val >= 0) && (val <= 3)) { SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x01, (val << 4), 0xCF); } break; } } int SiS_GetCHTVchromaflickerfilter(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif if(!((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->VBFlags & CRT2_TV))) { #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->chtvchromaflickerfilter; else #endif return (int)pSiS->chtvchromaflickerfilter; } else { #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: return (int)(((SiS_GetCH70xx(pSiS->SiS_Pr, 0x01) & 0x30) >> 4) * 6); case CHRONTEL_701x: return (int)(((SiS_GetCH70xx(pSiS->SiS_Pr, 0x01) & 0x30) >> 4) * 4); default: return (int)pSiS->chtvchromaflickerfilter; } } } void SiS_SetCHTVcvbscolor(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->chtvcvbscolor = val ? 1 : 0; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->chtvcvbscolor = pSiS->chtvcvbscolor; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_CHRONTEL)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: if(!val) SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x03, 0x40, 0x00); else SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x03, 0x00, ~0x40); break; case CHRONTEL_701x: if(!val) SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x02, 0x00, ~0x20); else SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x02, 0x20, 0x00); break; } } int SiS_GetCHTVcvbscolor(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif if(!((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->VBFlags & CRT2_TV))) { #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->chtvcvbscolor; else #endif return (int)pSiS->chtvcvbscolor; } else { #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: return (int)(((SiS_GetCH70xx(pSiS->SiS_Pr, 0x03) & 0x40) >> 6) ^ 0x01); case CHRONTEL_701x: return (int)(((SiS_GetCH70xx(pSiS->SiS_Pr, 0x02) & 0x20) >> 5) ^ 0x01); default: return (int)pSiS->chtvcvbscolor; } } } void SiS_SetCHTVtextenhance(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->chtvtextenhance = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->chtvtextenhance = val; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_CHRONTEL)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: val /= 6; if((val >= 0) && (val <= 2)) { UShort reg = 0; reg = SiS_GetCH70xx(pSiS->SiS_Pr, 0x01); reg = (reg & 0xf0) | ((reg & 0x03) << 2) | val; SiS_SetCH70xx(pSiS->SiS_Pr, 0x01, reg); } break; case CHRONTEL_701x: val /= 2; if((val >= 0) && (val <= 7)) { SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x03, val, 0xF8); } break; } } int SiS_GetCHTVtextenhance(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif if(!((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->VBFlags & CRT2_TV))) { #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->chtvtextenhance; else #endif return (int)pSiS->chtvtextenhance; } else { #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: return (int)(((SiS_GetCH70xx(pSiS->SiS_Pr, 0x01) & 0x0c) >> 2) * 6); case CHRONTEL_701x: return (int)((SiS_GetCH70xx(pSiS->SiS_Pr, 0x03) & 0x07) * 2); default: return (int)pSiS->chtvtextenhance; } } } void SiS_SetCHTVcontrast(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->chtvcontrast = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->chtvcontrast = val; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_CHRONTEL)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif val /= 2; if((val >= 0) && (val <= 7)) { switch(pSiS->ChrontelType) { case CHRONTEL_700x: SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x11, val, 0xF8); break; case CHRONTEL_701x: SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x08, val, 0xF8); break; } SiS_DDC2Delay(pSiS->SiS_Pr, 1000); } } int SiS_GetCHTVcontrast(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif if(!((pSiS->VBFlags2 & VB2_CHRONTEL) && (pSiS->VBFlags & CRT2_TV))) { #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->chtvcontrast; else #endif return (int)pSiS->chtvcontrast; } else { #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: return (int)((SiS_GetCH70xx(pSiS->SiS_Pr, 0x11) & 0x07) * 2); case CHRONTEL_701x: return (int)((SiS_GetCH70xx(pSiS->SiS_Pr, 0x08) & 0x07) * 2); default: return (int)pSiS->chtvcontrast; } } } void SiS_SetSISTVedgeenhance(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->sistvedgeenhance = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->sistvedgeenhance = val; #endif if(!(pSiS->VBFlags2 & VB2_301)) return; if(!(pSiS->VBFlags & CRT2_TV)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif val /= 2; if((val >= 0) && (val <= 7)) { setSISIDXREG(SISPART2,0x3A, 0x1F, (val << 5)); } } int SiS_GetSISTVedgeenhance(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int result = pSiS->sistvedgeenhance; UChar temp; #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt && pSiS->DualHeadMode) result = pSiSEnt->sistvedgeenhance; #endif if(!(pSiS->VBFlags2 & VB2_301)) return result; if(!(pSiS->VBFlags & CRT2_TV)) return result; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif inSISIDXREG(SISPART2, 0x3a, temp); return(int)(((temp & 0xe0) >> 5) * 2); } void SiS_SetSISTVantiflicker(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->sistvantiflicker = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->sistvantiflicker = val; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_SISBRIDGE)) return; if(pSiS->VBFlags & TV_HIVISION) return; if((pSiS->VBFlags & TV_YPBPR) && (pSiS->VBFlags & (TV_YPBPR525P | TV_YPBPR625P | TV_YPBPR750P | TV_YPBPR1080I))) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif /* Valid values: 0=off, 1=low, 2=med, 3=high, 4=adaptive */ if((val >= 0) && (val <= 4)) { setSISIDXREG(SISPART2,0x0A,0x8F, (val << 4)); } } int SiS_GetSISTVantiflicker(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int result = pSiS->sistvantiflicker; UChar temp; #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt && pSiS->DualHeadMode) result = pSiSEnt->sistvantiflicker; #endif if(!(pSiS->VBFlags2 & VB2_SISBRIDGE)) return result; if(!(pSiS->VBFlags & CRT2_TV)) return result; if(pSiS->VBFlags & TV_HIVISION) return result; if((pSiS->VBFlags & TV_YPBPR) && (pSiS->VBFlags & (TV_YPBPR525P | TV_YPBPR625P | TV_YPBPR750P | TV_YPBPR1080I))) return result; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif inSISIDXREG(SISPART2, 0x0a, temp); return(int)((temp & 0x70) >> 4); } void SiS_SetSISTVsaturation(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->sistvsaturation = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->sistvsaturation = val; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_SISBRIDGE)) return; if(pSiS->VBFlags2 & VB2_301) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif val /= 2; if((val >= 0) && (val <= 7)) { setSISIDXREG(SISPART4,0x21,0xF8, val); } } int SiS_GetSISTVsaturation(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int result = pSiS->sistvsaturation; UChar temp; #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt && pSiS->DualHeadMode) result = pSiSEnt->sistvsaturation; #endif if(!(pSiS->VBFlags2 & VB2_SISBRIDGE)) return result; if(pSiS->VBFlags2 & VB2_301) return result; if(!(pSiS->VBFlags & CRT2_TV)) return result; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif inSISIDXREG(SISPART4, 0x21, temp); return(int)((temp & 0x07) * 2); } void SiS_SetSISTVcolcalib(ScrnInfoPtr pScrn, int val, Bool coarse) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif int ccoarse, cfine, cbase = pSiS->sistvccbase; /* UChar temp; */ #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) cbase = pSiSEnt->sistvccbase; #endif if(coarse) { pSiS->sistvcolcalibc = ccoarse = val; cfine = pSiS->sistvcolcalibf; #ifdef SISDUALHEAD if(pSiSEnt) { pSiSEnt->sistvcolcalibc = val; if(pSiS->DualHeadMode) cfine = pSiSEnt->sistvcolcalibf; } #endif } else { pSiS->sistvcolcalibf = cfine = val; ccoarse = pSiS->sistvcolcalibc; #ifdef SISDUALHEAD if(pSiSEnt) { pSiSEnt->sistvcolcalibf = val; if(pSiS->DualHeadMode) ccoarse = pSiSEnt->sistvcolcalibc; } #endif } if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_SISBRIDGE)) return; if(pSiS->VBFlags & (TV_HIVISION | TV_YPBPR)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif if((cfine >= -128) && (cfine <= 127) && (ccoarse >= -120) && (ccoarse <= 120)) { long finalcc = cbase + (((ccoarse * 256) + cfine) * 256); #if 0 inSISIDXREG(SISPART4,0x1f,temp); if(!(temp & 0x01)) { if(pSiS->VBFlags & TV_NTSC) finalcc += 0x21ed8620; else if(pSiS->VBFlags & TV_PALM) finalcc += ?; else if(pSiS->VBFlags & TV_PALM) finalcc += ?; else finalcc += 0x2a05d300; } #endif setSISIDXREG(SISPART2,0x31,0x80,((finalcc >> 24) & 0x7f)); outSISIDXREG(SISPART2,0x32,((finalcc >> 16) & 0xff)); outSISIDXREG(SISPART2,0x33,((finalcc >> 8) & 0xff)); outSISIDXREG(SISPART2,0x34,(finalcc & 0xff)); } } int SiS_GetSISTVcolcalib(ScrnInfoPtr pScrn, Bool coarse) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt && pSiS->DualHeadMode) if(coarse) return (int)pSiSEnt->sistvcolcalibc; else return (int)pSiSEnt->sistvcolcalibf; else #endif if(coarse) return (int)pSiS->sistvcolcalibc; else return (int)pSiS->sistvcolcalibf; } void SiS_SetSISTVcfilter(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->sistvcfilter = val ? 1 : 0; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->sistvcfilter = pSiS->sistvcfilter; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_SISBRIDGE)) return; if(pSiS->VBFlags & (TV_HIVISION | TV_YPBPR)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif setSISIDXREG(SISPART2,0x30,~0x10,((pSiS->sistvcfilter << 4) & 0x10)); } int SiS_GetSISTVcfilter(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int result = pSiS->sistvcfilter; UChar temp; #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt && pSiS->DualHeadMode) result = pSiSEnt->sistvcfilter; #endif if(!(pSiS->VBFlags2 & VB2_SISBRIDGE)) return result; if(!(pSiS->VBFlags & CRT2_TV)) return result; if(pSiS->VBFlags & (TV_HIVISION | TV_YPBPR)) return result; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif inSISIDXREG(SISPART2, 0x30, temp); return (int)((temp & 0x10) ? 1 : 0); } void SiS_SetSISTVyfilter(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif UChar p35,p36,p37,p38,p48,p49,p4a,p30; int i,j; pSiS->sistvyfilter = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->sistvyfilter = pSiS->sistvyfilter; #endif if(!(pSiS->VBFlags & CRT2_TV)) return; if(!(pSiS->VBFlags2 & VB2_SISBRIDGE)) return; if(pSiS->VBFlags & (TV_HIVISION | TV_YPBPR)) return; p35 = pSiS->p2_35; p36 = pSiS->p2_36; p37 = pSiS->p2_37; p38 = pSiS->p2_38; p48 = pSiS->p2_48; p49 = pSiS->p2_49; p4a = pSiS->p2_4a; p30 = pSiS->p2_30; #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) { p35 = pSiSEnt->p2_35; p36 = pSiSEnt->p2_36; p37 = pSiSEnt->p2_37; p38 = pSiSEnt->p2_38; p48 = pSiSEnt->p2_48; p49 = pSiSEnt->p2_49; p4a = pSiSEnt->p2_4a; p30 = pSiSEnt->p2_30; } #endif p30 &= 0x20; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch(pSiS->sistvyfilter) { case 0: andSISIDXREG(SISPART2,0x30,0xdf); break; case 1: outSISIDXREG(SISPART2,0x35,p35); outSISIDXREG(SISPART2,0x36,p36); outSISIDXREG(SISPART2,0x37,p37); outSISIDXREG(SISPART2,0x38,p38); if(!(pSiS->VBFlags2 & VB2_301)) { outSISIDXREG(SISPART2,0x48,p48); outSISIDXREG(SISPART2,0x49,p49); outSISIDXREG(SISPART2,0x4a,p4a); } setSISIDXREG(SISPART2,0x30,0xdf,p30); break; case 2: case 3: case 4: case 5: case 6: case 7: case 8: if(!(pSiS->VBFlags & (TV_PALM | TV_PALN | TV_NTSCJ))) { int yindex301 = -1, yindex301B = -1; UChar p3d4_34; inSISIDXREG(SISCR,0x34,p3d4_34); switch((p3d4_34 & 0x7f)) { case 0x59: /* 320x200 */ case 0x41: case 0x4f: case 0x50: /* 320x240 */ case 0x56: case 0x53: yindex301 = (pSiS->VBFlags & TV_NTSC) ? 0 : 4; break; case 0x2f: /* 640x400 */ case 0x5d: case 0x5e: case 0x2e: /* 640x480 */ case 0x44: case 0x62: yindex301 = (pSiS->VBFlags & TV_NTSC) ? 1 : 5; yindex301B = (pSiS->VBFlags & TV_NTSC) ? 0 : 4; break; case 0x31: /* 720x480 */ case 0x33: case 0x35: case 0x32: /* 720x576 */ case 0x34: case 0x36: case 0x5f: /* 768x576 */ case 0x60: case 0x61: yindex301 = (pSiS->VBFlags & TV_NTSC) ? 2 : 6; yindex301B = (pSiS->VBFlags & TV_NTSC) ? 1 : 5; break; case 0x51: /* 400x300 */ case 0x57: case 0x54: case 0x30: /* 800x600 */ case 0x47: case 0x63: yindex301 = (pSiS->VBFlags & TV_NTSC) ? 3 : 7; yindex301B = (pSiS->VBFlags & TV_NTSC) ? 2 : 6; break; case 0x52: /* 512x384 */ case 0x58: case 0x5c: case 0x38: /* 1024x768 */ case 0x4a: case 0x64: yindex301B = (pSiS->VBFlags & TV_NTSC) ? 3 : 7; break; } if(pSiS->VBFlags2 & VB2_301) { if(yindex301 >= 0) { for(i=0, j=0x35; i<=3; i++, j++) { outSISIDXREG(SISPART2,j,(SiSTVFilter301[yindex301].filter[pSiS->sistvyfilter-2][i])); } } } else { if(yindex301B >= 0) { for(i=0, j=0x35; i<=3; i++, j++) { outSISIDXREG(SISPART2,j,(SiSTVFilter301B[yindex301B].filter[pSiS->sistvyfilter-2][i])); } for(i=4, j=0x48; i<=6; i++, j++) { outSISIDXREG(SISPART2,j,(SiSTVFilter301B[yindex301B].filter[pSiS->sistvyfilter-2][i])); } } } orSISIDXREG(SISPART2,0x30,0x20); } } } int SiS_GetSISTVyfilter(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->sistvyfilter; else #endif return (int)pSiS->sistvyfilter; } void SiS_SetSIS6326TVantiflicker(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); UChar tmp; pSiS->sistvantiflicker = val; if(!(pSiS->SiS6326Flags & SIS6326_TVDETECTED)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif tmp = SiS6326GetTVReg(pScrn,0x00); if(!(tmp & 0x04)) return; /* Valid values: 0=off, 1=low, 2=med, 3=high, 4=adaptive */ if(val >= 0 && val <= 4) { tmp &= 0x1f; tmp |= (val << 5); SiS6326SetTVReg(pScrn,0x00,tmp); } } int SiS_GetSIS6326TVantiflicker(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); UChar tmp; if(!(pSiS->SiS6326Flags & SIS6326_TVDETECTED)) { return (int)pSiS->sistvantiflicker; } #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif tmp = SiS6326GetTVReg(pScrn,0x00); if(!(tmp & 0x04)) { return (int)pSiS->sistvantiflicker; } else { return (int)((tmp >> 5) & 0x07); } } void SiS_SetSIS6326TVenableyfilter(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); UChar tmp; if(val) val = 1; pSiS->sis6326enableyfilter = val; if(!(pSiS->SiS6326Flags & SIS6326_TVDETECTED)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif tmp = SiS6326GetTVReg(pScrn,0x00); if(!(tmp & 0x04)) return; tmp = SiS6326GetTVReg(pScrn,0x43); tmp &= ~0x10; tmp |= ((val & 0x01) << 4); SiS6326SetTVReg(pScrn,0x43,tmp); } int SiS_GetSIS6326TVenableyfilter(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); UChar tmp; if(!(pSiS->SiS6326Flags & SIS6326_TVDETECTED)) { return (int)pSiS->sis6326enableyfilter; } #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif tmp = SiS6326GetTVReg(pScrn,0x00); if(!(tmp & 0x04)) { return (int)pSiS->sis6326enableyfilter; } else { tmp = SiS6326GetTVReg(pScrn,0x43); return (int)((tmp >> 4) & 0x01); } } void SiS_SetSIS6326TVyfilterstrong(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); UChar tmp; if(val) val = 1; pSiS->sis6326yfilterstrong = val; if(!(pSiS->SiS6326Flags & SIS6326_TVDETECTED)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif tmp = SiS6326GetTVReg(pScrn,0x00); if(!(tmp & 0x04)) return; tmp = SiS6326GetTVReg(pScrn,0x43); if(tmp & 0x10) { tmp &= ~0x40; tmp |= ((val & 0x01) << 6); SiS6326SetTVReg(pScrn,0x43,tmp); } } int SiS_GetSIS6326TVyfilterstrong(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); UChar tmp; if(!(pSiS->SiS6326Flags & SIS6326_TVDETECTED)) { return (int)pSiS->sis6326yfilterstrong; } #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif tmp = SiS6326GetTVReg(pScrn,0x00); if(!(tmp & 0x04)) { return (int)pSiS->sis6326yfilterstrong; } else { tmp = SiS6326GetTVReg(pScrn,0x43); if(!(tmp & 0x10)) { return (int)pSiS->sis6326yfilterstrong; } else { return (int)((tmp >> 6) & 0x01); } } } void SiS_SetTVxposoffset(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif pSiS->tvxpos = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->tvxpos = val; #endif if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { if(pSiS->VBFlags & CRT2_TV) { if(pSiS->VBFlags2 & VB2_CHRONTEL) { int x = pSiS->tvx; #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) x = pSiSEnt->tvx; #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: if((val >= -32) && (val <= 32)) { x += val; if(x < 0) x = 0; SiS_SetCH700x(pSiS->SiS_Pr, 0x0a, (x & 0xff)); SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x08, ((x & 0x0100) >> 7), 0xFD); } break; case CHRONTEL_701x: /* Not supported by hardware */ break; } } else if(pSiS->VBFlags2 & VB2_SISBRIDGE) { if((val >= -32) && (val <= 32)) { UChar p2_1f,p2_20,p2_2b,p2_42,p2_43; UShort temp; int mult; p2_1f = pSiS->p2_1f; p2_20 = pSiS->p2_20; p2_2b = pSiS->p2_2b; p2_42 = pSiS->p2_42; p2_43 = pSiS->p2_43; #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) { p2_1f = pSiSEnt->p2_1f; p2_20 = pSiSEnt->p2_20; p2_2b = pSiSEnt->p2_2b; p2_42 = pSiSEnt->p2_42; p2_43 = pSiSEnt->p2_43; } #endif mult = 2; if(pSiS->VBFlags & TV_YPBPR) { if(pSiS->VBFlags & (TV_YPBPR1080I | TV_YPBPR750P)) { mult = 4; } } temp = p2_1f | ((p2_20 & 0xf0) << 4); temp += (val * mult); p2_1f = temp & 0xff; p2_20 = (temp & 0xf00) >> 4; p2_2b = ((p2_2b & 0x0f) + (val * mult)) & 0x0f; temp = p2_43 | ((p2_42 & 0xf0) << 4); temp += (val * mult); p2_43 = temp & 0xff; p2_42 = (temp & 0xf00) >> 4; SISWaitRetraceCRT2(pScrn); outSISIDXREG(SISPART2,0x1f,p2_1f); setSISIDXREG(SISPART2,0x20,0x0F,p2_20); setSISIDXREG(SISPART2,0x2b,0xF0,p2_2b); setSISIDXREG(SISPART2,0x42,0x0F,p2_42); outSISIDXREG(SISPART2,0x43,p2_43); } } } } else if(pSiS->Chipset == PCI_CHIP_SIS6326) { if(pSiS->SiS6326Flags & SIS6326_TVDETECTED) { UChar tmp; UShort temp1, temp2, temp3; tmp = SiS6326GetTVReg(pScrn,0x00); if(tmp & 0x04) { temp1 = pSiS->tvx1; temp2 = pSiS->tvx2; temp3 = pSiS->tvx3; if((val >= -16) && (val <= 16)) { if(val > 0) { temp1 += (val * 4); temp2 += (val * 4); while((temp1 > 0x0fff) || (temp2 > 0x0fff)) { temp1 -= 4; temp2 -= 4; } } else { val = -val; temp3 += (val * 4); while(temp3 > 0x03ff) { temp3 -= 4; } } } SiS6326SetTVReg(pScrn,0x3a,(temp1 & 0xff)); tmp = SiS6326GetTVReg(pScrn,0x3c); tmp &= 0xf0; tmp |= ((temp1 & 0x0f00) >> 8); SiS6326SetTVReg(pScrn,0x3c,tmp); SiS6326SetTVReg(pScrn,0x26,(temp2 & 0xff)); tmp = SiS6326GetTVReg(pScrn,0x27); tmp &= 0x0f; tmp |= ((temp2 & 0x0f00) >> 4); SiS6326SetTVReg(pScrn,0x27,tmp); SiS6326SetTVReg(pScrn,0x12,(temp3 & 0xff)); tmp = SiS6326GetTVReg(pScrn,0x13); tmp &= ~0xC0; tmp |= ((temp3 & 0x0300) >> 2); SiS6326SetTVReg(pScrn,0x13,tmp); } } } } int SiS_GetTVxposoffset(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->tvxpos; else #endif return (int)pSiS->tvxpos; } void SiS_SetTVyposoffset(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif pSiS->tvypos = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->tvypos = val; #endif if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { if(pSiS->VBFlags & CRT2_TV) { if(pSiS->VBFlags2 & VB2_CHRONTEL) { int y = pSiS->tvy; #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) y = pSiSEnt->tvy; #endif switch(pSiS->ChrontelType) { case CHRONTEL_700x: if((val >= -32) && (val <= 32)) { y -= val; if(y < 0) y = 0; SiS_SetCH700x(pSiS->SiS_Pr, 0x0b, (y & 0xff)); SiS_SetCH70xxANDOR(pSiS->SiS_Pr, 0x08, ((y & 0x0100) >> 8), 0xFE); } break; case CHRONTEL_701x: /* Not supported by hardware */ break; } } else if(pSiS->VBFlags2 & VB2_SISBRIDGE) { if((val >= -32) && (val <= 32)) { char p2_01, p2_02; if( (pSiS->VBFlags & TV_HIVISION) || ((pSiS->VBFlags & TV_YPBPR) && (pSiS->VBFlags & (TV_YPBPR1080I|TV_YPBPR750P))) ) { val *= 2; } else { val /= 2; /* 4 */ } p2_01 = pSiS->p2_01; p2_02 = pSiS->p2_02; #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) { p2_01 = pSiSEnt->p2_01; p2_02 = pSiSEnt->p2_02; } #endif p2_01 += val; /* val * 2 */ p2_02 += val; /* val * 2 */ if(!(pSiS->VBFlags & (TV_YPBPR | TV_HIVISION))) { while((p2_01 <= 0) || (p2_02 <= 0)) { p2_01 += 2; p2_02 += 2; } } else if((pSiS->VBFlags & TV_YPBPR) && (pSiS->VBFlags & TV_YPBPR1080I)) { while(p2_01 <= 8) { p2_01 += 2; p2_02 += 2; } } else if((pSiS->VBFlags & TV_YPBPR) && (pSiS->VBFlags & TV_YPBPR750P)) { while(p2_01 <= 10) { p2_01 += 2; p2_02 += 2; } } SISWaitRetraceCRT2(pScrn); outSISIDXREG(SISPART2,0x01,p2_01); outSISIDXREG(SISPART2,0x02,p2_02); } } } } else if(pSiS->Chipset == PCI_CHIP_SIS6326) { if(pSiS->SiS6326Flags & SIS6326_TVDETECTED) { UChar tmp; int temp1, limit; tmp = SiS6326GetTVReg(pScrn,0x00); if(tmp & 0x04) { if((val >= -16) && (val <= 16)) { temp1 = (UShort)pSiS->tvy1; limit = (pSiS->SiS6326Flags & SIS6326_TVPAL) ? 625 : 525; if(val > 0) { temp1 += (val * 4); if(temp1 > limit) temp1 -= limit; } else { val = -val; temp1 -= (val * 2); if(temp1 <= 0) temp1 += (limit -1); } SiS6326SetTVReg(pScrn,0x11,(temp1 & 0xff)); tmp = SiS6326GetTVReg(pScrn,0x13); tmp &= ~0x30; tmp |= ((temp1 & 0x300) >> 4); SiS6326SetTVReg(pScrn,0x13,tmp); if(temp1 == 1) tmp = 0x10; else { if(pSiS->SiS6326Flags & SIS6326_TVPAL) { if((temp1 <= 3) || (temp1 >= (limit - 2))) tmp = 0x08; else if(temp1 < 22) tmp = 0x02; else tmp = 0x04; } else { if((temp1 <= 5) || (temp1 >= (limit - 4))) tmp = 0x08; else if(temp1 < 19) tmp = 0x02; else tmp = 0x04; } } SiS6326SetTVReg(pScrn,0x21,tmp); } } } } } int SiS_GetTVyposoffset(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->tvypos; else #endif return (int)pSiS->tvypos; } void SiS_SetTVxscale(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif pSiS->tvxscale = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->tvxscale = val; #endif if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { if((pSiS->VBFlags & CRT2_TV) && (pSiS->VBFlags2 & VB2_SISBRIDGE)) { if((val >= -16) && (val <= 16)) { UChar p2_44,p2_45,p2_46; int scalingfactor, mult; p2_44 = pSiS->p2_44; p2_45 = pSiS->p2_45 & 0x3f; p2_46 = pSiS->p2_46 & 0x07; #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) { p2_44 = pSiSEnt->p2_44; p2_45 = pSiSEnt->p2_45 & 0x3f; p2_46 = pSiSEnt->p2_46 & 0x07; } #endif scalingfactor = (p2_46 << 13) | ((p2_45 & 0x1f) << 8) | p2_44; mult = 64; if(pSiS->VBFlags & TV_YPBPR) { if(pSiS->VBFlags & TV_YPBPR1080I) { mult = 190; } else if(pSiS->VBFlags & TV_YPBPR750P) { mult = 360; } } else if(pSiS->VBFlags & TV_HIVISION) { mult = 190; } if(val < 0) { p2_45 &= 0xdf; scalingfactor += ((-val) * mult); if(scalingfactor > 0xffff) scalingfactor = 0xffff; } else if(val > 0) { p2_45 &= 0xdf; scalingfactor -= (val * mult); if(scalingfactor < 1) scalingfactor = 1; } p2_44 = scalingfactor & 0xff; p2_45 &= 0xe0; p2_45 |= ((scalingfactor >> 8) & 0x1f); p2_46 = ((scalingfactor >> 13) & 0x07); SISWaitRetraceCRT2(pScrn); outSISIDXREG(SISPART2,0x44,p2_44); setSISIDXREG(SISPART2,0x45,0xC0,p2_45); if(!(pSiS->VBFlags2 & VB2_301)) { setSISIDXREG(SISPART2,0x46,0xF8,p2_46); } } } } } int SiS_GetTVxscale(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->tvxscale; else #endif return (int)pSiS->tvxscale; } void SiS_SetTVyscale(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif if(val < -4) val = -4; if(val > 3) val = 3; pSiS->tvyscale = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->tvyscale = val; #endif if(pSiS->VGAEngine == SIS_300_VGA || pSiS->VGAEngine == SIS_315_VGA) { if((pSiS->VBFlags & CRT2_TV) && (pSiS->VBFlags2 & VB2_SISBRIDGE)) { int srindex = -1, newvde, i = 0, j, vlimit, temp, vdediv; int hdclk = 0; UChar p3d4_34; Bool found = FALSE; Bool usentsc = FALSE; Bool is750p = FALSE; Bool is1080i = FALSE; Bool skipmoveup = FALSE; SiS_UnLockCRT2(pSiS->SiS_Pr); if((pSiS->VBFlags & TV_YPBPR) && (pSiS->VBFlags & TV_YPBPR525P)) { vlimit = 525 - 7; vdediv = 1; usentsc = TRUE; } else if((pSiS->VBFlags & TV_YPBPR) && (pSiS->VBFlags & TV_YPBPR625P)) { vlimit = 625 - 7; vdediv = 1; } else if((pSiS->VBFlags & TV_YPBPR) && (pSiS->VBFlags & TV_YPBPR750P)) { vlimit = 750 - 7; vdediv = 1; is750p = TRUE; } else if(((pSiS->VBFlags & TV_YPBPR) && (pSiS->VBFlags & TV_YPBPR1080I)) || (pSiS->VBFlags & TV_HIVISION)) { vlimit = (1125 - 7) / 2; vdediv = 2; is1080i = TRUE; } else { if( ((pSiS->VBFlags & TV_YPBPR) && (pSiS->VBFlags & TV_YPBPR525I)) || ((!(pSiS->VBFlags & TV_YPBPR)) && (pSiS->VBFlags & (TV_NTSC | TV_PALM))) ) { usentsc = TRUE; } vlimit = usentsc ? 259 : 309; vdediv = 2; } inSISIDXREG(SISCR,0x34,p3d4_34); switch((p3d4_34 & 0x7f)) { case 0x50: /* 320x240 */ case 0x56: case 0x53: hdclk = 1; /* fall through */ case 0x2e: /* 640x480 */ case 0x44: case 0x62: if(is1080i) { srindex = 98; } else if(is750p) { srindex = 42; } else { srindex = usentsc ? 0 : 21; } break; case 0x31: /* 720x480 */ case 0x33: case 0x35: if(is1080i) { /* n/a */ } else if(is750p) { srindex = 49; } else { srindex = usentsc ? 7 : 21; } break; case 0x32: /* 720x576 */ case 0x34: case 0x36: case 0x5f: /* 768x576 */ case 0x60: case 0x61: if(is1080i) { /* n/a */ } else if(is750p) { srindex = 56; } else { srindex = usentsc ? 147 : 28; } break; case 0x70: /* 800x480 */ case 0x7a: case 0x76: if(is1080i) { srindex = 105; } else if(is750p) { srindex = 63; } else { srindex = usentsc ? 175 : 21; } break; case 0x51: /* 400x300 - hdclk mode */ case 0x57: case 0x54: hdclk = 1; /* fall through */ case 0x30: /* 800x600 */ case 0x47: case 0x63: if(is1080i) { srindex = 112; } else if(is750p) { srindex = 70; } else { srindex = usentsc ? 14 : 35; } break; case 0x1d: /* 960x540 */ case 0x1e: case 0x1f: if(is1080i) { srindex = 196; skipmoveup = TRUE; } break; case 0x20: /* 960x600 */ case 0x21: case 0x22: if(pSiS->VGAEngine == SIS_315_VGA && is1080i) { srindex = 203; } break; case 0x71: /* 1024x576 */ case 0x74: case 0x77: if(is1080i) { srindex = 119; } else if(is750p) { srindex = 77; } else { srindex = usentsc ? 182 : 189; } break; case 0x52: /* 512x384 */ case 0x58: case 0x5c: hdclk = 1; /* fall through */ case 0x38: /* 1024x768 */ case 0x4a: case 0x64: if(is1080i) { srindex = 126; } else if(is750p) { srindex = 84; } else if(!usentsc) { srindex = 154; } else if(vdediv == 1) { if(!hdclk) srindex = 168; } else { if(!hdclk) srindex = 161; } break; case 0x79: /* 1280x720 */ case 0x75: case 0x78: if(is1080i) { srindex = 133; } else if(is750p) { srindex = 91; } break; case 0x3a: /* 1280x1024 */ case 0x4d: case 0x65: if(is1080i) { srindex = 140; } break; } if(srindex < 0) return; if(pSiS->tvyscale != 0) { for(j = 0; j <= 1; j++) { for(i = 0; i <= 6; i++) { if(SiSTVVScale[srindex+i].sindex == pSiS->tvyscale) { found = TRUE; break; } } if(found) break; if(pSiS->tvyscale > 0) pSiS->tvyscale--; else pSiS->tvyscale++; } } #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->tvyscale = pSiS->tvyscale; #endif if(pSiS->tvyscale == 0) { UChar p2_0a = pSiS->p2_0a; UChar p2_2f = pSiS->p2_2f; UChar p2_30 = pSiS->p2_30; UChar p2_46 = pSiS->p2_46; UChar p2_47 = pSiS->p2_47; UChar p1scaling[9], p4scaling[9]; UChar *p2scaling; for(i = 0; i < 9; i++) { p1scaling[i] = pSiS->scalingp1[i]; p4scaling[i] = pSiS->scalingp4[i]; } p2scaling = &pSiS->scalingp2[0]; #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) { p2_0a = pSiSEnt->p2_0a; p2_2f = pSiSEnt->p2_2f; p2_30 = pSiSEnt->p2_30; p2_46 = pSiSEnt->p2_46; p2_47 = pSiSEnt->p2_47; for(i = 0; i < 9; i++) { p1scaling[i] = pSiSEnt->scalingp1[i]; p4scaling[i] = pSiSEnt->scalingp4[i]; } p2scaling = &pSiSEnt->scalingp2[0]; } #endif SISWaitRetraceCRT2(pScrn); if(pSiS->VBFlags2 & VB2_SISTAP4SCALER) { for(i = 0; i < 64; i++) { outSISIDXREG(SISPART2,(0xc0 + i),p2scaling[i]); } } for(i = 0; i < 9; i++) { outSISIDXREG(SISPART1,SiSScalingP1Regs[i],p1scaling[i]); } for(i = 0; i < 9; i++) { outSISIDXREG(SISPART4,SiSScalingP4Regs[i],p4scaling[i]); } setSISIDXREG(SISPART2,0x0a,0x7f,(p2_0a & 0x80)); outSISIDXREG(SISPART2,0x2f,p2_2f); setSISIDXREG(SISPART2,0x30,0x3f,(p2_30 & 0xc0)); if(!(pSiS->VBFlags2 & VB2_301)) { setSISIDXREG(SISPART2,0x46,0x9f,(p2_46 & 0x60)); outSISIDXREG(SISPART2,0x47,p2_47); } } else { int realvde, myypos, watchdog = 32; unsigned short temp1, temp2, vgahde, vgaht, vgavt; int p1div = 1; ULong calctemp; srindex += i; newvde = SiSTVVScale[srindex].ScaleVDE; realvde = SiSTVVScale[srindex].RealVDE; if(vdediv == 1) p1div = 2; if(!skipmoveup) { do { inSISIDXREG(SISPART2,0x01,temp); temp = vlimit - ((temp & 0x7f) / p1div); if((temp - (((newvde / vdediv) - 2) + 9)) > 0) break; myypos = pSiS->tvypos - 1; #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) myypos = pSiSEnt->tvypos - 1; #endif SiS_SetTVyposoffset(pScrn, myypos); } while(watchdog--); } SISWaitRetraceCRT2(pScrn); if(pSiS->VBFlags2 & VB2_SISTAP4SCALER) { SiS_CalcXTapScaler(pSiS->SiS_Pr, realvde, newvde, 4, FALSE); } if(!(pSiS->VBFlags2 & VB2_301)) { temp = (newvde / vdediv) - 3; setSISIDXREG(SISPART2,0x46,0x9f,((temp & 0x0300) >> 3)); outSISIDXREG(SISPART2,0x47,(temp & 0xff)); } inSISIDXREG(SISPART1,0x0a,temp1); inSISIDXREG(SISPART1,0x0c,temp2); vgahde = ((temp2 & 0xf0) << 4) | temp1; if(pSiS->VGAEngine == SIS_300_VGA) { vgahde -= 12; } else { vgahde -= 16; if(hdclk) vgahde <<= 1; } vgaht = SiSTVVScale[srindex].reg[0]; temp1 = vgaht; if((pSiS->VGAEngine == SIS_315_VGA) && hdclk) temp1 >>= 1; temp1--; outSISIDXREG(SISPART1,0x08,(temp1 & 0xff)); setSISIDXREG(SISPART1,0x09,0x0f,((temp1 >> 4) & 0xf0)); temp2 = (vgaht - vgahde) >> 2; if(pSiS->VGAEngine == SIS_300_VGA) { temp1 = vgahde + 12 + temp2; temp2 = temp1 + (temp2 << 1); } else { temp1 = vgahde; if(hdclk) { temp1 >>= 1; temp2 >>= 1; } temp2 >>= 1; temp1 = temp1 + 16 + temp2; temp2 = temp1 + temp2; } outSISIDXREG(SISPART1,0x0b,(temp1 & 0xff)); setSISIDXREG(SISPART1,0x0c,0xf0,((temp1 >> 8) & 0x0f)); outSISIDXREG(SISPART1,0x0d,(temp2 & 0xff)); vgavt = SiSTVVScale[srindex].reg[1]; temp1 = vgavt - 1; if(pSiS->VGAEngine == SIS_315_VGA) temp1--; outSISIDXREG(SISPART1,0x0e,(temp1 & 0xff)); setSISIDXREG(SISPART1,0x12,0xf8,((temp1 >> 8 ) & 0x07)); if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->ChipType >= SIS_661)) { temp1 = (vgavt + SiSTVVScale[srindex].RealVDE) >> 1; temp2 = ((vgavt - SiSTVVScale[srindex].RealVDE) >> 4) + temp1 + 1; } else { temp1 = (vgavt - SiSTVVScale[srindex].RealVDE) >> 2; temp2 = (temp1 < 4) ? 4 : temp1; temp1 += SiSTVVScale[srindex].RealVDE; temp2 = (temp2 >> 2) + temp1 + 1; } outSISIDXREG(SISPART1,0x10,(temp1 & 0xff)); setSISIDXREG(SISPART1,0x11,0x8f,((temp1 >> 4) & 0x70)); setSISIDXREG(SISPART1,0x11,0xf0,(temp2 & 0x0f)); setSISIDXREG(SISPART2,0x0a,0x7f,((SiSTVVScale[srindex].reg[2] >> 8) & 0x80)); outSISIDXREG(SISPART2,0x2f,((newvde / vdediv) - 2)); setSISIDXREG(SISPART2,0x30,0x3f,((((newvde / vdediv) - 2) >> 2) & 0xc0)); outSISIDXREG(SISPART4,0x13,(SiSTVVScale[srindex].reg[2] & 0xff)); outSISIDXREG(SISPART4,0x14,(SiSTVVScale[srindex].reg[3] & 0xff)); setSISIDXREG(SISPART4,0x15,0x7f,((SiSTVVScale[srindex].reg[3] >> 1) & 0x80)); temp1 = vgaht - 1; outSISIDXREG(SISPART4,0x16,(temp1 & 0xff)); setSISIDXREG(SISPART4,0x15,0x87,((temp1 >> 5) & 0x78)); temp1 = vgavt - 1; outSISIDXREG(SISPART4,0x17,(temp1 & 0xff)); setSISIDXREG(SISPART4,0x15,0xf8,((temp1 >> 8) & 0x07)); outSISIDXREG(SISPART4,0x18,0x00); setSISIDXREG(SISPART4,0x19,0xf0,0x00); inSISIDXREG(SISPART4,0x0e,temp1); if(is1080i) { if(!(temp1 & 0xe0)) newvde >>= 1; } temp = 0x40; if(realvde <= newvde) temp = 0; else realvde -= newvde; calctemp = (realvde * 256 * 1024) / newvde; if((realvde * 256 * 1024) % newvde) calctemp++; outSISIDXREG(SISPART4,0x1b,(calctemp & 0xff)); outSISIDXREG(SISPART4,0x1a,((calctemp >> 8) & 0xff)); setSISIDXREG(SISPART4,0x19,0x8f,(((calctemp >> 12) & 0x70) | temp)); } } } } int SiS_GetTVyscale(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt && pSiS->DualHeadMode) return (int)pSiSEnt->tvyscale; else #endif return (int)pSiS->tvyscale; } void SiS_SetSISCRT1SaturationGain(ScrnInfoPtr pScrn, int val) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif pSiS->siscrt1satgain = val; #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->siscrt1satgain = val; #endif if(!(pSiS->SiS_SD3_Flags & SiS_SD3_CRT1SATGAIN)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif if((val >= 0) && (val <= 7)) { setSISIDXREG(SISCR,0x53,0xE3, (val << 2)); } } int SiS_GetSISCRT1SaturationGain(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int result = pSiS->siscrt1satgain; UChar temp; #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiSEnt && pSiS->DualHeadMode) result = pSiSEnt->siscrt1satgain; #endif if(!(pSiS->SiS_SD3_Flags & SiS_SD3_CRT1SATGAIN)) return result; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif inSISIDXREG(SISCR, 0x53, temp); return (int)((temp >> 2) & 0x07); } /* Calc dotclock from registers */ static int SiSGetClockFromRegs(UChar sr2b, UChar sr2c) { float num, denum, postscalar, divider; int myclock; divider = (sr2b & 0x80) ? 2.0 : 1.0; postscalar = (sr2c & 0x80) ? ( (((sr2c >> 5) & 0x03) == 0x02) ? 6.0 : 8.0 ) : ( ((sr2c >> 5) & 0x03) + 1.0 ); num = (sr2b & 0x7f) + 1.0; denum = (sr2c & 0x1f) + 1.0; myclock = (int)((14318 * (divider / postscalar) * (num / denum)) / 1000); return myclock; } #ifdef SISDUALHEAD static void SiS_SetDHFlags(SISPtr pSiS, unsigned int misc, unsigned int sd2) { SISEntPtr pSiSEnt = pSiS->entityPrivate; if(pSiS->DualHeadMode) { if(pSiSEnt->pScrn_1) { SISPTR(pSiSEnt->pScrn_1)->MiscFlags |= misc; SISPTR(pSiSEnt->pScrn_1)->SiS_SD2_Flags |= sd2; } if(pSiSEnt->pScrn_2) { SISPTR(pSiSEnt->pScrn_2)->MiscFlags |= misc; SISPTR(pSiSEnt->pScrn_2)->SiS_SD2_Flags |= sd2; } } } #endif /* PostSetMode: * -) Disable CRT1 for saving bandwidth. This doesn't work with VESA; * VESA uses the bridge in SlaveMode and switching CRT1 off while * the bridge is in SlaveMode not that clever... * -) Check if overlay can be used (depending on dotclock) * -) Check if Panel Scaler is active on LVDS for overlay re-scaling * -) Save TV registers for further processing * -) Apply TV settings */ static void SiSPostSetMode(ScrnInfoPtr pScrn, SISRegPtr sisReg) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif UChar usScratchCR17, sr2b, sr2c, tmpreg; int myclock1, myclock2, mycoldepth1, mycoldepth2, temp; Bool flag = FALSE; Bool doit = TRUE; Bool IsInSlaveMode; #ifdef TWDEBUG xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CRT1off is %d\n", pSiS->CRT1off); #endif pSiS->CRT1isoff = pSiS->CRT1off; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif SiSFixupSR11(pScrn); IsInSlaveMode = SiSBridgeIsInSlaveMode(pScrn); if((!pSiS->UseVESA) && (pSiS->VBFlags & CRT2_ENABLE)) { if(pSiS->VBFlags != pSiS->VBFlags_backup) { pSiS->VBFlags = pSiS->VBFlags_backup; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VBFlags restored to %0x\n", pSiS->VBFlags); } /* -) We can't switch off CRT1 if bridge is in SlaveMode. * -) If we change to a SlaveMode-Mode (like 512x384), we * need to adapt VBFlags for eg. Xv. */ #ifdef SISDUALHEAD if(!pSiS->DualHeadMode) { #endif if(IsInSlaveMode) { doit = FALSE; temp = pSiS->VBFlags; pSiS->VBFlags &= (~VB_DISPMODE_SINGLE); pSiS->VBFlags |= (VB_DISPMODE_MIRROR | DISPTYPE_DISP1); if(temp != pSiS->VBFlags) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VBFlags changed to 0x%0x\n", pSiS->VBFlags); } } #ifdef SISDUALHEAD } #endif if(pSiS->VGAEngine == SIS_315_VGA) { if((pSiS->CRT1off) && (doit)) { orSISIDXREG(SISCR,pSiS->myCR63,0x40); orSISIDXREG(SISSR,0x1f,0xc0); andSISIDXREG(SISSR,0x07,~0x10); andSISIDXREG(SISSR,0x06,0xe2); andSISIDXREG(SISSR,0x31,0xcf); outSISIDXREG(SISSR,0x2b,0x1b); outSISIDXREG(SISSR,0x2c,0xe1); outSISIDXREG(SISSR,0x2d,0x01); outSISIDXREG(SISSR, 0x00, 0x01); /* Synchronous Reset */ usleep(10000); outSISIDXREG(SISSR, 0x00, 0x03); /* End Reset */ } else { andSISIDXREG(SISCR,pSiS->myCR63,0xBF); andSISIDXREG(SISSR,0x1f,0x3f); orSISIDXREG(SISSR,0x07,0x10); } } else { if(doit) { inSISIDXREG(SISCR, 0x17, usScratchCR17); if(pSiS->CRT1off) { if(usScratchCR17 & 0x80) { flag = TRUE; usScratchCR17 &= ~0x80; } orSISIDXREG(SISSR,0x1f,0xc0); } else { if(!(usScratchCR17 & 0x80)) { flag = TRUE; usScratchCR17 |= 0x80; } andSISIDXREG(SISSR,0x1f,0x3f); } /* Reset only if status changed */ if(flag) { outSISIDXREG(SISCR, 0x17, usScratchCR17); outSISIDXREG(SISSR, 0x00, 0x01); /* Synchronous Reset */ usleep(10000); outSISIDXREG(SISSR, 0x00, 0x03); /* End Reset */ } } } } /* Set bridge to "disable CRT2" mode if CRT2 is disabled, LCD-A is enabled */ /* (Not needed for CRT1=VGA since CRT2 will really be disabled then) */ #ifdef SISDUALHEAD if(!pSiS->DualHeadMode) { #endif if((pSiS->VGAEngine == SIS_315_VGA) && (pSiS->VBFlags2 & VB2_SISLCDABRIDGE)) { if((!pSiS->UseVESA) && (!(pSiS->VBFlags & CRT2_ENABLE)) && (pSiS->VBFlags & CRT1_LCDA)) { if(!IsInSlaveMode) { andSISIDXREG(SISPART4,0x0d,~0x07); } } } #ifdef SISDUALHEAD } #endif /* Reset flags */ pSiS->MiscFlags &= ~( MISC_CRT1OVERLAY | MISC_CRT2OVERLAY | MISC_CRT1OVERLAYGAMMA | MISC_SIS760ONEOVERLAY | MISC_PANELLINKSCALER | MISC_STNMODE | MISC_TVNTSC1024); pSiS->SiS_SD2_Flags &= ~SiS_SD2_SIS760ONEOVL; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiSEnt->pScrn_1) { SISPTR(pSiSEnt->pScrn_1)->MiscFlags &= ~(MISC_SIS760ONEOVERLAY | MISC_CRT1OVERLAY | MISC_CRT2OVERLAY | MISC_CRT1OVERLAYGAMMA | MISC_PANELLINKSCALER | MISC_STNMODE | MISC_TVNTSC1024); SISPTR(pSiSEnt->pScrn_1)->SiS_SD2_Flags &= ~SiS_SD2_SIS760ONEOVL; } if(pSiSEnt->pScrn_2) { SISPTR(pSiSEnt->pScrn_2)->MiscFlags &= ~(MISC_SIS760ONEOVERLAY | MISC_CRT1OVERLAY | MISC_CRT2OVERLAY | MISC_CRT1OVERLAYGAMMA | MISC_PANELLINKSCALER | MISC_STNMODE | MISC_TVNTSC1024); SISPTR(pSiSEnt->pScrn_2)->SiS_SD2_Flags &= ~SiS_SD2_SIS760ONEOVL; } } #endif /* Determine if the video overlay can be used */ if(!pSiS->NoXvideo) { int clklimit1=0, clklimit2=0, clklimitg=0; Bool OverlayHandled = FALSE; inSISIDXREG(SISSR,0x2b,sr2b); inSISIDXREG(SISSR,0x2c,sr2c); myclock1 = myclock2 = SiSGetClockFromRegs(sr2b, sr2c); inSISIDXREG(SISSR,0x06,tmpreg); switch((tmpreg & 0x1c) >> 2) { case 0: mycoldepth1 = 1; break; case 1: case 2: mycoldepth1 = 2; break; default: mycoldepth1 = 4; } mycoldepth2 = mycoldepth1; if((!IsInSlaveMode) && (pSiS->VBFlags & CRT2_ENABLE)) { if(pSiS->VBFlags2 & VB2_SISBRIDGE) { inSISIDXREG(SISPART4,0x0a,sr2b); inSISIDXREG(SISPART4,0x0b,sr2c); } else { inSISIDXREG(SISSR,0x2e,sr2b); inSISIDXREG(SISSR,0x2f,sr2c); } myclock2 = SiSGetClockFromRegs(sr2b, sr2c); inSISIDXREG(SISPART1,0x00,tmpreg); tmpreg &= 0x0f; switch(tmpreg) { case 8: mycoldepth2 = 1; break; case 4: case 2: mycoldepth2 = 2; break; default: mycoldepth2 = 4; } } switch(pSiS->ChipType) { case SIS_300: case SIS_540: case SIS_630: case SIS_730: clklimit1 = clklimit2 = clklimitg = 150; break; case SIS_550: case SIS_650: case SIS_740: clklimit1 = clklimit2 = 175; /* verified for 65x */ clklimitg = 166; /* ? */ break; case SIS_661: case SIS_741: clklimit1 = clklimit2 = 190; /* ? */ clklimitg = 180; /* ? */ break; case SIS_760: case SIS_761: clklimit1 = clklimit2 = 190; /* ? */ if(pSiS->ChipFlags & SiSCF_760LFB) { /* LFB only or hybrid */ clklimit1 = clklimit2 = 220; /* ? */ } clklimitg = 200; /* ? */ if(pSiS->SiS_SD2_Flags & SiS_SD2_SUPPORT760OO) { /* UMA only */ Bool OnlyOne = FALSE, NoOverlay = FALSE; int dotclocksum = 0; if(pSiS->VBFlags & DISPTYPE_CRT1) dotclocksum += myclock1; if((!IsInSlaveMode) && (pSiS->VBFlags & CRT2_ENABLE)) dotclocksum += myclock2; /* TODO: Find out under what circumstances only one * overlay is usable in UMA-only mode. * This is not entirely accurate; the overlay * scaler also requires some time, so even though * the dotclocks are below these values, some * distortions in the overlay may occure. * Solution: Don't use a 760 with shared memory. */ if( (pSiS->VBFlags & DISPTYPE_CRT1) && (pSiS->VBFlags & CRT2_ENABLE) && (mycoldepth1 != mycoldepth2) ) { /* 0. If coldepths are different (only possible in dual head mode), * I have no idea to calculate the limits; hence, allow only one * overlay in all cases. */ OnlyOne = TRUE; } else if(pSiS->MemClock < 150000) { /* 1. MCLK <150: If someone seriously considers using such * slow RAM, so be it. Only one overlay in call cases. */ OnlyOne = TRUE; } else if(pSiS->MemClock < 170000) { /* 2. MCLK 166 */ switch(pSiS->CurrentLayout.bitsPerPixel) { case 32: if(dotclocksum > 133) OnlyOne = TRUE; /* One overlay; verified */ if(dotclocksum > 180) NoOverlay = TRUE; /* No overlay; verified */ break; case 16: if(dotclocksum > 175) OnlyOne = TRUE; /* One overlay; verified */ if(dotclocksum > 260) NoOverlay = TRUE;; /* No overlay; FIXME */ break; } } else if(pSiS->MemClock < 210000) { /* 3. MCLK 200 */ switch(pSiS->CurrentLayout.bitsPerPixel) { case 32: if(dotclocksum > 160) OnlyOne = TRUE; /* One overlay; FIXME */ if(dotclocksum > 216) NoOverlay = TRUE;; /* No overlay; FIXME */ break; case 16: if(dotclocksum > 210) OnlyOne = TRUE; /* One overlay; FIXME */ if(dotclocksum > 312) NoOverlay = TRUE;; /* No overlay; FIXME */ break; } } if(OnlyOne || NoOverlay) { ULong tmpflags = 0; if(!NoOverlay) { if(myclock1 <= clklimit1) tmpflags |= MISC_CRT1OVERLAY; if(myclock2 <= clklimit2) tmpflags |= MISC_CRT2OVERLAY; if(myclock1 <= clklimitg) tmpflags |= MISC_CRT1OVERLAYGAMMA; pSiS->MiscFlags |= tmpflags; } pSiS->MiscFlags |= MISC_SIS760ONEOVERLAY; pSiS->SiS_SD2_Flags |= SiS_SD2_SIS760ONEOVL; #ifdef SISDUALHEAD SiS_SetDHFlags(pSiS, (tmpflags | MISC_SIS760ONEOVERLAY), SiS_SD2_SIS760ONEOVL); #endif OverlayHandled = TRUE; } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "SiS76x/UMA: %s video overlay(s) available in current mode\n", NoOverlay ? "no" : ((pSiS->MiscFlags & MISC_SIS760ONEOVERLAY) ? "one" : "two")); #ifdef TWDEBUG xf86DrvMsg(0, 0, "SiS760: Memclock %d, c1 %d/%d c2 %d/%d, sum %d / %x\n", pSiS->MemClock, myclock1, mycoldepth1, myclock2, mycoldepth2, dotclocksum, pSiS->SiS_SD2_Flags); #endif } break; case SIS_660: clklimit1 = clklimit2 = 200; /* ? */ if(pSiS->ChipFlags & SiSCF_760LFB) { /* LFB only */ clklimit1 = clklimit2 = 220; } clklimitg = 200; /* ? */ break; case SIS_315H: case SIS_315: case SIS_315PRO: case SIS_330: clklimit1 = clklimit2 = 180; /* ? */ clklimitg = 166; /* ? */ break; case SIS_340: /* ? */ case XGI_20: case XGI_40: clklimit1 = clklimit2 = 240; /* ? */ clklimitg = 200; /* ? */ break; } if(!OverlayHandled) { ULong tmpflags = 0; if(myclock1 <= clklimit1) tmpflags |= MISC_CRT1OVERLAY; if(myclock2 <= clklimit2) tmpflags |= MISC_CRT2OVERLAY; if(myclock1 <= clklimitg) tmpflags |= MISC_CRT1OVERLAYGAMMA; pSiS->MiscFlags |= tmpflags; #ifdef SISDUALHEAD SiS_SetDHFlags(pSiS, tmpflags, 0); #endif if(!(pSiS->MiscFlags & MISC_CRT1OVERLAY)) { #ifdef SISDUALHEAD if((!pSiS->DualHeadMode) || (pSiS->SecondHead)) #endif xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 3, "Current dotclock (%dMhz) too high for video overlay on CRT1\n", myclock1); } if((pSiS->VBFlags & CRT2_ENABLE) && (!(pSiS->MiscFlags & MISC_CRT2OVERLAY))) { #ifdef SISDUALHEAD if((!pSiS->DualHeadMode) || (!pSiS->SecondHead)) #endif xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 3, "Current dotclock (%dMhz) too high for video overlay on CRT2\n", myclock2); } } } /* Determine if the Panel Link scaler is active */ if(pSiS->VBFlags & (CRT2_LCD | CRT1_LCDA)) { ULong tmpflags = 0; if(pSiS->VGAEngine == SIS_300_VGA) { if(pSiS->VBFlags2 & (VB2_LVDS | VB2_30xBDH)) { inSISIDXREG(SISPART1,0x1e,tmpreg); tmpreg &= 0x3f; if(tmpreg) tmpflags |= MISC_PANELLINKSCALER; } } else { if((pSiS->VBFlags2 & (VB2_LVDS | VB2_30xBDH)) || (pSiS->VBFlags & CRT1_LCDA)) { inSISIDXREG(SISPART1,0x35,tmpreg); tmpreg &= 0x04; if(!tmpreg) tmpflags |= MISC_PANELLINKSCALER; } } pSiS->MiscFlags |= tmpflags; #ifdef SISDUALHEAD SiS_SetDHFlags(pSiS, tmpflags, 0); #endif } /* Determine if STN is active */ if(pSiS->ChipType == SIS_550) { if((pSiS->VBFlags & CRT2_LCD) && (pSiS->FSTN || pSiS->DSTN)) { inSISIDXREG(SISCR,0x34,tmpreg); tmpreg &= 0x7f; if(tmpreg == 0x5a || tmpreg == 0x5b) { pSiS->MiscFlags |= MISC_STNMODE; #ifdef SISDUALHEAD SiS_SetDHFlags(pSiS, MISC_STNMODE, 0); #endif } } } /* Determine if our very special TV mode is active */ if((pSiS->VBFlags2 & VB2_SISBRIDGE) && (pSiS->VBFlags & CRT2_TV) && (!(pSiS->VBFlags & TV_HIVISION))) { if( ((pSiS->VBFlags & TV_YPBPR) && (pSiS->VBFlags & TV_YPBPR525I)) || ((!(pSiS->VBFlags & TV_YPBPR)) && (pSiS->VBFlags & (TV_NTSC | TV_PALM))) ) { inSISIDXREG(SISCR,0x34,tmpreg); tmpreg &= 0x7f; if((tmpreg == 0x64) || (tmpreg == 0x4a) || (tmpreg == 0x38)) { pSiS->MiscFlags |= MISC_TVNTSC1024; #ifdef SISDUALHEAD SiS_SetDHFlags(pSiS, MISC_TVNTSC1024, 0); #endif } } } if(pSiS->VGAEngine == SIS_315_VGA) { int i; #ifdef SISVRAMQ /* Re-Enable and reset command queue */ SiSEnableTurboQueue(pScrn); #endif /* Get HWCursor register contents for backup */ for(i = 0; i < 16; i++) { pSiS->HWCursorBackup[i] = SIS_MMIO_IN32(pSiS->IOBase, 0x8500 + (i << 2)); } if(pSiS->ChipType >= SIS_330) { /* Enable HWCursor protection (Y pos as trigger) */ andSISIDXREG(SISCR, 0x5b, ~0x30); } } /* Re-initialize accelerator engine */ /* (We are sync'ed here) */ if(!pSiS->NoAccel) { if(pSiS->InitAccel) { (pSiS->InitAccel)(pScrn); } } /* Set display device gamma (for SISCTRL) */ if(pSiS->VBFlags & CRT1_LCDA) pSiS->CRT1MonGamma = pSiS->CRT2LCDMonitorGamma; else pSiS->CRT1MonGamma = pSiS->CRT1VGAMonitorGamma; if(pSiS->VBFlags & CRT2_LCD) pSiS->CRT2MonGamma = pSiS->CRT2LCDMonitorGamma; else if(pSiS->VBFlags & CRT2_TV) { if(pSiS->VBFlags & TV_YPBPR) pSiS->CRT2MonGamma = 2200; /* */ else if(pSiS->VBFlags & TV_HIVISION) pSiS->CRT2MonGamma = 2200; /* ? */ else if(pSiS->VBFlags & TV_NTSC) pSiS->CRT2MonGamma = 2200; /* NTSC */ else pSiS->CRT2MonGamma = 2800; /* All PAL modes? */ } else if(pSiS->VBFlags & CRT2_VGA) pSiS->CRT2MonGamma = pSiS->CRT2VGAMonitorGamma; else pSiS->CRT2MonGamma = 0; /* Unknown */ /* Reset XV display properties (such as number of overlays, etc) */ /* (And copy monitor gamma) */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiSEnt->pScrn_1) { if(SISPTR(pSiSEnt->pScrn_1)->ResetXvDisplay) { (SISPTR(pSiSEnt->pScrn_1)->ResetXvDisplay)(pSiSEnt->pScrn_1); } SISPTR(pSiSEnt->pScrn_1)->CRT1MonGamma = pSiS->CRT1MonGamma; SISPTR(pSiSEnt->pScrn_1)->CRT2MonGamma = pSiS->CRT2MonGamma; } if(pSiSEnt->pScrn_2) { if(SISPTR(pSiSEnt->pScrn_2)->ResetXvDisplay) { (SISPTR(pSiSEnt->pScrn_1)->ResetXvDisplay)(pSiSEnt->pScrn_2); } SISPTR(pSiSEnt->pScrn_2)->CRT1MonGamma = pSiS->CRT1MonGamma; SISPTR(pSiSEnt->pScrn_2)->CRT2MonGamma = pSiS->CRT2MonGamma; } } else { #endif if(pSiS->ResetXvDisplay) { (pSiS->ResetXvDisplay)(pScrn); } #ifdef SISDUALHEAD } #endif /* Reset XV gamma correction */ if(pSiS->ResetXvGamma) { (pSiS->ResetXvGamma)(pScrn); } /* Reset various display parameters */ { int val = pSiS->siscrt1satgain; #ifdef SISDUALHEAD if(pSiS->DualHeadMode && pSiSEnt) val = pSiSEnt->siscrt1satgain; #endif SiS_SetSISCRT1SaturationGain(pScrn, val); } /* Apply TV settings given by options Do this even in DualHeadMode: - if this is called by SetModeCRT1, CRT2 mode has been reset by SetModeCRT1 - if this is called by SetModeCRT2, CRT2 mode has changed (duh!) -> Hence, in both cases, the settings must be re-applied. */ if(pSiS->VBFlags & CRT2_TV) { int val; if(pSiS->VBFlags2 & VB2_CHRONTEL) { int mychtvlumabandwidthcvbs = pSiS->chtvlumabandwidthcvbs; int mychtvlumabandwidthsvideo = pSiS->chtvlumabandwidthsvideo; int mychtvlumaflickerfilter = pSiS->chtvlumaflickerfilter; int mychtvchromabandwidth = pSiS->chtvchromabandwidth; int mychtvchromaflickerfilter = pSiS->chtvchromaflickerfilter; int mychtvcvbscolor = pSiS->chtvcvbscolor; int mychtvtextenhance = pSiS->chtvtextenhance; int mychtvcontrast = pSiS->chtvcontrast; int mytvxpos = pSiS->tvxpos; int mytvypos = pSiS->tvypos; #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) { mychtvlumabandwidthcvbs = pSiSEnt->chtvlumabandwidthcvbs; mychtvlumabandwidthsvideo = pSiSEnt->chtvlumabandwidthsvideo; mychtvlumaflickerfilter = pSiSEnt->chtvlumaflickerfilter; mychtvchromabandwidth = pSiSEnt->chtvchromabandwidth; mychtvchromaflickerfilter = pSiSEnt->chtvchromaflickerfilter; mychtvcvbscolor = pSiSEnt->chtvcvbscolor; mychtvtextenhance = pSiSEnt->chtvtextenhance; mychtvcontrast = pSiSEnt->chtvcontrast; mytvxpos = pSiSEnt->tvxpos; mytvypos = pSiSEnt->tvypos; } #endif if((val = mychtvlumabandwidthcvbs) != -1) { SiS_SetCHTVlumabandwidthcvbs(pScrn, val); } if((val = mychtvlumabandwidthsvideo) != -1) { SiS_SetCHTVlumabandwidthsvideo(pScrn, val); } if((val = mychtvlumaflickerfilter) != -1) { SiS_SetCHTVlumaflickerfilter(pScrn, val); } if((val = mychtvchromabandwidth) != -1) { SiS_SetCHTVchromabandwidth(pScrn, val); } if((val = mychtvchromaflickerfilter) != -1) { SiS_SetCHTVchromaflickerfilter(pScrn, val); } if((val = mychtvcvbscolor) != -1) { SiS_SetCHTVcvbscolor(pScrn, val); } if((val = mychtvtextenhance) != -1) { SiS_SetCHTVtextenhance(pScrn, val); } if((val = mychtvcontrast) != -1) { SiS_SetCHTVcontrast(pScrn, val); } /* Backup default TV position registers */ switch(pSiS->ChrontelType) { case CHRONTEL_700x: pSiS->tvx = SiS_GetCH700x(pSiS->SiS_Pr, 0x0a); pSiS->tvx |= (((SiS_GetCH700x(pSiS->SiS_Pr, 0x08) & 0x02) >> 1) << 8); pSiS->tvy = SiS_GetCH700x(pSiS->SiS_Pr, 0x0b); pSiS->tvy |= ((SiS_GetCH700x(pSiS->SiS_Pr, 0x08) & 0x01) << 8); #ifdef SISDUALHEAD if(pSiSEnt) { pSiSEnt->tvx = pSiS->tvx; pSiSEnt->tvy = pSiS->tvy; } #endif break; case CHRONTEL_701x: /* Not supported by hardware */ break; } if((val = mytvxpos) != 0) { SiS_SetTVxposoffset(pScrn, val); } if((val = mytvypos) != 0) { SiS_SetTVyposoffset(pScrn, val); } } if(pSiS->VBFlags2 & VB2_301) { int mysistvedgeenhance = pSiS->sistvedgeenhance; #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) { mysistvedgeenhance = pSiSEnt->sistvedgeenhance; } #endif if((val = mysistvedgeenhance) != -1) { SiS_SetSISTVedgeenhance(pScrn, val); } } if(pSiS->VBFlags2 & VB2_SISBRIDGE) { int mysistvantiflicker = pSiS->sistvantiflicker; int mysistvsaturation = pSiS->sistvsaturation; int mysistvcolcalibf = pSiS->sistvcolcalibf; int mysistvcolcalibc = pSiS->sistvcolcalibc; int mysistvcfilter = pSiS->sistvcfilter; int mysistvyfilter = pSiS->sistvyfilter; int mytvxpos = pSiS->tvxpos; int mytvypos = pSiS->tvypos; int mytvxscale = pSiS->tvxscale; int mytvyscale = pSiS->tvyscale; int i; ULong cbase; UChar ctemp; #ifdef SISDUALHEAD if(pSiSEnt && pSiS->DualHeadMode) { mysistvantiflicker = pSiSEnt->sistvantiflicker; mysistvsaturation = pSiSEnt->sistvsaturation; mysistvcolcalibf = pSiSEnt->sistvcolcalibf; mysistvcolcalibc = pSiSEnt->sistvcolcalibc; mysistvcfilter = pSiSEnt->sistvcfilter; mysistvyfilter = pSiSEnt->sistvyfilter; mytvxpos = pSiSEnt->tvxpos; mytvypos = pSiSEnt->tvypos; mytvxscale = pSiSEnt->tvxscale; mytvyscale = pSiSEnt->tvyscale; } #endif /* Backup default TV position, scale and colcalib registers */ inSISIDXREG(SISPART2,0x1f,pSiS->p2_1f); inSISIDXREG(SISPART2,0x20,pSiS->p2_20); inSISIDXREG(SISPART2,0x2b,pSiS->p2_2b); inSISIDXREG(SISPART2,0x42,pSiS->p2_42); inSISIDXREG(SISPART2,0x43,pSiS->p2_43); inSISIDXREG(SISPART2,0x01,pSiS->p2_01); inSISIDXREG(SISPART2,0x02,pSiS->p2_02); inSISIDXREG(SISPART2,0x44,pSiS->p2_44); inSISIDXREG(SISPART2,0x45,pSiS->p2_45); if(!(pSiS->VBFlags2 & VB2_301)) { inSISIDXREG(SISPART2,0x46,pSiS->p2_46); } else { pSiS->p2_46 = 0; } inSISIDXREG(SISPART2,0x0a,pSiS->p2_0a); inSISIDXREG(SISPART2,0x31,cbase); cbase = (cbase & 0x7f) << 8; inSISIDXREG(SISPART2,0x32,ctemp); cbase = (cbase | ctemp) << 8; inSISIDXREG(SISPART2,0x33,ctemp); cbase = (cbase | ctemp) << 8; inSISIDXREG(SISPART2,0x34,ctemp); pSiS->sistvccbase = (cbase | ctemp); inSISIDXREG(SISPART2,0x35,pSiS->p2_35); inSISIDXREG(SISPART2,0x36,pSiS->p2_36); inSISIDXREG(SISPART2,0x37,pSiS->p2_37); inSISIDXREG(SISPART2,0x38,pSiS->p2_38); if(!(pSiS->VBFlags2 & VB2_301)) { inSISIDXREG(SISPART2,0x47,pSiS->p2_47); inSISIDXREG(SISPART2,0x48,pSiS->p2_48); inSISIDXREG(SISPART2,0x49,pSiS->p2_49); inSISIDXREG(SISPART2,0x4a,pSiS->p2_4a); } inSISIDXREG(SISPART2,0x2f,pSiS->p2_2f); inSISIDXREG(SISPART2,0x30,pSiS->p2_30); for(i=0; i<9; i++) { inSISIDXREG(SISPART1,SiSScalingP1Regs[i],pSiS->scalingp1[i]); } for(i=0; i<9; i++) { inSISIDXREG(SISPART4,SiSScalingP4Regs[i],pSiS->scalingp4[i]); } if(pSiS->VBFlags2 & VB2_SISTAP4SCALER) { for(i=0; i<64; i++) { inSISIDXREG(SISPART2,(0xc0 + i),pSiS->scalingp2[i]); } } #ifdef SISDUALHEAD if(pSiSEnt) { pSiSEnt->p2_1f = pSiS->p2_1f; pSiSEnt->p2_20 = pSiS->p2_20; pSiSEnt->p2_42 = pSiS->p2_42; pSiSEnt->p2_43 = pSiS->p2_43; pSiSEnt->p2_2b = pSiS->p2_2b; pSiSEnt->p2_01 = pSiS->p2_01; pSiSEnt->p2_02 = pSiS->p2_02; pSiSEnt->p2_44 = pSiS->p2_44; pSiSEnt->p2_45 = pSiS->p2_45; pSiSEnt->p2_46 = pSiS->p2_46; pSiSEnt->p2_0a = pSiS->p2_0a; pSiSEnt->sistvccbase = pSiS->sistvccbase; pSiSEnt->p2_35 = pSiS->p2_35; pSiSEnt->p2_36 = pSiS->p2_36; pSiSEnt->p2_37 = pSiS->p2_37; pSiSEnt->p2_38 = pSiS->p2_38; pSiSEnt->p2_48 = pSiS->p2_48; pSiSEnt->p2_49 = pSiS->p2_49; pSiSEnt->p2_4a = pSiS->p2_4a; pSiSEnt->p2_2f = pSiS->p2_2f; pSiSEnt->p2_30 = pSiS->p2_30; pSiSEnt->p2_47 = pSiS->p2_47; for(i=0; i<9; i++) { pSiSEnt->scalingp1[i] = pSiS->scalingp1[i]; } for(i=0; i<9; i++) { pSiSEnt->scalingp4[i] = pSiS->scalingp4[i]; } if(pSiS->VBFlags2 & VB2_SISTAP4SCALER) { for(i=0; i<64; i++) { pSiSEnt->scalingp2[i] = pSiS->scalingp2[i]; } } } #endif if((val = mysistvantiflicker) != -1) { SiS_SetSISTVantiflicker(pScrn, val); } if((val = mysistvsaturation) != -1) { SiS_SetSISTVsaturation(pScrn, val); } if((val = mysistvcfilter) != -1) { SiS_SetSISTVcfilter(pScrn, val); } if((val = mysistvyfilter) != 1) { SiS_SetSISTVyfilter(pScrn, val); } if((val = mysistvcolcalibc) != 0) { SiS_SetSISTVcolcalib(pScrn, val, TRUE); } if((val = mysistvcolcalibf) != 0) { SiS_SetSISTVcolcalib(pScrn, val, FALSE); } if((val = mytvxpos) != 0) { SiS_SetTVxposoffset(pScrn, val); } if((val = mytvypos) != 0) { SiS_SetTVyposoffset(pScrn, val); } if((val = mytvxscale) != 0) { SiS_SetTVxscale(pScrn, val); } if((val = mytvyscale) != 0) { SiS_SetTVyscale(pScrn, val); } } } } /* Post-set SiS6326 TV registers */ static void SiS6326PostSetMode(ScrnInfoPtr pScrn, SISRegPtr sisReg) { SISPtr pSiS = SISPTR(pScrn); UChar tmp; int val; if(!(pSiS->SiS6326Flags & SIS6326_TVDETECTED)) return; #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif /* Backup default TV position registers */ pSiS->tvx1 = SiS6326GetTVReg(pScrn,0x3a); pSiS->tvx1 |= ((SiS6326GetTVReg(pScrn,0x3c) & 0x0f) << 8); pSiS->tvx2 = SiS6326GetTVReg(pScrn,0x26); pSiS->tvx2 |= ((SiS6326GetTVReg(pScrn,0x27) & 0xf0) << 4); pSiS->tvx3 = SiS6326GetTVReg(pScrn,0x12); pSiS->tvx3 |= ((SiS6326GetTVReg(pScrn,0x13) & 0xC0) << 2); pSiS->tvy1 = SiS6326GetTVReg(pScrn,0x11); pSiS->tvy1 |= ((SiS6326GetTVReg(pScrn,0x13) & 0x30) << 4); /* Handle TVPosOffset options (BEFORE switching on TV) */ if((val = pSiS->tvxpos) != 0) { SiS_SetTVxposoffset(pScrn, val); } if((val = pSiS->tvypos) != 0) { SiS_SetTVyposoffset(pScrn, val); } /* Switch on TV output. This is rather complicated, but * if we don't do it, TV output will flicker terribly. */ if(pSiS->SiS6326Flags & SIS6326_TVON) { orSISIDXREG(SISSR, 0x01, 0x20); tmp = SiS6326GetTVReg(pScrn,0x00); tmp &= ~0x04; while(!(inSISREG(SISINPSTAT) & 0x08)); /* Wait while NOT vb */ SiS6326SetTVReg(pScrn,0x00,tmp); for(val=0; val < 2; val++) { while(!(inSISREG(SISINPSTAT) & 0x08)); /* Wait while NOT vb */ while(inSISREG(SISINPSTAT) & 0x08); /* wait while vb */ } SiS6326SetTVReg(pScrn, 0x00, sisReg->sis6326tv[0]); tmp = inSISREG(SISINPSTAT); outSISREG(SISAR, 0x20); tmp = inSISREG(SISINPSTAT); while(inSISREG(SISINPSTAT) & 0x01); while(!(inSISREG(SISINPSTAT) & 0x01)); andSISIDXREG(SISSR, 0x01, ~0x20); for(val=0; val < 10; val++) { while(!(inSISREG(SISINPSTAT) & 0x08)); /* Wait while NOT vb */ while(inSISREG(SISINPSTAT) & 0x08); /* wait while vb */ } andSISIDXREG(SISSR, 0x01, ~0x20); } tmp = SiS6326GetTVReg(pScrn,0x00); if(!(tmp & 0x04)) return; /* Apply TV settings given by options */ if((val = pSiS->sistvantiflicker) != -1) { SiS_SetSIS6326TVantiflicker(pScrn, val); } if((val = pSiS->sis6326enableyfilter) != -1) { SiS_SetSIS6326TVenableyfilter(pScrn, val); } if((val = pSiS->sis6326yfilterstrong) != -1) { SiS_SetSIS6326TVyfilterstrong(pScrn, val); } } /* Check if video bridge is in slave mode */ Bool SiSBridgeIsInSlaveMode(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); UChar usScrP1_00; if(!(pSiS->VBFlags2 & VB2_VIDEOBRIDGE)) return FALSE; inSISIDXREG(SISPART1,0x00,usScrP1_00); if( ((pSiS->VGAEngine == SIS_300_VGA) && (usScrP1_00 & 0xa0) == 0x20) || ((pSiS->VGAEngine == SIS_315_VGA) && (usScrP1_00 & 0x50) == 0x10) ) { return TRUE; } return FALSE; } /* Build a list of the VESA modes the BIOS reports as valid */ static void SiSBuildVesaModeList(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe) { SISPtr pSiS = SISPTR(pScrn); int i = 0; while(vbe->VideoModePtr[i] != 0xffff) { sisModeInfoPtr m; VbeModeInfoBlock *mode; int id = vbe->VideoModePtr[i++]; if((mode = VBEGetModeInfo(pVbe, id)) == NULL) { continue; } m = xnfcalloc(sizeof(sisModeInfoRec), 1); if(!m) { VBEFreeModeInfo(mode); continue; } m->width = mode->XResolution; m->height = mode->YResolution; m->bpp = mode->BitsPerPixel; m->n = id; m->next = pSiS->SISVESAModeList; pSiS->SISVESAModeList = m; VBEFreeModeInfo(mode); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VESA BIOS supports mode number 0x%x: %ix%i (%i bpp)\n", m->n, m->width, m->height, m->bpp); } } /* Get VESA mode number from given resolution/depth */ static UShort SiSCalcVESAModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) { SISPtr pSiS = SISPTR(pScrn); sisModeInfoPtr m = pSiS->SISVESAModeList; UShort i = (pScrn->bitsPerPixel+7)/8 - 1; UShort ModeNumber = 0; int j; while(m) { if( (pScrn->bitsPerPixel == m->bpp) && (mode->HDisplay == m->width) && (mode->VDisplay == m->height) ) return m->n; m = m->next; } xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "No valid VESA BIOS mode found for %dx%d (%d bpp)\n", mode->HDisplay, mode->VDisplay, pScrn->bitsPerPixel); if(!pSiS->ROM661New) { /* VESA numbers changed! */ j = 0; while(VESAModeIndices[j] != 9999) { if( (mode->HDisplay == VESAModeIndices[j]) && (mode->VDisplay == VESAModeIndices[j+1]) ) { ModeNumber = VESAModeIndices[j + 2 + i]; break; } j += 6; } if(!ModeNumber) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid mode found for %dx%dx%d in built-in table either.\n", mode->HDisplay, mode->VDisplay, pScrn->bitsPerPixel); } } return(ModeNumber); } UShort SiS_GetModeNumber(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags) { SISPtr pSiS = SISPTR(pScrn); UShort i = (pSiS->CurrentLayout.bitsPerPixel+7)/8 - 1; BOOLEAN FSTN = pSiS->FSTN ? TRUE : FALSE; #ifdef SISDUALHEAD if(pSiS->DualHeadMode && pSiS->SecondHead) FSTN = FALSE; #endif return(SiS_GetModeID(pSiS->VGAEngine, VBFlags, mode->HDisplay, mode->VDisplay, i, FSTN, pSiS->LCDwidth, pSiS->LCDheight)); } static Bool SiSValidLCDUserMode(SISPtr pSiS, unsigned int VBFlags, DisplayModePtr mode, Bool isforlcda) { if(mode->Flags & V_INTERLACE) return FALSE; if(mode->HDisplay > 2048) return FALSE; if(mode->VDisplay > 1536) return FALSE; if(pSiS->VBFlags2 & VB2_LCD162MHZBRIDGE) { if(mode->Clock > 162500) return FALSE; #ifdef VB_FORBID_CRT2LCD_OVER_1600 if(!isforlcda) { if(mode->HDisplay > 1600) return FALSE; } #endif } else { /* 301, 301B, 302B (no LCDA!) */ if(mode->Clock > 130000) return FALSE; if(mode->Clock > 111000) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_WARNING, "WARNING: Mode clock beyond video bridge specs (%dMHz). Hardware damage might occure.\n", mode->Clock / 1000); } if(mode->HDisplay > 1600) return FALSE; if(mode->VDisplay > 1024) return FALSE; } return TRUE; } static Bool SiSValidVGA2UserMode(SISPtr pSiS, unsigned int VBFlags, DisplayModePtr mode) { if(mode->Flags & V_INTERLACE) return FALSE; if(mode->HDisplay > 2048) return FALSE; if(mode->VDisplay > 1536) return FALSE; if(pSiS->VBFlags2 & VB2_RAMDAC202MHZBRIDGE) { if(mode->Clock > 203000) return FALSE; } else if(pSiS->VBFlags2 & VB2_30xBLV) { if(mode->Clock > 162500) return FALSE; } else { if(mode->Clock > 135500) return FALSE; } return TRUE; } UShort SiS_CheckModeCRT1(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags, Bool havecustommodes) { SISPtr pSiS = SISPTR(pScrn); UShort i = (pSiS->CurrentLayout.bitsPerPixel+7)/8 - 1; int j; if(!(VBFlags & CRT1_LCDA)) { if((havecustommodes) && (!(mode->type & M_T_DEFAULT))) { return 0xfe; } } else if(pSiS->VBFlags2 & VB2_SISTMDSLCDABRIDGE) { if(pSiS->ChipType < SIS_661) { /* < 661 only? */ if(!(mode->type & M_T_DEFAULT)) { if(mode->HTotal > 2055) return 0; /* (Default mode will be caught in mode switching code) */ } } if(pSiS->SiS_Pr->CP_HaveCustomData) { for(j=0; j<7; j++) { if((pSiS->SiS_Pr->CP_DataValid[j]) && (mode->HDisplay == pSiS->SiS_Pr->CP_HDisplay[j]) && (mode->VDisplay == pSiS->SiS_Pr->CP_VDisplay[j]) && (mode->type & M_T_BUILTIN)) return 0xfe; } } if((pSiS->AddedPlasmaModes) && (mode->type & M_T_BUILTIN)) return 0xfe; if((havecustommodes) && (pSiS->LCDwidth) && /* = test if LCD present */ (!(mode->type & M_T_DEFAULT)) && (SiSValidLCDUserMode(pSiS, VBFlags, mode, TRUE))) return 0xfe; if((mode->HDisplay > pSiS->LCDwidth) || (mode->VDisplay > pSiS->LCDheight)) { return 0; } } else { if((mode->HDisplay > pSiS->LCDwidth) || (mode->VDisplay > pSiS->LCDheight)) { return 0; } } return(SiS_GetModeID(pSiS->VGAEngine, VBFlags, mode->HDisplay, mode->VDisplay, i, pSiS->FSTN, pSiS->LCDwidth, pSiS->LCDheight)); } UShort SiS_CheckModeCRT2(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags, Bool havecustommodes) { SISPtr pSiS = SISPTR(pScrn); UShort i = (pSiS->CurrentLayout.bitsPerPixel+7)/8 - 1; UShort ModeIndex = 0; int j; #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "Inside CheckCalcModeIndex (VBFlags %lx, mode %dx%d)\n", VBFlags,mode->HDisplay, mode->VDisplay); #endif if(VBFlags & CRT2_LCD) { /* CRT2 is LCD */ if((pSiS->VBFlags2 & VB2_SISTMDSBRIDGE) && (!(pSiS->VBFlags2 & VB2_30xBDH))) { if(pSiS->SiS_Pr->CP_HaveCustomData) { for(j=0; j<7; j++) { if((pSiS->SiS_Pr->CP_DataValid[j]) && (mode->HDisplay == pSiS->SiS_Pr->CP_HDisplay[j]) && (mode->VDisplay == pSiS->SiS_Pr->CP_VDisplay[j]) && #ifdef VB_FORBID_CRT2LCD_OVER_1600 (mode->HDisplay <= 1600) && #endif (mode->type & M_T_BUILTIN)) return 0xfe; } } /* All plasma modes have HDisplay <= 1600 */ if((pSiS->AddedPlasmaModes) && (mode->type & M_T_BUILTIN)) return 0xfe; if((havecustommodes) && (pSiS->LCDwidth) && /* = test if LCD present */ (!(mode->type & M_T_DEFAULT)) && (SiSValidLCDUserMode(pSiS, VBFlags, mode, FALSE))) return 0xfe; } if( ((mode->HDisplay <= pSiS->LCDwidth) && (mode->VDisplay <= pSiS->LCDheight)) || ((pSiS->SiS_Pr->SiS_CustomT == CUT_PANEL848) && (((mode->HDisplay == 1360) && (mode->HDisplay == 768)) || ((mode->HDisplay == 1024) && (mode->HDisplay == 768)) || ((mode->HDisplay == 800) && (mode->HDisplay == 600)))) || ((pSiS->SiS_Pr->SiS_CustomT == CUT_PANEL856) && (((mode->HDisplay == 1024) && (mode->HDisplay == 768)) || ((mode->HDisplay == 800) && (mode->HDisplay == 600)))) ) { ModeIndex = SiS_GetModeID_LCD(pSiS->VGAEngine, VBFlags, mode->HDisplay, mode->VDisplay, i, pSiS->FSTN, pSiS->SiS_Pr->SiS_CustomT, pSiS->LCDwidth, pSiS->LCDheight, pSiS->VBFlags2); } } else if(VBFlags & CRT2_TV) { /* CRT2 is TV */ ModeIndex = SiS_GetModeID_TV(pSiS->VGAEngine, VBFlags, mode->HDisplay, mode->VDisplay, i, pSiS->VBFlags2); } else if(VBFlags & CRT2_VGA) { /* CRT2 is VGA2 */ if((pSiS->AddedPlasmaModes) && (mode->type & M_T_BUILTIN)) return 0xfe; if((havecustommodes) && (!(mode->type & M_T_DEFAULT)) && (SiSValidVGA2UserMode(pSiS, VBFlags, mode))) return 0xfe; ModeIndex = SiS_GetModeID_VGA2(pSiS->VGAEngine, VBFlags, mode->HDisplay, mode->VDisplay, i, pSiS->VBFlags2); } else { /* no CRT2 */ /* Return a valid mode number */ ModeIndex = 0xfe; } return(ModeIndex); } /* Calculate the vertical refresh rate from a mode */ float SiSCalcVRate(DisplayModePtr mode) { float hsync, refresh = 0; if(mode->HSync > 0.0) hsync = mode->HSync; else if(mode->HTotal > 0) hsync = (float)mode->Clock / (float)mode->HTotal; else hsync = 0.0; if(mode->VTotal > 0) refresh = hsync * 1000.0 / mode->VTotal; if(mode->Flags & V_INTERLACE) refresh *= 2.0; if(mode->Flags & V_DBLSCAN) refresh /= 2.0; if(mode->VScan > 1) refresh /= mode->VScan; if(mode->VRefresh > 0.0) refresh = mode->VRefresh; if(hsync == 0.0 || refresh == 0.0) return 0.0; return refresh; } /* Calculate CR33 (rate index) for CRT1. * Calculation is done using currentmode, therefore it is * recommended to set VertRefresh and HorizSync to correct * values in config file. */ UChar SISSearchCRT1Rate(ScrnInfoPtr pScrn, DisplayModePtr mode) { SISPtr pSiS = SISPTR(pScrn); int i = 0, irefresh; UShort xres = mode->HDisplay; UShort yres = mode->VDisplay; UChar index, defindex; Bool checksis730 = FALSE; defindex = (xres == 800 || xres == 1024 || xres == 1280) ? 0x02 : 0x01; irefresh = (int)SiSCalcVRate(mode); if(!irefresh) return defindex; /* SiS730 has troubles on CRT2 if CRT1 is at 32bpp */ if( (pSiS->ChipType == SIS_730) && (pSiS->VBFlags2 & VB2_VIDEOBRIDGE) && (pSiS->CurrentLayout.bitsPerPixel == 32) ) { #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiS->SecondHead) { checksis730 = TRUE; } } else #endif if((!pSiS->UseVESA) && (pSiS->VBFlags & CRT2_ENABLE) && (!pSiS->CRT1off)) { checksis730 = TRUE; } } #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "Debug: CalcVRate returned %d\n", irefresh); #endif /* We need the REAL refresh rate here */ if(mode->Flags & V_INTERLACE) irefresh /= 2; /* Do not multiply by 2 when DBLSCAN! */ #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "Debug: Rate after correction = %d\n", irefresh); #endif index = 0; while((sisx_vrate[i].idx != 0) && (sisx_vrate[i].xres <= xres)) { if((sisx_vrate[i].xres == xres) && (sisx_vrate[i].yres == yres)) { if((checksis730 == FALSE) || (sisx_vrate[i].SiS730valid32bpp == TRUE)) { if(sisx_vrate[i].refresh == irefresh) { index = sisx_vrate[i].idx; break; } else if(sisx_vrate[i].refresh > irefresh) { if((sisx_vrate[i].refresh - irefresh) <= 3) { index = sisx_vrate[i].idx; } else if( ((checksis730 == FALSE) || (sisx_vrate[i - 1].SiS730valid32bpp == TRUE)) && ((irefresh - sisx_vrate[i - 1].refresh) <= 2) && (sisx_vrate[i].idx != 1) ) { index = sisx_vrate[i - 1].idx; } break; } else if((irefresh - sisx_vrate[i].refresh) <= 2) { index = sisx_vrate[i].idx; break; } } } i++; } if(index > 0) return index; else return defindex; } void SISWaitRetraceCRT1(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int watchdog; UChar temp; inSISIDXREG(SISCR,0x17,temp); if(!(temp & 0x80)) return; inSISIDXREG(SISSR,0x1f,temp); if(temp & 0xc0) return; watchdog = 65536; while((inSISREG(SISINPSTAT) & 0x08) && --watchdog); watchdog = 65536; while((!(inSISREG(SISINPSTAT) & 0x08)) && --watchdog); } void SISWaitRetraceCRT2(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int watchdog; UChar temp, reg; if(SiSBridgeIsInSlaveMode(pScrn)) { SISWaitRetraceCRT1(pScrn); return; } switch(pSiS->VGAEngine) { case SIS_300_VGA: reg = 0x25; break; case SIS_315_VGA: reg = 0x30; break; default: return; } watchdog = 65536; do { inSISIDXREG(SISPART1, reg, temp); if(!(temp & 0x02)) break; } while(--watchdog); watchdog = 65536; do { inSISIDXREG(SISPART1, reg, temp); if(temp & 0x02) break; } while(--watchdog); } static void SISWaitVBRetrace(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiS->SecondHead) SISWaitRetraceCRT1(pScrn); else SISWaitRetraceCRT2(pScrn); } else { #endif if(pSiS->VBFlags & DISPTYPE_DISP1) { SISWaitRetraceCRT1(pScrn); } if(pSiS->VBFlags & DISPTYPE_DISP2) { if(!(SiSBridgeIsInSlaveMode(pScrn))) { SISWaitRetraceCRT2(pScrn); } } #ifdef SISDUALHEAD } #endif } else { SISWaitRetraceCRT1(pScrn); } } #define MODEID_OFF 0x449 UChar SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, UShort offset, UChar value) { UChar ret = 0; #ifdef SIS_USE_BIOS_SCRATCH UChar *base; #endif /* For some reasons (like detecting the current display mode), * we need to read (or write-back) values from the BIOS * scratch area. This area is only valid for the primary * graphics card. For the secondary, we just return some * defaults and ignore requests to write data. As regards * the display mode: If sisfb is loaded for the secondary * card, it very probably has set a mode, but in any case * informed us via its info packet. So this here will not be * called for mode detection in this case. */ switch(offset) { case 0x489: ret = 0x11; /* Default VGA Info */ break; case MODEID_OFF: ret = 0x03; /* Default current display mode */ break; } #ifdef SIS_USE_BIOS_SCRATCH if(SISPTR(pScrn)->Primary) { base = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_MMIO, 0, 0x2000); if(!base) { SISErrorLog(pScrn, "(Could not map BIOS scratch area)\n"); return ret; } ret = *(base + offset); /* value != 0xff means: set register */ if(value != 0xff) { *(base + offset) = value; } xf86UnMapVidMem(pScrn->scrnIndex, base, 0x2000); } #endif return ret; } UChar SiS_GetSetModeID(ScrnInfoPtr pScrn, UChar id) { return(SiS_GetSetBIOSScratch(pScrn, MODEID_OFF, id)); } void SiSMemCopyToVideoRam(SISPtr pSiS, UChar *to, UChar *from, int size) { if((ULong)to & 15) (*pSiS->SiSFastMemCopy)(to, from, size); else (*pSiS->SiSFastVidCopy)(to, from, size); } void SiSMemCopyFromVideoRam(SISPtr pSiS, UChar *to, UChar *from, int size) { if((ULong)to & 15) (*pSiS->SiSFastMemCopyFrom)(to, from, size); else (*pSiS->SiSFastVidCopyFrom)(to, from, size); } void sisSaveUnlockExtRegisterLock(SISPtr pSiS, UChar *reg1, UChar *reg2) { register UChar val; ULong mylockcalls; #ifdef TWDEBUG UChar val1, val2; int i; #endif pSiS->lockcalls++; mylockcalls = pSiS->lockcalls; /* check if already unlocked */ inSISIDXREG(SISSR, 0x05, val); if(val != 0xa1) { /* save State */ if(reg1) *reg1 = val; /* unlock */ outSISIDXREG(SISSR, 0x05, 0x86); /* Now check again */ inSISIDXREG(SISSR, 0x05, val); if(val != 0xA1) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_WARNING, "Failed to unlock SR registers at relocated i/o ports\n"); #ifdef TWDEBUG for(i = 0; i <= 0x3f; i++) { inSISIDXREG(SISSR, i, val1); inSISIDXREG(0x3c4, i, val2); xf86DrvMsg(pSiS->pScrn->scrnIndex, X_INFO, "SR%02d: RelIO=0x%02x 0x3c4=0x%02x (%ld)\n", i, val1, val2, mylockcalls); } #endif /* Emergency measure: unlock at 0x3c4, and try to enable relocated IO ports */ switch(pSiS->VGAEngine) { case SIS_OLD_VGA: case SIS_530_VGA: outSISIDXREG(0x3c4, 0x05, 0x86); andSISIDXREG(0x3c4, 0x33, ~0x20); break; case SIS_300_VGA: case SIS_315_VGA: outSISIDXREG(0x3c4, 0x05, 0x86); orSISIDXREG(0x3c4, 0x20, 0x20); break; } outSISIDXREG(SISSR, 0x05, 0x86); inSISIDXREG(SISSR, 0x05, val); if(val != 0xa1) { SISErrorLog(pSiS->pScrn, "Failed to unlock SR registers (%p, %lx, 0x%02x; %ld)\n", (void *)pSiS, (ULong)pSiS->RelIO, val, mylockcalls); /* Now await doom... */ } } } if((pSiS->VGAEngine == SIS_OLD_VGA) || (pSiS->VGAEngine == SIS_530_VGA)) { inSISIDXREG(SISCR, 0x80, val); if(val != 0xa1) { /* save State */ if(reg2) *reg2 = val; outSISIDXREG(SISCR, 0x80, 0x86); inSISIDXREG(SISCR, 0x80, val); if(val != 0xA1) { SISErrorLog(pSiS->pScrn, "Failed to unlock cr registers (%p, %lx, 0x%02x)\n", (void *)pSiS, (ULong)pSiS->RelIO, val); } } } } void sisRestoreExtRegisterLock(SISPtr pSiS, UChar reg1, UChar reg2) { /* restore lock */ #ifndef UNLOCK_ALWAYS outSISIDXREG(SISSR, 0x05, reg1 == 0xA1 ? 0x86 : 0x00); if((pSiS->VGAEngine == SIS_OLD_VGA) || (pSiS->VGAEngine == SIS_530_VGA)) { outSISIDXREG(SISCR, 0x80, reg2 == 0xA1 ? 0x86 : 0x00); } #endif } xf86-video-sis-0.10.7/src/sis_video.c0000664000076400007640000042427611763614406014173 00000000000000/* * Xv driver for SiS 300, 315 and 330 series. * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * * Formerly based on a mostly non-working code fragment for the 630 by * Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan which is * Copyright (C) 2000 Silicon Integrated Systems Corp, Inc. * * Basic structure based on the mga Xv driver by Mark Vojkovich * and i810 Xv driver by Jonathan Bian . * * All comments in this file are by Thomas Winischhofer. * * The overlay adaptor supports the following chipsets: * SiS300: No registers >0x65, two overlays (one used for CRT1, one for CRT2) * SiS630/730: No registers >0x6b, two overlays (one used for CRT1, one for CRT2) * SiS550: Full register range, two overlays (one used for CRT1, one for CRT2) * SiS315: Full register range, one overlay (used for both CRT1 and CRT2 alt.) * SiS650/740: Full register range, one overlay (used for both CRT1 and CRT2 alt.) * SiSM650/651: Full register range, two overlays (one used for CRT1, one for CRT2) * SiS330: Full register range, one overlay (used for both CRT1 and CRT2 alt.) * SiS661/741/760: Full register range, two overlays (one used for CRT1, one for CRT2) * SiS340: - ? overlays. Extended registers for DDA. * SiS761: - ? overlays. Extended registers for DDA. * XGI Volari V3XT/V5/V8: 1 Overlay. Extended registers for DDA. * * Help for reading the code: * 315/550/650/740/M650/651/330/661/741/76x/340/XGI = SIS_315_VGA * 300/630/730 = SIS_300_VGA * For chipsets with 2 overlays, hasTwoOverlays will be true * * Notes on display modes: * * -) dual head mode: * DISPMODE is either SINGLE1 or SINGLE2, hence you need to check dualHeadMode flag * DISPMODE is _never_ MIRROR. * a) Chipsets with 2 overlays: * 315/330 series: Only half sized overlays available (width 960), 660: 1536 * Overlay 1 is used on CRT1, overlay 2 for CRT2. * b) Chipsets with 1 overlay: * Full size overlays available. * Overlay is used for either CRT1 or CRT2 * -) merged fb mode: * a) Chipsets with 2 overlays: * 315/330 series: Only half sized overlays available (width 960), 660: 1536 * DISPMODE is always MIRROR. Overlay 1 is used for CRT1, overlay 2 for CRT2. * b) Chipsets with 1 overlay: * Full size overlays available. * DISPMODE is either SINGLE1 or SINGLE2. Overlay is used accordingly on either * CRT1 or CRT2 (automatically, where it is located) * -) mirror mode (without dualhead or mergedfb) * a) Chipsets with 2 overlays: * 315/330 series: Only half sized overlays available (width 960), 660: 1536 * DISPMODE is MIRROR. Overlay 1 is used for CRT1, overlay 2 for CRT2. * b) Chipsets with 1 overlay: * Full size overlays available. * DISPMODE is either SINGLE1 or SINGLE2. Overlay is used depending on * XvOnCRT2 flag. * * About the video blitter: * The video blitter adaptor supports 16 ports. By default, adaptor 0 will * be the overlay adaptor, adaptor 1 the video blitter. The option XvDefaultAdaptor * allows reversing this. * Since SiS does not provide information on the 3D engine, I could not * implement scaling. Instead, the driver paints a black border around the unscaled * video if the destination area is bigger than the video. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "sis.h" #ifdef SIS_USE_XAA #include "xf86fbman.h" #endif #include "regionstr.h" #include "xf86xv.h" #include #include "dixstruct.h" #include "fourcc.h" #define SIS_NEED_inSISREG #define SIS_NEED_outSISREG #define SIS_NEED_inSISIDXREG #define SIS_NEED_outSISIDXREG #define SIS_NEED_setSISIDXREGmask #define SIS_NEED_MYMMIO #include "sis_regs.h" #ifdef INCL_YUV_BLIT_ADAPTOR #include "sis310_accel.h" #endif #include "sis_video.h" /********************************* * Raw register access * *********************************/ #if 0 static CARD32 _sisread(SISPtr pSiS, CARD32 reg) { return *(pSiS->IOBase + reg); } static void _siswrite(SISPtr pSiS, CARD32 reg, CARD32 data) { *(pSiS->IOBase + reg) = data; } #endif static CARD8 getsrreg(SISPtr pSiS, CARD8 reg) { CARD8 ret; inSISIDXREG(SISSR, reg, ret); return ret; } static CARD8 getvideoreg(SISPtr pSiS, CARD8 reg) { CARD8 ret; inSISIDXREG(SISVID, reg, ret); return ret; } static __inline void setvideoreg(SISPtr pSiS, CARD8 reg, CARD8 data) { outSISIDXREG(SISVID, reg, data); } static __inline void setvideoregmask(SISPtr pSiS, CARD8 reg, CARD8 data, CARD8 mask) { setSISIDXREGmask(SISVID, reg, data, mask); } static void setsrregmask(SISPtr pSiS, CARD8 reg, CARD8 data, CARD8 mask) { setSISIDXREGmask(SISSR, reg, data, mask); } /* VBlank */ static CARD8 vblank_active_CRT1(SISPtr pSiS, SISPortPrivPtr pPriv) { return(inSISREG(SISINPSTAT) & 0x08); /* Verified */ } static CARD8 vblank_active_CRT2(SISPtr pSiS, SISPortPrivPtr pPriv) { CARD8 ret; if(pPriv->bridgeIsSlave) return(vblank_active_CRT1(pSiS, pPriv)); if(pSiS->VGAEngine == SIS_315_VGA) { inSISIDXREG(SISPART1, 0x30, ret); } else { inSISIDXREG(SISPART1, 0x25, ret); } return(ret & 0x02); /* Verified */ } /* Scanline - unused */ #if 0 static CARD16 get_scanline_CRT1(SISPtr pSiS) { CARD32 line; _siswrite(pSiS, REG_PRIM_CRT_COUNTER, 0x00000001); line = _sisread(pSiS, REG_PRIM_CRT_COUNTER); return((CARD16)((line >> 16) & 0x07FF)); } #endif static CARD16 get_scanline_CRT2(SISPtr pSiS, SISPortPrivPtr pPriv) { CARD8 reg1, reg2; if(pSiS->VGAEngine == SIS_315_VGA) { inSISIDXREG(SISPART1, 0x32, reg1); inSISIDXREG(SISPART1, 0x33, reg2); } else { inSISIDXREG(SISPART1, 0x27, reg1); inSISIDXREG(SISPART1, 0x28, reg2); } return((CARD16)(reg1 | ((reg2 & 0x70) << 4))); } /* Helper: Count attributes */ static int SiSCountAttributes(XF86AttributeRec *attrs) { int num = 0; while(attrs[num].name) num++; return num; } /********************************* * Video gamma * *********************************/ static void SiSComputeXvGamma(SISPtr pSiS) { int num = 255, i; double red = 1.0 / (double)((double)pSiS->XvGammaRed / 1000); double green = 1.0 / (double)((double)pSiS->XvGammaGreen / 1000); double blue = 1.0 / (double)((double)pSiS->XvGammaBlue / 1000); for(i = 0; i <= num; i++) { pSiS->XvGammaRampRed[i] = (red == 1.0) ? i : (CARD8)(pow((double)i / (double)num, red) * (double)num + 0.5); pSiS->XvGammaRampGreen[i] = (green == 1.0) ? i : (CARD8)(pow((double)i / (double)num, green) * (double)num + 0.5); pSiS->XvGammaRampBlue[i] = (blue == 1.0) ? i : (CARD8)(pow((double)i / (double)num, blue) * (double)num + 0.5); } } static void SiSSetXvGamma(SISPtr pSiS) { int i; UChar backup = getsrreg(pSiS, 0x1f); setsrregmask(pSiS, 0x1f, 0x08, 0x18); for(i = 0; i <= 255; i++) { SIS_MMIO_OUT32(pSiS->IOBase, 0x8570, (i << 24) | (pSiS->XvGammaRampBlue[i] << 16) | (pSiS->XvGammaRampGreen[i] << 8) | pSiS->XvGammaRampRed[i]); } setsrregmask(pSiS, 0x1f, backup, 0xff); } void SiSUpdateXvGamma(SISPtr pSiS, SISPortPrivPtr pPriv) { UChar sr7 = getsrreg(pSiS, 0x07); if(!pSiS->XvGamma) return; if(!(pSiS->MiscFlags & MISC_CRT1OVERLAYGAMMA)) return; #ifdef SISDUALHEAD if((pPriv->dualHeadMode) && (!pSiS->SecondHead)) return; #endif if(!(sr7 & 0x04)) return; SiSComputeXvGamma(pSiS); SiSSetXvGamma(pSiS); } static void SISResetXvGamma(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); SISPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); SiSUpdateXvGamma(pSiS, pPriv); } /********************************* * InitVideo() * *********************************/ void SISInitVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; XF86VideoAdaptorPtr newAdaptor = NULL, newBlitAdaptor = NULL; int num_adaptors; newAdaptor = SISSetupImageVideo(pScreen); if(newAdaptor) { SISInitOffscreenImages(pScreen); } #ifdef INCL_YUV_BLIT_ADAPTOR if( ( (pSiS->ChipFlags & SiSCF_Is65x) || (pSiS->ChipType >= SIS_330) ) && (pScrn->bitsPerPixel != 8) ) { newBlitAdaptor = SISSetupBlitVideo(pScreen); } #endif num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); if(newAdaptor || newBlitAdaptor) { int size = num_adaptors; if(newAdaptor) size++; if(newBlitAdaptor) size++; newAdaptors = malloc(size * sizeof(XF86VideoAdaptorPtr*)); if(newAdaptors) { if(num_adaptors) { memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr)); } if(pSiS->XvDefAdaptorBlit) { if(newBlitAdaptor) { newAdaptors[num_adaptors] = newBlitAdaptor; num_adaptors++; } } if(newAdaptor) { newAdaptors[num_adaptors] = newAdaptor; num_adaptors++; } if(!pSiS->XvDefAdaptorBlit) { if(newBlitAdaptor) { newAdaptors[num_adaptors] = newBlitAdaptor; num_adaptors++; } } adaptors = newAdaptors; } } if(num_adaptors) { xf86XVScreenInit(pScreen, adaptors, num_adaptors); } if(newAdaptors) { free(newAdaptors); } } /********************************* * SetPortsDefault() * *********************************/ void SISSetPortDefaults(ScrnInfoPtr pScrn, SISPortPrivPtr pPriv) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate;; #endif pPriv->colorKey = pSiS->colorKey = 0x000101fe; pPriv->brightness = pSiS->XvDefBri; pPriv->contrast = pSiS->XvDefCon; pPriv->hue = pSiS->XvDefHue; pPriv->saturation = pSiS->XvDefSat; pPriv->autopaintColorKey = TRUE; pPriv->disablegfx = pSiS->XvDefDisableGfx; pPriv->disablegfxlr= pSiS->XvDefDisableGfxLR; pSiS->disablecolorkeycurrent = pSiS->XvDisableColorKey; pPriv->usechromakey = pSiS->XvUseChromaKey; pPriv->insidechromakey = pSiS->XvInsideChromaKey; pPriv->yuvchromakey = pSiS->XvYUVChromaKey; pPriv->chromamin = pSiS->XvChromaMin; pPriv->chromamax = pSiS->XvChromaMax; if(pPriv->dualHeadMode) { #ifdef SISDUALHEAD if(!pSiS->SecondHead) { pPriv->tvxpos = pSiS->tvxpos; pPriv->tvypos = pSiS->tvypos; pPriv->updatetvxpos = TRUE; pPriv->updatetvypos = TRUE; } #endif } else { pPriv->tvxpos = pSiS->tvxpos; pPriv->tvypos = pSiS->tvypos; pPriv->updatetvxpos = TRUE; pPriv->updatetvypos = TRUE; } #ifdef SIS_CP SIS_CP_VIDEO_DEF #endif if(pPriv->dualHeadMode) { #ifdef SISDUALHEAD pPriv->crtnum = pSiSEnt->curxvcrtnum = pSiSEnt->XvOnCRT2 ? 1 : 0; #endif } else pPriv->crtnum = pSiS->XvOnCRT2 ? 1 : 0; pSiS->XvGammaRed = pSiS->XvGammaRedDef; pSiS->XvGammaGreen = pSiS->XvGammaGreenDef; pSiS->XvGammaBlue = pSiS->XvGammaBlueDef; SiSUpdateXvGamma(pSiS, pPriv); } /********************************* * ResetVideo() * *********************************/ static void SISResetVideo(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); SISPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); /* Unlock registers */ #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif if(getvideoreg (pSiS, Index_VI_Passwd) != 0xa1) { setvideoreg (pSiS, Index_VI_Passwd, 0x86); if(getvideoreg (pSiS, Index_VI_Passwd) != 0xa1) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Xv: Video password could not unlock registers\n"); } /* Initialize first overlay (CRT1) ------------------------------- */ /* This bit has obviously a different meaning on 315 series (linebuffer-related) */ if(pSiS->VGAEngine == SIS_300_VGA) { /* Write-enable video registers */ setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x80, 0x81); } else { /* Select overlay 2, clear all linebuffer related bits */ setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x00, 0xb1); } /* Disable overlay */ setvideoregmask(pSiS, Index_VI_Control_Misc0, 0x00, 0x02); /* Disable bob de-interlacer and some strange bit */ setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x82); /* Select RGB chroma key format (300 series only) */ if(pSiS->VGAEngine == SIS_300_VGA) { setvideoregmask(pSiS, Index_VI_Control_Misc0, 0x00, 0x40); } /* Reset scale control and contrast */ /* (Enable DDA (interpolation)) */ setvideoregmask(pSiS, Index_VI_Scale_Control, 0x60, 0x60); setvideoregmask(pSiS, Index_VI_Contrast_Enh_Ctrl, 0x04, 0x1F); setvideoreg(pSiS, Index_VI_Disp_Y_Buf_Preset_Low, 0x00); setvideoreg(pSiS, Index_VI_Disp_Y_Buf_Preset_Middle, 0x00); setvideoreg(pSiS, Index_VI_UV_Buf_Preset_Low, 0x00); setvideoreg(pSiS, Index_VI_UV_Buf_Preset_Middle, 0x00); setvideoreg(pSiS, Index_VI_Disp_Y_UV_Buf_Preset_High, 0x00); setvideoreg(pSiS, Index_VI_Play_Threshold_Low, 0x00); setvideoreg(pSiS, Index_VI_Play_Threshold_High, 0x00); if(pSiS->Chipset == PCI_CHIP_SIS330) { /* Disable contrast enhancement (?) */ setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, 0x00, 0x10); } else if(pPriv->is661741760) { setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, 0x00, 0xE0); if(pPriv->is760) { setvideoregmask(pSiS, Index_VI_V_Buf_Start_Over, 0x3c, 0x3c); } else { /* 661, 741 */ setvideoregmask(pSiS, Index_VI_V_Buf_Start_Over, 0x2c, 0x3c); } } else if((pSiS->Chipset == PCI_CHIP_SIS340) || (pSiS->Chipset == PCI_CHIP_XGIXG20) || (pSiS->Chipset == PCI_CHIP_XGIXG40)) { /* Disable contrast enhancement (?) */ setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, 0x00, 0x10); /* Threshold high */ setvideoregmask(pSiS, 0xb5, 0x00, 0x01); setvideoregmask(pSiS, 0xb6, 0x00, 0x01); /* Enable horizontal, disable vertical 4-tap DDA scaler */ setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, 0x40, 0xc0); set_dda_regs(pSiS, 1.0); /* Enable software-flip */ setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, 0x20, 0x20); /* "Disable video processor" */ setsrregmask(pSiS, 0x3f, 0x00, 0x02); } else if(pPriv->is761) { /* Disable contrast enhancement (?) */ setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, 0x00, 0x10); /* Threshold high */ setvideoregmask(pSiS, 0xb5, 0x00, 0x01); setvideoregmask(pSiS, 0xb6, 0x00, 0x01); /* Enable horizontal, disable vertical 4-tap DDA scaler */ setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, 0x40, 0xC0); /* ? */ setvideoregmask(pSiS, 0xb6, 0x02, 0x02); set_dda_regs(pSiS, 1.0); setvideoregmask(pSiS, Index_VI_V_Buf_Start_Over, 0x00, 0x3c); } if((pSiS->ChipFlags & SiSCF_Is65x) || (pPriv->is661741760)) { setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x00, 0x04); } /* Reset top window position for scanline check */ setvideoreg(pSiS, Index_VI_Win_Ver_Disp_Start_Low, 0x00); setvideoreg(pSiS, Index_VI_Win_Ver_Over, 0x00); /* Initialize second overlay (CRT2) - only for 300, 630/730, 550, M650/651, 661/741/660/760 */ if(pSiS->hasTwoOverlays) { if(pSiS->VGAEngine == SIS_300_VGA) { /* Write-enable video registers */ setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x81, 0x81); } else { /* Select overlay 2, clear all linebuffer related bits */ setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x01, 0xb1); } /* Disable overlay */ setvideoregmask(pSiS, Index_VI_Control_Misc0, 0x00, 0x02); /* Disable bob de-interlacer and some strange bit */ setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x82); /* Select RGB chroma key format */ if(pSiS->VGAEngine == SIS_300_VGA) { setvideoregmask(pSiS, Index_VI_Control_Misc0, 0x00, 0x40); } /* Reset scale control and contrast */ /* (Enable DDA (interpolation)) */ setvideoregmask(pSiS, Index_VI_Scale_Control, 0x60, 0x60); setvideoregmask(pSiS, Index_VI_Contrast_Enh_Ctrl, 0x04, 0x1F); setvideoreg(pSiS, Index_VI_Disp_Y_Buf_Preset_Low, 0x00); setvideoreg(pSiS, Index_VI_Disp_Y_Buf_Preset_Middle, 0x00); setvideoreg(pSiS, Index_VI_UV_Buf_Preset_Low, 0x00); setvideoreg(pSiS, Index_VI_UV_Buf_Preset_Middle, 0x00); setvideoreg(pSiS, Index_VI_Disp_Y_UV_Buf_Preset_High, 0x00); setvideoreg(pSiS, Index_VI_Play_Threshold_Low, 0x00); setvideoreg(pSiS, Index_VI_Play_Threshold_High, 0x00); if(pPriv->is661741760) { CARD8 temp; setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, 0x00, 0xE0); switch(pSiS->ChipType) { case SIS_661: temp = 0x24; break; case SIS_741: temp = 0x2c; break; default: temp = 0x3c; } setvideoregmask(pSiS, Index_VI_V_Buf_Start_Over, temp, 0x3c); } else if(pPriv->is761) { setvideoregmask(pSiS, Index_VI_V_Buf_Start_Over, 0x00, 0x3c); } else if(pSiS->Chipset == PCI_CHIP_SIS340) { /* 2 overlays? */ setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, 0x00, 0x10); setvideoregmask(pSiS, 0xb5, 0x00, 0x01); setvideoregmask(pSiS, 0xb6, 0x00, 0x01); setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, 0x40, 0xC0); set_dda_regs(pSiS, 1.0); setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, 0x20, 0x20); } setvideoreg(pSiS, Index_VI_Win_Ver_Disp_Start_Low, 0x00); setvideoreg(pSiS, Index_VI_Win_Ver_Over, 0x00); } /* set default properties for overlay 1 (CRT1) -------------------------- */ setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x00, 0x01); setvideoregmask(pSiS, Index_VI_Contrast_Enh_Ctrl, 0x04, 0x07); setvideoreg(pSiS, Index_VI_Brightness, 0x20); if(pSiS->VGAEngine == SIS_315_VGA) { setvideoreg(pSiS, Index_VI_Hue, 0x00); setvideoreg(pSiS, Index_VI_Saturation, 0x00); } /* set default properties for overlay 2(CRT2) -------------------------- */ if(pSiS->hasTwoOverlays) { setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x01, 0x01); setvideoregmask(pSiS, Index_VI_Contrast_Enh_Ctrl, 0x04, 0x07); setvideoreg(pSiS, Index_VI_Brightness, 0x20); if(pSiS->VGAEngine == SIS_315_VGA) { setvideoreg(pSiS, Index_VI_Hue, 0x00); setvideoreg(pSiS, Index_VI_Saturation, 0x00); } } /* Reset Xv gamma correction */ if(pSiS->VGAEngine == SIS_315_VGA) { SiSUpdateXvGamma(pSiS, pPriv); } pPriv->mustresettap = TRUE; #ifdef SISMERGED pPriv->mustresettap2 = TRUE; #endif } /********************************* * Set displaymode * *********************************/ /* Set display mode (single CRT1/CRT2, mirror). * MIRROR mode is only available on chipsets with two overlays. * On the other chipsets, if only CRT1 or only CRT2 are used, * the correct display CRT is chosen automatically. If both * CRT1 and CRT2 are connected, the user can choose between CRT1 and * CRT2 by using the option XvOnCRT2. */ static void set_dispmode(ScrnInfoPtr pScrn, SISPortPrivPtr pPriv) { SISPtr pSiS = SISPTR(pScrn); pPriv->dualHeadMode = pPriv->bridgeIsSlave = FALSE; if(SiSBridgeIsInSlaveMode(pScrn)) { pPriv->bridgeIsSlave = TRUE; } if( (pSiS->VBFlags & VB_DISPMODE_MIRROR) || ((pPriv->bridgeIsSlave) && (pSiS->VBFlags & DISPTYPE_DISP2)) ) { if(pPriv->hasTwoOverlays) pPriv->displayMode = DISPMODE_MIRROR; /* CRT1+CRT2 (2 overlays) */ else if(pPriv->crtnum) pPriv->displayMode = DISPMODE_SINGLE2; /* CRT2 only */ else pPriv->displayMode = DISPMODE_SINGLE1; /* CRT1 only */ } else { #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pPriv->dualHeadMode = TRUE; if(pSiS->SecondHead) pPriv->displayMode = DISPMODE_SINGLE1; /* CRT1 only */ else pPriv->displayMode = DISPMODE_SINGLE2; /* CRT2 only */ } else #endif if(pSiS->VBFlags & DISPTYPE_DISP1) { pPriv->displayMode = DISPMODE_SINGLE1; /* CRT1 only */ } else { pPriv->displayMode = DISPMODE_SINGLE2; /* CRT2 only */ } } } static void set_disptype_regs(ScrnInfoPtr pScrn, SISPortPrivPtr pPriv) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; int crtnum = 0; if(pPriv->dualHeadMode) crtnum = pSiSEnt->curxvcrtnum; #endif /* * SR06[7:6] * Bit 7: Enable overlay 1 on CRT2 * Bit 6: Enable overlay 0 on CRT2 * SR32[7:6] * Bit 7: DCLK/TCLK overlay 1 * 0=DCLK (overlay on CRT1) * 1=TCLK (overlay on CRT2) * Bit 6: DCLK/TCLK overlay 0 * 0=DCLK (overlay on CRT1) * 1=TCLK (overlay on CRT2) * * On chipsets with two overlays, we can freely select and also * have a mirror mode. However, we use overlay 0 for CRT1 and * overlay 1 for CRT2. * ATTENTION: CRT2 can only take up to 1 (one) overlay. Setting * SR06/32 to 0xc0 DOES NOT WORK. THAT'S CONFIRMED. * Therefore, we use overlay 0 on CRT2 if in SINGLE2 mode. * * For chipsets with only one overlay, user must choose whether * to display the overlay on CRT1 or CRT2 by setting XvOnCRT2 * to TRUE (CRT2) or FALSE (CRT1). The driver does this auto- * matically if only CRT1 or only CRT2 is used. */ #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif switch (pPriv->displayMode) { case DISPMODE_SINGLE1: /* CRT1-only mode: */ if(pPriv->hasTwoOverlays) { if(pPriv->dualHeadMode) { setsrregmask(pSiS, 0x06, 0x00, 0x40); /* overlay 0 -> CRT1 */ setsrregmask(pSiS, 0x32, 0x00, 0x40); } else { setsrregmask(pSiS, 0x06, 0x00, 0xc0); /* both overlays -> CRT1 */ setsrregmask(pSiS, 0x32, 0x00, 0xc0); } } else { #ifdef SISDUALHEAD if((!pPriv->dualHeadMode) || (crtnum == 0)) { #endif setsrregmask(pSiS, 0x06, 0x00, 0xc0); /* only overlay -> CRT1 */ setsrregmask(pSiS, 0x32, 0x00, 0xc0); #ifdef SISDUALHEAD } #endif } break; case DISPMODE_SINGLE2: /* CRT2-only mode: */ if(pPriv->hasTwoOverlays) { if(pPriv->dualHeadMode) { setsrregmask(pSiS, 0x06, 0x80, 0x80); /* overlay 1 -> CRT2 */ setsrregmask(pSiS, 0x32, 0x80, 0x80); } else { setsrregmask(pSiS, 0x06, 0x40, 0xc0); /* overlay 0 -> CRT2 */ setsrregmask(pSiS, 0x32, 0xc0, 0xc0); /* (although both clocks for CRT2!) */ } } else { #ifdef SISDUALHEAD if((!pPriv->dualHeadMode) || (crtnum == 1)) { #endif if(pSiS->MiscFlags & MISC_SIS760ONEOVERLAY) { setsrregmask(pSiS, 0x06, 0x40, 0xc0); /* overlay 0 -> CRT2 */ setsrregmask(pSiS, 0x32, 0xc0, 0xc0); /* (although both clocks for CRT2!) */ } else { setsrregmask(pSiS, 0x06, 0x40, 0xc0); /* only overlay -> CRT2 */ setsrregmask(pSiS, 0x32, 0x40, 0xc0); } #ifdef SISDUALHEAD } #endif } break; case DISPMODE_MIRROR: /* CRT1+CRT2-mode: (only on chips with 2 overlays) */ default: setsrregmask(pSiS, 0x06, 0x80, 0xc0); /* overlay 0 -> CRT1, overlay 1 -> CRT2 */ setsrregmask(pSiS, 0x32, 0x80, 0xc0); break; } } static void set_hastwooverlays(SISPtr pSiS, SISPortPrivPtr pPriv) { int temp, watchdog; if(pSiS->hasTwoOverlays) { if(pSiS->MiscFlags & MISC_SIS760ONEOVERLAY) { if(pPriv->hasTwoOverlays) { /* Disable overlay 1 on change */ setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x01, 0x01); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x01); temp = getvideoreg(pSiS,Index_VI_Control_Misc0); if(temp & 0x02) { watchdog = WATCHDOG_DELAY; while((!vblank_active_CRT2(pSiS, pPriv)) && --watchdog); watchdog = WATCHDOG_DELAY; while(vblank_active_CRT2(pSiS, pPriv) && --watchdog); setvideoregmask(pSiS, Index_VI_Control_Misc0, 0x00, 0x02); } } pPriv->hasTwoOverlays = FALSE; } else { pPriv->hasTwoOverlays = TRUE; } } else { pPriv->hasTwoOverlays = FALSE; } } static void set_allowswitchcrt(SISPtr pSiS, SISPortPrivPtr pPriv) { if(pPriv->hasTwoOverlays) { pPriv->AllowSwitchCRT = FALSE; } else if((!(pSiS->VBFlags & DISPTYPE_DISP1)) || (!(pSiS->VBFlags & DISPTYPE_DISP2))) { pPriv->AllowSwitchCRT = FALSE; if(!(pSiS->VBFlags & DISPTYPE_DISP1)) pPriv->crtnum = 1; else pPriv->crtnum = 0; } else { pPriv->AllowSwitchCRT = TRUE; } } static void set_maxencoding(SISPtr pSiS, SISPortPrivPtr pPriv) { int half; if(pSiS->VGAEngine == SIS_300_VGA) { DummyEncoding.width = IMAGE_MAX_WIDTH_300; DummyEncoding.height = IMAGE_MAX_HEIGHT_300; } else { DummyEncoding.width = IMAGE_MAX_WIDTH_315; DummyEncoding.height = IMAGE_MAX_HEIGHT_315; half = IMAGE_MAX_WIDTH_315 >> 1; if(pPriv->is661741760) { half = 768 * 2; } else if(pPriv->is340) { /* 2 overlays? */ DummyEncoding.width = IMAGE_MAX_WIDTH_340; half = 1280; /* ? */ } else if(pPriv->is761) { DummyEncoding.width = IMAGE_MAX_WIDTH_761; half = 1920; /* ? */ } if(pPriv->hasTwoOverlays) { #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { DummyEncoding.width = half; } else #endif #ifdef SISMERGED if(pSiS->MergedFB) { DummyEncoding.width = half; } else #endif if(pPriv->displayMode == DISPMODE_MIRROR) { DummyEncoding.width = half; } } } } /********************************* * ResetXvDisplay() * *********************************/ static void SISResetXvDisplay(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); SISPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); if(!pPriv) return; set_hastwooverlays(pSiS, pPriv); set_allowswitchcrt(pSiS, pPriv); set_dispmode(pScrn, pPriv); set_maxencoding(pSiS, pPriv); } /********************************* * SetupImageVideo() * *********************************/ static XF86VideoAdaptorPtr SISSetupImageVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); XF86VideoAdaptorPtr adapt; SISPortPrivPtr pPriv; #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,1,99,1,0) XAAInfoRecPtr pXAA = pSiS->AccelInfoPtr; if(!pXAA || !pXAA->FillSolidRects) { return NULL; } #endif if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + sizeof(SISPortPrivRec) + sizeof(DevUnion)))) { return NULL; } adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; adapt->name = "SIS 300/315/330 series Video Overlay"; adapt->nEncodings = 1; adapt->pEncodings = &DummyEncoding; adapt->nFormats = NUM_FORMATS; adapt->pFormats = SISFormats; adapt->nPorts = 1; adapt->pPortPrivates = (DevUnion*)(&adapt[1]); pPriv = (SISPortPrivPtr)(&adapt->pPortPrivates[1]); pPriv->videoStatus = 0; pPriv->currentBuf = 0; pPriv->handle = NULL; pPriv->grabbedByV4L= FALSE; pPriv->NoOverlay = FALSE; pPriv->PrevOverlay = FALSE; pPriv->is661741760 = ((pSiS->ChipType >= SIS_661) && (pSiS->ChipType <= SIS_760)) ? TRUE : FALSE; pPriv->is760 = (pSiS->ChipType == SIS_760) ? TRUE : FALSE; pPriv->is761 = (pSiS->ChipType == SIS_761) ? TRUE : FALSE; pPriv->is340 = (pSiS->Chipset == PCI_CHIP_SIS340) ? TRUE : FALSE; pPriv->isXGI = (pSiS->Chipset == PCI_CHIP_XGIXG20 || pSiS->Chipset == PCI_CHIP_XGIXG40) ? TRUE : FALSE; /* Setup chipset type helpers */ set_hastwooverlays(pSiS, pPriv); set_allowswitchcrt(pSiS, pPriv); pPriv->havetapscaler = FALSE; if(pPriv->is340 || pPriv->is761 || pPriv->isXGI) { pPriv->havetapscaler = TRUE; } adapt->pPortPrivates[0].ptr = (pointer)(pPriv); if(pSiS->VGAEngine == SIS_300_VGA) { adapt->nImages = NUM_IMAGES_300; adapt->pAttributes = SISAttributes_300; adapt->nAttributes = SiSCountAttributes(&SISAttributes_300[0]); } else { if(pSiS->ChipType >= SIS_330) { adapt->nImages = NUM_IMAGES_330; } else { adapt->nImages = NUM_IMAGES_315; } adapt->pAttributes = SISAttributes_315; adapt->nAttributes = SiSCountAttributes(&SISAttributes_315[0]); if((pSiS->hasTwoOverlays) && (!(pSiS->SiS_SD2_Flags & SiS_SD2_SUPPORT760OO))) { adapt->nAttributes--; } } adapt->pImages = SISImages; adapt->PutVideo = NULL; adapt->PutStill = NULL; adapt->GetVideo = NULL; adapt->GetStill = NULL; adapt->StopVideo = SISStopVideo; adapt->SetPortAttribute = SISSetPortAttribute; adapt->GetPortAttribute = SISGetPortAttribute; adapt->QueryBestSize = SISQueryBestSize; adapt->PutImage = SISPutImage; adapt->QueryImageAttributes = SISQueryImageAttributes; /* gotta uninit this someplace */ #if defined(REGION_NULL) REGION_NULL(pScreen, &pPriv->clip); #else REGION_INIT(pScreen, &pPriv->clip, NullBox, 0); #endif pSiS->adaptor = adapt; pSiS->xvBrightness = MAKE_ATOM(sisxvbrightness); pSiS->xvContrast = MAKE_ATOM(sisxvcontrast); pSiS->xvColorKey = MAKE_ATOM(sisxvcolorkey); pSiS->xvSaturation = MAKE_ATOM(sisxvsaturation); pSiS->xvHue = MAKE_ATOM(sisxvhue); pSiS->xvSwitchCRT = MAKE_ATOM(sisxvswitchcrt); pSiS->xvAutopaintColorKey = MAKE_ATOM(sisxvautopaintcolorkey); pSiS->xvSetDefaults = MAKE_ATOM(sisxvsetdefaults); pSiS->xvDisableGfx = MAKE_ATOM(sisxvdisablegfx); pSiS->xvDisableGfxLR = MAKE_ATOM(sisxvdisablegfxlr); pSiS->xvTVXPosition = MAKE_ATOM(sisxvtvxposition); pSiS->xvTVYPosition = MAKE_ATOM(sisxvtvyposition); pSiS->xvGammaRed = MAKE_ATOM(sisxvgammared); pSiS->xvGammaGreen = MAKE_ATOM(sisxvgammagreen); pSiS->xvGammaBlue = MAKE_ATOM(sisxvgammablue); pSiS->xvDisableColorkey = MAKE_ATOM(sisxvdisablecolorkey); pSiS->xvUseChromakey = MAKE_ATOM(sisxvusechromakey); pSiS->xvInsideChromakey = MAKE_ATOM(sisxvinsidechromakey); pSiS->xvYUVChromakey = MAKE_ATOM(sisxvyuvchromakey); pSiS->xvChromaMin = MAKE_ATOM(sisxvchromamin); pSiS->xvChromaMax = MAKE_ATOM(sisxvchromamax); #ifdef SISDEINT pSiS->xvdeintmeth = MAKE_ATOM(sisxvdeinterlace); #endif #ifdef XV_SD_DEPRECATED pSiS->xv_QVF = MAKE_ATOM(sisxvqueryvbflags); pSiS->xv_GDV = MAKE_ATOM(sisxvsdgetdriverversion); pSiS->xv_GHI = MAKE_ATOM(sisxvsdgethardwareinfo); pSiS->xv_GBI = MAKE_ATOM(sisxvsdgetbusid); pSiS->xv_QVV = MAKE_ATOM(sisxvsdqueryvbflagsversion); pSiS->xv_GSF = MAKE_ATOM(sisxvsdgetsdflags); pSiS->xv_GSF2 = MAKE_ATOM(sisxvsdgetsdflags2); pSiS->xv_USD = MAKE_ATOM(sisxvsdunlocksisdirect); pSiS->xv_SVF = MAKE_ATOM(sisxvsdsetvbflags); pSiS->xv_QDD = MAKE_ATOM(sisxvsdquerydetecteddevices); pSiS->xv_CT1 = MAKE_ATOM(sisxvsdcrt1status); pSiS->xv_CMD = MAKE_ATOM(sisxvsdcheckmodeindexforcrt2); pSiS->xv_CMDR = MAKE_ATOM(sisxvsdresultcheckmodeindexforcrt2); pSiS->xv_RDT = MAKE_ATOM(sisxvsdredetectcrt2); pSiS->xv_TAF = MAKE_ATOM(sisxvsdsisantiflicker); pSiS->xv_TSA = MAKE_ATOM(sisxvsdsissaturation); pSiS->xv_TEE = MAKE_ATOM(sisxvsdsisedgeenhance); pSiS->xv_COC = MAKE_ATOM(sisxvsdsiscolcalibc); pSiS->xv_COF = MAKE_ATOM(sisxvsdsiscolcalibf); pSiS->xv_CFI = MAKE_ATOM(sisxvsdsiscfilter); pSiS->xv_YFI = MAKE_ATOM(sisxvsdsisyfilter); pSiS->xv_TCO = MAKE_ATOM(sisxvsdchcontrast); pSiS->xv_TTE = MAKE_ATOM(sisxvsdchtextenhance); pSiS->xv_TCF = MAKE_ATOM(sisxvsdchchromaflickerfilter); pSiS->xv_TLF = MAKE_ATOM(sisxvsdchlumaflickerfilter); pSiS->xv_TCC = MAKE_ATOM(sisxvsdchcvbscolor); pSiS->xv_OVR = MAKE_ATOM(sisxvsdchoverscan); pSiS->xv_SGA = MAKE_ATOM(sisxvsdenablegamma); pSiS->xv_TXS = MAKE_ATOM(sisxvsdtvxscale); pSiS->xv_TYS = MAKE_ATOM(sisxvsdtvyscale); pSiS->xv_GSS = MAKE_ATOM(sisxvsdgetscreensize); pSiS->xv_BRR = MAKE_ATOM(sisxvsdstorebrir); pSiS->xv_BRG = MAKE_ATOM(sisxvsdstorebrig); pSiS->xv_BRB = MAKE_ATOM(sisxvsdstorebrib); pSiS->xv_PBR = MAKE_ATOM(sisxvsdstorepbrir); pSiS->xv_PBG = MAKE_ATOM(sisxvsdstorepbrig); pSiS->xv_PBB = MAKE_ATOM(sisxvsdstorepbrib); pSiS->xv_BRR2 = MAKE_ATOM(sisxvsdstorebrir2); pSiS->xv_BRG2 = MAKE_ATOM(sisxvsdstorebrig2); pSiS->xv_BRB2 = MAKE_ATOM(sisxvsdstorebrib2); pSiS->xv_PBR2 = MAKE_ATOM(sisxvsdstorepbrir2); pSiS->xv_PBG2 = MAKE_ATOM(sisxvsdstorepbrig2); pSiS->xv_PBB2 = MAKE_ATOM(sisxvsdstorepbrib2); pSiS->xv_GARC2 = MAKE_ATOM(sisxvsdstoregarc2); pSiS->xv_GAGC2 = MAKE_ATOM(sisxvsdstoregagc2); pSiS->xv_GABC2 = MAKE_ATOM(sisxvsdstoregabc2); pSiS->xv_BRRC2 = MAKE_ATOM(sisxvsdstorebrirc2); pSiS->xv_BRGC2 = MAKE_ATOM(sisxvsdstorebrigc2); pSiS->xv_BRBC2 = MAKE_ATOM(sisxvsdstorebribc2); pSiS->xv_PBRC2 = MAKE_ATOM(sisxvsdstorepbrirc2); pSiS->xv_PBGC2 = MAKE_ATOM(sisxvsdstorepbrigc2); pSiS->xv_PBBC2 = MAKE_ATOM(sisxvsdstorepbribc2); pSiS->xv_SHC = MAKE_ATOM(sisxvsdhidehwcursor); pSiS->xv_PMD = MAKE_ATOM(sisxvsdpanelmode); #ifdef TWDEBUG pSiS->xv_STR = MAKE_ATOM(sisxvsetreg); #endif #endif /* XV_SD_DEPRECATED */ #ifdef SIS_CP SIS_CP_VIDEO_ATOMS #endif pSiS->xv_sisdirectunlocked = 0; #ifdef XV_SD_DEPRECATED pSiS->xv_sd_result = 0; #endif /* 300 series require double words for addresses and pitches, * 315/330 series require word. */ switch (pSiS->VGAEngine) { case SIS_315_VGA: pPriv->shiftValue = 1; break; case SIS_300_VGA: default: pPriv->shiftValue = 2; break; } /* Set displayMode according to VBFlags */ set_dispmode(pScrn, pPriv); /* Now for the linebuffer stuff. * All chipsets have a certain number of linebuffers, each of a certain * size. The number of buffers is per overlay. * Chip number size max video size * 300 2 ? 720x576 * 630/730 2 ? 720x576 * 315 2 960? 1920x1080 * 550 2? 960? 1920x1080? * 650/740 2 960 ("120x128") 1920x1080 * M650/651.. 4 480 1920x1080 * 330 2 960 1920x1080 * 661/741/760 4 768 1920x1080 * 340 4 1280? 1920x1080? * 761 4 1536? 1920x1080? * The unit of size is unknown; I just know that a size of 480 limits * the video source width to 384. Beyond that, line buffers must be * merged (otherwise the video output is garbled). * To use the maximum width (eg 1920x1080 on the 315 series, including * the M650, 651 and later), *all* line buffers must be merged. Hence, * we can only use one overlay. This should be set up for modes where * either only CRT1 or only CRT2 is used. * If both overlays are going to be used (such as in modes were both * CRT1 and CRT2 are active), we are limited to the half of the * maximum width, or 1536 on 661/741/760. * There is a known hardware problem with the 760 and 761 if the video * data is in the UMA area: The memory access latency is too big to * allow two overlays under some circumstances. Therefore, we must * support switching between hasTwoOverlays and !hasTwoOverlays on * the fly. */ if(pSiS->VGAEngine == SIS_300_VGA) { pPriv->linebufmask = 0x11; pPriv->linebufMergeLimit = 384; } else { pPriv->linebufmask = 0xb1; pPriv->linebufMergeLimit = 384; /* should be 480 */ if(pPriv->is661741760) { pPriv->linebufMergeLimit = 576; /* should be 768 */ } else if(pPriv->is340) { pPriv->linebufMergeLimit = 1280; /* should be 1280 */ } else if(pPriv->is761) { pPriv->linebufMergeLimit = 1280; /* should be 1536 */ } else if(pPriv->isXGI) { pPriv->linebufMergeLimit = 1280; /* FIXME */ } else if(!(pPriv->hasTwoOverlays)) { pPriv->linebufMergeLimit = 720; /* should be 960 */ } /* No special treatment for 760/761 required */ } set_maxencoding(pSiS, pPriv); /* Reset the properties to their defaults */ SISSetPortDefaults(pScrn, pPriv); /* Set SR(06, 32) registers according to DISPMODE */ set_disptype_regs(pScrn, pPriv); SISResetVideo(pScrn); pSiS->ResetXv = SISResetVideo; pSiS->ResetXvDisplay = SISResetXvDisplay; if(pSiS->VGAEngine == SIS_315_VGA) { pSiS->ResetXvGamma = SISResetXvGamma; } return adapt; } #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,3,0) static Bool RegionsEqual(RegionPtr A, RegionPtr B) { int *dataA, *dataB; int num; num = REGION_NUM_RECTS(A); if(num != REGION_NUM_RECTS(B)) return FALSE; if((A->extents.x1 != B->extents.x1) || (A->extents.x2 != B->extents.x2) || (A->extents.y1 != B->extents.y1) || (A->extents.y2 != B->extents.y2)) return FALSE; dataA = (int*)REGION_RECTS(A); dataB = (int*)REGION_RECTS(B); while(num--) { if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1])) return FALSE; dataA += 2; dataB += 2; } return TRUE; } #endif /********************************* * SetPortAttribute() * *********************************/ void SISUpdateVideoParms(SISPtr pSiS, SISPortPrivPtr pPriv) { set_hastwooverlays(pSiS, pPriv); set_allowswitchcrt(pSiS, pPriv); set_dispmode(pSiS->pScrn, pPriv); set_maxencoding(pSiS, pPriv); } static int SISSetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value, pointer data) { SISPortPrivPtr pPriv = (SISPortPrivPtr)data; SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate;; #endif if(attribute == pSiS->xvBrightness) { if((value < -128) || (value > 127)) return BadValue; pPriv->brightness = value; } else if(attribute == pSiS->xvContrast) { if((value < 0) || (value > 7)) return BadValue; pPriv->contrast = value; } else if(attribute == pSiS->xvColorKey) { pPriv->colorKey = pSiS->colorKey = value; REGION_EMPTY(pScrn->pScreen, &pPriv->clip); } else if(attribute == pSiS->xvAutopaintColorKey) { if((value < 0) || (value > 1)) return BadValue; pPriv->autopaintColorKey = value; } else if(attribute == pSiS->xvSetDefaults) { SISSetPortDefaults(pScrn, pPriv); } else if(attribute == pSiS->xvDisableGfx) { if((value < 0) || (value > 1)) return BadValue; pPriv->disablegfx = value; } else if(attribute == pSiS->xvDisableGfxLR) { if((value < 0) || (value > 1)) return BadValue; pPriv->disablegfxlr = value; } else if(attribute == pSiS->xvTVXPosition) { if((value < -32) || (value > 32)) return BadValue; pPriv->tvxpos = value; if(pSiS->xv_sisdirectunlocked) { SiS_SetTVxposoffset(pScrn, pPriv->tvxpos); pPriv->updatetvxpos = FALSE; } else { pSiS->tvxpos = pPriv->tvxpos; #ifdef SISDUALHEAD if(pPriv->dualHeadMode) pSiSEnt->tvxpos = pPriv->tvxpos; #endif pPriv->updatetvxpos = TRUE; } } else if(attribute == pSiS->xvTVYPosition) { if((value < -32) || (value > 32)) return BadValue; pPriv->tvypos = value; if(pSiS->xv_sisdirectunlocked) { SiS_SetTVyposoffset(pScrn, pPriv->tvypos); pPriv->updatetvypos = FALSE; } else { pSiS->tvypos = pPriv->tvypos; #ifdef SISDUALHEAD if(pPriv->dualHeadMode) pSiSEnt->tvypos = pPriv->tvypos; #endif pPriv->updatetvypos = TRUE; } } else if(attribute == pSiS->xvDisableColorkey) { if((value < 0) || (value > 1)) return BadValue; pSiS->disablecolorkeycurrent = value; } else if(attribute == pSiS->xvUseChromakey) { if((value < 0) || (value > 1)) return BadValue; pPriv->usechromakey = value; } else if(attribute == pSiS->xvInsideChromakey) { if((value < 0) || (value > 1)) return BadValue; pPriv->insidechromakey = value; } else if(attribute == pSiS->xvYUVChromakey) { if((value < 0) || (value > 1)) return BadValue; pPriv->yuvchromakey = value; } else if(attribute == pSiS->xvChromaMin) { pPriv->chromamin = value; } else if(attribute == pSiS->xvChromaMax) { pPriv->chromamax = value; #ifdef SISDEINT } else if(attribute == pSiS->xvdeintmeth) { if(value < 0) value = 0; if(value > 4) value = 4; pPriv->deinterlacemethod = value; #endif #ifdef SIS_CP SIS_CP_VIDEO_SETATTRIBUTE #endif } else if(attribute == pSiS->xvHue) { if(pSiS->VGAEngine == SIS_315_VGA) { if((value < -8) || (value > 7)) return BadValue; pPriv->hue = value; } else return BadMatch; } else if(attribute == pSiS->xvSaturation) { if(pSiS->VGAEngine == SIS_315_VGA) { if((value < -7) || (value > 7)) return BadValue; pPriv->saturation = value; } else return BadMatch; } else if(attribute == pSiS->xvGammaRed) { if(pSiS->VGAEngine == SIS_315_VGA) { if((value < 100) || (value > 10000)) return BadValue; pSiS->XvGammaRed = value; SiSUpdateXvGamma(pSiS, pPriv); } else return BadMatch; } else if(attribute == pSiS->xvGammaGreen) { if(pSiS->VGAEngine == SIS_315_VGA) { if((value < 100) || (value > 10000)) return BadValue; pSiS->XvGammaGreen = value; SiSUpdateXvGamma(pSiS, pPriv); } else return BadMatch; } else if(attribute == pSiS->xvGammaBlue) { if(pSiS->VGAEngine == SIS_315_VGA) { if((value < 100) || (value > 10000)) return BadValue; pSiS->XvGammaBlue = value; SiSUpdateXvGamma(pSiS, pPriv); } else return BadMatch; } else if(attribute == pSiS->xvSwitchCRT) { if(pSiS->VGAEngine == SIS_315_VGA) { if(pPriv->AllowSwitchCRT) { if((value < 0) || (value > 1)) return BadValue; pPriv->crtnum = value; #ifdef SISDUALHEAD if(pPriv->dualHeadMode) pSiSEnt->curxvcrtnum = value; #endif } } else return BadMatch; } else { #ifdef XV_SD_DEPRECATED return(SISSetPortUtilAttribute(pScrn, attribute, value, pPriv)); #else return BadMatch; #endif } return Success; } /********************************* * GetPortAttribute() * *********************************/ static int SISGetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 *value, pointer data) { SISPortPrivPtr pPriv = (SISPortPrivPtr)data; SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate;; #endif if(attribute == pSiS->xvBrightness) { *value = pPriv->brightness; } else if(attribute == pSiS->xvContrast) { *value = pPriv->contrast; } else if(attribute == pSiS->xvColorKey) { *value = pPriv->colorKey; } else if(attribute == pSiS->xvAutopaintColorKey) { *value = (pPriv->autopaintColorKey) ? 1 : 0; } else if(attribute == pSiS->xvDisableGfx) { *value = (pPriv->disablegfx) ? 1 : 0; } else if(attribute == pSiS->xvDisableGfxLR) { *value = (pPriv->disablegfxlr) ? 1 : 0; } else if(attribute == pSiS->xvTVXPosition) { *value = SiS_GetTVxposoffset(pScrn); } else if(attribute == pSiS->xvTVYPosition) { *value = SiS_GetTVyposoffset(pScrn); } else if(attribute == pSiS->xvDisableColorkey) { *value = (pSiS->disablecolorkeycurrent) ? 1 : 0; } else if(attribute == pSiS->xvUseChromakey) { *value = (pPriv->usechromakey) ? 1 : 0; } else if(attribute == pSiS->xvInsideChromakey) { *value = (pPriv->insidechromakey) ? 1 : 0; } else if(attribute == pSiS->xvYUVChromakey) { *value = (pPriv->yuvchromakey) ? 1 : 0; } else if(attribute == pSiS->xvChromaMin) { *value = pPriv->chromamin; } else if(attribute == pSiS->xvChromaMax) { *value = pPriv->chromamax; #ifdef SISDEINT } else if(attribute == pSiS->xvdeintmeth) { *value = pPriv->deinterlacemethod; #endif #ifdef SIS_CP SIS_CP_VIDEO_GETATTRIBUTE #endif } else if(attribute == pSiS->xvHue) { if(pSiS->VGAEngine == SIS_315_VGA) { *value = pPriv->hue; } else return BadMatch; } else if(attribute == pSiS->xvSaturation) { if(pSiS->VGAEngine == SIS_315_VGA) { *value = pPriv->saturation; } else return BadMatch; } else if(attribute == pSiS->xvGammaRed) { if(pSiS->VGAEngine == SIS_315_VGA) { *value = pSiS->XvGammaRed; } else return BadMatch; } else if(attribute == pSiS->xvGammaGreen) { if(pSiS->VGAEngine == SIS_315_VGA) { *value = pSiS->XvGammaGreen; } else return BadMatch; } else if(attribute == pSiS->xvGammaBlue) { if(pSiS->VGAEngine == SIS_315_VGA) { *value = pSiS->XvGammaBlue; } else return BadMatch; } else if(attribute == pSiS->xvSwitchCRT) { if(pSiS->VGAEngine == SIS_315_VGA) { #ifdef SISDUALHEAD if(pPriv->dualHeadMode) *value = pSiSEnt->curxvcrtnum; else #endif *value = pPriv->crtnum; } else return BadMatch; } else { #ifdef XV_SD_DEPRECATED return(SISGetPortUtilAttribute(pScrn, attribute, value, pPriv)); #else return BadMatch; #endif } return Success; } /********************************* * QueryBestSize() * *********************************/ static void SISQueryBestSize( ScrnInfoPtr pScrn, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, unsigned int *p_h, pointer data ){ *p_w = drw_w; *p_h = drw_h; } /********************************* * Calc scaling factor * *********************************/ static void calc_scale_factor(SISOverlayPtr pOverlay, ScrnInfoPtr pScrn, SISPortPrivPtr pPriv, int index, int iscrt2) { SISPtr pSiS = SISPTR(pScrn); CARD32 I=0,mult=0; int flag=0, flag2=0; int dstW = pOverlay->dstBox.x2 - pOverlay->dstBox.x1; int dstH = pOverlay->dstBox.y2 - pOverlay->dstBox.y1; int srcW = pOverlay->srcW; int srcH = pOverlay->srcH; CARD16 LCDheight = pSiS->LCDheight; int srcPitch = pOverlay->origPitch; int origdstH = dstH; int modeflags = pOverlay->currentmode->Flags; /* Stretch image due to panel link scaling */ if(pSiS->VBFlags & (CRT2_LCD | CRT1_LCDA)) { if(pPriv->bridgeIsSlave) { if(pSiS->VBFlags2 & (VB2_LVDS | VB2_30xBDH)) { if(pSiS->MiscFlags & MISC_PANELLINKSCALER) { dstH = (dstH * LCDheight) / pOverlay->SCREENheight; } } } else if((iscrt2 && (pSiS->VBFlags & CRT2_LCD)) || (!iscrt2 && (pSiS->VBFlags & CRT1_LCDA))) { if((pSiS->VBFlags2 & (VB2_LVDS | VB2_30xBDH)) || (pSiS->VBFlags & CRT1_LCDA)) { if(pSiS->MiscFlags & MISC_PANELLINKSCALER) { dstH = (dstH * LCDheight) / pOverlay->SCREENheight; if(pPriv->displayMode == DISPMODE_MIRROR) flag = 1; } } } if((pPriv->bridgeIsSlave || iscrt2) && (pSiS->MiscFlags & MISC_STNMODE)) { flag2 = 1; } } /* For double scan modes, we need to double the height * On 315 and 550 (?), we need to double the width as well. * Interlace mode vice versa. */ if((modeflags & V_DBLSCAN) && !flag2) { dstH = origdstH << 1; flag = 0; if((pSiS->ChipType >= SIS_315H) && (pSiS->ChipType <= SIS_550)) { dstW <<= 1; } } else if(modeflags & V_INTERLACE) { dstH = origdstH >> 1; flag = 0; } pOverlay->tap_scale = 1.0; if(dstW < OVERLAY_MIN_WIDTH) dstW = OVERLAY_MIN_WIDTH; if(dstW == srcW) { pOverlay->HUSF = 0x00; pOverlay->IntBit = 0x05; pOverlay->wHPre = 0; } else if(dstW > srcW) { pOverlay->IntBit = 0x04; pOverlay->wHPre = 0; if(pPriv->havetapscaler) { if((dstW > 2) && (srcW > 2)) { pOverlay->HUSF = (((srcW - 2) << 16) + dstW - 3) / (dstW - 2); } else { pOverlay->HUSF = ((srcW << 16) + dstW - 1) / dstW; } } else { dstW += 2; pOverlay->HUSF = (srcW << 16) / dstW; } } else { int tmpW = dstW; /* It seems, the hardware can't scale below factor .125 (=1/8) if the pitch isn't a multiple of 256. TODO: Test this on the 315 series! */ if((srcPitch % 256) || (srcPitch < 256)) { if(((dstW * 1000) / srcW) < 125) dstW = tmpW = ((srcW * 125) / 1000) + 1; } I = 0; pOverlay->IntBit = 0x01; while(srcW >= tmpW) { tmpW <<= 1; I++; } pOverlay->wHPre = (CARD8)(I - 1); dstW <<= (I - 1); pOverlay->tap_scale = (float)srcW / (float)dstW; if(pOverlay->tap_scale < 1.0) pOverlay->tap_scale = 1.0; if((srcW % dstW)) pOverlay->HUSF = ((srcW - dstW) << 16) / dstW; else pOverlay->HUSF = 0; } if(dstH < OVERLAY_MIN_HEIGHT) dstH = OVERLAY_MIN_HEIGHT; if(dstH == srcH) { pOverlay->VUSF = 0x00; pOverlay->IntBit |= 0x0A; } else if(dstH > srcH) { dstH += 2; pOverlay->IntBit |= 0x08; if(pPriv->havetapscaler) { if((dstH > 2) && (srcH > 2)) { pOverlay->VUSF = (((srcH - 2) << 16) - 32768 + dstH - 3) / (dstH - 2); } else { pOverlay->VUSF = ((srcH << 16) + dstH - 1) / dstH; } } else { pOverlay->VUSF = (srcH << 16) / dstH; } } else { I = srcH / dstH; pOverlay->IntBit |= 0x02; if(I < 2) { pOverlay->VUSF = ((srcH - dstH) << 16) / dstH; /* Needed for LCD-scaling modes */ if((flag) && (mult = (srcH / origdstH)) >= 2) { pOverlay->pitch /= mult; } } else { #if 0 if(((pOverlay->bobEnable & 0x08) == 0x00) && (((srcPitch * I) >> 2) > 0xFFF)){ pOverlay->bobEnable |= 0x08; srcPitch >>= 1; } #endif if(((srcPitch * I) >> 2) > 0xFFF) { I = (0xFFF * 2 / srcPitch); pOverlay->VUSF = 0xFFFF; } else { dstH = I * dstH; if(srcH % dstH) pOverlay->VUSF = ((srcH - dstH) << 16) / dstH; else pOverlay->VUSF = 0; } /* set video frame buffer offset */ pOverlay->pitch = (CARD16)(srcPitch * I); } } } #ifdef SISMERGED static void calc_scale_factor_2(SISOverlayPtr pOverlay, ScrnInfoPtr pScrn, SISPortPrivPtr pPriv, int index, int iscrt2) { SISPtr pSiS = SISPTR(pScrn); CARD32 I=0,mult=0; int flag=0, flag2=0; int dstW = pOverlay->dstBox2.x2 - pOverlay->dstBox2.x1; int dstH = pOverlay->dstBox2.y2 - pOverlay->dstBox2.y1; int srcW = pOverlay->srcW2; int srcH = pOverlay->srcH2; CARD16 LCDheight = pSiS->LCDheight; int srcPitch = pOverlay->origPitch; int origdstH = dstH; int modeflags = pOverlay->currentmode2->Flags; /* Stretch image due to panel link scaling */ if(pSiS->VBFlags & CRT2_LCD) { if(pSiS->VBFlags2 & (VB2_LVDS | VB2_30xBDH)) { if(pSiS->MiscFlags & MISC_PANELLINKSCALER) { dstH = (dstH * LCDheight) / pOverlay->SCREENheight2; flag = 1; } if(pSiS->MiscFlags & MISC_STNMODE) flag2 = 1; } } /* For double scan modes, we need to double the height * On 315 and 550 (?), we need to double the width as well. * Interlace mode vice versa. */ if((modeflags & V_DBLSCAN) && !flag2) { dstH = origdstH << 1; flag = 0; if((pSiS->ChipType >= SIS_315H) && (pSiS->ChipType <= SIS_550)) { dstW <<= 1; } } if(modeflags & V_INTERLACE) { dstH = origdstH >> 1; flag = 0; } pOverlay->tap_scale2 = 1.0; if(dstW < OVERLAY_MIN_WIDTH) dstW = OVERLAY_MIN_WIDTH; if(dstW == srcW) { pOverlay->HUSF2 = 0x00; pOverlay->IntBit2 = 0x05; pOverlay->wHPre2 = 0; } else if(dstW > srcW) { pOverlay->IntBit2 = 0x04; pOverlay->wHPre2 = 0; if(pPriv->havetapscaler) { if((dstW > 2) && (srcW > 2)) { pOverlay->HUSF2 = (((srcW - 2) << 16) + dstW - 3) / (dstW - 2); } else { pOverlay->HUSF2 = ((srcW << 16) + dstW - 1) / dstW; } } else { dstW += 2; pOverlay->HUSF2 = (srcW << 16) / dstW; } } else { int tmpW = dstW; /* It seems, the hardware can't scale below factor .125 (=1/8) if the pitch isn't a multiple of 256. TODO: Test this on the 315 series! */ if((srcPitch % 256) || (srcPitch < 256)) { if(((dstW * 1000) / srcW) < 125) dstW = tmpW = ((srcW * 125) / 1000) + 1; } I = 0; pOverlay->IntBit2 = 0x01; while(srcW >= tmpW) { tmpW <<= 1; I++; } pOverlay->wHPre2 = (CARD8)(I - 1); dstW <<= (I - 1); pOverlay->tap_scale2 = (float)srcW / (float)dstW; if(pOverlay->tap_scale2 < 1.0) pOverlay->tap_scale2 = 1.0; if((srcW % dstW)) pOverlay->HUSF2 = ((srcW - dstW) << 16) / dstW; else pOverlay->HUSF2 = 0x00; } if(dstH < OVERLAY_MIN_HEIGHT) dstH = OVERLAY_MIN_HEIGHT; if(dstH == srcH) { pOverlay->VUSF2 = 0x00; pOverlay->IntBit2 |= 0x0A; } else if(dstH > srcH) { dstH += 2; pOverlay->IntBit2 |= 0x08; if(pPriv->havetapscaler) { if((dstH > 2) && (srcH > 2)) { pOverlay->VUSF2 = (((srcH - 2) << 16) - 32768 + dstH - 3) / (dstH - 2); } else { pOverlay->VUSF2 = ((srcH << 16) + dstH - 1) / dstH; } } else { pOverlay->VUSF2 = (srcH << 16) / dstH; } } else { I = srcH / dstH; pOverlay->IntBit2 |= 0x02; if(I < 2) { pOverlay->VUSF2 = ((srcH - dstH) << 16) / dstH; /* Needed for LCD-scaling modes */ if(flag && ((mult = (srcH / origdstH)) >= 2)) { pOverlay->pitch2 /= mult; } } else { #if 0 if(((pOverlay->bobEnable & 0x08) == 0x00) && (((srcPitch * I)>>2) > 0xFFF)){ pOverlay->bobEnable |= 0x08; srcPitch >>= 1; } #endif if(((srcPitch * I) >> 2) > 0xFFF) { I = (0xFFF * 2 / srcPitch); pOverlay->VUSF2 = 0xFFFF; } else { dstH = I * dstH; if(srcH % dstH) pOverlay->VUSF2 = ((srcH - dstH) << 16) / dstH; else pOverlay->VUSF2 = 0x00; } /* set video frame buffer offset */ pOverlay->pitch2 = (CARD16)(srcPitch * I); } } } #endif /********************************* * Handle 4-tap scaler (340) * *********************************/ static float tap_dda_func(float x) { double pi = 3.14159265358979; float r = 0.5, y; if(x == 0.0) { y = 1.0; } else if(x == -1.0 || x == 1.0) { y = 0.0; /* case ((x == -1.0 / (r * 2.0)) || (x == 1.0 / (r * 2.0))): */ /* y = (float)(r / 2.0 * sin(pi / (2.0 * r))); = 0.013700916287197; */ } else { y = sin(pi * x) / (pi * x) * cos(r * pi * x) / (1 - x * x); /* y = sin(pi * x) / (pi * x) * cos(r * pi * x) / (1 - 4 * r * r * x * x); */ } return y; } static void set_dda_regs(SISPtr pSiS, float scale) { float W[4], WS, myadd; int *temp[4], *wm1, *wm2, *wm3, *wm4; int i, j, w, tidx, weightmatrix[16][4]; for(i = 0; i < 16; i++) { myadd = ((float)i) / 16.0; WS = W[0] = tap_dda_func((myadd + 1.0) / scale); W[1] = tap_dda_func(myadd / scale); WS += W[1]; W[2] = tap_dda_func((myadd - 1.0) / scale); WS += W[2]; W[3] = tap_dda_func((myadd - 2.0) / scale); WS += W[3]; w = 0; for(j = 0; j < 4; j++) { weightmatrix[i][j] = (int)(((float)((W[j] * 16.0 / WS) + 0.5))); w += weightmatrix[i][j]; } if(w == 12) { weightmatrix[i][0]++; weightmatrix[i][1]++; weightmatrix[i][2]++; weightmatrix[i][3]++; } else if(w == 20) { weightmatrix[i][0]--; weightmatrix[i][1]--; weightmatrix[i][2]--; weightmatrix[i][3]--; } else if(w != 16) { tidx = (weightmatrix[i][0] > weightmatrix[i][1]) ? 0 : 1; temp[0] = &weightmatrix[i][tidx]; temp[1] = &weightmatrix[i][tidx ^ 1]; tidx = (weightmatrix[i][2] > weightmatrix[i][3]) ? 2 : 3; temp[2] = &weightmatrix[i][tidx]; temp[3] = &weightmatrix[i][tidx ^ 1]; tidx = (*(temp[0]) > *(temp[2])) ? 0 : 2; wm1 = temp[tidx]; wm2 = temp[tidx ^ 2]; tidx = (*(temp[1]) > *(temp[3])) ? 1 : 3; wm3 = temp[tidx]; wm4 = temp[tidx ^ 2]; switch(w) { case 13: (*wm1)++; (*wm4)++; if(*wm2 > *wm3) (*wm2)++; else (*wm3)++; break; case 14: (*wm1)++; (*wm4)++; break; case 15: (*wm1)++; break; case 17: (*wm4)--; break; case 18: (*wm1)--; (*wm4)--; break; case 19: (*wm1)--; (*wm4)--; if(*wm2 > *wm3) (*wm3)--; else (*wm2)--; } } } /* Set 4-tap scaler video regs 0x75-0xb4 */ w = 0x75; for(i = 0; i < 16; i++) { for(j = 0; j < 4; j++, w++) { setvideoregmask(pSiS, w, weightmatrix[i][j], 0x3f); } } } /********************************* * Calc line buffer size * *********************************/ static CARD16 calc_line_buf_size(CARD32 srcW, CARD8 wHPre, CARD8 planar, SISPortPrivPtr pPriv) { CARD32 I, mask = 0xffffffff, shift = pPriv->is761 ? 1 : 0; if(planar) { switch(wHPre & 0x07) { case 3: shift += 8; mask <<= shift; I = srcW >> shift; if((mask & srcW) != srcW) I++; I <<= 5; break; case 4: shift += 9; mask <<= shift; I = srcW >> shift; if((mask & srcW) != srcW) I++; I <<= 6; break; case 5: shift += 10; mask <<= shift; I = srcW >> shift; if((mask & srcW) != srcW) I++; I <<= 7; break; case 6: if(pPriv->is340 || pPriv->isXGI || pPriv->is761) { shift += 11; mask <<= shift; I = srcW >> shift; if((mask & srcW) != srcW) I++; I <<= 8; break; } else { return((CARD16)(255)); } default: shift += 7; mask <<= shift; I = srcW >> shift; if((mask & srcW) != srcW) I++; I <<= 4; break; } } else { /* packed */ shift += 3; mask <<= shift; I = srcW >> shift; if((mask & srcW) != srcW) I++; } if(I <= 3) I = 4; return((CARD16)(I - 1)); } static __inline void calc_line_buf_size_1(SISOverlayPtr pOverlay, SISPortPrivPtr pPriv) { pOverlay->lineBufSize = calc_line_buf_size(pOverlay->srcW, pOverlay->wHPre, pOverlay->planar, pPriv); } #ifdef SISMERGED static __inline void calc_line_buf_size_2(SISOverlayPtr pOverlay, SISPortPrivPtr pPriv) { pOverlay->lineBufSize2 = calc_line_buf_size(pOverlay->srcW2, pOverlay->wHPre2, pOverlay->planar, pPriv); } /********************************** *En/Disable merging of linebuffer* **********************************/ static void merge_line_buf_mfb(SISPtr pSiS, SISPortPrivPtr pPriv, Bool enable1, Bool enable2, short width1, short width2, short limit) { UChar misc1, misc2, mask = pPriv->linebufmask; if(pPriv->hasTwoOverlays) { /* This means we are in MIRROR mode */ misc2 = 0x00; if(enable1) misc1 = 0x04; else misc1 = 0x00; setvideoregmask(pSiS, Index_VI_Control_Misc2, misc2, mask); setvideoregmask(pSiS, Index_VI_Control_Misc1, misc1, 0x04); misc2 = 0x01; if(enable2) misc1 = 0x04; else misc1 = 0x00; setvideoregmask(pSiS, Index_VI_Control_Misc2, misc2, mask); setvideoregmask(pSiS, Index_VI_Control_Misc1, misc1, 0x04); } else { /* This means we are either in SINGLE1 or SINGLE2 mode */ misc2 = 0x00; if(enable1 || enable2) { if(pSiS->MiscFlags & MISC_SIS760ONEOVERLAY) { if((width1 > (limit * 2)) || (width2 > (limit * 2))) { misc2 = 0x20; } else { misc2 = 0x10; } misc1 = 0x00; } else { misc1 = 0x04; } } else { misc1 = 0x00; } setvideoregmask(pSiS, Index_VI_Control_Misc2, misc2, mask); setvideoregmask(pSiS, Index_VI_Control_Misc1, misc1, 0x04); } } #endif /* About linebuffer merging: * * For example the 651: * Each overlay has 4 line buffers, 384 bytes each (<-- Is that really correct? 1920 / 384 = 5 !!!) * If the source width is greater than 384, line buffers must be merged. * Dual merge: Only O1 usable (uses overlay 2's linebuffer), maximum width 384*2 * Individual merge: Both overlays available, maximum width 384*2 * All merge: Only overlay 1 available, maximum width = 384*4 (<--- should be 1920, is 1536...) * * * Normally: Dual merge: Individual merge * Overlay 1 Overlay 2 Overlay 1 only! Both overlays * ___1___ ___5___ ___1___ ___2___ -\ O1 ___1___ ___2___ * ___2___ ___6___ ___3___ ___4___ \_ O 1 O1 ___3___ ___4___ * ___3___ ___7___ ___5___ ___6___ / O2 ___5___ ___6___ * ___4___ ___8___ ___7___ ___8___ -/ O2 ___7___ ___8___ * * * All merge: ___1___ ___2___ ___3___ ___4___ * (Overlay 1 only!) ___5___ ___6___ ___7___ ___8___ * * Individual merge is supported on all chipsets. * Dual merge is only supported on the 300 series and M650/651 and later. * All merge is only supported on the M650/651 and later. * Single-Overlay-chipsets only support Individual merge. * */ static void merge_line_buf(SISPtr pSiS, SISPortPrivPtr pPriv, Bool enable, short width, short limit) { UChar misc1, misc2, mask = pPriv->linebufmask; if(enable) { /* ----- enable linebuffer merge */ switch(pPriv->displayMode){ case DISPMODE_SINGLE1: if(pSiS->VGAEngine == SIS_300_VGA) { if(pPriv->dualHeadMode) { misc2 = 0x00; misc1 = 0x04; } else { misc2 = 0x10; misc1 = 0x00; } } else { if(pPriv->hasTwoOverlays) { if(pPriv->dualHeadMode) { misc2 = 0x00; misc1 = 0x04; } else { if(width > (limit * 2)) { misc2 = 0x20; } else { misc2 = 0x10; } misc1 = 0x00; } } else if(pSiS->MiscFlags & MISC_SIS760ONEOVERLAY) { if(width > (limit * 2)) { misc2 = 0x20; } else { misc2 = 0x10; } misc1 = 0x00; } else { misc2 = 0x00; misc1 = 0x04; } } setvideoregmask(pSiS, Index_VI_Control_Misc2, misc2, mask); setvideoregmask(pSiS, Index_VI_Control_Misc1, misc1, 0x04); break; case DISPMODE_SINGLE2: if(pSiS->VGAEngine == SIS_300_VGA) { if(pPriv->dualHeadMode) { misc2 = 0x01; misc1 = 0x04; } else { misc2 = 0x10; misc1 = 0x00; } } else { if(pPriv->hasTwoOverlays) { if(pPriv->dualHeadMode) { misc2 = 0x01; misc1 = 0x04; } else { if(width > (limit * 2)) { misc2 = 0x20; } else { misc2 = 0x10; } misc1 = 0x00; } } else if(pSiS->MiscFlags & MISC_SIS760ONEOVERLAY) { if(width > (limit * 2)) { misc2 = 0x20; } else { misc2 = 0x10; } misc1 = 0x00; } else { misc2 = 0x00; misc1 = 0x04; } } setvideoregmask(pSiS, Index_VI_Control_Misc2, misc2, mask); setvideoregmask(pSiS, Index_VI_Control_Misc1, misc1, 0x04); break; case DISPMODE_MIRROR: /* This can only be on chips with 2 overlays */ default: setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x00, mask); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x04, 0x04); setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x01, mask); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x04, 0x04); break; } } else { /* ----- disable linebuffer merge */ switch(pPriv->displayMode) { case DISPMODE_SINGLE1: setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x00, mask); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x04); break; case DISPMODE_SINGLE2: if(pSiS->VGAEngine == SIS_300_VGA) { if(pPriv->dualHeadMode) misc2 = 0x01; else misc2 = 0x00; } else { if(pPriv->hasTwoOverlays) { if(pPriv->dualHeadMode) misc2 = 0x01; else misc2 = 0x00; } else { misc2 = 0x00; } } setvideoregmask(pSiS, Index_VI_Control_Misc2, misc2, mask); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x04); break; case DISPMODE_MIRROR: /* This can only be on chips with 2 overlays */ default: setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x00, mask); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x04); setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x01, mask); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x04); break; } } } /********************************* * Select video format * *********************************/ static __inline void set_format(SISPtr pSiS, SISOverlayPtr pOverlay) { CARD8 fmt; switch (pOverlay->pixelFormat){ case PIXEL_FMT_YV12: case PIXEL_FMT_I420: fmt = 0x0c; break; case PIXEL_FMT_YUY2: fmt = 0x28; break; case PIXEL_FMT_UYVY: fmt = 0x08; break; case PIXEL_FMT_YVYU: fmt = 0x38; break; case PIXEL_FMT_NV12: fmt = 0x4c; break; case PIXEL_FMT_NV21: fmt = 0x5c; break; case PIXEL_FMT_RGB5: /* D[5:4] : 00 RGB555, 01 RGB 565 */ fmt = 0x00; break; case PIXEL_FMT_RGB6: fmt = 0x10; break; default: fmt = 0x00; } setvideoregmask(pSiS, Index_VI_Control_Misc0, fmt, 0xfc); } /********************************* * Set various video registers * *********************************/ static __inline void set_colorkey(SISPtr pSiS, CARD32 colorkey) { CARD8 r, g, b; b = (CARD8)(colorkey & 0xFF); g = (CARD8)((colorkey >> 8) & 0xFF); r = (CARD8)((colorkey >> 16) & 0xFF); setvideoreg(pSiS, Index_VI_Overlay_ColorKey_Blue_Min ,(CARD8)b); setvideoreg(pSiS, Index_VI_Overlay_ColorKey_Green_Min ,(CARD8)g); setvideoreg(pSiS, Index_VI_Overlay_ColorKey_Red_Min ,(CARD8)r); setvideoreg(pSiS, Index_VI_Overlay_ColorKey_Blue_Max ,(CARD8)b); setvideoreg(pSiS, Index_VI_Overlay_ColorKey_Green_Max ,(CARD8)g); setvideoreg(pSiS, Index_VI_Overlay_ColorKey_Red_Max ,(CARD8)r); } static __inline void set_chromakey(SISPtr pSiS, CARD32 chromamin, CARD32 chromamax) { CARD8 r1, g1, b1; CARD8 r2, g2, b2; b1 = (CARD8)(chromamin & 0xFF); g1 = (CARD8)((chromamin >> 8) & 0xFF); r1 = (CARD8)((chromamin >> 16) & 0xFF); b2 = (CARD8)(chromamax & 0xFF); g2 = (CARD8)((chromamax >> 8) & 0xFF); r2 = (CARD8)((chromamax >> 16) & 0xFF); setvideoreg(pSiS, Index_VI_Overlay_ChromaKey_Blue_V_Min ,(CARD8)b1); setvideoreg(pSiS, Index_VI_Overlay_ChromaKey_Green_U_Min ,(CARD8)g1); setvideoreg(pSiS, Index_VI_Overlay_ChromaKey_Red_Y_Min ,(CARD8)r1); setvideoreg(pSiS, Index_VI_Overlay_ChromaKey_Blue_V_Max ,(CARD8)b2); setvideoreg(pSiS, Index_VI_Overlay_ChromaKey_Green_U_Max ,(CARD8)g2); setvideoreg(pSiS, Index_VI_Overlay_ChromaKey_Red_Y_Max ,(CARD8)r2); } static __inline void set_brightness(SISPtr pSiS, CARD8 brightness) { setvideoreg(pSiS, Index_VI_Brightness, brightness); } static __inline void set_contrast(SISPtr pSiS, CARD8 contrast) { setvideoregmask(pSiS, Index_VI_Contrast_Enh_Ctrl, contrast, 0x07); } /* 315 series and later only */ static __inline void set_saturation(SISPtr pSiS, short saturation) { CARD8 temp = 0; if(saturation < 0) { temp |= 0x88; saturation = -saturation; } temp |= (saturation & 0x07); temp |= ((saturation & 0x07) << 4); setvideoreg(pSiS, Index_VI_Saturation, temp); } /* 315 series and later only */ static __inline void set_hue(SISPtr pSiS, CARD8 hue) { setvideoregmask(pSiS, Index_VI_Hue, (hue & 0x08) ? (hue ^ 0x07) : hue, 0x0F); } static __inline void set_disablegfx(SISPtr pSiS, Bool mybool, SISOverlayPtr pOverlay) { /* This is not supported on M65x, 65x (x>0) or later */ /* For CRT1 ONLY!!! */ if((!(pSiS->ChipFlags & SiSCF_Is65x)) && (pSiS->Chipset != PCI_CHIP_SIS660) && (pSiS->Chipset != PCI_CHIP_SIS340) && (pSiS->Chipset != PCI_CHIP_XGIXG20) && (pSiS->Chipset != PCI_CHIP_XGIXG40)) { setvideoregmask(pSiS, Index_VI_Control_Misc2, mybool ? 0x04 : 0x00, 0x04); if(mybool) pOverlay->keyOP = VI_ROP_Always; } } static __inline void set_disablegfxlr(SISPtr pSiS, Bool mybool, SISOverlayPtr pOverlay) { setvideoregmask(pSiS, Index_VI_Control_Misc1, mybool ? 0x01 : 0x00, 0x01); if(mybool) pOverlay->keyOP = VI_ROP_Always; } #ifdef SIS_CP SIS_CP_VIDEO_SUBS #endif /********************************* * Set main overlay registers * *********************************/ static void set_overlay(SISPtr pSiS, SISOverlayPtr pOverlay, SISPortPrivPtr pPriv, int index, int iscrt2) { CARD8 h_over, v_over; CARD16 top, bottom, left, right, pitch = 0; CARD16 screenX, screenY; CARD32 PSY; int modeflags, totalPixels, confactor, sample, watchdog = 0; #ifdef SISMERGED if(pSiS->MergedFB && iscrt2) { screenX = pOverlay->currentmode2->HDisplay; screenY = pOverlay->currentmode2->VDisplay; modeflags = pOverlay->currentmode2->Flags; top = pOverlay->dstBox2.y1; bottom = pOverlay->dstBox2.y2; left = pOverlay->dstBox2.x1; right = pOverlay->dstBox2.x2; pitch = pOverlay->pitch2 >> pPriv->shiftValue; } else { #endif screenX = pOverlay->currentmode->HDisplay; screenY = pOverlay->currentmode->VDisplay; modeflags = pOverlay->currentmode->Flags; top = pOverlay->dstBox.y1; bottom = pOverlay->dstBox.y2; left = pOverlay->dstBox.x1; right = pOverlay->dstBox.x2; pitch = pOverlay->pitch >> pPriv->shiftValue; #ifdef SISMERGED } #endif if(bottom > screenY) bottom = screenY; if(right > screenX) right = screenX; /* calculate contrast factor */ totalPixels = (right - left) * (bottom - top); confactor = (totalPixels - 10000) / 20000; if(confactor > 3) confactor = 3; switch(confactor) { case 1: sample = 4096 << 10; break; case 2: case 3: sample = 8192 << 10; break; default: sample = 2048 << 10; } sample /= totalPixels; confactor <<= 6; /* Correct coordinates for doublescan/interlace modes */ if( (modeflags & V_DBLSCAN) && (!((pPriv->bridgeIsSlave || iscrt2) && (pSiS->MiscFlags & MISC_STNMODE))) ) { /* DoubleScan modes require Y coordinates * 2 */ top <<= 1; bottom <<= 1; } else if(modeflags & V_INTERLACE) { /* Interlace modes require Y coordinates / 2 */ top >>= 1; bottom >>= 1; } h_over = (((left >> 8) & 0x0f) | ((right >> 4) & 0xf0)); v_over = (((top >> 8) & 0x0f) | ((bottom >> 4) & 0xf0)); /* set line buffer size */ #ifdef SISMERGED if(pSiS->MergedFB && iscrt2) { setvideoreg(pSiS, Index_VI_Line_Buffer_Size, (CARD8)pOverlay->lineBufSize2); if(pPriv->is340 || pPriv->is761 || pPriv->isXGI) { setvideoreg(pSiS, Index_VI_Line_Buffer_Size_High, (CARD8)(pOverlay->lineBufSize2 >> 8)); } } else { #endif setvideoreg(pSiS, Index_VI_Line_Buffer_Size, (CARD8)pOverlay->lineBufSize); if(pPriv->is340 || pPriv->is761 || pPriv->isXGI) { setvideoreg(pSiS, Index_VI_Line_Buffer_Size_High, (CARD8)(pOverlay->lineBufSize >> 8)); } #ifdef SISMERGED } #endif /* set color key mode */ setvideoregmask(pSiS, Index_VI_Key_Overlay_OP, pOverlay->keyOP, 0x0f); /* We don't have to wait for vertical retrace in all cases */ if(pPriv->mustwait) { if(pSiS->VGAEngine == SIS_315_VGA) { if(index) { CARD16 mytop = getvideoreg(pSiS, Index_VI_Win_Ver_Disp_Start_Low); mytop |= ((getvideoreg(pSiS, Index_VI_Win_Ver_Over) & 0x0f) << 8); pOverlay->oldtop = mytop; watchdog = 0xffff; if(mytop < screenY - 2) { do { watchdog = get_scanline_CRT2(pSiS, pPriv); } while((watchdog <= mytop) || (watchdog >= screenY)); } pOverlay->oldLine = watchdog; } } else { watchdog = WATCHDOG_DELAY; while(pOverlay->VBlankActiveFunc(pSiS, pPriv) && --watchdog); watchdog = WATCHDOG_DELAY; while((!pOverlay->VBlankActiveFunc(pSiS, pPriv)) && --watchdog); } } /* Unlock address registers */ setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x20, 0x20); /* Set destination window position */ setvideoreg(pSiS, Index_VI_Win_Hor_Disp_Start_Low, (CARD8)left); setvideoreg(pSiS, Index_VI_Win_Hor_Disp_End_Low, (CARD8)right); setvideoreg(pSiS, Index_VI_Win_Hor_Over, (CARD8)h_over); setvideoreg(pSiS, Index_VI_Win_Ver_Disp_Start_Low, (CARD8)top); setvideoreg(pSiS, Index_VI_Win_Ver_Disp_End_Low, (CARD8)bottom); setvideoreg(pSiS, Index_VI_Win_Ver_Over, (CARD8)v_over); /* Contrast factor */ setvideoregmask(pSiS, Index_VI_Contrast_Enh_Ctrl, (CARD8)confactor, 0xc0); setvideoreg(pSiS, Index_VI_Contrast_Factor, sample); /* Set Y buf pitch */ setvideoreg(pSiS, Index_VI_Disp_Y_Buf_Pitch_Low, (CARD8)(pitch)); setvideoregmask(pSiS, Index_VI_Disp_Y_UV_Buf_Pitch_Middle, (CARD8)(pitch >> 8), 0x0f); /* Set Y start address */ #ifdef SISMERGED if(pSiS->MergedFB && iscrt2) { PSY = pOverlay->PSY2; } else #endif PSY = pOverlay->PSY; setvideoreg(pSiS, Index_VI_Disp_Y_Buf_Start_Low, (CARD8)(PSY)); setvideoreg(pSiS, Index_VI_Disp_Y_Buf_Start_Middle, (CARD8)(PSY >> 8)); setvideoreg(pSiS, Index_VI_Disp_Y_Buf_Start_High, (CARD8)(PSY >> 16)); /* Set 315 series overflow bits for Y plane */ if(pSiS->VGAEngine == SIS_315_VGA) { setvideoreg(pSiS, Index_VI_Disp_Y_Buf_Pitch_High, (CARD8)(pitch >> 12)); setvideoreg(pSiS, Index_VI_Y_Buf_Start_Over, ((CARD8)(PSY >> 24) & 0x03)); } /* Set U/V data if using planar formats */ if(pOverlay->planar) { CARD32 PSU = pOverlay->PSU; CARD32 PSV = pOverlay->PSV; #ifdef SISMERGED if(pSiS->MergedFB && iscrt2) { PSU = pOverlay->PSU2; PSV = pOverlay->PSV2; } #endif if(pOverlay->planar_shiftpitch) pitch >>= 1; /* Set U/V pitch */ setvideoreg(pSiS, Index_VI_Disp_UV_Buf_Pitch_Low, (CARD8)pitch); setvideoregmask(pSiS, Index_VI_Disp_Y_UV_Buf_Pitch_Middle, (CARD8)(pitch >> 4), 0xf0); /* Set U/V start address */ setvideoreg(pSiS, Index_VI_U_Buf_Start_Low, (CARD8)PSU); setvideoreg(pSiS, Index_VI_U_Buf_Start_Middle,(CARD8)(PSU >> 8)); setvideoreg(pSiS, Index_VI_U_Buf_Start_High, (CARD8)(PSU >> 16)); setvideoreg(pSiS, Index_VI_V_Buf_Start_Low, (CARD8)PSV); setvideoreg(pSiS, Index_VI_V_Buf_Start_Middle,(CARD8)(PSV >> 8)); setvideoreg(pSiS, Index_VI_V_Buf_Start_High, (CARD8)(PSV >> 16)); /* 315 series overflow bits */ if(pSiS->VGAEngine == SIS_315_VGA) { setvideoreg(pSiS, Index_VI_Disp_UV_Buf_Pitch_High, (CARD8)(pitch >> 12)); setvideoreg(pSiS, Index_VI_U_Buf_Start_Over, ((CARD8)(PSU >> 24) & 0x03)); if(pPriv->is661741760) { setvideoregmask(pSiS, Index_VI_V_Buf_Start_Over, ((CARD8)(PSV >> 24) & 0x03), 0xc3); } else { setvideoreg(pSiS, Index_VI_V_Buf_Start_Over, ((CARD8)(PSV >> 24) & 0x03)); } } } setvideoregmask(pSiS, Index_VI_Control_Misc1, pOverlay->bobEnable, 0x1a); /* Lock the address registers */ setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x20); /* Set scale factor */ #ifdef SISMERGED if(pSiS->MergedFB && iscrt2) { setvideoreg(pSiS, Index_VI_Hor_Post_Up_Scale_Low, (CARD8)(pOverlay->HUSF2)); setvideoreg(pSiS, Index_VI_Hor_Post_Up_Scale_High,(CARD8)((pOverlay->HUSF2) >> 8)); setvideoreg(pSiS, Index_VI_Ver_Up_Scale_Low, (CARD8)(pOverlay->VUSF2)); setvideoreg(pSiS, Index_VI_Ver_Up_Scale_High, (CARD8)((pOverlay->VUSF2) >> 8)); setvideoregmask(pSiS, Index_VI_Scale_Control, (pOverlay->IntBit2 << 3) | (pOverlay->wHPre2), 0x7f); if(pPriv->havetapscaler) { if((pOverlay->tap_scale2 != pOverlay->tap_scale2_old) || pPriv->mustresettap2) { set_dda_regs(pSiS, pOverlay->tap_scale2); pOverlay->tap_scale2_old = pOverlay->tap_scale2; pPriv->mustresettap2 = FALSE; } } } else { #endif setvideoreg(pSiS, Index_VI_Hor_Post_Up_Scale_Low, (CARD8)(pOverlay->HUSF)); setvideoreg(pSiS, Index_VI_Hor_Post_Up_Scale_High,(CARD8)((pOverlay->HUSF) >> 8)); setvideoreg(pSiS, Index_VI_Ver_Up_Scale_Low, (CARD8)(pOverlay->VUSF)); setvideoreg(pSiS, Index_VI_Ver_Up_Scale_High, (CARD8)((pOverlay->VUSF) >> 8)); setvideoregmask(pSiS, Index_VI_Scale_Control, (pOverlay->IntBit << 3) | (pOverlay->wHPre), 0x7f); if(pPriv->havetapscaler) { if((pOverlay->tap_scale != pOverlay->tap_scale_old) || pPriv->mustresettap) { set_dda_regs(pSiS, pOverlay->tap_scale); pOverlay->tap_scale_old = pOverlay->tap_scale; pPriv->mustresettap = FALSE; } } #ifdef SISMERGED } #endif } /********************************* * Shut down overlay * *********************************/ /* Overlay MUST NOT be switched off while beam is over it */ static void close_overlay(SISPtr pSiS, SISPortPrivPtr pPriv) { int watchdog; if(!pPriv->overlayStatus) return; pPriv->overlayStatus = FALSE; pPriv->mustresettap = TRUE; #ifdef SISMERGED pPriv->mustresettap2 = TRUE; #endif if(pPriv->displayMode & (DISPMODE_MIRROR | DISPMODE_SINGLE2)) { /* CRT2: MIRROR or SINGLE2 * 1 overlay: Uses overlay 0 * 2 overlays: Uses Overlay 1 if MIRROR or DUAL HEAD * Uses Overlay 0 if SINGLE2 and not DUAL HEAD */ if(pPriv->hasTwoOverlays) { if((pPriv->dualHeadMode) || (pPriv->displayMode == DISPMODE_MIRROR)) { setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x01, 0x01); } else { setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x00, 0x01); } } else if(pPriv->displayMode == DISPMODE_SINGLE2) { #ifdef SISDUALHEAD if(pPriv->dualHeadMode) { /* Check if overlay already grabbed by other head */ if(!(getsrreg(pSiS, 0x06) & 0x40)) return; } #endif setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x00, 0x01); } setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x01); watchdog = WATCHDOG_DELAY; while((!vblank_active_CRT2(pSiS, pPriv)) && --watchdog); watchdog = WATCHDOG_DELAY; while(vblank_active_CRT2(pSiS, pPriv) && --watchdog); setvideoregmask(pSiS, Index_VI_Control_Misc0, 0x00, 0x02); watchdog = WATCHDOG_DELAY; while((!vblank_active_CRT2(pSiS, pPriv)) && --watchdog); watchdog = WATCHDOG_DELAY; while(vblank_active_CRT2(pSiS, pPriv) && --watchdog); #ifdef SIS_CP SIS_CP_RESET_CP #endif } if(pPriv->displayMode & (DISPMODE_SINGLE1 | DISPMODE_MIRROR)) { /* CRT1: Always uses overlay 0 */ #ifdef SISDUALHEAD if(pPriv->dualHeadMode) { if(!pPriv->hasTwoOverlays) { /* Check if overlay already grabbed by other head */ if(getsrreg(pSiS, 0x06) & 0x40) return; } } #endif setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x00, 0x05); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x01); watchdog = WATCHDOG_DELAY; while((!vblank_active_CRT1(pSiS, pPriv)) && --watchdog); watchdog = WATCHDOG_DELAY; while(vblank_active_CRT1(pSiS, pPriv) && --watchdog); setvideoregmask(pSiS, Index_VI_Control_Misc0, 0x00, 0x02); watchdog = WATCHDOG_DELAY; while((!vblank_active_CRT1(pSiS, pPriv)) && --watchdog); watchdog = WATCHDOG_DELAY; while(vblank_active_CRT1(pSiS, pPriv) && --watchdog); } } /********************************* * DisplayVideo() * *********************************/ static void SISDisplayVideo(ScrnInfoPtr pScrn, SISPortPrivPtr pPriv) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif short srcPitch = pPriv->srcPitch; short height = pPriv->height; UShort screenwidth; SISOverlayRec overlay; int srcOffsetX = 0, srcOffsetY = 0; int sx = 0, sy = 0, watchdog; int index = 0, iscrt2 = 0; #ifdef SISMERGED UChar temp; UShort screen2width = 0; int srcOffsetX2 = 0, srcOffsetY2 = 0; int sx2 = 0, sy2 = 0; #endif /* Determine whether we have two overlays or only one */ set_hastwooverlays(pSiS, pPriv); pPriv->NoOverlay = FALSE; #ifdef SISDUALHEAD if(pPriv->dualHeadMode) { if(!pPriv->hasTwoOverlays) { if(pSiS->SecondHead) { if(pSiSEnt->curxvcrtnum != 0) { if(pPriv->overlayStatus) { close_overlay(pSiS, pPriv); } pPriv->NoOverlay = TRUE; return; } } else { if(pSiSEnt->curxvcrtnum != 1) { if(pPriv->overlayStatus) { close_overlay(pSiS, pPriv); } pPriv->NoOverlay = TRUE; return; } } } } #endif /* setup dispmode (MIRROR, SINGLEx) */ set_dispmode(pScrn, pPriv); /* Check if overlay is supported with current mode */ #ifdef SISMERGED if(!pSiS->MergedFB) { #endif if( ((pPriv->displayMode & DISPMODE_MIRROR) && ((pSiS->MiscFlags & (MISC_CRT1OVERLAY|MISC_CRT2OVERLAY)) != (MISC_CRT1OVERLAY|MISC_CRT2OVERLAY))) || ((pPriv->displayMode & DISPMODE_SINGLE1) && (!(pSiS->MiscFlags & MISC_CRT1OVERLAY))) || ((pPriv->displayMode & DISPMODE_SINGLE2) && (!(pSiS->MiscFlags & MISC_CRT2OVERLAY))) ) { if(pPriv->overlayStatus) { close_overlay(pSiS, pPriv); } pPriv->NoOverlay = TRUE; return; } #ifdef SISMERGED } #endif memset(&overlay, 0, sizeof(overlay)); overlay.pixelFormat = pPriv->id; overlay.pitch = overlay.origPitch = srcPitch; if(pPriv->usechromakey) { overlay.keyOP = (pPriv->insidechromakey) ? VI_ROP_ChromaKey : VI_ROP_NotChromaKey; } else { overlay.keyOP = VI_ROP_DestKey; } #ifdef SISDEINT switch(pPriv->deinterlacemethod) { case 1: overlay.bobEnable = 0x02; /* overlay.bobEnable |= (pPriv->currentBuf) ? 0x00 : 0x10; */ break; case 2: overlay.bobEnable = 0x08; /* overlay.bobEnable |= (pPriv->currentBuf) ? 0x00 : 0x10; */ break; case 3: overlay.bobEnable = 0x0a; /* overlay.bobEnable |= (pPriv->currentBuf) ? 0x00 : 0x10; */ break; default: #endif overlay.bobEnable = 0x00; /* Disable BOB de-interlacer */ #ifdef SISDEINT } #endif #ifdef SISMERGED if(pSiS->MergedFB) { overlay.DoFirst = TRUE; overlay.DoSecond = TRUE; overlay.pitch2 = overlay.origPitch; overlay.currentmode = ((SiSMergedDisplayModePtr)pSiS->CurrentLayout.mode->Private)->CRT1; overlay.currentmode2 = ((SiSMergedDisplayModePtr)pSiS->CurrentLayout.mode->Private)->CRT2; overlay.SCREENheight = overlay.currentmode->VDisplay; overlay.SCREENheight2 = overlay.currentmode2->VDisplay; screenwidth = overlay.currentmode->HDisplay; screen2width = overlay.currentmode2->HDisplay; overlay.dstBox.x1 = pPriv->drw_x - pSiS->CRT1frameX0; overlay.dstBox.x2 = overlay.dstBox.x1 + pPriv->drw_w; overlay.dstBox.y1 = pPriv->drw_y - pSiS->CRT1frameY0; overlay.dstBox.y2 = overlay.dstBox.y1 + pPriv->drw_h; overlay.dstBox2.x1 = pPriv->drw_x - pSiS->CRT2pScrn->frameX0; overlay.dstBox2.x2 = overlay.dstBox2.x1 + pPriv->drw_w; overlay.dstBox2.y1 = pPriv->drw_y - pSiS->CRT2pScrn->frameY0; overlay.dstBox2.y2 = overlay.dstBox2.y1 + pPriv->drw_h; } else { #endif overlay.currentmode = pSiS->CurrentLayout.mode; overlay.SCREENheight = overlay.currentmode->VDisplay; screenwidth = overlay.currentmode->HDisplay; overlay.dstBox.x1 = pPriv->drw_x - pScrn->frameX0; overlay.dstBox.x2 = pPriv->drw_x + pPriv->drw_w - pScrn->frameX0; overlay.dstBox.y1 = pPriv->drw_y - pScrn->frameY0; overlay.dstBox.y2 = pPriv->drw_y + pPriv->drw_h - pScrn->frameY0; #ifdef SISMERGED } #endif /* Note: x2/y2 is actually real coordinate + 1 */ if((overlay.dstBox.x1 >= overlay.dstBox.x2) || (overlay.dstBox.y1 >= overlay.dstBox.y2)) { #ifdef SISMERGED if(pSiS->MergedFB) overlay.DoFirst = FALSE; else #endif return; } if((overlay.dstBox.x2 <= 0) || (overlay.dstBox.y2 <= 0)) { #ifdef SISMERGED if(pSiS->MergedFB) overlay.DoFirst = FALSE; else #endif return; } if((overlay.dstBox.x1 >= screenwidth) || (overlay.dstBox.y1 >= overlay.SCREENheight)) { #ifdef SISMERGED if(pSiS->MergedFB) overlay.DoFirst = FALSE; else #endif return; } #ifdef SISMERGED if(pSiS->MergedFB) { /* Check if dotclock is within limits for CRT1 */ if(pPriv->displayMode & (DISPMODE_SINGLE1 | DISPMODE_MIRROR)) { if(!(pSiS->MiscFlags & MISC_CRT1OVERLAY)) { overlay.DoFirst = FALSE; } } } #endif if(overlay.dstBox.x1 < 0) { srcOffsetX = pPriv->src_w * (-overlay.dstBox.x1) / pPriv->drw_w; overlay.dstBox.x1 = 0; } if(overlay.dstBox.y1 < 0) { srcOffsetY = pPriv->src_h * (-overlay.dstBox.y1) / pPriv->drw_h; overlay.dstBox.y1 = 0; } if((overlay.dstBox.x1 >= overlay.dstBox.x2 - 2) || (overlay.dstBox.x1 >= screenwidth - 2) || (overlay.dstBox.y1 >= overlay.dstBox.y2)) { #ifdef SISMERGED if(pSiS->MergedFB) overlay.DoFirst = FALSE; else #endif return; } #ifdef SISMERGED if(pSiS->MergedFB) { if((overlay.dstBox2.x2 <= 0) || (overlay.dstBox2.y2 <= 0)) overlay.DoSecond = FALSE; if((overlay.dstBox2.x1 >= screen2width) || (overlay.dstBox2.y1 >= overlay.SCREENheight2)) overlay.DoSecond = FALSE; if(overlay.dstBox2.x1 < 0) { srcOffsetX2 = pPriv->src_w * (-overlay.dstBox2.x1) / pPriv->drw_w; overlay.dstBox2.x1 = 0; } if(overlay.dstBox2.y1 < 0) { srcOffsetY2 = pPriv->src_h * (-overlay.dstBox2.y1) / pPriv->drw_h; overlay.dstBox2.y1 = 0; } if((overlay.dstBox2.x1 >= overlay.dstBox2.x2 - 2) || (overlay.dstBox2.x1 >= screen2width - 2) || (overlay.dstBox2.y1 >= overlay.dstBox2.y2)) overlay.DoSecond = FALSE; /* Check if dotclock is within limits for CRT2 */ if(pPriv->displayMode & (DISPMODE_SINGLE2 | DISPMODE_MIRROR)) { if(!(pSiS->MiscFlags & MISC_CRT2OVERLAY)) { overlay.DoSecond = FALSE; } } /* If neither overlay is to be displayed, disable them if they are currently enabled */ if((!overlay.DoFirst) && (!overlay.DoSecond)) { setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x00, 0x05); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x01); temp = getvideoreg(pSiS,Index_VI_Control_Misc0); if(temp & 0x02) { watchdog = WATCHDOG_DELAY; if(pPriv->hasTwoOverlays) { while((!vblank_active_CRT1(pSiS, pPriv)) && --watchdog); watchdog = WATCHDOG_DELAY; while(vblank_active_CRT1(pSiS, pPriv) && --watchdog); } else { temp = getsrreg(pSiS, 0x06); if(!(temp & 0x40)) { while((!vblank_active_CRT1(pSiS, pPriv)) && --watchdog); watchdog = WATCHDOG_DELAY; while(vblank_active_CRT1(pSiS, pPriv) && --watchdog); } else { while((!vblank_active_CRT2(pSiS, pPriv)) && --watchdog); watchdog = WATCHDOG_DELAY; while(vblank_active_CRT2(pSiS, pPriv) && --watchdog); } } setvideoregmask(pSiS, Index_VI_Control_Misc0, 0x00, 0x02); } if(pPriv->hasTwoOverlays) { setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x01, 0x01); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x01); temp = getvideoreg(pSiS,Index_VI_Control_Misc0); if(temp & 0x02) { watchdog = WATCHDOG_DELAY; while((!vblank_active_CRT2(pSiS, pPriv)) && --watchdog); watchdog = WATCHDOG_DELAY; while(vblank_active_CRT2(pSiS, pPriv) && --watchdog); setvideoregmask(pSiS, Index_VI_Control_Misc0, 0x00, 0x02); } } pPriv->overlayStatus = FALSE; return; } } #endif switch(pPriv->id) { case PIXEL_FMT_YV12: overlay.planar = 1; overlay.planar_shiftpitch = 1; #ifdef SISMERGED if((!pSiS->MergedFB) || (overlay.DoFirst)) { #endif sx = (pPriv->src_x + srcOffsetX) & ~7; sy = (pPriv->src_y + srcOffsetY) & ~1; overlay.PSY = pPriv->bufAddr[pPriv->currentBuf] + sx + sy*srcPitch; overlay.PSV = pPriv->bufAddr[pPriv->currentBuf] + height*srcPitch + ((sx + sy*srcPitch/2) >> 1); overlay.PSU = pPriv->bufAddr[pPriv->currentBuf] + height*srcPitch*5/4 + ((sx + sy*srcPitch/2) >> 1); overlay.PSY += FBOFFSET; overlay.PSV += FBOFFSET; overlay.PSU += FBOFFSET; overlay.PSY >>= pPriv->shiftValue; overlay.PSV >>= pPriv->shiftValue; overlay.PSU >>= pPriv->shiftValue; #ifdef SISMERGED } if((pSiS->MergedFB) && (overlay.DoSecond)) { sx2 = (pPriv->src_x + srcOffsetX2) & ~7; sy2 = (pPriv->src_y + srcOffsetY2) & ~1; overlay.PSY2 = pPriv->bufAddr[pPriv->currentBuf] + sx2 + sy2*srcPitch; overlay.PSV2 = pPriv->bufAddr[pPriv->currentBuf] + height*srcPitch + ((sx2 + sy2*srcPitch/2) >> 1); overlay.PSU2 = pPriv->bufAddr[pPriv->currentBuf] + height*srcPitch*5/4 + ((sx2 + sy2*srcPitch/2) >> 1); overlay.PSY2 += FBOFFSET; overlay.PSV2 += FBOFFSET; overlay.PSU2 += FBOFFSET; overlay.PSY2 >>= pPriv->shiftValue; overlay.PSV2 >>= pPriv->shiftValue; overlay.PSU2 >>= pPriv->shiftValue; } #endif break; case PIXEL_FMT_I420: overlay.planar = 1; overlay.planar_shiftpitch = 1; #ifdef SISMERGED if((!pSiS->MergedFB) || (overlay.DoFirst)) { #endif sx = (pPriv->src_x + srcOffsetX) & ~7; sy = (pPriv->src_y + srcOffsetY) & ~1; overlay.PSY = pPriv->bufAddr[pPriv->currentBuf] + sx + sy*srcPitch; overlay.PSV = pPriv->bufAddr[pPriv->currentBuf] + height*srcPitch*5/4 + ((sx + sy*srcPitch/2) >> 1); overlay.PSU = pPriv->bufAddr[pPriv->currentBuf] + height*srcPitch + ((sx + sy*srcPitch/2) >> 1); overlay.PSY += FBOFFSET; overlay.PSV += FBOFFSET; overlay.PSU += FBOFFSET; overlay.PSY >>= pPriv->shiftValue; overlay.PSV >>= pPriv->shiftValue; overlay.PSU >>= pPriv->shiftValue; #ifdef SISMERGED } if((pSiS->MergedFB) && (overlay.DoSecond)) { sx2 = (pPriv->src_x + srcOffsetX2) & ~7; sy2 = (pPriv->src_y + srcOffsetY2) & ~1; overlay.PSY2 = pPriv->bufAddr[pPriv->currentBuf] + sx2 + sy2*srcPitch; overlay.PSV2 = pPriv->bufAddr[pPriv->currentBuf] + height*srcPitch*5/4 + ((sx2 + sy2*srcPitch/2) >> 1); overlay.PSU2 = pPriv->bufAddr[pPriv->currentBuf] + height*srcPitch + ((sx2 + sy2*srcPitch/2) >> 1); overlay.PSY2 += FBOFFSET; overlay.PSV2 += FBOFFSET; overlay.PSU2 += FBOFFSET; overlay.PSY2 >>= pPriv->shiftValue; overlay.PSV2 >>= pPriv->shiftValue; overlay.PSU2 >>= pPriv->shiftValue; } #endif break; case PIXEL_FMT_NV12: case PIXEL_FMT_NV21: overlay.planar = 1; overlay.planar_shiftpitch = 0; #ifdef SISMERGED if((!pSiS->MergedFB) || (overlay.DoFirst)) { #endif sx = (pPriv->src_x + srcOffsetX) & ~7; sy = (pPriv->src_y + srcOffsetY) & ~1; overlay.PSY = pPriv->bufAddr[pPriv->currentBuf] + sx + sy*srcPitch; overlay.PSV = pPriv->bufAddr[pPriv->currentBuf] + height*srcPitch + ((sx + sy*srcPitch/2) >> 1); overlay.PSY += FBOFFSET; overlay.PSV += FBOFFSET; overlay.PSY >>= pPriv->shiftValue; overlay.PSV >>= pPriv->shiftValue; overlay.PSU = overlay.PSV; #ifdef SISMERGED } if((pSiS->MergedFB) && (overlay.DoSecond)) { sx2 = (pPriv->src_x + srcOffsetX2) & ~7; sy2 = (pPriv->src_y + srcOffsetY2) & ~1; overlay.PSY2 = pPriv->bufAddr[pPriv->currentBuf] + sx2 + sy2*srcPitch; overlay.PSV2 = pPriv->bufAddr[pPriv->currentBuf] + height*srcPitch + ((sx2 + sy2*srcPitch/2) >> 1); overlay.PSY2 += FBOFFSET; overlay.PSV2 += FBOFFSET; overlay.PSY2 >>= pPriv->shiftValue; overlay.PSV2 >>= pPriv->shiftValue; overlay.PSU2 = overlay.PSV2; } #endif break; case PIXEL_FMT_YUY2: case PIXEL_FMT_UYVY: case PIXEL_FMT_YVYU: case PIXEL_FMT_RGB6: case PIXEL_FMT_RGB5: default: overlay.planar = 0; #ifdef SISMERGED if((!pSiS->MergedFB) || (overlay.DoFirst)) { #endif sx = (pPriv->src_x + srcOffsetX) & ~1; sy = (pPriv->src_y + srcOffsetY); overlay.PSY = (pPriv->bufAddr[pPriv->currentBuf] + sx*2 + sy*srcPitch); overlay.PSY += FBOFFSET; overlay.PSY >>= pPriv->shiftValue; #ifdef SISMERGED } if((pSiS->MergedFB) && (overlay.DoSecond)) { sx2 = (pPriv->src_x + srcOffsetX2) & ~1; sy2 = (pPriv->src_y + srcOffsetY2); overlay.PSY2 = (pPriv->bufAddr[pPriv->currentBuf] + sx2*2 + sy2*srcPitch); overlay.PSY2 += FBOFFSET; overlay.PSY2 >>= pPriv->shiftValue; } #endif break; } /* Some clipping checks */ #ifdef SISMERGED if((!pSiS->MergedFB) || (overlay.DoFirst)) { #endif overlay.srcW = pPriv->src_w - (sx - pPriv->src_x); overlay.srcH = pPriv->src_h - (sy - pPriv->src_y); if( (pPriv->oldx1 != overlay.dstBox.x1) || (pPriv->oldx2 != overlay.dstBox.x2) || (pPriv->oldy1 != overlay.dstBox.y1) || (pPriv->oldy2 != overlay.dstBox.y2) ) { pPriv->mustwait = 1; pPriv->oldx1 = overlay.dstBox.x1; pPriv->oldx2 = overlay.dstBox.x2; pPriv->oldy1 = overlay.dstBox.y1; pPriv->oldy2 = overlay.dstBox.y2; } #ifdef SISMERGED } if((pSiS->MergedFB) && (overlay.DoSecond)) { overlay.srcW2 = pPriv->src_w - (sx2 - pPriv->src_x); overlay.srcH2 = pPriv->src_h - (sy2 - pPriv->src_y); if( (pPriv->oldx1_2 != overlay.dstBox2.x1) || (pPriv->oldx2_2 != overlay.dstBox2.x2) || (pPriv->oldy1_2 != overlay.dstBox2.y1) || (pPriv->oldy2_2 != overlay.dstBox2.y2) ) { pPriv->mustwait = 1; pPriv->oldx1_2 = overlay.dstBox2.x1; pPriv->oldx2_2 = overlay.dstBox2.x2; pPriv->oldy1_2 = overlay.dstBox2.y1; pPriv->oldy2_2 = overlay.dstBox2.y2; } } #endif #ifdef SISMERGED /* Disable an overlay if it is not to be displayed (but enabled currently) */ if((pSiS->MergedFB) && (pPriv->hasTwoOverlays)) { if(!overlay.DoFirst) { setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x00, 0x05); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x01); temp = getvideoreg(pSiS,Index_VI_Control_Misc0); if(temp & 0x02) { watchdog = WATCHDOG_DELAY; while((!vblank_active_CRT1(pSiS, pPriv)) && --watchdog); watchdog = WATCHDOG_DELAY; while(vblank_active_CRT1(pSiS, pPriv) && --watchdog); setvideoregmask(pSiS, Index_VI_Control_Misc0, 0x00, 0x02); } } else if(!overlay.DoSecond) { setvideoregmask(pSiS, Index_VI_Control_Misc2, 0x01, 0x01); setvideoregmask(pSiS, Index_VI_Control_Misc1, 0x00, 0x01); temp = getvideoreg(pSiS,Index_VI_Control_Misc0); if(temp & 0x02) { watchdog = WATCHDOG_DELAY; while((!vblank_active_CRT2(pSiS, pPriv)) && --watchdog); watchdog = WATCHDOG_DELAY; while(vblank_active_CRT2(pSiS, pPriv) && --watchdog); setvideoregmask(pSiS, Index_VI_Control_Misc0, 0x00, 0x02); } } } #endif /* Loop head */ /* Note: index can only be 1 for CRT2, ie overlay 1 * is only used for CRT2. */ if(pPriv->displayMode & DISPMODE_SINGLE2) { if(pPriv->hasTwoOverlays) { /* We have 2 overlays: */ if(pPriv->dualHeadMode) { /* Dual head: We use overlay 2 for CRT2 */ index = 1; iscrt2 = 1; } else { /* Single head: We use overlay 1 for CRT2 */ index = 0; iscrt2 = 1; } } else { /* We have 1 overlay */ /* We use that only overlay for CRT2 */ index = 0; iscrt2 = 1; } overlay.VBlankActiveFunc = vblank_active_CRT2; #ifdef SISMERGED if(!pPriv->hasTwoOverlays) { if((pSiS->MergedFB) && (!overlay.DoSecond)) { index = 0; iscrt2 = 0; overlay.VBlankActiveFunc = vblank_active_CRT1; pPriv->displayMode = DISPMODE_SINGLE1; } } #endif } else { index = 0; iscrt2 = 0; overlay.VBlankActiveFunc = vblank_active_CRT1; #ifdef SISMERGED if((pSiS->MergedFB) && (!overlay.DoFirst)) { if(pPriv->hasTwoOverlays) index = 1; iscrt2 = 1; overlay.VBlankActiveFunc = vblank_active_CRT2; if(!pPriv->hasTwoOverlays) { pPriv->displayMode = DISPMODE_SINGLE2; } } #endif } /* set display mode SR06,32 (CRT1, CRT2 or mirror) */ set_disptype_regs(pScrn, pPriv); /* set (not only calc) merge line buffer */ #ifdef SISMERGED if(!pSiS->MergedFB) { #endif merge_line_buf(pSiS, pPriv, (overlay.srcW > pPriv->linebufMergeLimit), overlay.srcW, pPriv->linebufMergeLimit); #ifdef SISMERGED } else { Bool temp1 = FALSE, temp2 = FALSE; if(overlay.DoFirst) { if(overlay.srcW > pPriv->linebufMergeLimit) temp1 = TRUE; } if(overlay.DoSecond) { if(overlay.srcW2 > pPriv->linebufMergeLimit) temp2 = TRUE; } merge_line_buf_mfb(pSiS, pPriv, temp1, temp2, overlay.srcW, overlay.srcW2, pPriv->linebufMergeLimit); } #endif /* calculate (not set!) line buffer length */ #ifdef SISMERGED if((!pSiS->MergedFB) || (overlay.DoFirst)) #endif calc_line_buf_size_1(&overlay, pPriv); #ifdef SISMERGED if((pSiS->MergedFB) && (overlay.DoSecond)) calc_line_buf_size_2(&overlay, pPriv); #endif if(pPriv->dualHeadMode) { #ifdef SISDUALHEAD if(!pSiS->SecondHead) { if(pPriv->updatetvxpos) { SiS_SetTVxposoffset(pScrn, pPriv->tvxpos); pPriv->updatetvxpos = FALSE; } if(pPriv->updatetvypos) { SiS_SetTVyposoffset(pScrn, pPriv->tvypos); pPriv->updatetvypos = FALSE; } } #endif } else { if(pPriv->updatetvxpos) { SiS_SetTVxposoffset(pScrn, pPriv->tvxpos); pPriv->updatetvxpos = FALSE; } if(pPriv->updatetvypos) { SiS_SetTVyposoffset(pScrn, pPriv->tvypos); pPriv->updatetvypos = FALSE; } } #if 0 /* Clearing this does not seem to be required */ /* and might even be dangerous. */ if(pSiS->VGAEngine == SIS_315_VGA) { watchdog = WATCHDOG_DELAY; while(overlay.VBlankActiveFunc(pSiS, pPriv) && --watchdog); setvideoregmask(pSiS, Index_VI_Control_Misc3, 0x00, 0x03); } #endif setvideoregmask(pSiS, Index_VI_Control_Misc3, 0x03, 0x03); /* Do the following in a loop for CRT1 and CRT2 ----------------- */ MIRROR: /* calculate scale factor */ #ifdef SISMERGED if(pSiS->MergedFB && iscrt2) calc_scale_factor_2(&overlay, pScrn, pPriv, index, iscrt2); else #endif calc_scale_factor(&overlay, pScrn, pPriv, index, iscrt2); /* Select overlay 0 (used for CRT1/or CRT2) or overlay 1 (used for CRT2 only) */ setvideoregmask(pSiS, Index_VI_Control_Misc2, index, 0x01); /* set format (before color and chroma keys) */ set_format(pSiS, &overlay); /* set color key */ set_colorkey(pSiS, pPriv->colorKey); if(pPriv->usechromakey) { /* Select chroma key format (300 series only) */ if(pSiS->VGAEngine == SIS_300_VGA) { setvideoregmask(pSiS, Index_VI_Control_Misc0, (pPriv->yuvchromakey ? 0x40 : 0x00), 0x40); } set_chromakey(pSiS, pPriv->chromamin, pPriv->chromamax); } /* set brightness, contrast, hue, saturation */ set_brightness(pSiS, pPriv->brightness); set_contrast(pSiS, pPriv->contrast); if(pSiS->VGAEngine == SIS_315_VGA) { set_hue(pSiS, pPriv->hue); set_saturation(pSiS, pPriv->saturation); } /* enable/disable graphics display around overlay * (Since disabled overlays don't get treated in this * loop, we omit respective checks here) */ if(!iscrt2) { set_disablegfx(pSiS, pPriv->disablegfx, &overlay); } else if(!pSiS->hasTwoOverlays) { set_disablegfx(pSiS, FALSE, &overlay); } set_disablegfxlr(pSiS, pPriv->disablegfxlr, &overlay); #ifdef SIS_CP SIS_CP_VIDEO_SET_CP #endif /* set remaining overlay parameters */ set_overlay(pSiS, &overlay, pPriv, index, iscrt2); /* enable overlay */ setvideoregmask (pSiS, Index_VI_Control_Misc0, 0x02, 0x02); /* loop foot */ if(pPriv->displayMode & DISPMODE_MIRROR && index == 0 && pPriv->hasTwoOverlays) { #ifdef SISMERGED if((!pSiS->MergedFB) || overlay.DoSecond) { #endif index = 1; iscrt2 = 1; overlay.VBlankActiveFunc = vblank_active_CRT2; goto MIRROR; #ifdef SISMERGED } #endif } /* Now for the trigger: This is a bad hack to work-around * an obvious hardware bug: Overlay 1 (which is ONLY used * for CRT2 in this driver) does not always update its * window position and some other stuff. Earlier, this was * solved be disabling the overlay, but this took forever * and was ugly on the screen. * Now: We write 0x03 to 0x74 from the beginning. This is * meant as a "lock" - the driver is supposed to write 0 * to this register, bit 0 for overlay 0, bit 1 for over- * lay 1, then change buffer addresses, pitches, window * position, scaler registers, format, etc., then write * 1 to 0x74. The hardware then reads the registers into * its internal engine and clears these bits. * All this works for overlay 0, but not 1. Overlay 1 * has assumingly the following restrictions: * - New data written to the registers is only read * correctly by the engine if the registers are written * when the current scanline is beyond the current * overlay position and below the maximum visible * scanline (vertical screen resolution) * - If a vertical retrace occures during writing the * registers, the registers written BEFORE this re- * trace happened, are not being read into the * engine if the trigger is set after the retrace. * Therefore: We write the overlay registers above in * set_overlay only if the scanline matches, and save * the then current scanline. If this scanline is higher * than the now current scanline, we assume a retrace, * wait for the scanline to match the criteria above again, * and rewrite all relevant registers. * I have no idea if this is meant that way, but after * fiddling three entire days with this crap, I found this * to be the only solution. */ if(pSiS->VGAEngine == SIS_315_VGA) { if((pPriv->mustwait) && index) { watchdog = get_scanline_CRT2(pSiS, pPriv); if(watchdog <= overlay.oldLine) { int i, mytop = overlay.oldtop; int screenHeight = overlay.SCREENheight; #ifdef SISMERGED if(pSiS->MergedFB) { screenHeight = overlay.SCREENheight2; } #endif if(mytop < screenHeight - 2) { do { watchdog = get_scanline_CRT2(pSiS, pPriv); } while((watchdog <= mytop) || (watchdog >= screenHeight)); } for(i=0x02; i<=0x12; i++) { setvideoreg(pSiS, i, getvideoreg(pSiS, i)); } for(i=0x18; i<=0x1c; i++) { setvideoreg(pSiS, i, getvideoreg(pSiS, i)); } for(i=0x2c; i<=0x2e; i++) { setvideoreg(pSiS, i, getvideoreg(pSiS, i)); } for(i=0x6b; i<=0x6f; i++) { setvideoreg(pSiS, i, getvideoreg(pSiS, i)); } } } /* Trigger register copy for 315/330 series */ setvideoregmask(pSiS, Index_VI_Control_Misc3, 0x03, 0x03); } pPriv->mustwait = 0; pPriv->overlayStatus = TRUE; } /********************************* * Memory management * *********************************/ #ifdef SIS_USE_EXA static void SiSDestroyArea(ScreenPtr pScreen, ExaOffscreenArea *area) { void **handle = (void *)area->privData; *handle = NULL; } #endif unsigned int SISAllocateFBMemory( ScrnInfoPtr pScrn, void **handle, int bytesize ){ SISPtr pSiS = SISPTR(pScrn); ScreenPtr pScreen = xf86ScrnToScreen(pScrn); #ifdef SIS_USE_XAA if(!pSiS->useEXA) { FBLinearPtr linear = (FBLinearPtr)(*handle); FBLinearPtr new_linear; int depth = pSiS->CurrentLayout.bitsPerPixel >> 3; int size = ((bytesize + depth - 1) / depth); if(linear) { if(linear->size >= size) { return (unsigned int)(linear->offset * depth); } if(xf86ResizeOffscreenLinear(linear, size)) { return (unsigned int)(linear->offset * depth); } xf86FreeOffscreenLinear(linear); *handle = NULL; } new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8, NULL, NULL, NULL); if(!new_linear) { int max_size; xf86QueryLargestOffscreenLinear(pScreen, &max_size, 8, PRIORITY_EXTREME); if(max_size < size) return 0; xf86PurgeUnlockedOffscreenAreas(pScreen); new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8, NULL, NULL, NULL); } if(!new_linear) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Xv: Failed to allocate %d pixels of linear video memory\n", size); return 0; } else { *handle = (void *)new_linear; return (unsigned int)(new_linear->offset * depth); } } #endif #ifdef SIS_USE_EXA if(pSiS->useEXA && !pSiS->NoAccel) { ExaOffscreenArea *area = (ExaOffscreenArea *)(*handle); if(area) { if(area->size >= bytesize) return (unsigned int)(area->offset); exaOffscreenFree(pScreen, area); *handle = NULL; } if(!(area = exaOffscreenAlloc(pScreen, bytesize, 8, TRUE, SiSDestroyArea, (pointer)handle))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Xv: Failed to allocate %d bytes of video memory\n", bytesize); return 0; } else { *handle = (void *)area; return (unsigned int)(area->offset); } } #endif return 0; } void SISFreeFBMemory(ScrnInfoPtr pScrn, void **handle) { SISPtr pSiS = SISPTR(pScrn); #ifdef SIS_USE_EXA ScreenPtr pScreen = xf86ScrnToScreen(pScrn); #endif #ifdef SIS_USE_XAA if(!pSiS->useEXA) { if(*handle) { xf86FreeOffscreenLinear((FBLinearPtr)(*handle)); } } #endif #ifdef SIS_USE_EXA if(pSiS->useEXA && !pSiS->NoAccel) { if(*handle) { exaOffscreenFree(pScreen, (ExaOffscreenArea *)(*handle)); } } #endif *handle = NULL; } /********************************* * StopVideo() * *********************************/ static void SISStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) { SISPortPrivPtr pPriv = (SISPortPrivPtr)data; SISPtr pSiS = SISPTR(pScrn); if(pPriv->grabbedByV4L) return; REGION_EMPTY(pScrn->pScreen, &pPriv->clip); if(shutdown) { if(pPriv->videoStatus & CLIENT_VIDEO_ON) { close_overlay(pSiS, pPriv); pPriv->mustwait = 1; } SISFreeFBMemory(pScrn, &pPriv->handle); pPriv->videoStatus = 0; } else { if(pPriv->videoStatus & CLIENT_VIDEO_ON) { UpdateCurrentTime(); pPriv->offTime = currentTime.milliseconds + OFF_DELAY; pPriv->videoStatus = OFF_TIMER | CLIENT_VIDEO_ON; pSiS->VideoTimerCallback = SISVideoTimerCallback; } } } /********************************* * PutImage() * *********************************/ static int SISPutImage( ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int id, UChar *buf, short width, short height, Bool sync, RegionPtr clipBoxes, pointer data, DrawablePtr pDraw ){ SISPtr pSiS = SISPTR(pScrn); SISPortPrivPtr pPriv = (SISPortPrivPtr)data; #ifdef SIS_USE_XAA XAAInfoRecPtr pXAA = pSiS->AccelInfoPtr; int depth = pSiS->CurrentLayout.bitsPerPixel >> 3; int myreds[] = { 0x000000ff, 0x0000f800, 0, 0x00ff0000 }; #endif int totalSize = 0; #ifdef SISDEINT Bool deintfm = (pPriv->deinterlacemethod > 1) ? TRUE : FALSE; #endif #if 0 xf86DrvMsg(0, X_INFO, "PutImage: src %dx%d-%dx%d, drw %dx%d-%dx%d, id %x, w %d h %d, buf %p\n", src_x, src_y, src_w, src_h, drw_x, drw_y, drw_w, drw_h, id, width, height, buf); #endif if(pPriv->grabbedByV4L) return Success; pPriv->drw_x = drw_x; pPriv->drw_y = drw_y; pPriv->drw_w = drw_w; pPriv->drw_h = drw_h; pPriv->src_x = src_x; pPriv->src_y = src_y; pPriv->src_w = src_w; pPriv->src_h = src_h; pPriv->id = id; pPriv->height = height; /* Pixel formats: 1. YU12: 3 planes: H V Y sample period 1 1 (8 bit per pixel) V sample period 2 2 (8 bit per pixel, subsampled) U sample period 2 2 (8 bit per pixel, subsampled) Y plane is fully sampled (width*height), U and V planes are sampled in 2x2 blocks, hence a group of 4 pixels requires 4 + 1 + 1 = 6 bytes. The data is planar, ie in single planes for Y, U and V. 2. UYVY: 3 planes: H V Y sample period 1 1 (8 bit per pixel) V sample period 2 1 (8 bit per pixel, subsampled) U sample period 2 1 (8 bit per pixel, subsampled) Y plane is fully sampled (width*height), U and V planes are sampled in 2x1 blocks, hence a group of 4 pixels requires 4 + 2 + 2 = 8 bytes. The data is bit packed, there are no separate Y, U or V planes. Bit order: U0 Y0 V0 Y1 U2 Y2 V2 Y3 ... 3. I420: Like YU12, but planes U and V are in reverse order. 4. YUY2: Like UYVY, but order is Y0 U0 Y1 V0 Y2 U2 Y3 V2 ... 5. YVYU: Like YUY2, but order is Y0 V0 Y1 U0 Y2 V2 Y3 U2 ... 6. NV12, NV21: 2 planes H V Y sample period 1 1 (8 bit per pixel) V sample period 2 1 (8 bit per pixel, subsampled) U sample period 2 1 (8 bit per pixel, subsampled) Y plane is fully samples (width*height), U and V planes are interleaved in memory (one byte U, one byte V for NV12, NV21 other way round) and sampled in 2x1 blocks. Otherwise such as all other planar formats. */ switch(id){ case PIXEL_FMT_YV12: case PIXEL_FMT_I420: case PIXEL_FMT_NV12: case PIXEL_FMT_NV21: pPriv->srcPitch = (width + 7) & ~7; /* Size = width * height * 3 / 2 */ totalSize = (pPriv->srcPitch * height * 3) >> 1; /* Verified */ break; case PIXEL_FMT_YUY2: case PIXEL_FMT_UYVY: case PIXEL_FMT_YVYU: case PIXEL_FMT_RGB6: case PIXEL_FMT_RGB5: default: pPriv->srcPitch = ((width << 1) + 3) & ~3; /* Verified */ /* Size = width * 2 * height */ totalSize = pPriv->srcPitch * height; } /* make it a multiple of 16 to simplify to copy loop */ totalSize += 15; totalSize &= ~15; /* in bytes */ /* allocate memory (we do doublebuffering) - size is in bytes */ if(!(pPriv->bufAddr[0] = SISAllocateFBMemory(pScrn, &pPriv->handle, totalSize << 1))) return BadAlloc; #ifdef SISDEINT if(deintfm) { pPriv->bufAddr[1] = pPriv->bufAddr[0] + pPriv->srcPitch; { CARD8 *src = (CARD8 *)buf; CARD8 *dest = (CARD8 *)(pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf]); int i = height; while(i--) { SiSMemCopyToVideoRam(pSiS, dest, src, pPriv->srcPitch); src += pPriv->srcPitch; dest += (pPriv->srcPitch << 1); } } } else { #endif pPriv->bufAddr[1] = pPriv->bufAddr[0] + totalSize; /* copy data */ if((pSiS->XvUseMemcpy) || (totalSize < 16)) { SiSMemCopyToVideoRam(pSiS, pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf], buf, totalSize); } else { ULong i; CARD32 *src = (CARD32 *)buf; CARD32 *dest = (CARD32 *)(pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf]); for(i = 0; i < (totalSize/16); i++) { *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; } } #ifdef SISDEINT } #endif SISDisplayVideo(pScrn, pPriv); /* update cliplist */ if(pPriv->autopaintColorKey && (pPriv->grabbedByV4L || #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,3,0) (!RegionsEqual(&pPriv->clip, clipBoxes)) || #else (!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) || #endif (pPriv->PrevOverlay != pPriv->NoOverlay))) { /* We always paint the colorkey for V4L */ if(!pPriv->grabbedByV4L) { REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); } /* draw these */ pPriv->PrevOverlay = pPriv->NoOverlay; #ifdef SIS_USE_XAA if((pPriv->NoOverlay) && pXAA && pXAA->FillMono8x8PatternRects) { (*pXAA->FillMono8x8PatternRects)(pScrn, myreds[depth-1], 0x000000, GXcopy, ~0, REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes), 0x00422418, 0x18244200, 0, 0); } else { #endif if(!pSiS->disablecolorkeycurrent) { #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,1,99,1,0) (*pXAA->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy, ~0, REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes)); #else xf86XVFillKeyHelper(pScrn->pScreen, (pPriv->NoOverlay) ? 0x00ff0000 : pPriv->colorKey, clipBoxes); #endif } #ifdef SIS_USE_XAA } #endif } pPriv->currentBuf ^= 1; pPriv->videoStatus = CLIENT_VIDEO_ON; pSiS->VideoTimerCallback = SISVideoTimerCallback; return Success; } /********************************* * QueryImageAttributes() * *********************************/ static int SISQueryImageAttributes( ScrnInfoPtr pScrn, int id, UShort *w, UShort *h, int *pitches, int *offsets ){ int pitchY, pitchUV; int size, sizeY, sizeUV; if(*w < IMAGE_MIN_WIDTH) *w = IMAGE_MIN_WIDTH; if(*h < IMAGE_MIN_HEIGHT) *h = IMAGE_MIN_HEIGHT; if(*w > DummyEncoding.width) *w = DummyEncoding.width; if(*h > DummyEncoding.height) *h = DummyEncoding.height; switch(id) { case PIXEL_FMT_YV12: case PIXEL_FMT_I420: *w = (*w + 7) & ~7; *h = (*h + 1) & ~1; pitchY = *w; pitchUV = *w >> 1; if(pitches) { pitches[0] = pitchY; pitches[1] = pitches[2] = pitchUV; } sizeY = pitchY * (*h); sizeUV = pitchUV * ((*h) >> 1); if(offsets) { offsets[0] = 0; offsets[1] = sizeY; offsets[2] = sizeY + sizeUV; } size = sizeY + (sizeUV << 1); break; case PIXEL_FMT_NV12: case PIXEL_FMT_NV21: *w = (*w + 7) & ~7; *h = (*h + 1) & ~1; pitchY = *w; pitchUV = *w; if(pitches) { pitches[0] = pitchY; pitches[1] = pitchUV; } sizeY = pitchY * (*h); sizeUV = pitchUV * ((*h) >> 1); if(offsets) { offsets[0] = 0; offsets[1] = sizeY; } size = sizeY + (sizeUV << 1); break; case PIXEL_FMT_YUY2: case PIXEL_FMT_UYVY: case PIXEL_FMT_YVYU: case PIXEL_FMT_RGB6: case PIXEL_FMT_RGB5: default: *w = (*w + 1) & ~1; pitchY = *w << 1; if(pitches) pitches[0] = pitchY; if(offsets) offsets[0] = 0; size = pitchY * (*h); break; } return size; } /********************************* * OFFSCREEN SURFACES * *********************************/ static int SISAllocSurface ( ScrnInfoPtr pScrn, int id, UShort w, UShort h, XF86SurfacePtr surface ) { SISPtr pSiS = SISPTR(pScrn); SISPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); int size; if((w < IMAGE_MIN_WIDTH) || (h < IMAGE_MIN_HEIGHT)) return BadValue; if((w > DummyEncoding.width) || (h > DummyEncoding.height)) return BadValue; if(pPriv->grabbedByV4L) return BadAlloc; w = (w + 1) & ~1; pPriv->pitch = ((w << 1) + 63) & ~63; /* Only packed pixel modes supported */ size = h * pPriv->pitch; if(!(pPriv->offset = SISAllocateFBMemory(pScrn, &pPriv->handle, size))) return BadAlloc; surface->width = w; surface->height = h; surface->pScrn = pScrn; surface->id = id; surface->pitches = &pPriv->pitch; surface->offsets = &pPriv->offset; surface->devPrivate.ptr = (pointer)pPriv; close_overlay(pSiS, pPriv); pPriv->videoStatus = 0; REGION_EMPTY(pScrn->pScreen, &pPriv->clip); pSiS->VideoTimerCallback = NULL; pPriv->grabbedByV4L = TRUE; return Success; } static int SISStopSurface (XF86SurfacePtr surface) { SISPortPrivPtr pPriv = (SISPortPrivPtr)(surface->devPrivate.ptr); SISPtr pSiS = SISPTR(surface->pScrn); if(pPriv->grabbedByV4L && pPriv->videoStatus) { close_overlay(pSiS, pPriv); pPriv->mustwait = 1; pPriv->videoStatus = 0; } return Success; } static int SISFreeSurface (XF86SurfacePtr surface) { SISPortPrivPtr pPriv = (SISPortPrivPtr)(surface->devPrivate.ptr); if(pPriv->grabbedByV4L) { SISStopSurface(surface); SISFreeFBMemory(surface->pScrn, &pPriv->handle); pPriv->grabbedByV4L = FALSE; } return Success; } static int SISGetSurfaceAttribute ( ScrnInfoPtr pScrn, Atom attribute, INT32 *value ) { SISPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); return SISGetPortAttribute(pScrn, attribute, value, (pointer)pPriv); } static int SISSetSurfaceAttribute( ScrnInfoPtr pScrn, Atom attribute, INT32 value ) { SISPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn);; return SISSetPortAttribute(pScrn, attribute, value, (pointer)pPriv); } static int SISDisplaySurface ( XF86SurfacePtr surface, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, RegionPtr clipBoxes ) { ScrnInfoPtr pScrn = surface->pScrn; SISPortPrivPtr pPriv = (SISPortPrivPtr)(surface->devPrivate.ptr); #ifdef SIS_USE_XAA SISPtr pSiS = SISPTR(pScrn); int myreds[] = { 0x000000ff, 0x0000f800, 0, 0x00ff0000 }; #endif if(!pPriv->grabbedByV4L) return Success; pPriv->drw_x = drw_x; pPriv->drw_y = drw_y; pPriv->drw_w = drw_w; pPriv->drw_h = drw_h; pPriv->src_x = src_x; pPriv->src_y = src_y; pPriv->src_w = src_w; pPriv->src_h = src_h; pPriv->id = surface->id; pPriv->height = surface->height; pPriv->bufAddr[0] = surface->offsets[0]; pPriv->currentBuf = 0; pPriv->srcPitch = surface->pitches[0]; SISDisplayVideo(pScrn, pPriv); if(pPriv->autopaintColorKey) { #ifdef SIS_USE_XAA XAAInfoRecPtr pXAA = pSiS->AccelInfoPtr; if((pPriv->NoOverlay) && pXAA && pXAA->FillMono8x8PatternRects) { (*pXAA->FillMono8x8PatternRects)(pScrn, myreds[(pSiS->CurrentLayout.bitsPerPixel >> 3) - 1], 0x000000, GXcopy, ~0, REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes), 0x00422418, 0x18244200, 0, 0); } else { #endif #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,1,99,1,0) (*pXAA->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy, ~0, REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes)); #else xf86XVFillKeyHelper(pScrn->pScreen, (pPriv->NoOverlay) ? 0x00ff0000 : pPriv->colorKey, clipBoxes); #endif #ifdef SIS_USE_XAA } #endif } pPriv->videoStatus = CLIENT_VIDEO_ON; return Success; } #define NUMOFFSCRIMAGES_300 4 #define NUMOFFSCRIMAGES_315 5 static XF86OffscreenImageRec SISOffscreenImages[NUMOFFSCRIMAGES_315] = { { &SISImages[0], /* YUV2 */ VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT, SISAllocSurface, SISFreeSurface, SISDisplaySurface, SISStopSurface, SISGetSurfaceAttribute, SISSetSurfaceAttribute, 0, 0, /* Rest will be filled in */ 0, NULL }, { &SISImages[2], /* UYVY */ VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT, SISAllocSurface, SISFreeSurface, SISDisplaySurface, SISStopSurface, SISGetSurfaceAttribute, SISSetSurfaceAttribute, 0, 0, /* Rest will be filled in */ 0, NULL } , { &SISImages[4], /* RV15 */ VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT, SISAllocSurface, SISFreeSurface, SISDisplaySurface, SISStopSurface, SISGetSurfaceAttribute, SISSetSurfaceAttribute, 0, 0, /* Rest will be filled in */ 0, NULL }, { &SISImages[5], /* RV16 */ VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT, SISAllocSurface, SISFreeSurface, SISDisplaySurface, SISStopSurface, SISGetSurfaceAttribute, SISSetSurfaceAttribute, 0, 0, /* Rest will be filled in */ 0, NULL }, { &SISImages[6], /* YVYU */ VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT, SISAllocSurface, SISFreeSurface, SISDisplaySurface, SISStopSurface, SISGetSurfaceAttribute, SISSetSurfaceAttribute, 0, 0, /* Rest will be filled in */ 0, NULL } }; static void SISInitOffscreenImages(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); int i, num; if(pSiS->VGAEngine == SIS_300_VGA) num = NUMOFFSCRIMAGES_300; else num = NUMOFFSCRIMAGES_315; for(i = 0; i < num; i++) { SISOffscreenImages[i].max_width = DummyEncoding.width; SISOffscreenImages[i].max_height = DummyEncoding.height; if(pSiS->VGAEngine == SIS_300_VGA) { SISOffscreenImages[i].attributes = &SISAttributes_300[0]; SISOffscreenImages[i].num_attributes = SiSCountAttributes(&SISAttributes_300[0]); } else { SISOffscreenImages[i].attributes = &SISAttributes_315[0]; SISOffscreenImages[i].num_attributes = SiSCountAttributes(&SISAttributes_315[0]); if((pSiS->hasTwoOverlays) && (!(pSiS->SiS_SD2_Flags & SiS_SD2_SUPPORT760OO))) { SISOffscreenImages[i].num_attributes--; } } } xf86XVRegisterOffscreenImages(pScreen, SISOffscreenImages, num); } /*****************************************************************/ /* BLIT ADAPTORS */ /*****************************************************************/ #ifdef INCL_YUV_BLIT_ADAPTOR static void SISSetPortDefaultsBlit(ScrnInfoPtr pScrn, SISBPortPrivPtr pPriv) { /* Default: Don't sync. */ pPriv->vsync = 0; } static void SISResetVideoBlit(ScrnInfoPtr pScrn) { } static XF86VideoAdaptorPtr SISSetupBlitVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); XF86VideoAdaptorPtr adapt; SISBPortPrivPtr pPriv; int i; #ifdef SIS_USE_XAA if(!pSiS->useEXA) { if(!pSiS->AccelInfoPtr) return NULL; } #endif if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + (sizeof(DevUnion) * NUM_BLIT_PORTS) + sizeof(SISBPortPrivRec)))) { return NULL; } adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = 0; adapt->name = "SIS 315/330 series Video Blitter"; adapt->nEncodings = 1; adapt->pEncodings = &DummyEncodingBlit; adapt->nFormats = NUM_FORMATS; adapt->pFormats = SISFormats; adapt->nImages = NUM_IMAGES_BLIT; adapt->pImages = SISImagesBlit; adapt->pAttributes = SISAttributes_Blit; adapt->nAttributes = NUM_ATTRIBUTES_BLIT; adapt->nPorts = NUM_BLIT_PORTS; adapt->pPortPrivates = (DevUnion*)(&adapt[1]); pSiS->blitPriv = (void *)(&adapt->pPortPrivates[NUM_BLIT_PORTS]); pPriv = (SISBPortPrivPtr)(pSiS->blitPriv); for(i = 0; i < NUM_BLIT_PORTS; i++) { adapt->pPortPrivates[i].uval = (ULong)(i); #if defined(REGION_NULL) REGION_NULL(pScreen, &pPriv->blitClip[i]); #else REGION_INIT(pScreen, &pPriv->blitClip[i], NullBox, 0); #endif pPriv->videoStatus[i] = 0; pPriv->currentBuf[i] = 0; pPriv->handle[i] = NULL; } /* Scanline trigger not implemented by hardware! */ pPriv->VBlankTriggerCRT1 = 0; /* SCANLINE_TRIGGER_ENABLE | SCANLINE_TR_CRT1; */ pPriv->VBlankTriggerCRT2 = 0; /* SCANLINE_TRIGGER_ENABLE | SCANLINE_TR_CRT2; */ if(pSiS->ChipType >= SIS_330) { pPriv->AccelCmd = YUVRGB_BLIT_330; } else { pPriv->AccelCmd = YUVRGB_BLIT_325; } adapt->PutVideo = NULL; adapt->PutStill = NULL; adapt->GetVideo = NULL; adapt->GetStill = NULL; adapt->StopVideo = (StopVideoFuncPtr)SISStopVideoBlit; adapt->SetPortAttribute = (SetPortAttributeFuncPtr)SISSetPortAttributeBlit; adapt->GetPortAttribute = (GetPortAttributeFuncPtr)SISGetPortAttributeBlit; adapt->QueryBestSize = (QueryBestSizeFuncPtr)SISQueryBestSizeBlit; adapt->PutImage = (PutImageFuncPtr)SISPutImageBlit; adapt->QueryImageAttributes = SISQueryImageAttributesBlit; pSiS->blitadaptor = adapt; pSiS->xvVSync = MAKE_ATOM(sisxvvsync); pSiS->xvSetDefaults = MAKE_ATOM(sisxvsetdefaults); SISResetVideoBlit(pScrn); /* Reset the properties to their defaults */ SISSetPortDefaultsBlit(pScrn, pPriv); return adapt; } static int SISGetPortAttributeBlit(ScrnInfoPtr pScrn, Atom attribute, INT32 *value, ULong index) { SISPtr pSiS = SISPTR(pScrn); SISBPortPrivPtr pPriv = (SISBPortPrivPtr)(pSiS->blitPriv); if(attribute == pSiS->xvVSync) { *value = pPriv->vsync; } else return BadMatch; return Success; } static int SISSetPortAttributeBlit(ScrnInfoPtr pScrn, Atom attribute, INT32 value, ULong index) { SISPtr pSiS = SISPTR(pScrn); SISBPortPrivPtr pPriv = (SISBPortPrivPtr)(pSiS->blitPriv); if(attribute == pSiS->xvVSync) { if((value < 0) || (value > 1)) return BadValue; pPriv->vsync = value; } else if(attribute == pSiS->xvSetDefaults) { SISSetPortDefaultsBlit(pScrn, pPriv); } else return BadMatch; return Success; } static void SISStopVideoBlit(ScrnInfoPtr pScrn, ULong index, Bool shutdown) { SISPtr pSiS = SISPTR(pScrn); SISBPortPrivPtr pPriv = (SISBPortPrivPtr)(pSiS->blitPriv); /* This shouldn't be called for blitter adaptors due to * adapt->flags but we provide it anyway. */ if(index >= NUM_BLIT_PORTS) return; REGION_EMPTY(pScrn->pScreen, &pPriv->blitClip[index]); if(shutdown) { (*pSiS->SyncAccel)(pScrn); pPriv->videoStatus[index] = 0; SISFreeFBMemory(pScrn, &pPriv->handle[(int)index]); } } static int SISPutImageBlit( ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int id, UChar *buf, short width, short height, Bool sync, RegionPtr clipBoxes, ULong index, DrawablePtr pDraw ){ SISPtr pSiS = SISPTR(pScrn); SISBPortPrivPtr pPriv = (SISBPortPrivPtr)(pSiS->blitPriv); #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,1,99,1,0) XAAInfoRecPtr pXAA = pSiS->AccelInfoPtr; #endif BoxPtr pbox = REGION_RECTS(clipBoxes); int nbox = REGION_NUM_RECTS(clipBoxes); CARD32 dstbase = 0, offsety, offsetuv, temp; int totalSize, bytesize=0, h, w, wb, srcPitch; int xoffset = 0, yoffset = 0, left, right, top, bottom; UChar *ybases, *ubases = NULL, *vbases = NULL, *myubases, *myvbases; UChar *ybased, *uvbased, packed; CARD16 *myuvbased; SiS_Packet12_YUV MyPacket; Bool first; if(index >= NUM_BLIT_PORTS) return BadMatch; if(!height || !width) return Success; switch(id) { case PIXEL_FMT_YV12: case PIXEL_FMT_I420: case PIXEL_FMT_NV12: case PIXEL_FMT_NV21: srcPitch = (width + 7) & ~7; /* Should come this way anyway */ bytesize = srcPitch * height; totalSize = (bytesize * 3) >> 1; break; case PIXEL_FMT_YUY2: case PIXEL_FMT_UYVY: case PIXEL_FMT_YVYU: srcPitch = ((width << 1) + 3) & ~3; /* Size = width * 2 * height */ totalSize = srcPitch * height; bytesize = 0; break; default: return BadMatch; } /* allocate memory (we do doublebuffering) */ if(!(pPriv->bufAddr[index][0] = SISAllocateFBMemory(pScrn, &pPriv->handle[index], totalSize << 1))) return BadAlloc; pPriv->bufAddr[index][1] = pPriv->bufAddr[index][0] + totalSize; if(drw_w > width) { xoffset = (drw_w - width) >> 1; } if(drw_h > (height & ~1)) { yoffset = (drw_h - height) >> 1; } if(xoffset || yoffset) { #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,3,0) if(!RegionsEqual(&pPriv->blitClip[index], clipBoxes)) { #else if(!REGION_EQUAL(pScrn->pScreen, &pPriv->blitClip[index], clipBoxes)) { #endif #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,1,99,1,0) (*pXAA->FillSolidRects)(pScrn, 0x00000000, GXcopy, ~0, REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes)); #else xf86XVFillKeyHelper(pScrn->pScreen, 0x00000000, clipBoxes); #endif REGION_COPY(pScrn->pScreen, &pPriv->blitClip[index], clipBoxes); } } memset(&MyPacket, 0, sizeof(MyPacket)); ybased = pSiS->FbBase + pPriv->bufAddr[index][pPriv->currentBuf[index]]; uvbased = pSiS->FbBase + pPriv->bufAddr[index][pPriv->currentBuf[index]] + bytesize; ybases = buf; packed = 0; switch(id) { case PIXEL_FMT_YV12: vbases = buf + bytesize; ubases = buf + bytesize*5/4; break; case PIXEL_FMT_I420: ubases = buf + bytesize; vbases = buf + bytesize*5/4; break; case PIXEL_FMT_NV12: MyPacket.P12_Command = YUV_FORMAT_NV12; break; case PIXEL_FMT_NV21: MyPacket.P12_Command = YUV_FORMAT_NV21; break; case PIXEL_FMT_YUY2: MyPacket.P12_Command = YUV_FORMAT_YUY2; packed = 1; break; case PIXEL_FMT_UYVY: MyPacket.P12_Command = YUV_FORMAT_UYVY; packed = 1; break; case PIXEL_FMT_YVYU: MyPacket.P12_Command = YUV_FORMAT_YVYU; packed = 1; break; default: return BadMatch; } switch(id) { case PIXEL_FMT_YV12: case PIXEL_FMT_I420: MyPacket.P12_Command = YUV_FORMAT_NV12; /* Copy y plane */ SiSMemCopyToVideoRam(pSiS, ybased, ybases, bytesize); /* Copy u/v planes */ wb = srcPitch >> 1; h = height >> 1; while(h--) { myuvbased = (CARD16*)uvbased; myubases = ubases; myvbases = vbases; w = wb; while(w--) { #if X_BYTE_ORDER == X_BIG_ENDIAN temp = (*myubases++) << 8; temp |= (*myvbases++); #else temp = (*myvbases++) << 8; temp |= (*myubases++); #endif *myuvbased++ = temp; } uvbased += srcPitch; ubases += wb; vbases += wb; } break; default: SiSMemCopyToVideoRam(pSiS, ybased, ybases, totalSize); } dstbase += FBOFFSET; MyPacket.P12_Header0 = SIS_PACKET12_HEADER0; MyPacket.P12_Header1 = SIS_PACKET12_HEADER1; MyPacket.P12_Null1 = SIS_NIL_CMD; MyPacket.P12_Null2 = SIS_NIL_CMD; MyPacket.P12_YPitch = MyPacket.P12_UVPitch = srcPitch; MyPacket.P12_DstAddr = dstbase; MyPacket.P12_DstPitch = pSiS->scrnOffset; MyPacket.P12_DstHeight = 0x0fff; MyPacket.P12_Command |= pPriv->AccelCmd | SRCVIDEO | PATFG | pSiS->SiS310_AccelDepth | YUV_CMD_YUV | DSTVIDEO; #if 0 /* Not implemented by hardware! */ if(pPriv->vsync) { #ifdef SISMERGED if(!pSiS->MergedFB) { #endif #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiS->SecondHead) { MyPacket.P12_Command |= pPriv->VBlankTriggerCRT1; } else { MyPacket.P12_Command |= pPriv->VBlankTriggerCRT2; } } else { #endif Bool IsSlaveMode = SiSBridgeIsInSlaveMode(pScrn); if((pSiS->VBFlags & DISPTYPE_DISP2) && !IsSlaveMode) MyPacket.P12_Command |= pPriv->VBlankTriggerCRT2; else if((pSiS->VBFlags & DISPTYPE_DISP1) || IsSlaveMode) MyPacket.P12_Command |= pPriv->VBlankTriggerCRT1; #ifdef SISDUALHEAD } #endif #ifdef SISMERGED } #endif } #endif first = TRUE; while(nbox--) { left = pbox->x1; if(left >= drw_x + xoffset + width) goto mycont; right = pbox->x2; if(right <= drw_x + xoffset) goto mycont; top = pbox->y1; if(top >= drw_y + yoffset + height) goto mycont; bottom = pbox->y2; if(bottom <= drw_y + yoffset) goto mycont; if(left < (drw_x + xoffset)) left = drw_x + xoffset; if(right > (drw_x + xoffset + width)) right = drw_x + xoffset + width; if(top < (drw_y + yoffset)) top = drw_y + yoffset; if(bottom > (drw_y + yoffset + height)) bottom = drw_y + yoffset + height; MyPacket.P12_DstX = left; MyPacket.P12_DstY = top; MyPacket.P12_RectWidth = right - left; MyPacket.P12_RectHeight = bottom - top; #if 0 #ifdef SISMERGED if((first) && (pSiS->MergedFB)) { int scrwidth = ((SiSMergedDisplayModePtr)pSiS->CurrentLayout.mode->Private)->CRT2->HDisplay; int scrheight = ((SiSMergedDisplayModePtr)pSiS->CurrentLayout.mode->Private)->CRT2->VDisplay; if( (right < pSiS->CRT2pScrn->frameX0) || (left >= pSiS->CRT2pScrn->frameX0 + scrwidth) || (bottom < pSiS->CRT2pScrn->frameY0) || (top >= pSiS->CRT2pScrn->frameY0 + scrheight) ) { MyPacket.P12_Command |= pPriv->VBlankTriggerCRT1; } else { MyPacket.P12_Command |= pPriv->VBlankTriggerCRT2; } } #endif #endif offsety = offsetuv = 0; if(packed) { if(pbox->y1 > drw_y + yoffset) { offsetuv = (pbox->y1 - drw_y - yoffset) * srcPitch; } if(pbox->x1 > drw_x + xoffset) { offsetuv += ((pbox->x1 - drw_x - xoffset) << 1); if(offsetuv & 3) { #if 0 /* Paint over covering object - no */ if(MyPacket.P12_DstX > 0) { offsetuv &= ~3; MyPacket.P12_DstX--; MyPacket.P12_RectWidth++; } else { #endif offsetuv = (offsetuv + 3) & ~3; MyPacket.P12_DstX++; MyPacket.P12_RectWidth--; #if 0 } #endif } } } else { if(pbox->y1 > drw_y + yoffset) { offsety = (pbox->y1 - drw_y - yoffset) * srcPitch; offsetuv = ((pbox->y1 - drw_y - yoffset) >> 1) * srcPitch; } if(pbox->x1 > drw_x + xoffset) { offsety += (pbox->x1 - drw_x - xoffset); offsetuv += (pbox->x1 - drw_x - xoffset); if(offsetuv & 1) { offsety++; offsetuv++; MyPacket.P12_DstX++; MyPacket.P12_RectWidth--; } } } if(!MyPacket.P12_RectWidth) continue; MyPacket.P12_YSrcAddr = pPriv->bufAddr[index][pPriv->currentBuf[index]] + offsety + FBOFFSET; MyPacket.P12_UVSrcAddr = pPriv->bufAddr[index][pPriv->currentBuf[index]] + bytesize + offsetuv + FBOFFSET; SISWriteBlitPacket(pSiS, (CARD32*)&MyPacket); #if 0 MyPacket.P12_Command &= ~(pPriv->VBlankTriggerCRT1 | pPriv->VBlankTriggerCRT2); #endif first = FALSE; mycont: pbox++; } #if 0 { int debug = 0; while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) { debug++; }; while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) { debug++; }; xf86DrvMsg(0, X_INFO, "vsync %d, debug %d\n", pPriv->vsync, debug); } #endif pPriv->currentBuf[index] ^= 1; UpdateCurrentTime(); pPriv->freeTime[index] = currentTime.milliseconds + FREE_DELAY; pPriv->videoStatus[index] = FREE_TIMER; pSiS->VideoTimerCallback = SISVideoTimerCallback; return Success; } static int SISQueryImageAttributesBlit( ScrnInfoPtr pScrn, int id, UShort *w, UShort *h, int *pitches, int *offsets ){ int pitchY, pitchUV; int size, sizeY, sizeUV; if(*w > DummyEncodingBlit.width) *w = DummyEncodingBlit.width; if(*h > DummyEncodingBlit.height) *h = DummyEncodingBlit.height; switch(id) { case PIXEL_FMT_YV12: case PIXEL_FMT_I420: *w = (*w + 7) & ~7; *h = (*h + 1) & ~1; pitchY = *w; pitchUV = *w >> 1; if(pitches) { pitches[0] = pitchY; pitches[1] = pitches[2] = pitchUV; } sizeY = pitchY * (*h); sizeUV = pitchUV * ((*h) >> 1); if(offsets) { offsets[0] = 0; offsets[1] = sizeY; offsets[2] = sizeY + sizeUV; } size = sizeY + (sizeUV << 1); break; case PIXEL_FMT_NV12: case PIXEL_FMT_NV21: *w = (*w + 7) & ~7; pitchY = *w; pitchUV = *w; if(pitches) { pitches[0] = pitchY; pitches[1] = pitchUV; } sizeY = pitchY * (*h); sizeUV = pitchUV * ((*h) >> 1); if(offsets) { offsets[0] = 0; offsets[1] = sizeY; } size = sizeY + (sizeUV << 1); break; case PIXEL_FMT_YUY2: case PIXEL_FMT_UYVY: case PIXEL_FMT_YVYU: default: *w = (*w + 1) & ~1; pitchY = *w << 1; if(pitches) pitches[0] = pitchY; if(offsets) offsets[0] = 0; size = pitchY * (*h); break; } return size; } static void SISQueryBestSizeBlit( ScrnInfoPtr pScrn, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, unsigned int *p_h, ULong index ){ /* We cannot scale */ *p_w = vid_w; *p_h = vid_h; } #endif /* INCL_YUV */ /*****************************************/ /* TIMER CALLBACK */ /*****************************************/ static void SISVideoTimerCallback(ScrnInfoPtr pScrn, Time now) { SISPtr pSiS = SISPTR(pScrn); SISPortPrivPtr pPriv = NULL; #ifdef INCL_YUV_BLIT_ADAPTOR SISBPortPrivPtr pPrivBlit = NULL; #endif UChar sridx, cridx; Bool setcallback = FALSE; if(!pScrn->vtSema) return; if(pSiS->adaptor) { pPriv = GET_PORT_PRIVATE(pScrn); if(!pPriv->videoStatus) pPriv = NULL; } if(pPriv) { if(pPriv->videoStatus & TIMER_MASK) { if(pPriv->videoStatus & OFF_TIMER) { setcallback = TRUE; if(pPriv->offTime < now) { /* Turn off the overlay */ sridx = inSISREG(SISSR); cridx = inSISREG(SISCR); close_overlay(pSiS, pPriv); outSISREG(SISSR, sridx); outSISREG(SISCR, cridx); pPriv->mustwait = 1; pPriv->videoStatus = FREE_TIMER; pPriv->freeTime = now + FREE_DELAY; } } else if(pPriv->videoStatus & FREE_TIMER) { if(pPriv->freeTime < now) { SISFreeFBMemory(pScrn, &pPriv->handle); pPriv->mustwait = 1; pPriv->videoStatus = 0; } else { setcallback = TRUE; } } } } #ifdef INCL_YUV_BLIT_ADAPTOR if(pSiS->blitadaptor) { int i; pPrivBlit = (SISBPortPrivPtr)(pSiS->blitPriv); for(i = 0; i < NUM_BLIT_PORTS; i++) { if(pPrivBlit->videoStatus[i] & FREE_TIMER) { if(pPrivBlit->freeTime[i] < now) { SISFreeFBMemory(pScrn, &pPrivBlit->handle[i]); pPrivBlit->videoStatus[i] = 0; } else { setcallback = TRUE; } } } } #endif pSiS->VideoTimerCallback = (setcallback) ? SISVideoTimerCallback : NULL; } xf86-video-sis-0.10.7/src/sis_memcpy.c0000664000076400007640000010025111763614406014337 00000000000000/* * SiS memcpy() routines (assembly) * * Copyright (C) 2004-2005 Thomas Winischhofer * * Idea and some code bits from via_memcpy.c which is * Copyright (C) 2004 Thomas Hellstroem, 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, sub license, * 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 NON-INFRINGEMENT. IN NO EVENT SHALL * THE CODE SUPPLIER(S) 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 #include "sis.h" #if 0 /* Debug */ #define SISDGBMC #endif extern unsigned int SISAllocateFBMemory(ScrnInfoPtr pScrn, void **handle, int bytesize); extern void SISFreeFBMemory(ScrnInfoPtr pScrn, void **handle); #define CPUBUFFERSIZE 2048 /* Size of /proc/cpuinfo buffer */ #define BUFFERSIZE (576 * 1152) /* Matches 720x576 YUV420 */ /************************************************************************/ /* arch specific memcpy() routines */ /************************************************************************/ /* i386, AMD64 */ #define FENCE \ __asm__ __volatile__( \ " sfence\n" \ : \ : \ : "memory"); #define FENCEMMS \ __asm__ __volatile__ ( \ " sfence\n" \ " emms\n" \ : \ : \ : "memory"); #define FEMMS \ __asm__ __volatile__( \ " femms\n" \ : \ : \ : "memory"); #define EMMS \ __asm__ __volatile__( \ " emms\n" \ : \ : \ : "memory"); #define SSE_PREFETCH " prefetchnta " #define NOW_PREFETCH " prefetch " #define PREFETCH1(arch_prefetch,from) \ __asm__ __volatile__ ( \ arch_prefetch "(%0)\n" \ arch_prefetch "32(%0)\n" \ arch_prefetch "64(%0)\n" \ arch_prefetch "96(%0)\n" \ arch_prefetch "128(%0)\n" \ arch_prefetch "160(%0)\n" \ arch_prefetch "192(%0)\n" \ arch_prefetch "256(%0)\n" \ arch_prefetch "288(%0)\n" \ : \ : "r" (from) ); #define PREFETCH2(arch_prefetch,from) \ __asm__ __volatile__ ( \ arch_prefetch "320(%0)\n" \ : \ : "r" (from) ); #define PREFETCH3(arch_prefetch,from) \ __asm__ __volatile__ ( \ arch_prefetch "288(%0)\n" \ : \ : "r" (from) ); #define small_memcpy_i386(to,from,n) \ { \ __asm__ __volatile__( \ " cld\n" \ " shrl $1, %%ecx\n" \ " jnc 1f\n" \ " movsb\n" \ "1: shrl $1, %%ecx\n" \ " jnc 2f\n" \ " movsw\n" \ "2: rep ; movsl" \ : "=&D" (to), "=&S" (from) \ : "c" (n), "0" ((long) to), "1" ((long) from) \ : "memory", "cc"); \ } #define small_memcpy_amd64(to,from,n) \ { \ __asm__ __volatile__( \ " cld\n" \ " shrq $1, %%rcx\n" \ " jnc 1f\n" \ " movsb\n" \ "1: shrq $1, %%rcx\n" \ " jnc 2f\n" \ " movsw\n" \ "2: shrq $1, %%rcx\n" \ " jnc 3f\n" \ " movsl\n" \ "3: rep ; movsq" \ : "=&D" (to), "=&S" (from) \ : "c" (n), "0" ((long) to), "1" ((long) from) \ : "memory", "cc"); \ } #define MMX_CPY(prefetch,from,to,dummy,lcnt) \ __asm__ __volatile__ ( \ "1:\n" \ prefetch "320(%1)\n" \ " movq (%1), %%mm0\n" \ " movq 8(%1), %%mm1\n" \ " movq 16(%1), %%mm2\n" \ " movq 24(%1), %%mm3\n" \ " movq %%mm0, (%0)\n" \ " movq %%mm1, 8(%0)\n" \ " movq %%mm2, 16(%0)\n" \ " movq %%mm3, 24(%0)\n" \ prefetch "352(%1)\n" \ " movq 32(%1), %%mm0\n" \ " movq 40(%1), %%mm1\n" \ " movq 48(%1), %%mm2\n" \ " movq 56(%1), %%mm3\n" \ " leal 64(%1),%1\n" \ " movq %%mm0, 32(%0)\n" \ " movq %%mm1, 40(%0)\n" \ " movq %%mm2, 48(%0)\n" \ " movq %%mm3, 56(%0)\n" \ " decl %2\n" \ " leal 64(%0),%0\n" \ " jne 1b\n" \ : "=&D"(to), "=&S"(from), "=&r"(dummy) \ : "0" (to), "1" (from), "2" (lcnt) \ : "memory", "cc"); #define SSE_CPY(prefetch,from,to,dummy,lcnt) \ if((ULong) from & 15) { \ __asm__ __volatile__ ( \ "1:\n" \ prefetch "320(%1)\n" \ " movups (%1), %%xmm0\n" \ " movups 16(%1), %%xmm1\n" \ " movntps %%xmm0, (%0)\n" \ " movntps %%xmm1, 16(%0)\n" \ prefetch "352(%1)\n" \ " movups 32(%1), %%xmm2\n" \ " movups 48(%1), %%xmm3\n" \ " leal 64(%1),%1\n" \ " movntps %%xmm2, 32(%0)\n" \ " movntps %%xmm3, 48(%0)\n" \ " decl %2\n" \ " leal 64(%0),%0\n" \ " jne 1b\n" \ : "=&D"(to), "=&S"(from), "=&r"(dummy) \ : "0" (to), "1" (from), "2" (lcnt) \ : "memory", "cc"); \ } else { \ __asm__ __volatile__ ( \ "2:\n" \ prefetch "320(%1)\n" \ " movaps (%1), %%xmm0\n" \ " movaps 16(%1), %%xmm1\n" \ " movntps %%xmm0, (%0)\n" \ " movntps %%xmm1, 16(%0)\n" \ prefetch "352(%1)\n" \ " movaps 32(%1), %%xmm2\n" \ " movaps 48(%1), %%xmm3\n" \ " leal 64(%1),%1\n" \ " movntps %%xmm2, 32(%0)\n" \ " movntps %%xmm3, 48(%0)\n" \ " decl %2\n" \ " leal 64(%0),%0\n" \ " jne 2b\n" \ : "=&D"(to), "=&S"(from), "=&r"(dummy) \ : "0" (to), "1" (from), "2" (lcnt) \ : "memory", "cc"); \ } #define SSE64_CPY(prefetch,from,to,dummy,lcnt) \ if((ULong) from & 15) { \ __asm__ __volatile__ ( \ "1:\n" \ prefetch "320(%1)\n" \ " movups (%1), %%xmm0\n" \ " movups 16(%1), %%xmm1\n" \ " movntps %%xmm0, (%0)\n" \ " movntps %%xmm1, 16(%0)\n" \ prefetch "352(%1)\n" \ " movups 32(%1), %%xmm2\n" \ " movups 48(%1), %%xmm3\n" \ " leaq 64(%1),%1\n" \ " movntps %%xmm2, 32(%0)\n" \ " movntps %%xmm3, 48(%0)\n" \ " decl %2\n" \ " leaq 64(%0),%0\n" \ " jne 1b\n" \ : "=&D"(to), "=&S"(from), "=&r"(dummy) \ : "0" (to), "1" (from), "2" (lcnt) \ : "memory", "cc"); \ } else { \ __asm__ __volatile__ ( \ "2:\n" \ prefetch "320(%1)\n" \ " movaps (%1), %%xmm0\n" \ " movaps 16(%1), %%xmm1\n" \ " movntps %%xmm0, (%0)\n" \ " movntps %%xmm1, 16(%0)\n" \ prefetch "352(%1)\n" \ " movaps 32(%1), %%xmm2\n" \ " movaps 48(%1), %%xmm3\n" \ " leaq 64(%1),%1\n" \ " movntps %%xmm2, 32(%0)\n" \ " movntps %%xmm3, 48(%0)\n" \ " decl %2\n" \ " leaq 64(%0),%0\n" \ " jne 2b\n" \ : "=&D"(to), "=&S"(from), "=&r"(dummy) \ : "0" (to), "1" (from), "2" (lcnt) \ : "memory", "cc"); \ } #define MMXEXT_CPY(prefetch,from,to,dummy,lcnt) \ __asm__ __volatile__ ( \ ".p2align 4,,7\n" \ "1:\n" \ prefetch "320(%1)\n" \ " movq (%1), %%mm0\n" \ " movq 8(%1), %%mm1\n" \ " movq 16(%1), %%mm2\n" \ " movq 24(%1), %%mm3\n" \ " movntq %%mm0, (%0)\n" \ " movntq %%mm1, 8(%0)\n" \ " movntq %%mm2, 16(%0)\n" \ " movntq %%mm3, 24(%0)\n" \ prefetch "352(%1)\n" \ " movq 32(%1), %%mm0\n" \ " movq 40(%1), %%mm1\n" \ " movq 48(%1), %%mm2\n" \ " movq 56(%1), %%mm3\n" \ " leal 64(%1),%1\n" \ " movntq %%mm0, 32(%0)\n" \ " movntq %%mm1, 40(%0)\n" \ " movntq %%mm2, 48(%0)\n" \ " movntq %%mm3, 56(%0)\n" \ " decl %2\n" \ " leal 64(%0),%0\n" \ " jne 1b\n" \ : "=&D"(to), "=&S"(from), "=&r"(dummy) \ : "0" (to), "1" (from), "2" (lcnt) \ : "memory", "cc"); #define PREFETCH_FUNC(prefix,itype,ptype,begin,fence,small) \ \ static void prefix##_memcpy(UChar *to, \ const UChar *from, \ int size) \ { \ int lcnt = size >> 6; \ int rest = size & 63; \ register int dummy; \ \ PREFETCH1(ptype##_PREFETCH,from); \ \ begin; \ if(lcnt) { \ itype##_CPY(ptype##_PREFETCH,from,to,dummy,lcnt); \ } \ if(rest) { \ PREFETCH2(ptype##_PREFETCH,from); \ small(to, from, rest); \ PREFETCH3(ptype##_PREFETCH,from); \ } \ fence; \ } #define NOPREFETCH_FUNC(prefix,itype,begin,fence,small) \ \ static void prefix##_memcpy(UChar *to, \ const UChar *from, \ int size) \ { \ int lcnt = size >> 6; \ int rest = size & 63; \ register int dummy; \ \ begin; \ if(lcnt) { \ itype##_CPY("#",from,to,dummy,lcnt); \ } \ if(rest) { \ small(to, from, rest); \ } \ fence; \ } /* Other archs */ /* ... */ /* Type for table for benchmark list */ typedef struct { vidCopyFunc mFunc; char *mName; unsigned int mycpuflag; int grade; int gradefrom; Bool reqAlignment; } SISMCFuncData; /************************************************************************/ /* libc memcpy() wrapper - generic */ /************************************************************************/ static void SiS_libc_memcpy(UChar *dst, const UChar *src, int size) { memcpy(dst, src, size); } /************************************************************************/ /* We only do all that stuff under gcc; no idea what other compilers */ /* would do with our asm code. */ /************************************************************************/ #ifndef __GNUC__ unsigned int SiSGetCPUFlags(ScrnInfoPtr pScrn) { return 0; } vidCopyFunc SiSVidCopyInit(ScreenPtr pScreen, vidCopyFunc *UMemCpy, Bool from) { *UMemCpy = SiS_libc_memcpy; return SiS_libc_memcpy; } vidCopyFunc SiSVidCopyGetDefault(void) { return SiS_libc_memcpy; } #else /* ! Everything below is gcc specific ! */ /************************************************************************/ /* Definitions for archs and OSes */ /************************************************************************/ #undef SiS_checkosforsse #undef SiS_canBenchmark #undef SiS_haveProc #undef SiS_haveBuiltInMC #if defined(__i386__) /* ***************************************** i386 */ #define SiS_checkosforsse /* Does this cpu support sse and do we need to check os? */ #define SiS_canBenchmark /* Can we perform a benchmark? */ #ifdef SIS_LINUX #define SiS_haveProc /* Do we have /proc/cpuinfo or similar? */ #endif #define SiS_haveBuiltInMC /* Is there a built-in memcpy for this arch? */ /* Built-in memcpy for i386 */ static __inline void * builtin_memcpy(void * to, const void * from, size_t n) { int d1,d2,d3; __asm__ __volatile__( " cld\n" " shrl $1, %%ecx\n" " jnc 1f\n" " movsb\n" "1: shrl $1, %%ecx\n" " jnc 2f\n" " movsw\n" "2: rep ; movsl\n" : "=&c" (d1), "=&D" (d2), "=&S" (d3) : "0" (n), "1" ((long) to), "2" ((long) from) : "memory", "cc"); return(to); } /* Alternative for 586: Unroll loop, copy 32 bytes at a time */ static void SiS_builtin_memcp2(UChar *to, const UChar *from, int n) { int d1,d2,d3; __asm__ __volatile__( " movl %%edi, %%eax\n" " cmpl $32, %%ecx\n" " cld\n" " jbe 3f\n" " negl %%eax\n" /* Align dest */ " andl $3, %%eax\n" " subl %%eax, %%ecx\n" " xchgl %%eax, %%ecx\n" " rep ; movsb\n" " movl %%eax, %%ecx\n" " subl $32, %%ecx\n" " js 2f\n" " movl (%%edi), %%eax\n" "1: movl 28(%%edi), %%edx\n" /* Trick: Read-ahead */ " subl $32, %%ecx\n" " movl (%%esi), %%eax\n" " movl 4(%%esi), %%edx\n" " movl %%eax, (%%edi)\n" " movl %%edx, 4(%%edi)\n" " movl 8(%%esi), %%eax\n" " movl 12(%%esi), %%edx\n" " movl %%eax, 8(%%edi)\n" " movl %%edx, 12(%%edi)\n" " movl 16(%%esi), %%eax\n" " movl 20(%%esi), %%edx\n" " movl %%eax, 16(%%edi)\n" " movl %%edx, 20(%%edi)\n" " movl 24(%%esi), %%eax\n" " movl 28(%%esi), %%edx\n" " movl %%eax, 24(%%edi)\n" " movl %%edx, 28(%%edi)\n" " leal 32(%%esi), %%esi\n" " leal 32(%%edi), %%edi\n" " jns 1b\n" "2: addl $32, %%ecx\n" "3: rep ; movsb" : "=&c" (d1), "=&D" (d2), "=&S" (d3) : "0" (n), "1" ((long) to), "2" ((long) from) : "eax", "edx", "memory", "cc"); } static unsigned int taketime(void) /* get current time (for benchmarking) */ { unsigned int eax; __asm__ volatile ( " pushl %%ebx\n" " cpuid\n" " rdtsc\n" " popl %%ebx\n" : "=a" (eax) : "0" (0) : "ecx", "edx", "cc"); return(eax); } #elif defined(__AMD64__) || defined(__amd64__) || defined(__x86_64__) /***************** AMD64 */ #define SiS_checkosforsse /* Does this cpu support sse and do we need to check os? */ #define SiS_canBenchmark /* Can we perform a benchmark? */ #ifdef SIS_LINUX #define SiS_haveProc /* Do we have /proc/cpuinfo or similar? */ #endif #define SiS_haveBuiltInMC /* Is there a built-in memcpy for this arch? */ /* Built-in memcpy for AMD64 */ static __inline void * builtin_memcpy(void * to, const void * from, int n) { long d1, d2, d3; __asm__ __volatile__ ( " cld\n" " rep ; movsq\n" " movq %4, %%rcx\n" " rep ; movsb" : "=%c" (d1), "=&D" (d2), "=&S" (d3) : "0" ((ULong)(n >> 3)), "q" ((ULong)(n & 7)), "1" ((long) to), "2" ((long) from) : "memory"); return(to); } /* Alternative: Unroll loop, copy 32 bytes at a time */ static void SiS_builtin_memcp2(UChar *to, const UChar *from, int n) { long d1,d2,d3; __asm__ __volatile__( " movq %%rdi, %%rax\n" " cmpq $32, %%rcx\n" " cld\n" /* Pipeline; no other flags but DF */ " jbe 1f\n" " negq %%rax\n" /* Align dest */ " andq $7, %%rax\n" " subq %%rax, %%rcx\n" " xchgq %%rax, %%rcx\n" " rep ; movsb\n" " movq %%rax, %%rcx\n" " subq $32, %%rcx\n" " js 2f\n" ".p2align 4\n" "3: subq $32, %%rcx\n" " movq (%%rsi), %%rax\n" " movq 8(%%rsi), %%rdx\n" " movq 16(%%rsi), %%r8\n" " movq 24(%%rsi), %%r9\n" " movq %%rax, (%%rdi)\n" " movq %%rdx, 8(%%rdi)\n" " movq %%r8, 16(%%rdi)\n" " movq %%r9, 24(%%rdi)\n" " leaq 32(%%rsi), %%rsi\n" " leaq 32(%%rdi), %%rdi\n" " jns 3b\n" "2: addq $32, %%rcx\n" "1: rep ; movsb" : "=&c" (d1), "=&D" (d2), "=&S" (d3) :"0" ((ULong) n), "1" ((long) to), "2" ((long) from) : "rax", "rdx", "r8", "r9", "memory", "cc"); } static unsigned int taketime(void) /* get current time (for benchmarking) */ { unsigned int eax; __asm__ volatile ( " pushq %%rbx\n" " cpuid\n" " rdtsc\n" " popq %%rbx\n" : "=a" (eax) : "0" (0) : "rcx", "rdx", "cc"); return(eax); } #else /* **************************************** Other archs */ /* 1. Can we do a benchmark? */ /* #define SiS_canBenchmark */ /* 2. Do we have /proc filesystem or similar for CPU information? */ /* #define SiS_haveproc */ /* 3. Optional: build-in memcpy() */ /* #define SiS_haveBuiltInMC */ /* static __inline void * builtin_memcpy(void * to, const void * from, int n) { } */ /* 4. Function for getting current time (for benchmarking) */ /* static unsigned int taketime(void) { } */ #endif /************************************************************************/ /* Generic built-in memcpy wrapper */ /************************************************************************/ #ifdef SiS_haveBuiltInMC static void SiS_builtin_memcpy(UChar *dst, const UChar *src, int size) { builtin_memcpy(dst, src, size); } #endif /************************************************************************/ /* Generic routines if Benchmark can be performed (all archs, all OSes) */ /************************************************************************/ #ifdef SiS_canBenchmark /* Get time (unsigned int) */ static unsigned int time_function(vidCopyFunc mf, UChar *buf1, UChar *buf2, int size) { unsigned int t1, t2; t1 = taketime(); (*mf)(buf1, buf2, size); t2 = taketime(); return((t1 < t2) ? t2 - t1 : 0xFFFFFFFFU - (t1 - t2 - 1)); } /* Allocate an area of offscreen FB memory (buf1), a simulated video * player buffer (buf2) and a pool of uninitialized "video" data (buf3). */ static void * SiS_AllocBuffers(ScrnInfoPtr pScrn, UChar **buf1, UChar **buf2, UChar **buf3) { SISPtr pSiS = SISPTR(pScrn); unsigned int offset; void *handle = NULL; if(!(offset = SISAllocateFBMemory(pScrn, &handle, BUFFERSIZE + 31))) { return NULL; } (*buf1) = (UChar *)pSiS->FbBase + offset; (*buf1) = (UChar *)(((ULong)(*buf1) + 31) & ~31); if(!((*buf2) = (UChar *)malloc(BUFFERSIZE + 15))) { SISFreeFBMemory(pScrn, &handle); return NULL; } if(!((*buf3) = (UChar *)malloc(BUFFERSIZE + 15))) { free((*buf2)); SISFreeFBMemory(pScrn, &handle); return NULL; } return handle; } /* Perform Benchmark */ static int SiS_BenchmarkMemcpy(ScrnInfoPtr pScrn, SISMCFuncData *MCFunctions, unsigned int myCPUflags, UChar *buf1, UChar *buf2, UChar *buf3, char *frqBuf, double cpuFreq, vidCopyFunc *UMemCpy, int *best2, Bool from) { SISMCFuncData *curData; int j = 0, bestSoFar = 0; unsigned int tmp1, tmp2, best = 0xFFFFFFFFU, sbest = 0xFFFFFFFFU; (*best2) = 0; /* Make probable buf1 and buf2 are not paged out by referencing them */ SiS_libc_memcpy(buf1, buf2, BUFFERSIZE); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Benchmarking %s RAM to %s RAM memory transfer methods:\n", from ? "video" : "system", from ? "system" : "video"); #ifdef TWDEBUG xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Benchmark: CPUFlags %x\n", myCPUflags); #endif j = 0; while(MCFunctions[j].mFunc) { curData = MCFunctions + j; if(myCPUflags & curData->mycpuflag) { /* Simulate setup of the video buffer and copy result to framebuffer */ /* Do this 4 times to verify results */ if(!from) { SiS_builtin_memcpy(buf2, buf3, BUFFERSIZE); tmp1 = time_function(curData->mFunc, buf1, buf2, BUFFERSIZE); SiS_builtin_memcpy(buf2, buf3, BUFFERSIZE); tmp2 = time_function(curData->mFunc, buf1, buf2, BUFFERSIZE); tmp1 = (tmp2 < tmp1) ? tmp2 : tmp1; SiS_builtin_memcpy(buf2, buf3, BUFFERSIZE); tmp2 = time_function(curData->mFunc, buf1, buf2, BUFFERSIZE); tmp1 = (tmp2 < tmp1) ? tmp2 : tmp1; SiS_builtin_memcpy(buf2, buf3, BUFFERSIZE); tmp2 = time_function(curData->mFunc, buf1, buf2, BUFFERSIZE); tmp1 = (tmp2 < tmp1) ? tmp2 : tmp1; } else { SiS_builtin_memcpy(buf3, buf2, BUFFERSIZE); tmp1 = time_function(curData->mFunc, buf2, buf1, BUFFERSIZE); SiS_builtin_memcpy(buf3, buf2, BUFFERSIZE); tmp2 = time_function(curData->mFunc, buf2, buf1, BUFFERSIZE); tmp1 = (tmp2 < tmp1) ? tmp2 : tmp1; SiS_builtin_memcpy(buf3, buf2, BUFFERSIZE); tmp2 = time_function(curData->mFunc, buf2, buf1, BUFFERSIZE); tmp1 = (tmp2 < tmp1) ? tmp2 : tmp1; SiS_builtin_memcpy(buf3, buf2, BUFFERSIZE); tmp2 = time_function(curData->mFunc, buf2, buf1, BUFFERSIZE); tmp1 = (tmp2 < tmp1) ? tmp2 : tmp1; } if((!frqBuf) || (tmp1 == 0)) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "\tChecked %s memcpy()... \t%u\n",curData->mName, tmp1); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "\tChecked %s memcpy()... \t%.1f MiB/s\n", curData->mName, cpuFreq * 1.e6 * (double)BUFFERSIZE / ((double)(tmp1) * (double)(0x100000))); } if(tmp1 < best) { best = tmp1; bestSoFar = j; } if(!curData->reqAlignment) { if(tmp1 < sbest) { sbest = tmp1; (*best2) = j; } } } j++; } return bestSoFar; } static vidCopyFunc SiS_GetBestByGrade(ScrnInfoPtr pScrn, SISMCFuncData *MCFunctions, unsigned int myCPUflags, vidCopyFunc *UMemCpy, Bool from) { int j = 0, best = -1, secondbest = -1, bestSoFar = 10, best2SoFar = 10; int grade; *UMemCpy = SiS_libc_memcpy; while(MCFunctions[j].mFunc) { if(myCPUflags & MCFunctions[j].mycpuflag) { grade = from ? MCFunctions[j].gradefrom : MCFunctions[j].grade; if(grade < bestSoFar) { best = j; bestSoFar = grade; } if(grade < best2SoFar) { if(!MCFunctions[j].reqAlignment) { secondbest = j; best2SoFar = grade; } } } j++; } if(best >= 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Chose %s method for aligned data transfers %s video RAM\n", MCFunctions[best].mName, from ? "from" : "to"); if(secondbest >= 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Chose %s method for unaligned data transfers %s video RAM\n", MCFunctions[secondbest].mName, from ? "from" : "to"); *UMemCpy = MCFunctions[secondbest].mFunc; } return MCFunctions[best].mFunc; } return SiS_libc_memcpy; } #endif /* canBenchmark */ /**********************************************************************/ /* Generic routines if /proc filesystem is available (Linux) */ /**********************************************************************/ #ifdef SiS_haveProc /* Linux: Read file (/proc/cpuinfo) into buffer */ static int SiS_ReadProc(char *buf, char *filename) { FILE *cpuInfoFile; int count; if((cpuInfoFile = fopen(filename, "r")) == NULL) { return 0; } count = fread(buf, 1, CPUBUFFERSIZE, cpuInfoFile); if(ferror(cpuInfoFile)) { fclose(cpuInfoFile); return 0; } fclose(cpuInfoFile); if(count >= CPUBUFFERSIZE - 2) { return 0; } buf[count] = 0; return count; } /* Linux: Extract CPU speed from /proc/cpuinfo */ static char *SiS_GetCPUFreq(ScrnInfoPtr pScrn, char *buf, double *cpuFreq) { char *frqBuf, *endBuf; (*cpuFreq) = 0.0; if((frqBuf = strstr(buf,"cpu MHz\t\t:"))) { frqBuf += 11; (*cpuFreq) = strtod(frqBuf, &endBuf); if(endBuf == frqBuf) frqBuf = NULL; if((*cpuFreq) < 10.0) frqBuf = NULL; /* sanity check */ if(frqBuf) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CPU frequency %.2fMhz\n", (*cpuFreq)); } } return frqBuf; } #endif /* haveProc */ /**********************************************************************/ /* Arch-specific routines */ /**********************************************************************/ #ifdef SiS_checkosforsse /* Common i386, AMD64 */ #ifdef SISCHECKOSSSE #ifndef XFree86LOADER #include #endif static jmp_buf sigill_return; static void sigill_handler(void) { longjmp(sigill_return, 1); } #endif static Bool CheckOSforSSE(ScrnInfoPtr pScrn) { #ifdef SISCHECKOSSSE /* Check OS for SSE possible: */ int signo = -1; #ifdef SISDGBMC xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Checking OS SSE support\n"); #endif xf86InterceptSigIll(&sigill_handler); if(setjmp(sigill_return)) { signo = 4; } else { __asm__ __volatile__ (" xorps %xmm0, %xmm0\n"); /* __asm__ __volatile__ (" .byte 0xff\n"); */ /* For test */ } xf86InterceptSigIll(NULL); #ifdef SISDGBMC xf86DrvMsg(pScrn->scrnIndex, X_INFO, "OS SSE support signal %d\n", signo); #endif if(signo != -1) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "OS does not support SSE instructions\n"); } return (signo >= 0) ? FALSE : TRUE; #else /* no check for SSE possible: */ SISPtr pSiS = SISPTR(pScrn); xf86DrvMsg(pScrn->scrnIndex, pSiS->XvSSEMemcpy ? X_WARNING : X_INFO, "Checking OS for SSE support is not supported in this version of " SISMYSERVERNAME "\n"); if(pSiS->XvSSEMemcpy) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "If you get a signal 4 here, set the option \"UseSSE\" to \"off\".\n"); return TRUE; } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "If your OS supports SSE, set the option \"UseSSE\" to \"on\".\n"); return FALSE; } #endif } #endif /* SiS_checkosforsse */ #ifdef __i386__ /* i386 specific *************************************/ PREFETCH_FUNC(SiS_sse,SSE,SSE,,FENCE,small_memcpy_i386) PREFETCH_FUNC(SiS_mmxext,MMXEXT,SSE,EMMS,FENCEMMS,small_memcpy_i386) PREFETCH_FUNC(SiS_now,MMX,NOW,FEMMS,FEMMS,small_memcpy_i386) NOPREFETCH_FUNC(SiS_mmx,MMX,EMMS,EMMS,small_memcpy_i386) static SISMCFuncData MCFunctions_i386[] = { {SiS_libc_memcpy, "libc", SIS_CPUFL_LIBC, 4, 4, FALSE}, {SiS_builtin_memcpy,"built-in-1",SIS_CPUFL_BI, 5, 5, FALSE}, {SiS_builtin_memcp2,"built-in-2",SIS_CPUFL_BI2, 6, 6, FALSE}, {SiS_mmx_memcpy, "MMX", SIS_CPUFL_MMX, 3, 3, FALSE}, {SiS_sse_memcpy, "SSE", SIS_CPUFL_SSE, 1, 0, TRUE}, {SiS_now_memcpy, "3DNow!", SIS_CPUFL_3DNOW, 2, 2, FALSE}, {SiS_mmxext_memcpy, "MMX2", SIS_CPUFL_MMX2, 0, 1, FALSE}, {NULL, "", 0, 10, 10, FALSE} }; #define Def_FL (SIS_CPUFL_LIBC | SIS_CPUFL_BI | SIS_CPUFL_BI2) /* Default methods */ #define cpuid(op, eax, ebx, ecx, edx) \ __asm__ __volatile__ ( \ " pushl %%ebx\n" \ " cpuid\n" \ " movl %%ebx, %1\n" \ " popl %%ebx\n" \ : "=a" (eax), "=r" (ebx), \ "=c" (ecx), "=d" (edx) \ : "a" (op) \ : "cc") static Bool cpuIDSupported(ScrnInfoPtr pScrn) { int eax, ebx, ecx, edx; /* Check for cpuid instruction */ __asm__ __volatile__ ( " pushf\n" " popl %0\n" " movl %0, %1\n" " xorl $0x200000, %0\n" " push %0\n" " popf\n" " pushf\n" " popl %0\n" : "=a" (eax), "=c" (ecx) : : "cc"); if(eax == ecx) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CPU does not support CPUID instruction\n"); return FALSE; } /* Check for cpuid level */ cpuid(0x00000000, eax, ebx, ecx, edx); if(!eax) { return FALSE; } /* Check for RDTSC */ cpuid(0x00000001, eax, ebx, ecx, edx); if(!(edx & 0x10)) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CPU does not support RDTSC instruction\n"); return FALSE; } return TRUE; } static unsigned int SiS_GetCpuFeatures(ScrnInfoPtr pScrn) { unsigned int flags = 0, eax, ebx, ecx, edx; Bool IsAMD; /* Check if cpuid and rdtsc instructions are supported */ if(!cpuIDSupported(pScrn)) { return 0; } cpuid(0x00000000, eax, ebx, ecx, edx); IsAMD = (ebx == 0x68747541) && (edx == 0x69746e65) && (ecx == 0x444d4163); cpuid(0x00000001, eax, ebx, ecx, edx); /* MMX */ if(edx & 0x00800000) flags |= SIS_CPUFL_MMX; /* SSE, MMXEXT */ if(edx & 0x02000000) flags |= (SIS_CPUFL_SSE | SIS_CPUFL_MMX2); /* SSE2 - don't need this one directly, set SSE instead */ if(edx & 0x04000000) flags |= (SIS_CPUFL_SSE | SIS_CPUFL_SSE2); cpuid(0x80000000, eax, ebx, ecx, edx); if(eax >= 0x80000001) { cpuid(0x80000001, eax, ebx, ecx, edx); /* 3DNow! */ if(edx & 0x80000000) flags |= SIS_CPUFL_3DNOW; /* AMD MMXEXT */ if(IsAMD && (edx & 0x00400000)) flags |= SIS_CPUFL_MMX2; } return flags; } #elif defined(__AMD64__) || defined(__amd64__) || defined(__x86_64__) /* AMD64 specific ***** */ PREFETCH_FUNC(SiS_sse,SSE64,SSE,,FENCE,small_memcpy_amd64) static SISMCFuncData MCFunctions_AMD64[] = { {SiS_libc_memcpy, "libc", SIS_CPUFL_LIBC, 2, 2, FALSE}, {SiS_builtin_memcpy,"built-in-1",SIS_CPUFL_BI, 1, 1, FALSE}, {SiS_builtin_memcp2,"built-in-2",SIS_CPUFL_BI2, 3, 3, FALSE}, {SiS_sse_memcpy, "SSE", SIS_CPUFL_SSE, 0, 0, TRUE}, {NULL, "", 0, 10, 10, FALSE} }; #define Def_FL (SIS_CPUFL_LIBC | SIS_CPUFL_BI | SIS_CPUFL_BI2) static unsigned int SiS_GetCpuFeatures(ScrnInfoPtr pScrn) { return((unsigned int)(SIS_CPUFL_SSE|SIS_CPUFL_SSE2)); } #else /* Specific for other archs ******************************** */ /* Fill in here */ #define Def_FL (SIS_CPUFL_LIBC) static unsigned int SiS_GetCpuFeatures(ScrnInfoPtr pScrn) { return((unsigned int)(0)); } #endif /**********************************************************************/ /* Benchmark the video copy routines and choose the fastest */ /**********************************************************************/ #ifdef SiS_canBenchmark static vidCopyFunc SiSVidCopyInitGen(ScreenPtr pScreen, SISMCFuncData *MCFunctions, vidCopyFunc *UMemCpy, Bool from) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); void *fbhandle = NULL; char *frqBuf = NULL; UChar *buf1, *buf2, *buf3; double cpuFreq = 0.0; unsigned int myCPUflags = pSiS->CPUFlags | Def_FL; int best, secondbest; #ifdef SiS_haveProc char buf[CPUBUFFERSIZE]; #endif *UMemCpy = SiS_libc_memcpy; /* Bail out if user disabled benchmarking */ if(!pSiS->BenchMemCpy) { return SiS_libc_memcpy; } #ifdef SiS_haveProc /* Read /proc/cpuinfo into buf */ if(SiS_ReadProc(buf, "/proc/cpuinfo")) { /* Extract CPU frequency */ frqBuf = SiS_GetCPUFreq(pScrn, buf, &cpuFreq); } #endif /* Allocate buffers */ if(!(fbhandle = SiS_AllocBuffers(pScrn, &buf1, &buf2, &buf3))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Failed to allocate video RAM for video data transfer benchmark\n"); return SiS_GetBestByGrade(pScrn, MCFunctions, myCPUflags, UMemCpy, from); } /* Perform Benchmark */ best = SiS_BenchmarkMemcpy(pScrn, MCFunctions, myCPUflags, buf1, (UChar *)(((unsigned long)buf2 + 15) & ~15), (UChar *)(((unsigned long)buf3 + 15) & ~15), frqBuf, cpuFreq, UMemCpy, &secondbest, from); /* Free buffers */ SISFreeFBMemory(pScrn, &fbhandle); free(buf2); free(buf3); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Using %s method for aligned data transfers %s video RAM\n", MCFunctions[best].mName, from ? "from" : "to"); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Using %s method for unaligned data transfers %s video RAM\n", MCFunctions[secondbest].mName, from ? "from" : "to"); return MCFunctions[best].mFunc; } #endif /* canBenchmark */ /**********************************************************************/ /* main(): Get CPU capabilities */ /* (called externally) */ /**********************************************************************/ unsigned int SiSGetCPUFlags(ScrnInfoPtr pScrn) { unsigned int myCPUflags = SiS_GetCpuFeatures(pScrn); #ifdef SiS_checkosforsse if(myCPUflags & (SIS_CPUFL_SSE | SIS_CPUFL_SSE2)) { /* Check if OS supports usage of SSE instructions */ if(!(CheckOSforSSE(pScrn))) { myCPUflags &= ~(SIS_CPUFL_SSE | SIS_CPUFL_SSE2); } } #endif return myCPUflags; } /**********************************************************************/ /* main(): SiSVidCopyInit() */ /* (called externally) */ /* (SiSGetCPUFlags must be called before this one) */ /**********************************************************************/ vidCopyFunc SiSVidCopyInit(ScreenPtr pScreen, vidCopyFunc *UMemCpy, Bool from) { #if defined(__i386__) && defined(SiS_canBenchmark) return(SiSVidCopyInitGen(pScreen, MCFunctions_i386, UMemCpy, from)); #elif (defined(__AMD64__) || defined(__amd64__) || defined(__x86_64__)) && defined(SiS_canBenchmark) return(SiSVidCopyInitGen(pScreen, MCFunctions_AMD64, UMemCpy, from)); #else /* Other cases: Use libc memcpy() */ *UMemCpy = SiS_libc_memcpy; return SiS_libc_memcpy; #endif } vidCopyFunc SiSVidCopyGetDefault(void) { return SiS_libc_memcpy; } #endif /* GNU C */ xf86-video-sis-0.10.7/src/300vtbl.h0000664000076400007640000012533311763614406013376 00000000000000/* * Register settings for SiS 300 series * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * If distributed as part of the Linux kernel, the following license terms * apply: * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the named License, * * or any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA * * Otherwise, the following license terms apply: * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted provided that the following conditions * * are met: * * 1) Redistributions of source code must retain the above copyright * * notice, this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright * * notice, this list of conditions and the following disclaimer in the * * documentation and/or other materials provided with the distribution. * * 3) The name of the author may not be used to endorse or promote products * * derived from this software without specific prior written permission. * * * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * */ static const struct SiS_Ext SiS300_EModeIDTable[] = { {0x6a,0x2212,0x0102,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00,-1}, /* 800x600x? */ {0x2e,0x0a1b,0x0101,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08,-1}, {0x2f,0x021b,0x0100,SIS_RI_640x400, 0x00,0x00,0x00,0x00,0x10,-1}, /* 640x400x8 */ {0x30,0x2a1b,0x0103,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00,-1}, {0x31,0x4a1b,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x8 */ {0x32,0x6a1b,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x8 */ {0x33,0x4a1d,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x16 */ {0x34,0x6a1d,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x16 */ {0x35,0x4a1f,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x32 */ {0x36,0x6a1f,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x32 */ {0x37,0x0212,0x0104,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1}, /* 1024x768x? */ {0x38,0x0a1b,0x0105,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1}, /* 1024x768x8 */ {0x3a,0x0e3b,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1}, /* 1280x1024x8 */ {0x3c,0x063b,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,-1}, {0x3d,0x067d,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,-1}, {0x40,0x921c,0x010d,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23,-1}, /* 320x200x15 */ {0x41,0x921d,0x010e,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23,-1}, /* 320x200x16 */ {0x43,0x0a1c,0x0110,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08,-1}, {0x44,0x0a1d,0x0111,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08,-1}, {0x46,0x2a1c,0x0113,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00,-1}, /* 800x600x15 */ {0x47,0x2a1d,0x0114,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00,-1}, /* 800x600x16 */ {0x49,0x0a3c,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1}, {0x4a,0x0a3d,0x0117,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1}, {0x4c,0x0e7c,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1}, {0x4d,0x0e7d,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1}, {0x50,0x921b,0x0132,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x24,-1}, /* 320x240x8 */ {0x51,0xb21b,0x0133,SIS_RI_400x300, 0x00,0x00,0x00,0x00,0x25,-1}, /* 400x300x8 */ {0x52,0x921b,0x0134,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x26,-1}, /* 512x384x8 */ {0x56,0x921d,0x0135,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x24,-1}, /* 320x240x16 */ {0x57,0xb21d,0x0136,SIS_RI_400x300, 0x00,0x00,0x00,0x00,0x25,-1}, /* 400x300x16 */ {0x58,0x921d,0x0137,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x26,-1}, /* 512x384x16 */ {0x59,0x921b,0x0138,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23,-1}, /* 320x200x8 */ {0x5c,0x921f,0x0000,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x26,-1}, /* 512x384x32 */ {0x5d,0x021d,0x0139,SIS_RI_640x400, 0x00,0x00,0x00,0x00,0x10,-1}, /* 640x400x16 */ {0x5e,0x021f,0x0000,SIS_RI_640x400, 0x00,0x00,0x00,0x00,0x10,-1}, /* 640x400x32 */ {0x62,0x0a3f,0x013a,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08,-1}, {0x63,0x2a3f,0x013b,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00,-1}, /* 800x600x32 */ {0x64,0x0a7f,0x013c,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1}, {0x65,0x0eff,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1}, {0x66,0x06ff,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,-1}, {0x68,0x067b,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27,-1}, {0x69,0x06fd,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27,-1}, {0x6b,0x07ff,0x0000,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27,-1}, {0x6c,0x067b,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28,-1}, /* 2048x1536x8 */ {0x6d,0x06fd,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28,-1}, /* 2048x1536x16 */ {0x70,0x6a1b,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x8 */ {0x71,0x4a1b,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x8 */ {0x74,0x4a1d,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x16 */ {0x75,0x0e3d,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1}, /* 1280x720x16 */ {0x76,0x6a1f,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x32 */ {0x77,0x4a3f,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x32 */ {0x78,0x0eff,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1}, /* 1280x720x32 */ {0x79,0x0e3b,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1}, /* 1280x720x8 */ {0x7a,0x6a1d,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x16 */ {0x7c,0x0a3b,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1}, /* 1280x960x8 */ {0x7d,0x0a7d,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1}, /* 1280x960x16 */ {0x7e,0x0aff,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1}, /* 1280x960x32 */ {0x20,0x4a1b,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1}, /* 1024x600 */ {0x21,0x4a3d,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1}, {0x22,0x4a7f,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1}, {0x23,0x4a1b,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1}, /* 1152x768 */ {0x24,0x4a3d,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1}, {0x25,0x4a7f,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1}, {0x29,0x4e1b,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1}, /* 1152x864 */ {0x2a,0x4e3d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1}, {0x2b,0x4e7f,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1}, {0x39,0x6a1b,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x39,-1}, /* 848x480 */ {0x3b,0x6a3d,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x39,-1}, {0x3e,0x6a7f,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x39,-1}, {0x3f,0x6a1b,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3b,-1}, /* 856x480 */ {0x42,0x6a3d,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3b,-1}, {0x45,0x6a7f,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3b,-1}, {0x48,0x6a3b,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1360x768 */ {0x4b,0x6a7d,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3d,-1}, {0x4e,0x6aff,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3d,-1}, {0x4f,0x921f,0x0000,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23,-1}, /* 320x200x32 */ {0x53,0x921f,0x0000,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x24,-1}, /* 320x240x32 */ {0x54,0xb21f,0x0000,SIS_RI_400x300, 0x00,0x00,0x00,0x00,0x25,-1}, /* 400x300x32 */ {0x55,0x2e3b,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3e,-1}, /* 1280x768 */ {0x5a,0x2e7d,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3e,-1}, {0x5b,0x2eff,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3e,-1}, {0x5f,0x6a1b,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3f,-1}, /* 768x576x8 */ {0x60,0x6a1d,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3f,-1}, /* 768x576x16 */ {0x61,0x6a1f,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3f,-1}, /* 768x576x32 */ {0x67,0x6e3b,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x40,-1}, /* 1360x1024x8 (BARCO) */ {0x6f,0x6e7d,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x40,-1}, /* 1360x1024x16 (BARCO) */ {0x72,0x6eff,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x40,-1}, /* 1360x1024x32 (BARCO) */ {0xff,0x0000,0xffff,0, 0x00,0x00,0x00,0x00,0x00} }; static const struct SiS_Ext2 SiS300_RefIndex[] = { {0x085f,0x0d,0x03,0x05,0x05,0x6a, 800, 600, 0, 0x00, 0x00}, /* 00 */ {0x0467,0x0e,0x04,0x05,0x05,0x6a, 800, 600, 0, 0x00, 0x00}, /* 01 */ {0x0067,0x0f,0x07,0x48,0x05,0x6a, 800, 600, 0, 0x00, 0x00}, /* 02 - CRT1CRTC was 0x4f */ {0x0067,0x10,0x06,0x8b,0x05,0x6a, 800, 600, 0, 0x00, 0x00}, /* 03 */ {0x0147,0x11,0x08,0x00,0x05,0x6a, 800, 600, 0, 0x00, 0x00}, /* 04 */ {0x0147,0x12,0x0c,0x00,0x05,0x6a, 800, 600, 0, 0x00, 0x00}, /* 05 */ {0x0047,0x11,0x0e,0x00,0x05,0x6a, 800, 600, 0, 0x00, 0x00}, /* 06 - CRT1CRTC was 0x51 */ {0x0047,0x11,0x13,0x00,0x05,0x6a, 800, 600, 0, 0x00, 0x00}, /* 07 */ {0xc85f,0x05,0x00,0x04,0x04,0x2e, 640, 480, 0, 0x00, 0x00}, /* 08 */ {0xc067,0x06,0x02,0x04,0x04,0x2e, 640, 480, 0, 0x00, 0x00}, /* 09 */ {0xc067,0x07,0x02,0x47,0x04,0x2e, 640, 480, 0, 0x00, 0x00}, /* 0a */ {0xc067,0x08,0x03,0x8a,0x04,0x2e, 640, 480, 0, 0x00, 0x00}, /* 0b */ {0xc047,0x09,0x05,0x00,0x04,0x2e, 640, 480, 0, 0x00, 0x00}, /* 0c */ {0xc047,0x0a,0x08,0x00,0x04,0x2e, 640, 480, 0, 0x00, 0x00}, /* 0d */ {0xc047,0x0b,0x0a,0x00,0x04,0x2e, 640, 480, 0, 0x00, 0x00}, /* 0e */ {0xc047,0x0c,0x10,0x00,0x04,0x2e, 640, 480, 0, 0x00, 0x00}, /* 0f */ {0x487f,0x04,0x00,0x00,0x00,0x2f, 640, 400, 0, 0x4a, 0x49}, /* 10 */ {0xc06f,0x31,0x01,0x06,0x13,0x31, 720, 480, 0, 0x00, 0x00}, /* 11 */ {0x006f,0x32,0x4a,0x06,0x14,0x32, 720, 576, 0, 0x00, 0x00}, /* 12 */ /* 4a was 03 */ {0x0187,0x15,0x05,0x00,0x06,0x37,1024, 768, 0, 0x00, 0x00}, /* 13 */ {0xc877,0x16,0x09,0x06,0x06,0x37,1024, 768, 0, 0x00, 0x00}, /* 14 */ {0xc067,0x17,0x0b,0x49,0x06,0x37,1024, 768, 0, 0x00, 0x00}, /* 15 - CRT1CRTC was 0x97 */ {0x0267,0x18,0x0d,0x00,0x06,0x37,1024, 768, 0, 0x00, 0x00}, /* 16 */ {0x0047,0x19,0x11,0x8c,0x06,0x37,1024, 768, 0, 0x00, 0x00}, /* 17 - CRT1CRTC was 0x59 */ {0x0047,0x1a,0x12,0x00,0x06,0x37,1024, 768, 0, 0x00, 0x00}, /* 18 */ {0x0007,0x1b,0x16,0x00,0x06,0x37,1024, 768, 0, 0x00, 0x00}, /* 19 - CRT1CRTC was 0x5b */ {0x0387,0x1c,0x0d,0x00,0x07,0x3a,1280,1024, 0, 0x00, 0x00}, /* 1a - CRT1CRTC was 0x5c */ {0x0077,0x1d,0x14,0x07,0x07,0x3a,1280,1024, 0, 0x00, 0x00}, /* 1b */ {0x0047,0x1e,0x17,0x00,0x07,0x3a,1280,1024, 0, 0x00, 0x00}, /* 1c */ {0x0007,0x1f,0x18,0x00,0x07,0x3a,1280,1024, 0, 0x00, 0x00}, /* 1d */ {0x0007,0x20,0x19,0x00,0x00,0x3c,1600,1200, 0, 0x00, 0x00}, /* 1e - CRT1CRTC was 0x60 */ {0x0007,0x21,0x1a,0x00,0x00,0x3c,1600,1200, 0, 0x00, 0x00}, /* 1f */ {0x0007,0x22,0x1b,0x00,0x00,0x3c,1600,1200, 0, 0x00, 0x00}, /* 20 */ {0x0007,0x23,0x1d,0x00,0x00,0x3c,1600,1200, 0, 0x00, 0x00}, /* 21 - CRT1CRTC was 0x63 */ {0x0007,0x24,0x1e,0x00,0x00,0x3c,1600,1200, 0, 0x00, 0x00}, /* 22 */ {0x407f,0x00,0x00,0x00,0x00,0x40, 320, 200, 0, 0x4b, 0x4b}, /* 23 */ {0xc07f,0x01,0x00,0x04,0x04,0x50, 320, 240, 0, 0x00, 0x00}, /* 24 */ {0x0077,0x02,0x04,0x05,0x05,0x51, 400, 300, 0, 0x00, 0x00}, /* 25 */ {0xc877,0x03,0x09,0x06,0x06,0x52, 512, 384, 0, 0x00, 0x00}, /* 26 */ /* was c077 */ {0x8207,0x25,0x1f,0x00,0x00,0x68,1920,1440, 0, 0x00, 0x00}, /* 27 */ {0x0007,0x26,0x20,0x00,0x00,0x6c,2048,1536, 0, 0x00, 0x00}, /* 28 */ {0x0067,0x27,0x14,0x08,0x0a,0x6e,1280, 960, 0, 0x00, 0x00}, /* 29 - 1280x960-60 */ {0x0027,0x45,0x3c,0x08,0x0a,0x6e,1280, 960, 0, 0x00, 0x00}, /* 2a - 1280x960-85 */ {0xc077,0x33,0x09,0x06,0x00,0x20,1024, 600, 0, 0x00, 0x00}, /* 2b */ {0xc077,0x34,0x0b,0x06,0x00,0x23,1152, 768, 0, 0x00, 0x00}, /* 2c */ /* VCLK 0x09 */ {0x0077,0x35,0x27,0x08,0x18,0x70, 800, 480, 0, 0x00, 0x00}, /* 2d */ {0x0047,0x36,0x37,0x08,0x18,0x70, 800, 480, 0, 0x00, 0x00}, /* 2e */ {0x0047,0x37,0x08,0x08,0x18,0x70, 800, 480, 0, 0x00, 0x00}, /* 2f */ {0x0077,0x38,0x09,0x09,0x19,0x71,1024, 576, 0, 0x00, 0x00}, /* 30 */ {0x0047,0x39,0x38,0x09,0x19,0x71,1024, 576, 0, 0x00, 0x00}, /* 31 */ {0x0047,0x3a,0x11,0x09,0x19,0x71,1024, 576, 0, 0x00, 0x00}, /* 32 */ {0x0077,0x3b,0x39,0x0a,0x0c,0x75,1280, 720, 0, 0x00, 0x00}, /* 33 */ {0x0047,0x3c,0x3a,0x0a,0x0c,0x75,1280, 720, 0, 0x00, 0x00}, /* 34 */ {0x0007,0x3d,0x3b,0x0a,0x0c,0x75,1280, 720, 0, 0x00, 0x00}, /* 35 */ {0x0067,0x49,0x35,0x06,0x1a,0x29,1152, 864, 0, 0x00, 0x00}, /* 36 1152x864-60Hz */ {0x0067,0x3e,0x34,0x06,0x1a,0x29,1152, 864, 0, 0x00, 0x00}, /* 37 1152x864-75Hz */ {0x0047,0x44,0x3a,0x06,0x1a,0x29,1152, 864, 0, 0x00, 0x00}, /* 38 1152x864-85Hz */ {0x00c7,0x3f,0x28,0x00,0x16,0x39, 848, 480, 0, 0x00, 0x00}, /* 39 848x480-38Hzi */ {0xc067,0x40,0x3d,0x0b,0x16,0x39, 848, 480, 0, 0x00, 0x00}, /* 3a 848x480-60Hz */ {0x00c7,0x41,0x28,0x00,0x17,0x3f, 856, 480, 0, 0x00, 0x00}, /* 3b 856x480-38Hzi */ {0xc067,0x42,0x28,0x0c,0x17,0x3f, 856, 480, 0, 0x00, 0x00}, /* 3c 856x480-60Hz */ {0x0067,0x43,0x3e,0x0d,0x1b,0x48,1360, 768, 0, 0x00, 0x00}, /* 3d 1360x768-60Hz */ {0x0077,0x46,0x3f,0x08,0x08,0x55,1280, 768, 0, 0x00, 0x00}, /* 3e 1280x768-60Hz */ {0x006f,0x47,0x4c,0x06,0x15,0x5f, 768, 576, 0, 0x00, 0x00}, /* 3f 768x576 */ {0x0027,0x48,0x13,0x08,0x00,0x67,1360,1024, 0, 0x00, 0x00}, /* 40 1360x1024-59Hz (BARCO1366 only) */ {0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0x00, 0x00} }; static const struct SiS_VBMode SiS300_VBModeIDTable[] = { {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, {0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, {0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x02}, {0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x00}, {0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x01}, {0x03,0x00,0x00,0x00,0x03,0x00,0x03,0x02}, {0x05,0x00,0x00,0x01,0x04,0x00,0x00,0x00}, {0x06,0x00,0x00,0x01,0x05,0x00,0x02,0x00}, {0x07,0x00,0x00,0x00,0x03,0x00,0x03,0x01}, {0x07,0x00,0x00,0x00,0x03,0x00,0x03,0x02}, {0x0d,0x00,0x00,0x01,0x04,0x00,0x00,0x00}, {0x0e,0x00,0x00,0x01,0x05,0x00,0x02,0x00}, {0x0f,0x00,0x00,0x01,0x05,0x00,0x02,0x01}, {0x10,0x00,0x00,0x01,0x05,0x00,0x02,0x01}, {0x11,0x00,0x00,0x01,0x05,0x00,0x02,0x03}, {0x12,0x00,0x00,0x01,0x05,0x00,0x02,0x03}, {0x13,0x00,0x00,0x01,0x04,0x00,0x04,0x00}, {0x6a,0x00,0x00,0x01,0x07,0x00,0x08,0x0a}, {0x2e,0x00,0x00,0x01,0x05,0x00,0x06,0x08}, {0x2f,0x00,0x00,0x01,0x05,0x00,0x06,0x06}, {0x30,0x00,0x00,0x01,0x07,0x00,0x08,0x0a}, {0x31,0x00,0x00,0x01,0x06,0x00,0x00,0x00}, {0x32,0x00,0x00,0x01,0x06,0x00,0x00,0x00}, {0x33,0x00,0x00,0x01,0x06,0x00,0x00,0x00}, {0x34,0x00,0x00,0x01,0x06,0x00,0x00,0x00}, {0x35,0x00,0x00,0x01,0x06,0x00,0x00,0x00}, {0x36,0x00,0x00,0x01,0x06,0x00,0x00,0x00}, {0x37,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c}, {0x38,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c}, {0x3a,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d}, {0x40,0x00,0x00,0x01,0x04,0x00,0x05,0x05}, {0x41,0x00,0x00,0x01,0x04,0x00,0x05,0x05}, {0x43,0x00,0x00,0x01,0x05,0x00,0x06,0x08}, {0x44,0x00,0x00,0x01,0x05,0x00,0x06,0x08}, {0x46,0x00,0x00,0x01,0x07,0x00,0x08,0x0a}, {0x47,0x00,0x00,0x01,0x07,0x00,0x08,0x0a}, {0x49,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c}, {0x4a,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c}, {0x4c,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d}, {0x4d,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d}, {0x4f,0x00,0x00,0x01,0x04,0x00,0x05,0x05}, {0x50,0x00,0x00,0x01,0x04,0x00,0x05,0x07}, {0x51,0x00,0x00,0x01,0x07,0x00,0x07,0x09}, {0x52,0x00,0x00,0x01,0x00,0x00,0x09,0x0b}, {0x53,0x00,0x00,0x01,0x04,0x00,0x05,0x07}, {0x54,0x00,0x00,0x01,0x07,0x00,0x07,0x09}, {0x56,0x00,0x00,0x01,0x04,0x00,0x05,0x07}, {0x57,0x00,0x00,0x01,0x07,0x00,0x07,0x09}, {0x58,0x00,0x00,0x01,0x00,0x00,0x09,0x0b}, {0x59,0x00,0x00,0x01,0x04,0x00,0x05,0x05}, {0x5c,0x00,0x00,0x01,0x00,0x00,0x09,0x0b}, {0x5d,0x00,0x00,0x01,0x05,0x00,0x06,0x06}, {0x5e,0x00,0x00,0x01,0x05,0x00,0x06,0x06}, {0x5f,0x00,0x00,0x01,0x06,0x00,0x00,0x00}, {0x60,0x00,0x00,0x01,0x06,0x00,0x00,0x00}, {0x61,0x00,0x00,0x01,0x06,0x00,0x00,0x00}, {0x62,0x00,0x00,0x01,0x05,0x00,0x06,0x08}, {0x63,0x00,0x00,0x01,0x07,0x00,0x08,0x0a}, {0x64,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c}, {0x65,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d}, {0x6c,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d}, {0x6d,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d}, {0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00} }; static const struct SiS_CRT1Table SiS300_CRT1Table[] = { {{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f, /* 0x00 - 320x200 */ 0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x00, /* HRE [4],[15] is invalid - but correcting it does not work */ 0x00}}, {{0x2d,0x27,0x28,0x90,0x2c,0x80,0x0b,0x3e, /* 0x01 */ 0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x00, /* HRE [4],[15] is invalid - but correcting it does not work */ 0x00}}, {{0x3d,0x31,0x31,0x81,0x37,0x1f,0x72,0xf0, /* 0x02 */ 0x58,0x8c,0x57,0x57,0x73,0x20,0x00,0x05, 0x01}}, {{0x4f,0x3f,0x3f,0x93,0x45,0x0d,0x24,0xf5, 0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x01, 0x01}}, {{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, 0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x05, 0x00}}, {{0x5f,0x4f,0x4f,0x83,0x55,0x81,0x0b,0x3e, /* 0x05 - corrected 640x480-60 */ 0xe9,0x8b,0xdf,0xe8,0x0c,0x00,0x00,0x05, 0x00}}, {{0x63,0x4f,0x4f,0x87,0x56,0x9b,0x06,0x3e, /* 0x06 - corrected 640x480-72 */ 0xe8,0x8a,0xdf,0xe7,0x07,0x00,0x00,0x01, 0x00}}, {{0x64,0x4f,0x4f,0x88,0x55,0x9d,0xf2,0x1f, 0xe0,0x83,0xdf,0xdf,0xf3,0x10,0x00,0x01, 0x00}}, {{0x63,0x4f,0x4f,0x87,0x5a,0x81,0xfb,0x1f, 0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05, 0x00}}, {{0x67,0x4f,0x4f,0x8b,0x57,0x83,0x10,0x3e, /* 0x09 - corrected 640x480-100 */ 0xe7,0x8d,0xdf,0xe6,0x11,0x00,0x00,0x05, 0x00}}, {{0x67,0x4f,0x4f,0x8b,0x57,0x83,0x10,0x3e, /* 0x0a - corrected 640x480-120 */ 0xe7,0x8d,0xdf,0xe6,0x11,0x00,0x00,0x05, 0x00}}, {{0x63,0x4f,0x4f,0x87,0x56,0x9d,0xfb,0x1f, 0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x01, 0x00}}, {{0x65,0x4f,0x4f,0x89,0x57,0x9f,0xfb,0x1f, 0xe6,0x8a,0xdf,0xdf,0xfc,0x10,0x00,0x01, /* Corrected VDE, VBE */ 0x00}}, {{0x7b,0x63,0x63,0x9f,0x6a,0x93,0x6f,0xf0, 0x58,0x8a,0x57,0x57,0x70,0x20,0x00,0x05, 0x01}}, {{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xf0, 0x58,0x8c,0x57,0x57,0x73,0x20,0x00,0x06, 0x01}}, {{0x7d,0x63,0x63,0x81,0x6e,0x1d,0x98,0xf0, 0x7c,0x82,0x57,0x57,0x99,0x00,0x00,0x06, 0x01}}, {{0x7f,0x63,0x63,0x83,0x69,0x13,0x6f,0xf0, 0x58,0x8b,0x57,0x57,0x70,0x20,0x00,0x06, 0x01}}, {{0x7e,0x63,0x63,0x82,0x6b,0x13,0x75,0xf0, 0x58,0x8b,0x57,0x57,0x76,0x20,0x00,0x06, 0x01}}, {{0x8c,0x63,0x63,0x87,0x72,0x16,0x7e,0xf0, 0x59,0x8d,0x57,0x57,0x7f,0x00,0x00,0x06, 0x01}}, {{0x7e,0x63,0x63,0x82,0x6c,0x14,0x75,0xe0, 0x58,0x0b,0x57,0x57,0x76,0x20,0x00,0x06, 0x01}}, {{0x7e,0x63,0x63,0x82,0x6c,0x14,0x75,0xe0, /* 0x14 */ 0x58,0x0b,0x57,0x57,0x76,0x20,0x00,0x06, 0x01}}, {{0x99,0x7f,0x7f,0x9d,0x84,0x1a,0x96,0x1f, 0x7f,0x83,0x7f,0x7f,0x97,0x10,0x00,0x02, 0x00}}, {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5, 0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02, 0x01}}, {{0xa1,0x7f,0x7f,0x85,0x86,0x97,0x24,0xf5, 0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02, 0x01}}, {{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf5, 0x00,0x83,0xff,0xff,0x1f,0x10,0x00,0x02, 0x01}}, {{0xa7,0x7f,0x7f,0x8b,0x89,0x95,0x26,0xf5, 0x00,0x83,0xff,0xff,0x27,0x10,0x00,0x02, 0x01}}, {{0x9f,0x7f,0x7f,0x83,0x83,0x93,0x1e,0xf5, /* 0x1a */ 0x00,0x84,0xff,0xff,0x1f,0x10,0x00,0x02, 0x01}}, {{0xa2,0x7f,0x7f,0x86,0x84,0x94,0x37,0xf5, 0x0b,0x82,0xff,0xff,0x38,0x10,0x00,0x02, 0x01}}, {{0xcf,0x9f,0x9f,0x93,0xb2,0x01,0x14,0xba, 0x00,0x83,0xff,0xff,0x15,0x00,0x00,0x03, 0x00}}, {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0x5a, 0x00,0x83,0xff,0xff,0x29,0x09,0x00,0x07, 0x01}}, {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0x5a, /* 0x1e */ 0x00,0x83,0xff,0xff,0x29,0x09,0x00,0x07, 0x01}}, {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0x5a, 0x00,0x83,0xff,0xff,0x2f,0x09,0x00,0x07, 0x01}}, {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, /* 36: 1600x1200x85Hz */ 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, {{0x3f,0xef,0xef,0x83,0xfd,0x1a,0xda,0x1f, /* 37: 1920x1440x60Hz */ 0xa0,0x84,0x9f,0x9f,0xdb,0x1f,0x01,0x01, 0x00}}, {{0x55,0xff,0xff,0x99,0x0d,0x0c,0x3e,0xba, 0x00,0x84,0xff,0xff,0x3f,0x0f,0x41,0x05, 0x00}}, {{0xdc,0x9f,0x9f,0x80,0xaf,0x9d,0xe6,0xff, /* 0x27: 1280x960-60 - correct */ 0xc0,0x83,0xbf,0xbf,0xe7,0x10,0x00,0x07, 0x01}}, {{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xba, /* 0x28 */ 0x27,0x8b,0xdf,0xdf,0x73,0x00,0x00,0x06, 0x01}}, {{0x7f,0x63,0x63,0x83,0x69,0x13,0x6f,0xba, 0x26,0x89,0xdf,0xdf,0x6f,0x00,0x00,0x06, 0x01}}, {{0x7f,0x63,0x63,0x82,0x6b,0x13,0x75,0xba, 0x29,0x8c,0xdf,0xdf,0x75,0x00,0x00,0x06, 0x01}}, {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf1, 0xaf,0x85,0x3f,0x3f,0x25,0x30,0x00,0x02, 0x01}}, {{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf1, 0xad,0x81,0x3f,0x3f,0x1f,0x30,0x00,0x02, 0x01}}, {{0xa7,0x7f,0x7f,0x88,0x89,0x15,0x26,0xf1, 0xb1,0x85,0x3f,0x3f,0x27,0x30,0x00,0x02, 0x01}}, {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xc4, 0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07, 0x01}}, {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0xd4, 0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07, 0x01}}, {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0xd4, 0x7d,0x81,0xcf,0xcf,0x2f,0x21,0x00,0x07, 0x01}}, {{0x6b,0x59,0x59,0x8f,0x5e,0x8c,0x0b,0x3e, 0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x05, 0x00}}, {{0x6d,0x59,0x59,0x91,0x60,0x89,0x53,0xf0, /* 0x32: 720x576, corrected to 60Hz */ 0x41,0x84,0x3f,0x3f,0x54,0x00,0x00,0x05, 0x41}}, {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x1e,0xf1, /* 0x33 - 1024x600 */ 0xae,0x85,0x57,0x57,0x1f,0x30,0x00,0x02, 0x01}}, {{0xa3,0x8f,0x8f,0x97,0x96,0x97,0x24,0xf5, /* 0x34 - 1152x768 - corrected */ 0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02, 0x01}}, {{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xba, /* 0x35 */ 0x27,0x8b,0xdf,0xdf,0x73,0x00,0x00,0x06, 0x01}}, /* 0x35 */ {{0x7f,0x63,0x63,0x83,0x69,0x13,0x6f,0xba, 0x26,0x89,0xdf,0xdf,0x6f,0x00,0x00,0x06, 0x01}}, /* 0x36 */ {{0x7f,0x63,0x63,0x82,0x6b,0x13,0x75,0xba, 0x29,0x8c,0xdf,0xdf,0x75,0x00,0x00,0x06, 0x01}}, /* 0x37 */ {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf1, 0xaf,0x85,0x3f,0x3f,0x25,0x30,0x00,0x02, 0x01}}, /* 0x38 */ {{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf1, 0xad,0x81,0x3f,0x3f,0x1f,0x30,0x00,0x02, 0x01}}, /* 0x39 */ {{0xa7,0x7f,0x7f,0x88,0x89,0x95,0x26,0xf1, /* 95 was 15 - illegal HBE! */ 0xb1,0x85,0x3f,0x3f,0x27,0x30,0x00,0x02, 0x01}}, /* 0x3a */ {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xc4, 0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07, 0x01}}, /* 0x3b */ {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0xd4, 0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07, 0x01}}, /* 0x3c */ {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0xd4, 0x7d,0x81,0xcf,0xcf,0x2f,0x21,0x00,0x07, 0x01}}, /* 0x3d */ {{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef, /* 1152x864-75 */ 0x60,0x83,0x5f,0x5f,0x83,0x10,0x00,0x07, 0x01}}, /* 0x3e */ {{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15, /* 848x480-38i */ 0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02, 0x00}}, /* 0x3f */ {{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E, /* 848x480-60 */ 0xE5,0x8d,0xDF,0xe4,0x04,0x00,0x00,0x06, 0x00}}, /* 0x40 */ {{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15, /* 856x480-38i */ 0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02, 0x00}}, /* 0x41 */ {{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E, /* 856x480-60 */ 0xEB,0x8E,0xDF,0xDF,0x10,0x00,0x00,0x02, 0x00}}, /* 0x42 */ {{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd, /* 1360x768-60 */ 0x01,0x8d,0xff,0x00,0x27,0x10,0x00,0x03, 0x01}}, /* 0x43 */ {{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff, /* 1152x864-84 */ 0x60,0x8b,0x5f,0x5f,0x8b,0x10,0x00,0x03, 0x01}}, /* 0x44 */ {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff, /* 1280x960-85 */ 0xc0,0x83,0xbf,0xbf,0xf2,0x10,0x00,0x07, 0x01}}, /* 0x45 */ {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x20,0xf5, /* 1280x768-60 */ 0x03,0x88,0xff,0xff,0x21,0x10,0x00,0x07, 0x01}}, /* 0x46 */ {{0x75,0x5f,0x5f,0x99,0x66,0x90,0x53,0xf0, /* 768x576, corrected to 60Hz */ 0x41,0x84,0x3f,0x3f,0x54,0x00,0x00,0x05, 0x41}}, /* 0x47 */ {{0xce,0xa9,0xa9,0x92,0xb1,0x07,0x28,0x52, /* 1360x1024 (Barco iQ Pro R300) */ 0x02,0x8e,0xff,0x00,0x29,0x0d,0x00,0x03, 0x00}}, /* 0x48 */ {{0xcd,0x8f,0x8f,0x91,0x9b,0x1b,0x7a,0xff, /* 1152x864-60 */ 0x64,0x8c,0x5f,0x62,0x7b,0x10,0x00,0x07, 0x41}}, /* 0x49 */ {{0x5c,0x4f,0x4f,0x80,0x57,0x80,0xa3,0x1f, /* fake 640x400@60Hz (for LCD and TV, not actually used) */ 0x98,0x8c,0x8f,0x96,0xa4,0x30,0x00,0x05, 0x40}}, /* 0x4a */ {{0x2c,0x27,0x27,0x90,0x2d,0x92,0xa4,0x1f, /* fake 320x200@60Hz (for LCD and TV, not actually used) */ 0x98,0x8c,0x8f,0x96,0xa5,0x30,0x00,0x04, 0x00}} /* 0x4b */ }; static const struct SiS_MCLKData SiS300_MCLKData_630[] = { { 0x5a,0x64,0x80, 66}, { 0xb3,0x45,0x80, 83}, { 0x37,0x61,0x80,100}, { 0x37,0x22,0x80,133}, { 0x37,0x61,0x80,100}, { 0x37,0x61,0x80,100}, { 0x37,0x61,0x80,100}, { 0x37,0x61,0x80,100} }; static const struct SiS_MCLKData SiS300_MCLKData_300[] = { { 0x68,0x43,0x80,125}, { 0x68,0x43,0x80,125}, { 0x68,0x43,0x80,125}, { 0x37,0x61,0x80,100}, { 0x37,0x61,0x80,100}, { 0x37,0x61,0x80,100}, { 0x37,0x61,0x80,100}, { 0x37,0x61,0x80,100} }; static struct SiS_VCLKData SiS300_VCLKData[] = { { 0x1b,0xe1, 25}, /* 0x00 */ { 0x4e,0xe4, 28}, /* 0x01 */ { 0x57,0xe4, 32}, /* 0x02 */ { 0xc3,0xc8, 36}, /* 0x03 */ { 0x42,0xc3, 40}, /* 0x04 */ { 0x5d,0xc4, 45}, /* 0x05 */ { 0x52,0x65, 50}, /* 0x06 */ { 0x53,0x65, 50}, /* 0x07 */ { 0x6d,0x66, 56}, /* 0x08 */ { 0x5a,0x64, 65}, /* 0x09 */ { 0x46,0x44, 68}, /* 0x0a */ { 0x3e,0x43, 75}, /* 0x0b */ { 0x6d,0x46, 76}, /* 0x0c */ /* 800x600 | LVDS_2(CH), MITAC(CH); - 730, A901(301B): 0xb1,0x46, 76 */ { 0x41,0x43, 79}, /* 0x0d */ { 0x31,0x42, 79}, /* 0x0e */ { 0x46,0x25, 85}, /* 0x0f */ { 0x78,0x29, 87}, /* 0x10 */ { 0x62,0x44, 95}, /* 0x11 */ { 0x2b,0x22,105}, /* 0x12 */ { 0x49,0x24,106}, /* 0x13 */ { 0xc3,0x28,108}, /* 0x14 */ { 0x3c,0x23,109}, /* 0x15 */ { 0xf7,0x2c,132}, /* 0x16 */ { 0xd4,0x28,136}, /* 0x17 */ { 0x41,0x05,158}, /* 0x18 */ { 0x43,0x05,162}, /* 0x19 */ { 0xe1,0x0f,175}, /* 0x1a */ { 0xfc,0x12,189}, /* 0x1b */ { 0xde,0x26,194}, /* 0x1c */ { 0x54,0x05,203}, /* 0x1d */ { 0x3f,0x03,230}, /* 0x1e */ { 0x30,0x02,234}, /* 0x1f */ { 0x24,0x01,266}, /* 0x20 */ { 0x52,0x2a, 54}, /* 0x21 */ /* 301 TV */ { 0x52,0x6a, 27}, /* 0x22 */ /* 301 TV */ { 0x62,0x24, 70}, /* 0x23 */ /* 301 TV */ { 0x62,0x64, 70}, /* 0x24 */ /* 301 TV */ { 0xa8,0x4c, 30}, /* 0x25 */ /* 301 TV */ { 0x20,0x26, 33}, /* 0x26 */ /* 301 TV */ { 0x31,0xc2, 39}, /* 0x27 */ { 0xbf,0xc8, 35}, /* 0x28 */ /* 856x480 */ { 0x60,0x36, 30}, /* 0x29 */ /* CH/UNTSC TEXT | LVDS_2(CH) - 730, A901(301B), Mitac(CH): 0xe0, 0xb6, 30 */ { 0x40,0x4a, 28}, /* 0x2a */ /* CH-TV */ { 0x9f,0x46, 44}, /* 0x2b */ /* CH-TV */ { 0x97,0x2c, 26}, /* 0x2c */ /* CH-TV */ { 0x44,0xe4, 25}, /* 0x2d */ /* CH-TV */ { 0x7e,0x32, 47}, /* 0x2e */ /* CH-TV */ { 0x8a,0x24, 31}, /* 0x2f */ /* CH/PAL TEXT | LVDS_2(CH), Mitac(CH) - 730, A901(301B): 0x57, 0xe4, 31 */ { 0x97,0x2c, 26}, /* 0x30 */ /* CH-TV */ { 0xce,0x3c, 39}, /* 0x31 */ /* CH-TV */ { 0x52,0x4a, 36}, /* 0x32 */ /* CH/PAL 800x600 5/6 */ { 0x34,0x61, 95}, /* 0x33 */ { 0x78,0x27,108}, /* 0x34 */ /* Replacement for index 0x14 for 630 (?) */ { 0x70,0x28, 90}, /* 0x35 */ /* 1152x864@60 */ { 0x45,0x6b, 21}, /* 0x36 */ /* Chrontel SuperOverscan */ { 0x52,0xe2, 49}, /* 0x37 */ /* 16:9 modes */ { 0x2b,0x61, 78}, /* 0x38 */ /* 16:9 modes */ { 0x70,0x44,108}, /* 0x39 */ /* 16:9 modes */ { 0x54,0x42,135}, /* 0x3a */ /* 16:9 modes */ { 0x41,0x22,157}, /* 0x3b */ /* 16:9 modes */ { 0x52,0x07,149}, /* 0x3c */ /* 1280x960-85 */ { 0x62,0xc6, 34}, /* 0x3d */ /* 848x480-60 */ { 0x30,0x23, 88}, /* 0x3e */ /* 1360x768-60 */ { 0x70,0x29, 81}, /* 0x3f */ /* 1280x768-60 */ { 0x72,0x2a, 76}, /* 0x40 */ /* test for SiS730 --- LIMIT for table (&0x3f) */ { 0x15,0x21, 79}, /* 0x41 */ /* test for SiS730 */ { 0xa1,0x42,108}, /* 0x42 */ /* 1280x960 LCD */ { 0x37,0x61,100}, /* 0x43 */ /* 1280x960 LCD */ { 0xe3,0x9a,106}, /* 0x44 */ /* 1360x1024 - special for Barco iQ R300 */ { 0xe2,0x46,135}, /* 0x45 */ /* 1280x1024-75, better clock for VGA2 */ { 0x70,0x29, 81}, /* 0x46 */ /* unused */ { 0, 0, 0}, /* 0x47 custom (will be filled out) */ { 0xce,0x25,189}, /* 0x48 */ /* Replacement for index 0x1b for 730 (and 540?) */ { 0x15,0xe1, 20}, /* 0x49 */ /* 640x400@60 (fake, not actually used) */ { 0x5f,0xc6, 33}, /* 0x4a */ /* 720x576@60 */ { 0x37,0x5a, 10}, /* 0x4b */ /* 320x200@60 (fake, not actually used) */ { 0x2b,0xc2, 35} /* 0x4c */ /* 768@576@60 */ }; static const unsigned char SiS300_SR15[4 * 8] = { 0x01,0x09,0xa3,0x00, 0x43,0x43,0x43,0x00, 0x1e,0x1e,0x1e,0x00, 0x2a,0x2a,0x2a,0x00, 0x06,0x06,0x06,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }; static const struct SiS_PanelDelayTbl SiS300_PanelDelayTbl[] = { {{0x05,0xaa}}, {{0x05,0x14}}, {{0x05,0x36}}, {{0x05,0x14}}, {{0x05,0x14}}, {{0x05,0x14}}, {{0x05,0x90}}, {{0x05,0x90}}, {{0x05,0x14}}, {{0x05,0x14}}, {{0x05,0x14}}, {{0x05,0x14}}, {{0x20,0x80}}, {{0x05,0x14}}, {{0x05,0x40}}, {{0x05,0x60}} }; /**************************************************************/ /* SIS VIDEO BRIDGE ----------------------------------------- */ /**************************************************************/ static const struct SiS_LCDData SiS300_St2LCD1024x768Data[] = { { 62, 25, 800, 546,1344, 806}, { 32, 15, 930, 546,1344, 806}, { 32, 15, 930, 546,1344, 806}, { 104, 45, 945, 496,1344, 806}, { 62, 25, 800, 546,1344, 806}, { 31, 18,1008, 624,1344, 806}, { 1, 1,1344, 806,1344, 806} }; static const struct SiS_LCDData SiS300_ExtLCD1024x768Data[] = { { 12, 5, 896, 512,1344, 806}, { 12, 5, 896, 510,1344, 806}, { 32, 15,1008, 505,1344, 806}, { 32, 15,1008, 514,1344, 806}, { 12, 5, 896, 500,1344, 806}, { 42, 25,1024, 625,1344, 806}, { 1, 1,1344, 806,1344, 806}, { 12, 5, 896, 500,1344, 806}, { 42, 25,1024, 625,1344, 806}, { 1, 1,1344, 806,1344, 806}, { 12, 5, 896, 500,1344, 806}, { 42, 25,1024, 625,1344, 806}, { 1, 1,1344, 806,1344, 806} }; static const struct SiS_LCDData SiS300_St2LCD1280x1024Data[] = { { 22, 5, 800, 510,1650,1088}, { 22, 5, 800, 510,1650,1088}, { 176, 45, 900, 510,1650,1088}, { 176, 45, 900, 510,1650,1088}, { 22, 5, 800, 510,1650,1088}, { 13, 5,1024, 675,1560,1152}, { 16, 9,1266, 804,1688,1072}, { 1, 1,1688,1066,1688,1066} }; static const struct SiS_LCDData SiS300_ExtLCD1280x1024Data[] = { { 211, 60,1024, 501,1688,1066}, { 211, 60,1024, 508,1688,1066}, { 211, 60,1024, 501,1688,1066}, { 211, 60,1024, 508,1688,1066}, { 211, 60,1024, 500,1688,1066}, { 211, 75,1024, 625,1688,1066}, { 211, 120,1280, 798,1688,1066}, { 1, 1,1688,1066,1688,1066} }; static const struct SiS_Part2PortTbl SiS300_CRT2Part2_1024x768_1[] = { /* VESA Timing */ {{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}}, {{0x2c,0x12,0x9a,0xae,0x88,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}}, {{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}}, {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}}, {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}} }; static const struct SiS_Part2PortTbl SiS300_CRT2Part2_1024x768_2[] = { /* Non-VESA */ {{0x28,0x12,0xa3,0xd0,0xaa,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}, {{0x2c,0x12,0x9a,0xae,0x88,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}, {{0x28,0x12,0xa3,0xd0,0xaa,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}, {{0x2c,0x12,0x9a,0xae,0x88,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}, {{0x28,0x13,0xe7,0x0b,0xe8,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}, {{0x38,0x18,0x16,0x00,0x00,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}, {{0x36,0x13,0x13,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}} }; static const struct SiS_Part2PortTbl SiS300_CRT2Part2_1024x768_3[] = { {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} }; /**************************************************************/ /* LVDS/Chrontel -------------------------------------------- */ /**************************************************************/ /* Custom data for Barco iQ R series */ static const struct SiS_LVDSData SiS300_LVDSBARCO1366Data_1[]= { { 832, 438,1331, 806}, { 832, 388,1331, 806}, { 832, 438,1331, 806}, { 832, 388,1331, 806}, { 832, 518,1331, 806}, {1050, 638,1344, 806}, {1344, 806,1344, 806}, {1688,1066,1688,1066}, {1688,1066,1688,1066} /* 1360x1024 */ }; /* Custom data for Barco iQ R series */ static const struct SiS_LVDSData SiS300_LVDSBARCO1366Data_2[]= { {1344, 806,1344, 806}, {1344, 806,1344, 806}, {1344, 806,1344, 806}, {1344, 806,1344, 806}, {1344, 806,1344, 806}, {1344, 806,1344, 806}, {1344, 806,1344, 806}, {1688,1066,1688,1066}, {1688,1066,1688,1066} /* 1360x1024 */ }; /* Custom data for Barco iQ G series */ static const struct SiS_LVDSData SiS300_LVDSBARCO1024Data_1[]= { { 832, 438,1331, 806}, { 832, 409,1331, 806}, { 832, 438,1331, 806}, { 832, 409,1331, 806}, { 832, 518,1331, 806}, /* 640x480 */ {1050, 638,1344, 806}, /* 800x600 */ {1344, 806,1344, 806}, /* 1024x768 */ }; /* Custom data for 848x480 and 856x480 parallel LVDS panels */ static const struct SiS_LVDSData SiS300_LVDS848x480Data_1[]= { { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, {1088, 525,1088, 525}, /* 640x480 TODO */ {1088, 525,1088, 525}, /* 800x600 TODO */ {1088, 525,1088, 525}, /* 1024x768 TODO */ { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, {1088, 525,1088, 525}, /* 848x480 */ {1088, 525,1088, 525}, /* 856x480 */ {1088, 525,1088, 525} /* 1360x768 TODO */ }; /* Custom data for 848x480 parallel panel */ static const struct SiS_LVDSData SiS300_LVDS848x480Data_2[]= { { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, {1088, 525,1088, 525}, /* 640x480 */ {1088, 525,1088, 525}, /* 800x600 */ {1088, 525,1088, 525}, /* 1024x768 */ { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, {1088, 525,1088, 525}, /* 848x480 */ {1088, 525,1088, 525}, /* 856x480 */ {1088, 525,1088, 525} /* 1360x768 TODO */ }; static const struct SiS_LVDSData SiS300_CHTVUPALData[] = { {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, { 840, 750, 840, 750}, { 936, 836, 936, 836} }; static const struct SiS_LVDSData SiS300_CHTVOPALData[] = { {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, { 840, 625, 840, 625}, { 960, 750, 960, 750} }; static const struct SiS_LVDSData SiS300_CHTVSOPALData[] = { {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, { 840, 500, 840, 500}, { 944, 625, 944, 625} }; /* Custom des data for Barco iQ R200/300/400 (BIOS 2.00.07) */ static const struct SiS_LVDSDes SiS300_PanelType04_1a[] = /* 1280x1024 (1366x1024) */ { {1330, 798}, /* 320x200 */ {1330, 794}, {1330, 798}, {1330, 794}, {1330, 0}, /* 640x480 / 320x240 */ {1343, 0}, /* 800x600 / 400x300 */ { 0, 805}, /* 1024x768 / 512x384 */ {1688,1066}, /* 1280x1024 */ { 0, 0} /* 1360x1024 */ }; static const struct SiS_LVDSDes SiS300_PanelType04_2a[] = { {1152, 622}, {1152, 597}, {1152, 622}, {1152, 597}, {1152, 662}, {1232, 722}, { 0, 805}, {1688,1066}, { 0, 0} }; /* Custom des data for Barco iQ G200/300/400 (BIOS 2.00.07) */ static const struct SiS_LVDSDes SiS300_PanelType04_1b[] = /* 1024x768 */ { {1330, 798}, /* 320x200 */ {1330, 794}, {1330, 798}, {1330, 794}, {1330, 0}, /* 640x480 / 320x240 */ {1343, 0}, /* 800x600 / 400x300 */ { 0, 805} /* 1024x768 / 512x384 */ }; static const struct SiS_LVDSDes SiS300_PanelType04_2b[] = { {1152, 622}, {1152, 597}, {1152, 622}, {1152, 597}, {1152, 662}, {1232, 722}, { 0, 805} }; /* CRT1 CRTC for slave modes */ static const struct SiS_LVDSCRT1Data SiS300_CHTVCRT1UNTSC[] = { {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e, 0xe8,0x84,0x8f,0x57,0x20,0x00,0x01, 0x00 }}, {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e, 0xd0,0x82,0x5d,0x57,0x00,0x00,0x01, 0x00 }}, {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e, 0xe8,0x84,0x8f,0x57,0x20,0x00,0x01, 0x00 }}, {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e, 0xd0,0x82,0x5d,0x57,0x00,0x00,0x01, 0x00 }}, {{0x5d,0x4f,0x81,0x53,0x9c,0x56,0xba, 0x18,0x84,0xdf,0x57,0x00,0x00,0x01, 0x00 }}, {{0x80,0x63,0x84,0x6c,0x17,0xec,0xf0, 0x90,0x8c,0x57,0xed,0x20,0x00,0x06, 0x01 }} }; static const struct SiS_LVDSCRT1Data SiS300_CHTVCRT1ONTSC[] = { {{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e, 0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01, 0x00 }}, {{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e, 0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01, 0x00 }}, {{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e, 0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01, 0x00 }}, {{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e, 0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01, 0x00 }}, {{0x5d,0x4f,0x81,0x56,0x9c,0x0b,0x3e, 0xe8,0x84,0xdf,0x0c,0x00,0x00,0x01, 0x00 }}, {{0x7d,0x63,0x81,0x6a,0x16,0xba,0xf0, 0x7f,0x86,0x57,0xbb,0x00,0x00,0x06, 0x01 }} }; static const struct SiS_LVDSCRT1Data SiS300_CHTVCRT1UPAL[] = { {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf8,0x83,0x8f,0x70,0x20,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xde,0x81,0x5d,0x70,0x00,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf8,0x83,0x8f,0x70,0x20,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xde,0x81,0x5d,0x70,0x00,0x00,0x05, 0x00 }}, {{0x64,0x4f,0x88,0x55,0x80,0xec,0xba, 0x50,0x84,0xdf,0xed,0x00,0x00,0x05, 0x00 }}, {{0x70,0x63,0x94,0x68,0x8d,0x42,0xf1, 0xc8,0x8c,0x57,0xe9,0x20,0x00,0x05, 0x01 }} }; static const struct SiS_LVDSCRT1Data SiS300_CHTVCRT1OPAL[] = { {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf0,0x83,0x8f,0x70,0x20,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xde,0x81,0x5d,0x70,0x00,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf0,0x83,0x8f,0x70,0x20,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xde,0x81,0x5d,0x70,0x00,0x00,0x05, 0x00 }}, {{0x64,0x4f,0x88,0x55,0x80,0x6f,0xba, 0x20,0x83,0xdf,0x70,0x00,0x00,0x05, 0x00 }}, {{0x73,0x63,0x97,0x69,0x8e,0xec,0xf0, 0x90,0x8c,0x57,0xed,0x20,0x00,0x05, 0x01 }} }; static const struct SiS_LVDSCRT1Data SiS300_CHTVCRT1SOPAL[] = { {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf0,0x83,0x8f,0x70,0x20,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xde,0x81,0x5d,0x70,0x00,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf0,0x83,0x8f,0x70,0x20,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xde,0x81,0x5d,0x70,0x00,0x00,0x05, 0x00 }}, {{0x64,0x4f,0x88,0x55,0x80,0x6f,0xba, /* TODO */ 0x20,0x83,0xdf,0x70,0x00,0x00,0x05, 0x00 }}, {{0x73,0x63,0x97,0x69,0x8e,0xec,0xf0, /* TODO */ 0x90,0x8c,0x57,0xed,0x20,0x00,0x05, 0x01 }} }; static const struct SiS_CHTVRegData SiS300_CHTVReg_UNTSC[] = { {{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}}, {{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}}, {{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}}, {{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}}, {{0x6a,0x6a,0x00,0x2d,0xfa,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 17: 640x480 NTSC 7/8 */ {{0x8d,0xc4,0x00,0x3b,0xfb,0,0,0,0,0,0,0,0,0,0,0}} /* Mode 24: 800x600 NTSC 7/10 */ }; static const struct SiS_CHTVRegData SiS300_CHTVReg_ONTSC[] = { {{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}}, {{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}}, {{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}}, {{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}}, {{0x69,0x6a,0x00,0x1e,0xfd,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 16: 640x480 NTSC 1/1 */ {{0x8c,0xb4,0x00,0x32,0xf9,0,0,0,0,0,0,0,0,0,0,0}} /* Mode 23: 800x600 NTSC 3/4 */ }; static const struct SiS_CHTVRegData SiS300_CHTVReg_UPAL[] = { {{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, {{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}}, {{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, {{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}}, {{0x63,0x94,0x01,0x50,0x30,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 15: 640x480 PAL 5/6 */ {{0x84,0x64,0x01,0x4e,0x2f,0,0,0,0,0,0,0,0,0,0,0}} /* Mode 21: 800x600 PAL 3/4 */ }; static const struct SiS_CHTVRegData SiS300_CHTVReg_OPAL[] = { {{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 9: 640x400 PAL 1/1 */ {{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}}, {{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, {{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}}, {{0x61,0x94,0x01,0x36,0x30,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 14: 640x480 PAL 1/1 */ {{0x83,0x76,0x01,0x40,0x31,0,0,0,0,0,0,0,0,0,0,0}} /* Mode 20: 800x600 PAL 5/6 */ }; static const struct SiS_CHTVRegData SiS300_CHTVReg_SOPAL[] = { {{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 9: 640x400 PAL 1/1 */ {{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}}, {{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, {{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}}, {{0x60,0x30,0x00,0x10,0x00,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 13: 640x480 PAL 5/4 */ {{0x81,0x50,0x00,0x1b,0x00,0,0,0,0,0,0,0,0,0,0,0}} /* Mode 19: 800x600 PAL 1/1 */ }; static const unsigned char SiS300_CHTVVCLKUNTSC[] = { 0x29,0x29,0x29,0x29,0x2a,0x2e }; static const unsigned char SiS300_CHTVVCLKONTSC[] = { 0x2c,0x2c,0x2c,0x2c,0x2d,0x2b }; static const unsigned char SiS300_CHTVVCLKSONTSC[] = { 0x2c,0x2c,0x2c,0x2c,0x2d,0x2b }; static const unsigned char SiS300_CHTVVCLKUPAL[] = { 0x2f,0x2f,0x2f,0x2f,0x2f,0x31 }; static const unsigned char SiS300_CHTVVCLKOPAL[] = { 0x2f,0x2f,0x2f,0x2f,0x30,0x32 }; static const unsigned char SiS300_CHTVVCLKSOPAL[] = { 0x2f,0x2f,0x2f,0x2f,0x36,0x29 }; xf86-video-sis-0.10.7/src/sis.h0000664000076400007640000016601612001173034012764 00000000000000/* * Main global data and definitions * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Authors: Thomas Winischhofer * others (old code base) * */ #ifndef _SIS_H_ #define _SIS_H_ #include #include #include #include #include #include #include #include #define SISDRIVERVERSIONYEAR 5 #define SISDRIVERVERSIONMONTH 9 #define SISDRIVERVERSIONDAY 20 #define SISDRIVERREVISION 1 #define SISDRIVERIVERSION ((SISDRIVERVERSIONYEAR << 16) | \ (SISDRIVERVERSIONMONTH << 8) | \ SISDRIVERVERSIONDAY | \ (SISDRIVERREVISION << 24)) #undef SIS_LINUX /* Try to find out whether platform is Linux */ #if defined(__GNUC__) && (__GNUC__ >= 4) #ifdef __linux__ #define SIS_LINUX #endif #else #ifdef linux #define SIS_LINUX #endif #endif #if 0 #define TWDEBUG /* for debugging */ #endif #undef SIS_CP #if 0 #include "siscp.H" #endif #include "compiler.h" #include "xf86Pci.h" #include "xf86Priv.h" #include "xf86_OSproc.h" #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86Resources.h" #endif #include "xf86.h" #include "xf86Cursor.h" #include "xf86cmap.h" #include "vbe.h" #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12 #define _swapl(x, n) swapl(x,n) #define _swaps(x, n) swaps(x,n) #else #define _swapl(x, n) swapl(x) #define _swaps(x, n) swaps(x) #endif #define SIS_HaveDriverFuncs 0 #undef SISISXORG6899900 #ifdef XORG_VERSION_CURRENT #include "xorgVersion.h" #define SISMYSERVERNAME "X.org" #ifndef XF86_VERSION_NUMERIC #define XF86_VERSION_NUMERIC(major,minor,patch,snap,dummy) \ (((major) * 10000000) + ((minor) * 100000) + ((patch) * 1000) + snap) #define XF86_VERSION_CURRENT XF86_VERSION_NUMERIC(4,3,99,902,0) #endif #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(6,8,99,900,0) || XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(4,0,0,0,0) #define SISISXORG6899900 #endif #if 0 #ifdef HaveDriverFuncs #define SIS_HAVE_DRIVER_FUNC #undef SIS_HaveDriverFuncs #define SIS_HaveDriverFuncs HaveDriverFuncs #endif #endif #else #include "xf86Version.h" #define SISMYSERVERNAME "XFree86" #endif #define SIS_NAME "SIS" #define SIS_DRIVER_NAME "sis" #define SIS_MAJOR_VERSION PACKAGE_VERSION_MAJOR #ifdef SISISXORG6899900 #define SIS_MINOR_VERSION PACKAGE_VERSION_MINOR /* DRI changes */ #define SIS_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL #else #define SIS_MINOR_VERSION 7 #define SIS_PATCHLEVEL 1 #endif #define SIS_CURRENT_VERSION ((SIS_MAJOR_VERSION << 16) | \ (SIS_MINOR_VERSION << 8) | SIS_PATCHLEVEL ) #if (XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,99,0,0)) || (defined(XvExtension)) #include "xf86xv.h" #include #endif /* Platform/architecture related definitions: */ /* SIS_PC_PLATFORM: Map VGA memory at a0000 and save/restore fonts? */ /* List of architectures likely to be incomplete */ #define SIS_PC_PLATFORM #if defined(__powerpc__) || defined(__mips__) || defined(__arm32__) #undef SIS_PC_PLATFORM #endif /* SIS_USE_BIOS_SCRATCH: Save/restore mode number in BIOS scratch area? */ #undef SIS_USE_BIOS_SCRATCH #if defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__) || defined(__amd64__) || defined(__x86_64__) #define SIS_USE_BIOS_SCRATCH #endif /* SIS_NEED_MAP_IOP: Map i/o port area to virtual memory? */ /* List of architectures likely to be incomplete */ /* This is BROKEN, see comment in sis_driver.c */ #undef SIS_NEED_MAP_IOP #if 0 #if defined(__arm32__) || defined(__mips__) #define SIS_NEED_MAP_IOP #endif #endif /* SISUSEDEVPORT: Used on architectures without direct inX/outX access. In this case, * we use read()/write() to /dev/port. LINUX ONLY! (How can this be done on *BSD?) */ #undef SISUSEDEVPORT #if defined(SIS_LINUX) && (defined(__arm32__) || defined(__mips__)) #ifndef SIS_NEED_MAP_IOP #define SISUSEDEVPORT #endif #endif /* Our #includes: Require the arch/platform dependent #defines above */ #include "osdef.h" #include "vgatypes.h" #include "vstruct.h" #undef SISHAVEDRMWRITE #undef SISNEWDRI /* if the server was built without DRI support, force-disable DRI */ #ifndef XF86DRI #undef SISDRI #endif #ifdef SISDRI #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,2,99,3,0) #define SISHAVEDRMWRITE #endif #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,99,14,0) #define SISNEWDRI #endif #undef SIS315DRI /* define this if dri is adapted for 315/330 series */ #include "xf86drm.h" #include "sarea.h" #define _XF86DRI_SERVER_ #include "dri.h" #include "GL/glxint.h" #include "sis_dri.h" #endif /* SISDRI */ /* Configurable stuff: ------------------------------------- */ #define SISDUALHEAD /* Include Dual Head code */ #define SISMERGED /* Include Merged-FB code */ #undef SISXINERAMA #ifdef SISMERGED #define SISXINERAMA /* Include SiS Pseudo-Xinerama for MergedFB mode */ #define SIS_XINERAMA_MAJOR_VERSION 1 #define SIS_XINERAMA_MINOR_VERSION 1 #endif #define SIS_ARGB_CURSOR /* Include code for color hardware cursors */ #define ENABLE_YPBPR /* Include YPbPr support on SiS bridges (315 series and 661/741/760) */ #define SISVRAMQ /* Use VRAM queue mode on 315/330/340/XGI series */ #undef INCL_YUV_BLIT_ADAPTOR #ifdef SISVRAMQ #define INCL_YUV_BLIT_ADAPTOR /* Include support for YUV->RGB blit adaptors (VRAM queue mode only) */ #endif #ifdef HAVE_XAA_H #define SIS_USE_XAA /* Include code for XAA */ #endif #ifdef SISVRAMQ #ifdef XORG_VERSION_CURRENT #if defined(SIS_HAVE_EXA) || (defined(XF86EXA) && (XF86EXA != 0)) #if 1 #define SIS_USE_EXA /* Include code for EXA */ #endif #endif #endif #endif #if 0 #define SISDEINT /* Include Xv deinterlacer code (not functional yet!) */ #endif #if 0 #define XV_SD_DEPRECATED /* Include deprecated XV SD interface for SiSCtrl */ #endif /* End of configurable stuff --------------------------------- */ #define UNLOCK_ALWAYS /* Always unlock the registers (should be set!) */ #if !defined(SIS_USE_XAA) && !defined(SIS_USE_EXA) #define SIS_USE_XAA #endif #ifdef SIS_USE_XAA #include "xaa.h" #endif #ifdef SIS_USE_EXA #include "exa.h" #endif /* Need that for SiSCtrl and Pseudo-Xinerama */ #define EXTENSION_PROC_ARGS void * #include "extnsionst.h" /* required */ #include /* required */ #include "compat-api.h" #undef SISCHECKOSSSE #ifdef XORG_VERSION_CURRENT #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(6,8,99,13,0) #define SISCHECKOSSSE /* Automatic check OS for SSE; requires SigIll facility */ #endif #endif #undef SISGAMMARAMP #ifdef XORG_VERSION_CURRENT #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(6,8,99,13,0) #define SISGAMMARAMP /* Driver can set gamma ramp; requires additional symbols in xf86sym.h */ #endif #endif #if 0 /* Perhaps for future use */ #if 1 #define SIS_PCI_BUS(a) (a)->bus #define SIS_PCI_DEVICE(a) (a)->device #define SIS_PCI_FUNC(a) (a)->func #define SIS_PCI_TAG(a) pciTag((a)->bus, (a)->device, (a)->func); #else #define SIS_PCI_BUS(a) (a)->pciid.bus #define SIS_PCI_DEVICE(a) (a)->pciid.device #define SIS_PCI_FUNC(a) (a)->pciid.func #define SIS_PCI_TAG(a) pciTag(&((a)->pciid)); #endif #endif #ifdef TWDEBUG #define SISVERBLEVEL 3 #else #define SISVERBLEVEL 4 #endif #ifndef _XF86_PCIINFO_H #define PCI_VENDOR_SIS 0x1039 /* SiS */ #define PCI_CHIP_SG86C201 0x0001 #define PCI_CHIP_SG86C202 0x0002 #define PCI_CHIP_SG85C503 0x0008 #define PCI_CHIP_SIS5597 0x0200 /* Agregado por Carlos Duclos & Manuel Jander */ #define PCI_CHIP_SIS82C204 0x0204 #define PCI_CHIP_SG86C205 0x0205 #define PCI_CHIP_SG86C215 0x0215 #define PCI_CHIP_SG86C225 0x0225 #define PCI_CHIP_85C501 0x0406 #define PCI_CHIP_85C496 0x0496 #define PCI_CHIP_85C601 0x0601 #define PCI_CHIP_85C5107 0x5107 #define PCI_CHIP_85C5511 0x5511 #define PCI_CHIP_85C5513 0x5513 #define PCI_CHIP_SIS5571 0x5571 #define PCI_CHIP_SIS5597_2 0x5597 #define PCI_CHIP_SIS530 0x6306 #define PCI_CHIP_SIS6326 0x6326 #define PCI_CHIP_SIS7001 0x7001 #define PCI_CHIP_SIS300 0x0300 #define PCI_CHIP_SIS315H 0x0310 #define PCI_CHIP_SIS315PRO 0x0325 #define PCI_CHIP_SIS330 0x0330 #define PCI_CHIP_SIS630 0x6300 #define PCI_CHIP_SIS540 0x5300 #define PCI_CHIP_SIS550 0x5315 #define PCI_CHIP_SIS650 0x6325 #define PCI_CHIP_SIS730 0x7300 #endif /* For SiS315/550/650/740/330/660 - these should be moved elsewhere! */ #ifndef PCI_CHIP_SIS315H #define PCI_CHIP_SIS315H 0x0310 #endif #ifndef PCI_CHIP_SIS315 #define PCI_CHIP_SIS315 0x0315 #endif #ifndef PCI_CHIP_SIS315PRO #define PCI_CHIP_SIS315PRO 0x0325 #endif #ifndef PCI_CHIP_SIS550 #define PCI_CHIP_SIS550 0x5315 /* 550_VGA */ #endif #ifndef PCI_CHIP_SIS650 #define PCI_CHIP_SIS650 0x6325 /* 650_VGA and 740_VGA */ #endif #ifndef PCI_CHIP_SIS330 #define PCI_CHIP_SIS330 0x0330 #endif #ifndef PCI_CHIP_SIS660 #define PCI_CHIP_SIS660 0x6330 /* 661_VGA, 741_VGA, 760_VGA, 761_VGA */ #endif #ifndef PCI_CHIP_SIS340 #define PCI_CHIP_SIS340 0x0340 #endif #ifndef PCI_VENDOR_XGI #define PCI_VENDOR_XGI 0x18ca #endif #ifndef PCI_CHIP_XGIXG20 #define PCI_CHIP_XGIXG20 0x0020 #endif #ifndef PCI_CHIP_XGIXG40 #define PCI_CHIP_XGIXG40 0x0040 #endif /* pSiS->Flags (old series only) */ #define SYNCDRAM 0x00000001 #define RAMFLAG 0x00000002 #define ESS137xPRESENT 0x00000004 #define SECRETFLAG 0x00000008 #define A6326REVAB 0x00000010 #define MMIOMODE 0x00010000 #define LFBQMODE 0x00020000 #define AGPQMODE 0x00040000 #define UMA 0x80000000 #define BIOS_BASE 0xC0000 #define BIOS_SIZE 0x10000 #define SIS_VBFlagsVersion 1 /* pSiS->VBFlags - if anything is changed here, increase VBFlagsVersion! */ #define CRT2_DEFAULT 0x00000001 #define CRT2_LCD 0x00000002 /* Never change the order of the CRT2_XXX entries */ #define CRT2_TV 0x00000004 #define CRT2_VGA 0x00000008 #define TV_NTSC 0x00000010 #define TV_PAL 0x00000020 #define TV_HIVISION 0x00000040 #define TV_YPBPR 0x00000080 #define TV_AVIDEO 0x00000100 #define TV_SVIDEO 0x00000200 #define TV_SCART 0x00000400 #define OLDVB_CONEXANT 0x00000800 /* Definition deprecated (now VBFlags2) */ #define OLDVB_TRUMPION OLDVB_CONEXANT /* Definition deprecated (now VBFlags2) */ #define TV_PALM 0x00001000 #define TV_PALN 0x00002000 #define TV_NTSCJ TV_PALM #define OLDVB_302ELV 0x00004000 /* Definition deprecated (now VBFlags2) */ #define TV_CHSCART 0x00008000 #define TV_CHYPBPR525I 0x00010000 #define CRT1_VGA 0x00000000 /* ZERO - no mask! */ #define CRT1_LCDA 0x00020000 #define VGA2_CONNECTED 0x00040000 #define DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */ #define TV_YPBPR625I 0x00100000 #define TV_YPBPR625P 0x00200000 #define OLDVB_302B 0x00400000 /* Definition deprecated (now VBFlags2) */ #define OLDVB_30xBDH 0x00800000 /* Definition deprecated (now VBFlags2) */ #define OLDVB_LVDS 0x01000000 /* Definition deprecated (now VBFlags2) */ #define OLDVB_CHRONTEL 0x02000000 /* Definition deprecated (now VBFlags2) */ #define OLDVB_301LV 0x04000000 /* Definition deprecated (now VBFlags2) */ #define OLDVB_302LV 0x08000000 /* Definition deprecated (now VBFlags2) */ #define OLDVB_301C 0x10000000 /* Definition deprecated (now VBFlags2) */ #define SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */ #define MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */ #define DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */ /* Aliases: */ #define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA) #define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ) #define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR) /* Only if TV_YPBPR is set: */ #define TV_YPBPR525I TV_NTSC #define TV_YPBPR525P TV_PAL #define TV_YPBPR750P TV_PALM #define TV_YPBPR1080I TV_PALN #define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | \ TV_YPBPR625I | TV_YPBPR625P | \ TV_YPBPR750P | TV_YPBPR1080I) #define TV_YPBPR43LB TV_CHSCART #define TV_YPBPR43 TV_CHYPBPR525I #define TV_YPBPR169 (TV_CHSCART | TV_CHYPBPR525I) #define TV_YPBPRAR (TV_CHSCART | TV_CHYPBPR525I) #define DISPTYPE_DISP2 CRT2_ENABLE #define DISPTYPE_DISP1 DISPTYPE_CRT1 #define VB_DISPMODE_SINGLE SINGLE_MODE /* alias */ #define VB_DISPMODE_MIRROR MIRROR_MODE /* alias */ #define VB_DISPMODE_DUAL DUALVIEW_MODE /* alias */ #define DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE) /* pSiS->VBFlags2 (static stuff only!) */ #define VB2_SISUMC 0x00000001 #define VB2_301 0x00000002 /* Video bridge type */ #define VB2_301B 0x00000004 #define VB2_301C 0x00000008 #define VB2_307T 0x00000010 #define VB2_302B 0x00000800 #define VB2_301LV 0x00001000 #define VB2_302LV 0x00002000 #define VB2_302ELV 0x00004000 #define VB2_307LV 0x00008000 #define VB2_30xBDH 0x08000000 /* 30xB DH version (w/o LCD support) */ #define VB2_CONEXANT 0x10000000 /* >=661 series only */ #define VB2_TRUMPION 0x20000000 /* 300 series only */ #define VB2_LVDS 0x40000000 #define VB2_CHRONTEL 0x80000000 #define VB2_SISLVDSBRIDGE (VB2_301LV | VB2_302LV | VB2_302ELV | VB2_307LV) #define VB2_SISTMDSBRIDGE (VB2_301 | VB2_301B | VB2_301C | VB2_302B | VB2_307T) #define VB2_SISBRIDGE (VB2_SISLVDSBRIDGE | VB2_SISTMDSBRIDGE) #define VB2_SISTMDSLCDABRIDGE (VB2_301C | VB2_307T) #define VB2_SISLCDABRIDGE (VB2_SISTMDSLCDABRIDGE | VB2_301LV | VB2_302LV | VB2_302ELV | VB2_307LV) #define VB2_SISHIVISIONBRIDGE (VB2_301 | VB2_301B | VB2_302B) #define VB2_SISYPBPRBRIDGE (VB2_301C | VB2_307T | VB2_SISLVDSBRIDGE) #define VB2_SISYPBPRARBRIDGE (VB2_301C | VB2_307T | VB2_307LV) #define VB2_SISTAP4SCALER (VB2_301C | VB2_307T | VB2_302ELV | VB2_307LV) #define VB2_SISTVBRIDGE (VB2_SISHIVISIONBRIDGE | VB2_SISYPBPRBRIDGE) #define VB2_SISVGA2BRIDGE (VB2_301 | VB2_301B | VB2_301C | VB2_302B | VB2_307T) #define VB2_VIDEOBRIDGE (VB2_SISBRIDGE | VB2_LVDS | VB2_CHRONTEL | VB2_CONEXANT) #define VB2_30xB (VB2_301B | VB2_301C | VB2_302B | VB2_307T) #define VB2_30xBLV (VB2_30xB | VB2_SISLVDSBRIDGE) #define VB2_30xC (VB2_301C | VB2_307T) #define VB2_30xCLV (VB2_301C | VB2_307T | VB2_302ELV| VB2_307LV) #define VB2_SISEMIBRIDGE (VB2_302LV | VB2_302ELV | VB2_307LV) #define VB2_LCD162MHZBRIDGE (VB2_301C | VB2_307T) /* CRT2/LCD over 1280 (overflow bits in Part4) */ #define VB2_LCDOVER1280BRIDGE (VB2_301C | VB2_307T | VB2_302LV | VB2_302ELV | VB2_307LV) /* CRT2/LCD over 1600? Is this really gonna happen, or will there be LCDA only for large panels? */ #define VB2_LCDOVER1600BRIDGE (VB2_307T | VB2_307LV) /* VGA2 up to 202MHz (1600x1200@75) */ #define VB2_RAMDAC202MHZBRIDGE (VB2_301C | VB2_307T) /* pSiS->VBFlags3 (for future use) */ #define VB3_CRT1_TV 0x00000001 #define VB3_CRT1_LCD 0x00000002 #define VB3_CRT1_VGA 0x00000004 #define TV1_AVIDEO 0x00000100 #define TV1_SVIDEO 0x00000200 #define TV1_SCART 0x00000400 #define TV1_NTSC 0x00000800 #define TV1_PAL 0x00001000 #define TV1_YPBPR 0x00002000 #define TV1_PALM 0x00004000 #define TV1_PALN 0x00008000 #define TV1_NTSCJ 0x00010000 #define TV1_YPBPR525I 0x00020000 #define TV1_YPBPR525P 0x00040000 #define TV1_YPBPR625I 0x00080000 #define TV1_YPBPR625P 0x00100000 #define TV1_YPBPR750P 0x00200000 #define TV1_YPBPR1080I 0x00400000 /* pSiS->VBLCDFlags */ #define VB_LCD_320x480 0x00000001 /* DSTN/FSTN for 550 */ #define VB_LCD_640x480 0x00000002 #define VB_LCD_800x600 0x00000004 #define VB_LCD_1024x768 0x00000008 #define VB_LCD_1280x1024 0x00000010 #define VB_LCD_1280x960 0x00000020 #define VB_LCD_1600x1200 0x00000040 #define VB_LCD_2048x1536 0x00000080 #define VB_LCD_1400x1050 0x00000100 #define VB_LCD_1152x864 0x00000200 #define VB_LCD_1152x768 0x00000400 #define VB_LCD_1280x768 0x00000800 #define VB_LCD_1024x600 0x00001000 #define VB_LCD_640x480_2 0x00002000 /* DSTN/FSTN */ #define VB_LCD_640x480_3 0x00004000 /* DSTN/FSTN */ #define VB_LCD_848x480 0x00008000 /* LVDS only, otherwise handled as custom */ #define VB_LCD_1280x800 0x00010000 #define VB_LCD_1680x1050 0x00020000 #define VB_LCD_1280x720 0x00040000 #define VB_LCD_320x240 0x00080000 #define VB_LCD_856x480 0x00100000 #define VB_LCD_1280x854 0x00200000 #define VB_LCD_1920x1200 0x00400000 #define VB_LCD_UNKNOWN 0x10000000 #define VB_LCD_BARCO1366 0x20000000 #define VB_LCD_CUSTOM 0x40000000 #define VB_LCD_EXPANDING 0x80000000 #define VB_FORBID_CRT2LCD_OVER_1600 /* CRT2/LCD supports only up to 1600 pixels */ /* PresetMode argument */ #define SIS_MODE_SIMU 0 #define SIS_MODE_CRT1 1 #define SIS_MODE_CRT2 2 /* pSiS->MiscFlags */ #define MISC_CRT1OVERLAY 0x00000001 /* Current display mode supports overlay (CRT1) */ #define MISC_PANELLINKSCALER 0x00000002 /* Panel link is currently scaling */ #define MISC_CRT1OVERLAYGAMMA 0x00000004 /* Current display mode supports overlay gamma corr on CRT1 */ #define MISC_TVNTSC1024 0x00000008 /* Current display mode is TV NTSC/PALM/YPBPR525I 1024x768 */ #define MISC_CRT2OVERLAY 0x00000010 /* Current display mode supports overlay (CRT2) */ #define MISC_SIS760ONEOVERLAY 0x00000020 /* SiS760/761: Only one overlay available currently */ #define MISC_STNMODE 0x00000040 /* SiS550: xSTN active */ /* pSiS->SiS6326Flags */ #define SIS6326_HASTV 0x00000001 #define SIS6326_TVSVIDEO 0x00000002 #define SIS6326_TVCVBS 0x00000004 #define SIS6326_TVPAL 0x00000008 #define SIS6326_TVDETECTED 0x00000010 #define SIS6326_TVON 0x80000000 #ifdef DEBUG #define PDEBUG(p) p #else #define PDEBUG(p) #endif #define BITMASK(h,l) (((unsigned)(1U << ((h) - (l) + 1)) - 1) << (l)) #define GENMASK(mask) BITMASK(1 ? mask, 0 ? mask) #define GETBITS(var,mask) (((var) & GENMASK(mask)) >> (0 ? mask)) #define SETBITS(val,mask) ((val) << (0 ? mask)) #define SETBIT(n) (1 << (n)) #define GETBITSTR(val,from,to) ((GETBITS(val, from)) << (0 ? to)) #define SETVARBITS(var,val,from,to) (((var) & (~(GENMASK(to)))) | GETBITSTR(val,from,to)) #define GETVAR8(var) ((var) & 0xFF) #define SETVAR8(var,val) (var) = GETVAR8(val) typedef unsigned long ULong; typedef unsigned short UShort; typedef unsigned char UChar; /* pSiS->VGAEngine - VGA engine types */ #define UNKNOWN_VGA 0 #define SIS_530_VGA 1 #define SIS_OLD_VGA 2 #define SIS_300_VGA 3 #define SIS_315_VGA 4 /* Includes 330/660/661/741/760/340/761 and M versions thereof, XGI */ /* pSiS->oldChipset */ #define OC_UNKNOWN 0 #define OC_SIS86201 1 #define OC_SIS86202 2 #define OC_SIS6205A 3 #define OC_SIS6205B 4 #define OC_SIS82204 5 #define OC_SIS6205C 6 #define OC_SIS6225 7 #define OC_SIS5597 8 #define OC_SIS6326 9 #define OC_SIS530A 11 #define OC_SIS530B 12 /* 620 in 620-WDR */ #define OC_SIS620 13 /* Chrontel type */ #define CHRONTEL_700x 0 #define CHRONTEL_701x 1 /* pSiS->ChipFlags */ /* Use only lower 16 bit for chip id! (sisctrl) */ #define SiSCF_LARGEOVERLAY 0x00000001 #define SiSCF_Is651 0x00000002 #define SiSCF_IsM650 0x00000004 #define SiSCF_IsM652 0x00000008 #define SiSCF_IsM653 0x00000010 #define SiSCF_Is652 0x00000020 #define SiSCF_Is65x (SiSCF_Is651|SiSCF_IsM650|SiSCF_IsM652|SiSCF_IsM653|SiSCF_Is652) #define SiSCF_IsM661 0x00000100 /* M661FX */ #define SiSCF_IsM741 0x00000200 #define SiSCF_IsM760 0x00000400 #define SiSCF_IsM661M 0x00000800 /* M661MX */ #define SiSCF_IsM66x (SiSCF_IsM661 | SiSCF_IsM741 | SiSCF_IsM760 | SiSCF_IsM661M) #define SiSCF_Is315USB 0x00001000 /* USB2VGA dongle */ #define SiSCF_Is315E 0x00002000 /* 315E (lower clocks) */ #define SiSCF_IsXGIV3 SiSCF_Is651 /* Volari V3(XT) (If neither XGI... set, is V8) */ #define SiSCF_IsXGIV5 SiSCF_IsM650/* Volari V5 */ #define SiSCF_IsXGIDUO SiSCF_IsM652/* Volari Duo */ /* ... */ #define SiSCF_315Core 0x00010000 /* 3D: Real 315 */ #define SiSCF_Real256ECore 0x00020000 /* 3D: Similar to 315 core, no T&L? (65x, 661, 740, 741) */ #define SiSCF_XabreCore 0x00040000 /* 3D: Real Xabre */ #define SiSCF_Ultra256Core 0x00080000 /* 3D: aka "Mirage 2"; similar to Xabre, no T&L?, no P:Shader? (760) */ #define SiSCF_MMIOPalette 0x00100000 /* HW supports MMIO palette writing/reading */ #define SiSCF_IsXGI 0x00200000 /* Is XGI chip (Z7, V3, V5, V8) */ #define SiSCF_UseLCDA 0x01000000 #define SiSCF_760LFB 0x08000000 /* 76x: LFB active (if not set, UMA only) */ #define SiSCF_760UMA 0x10000000 /* 76x: UMA active (if not set, LFB only) */ #define SiSCF_CRT2HWCKaputt 0x20000000 /* CRT2 Mono HWCursor engine buggy (SiS 330) */ #define SiSCF_Glamour3 0x40000000 #define SiSCF_Integrated 0x80000000 /* SiS Direct Xv-API */ #define SiS_SD_IS300SERIES 0x00000001 #define SiS_SD_IS315SERIES 0x00000002 #define SiS_SD_IS330SERIES 0x00000004 #define SiS_SD_SUPPORTPALMN 0x00000008 /* tv chip supports pal-m, pal-n */ #define SiS_SD_SUPPORT2OVL 0x00000010 /* set = 2 overlays, clear = support SWITCHCRT xv prop */ #define SiS_SD_SUPPORTTVPOS 0x00000020 /* supports changing tv position */ #define SiS_SD_ISDUALHEAD 0x00000040 /* Driver is in dual head mode */ #define SiS_SD_ISMERGEDFB 0x00000080 /* Driver is in merged fb mode */ #define SiS_SD_ISDHSECONDHEAD 0x00000100 /* Dual head: This is CRT1 (=second head) */ #define SiS_SD_ISDHXINERAMA 0x00000200 /* Dual head: We are running Xinerama */ #define SiS_SD_VBHASSCART 0x00000400 /* videobridge has SCART instead of VGA2 */ #define SiS_SD_ISDEPTH8 0x00000800 /* Depth is 8, no independent gamma correction */ #define SiS_SD_SUPPORTSOVER 0x00001000 /* Support for Chrontel Super Overscan */ #define SiS_SD_ENABLED 0x00002000 /* sisctrl is enabled (by option) */ #define SiS_SD_PSEUDOXINERAMA 0x00004000 /* pseudo xinerama is active */ #define SiS_SD_SUPPORTLCDA 0x00008000 /* Support LCD Channel A */ #define SiS_SD_SUPPORTNTSCJ 0x00010000 /* tv chip supports ntsc-j */ #define SiS_SD_ADDLSUPFLAG 0x00020000 /* 1 = the following flags are valid */ #define SiS_SD_SUPPORTVGA2 0x00040000 /* CRT2=VGA supported */ #define SiS_SD_SUPPORTSCART 0x00080000 /* CRT2=SCART supported */ #define SiS_SD_SUPPORTOVERSCAN 0x00100000 /* Overscan flag supported */ #define SiS_SD_SUPPORTXVGAMMA1 0x00200000 /* Xv Gamma correction for CRT1 supported */ #define SiS_SD_SUPPORTTV 0x00400000 /* CRT2=TV supported */ #define SiS_SD_SUPPORTYPBPR 0x00800000 /* CRT2=YPbPr (525i, 525p, 750p, 1080i) is supported */ #define SiS_SD_SUPPORTHIVISION 0x01000000 /* CRT2=HiVision is supported */ #define SiS_SD_SUPPORTYPBPRAR 0x02000000 /* YPbPr aspect ratio is supported */ #define SiS_SD_SUPPORTSCALE 0x04000000 /* Scaling of LCD panel supported */ #define SiS_SD_SUPPORTCENTER 0x08000000 /* If scaling supported: Centering of screen [NOT] supported (TMDS only) */ #define SiS_SD_SUPPORTREDETECT 0x10000000 /* Support re-detection of CRT2 devices */ #define SiS_SD_IS340SERIES 0x20000000 #define SiS_SD_SUPPORTSGRCRT2 0x40000000 /* Separate CRT2 gamma correction supported */ #define SiS_SD_CANSETGAMMA 0x80000000 /* Driver can set gamma ramp; otherwise: App needs to reset palette */ /* after disabling sep CRT2 gamma corr */ #define SiS_SD2_LCDTMDS 0x00000001 /* SiS Bridge supports TMDS (DVI-D) */ #define SiS_SD2_LCDLVDS 0x00000002 /* SiS Bridge supports LVDS */ #define SiS_SD2_SUPPORTLCD 0x00000004 /* Bridge supports LCD (LVDS or TMDS, SiS+3rd party) */ #define SiS_SD2_SUPPORTTVSIZE 0x00000008 /* TV resizing supported (SiS bridges) */ #define SiS_SD2_SUPPORTTVTYPE 0x00000010 /* TV type selection supported (SiS bridges) */ #define SiS_SD2_SUPPORTGAMMA2 0x00000020 /* Gamma corr for CRT2 supported (SiS bridges) */ #define SiS_SD2_SISBRIDGE 0x00000040 /* SiS bridge */ #define SiS_SD2_SUPPTVSAT 0x00000080 /* TV saturation supported */ #define SiS_SD2_SUPPTVEDGE 0x00000100 /* TV edge enhancement supported */ #define SiS_SD2_CHRONTEL 0x00000200 /* Chrontel TV encoder present */ #define SiS_SD2_VIDEOBRIDGE 0x00000400 /* Any type of video bridge present */ #define SiS_SD2_THIRDPARTYLVDS 0x00000800 /* Third party LVDS (non-SiS) */ #define SiS_SD2_ADDLFLAGS 0x00001000 /* Following flags valid */ #define SiS_SD2_SUPPORT760OO 0x00002000 /* Support dynamic one/two overlay configuration changes */ /* (If set, utility must re-read SD2 flags after mode change) */ #define SiS_SD2_SIS760ONEOVL 0x00004000 /* (76x:) Only one overlay currently */ #define SiS_SD2_MERGEDUCLOCK 0x00008000 /* Provide VRefresh in mode->Clock field in MergedFB mode */ #define SiS_SD2_SUPPORTXVHUESAT 0x00010000 /* Xv: Support hue & saturation */ #define SiS_SD2_NEEDUSESSE 0x00020000 /* Need "UseSSE" option to use SSE (otherwise auto) */ #define SiS_SD2_NODDCSUPPORT 0x00040000 /* No hardware DDC support (USB) */ #define SiS_SD2_SUPPORTXVDEINT 0x00080000 /* Xv deinterlacing supported (n/a, for future use) */ #define SiS_SD2_ISXGI 0x00100000 /* Is XGI chip */ #define SiS_SD2_USEVBFLAGS2 0x00200000 /* Use VBFlags2 for bridge ID */ #define SiS_SD2_SUPPLTFLAG 0x00400000 /* Driver supports the following 3 flags */ #define SiS_SD2_ISLAPTOP 0x00800000 /* This machine is (very probably) a laptop */ #define SiS_SD2_MACHINETYPE2 0x01000000 /* Machine type 2 (for future use) */ #define SiS_SD2_MACHINETYPE3 0x02000000 /* Machine type 3 (for future use) */ #define SiS_SD2_SUPPORT625I 0x04000000 /* Support YPbPr 625i */ #define SiS_SD2_SUPPORT625P 0x08000000 /* Support YPbPr 625p */ #define SiS_SD2_VBINVB2ONLY 0x10000000 /* VB_* bits in vbflags no longer used for vb type */ #define SiS_SD2_NEWGAMMABRICON 0x20000000 /* Support new gamma brightness/contrast */ #define SiS_SD2_HAVESD34 0x40000000 /* Support SD3 and SD4 flags */ #define SiS_SD2_NOOVERLAY 0x80000000 /* No video overlay */ #define SiS_SD3_OLDGAMMAINUSE 0x00000001 /* Old gamma brightness is currently in use */ #define SiS_SD3_MFBALLOWOFFCL 0x00000002 /* Supports off'ing CRTx in MFB if a clone mode is active */ #define SiS_SD3_SUPPORTVBF34 0x00000004 /* Supports VBFlags3 and VBFlags4 */ #define SiS_SD3_SUPPORTDUALDVI 0x00000008 /* Supports dual dvi-d (for future use) */ #define SiS_SD3_SUPPORTDUALTV 0x00000010 /* Supports dual tv (for future use) */ #define SiS_SD3_NEWOUTPUTSW 0x00000020 /* Supports NEWSETVBFLAGS (for future use) */ #define SiS_SD3_CRT1SATGAIN 0x00000040 /* Supports CRT1 saturation gain */ #define SiS_SD3_CRT2SATGAIN 0x00000080 /* Supports CRT2 saturation gain (apart from TV, see SiS_SD2_SUPPTVSAT) */ #define SIS_DIRECTKEY 0x03145792 /* SiSCtrl: Check mode for CRT2 */ #define SiS_CF2_LCD 0x01 #define SiS_CF2_TV 0x02 #define SiS_CF2_VGA2 0x04 #define SiS_CF2_TVPAL 0x08 #define SiS_CF2_TVNTSC 0x10 /* + NTSC-J */ #define SiS_CF2_TVPALM 0x20 #define SiS_CF2_TVPALN 0x40 #define SiS_CF2_CRT1LCDA 0x80 #define SiS_CF2_TYPEMASK (SiS_CF2_LCD | SiS_CF2_TV | SiS_CF2_VGA2 | SiS_CF2_CRT1LCDA) #define SiS_CF2_TVSPECIAL (SiS_CF2_LCD | SiS_CF2_TV) #define SiS_CF2_TVSPECMASK (SiS_CF2_TVPAL | SiS_CF2_TVNTSC | SiS_CF2_TVPALM | SiS_CF2_TVPALN) #define SiS_CF2_TVHIVISION SiS_CF2_TVPAL #define SiS_CF2_TVYPBPR525I SiS_CF2_TVNTSC #define SiS_CF2_TVYPBPR525P (SiS_CF2_TVPAL | SiS_CF2_TVNTSC) #define SiS_CF2_TVYPBPR625I SiS_CF2_TVPALN #define SiS_CF2_TVYPBPR625P (SiS_CF2_TVPALN | SiS_CF2_TVPAL) #define SiS_CF2_TVYPBPR750P SiS_CF2_TVPALM #define SiS_CF2_TVYPBPR1080I (SiS_CF2_TVPALM | SiS_CF2_TVPAL) /* AGP stuff for DRI */ #define AGP_PAGE_SIZE 4096 #define AGP_PAGES 2048 /* Default: 2048 pages @ 4096 = 8MB */ /* 300 */ #define AGP_CMDBUF_PAGES 256 #define AGP_CMDBUF_SIZE (AGP_PAGE_SIZE * AGP_CMDBUF_PAGES) /* 315/330 */ #define AGP_VTXBUF_PAGES 512 #define AGP_VTXBUF_SIZE (AGP_PAGE_SIZE * AGP_VTXBUF_PAGES) /* Defines for our own vgaHW functions */ #define SISVGA_SR_MODE 0x01 #define SISVGA_SR_FONTS 0x02 #define SISVGA_SR_CMAP 0x04 #define SISVGA_SR_ALL (SISVGA_SR_MODE | SISVGA_SR_FONTS | SISVGA_SR_CMAP) #define SISKGA_FIX_OVERSCAN 1 /* overcan correction required */ #define SISKGA_ENABLE_ON_ZERO 2 /* if possible enable display at beginning of next scanline/frame */ #define SISKGA_BE_TOT_DEC 4 /* always fix problem by setting blank end */ /* CPU flags (for memcpy() etc.) */ #define SIS_CPUFL_LIBC 0x0001 #define SIS_CPUFL_BI 0x0002 #define SIS_CPUFL_SSE 0x0004 #define SIS_CPUFL_MMX 0x0008 #define SIS_CPUFL_3DNOW 0x0010 #define SIS_CPUFL_MMX2 0x0020 #define SIS_CPUFL_BI2 0x0040 #define SIS_CPUFL_SSE2 0x0080 #define SIS_CPUFL_FLAG 0x8000 /* Convenience macro for sisfb version checks */ #define SISFB_VERSION(a,b,c) ((a << 16) | (b << 8) | c) /* For backup of register contents */ typedef struct { UChar sisRegMiscOut; UChar sisRegsATTR[22]; UChar sisRegsGR[10]; UChar sisDAC[768]; UChar sisRegs3C4[0x80]; UChar sisRegs3D4[0x100]; UChar sisRegs3C2; UChar sisCapt[0x60]; UChar sisVid[0x50]; UChar VBPart1[0x80]; UChar VBPart2[0x100]; UChar VBPart3[0x50]; UChar VBPart4[0x50]; UShort ch70xx[64]; unsigned int sisMMIO85C0; UChar sis6326tv[0x46]; unsigned int sisRegsPCI50, sisRegsPCIA0; UChar BIOSModeSave; } SISRegRec, *SISRegPtr; typedef struct _sisModeInfoPtr { int width; int height; int bpp; int n; struct _sisModeInfoPtr *next; } sisModeInfoRec, *sisModeInfoPtr; /* SISFBLayout (which has nothing to do with sisfb, actually) * is mainly there because of DGA. It holds the current layout * parameters needed for acceleration and other stuff. When * switching mode using DGA, these are set up accordingly and * not necessarily match pScrn's. Therefore, driver modules * should read these values instead of pScrn's. */ typedef struct { int bitsPerPixel; /* = pScrn->bitsPerPixel */ int depth; /* = pScrn->depth */ int displayWidth; /* = pScrn->displayWidth */ int displayHeight; /* = imageHeight from DGA mode; ONLY WHEN DGA IS ACTIVE!!! */ int DGAViewportX; int DGAViewportY; DisplayModePtr mode; /* = pScrn->currentMode */ } SISFBLayout; /* For extended memcpy() */ typedef void (*vidCopyFunc)(UChar *, const UChar *, int); #ifdef SISISXORG6899900 #define SISAGPHTYPE drm_handle_t #else #define SISAGPHTYPE ULong #endif /* Dual head private entity structure */ #ifdef SISDUALHEAD typedef struct { ScrnInfoPtr pScrn_1; ScrnInfoPtr pScrn_2; UChar *BIOS; struct SiS_Private *SiS_Pr; #ifdef SISDRI SISAGPHTYPE agpHandle; ULong agpAddr; UChar *agpBase; unsigned int agpSize; unsigned int agpWantedSize; unsigned int agpWantedPages; ULong agpCmdBufAddr; /* 300 series */ UChar *agpCmdBufBase; unsigned int agpCmdBufSize; unsigned int agpCmdBufFree; ULong agpVtxBufAddr; /* 315/330 series */ UChar *agpVtxBufBase; unsigned int agpVtxBufSize; unsigned int agpVtxBufFree; sisRegion agp; int drmSubFD; #endif Bool AGPInitOK; int CRT1ModeNo; /* Current display mode for CRT1 */ DisplayModePtr CRT1DMode; /* Current display mode for CRT1 */ int CRT2ModeNo; /* Current display mode for CRT2 */ DisplayModePtr CRT2DMode; /* Current display mode for CRT2 */ Bool CRT2ModeSet; /* CRT2 mode has been set */ Bool CRT2IsCustom; UChar CRT2CR30, CRT2CR31, CRT2CR35, CRT2CR38; int refCount; int lastInstance; /* number of entities */ Bool DisableDual; /* Emergency flag */ Bool ErrorAfterFirst; /* Emergency flag: Error after first init -> Abort second */ Bool HWCursor; /* Backup master settings for use on slave */ Bool TurboQueue; int ForceCRT1Type; Bool CRT1TypeForced; int ForceCRT2Type; int OptTVStand; int OptTVOver; int OptTVSOver; int OptROMUsage; int OptUseOEM; Bool NoAccel; Bool useEXA; int forceCRT1; int DSTN, FSTN; Bool XvOnCRT2; int maxUsedClock; /* Max used pixelclock on master head */ ULong masterFbAddress; /* Framebuffer addresses and sizes */ ULong masterFbSize; ULong slaveFbAddress; ULong slaveFbSize; void *FbBase; /* VRAM linear address */ UChar *RealFbBase; /* Real VRAM linear address (for DHM, SiS76x UMA skipping) */ void *IOBase; /* MMIO linear address */ UShort MapCountIOBase; /* map/unmap queue counter */ UShort MapCountFbBase; /* map/unmap queue counter */ Bool forceUnmapIOBase; /* ignore counter and unmap */ Bool forceUnmapFbBase; /* ignore counter and unmap */ #ifdef __alpha__ void *IOBaseDense; /* MMIO for Alpha platform */ UShort MapCountIOBaseDense; Bool forceUnmapIOBaseDense; /* ignore counter and unmap */ #endif int chtvlumabandwidthcvbs; /* TV settings for Chrontel TV encoder */ int chtvlumabandwidthsvideo; int chtvlumaflickerfilter; int chtvchromabandwidth; int chtvchromaflickerfilter; int chtvcvbscolor; int chtvtextenhance; int chtvcontrast; int sistvedgeenhance; /* TV settings for SiS bridge */ int sistvantiflicker; int sistvsaturation; int sistvcolcalibc; int sistvcolcalibf; int sistvcfilter; int sistvyfilter; int tvxpos, tvypos; int tvxscale, tvyscale; int siscrt1satgain; Bool crt1satgaingiven; int ForceTVType, SenseYPbPr; unsigned int ForceYPbPrType, ForceYPbPrAR; int chtvtype; int NonDefaultPAL, NonDefaultNTSC; UShort tvx, tvy; UChar p2_01, p2_02, p2_1f, p2_20, p2_43, p2_42, p2_2b; UChar p2_44, p2_45, p2_46; unsigned int sistvccbase; UChar p2_35, p2_36, p2_37, p2_38, p2_48, p2_49, p2_4a; UChar p2_0a, p2_2f, p2_30, p2_47; UChar scalingp1[9], scalingp4[9], scalingp2[64]; UShort cursorBufferNum; Bool restorebyset; Bool CRT1gamma, CRT1gammaGiven, CRT2gamma, XvGamma, XvGammaGiven, XvDefAdaptorBlit; int XvGammaRed, XvGammaGreen, XvGammaBlue; int GammaBriR, GammaBriG, GammaBriB; /* strictly for Xinerama */ float NewGammaBriR, NewGammaBriG, NewGammaBriB; /* strictly for Xinerama */ float NewGammaConR, NewGammaConG, NewGammaConB; /* strictly for Xinerama */ unsigned int CRT1MonGamma, CRT2MonGamma; unsigned int CRT1VGAMonitorGamma, CRT2LCDMonitorGamma, CRT2VGAMonitorGamma; int curxvcrtnum; int UsePanelScaler, CenterLCD; int AllowHotkey; Bool enablesisctrl; unsigned int cmdQ_SharedWritePort_2D; UChar *RenderAccelArray; UChar *FbBase1; ULong OnScreenSize1; UChar OldMode; int HWCursorMBufNum, HWCursorCBufNum; Bool ROM661New; Bool HaveXGIBIOS; Bool XvUseMemcpy; Bool BenchMemCpy; Bool HaveFastVidCpy; vidCopyFunc SiSFastVidCopy, SiSFastMemCopy; vidCopyFunc SiSFastVidCopyFrom, SiSFastMemCopyFrom; unsigned int CPUFlags; #ifdef SIS_NEED_MAP_IOP CARD32 IOPAddress; /* I/O port physical address */ void *IOPBase; /* I/O port linear address */ UShort MapCountIOPBase; /* map/unmap queue counter */ Bool forceUnmapIOPBase; /* ignore counter and unmap */ #endif #ifdef SIS_CP SIS_CP_H_ENT #endif } SISEntRec, *SISEntPtr; #endif #define SISPTR(p) ((SISPtr)((p)->driverPrivate)) #define XAAPTR(p) ((XAAInfoRecPtr)(SISPTR(p)->AccelInfoPtr)) /* MergedFB: Relative position */ typedef enum { sisLeftOf, sisRightOf, sisAbove, sisBelow, sisClone } SiSScrn2Rel; typedef struct _region { int x0,x1,y0,y1; } region; typedef struct { ScrnInfoPtr pScrn; pciVideoPtr PciInfo; int PciBus, PciDevice, PciFunc; PCITAG PciTag; EntityInfoPtr pEnt; int Chipset; unsigned char ChipType; int ChipRev; int VGAEngine; /* see above */ int hasTwoOverlays; /* Chipset supports two video overlays? */ struct SiS_Private *SiS_Pr; /* For mode switching code */ int DSTN; /* For 550 FSTN/DSTN; set by option, no detection */ ULong FbAddress; /* VRAM physical address (in DHM: for each Fb!) */ ULong realFbAddress; /* For DHM/PCI mem mapping: store global FBAddress */ void *FbBase; /* VRAM virtual linear address */ void *RealFbBase; /* Real VRAM virtual linear address (for DHM and SiS76x UMA skipping) */ CARD32 IOAddress; /* MMIO physical address */ void *IOBase; /* MMIO linear address */ unsigned long IODBase; /* Base of PIO memory area */ #ifdef __alpha__ void *IOBaseDense; /* MMIO for Alpha platform */ #endif SISIOADDRESS RelIO; /* Relocated IO Ports baseaddress */ UChar *BIOS; int MemClock; int BusWidth; int MinClock; int MaxClock; int Flags; /* HW config flags */ long FbMapSize; /* Used for Mem Mapping - DON'T CHANGE THIS */ long availMem; /* Really available Fb mem (minus TQ, HWCursor) */ unsigned int maxxfbmem; /* limit fb memory X is to use to this (KB) */ unsigned int sisfbHeapStart; /* heapstart of sisfb (if running) */ unsigned int dhmOffset; /* Offset to memory for each head (0 or ..); also used on SiS76x/UMA+LFB */ unsigned int FbBaseOffset; DGAModePtr DGAModes; int numDGAModes; Bool DGAactive; int DGAViewportStatus; UChar OldMode; /* Back old modeNo (if available) */ Bool NoAccel; Bool NoXvideo; Bool XvOnCRT2; /* see sis_opt.c */ Bool HWCursor; Bool UsePCIRetry; Bool TurboQueue; int VESA; int ForceCRT1Type; Bool CRT1Detected, CRT1TypeForced; int ForceCRT2Type; int OptTVStand; int OptTVOver; int OptROMUsage; int UseCHOverScan; Bool ValidWidth; Bool FastVram; /* now unused */ int forceCRT1; Bool CRT1changed; UChar oldCR17, oldCR63, oldSR1F; UChar oldCR32, oldCR36, oldCR37; UChar myCR32, myCR36, myCR37, myCR63; UChar newCR32; unsigned int VBFlags; /* Video bridge configuration (dynamic) */ unsigned int VBFlags2; /* Video bridge configuration 2 (static flags only) */ unsigned int VBFlags3, VBFlags4; /* Video bridge configuration 3, 4 (dynamic) */ unsigned int VBFlags_backup; /* Backup for SlaveMode-modes */ unsigned int VBFlags_backup3; /* Backup for SlaveMode-modes */ unsigned int VBFlags_backup4; /* Backup for SlaveMode-modes */ unsigned int VBLCDFlags, VBLCDFlags2; int ChrontelType; /* CHRONTEL_700x or CHRONTEL_701x */ unsigned int PDC, PDCA; /* PanelDelayCompensation */ short scrnOffset; /* Screen pitch (data) */ short scrnPitch; /* Screen pitch (display; regarding interlace) */ short DstColor; unsigned int SiS310_AccelDepth; /* used in accel for 315 series */ int MaxCMDQueueLen; int CurCMDQueueLen; int MinCMDQueueLen; CARD16 CursorSize; /* Size of HWCursor area (bytes) */ CARD32 cursorOffset; /* see sis_driver.c and sis_cursor.c */ Bool useEXA; void (*InitAccel)(ScrnInfoPtr pScrn); void (*SyncAccel)(ScrnInfoPtr pScrn); void (*FillRect)(ScrnInfoPtr pScrn, int x, int y, int w, int h, int color); void (*BlitRect)(ScrnInfoPtr pScrn, int srcx, int srcy, int dstx, int dsty, int w, int h, int color); int CommandReg; Bool ClipEnabled; int Xdirection; /* for temp use in accel */ int Ydirection; /* for temp use in accel */ #ifdef SIS_USE_XAA XAAInfoRecPtr AccelInfoPtr; UChar *XAAScanlineColorExpandBuffers[2]; Bool DoColorExpand; Bool ColorExpandBusy; int xcurrent; /* for temp use in accel */ int ycurrent; /* for temp use in accel */ int sisPatternReg[4]; int ROPReg; #endif #ifdef SIS_USE_EXA ExaDriverPtr EXADriverPtr; int fillPitch, fillBpp; CARD32 fillDstBase; int copyBpp; int copySPitch, copyDPitch; CARD32 copySrcBase, copyDstBase; int copyXdir, copyYdir; ExaOffscreenArea * exa_scratch; unsigned int exa_scratch_next; #endif Bool alphaBlitBusy; SISRegRec SavedReg; SISRegRec ModeReg; xf86CursorInfoPtr CursorInfoPtr; CloseScreenProcPtr CloseScreen; Bool (*ModeInit)(ScrnInfoPtr pScrn, DisplayModePtr mode); void (*SiSSave)(ScrnInfoPtr pScrn, SISRegPtr sisreg); void (*SiSRestore)(ScrnInfoPtr pScrn, SISRegPtr sisreg); int cmdQueueLen; /* Current cmdQueueLength (for 2D and 3D) */ unsigned int *cmdQueueBase; int *cmdQueueLenPtr; /* Ptr to variable holding the current queue length */ int *cmdQueueLenPtrBackup; /* Backup for DRI init/restore */ unsigned int cmdQueueOffset; unsigned int cmdQueueSize; unsigned int cmdQueueSizeMask; unsigned int cmdQ_SharedWritePort_2D; unsigned int *cmdQ_SharedWritePort; unsigned int *cmdQ_SharedWritePortBackup; unsigned int cmdQueueSize_div2; unsigned int cmdQueueSize_div4; unsigned int cmdQueueSize_4_3; #ifdef SISDRI SISAGPHTYPE agpHandle; ULong agpAddr; UChar *agpBase; unsigned int agpSize; unsigned int agpWantedSize; unsigned int agpWantedPages; ULong agpCmdBufAddr; /* 300 series */ UChar *agpCmdBufBase; unsigned int agpCmdBufSize; unsigned int agpCmdBufFree; ULong agpVtxBufAddr; /* 315 series */ UChar *agpVtxBufBase; unsigned int agpVtxBufSize; unsigned int agpVtxBufFree; sisRegion agp; #endif Bool AGPInitOK; Bool irqEnabled; int irq; Bool IsAGPCard, IsPCIExpress; unsigned int DRIheapstart, DRIheapend; Bool NeedFlush; /* Need to flush cmd buf mem (760) */ #ifdef SIS_USE_XAA void (*RenderCallback)(ScrnInfoPtr); Time RenderTime; FBLinearPtr AccelLinearScratch; #endif #ifdef SIS_USE_EXA void (*ExaRenderCallback)(ScrnInfoPtr); Time ExaRenderTime; #endif UChar *RenderAccelArray; Bool doRender; int ColorExpandRingHead; int ColorExpandRingTail; int PerColorExpandBufferSize; int ColorExpandBufferNumber; int ColorExpandBufferCountMask; UChar *ColorExpandBufferAddr[32]; CARD32 ColorExpandBufferScreenOffset[32]; CARD32 ColorExpandBase; int Rotate, Reflect; void (*PointerMoved)(SCRN_ARG_TYPE arg, int x, int y); /* ShadowFB support */ Bool ShadowFB; UChar *ShadowPtr; int ShadowPitch; #ifdef SISUSEDEVPORT Bool sisdevportopen; #endif /* DRI */ Bool loadDRI; #ifdef SISDRI Bool directRenderingEnabled; DRIInfoPtr pDRIInfo; int drmSubFD; int numVisualConfigs; __GLXvisualConfig* pVisualConfigs; SISConfigPrivPtr pVisualConfigsPriv; SISRegRec DRContextRegs; #endif /* Xv */ XF86VideoAdaptorPtr adaptor; XF86VideoAdaptorPtr blitadaptor; void *blitPriv; ScreenBlockHandlerProcPtr BlockHandler; void (*VideoTimerCallback)(ScrnInfoPtr, Time); void (*ResetXv)(ScrnInfoPtr); void (*ResetXvDisplay)(ScrnInfoPtr); void (*ResetXvGamma)(ScrnInfoPtr); /* misc */ OptionInfoPtr Options; UChar BIOSModeSave; int CRT1off; /* 1=CRT1 off, 0=CRT1 on */ CARD16 LCDheight; /* Vertical resolution of LCD panel */ CARD16 LCDwidth; /* Horizontal resolution of LCD panel */ vbeInfoPtr pVbe; /* For VESA mode switching */ CARD16 vesamajor; CARD16 vesaminor; int UseVESA; sisModeInfoPtr SISVESAModeList; xf86MonPtr monitor; CARD16 maxBytesPerScanline; CARD32 *pal, *savedPal; int mapPhys, mapOff, mapSize; int statePage, stateSize, stateMode; CARD8 *fonts; CARD8 *state, *pstate; void *base, *VGAbase; #ifdef SISDUALHEAD Bool DualHeadMode; /* TRUE if we use dual head mode */ Bool SecondHead; /* TRUE is this is the second head */ SISEntPtr entityPrivate; /* Ptr to private entity (see above) */ Bool SiSXinerama; /* Do we use Xinerama mode? */ #endif SISFBLayout CurrentLayout; /* Current framebuffer layout */ UShort SiS_DDC2_Index; UShort SiS_DDC2_Data; UShort SiS_DDC2_Clk; Bool Primary; /* Display adapter is primary */ Bool VGADecodingEnabled; /* a0000 memory adress decoding is enabled */ xf86Int10InfoPtr pInt; /* Our int10 */ int oldChipset; /* Type of old chipset */ int RealVideoRam; /* 6326 can only address 4MB, but TQ can be above */ CARD32 CmdQueLenMask; /* Mask of queue length in MMIO register */ CARD32 CmdQueLenFix; /* Fix value to subtract from QueLen (530/620) */ CARD32 CmdQueMaxLen; /* (6326/5597/5598) Amount of cmds the queue can hold */ CARD32 TurboQueueLen; /* For future use */ CARD32 detectedCRT2Devices; /* detected CRT2 devices before mask-out */ Bool HostBus; /* Enable/disable 5597/5598 host bus */ Bool noInternalModes; /* Use our own default modes? */ int OptUseOEM; /* Use internal OEM data? */ int chtvlumabandwidthcvbs; /* TV settings for Chrontel TV encoder */ int chtvlumabandwidthsvideo; int chtvlumaflickerfilter; int chtvchromabandwidth; int chtvchromaflickerfilter; int chtvcvbscolor; int chtvtextenhance; int chtvcontrast; int sistvedgeenhance; /* TV settings for SiS bridges */ int sistvantiflicker; int sistvsaturation; int sistvcolcalibc; int sistvcolcalibf; int sistvcfilter; int sistvyfilter; int OptTVSOver; /* Chrontel 7005: Superoverscan */ int tvxpos, tvypos; int tvxscale, tvyscale; int SiS6326Flags; /* SiS6326 TV settings */ int sis6326enableyfilter; int sis6326yfilterstrong; int sis6326tvplug; int sis6326fscadjust; Bool sisfbfound; Bool donttrustpdc; /* Don't trust the detected PDC */ UChar sisfbpdc, sisfbpdca; UChar sisfblcda; int sisfbscalelcd; unsigned int sisfbspecialtiming; Bool sisfb_haveemi, sisfb_haveemilcd, sisfb_tvposvalid, sisfb_havelock; UChar sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33; int sisfb_tvxpos, sisfb_tvypos; int siscrt1satgain; Bool crt1satgaingiven; Bool sisfbHaveNewHeapDef; unsigned int sisfbHeapSize, sisfbVideoOffset; Bool sisfbxSTN; unsigned int sisfbDSTN, sisfbFSTN; Bool sisfbcanpost, sisfbcardposted, sisfbprimary; char sisfbdevname[16]; int EMI; int PRGB; int NoYV12; /* Disable Xv YV12 support (old series) */ UChar postVBCR32; int newFastVram; /* Replaces FastVram */ int ForceTVType, SenseYPbPr; int NonDefaultPAL, NonDefaultNTSC; unsigned int ForceYPbPrType, ForceYPbPrAR; ULong lockcalls; /* Count unlock calls for debug */ UShort tvx, tvy; /* Backup TV position registers */ UChar p2_01, p2_02, p2_1f, p2_20, p2_43, p2_42, p2_2b; /* Backup TV position registers */ UShort tvx1, tvx2, tvx3, tvy1; /* Backup TV position registers */ UChar p2_44, p2_45, p2_46; unsigned int sistvccbase; UChar p2_35, p2_36, p2_37, p2_38, p2_48, p2_49, p2_4a; UChar p2_0a, p2_2f, p2_30, p2_47; UChar scalingp1[9], scalingp4[9], scalingp2[64]; Bool ForceCursorOff; Bool HaveCustomModes; Bool IsCustom; DisplayModePtr backupmodelist; int chtvtype; Atom xvBrightness, xvContrast, xvColorKey, xvHue, xvSaturation; Atom xvAutopaintColorKey, xvSetDefaults, xvSwitchCRT; Atom xvDisableGfx, xvDisableGfxLR, xvTVXPosition, xvTVYPosition; Atom xvDisableColorkey, xvUseChromakey, xvChromaMin, xvChromaMax; Atom xvInsideChromakey, xvYUVChromakey, xvVSync; #ifdef SISDEINT Atom xvdeintmeth; #endif Atom xvGammaRed, xvGammaGreen, xvGammaBlue; #ifdef XV_SD_DEPRECATED Atom xv_QVF, xv_QVV, xv_USD, xv_SVF, xv_QDD, xv_TAF, xv_TSA, xv_TEE, xv_GSF; Atom xv_TTE, xv_TCO, xv_TCC, xv_TCF, xv_TLF, xv_CMD, xv_CMDR, xv_CT1, xv_SGA; Atom xv_GDV, xv_GHI, xv_OVR, xv_GBI, xv_TXS, xv_TYS, xv_CFI, xv_COC, xv_COF; Atom xv_YFI, xv_GSS, xv_BRR, xv_BRG, xv_BRB, xv_PBR, xv_PBG, xv_PBB, xv_SHC; Atom xv_BRR2, xv_BRG2, xv_BRB2, xv_PBR2, xv_PBG2, xv_PBB2, xv_PMD, xv_RDT; Atom xv_GARC2,xv_GAGC2,xv_GABC2, xv_GSF2; Atom xv_BRRC2, xv_BRGC2, xv_BRBC2, xv_PBRC2, xv_PBGC2, xv_PBBC2; #ifdef TWDEBUG Atom xv_STR; #endif unsigned int xv_sd_result; #endif /* XV_SD_DEPRECATED */ int xv_sisdirectunlocked; int SiS76xLFBSize; int SiS76xUMASize; int CRT1isoff; ULong UMAsize, LFBsize; /* For SiSCtrl extension info only */ #ifdef SIS_CP SIS_CP_H #endif ULong ChipFlags; ULong SiS_SD_Flags, SiS_SD2_Flags, SiS_SD3_Flags, SiS_SD4_Flags; Bool UseHWARGBCursor; int OptUseColorCursor; int OptUseColorCursorBlend; CARD32 OptColorCursorBlendThreshold; UShort cursorBufferNum; int vb; Bool restorebyset; Bool nocrt2ddcdetection; Bool forcecrt2redetection; Bool CRT1gamma, CRT1gammaGiven, CRT2gamma, XvGamma, XvGammaGiven; int XvDefCon, XvDefBri, XvDefHue, XvDefSat; Bool XvDefDisableGfx, XvDefDisableGfxLR, XvDefAdaptorBlit; Bool XvUseMemcpy; Bool XvUseChromaKey, XvDisableColorKey; Bool XvInsideChromaKey, XvYUVChromaKey; int XvChromaMin, XvChromaMax; int XvGammaRed, XvGammaGreen, XvGammaBlue; int XvGammaRedDef, XvGammaGreenDef, XvGammaBlueDef; CARD8 XvGammaRampRed[256], XvGammaRampGreen[256], XvGammaRampBlue[256]; Bool disablecolorkeycurrent; CARD32 colorKey; CARD32 MiscFlags; int UsePanelScaler, CenterLCD; float zClearVal; ULong bClrColor, dwColor; int AllowHotkey; Bool enablesisctrl; short Video_MaxWidth, Video_MaxHeight; int FSTN; Bool AddedPlasmaModes; short scrnPitch2; CARD32 CurFGCol, CurBGCol; UChar *CurMonoSrc; CARD32 *CurARGBDest; int GammaBriR, GammaBriG, GammaBriB; unsigned int CRT1MonGamma, CRT2MonGamma; unsigned int CRT1VGAMonitorGamma, CRT2LCDMonitorGamma, CRT2VGAMonitorGamma; Bool HideHWCursor; /* Custom application */ Bool HWCursorIsVisible; unsigned int HWCursorBackup[16]; int HWCursorMBufNum, HWCursorCBufNum; ULong mmioSize; Bool ROM661New; Bool HaveXGIBIOS; Bool NewCRLayout; Bool skipswitchcheck; unsigned int VBFlagsInit; DisplayModePtr currentModeLast; unsigned long MyPIOOffset; Bool OverruleRanges; Bool BenchMemCpy; Bool NeedCopyFastVidCpy; Bool SiSFastVidCopyDone; vidCopyFunc SiSFastVidCopy, SiSFastMemCopy; vidCopyFunc SiSFastVidCopyFrom, SiSFastMemCopyFrom; unsigned int CPUFlags; #ifndef SISCHECKOSSSE Bool XvSSEMemcpy; #endif char messagebuffer[64]; unsigned int VGAMapSize; /* SiSVGA stuff */ ULong VGAMapPhys; void *VGAMemBase; /* mapped */ Bool VGAPaletteEnabled; Bool VGACMapSaved; Bool CRT2SepGamma; /* CRT2 separate gamma stuff */ int *crt2cindices; LOCO *crt2gcolortable, *crt2colors; int CRT2ColNum; float GammaR2, GammaG2, GammaB2; int GammaR2i, GammaG2i, GammaB2i; int GammaBriR2, GammaBriG2, GammaBriB2; float NewGammaBriR, NewGammaBriG, NewGammaBriB; float NewGammaConR, NewGammaConG, NewGammaConB; float NewGammaBriR2, NewGammaBriG2, NewGammaBriB2; float NewGammaConR2, NewGammaConG2, NewGammaConB2; ExtensionEntry *SiSCtrlExtEntry; char devsectname[32]; Bool SCLogQuiet; #ifdef SIS_NEED_MAP_IOP CARD32 IOPAddress; /* I/O port physical address */ void *IOPBase; /* I/O port linear address */ #endif #ifdef SISMERGED Bool MergedFB, MergedFBAuto; SiSScrn2Rel CRT2Position; char *CRT2HSync; char *CRT2VRefresh; char *MetaModes; ScrnInfoPtr CRT2pScrn; DisplayModePtr CRT1Modes; DisplayModePtr CRT1CurrentMode; int CRT1frameX0; int CRT1frameY0; int CRT1frameX1; int CRT1frameY1; Bool CheckForCRT2; Bool IsCustomCRT2; Bool HaveCustomModes2; int maxCRT1_X1, maxCRT1_X2, maxCRT1_Y1, maxCRT1_Y2; int maxCRT2_X1, maxCRT2_X2, maxCRT2_Y1, maxCRT2_Y2; int maxClone_X1, maxClone_X2, maxClone_Y1, maxClone_Y2; int MergedFBXDPI, MergedFBYDPI; int CRT1XOffs, CRT1YOffs, CRT2XOffs, CRT2YOffs; int MBXNR1XMAX, MBXNR1YMAX, MBXNR2XMAX, MBXNR2YMAX; Bool NonRect, HaveNonRect, HaveOffsRegions, MouseRestrictions; region NonRectDead, OffDead1, OffDead2; #ifdef SISXINERAMA Bool UseSiSXinerama; Bool CRT2IsScrn0; ExtensionEntry *XineramaExtEntry; int SiSXineramaVX, SiSXineramaVY; Bool AtLeastOneNonClone; #endif #endif } SISRec, *SISPtr; typedef struct _ModeInfoData { int mode; VbeModeInfoBlock *data; VbeCRTCInfoBlock *block; } ModeInfoData; #define SDMPTR(x) ((SiSMergedDisplayModePtr)(x->currentMode->Private)) #define CDMPTR ((SiSMergedDisplayModePtr)(pSiS->CurrentLayout.mode->Private)) #define BOUND(test,low,hi) \ { \ if((test) < (low)) (test) = (low); \ if((test) > (hi)) (test) = (hi); \ } #define REBOUND(low,hi,test) \ { \ if((test) < (low)) { \ (hi) += (test)-(low); \ (low) = (test); \ } \ if((test) > (hi)) { \ (low) += (test)-(hi); \ (hi) = (test); \ } \ } typedef struct _MergedDisplayModeRec { DisplayModePtr CRT1; DisplayModePtr CRT2; SiSScrn2Rel CRT2Position; } SiSMergedDisplayModeRec, *SiSMergedDisplayModePtr; typedef struct _myhddctiming { int whichone; UChar mask; float rate; } myhddctiming; typedef struct _myvddctiming { int whichone; UChar mask; int rate; } myvddctiming; typedef struct _pdctable { int subsysVendor; int subsysCard; int pdc; char *vendorName; char *cardName; } pdctable; typedef struct _chswtable { int subsysVendor; int subsysCard; char *vendorName; char *cardName; } chswtable; typedef struct _customttable { UShort chipID; char *biosversion; char *biosdate; CARD32 bioschksum; UShort biosFootprintAddr[5]; UChar biosFootprintData[5]; UShort pcisubsysvendor; UShort pcisubsyscard; char *vendorName; char *cardName; ULong SpecialID; char *optionName; } customttable; #ifdef SISMERGED #ifdef SISXINERAMA typedef struct _SiSXineramaData { int x; int y; int width; int height; } SiSXineramaData; #endif #endif extern const customttable SiS_customttable[]; /* prototypes */ extern void sisSaveUnlockExtRegisterLock(SISPtr pSiS, UChar *reg1, UChar *reg2); extern void sisRestoreExtRegisterLock(SISPtr pSiS, UChar reg1, UChar reg2); extern void SiSOptions(ScrnInfoPtr pScrn); extern const OptionInfoRec * SISAvailableOptions(int chipid, int busid); extern void SiSSetup(ScrnInfoPtr pScrn); extern void SISVGAPreInit(ScrnInfoPtr pScrn); extern Bool SiSHWCursorInit(ScreenPtr pScreen); extern Bool SiSAccelInit(ScreenPtr pScreen); extern Bool SiS300AccelInit(ScreenPtr pScreen); extern Bool SiS530AccelInit(ScreenPtr pScreen); extern Bool SiS315AccelInit(ScreenPtr pScreen); extern void SISInitVideo(ScreenPtr pScreen); extern void SIS6326InitVideo(ScreenPtr pScreen); extern Bool SISDGAInit(ScreenPtr pScreen); /* For extended mempy() support */ extern unsigned int SiSGetCPUFlags(ScrnInfoPtr pScrn); extern vidCopyFunc SiSVidCopyInit(ScreenPtr pScreen, vidCopyFunc *UMemCpy, Bool from); extern vidCopyFunc SiSVidCopyGetDefault(void); extern void SiSMemCopyToVideoRam(SISPtr pSiS, UChar *to, UChar *from, int size); extern void SiSMemCopyFromVideoRam(SISPtr pSiS, UChar *to, UChar *from, int size); extern void SiS_SetCHTVlumabandwidthcvbs(ScrnInfoPtr pScrn, int val); extern void SiS_SetCHTVlumabandwidthsvideo(ScrnInfoPtr pScrn, int val); extern void SiS_SetCHTVlumaflickerfilter(ScrnInfoPtr pScrn, int val); extern void SiS_SetCHTVchromabandwidth(ScrnInfoPtr pScrn, int val); extern void SiS_SetCHTVchromaflickerfilter(ScrnInfoPtr pScrn, int val); extern void SiS_SetCHTVcvbscolor(ScrnInfoPtr pScrn, int val); extern void SiS_SetCHTVtextenhance(ScrnInfoPtr pScrn, int val); extern void SiS_SetCHTVcontrast(ScrnInfoPtr pScrn, int val); extern void SiS_SetSISTVedgeenhance(ScrnInfoPtr pScrn, int val); extern void SiS_SetSISTVantiflicker(ScrnInfoPtr pScrn, int val); extern void SiS_SetSISTVsaturation(ScrnInfoPtr pScrn, int val); extern void SiS_SetSISTVcfilter(ScrnInfoPtr pScrn, int val); extern void SiS_SetSISTVyfilter(ScrnInfoPtr pScrn, int val); extern void SiS_SetSISTVcolcalib(ScrnInfoPtr pScrn, int val, Bool coarse); extern void SiS_SetSIS6326TVantiflicker(ScrnInfoPtr pScrn, int val); extern void SiS_SetSIS6326TVenableyfilter(ScrnInfoPtr pScrn, int val); extern void SiS_SetSIS6326TVyfilterstrong(ScrnInfoPtr pScrn, int val); extern void SiS_SetTVxposoffset(ScrnInfoPtr pScrn, int val); extern void SiS_SetTVyposoffset(ScrnInfoPtr pScrn, int val); extern void SiS_SetTVxscale(ScrnInfoPtr pScrn, int val); extern void SiS_SetTVyscale(ScrnInfoPtr pScrn, int val); extern int SiS_GetCHTVlumabandwidthcvbs(ScrnInfoPtr pScrn); extern int SiS_GetCHTVlumabandwidthsvideo(ScrnInfoPtr pScrn); extern int SiS_GetCHTVlumaflickerfilter(ScrnInfoPtr pScrn); extern int SiS_GetCHTVchromabandwidth(ScrnInfoPtr pScrn); extern int SiS_GetCHTVchromaflickerfilter(ScrnInfoPtr pScrn); extern int SiS_GetCHTVcvbscolor(ScrnInfoPtr pScrn); extern int SiS_GetCHTVtextenhance(ScrnInfoPtr pScrn); extern int SiS_GetCHTVcontrast(ScrnInfoPtr pScrn); extern int SiS_GetSISTVedgeenhance(ScrnInfoPtr pScrn); extern int SiS_GetSISTVantiflicker(ScrnInfoPtr pScrn); extern int SiS_GetSISTVsaturation(ScrnInfoPtr pScrn); extern int SiS_GetSISTVcfilter(ScrnInfoPtr pScrn); extern int SiS_GetSISTVyfilter(ScrnInfoPtr pScrn); extern int SiS_GetSISTVcolcalib(ScrnInfoPtr pScrn, Bool coarse); extern int SiS_GetSIS6326TVantiflicker(ScrnInfoPtr pScrn); extern int SiS_GetSIS6326TVenableyfilter(ScrnInfoPtr pScrn); extern int SiS_GetSIS6326TVyfilterstrong(ScrnInfoPtr pScrn); extern int SiS_GetTVxposoffset(ScrnInfoPtr pScrn); extern int SiS_GetTVyposoffset(ScrnInfoPtr pScrn); extern int SiS_GetTVxscale(ScrnInfoPtr pScrn); extern int SiS_GetTVyscale(ScrnInfoPtr pScrn); extern int SiS_GetSISCRT1SaturationGain(ScrnInfoPtr pScrn); extern void SiS_SetSISCRT1SaturationGain(ScrnInfoPtr pScrn, int val); extern unsigned int sis_pci_read_device_u32(int device, int offset); extern unsigned char sis_pci_read_device_u8(int device, int offset); extern unsigned int sis_pci_read_host_bridge_u32(int offset); extern unsigned char sis_pci_read_host_bridge_u8(int offset); extern void sis_pci_write_host_bridge_u8(int offset, unsigned char value); extern void sis_pci_write_host_bridge_u32(int offset, unsigned int value); #endif /* _SIS_H_ */ xf86-video-sis-0.10.7/src/sis_utility.c0000664000076400007640000024575111763614463014572 00000000000000/* * SiS driver utility interface & routines * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "sis.h" #include #include "dixstruct.h" #include "sis_videostr.h" #ifdef TWDEBUG #define SIS_NEED_orSISIDXREG #include "sis_regs.h" #endif /* Definitions for SISCTRL extension */ #define SISCTRL_PROTOCOL_NAME "SISCTRL" #define SISCTRL_MAJOR_VERSION 0 /* current version numbers */ #define SISCTRL_MINOR_VERSION 1 #define SISCTRL_MAX_SCREENS 32 /* number of screens the ext can handle */ #define X_SiSCtrlQueryVersion 0 #define X_SiSCtrlCommand 1 #define SDC_ID 0x53495321 #define SDC_VERSION 1 #define SDC_NUM_PARM_RESULT 20 /* sdc_command */ #define SDC_CMD_GETVERSION 0x98980001 #define SDC_CMD_GETHWINFO 0x98980002 #define SDC_CMD_GETALLFLAGS 0x98980003 #define SDC_CMD_GETVBFLAGSVERSION 0x98980004 #define SDC_CMD_GETVBFLAGS 0x98980005 #define SDC_CMD_CHECKMODEFORCRT2 0x98980006 #define SDC_CMD_SETVBFLAGS 0x98980007 #define SDC_CMD_GETDETECTEDDEVICES 0x98980008 #define SDC_CMD_REDETECTCRT2DEVICES 0x98980009 #define SDC_CMD_GETCRT1STATUS 0x9898000a #define SDC_CMD_SETCRT1STATUS 0x9898000b #define SDC_CMD_GETSDFLAGS 0x9898000c #define SDC_CMD_GETSD2FLAGS 0x9898000d #define SDC_CMD_GETLOCKSTATUS 0x9898000e #define SDC_CMD_SETLOCKSTATUS 0x9898000f #define SDC_CMD_GETTVANTIFLICKER 0x98980010 #define SDC_CMD_SETTVANTIFLICKER 0x98980011 #define SDC_CMD_GETTVSATURATION 0x98980012 #define SDC_CMD_SETTVSATURATION 0x98980013 #define SDC_CMD_GETTVEDGEENHANCE 0x98980014 #define SDC_CMD_SETTVEDGEENHANCE 0x98980015 #define SDC_CMD_GETTVCFILTER 0x98980016 #define SDC_CMD_SETTVCFILTER 0x98980017 #define SDC_CMD_GETTVYFILTER 0x98980018 #define SDC_CMD_SETTVYFILTER 0x98980019 #define SDC_CMD_GETTVCOLORCALIB 0x9898001a #define SDC_CMD_SETTVCOLORCALIB 0x9898001b #define SDC_CMD_GETTVCHCONTRAST 0x9898001c #define SDC_CMD_SETTVCHCONTRAST 0x9898001d #define SDC_CMD_GETTVCHTEXTENHANCE 0x9898001e #define SDC_CMD_SETTVCHTEXTENHANCE 0x9898001f #define SDC_CMD_GETTVCHCHROMAFLICKERFILTER 0x98980020 #define SDC_CMD_SETTVCHCHROMAFLICKERFILTER 0x98980021 #define SDC_CMD_GETTVCHLUMAFLICKERFILTER 0x98980022 #define SDC_CMD_SETTVCHLUMAFLICKERFILTER 0x98980023 #define SDC_CMD_GETTVCHCVBSCOLOR 0x98980024 #define SDC_CMD_SETTVCHCVBSCOLOR 0x98980025 #define SDC_CMD_GETCHTVOVERSCAN 0x98980026 #define SDC_CMD_SETCHTVOVERSCAN 0x98980027 #define SDC_CMD_GETGAMMASTATUS 0x98980028 #define SDC_CMD_SETGAMMASTATUS 0x98980029 #define SDC_CMD_GETTVXSCALE 0x9898002a #define SDC_CMD_SETTVXSCALE 0x9898002b #define SDC_CMD_GETTVYSCALE 0x9898002c #define SDC_CMD_SETTVYSCALE 0x9898002d #define SDC_CMD_GETSCREENSIZE 0x9898002e #define SDC_CMD_GETGAMMABRIGHTNESS 0x9898002f #define SDC_CMD_SETGAMMABRIGHTNESS 0x98980030 #define SDC_CMD_GETGAMMABRIGHTNESS2 0x98980031 #define SDC_CMD_SETGAMMABRIGHTNESS2 0x98980032 #define SDC_CMD_GETGETGAMMACRT2 0x98980033 #define SDC_CMD_SETGETGAMMACRT2 0x98980034 #define SDC_CMD_GETHWCURSORSTATUS 0x98980035 #define SDC_CMD_SETHWCURSORSTATUS 0x98980036 #define SDC_CMD_GETPANELMODE 0x98980037 #define SDC_CMD_SETPANELMODE 0x98980038 #define SDC_CMD_GETMERGEDMODEDETAILS 0x98980039 #define SDC_CMD_GETDEVICENAME 0x9898003a #define SDC_CMD_GETMONITORNAME 0x9898003b #define SDC_CMD_GETDEVICENAME2 0x9898003c #define SDC_CMD_GETMONITORNAME2 0x9898003d #define SDC_CMD_SETXVBRIGHTNESS 0x9898003e #define SDC_CMD_GETXVBRIGHTNESS 0x9898003f #define SDC_CMD_SETXVCONTRAST 0x98980040 #define SDC_CMD_GETXVCONTRAST 0x98980041 #define SDC_CMD_SETXVHUE 0x98980042 #define SDC_CMD_GETXVHUE 0x98980043 #define SDC_CMD_SETXVSATURATION 0x98980044 #define SDC_CMD_GETXVSATURATION 0x98980045 #define SDC_CMD_SETXVGAMMA 0x98980046 #define SDC_CMD_GETXVGAMMA 0x98980047 #define SDC_CMD_SETXVCOLORKEY 0x98980048 #define SDC_CMD_GETXVCOLORKEY 0x98980049 #define SDC_CMD_SETXVAUTOPAINTCOLORKEY 0x9898004a #define SDC_CMD_GETXVAUTOPAINTCOLORKEY 0x9898004b #define SDC_CMD_SETXVDEFAULTS 0x9898004c #define SDC_CMD_SETXVDISABLEGFX 0x9898004d #define SDC_CMD_GETXVDISABLEGFX 0x9898004e #define SDC_CMD_SETXVDISABLEGFXLR 0x9898004f #define SDC_CMD_GETXVDISABLEGFXLR 0x98980050 #define SDC_CMD_SETXVSWITCHCRT 0x98980051 #define SDC_CMD_GETXVSWITCHCRT 0x98980052 #define SDC_CMD_GETTVXPOS 0x98980053 #define SDC_CMD_SETTVXPOS 0x98980054 #define SDC_CMD_GETTVYPOS 0x98980055 #define SDC_CMD_SETTVYPOS 0x98980056 #define SDC_CMD_SETXVDEINT 0x98980057 #define SDC_CMD_GETXVDEINT 0x98980058 #define SDC_CMD_GETMONGAMMACRT1 0x98980059 #define SDC_CMD_GETMONGAMMACRT2 0x9898005a #define SDC_CMD_LOGQUIET 0x9898005b #define SDC_CMD_GETNEWGAMMABRICON 0x9898005c #define SDC_CMD_SETNEWGAMMABRICON 0x9898005d #define SDC_CMD_GETNEWGAMMABRICON2 0x9898005e #define SDC_CMD_SETNEWGAMMABRICON2 0x9898005f #define SDC_CMD_GETGETNEWGAMMACRT2 0x98980060 #define SDC_CMD_SETGETNEWGAMMACRT2 0x98980061 #define SDC_CMD_NEWSETVBFLAGS 0x98980062 #define SDC_CMD_GETCRT1SATGAIN 0x98980063 #define SDC_CMD_SETCRT1SATGAIN 0x98980064 #define SDC_CMD_GETCRT2SATGAIN 0x98980065 #define SDC_CMD_SETCRT2SATGAIN 0x98980066 /* more to come, adapt MAXCOMMAND! */ #define SDC_MAXCOMMAND SDC_CMD_SETCRT2SATGAIN /* in result_header */ #define SDC_RESULT_OK 0x66670000 #define SDC_RESULT_UNDEFCMD 0x66670001 #define SDC_RESULT_NOPERM 0x66670002 #define SDC_RESULT_INVAL 0x66670003 #define SDC_RESULT_MESSAGEERROR 0x66670004 /* Client side only */ #define SDC_RESULT_NOEXTENSION 0x66670005 /* Client side only */ /* For SDC_CMD_GETHWINFO */ #define SDC_BUS_TYPE_PCI 0 #define SDC_BUS_TYPE_AGP 1 #define SDC_BUS_TYPE_PCIE 2 #define SDC_BUS_TYPE_USB 3 /* For SDC_CMD_GETMERGEDMODEDETAILS */ #define SDC_MMODE_POS_ERROR 0 #define SDC_MMODE_POS_LEFTOF 1 #define SDC_MMODE_POS_RIGHTOF 2 #define SDC_MMODE_POS_ABOVE 3 #define SDC_MMODE_POS_BELOW 4 #define SDC_MMODE_POS_CLONE 5 typedef struct _SiSCtrlQueryVersion { CARD8 reqType; /* always SiSCtrlReqCode */ CARD8 SiSCtrlReqType; /* always X_SiSCtrlQueryVersion */ CARD16 length B16; } xSiSCtrlQueryVersionReq; #define sz_xSiSCtrlQueryVersionReq 4 typedef struct { BYTE type; /* X_Reply */ BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 majorVersion B16; /* major version of SISCTRL */ CARD16 minorVersion B16; /* minor version of SISCTRL */ CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xSiSCtrlQueryVersionReply; #define sz_xSiSCtrlQueryVersionReply 32 typedef struct { CARD8 reqType; /* always SiSCtrlReqCode */ CARD8 SiSCtrlReqType; /* always SiSCtrl_SiSCtrlCommand */ CARD16 length B16; CARD32 pad1 B32; CARD32 screen; CARD32 sdc_id; CARD32 sdc_chksum; CARD32 sdc_command; CARD32 sdc_parm[SDC_NUM_PARM_RESULT]; CARD32 sdc_result_header; CARD32 sdc_result[SDC_NUM_PARM_RESULT]; char sdc_buffer[32]; } xSiSCtrlCommandReq; #define sz_xSiSCtrlCommandReq (28 + (SDC_NUM_PARM_RESULT * 4 * 2) + 32) typedef struct { BYTE type; /* X_Reply */ BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 screen; CARD32 sdc_id; CARD32 sdc_chksum; CARD32 sdc_command; CARD32 sdc_parm[SDC_NUM_PARM_RESULT]; CARD32 sdc_result_header; CARD32 sdc_result[SDC_NUM_PARM_RESULT]; char sdc_buffer[32]; } xSiSCtrlCommandReply; #define sz_xSiSCtrlCommandReply (28 + (SDC_NUM_PARM_RESULT * 4 * 2) + 32) typedef struct { unsigned int maxscreens; /* Max number of entries = SISCTRL_MAX_SCREENS*/ unsigned int version_major; /* Extension major version */ unsigned int version_minor; /* Extension minor version */ int (*HandleSiSDirectCommand[SISCTRL_MAX_SCREENS])(xSiSCtrlCommandReply *); } xSiSCtrlScreenTable; void SiSCtrlExtInit(ScrnInfoPtr pScrn); void SiSCtrlExtUnregister(SISPtr pSiS, int index); #ifdef XV_SD_DEPRECATED int SISSetPortUtilAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value, SISPortPrivPtr pPriv); int SISGetPortUtilAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 *value, SISPortPrivPtr pPriv); #endif extern Bool SISRedetectCRT2Type(ScrnInfoPtr pScrn); extern UShort SiS_CheckModeCRT1(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags, Bool hcm); extern UShort SiS_CheckModeCRT2(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags, Bool hcm); extern void SISAdjustFrame(ADJUST_FRAME_ARGS_DECL); extern float SiSCalcVRate(DisplayModePtr mode); extern void SiS_UpdateGammaCRT2(ScrnInfoPtr pScrn); #ifdef SISGAMMARAMP extern void SISCalculateGammaRamp(ScreenPtr pScreen, ScrnInfoPtr pScrn); #endif extern void SISSetPortDefaults(ScrnInfoPtr pScrn, SISPortPrivPtr pPriv); extern void SISUpdateVideoParms(SISPtr pSiS, SISPortPrivPtr pPriv); extern void SiSUpdateXvGamma(SISPtr pSiS, SISPortPrivPtr pPriv); /*********************************** * Low-level routines * ***********************************/ static Bool SISSwitchCRT1Status(ScrnInfoPtr pScrn, int onoff, Bool quiet) { SISPtr pSiS = SISPTR(pScrn); DisplayModePtr mode = pScrn->currentMode; ULong vbflags = pSiS->VBFlags; ULong vbflags3 = pSiS->VBFlags3; int crt1off; /* onoff: 0=OFF, 1=ON(VGA), 2=ON(LCDA) */ /* Switching to LCDA will disable CRT2 if previously LCD or VGA, * unless on a dual-vb setup */ /* For usability reasons, the user should not simply "lose" one * of his output devices in MergedFB mode. Therefore, a switch * which might lead to this situation will not be performed in * MergedFB mode. (For example: If CRT2 is either LCD or VGA, * don't let the user switch to LCD-via-CRT1 mode, because he * would lose one output device since LCD-via-CRT1 is only * supported together with TV, not any other CRT2 type.) * In Non-MergedFB mode, losing one output device is not * considered that harmful. * Update: We let the user switch off a device if currently * a "clone" mode is active. Same for switching CRT1 to LCD * while CRT2 is LCD or VGA. */ /* Do NOT use this to switch from CRT1_LCDA to CRT2_LCD */ /* Only on 300 and 315/330/340 series */ if(pSiS->VGAEngine != SIS_300_VGA && pSiS->VGAEngine != SIS_315_VGA) return FALSE; /* Off only if at least one CRT2 device is active */ if((!onoff) && (!(vbflags & CRT2_ENABLE))) return FALSE; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) return FALSE; #endif /* Can't switch to LCDA if not supported (duh!) */ if(!(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTLCDA)) { if(onoff == 2) { if(!quiet) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "LCD-via-CRT1 not supported by hardware or no panel detected\n"); } return FALSE; } } #ifdef SISMERGED if(pSiS->MergedFB) { if(((SiSMergedDisplayModePtr)mode->Private)->CRT2Position != sisClone) { if(!onoff) { if(!quiet) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "CRT1 can't be switched off in MergedFB mode unless a clone mode is active\n"); } return FALSE; } else if(onoff == 2) { if(!(pSiS->SiS_SD3_Flags & SiS_SD3_SUPPORTDUALDVI)) { if(vbflags & (CRT2_LCD|CRT2_VGA)) { if(!quiet) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "CRT1 type can only be VGA while CRT2 is LCD or VGA\n"); } return FALSE; } } } } if(mode->Private) { mode = ((SiSMergedDisplayModePtr)mode->Private)->CRT1; } } #endif vbflags &= ~(DISPTYPE_CRT1 | SINGLE_MODE | MIRROR_MODE | CRT1_LCDA); vbflags3 &= ~(VB3_CRT1_TV | VB3_CRT1_LCD | VB3_CRT1_VGA); crt1off = 1; if(onoff > 0) { vbflags |= DISPTYPE_CRT1; crt1off = 0; if(onoff == 2) { vbflags |= CRT1_LCDA; vbflags3 |= VB3_CRT1_LCD; if(!(pSiS->SiS_SD3_Flags & SiS_SD3_SUPPORTDUALDVI)) { vbflags &= ~(CRT2_LCD|CRT2_VGA); } } else { vbflags3 |= VB3_CRT1_VGA; } /* Remember: Dualhead not supported */ if(vbflags & CRT2_ENABLE) vbflags |= MIRROR_MODE; else vbflags |= SINGLE_MODE; } else { vbflags |= SINGLE_MODE; } if(vbflags & CRT1_LCDA) { if(SiS_CheckModeCRT1(pScrn, mode, vbflags, pSiS->HaveCustomModes) < 0x14) { if(!quiet) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Current mode not suitable for LCD-via-CRT1\n"); } return FALSE; } } pSiS->CRT1off = crt1off; pSiS->VBFlags = pSiS->VBFlags_backup = vbflags; pSiS->VBFlags3 = pSiS->VBFlags_backup3 = vbflags3; /* Sync the accelerators */ (*pSiS->SyncAccel)(pScrn); pSiS->skipswitchcheck = TRUE; if(!(pScrn->SwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode)))) { pSiS->skipswitchcheck = FALSE; return FALSE; } pSiS->skipswitchcheck = FALSE; SISAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); return TRUE; } static Bool SISRedetectCRT2Devices(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); if((pSiS->VGAEngine != SIS_300_VGA) && (pSiS->VGAEngine != SIS_315_VGA)) { return FALSE; } #ifdef SISDUALHEAD if(pSiS->DualHeadMode) return FALSE; #endif /* Sync the accelerators */ (*pSiS->SyncAccel)(pScrn); if(SISRedetectCRT2Type(pScrn)) { /* If this returns TRUE, we need to reset the display mode */ /* Sync the accelerators */ (*pSiS->SyncAccel)(pScrn); pSiS->skipswitchcheck = TRUE; if(!(pScrn->SwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode)))) { pSiS->skipswitchcheck = FALSE; return FALSE; } pSiS->skipswitchcheck = FALSE; SISAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); } return TRUE; } static Bool SISSwitchCRT2Type(ScrnInfoPtr pScrn, ULong newvbflags, Bool quiet) { SISPtr pSiS = SISPTR(pScrn); Bool hcm = pSiS->HaveCustomModes; DisplayModePtr mode = pScrn->currentMode; /* Do NOT use this to switch from CRT2_LCD to CRT1_LCDA */ /* Switching CRT2 to LCD or VGA will switch CRT1 to VGA if * previously LCD-via-CRT1 */ /* For usability reasons, the user should not simply "lose" one * of his output devices in MergedFB mode. Therefore, a switch * which might lead to this situation will not be performed in * MergedFB mode. (For example: If CRT1 is LCD-via-CRT1, don't * let the user switch CRT2 to LCD or VGA mode, because he * would lose one output device since LCD-via-CRT1 is only * supported together with TV, not any other CRT2 type.) * In Non-MergedFB mode, losing one output device is not * considered that harmful. * Update: We allow this if currently a "clone" display mode * is active. */ /* Only on 300 and 315/330/340 series */ if(pSiS->VGAEngine != SIS_300_VGA && pSiS->VGAEngine != SIS_315_VGA) return FALSE; /* Only if there is a video bridge */ if(!(pSiS->VBFlags2 & VB2_VIDEOBRIDGE)) return FALSE; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) return FALSE; #endif #define SiS_NewVBMask (CRT2_ENABLE|CRT1_LCDA|TV_PAL|TV_NTSC|TV_PALM|TV_PALN|TV_NTSCJ| \ TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_YPBPRALL|\ TV_YPBPRAR) newvbflags &= SiS_NewVBMask; newvbflags |= pSiS->VBFlags & ~SiS_NewVBMask; if(!(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTLCDA)) { newvbflags &= ~CRT1_LCDA; } if(!(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTHIVISION)) { newvbflags &= ~TV_HIVISION; } if(!(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTYPBPR)) { newvbflags &= ~TV_YPBPR; } #ifdef SISMERGED if(pSiS->MergedFB) { if((mode->Private) && ((SiSMergedDisplayModePtr)mode->Private)->CRT2Position != sisClone) { if(!(newvbflags & CRT2_ENABLE)) { if(!quiet) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "CRT2 can't be switched off in MergedFB mode unless a clone mode is active\n"); } return FALSE; } if(!(pSiS->SiS_SD3_Flags & SiS_SD3_SUPPORTDUALDVI)) { if((newvbflags & (CRT2_LCD|CRT2_VGA)) && (newvbflags & CRT1_LCDA)) { if(!quiet) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "CRT2 type can only be TV while in LCD-via-CRT1 mode\n"); } return FALSE; } } } hcm = pSiS->HaveCustomModes2; if(mode->Private) { mode = ((SiSMergedDisplayModePtr)mode->Private)->CRT2; } } #endif if((!(newvbflags & CRT2_ENABLE)) && (!newvbflags & DISPTYPE_CRT1)) { if(!quiet) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "CRT2 can't be switched off while CRT1 is off\n"); } return FALSE; } /* CRT2_LCD and CRT2_VGA overrule LCDA (in non-MergedFB mode) */ if(!(pSiS->SiS_SD3_Flags & SiS_SD3_SUPPORTDUALDVI)) { if(newvbflags & (CRT2_LCD|CRT2_VGA)) { newvbflags &= ~CRT1_LCDA; } } /* Check if the current mode is suitable for desired output device (if any) */ if(SiS_CheckModeCRT2(pScrn, mode, newvbflags, hcm) < 0x14) { if(!quiet) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Current mode not suitable for desired CRT2 output device\n"); } return FALSE; } /* Remember: Dualhead not supported */ newvbflags &= ~(SINGLE_MODE | MIRROR_MODE); if((newvbflags & DISPTYPE_CRT1) && (newvbflags & CRT2_ENABLE)) { newvbflags |= MIRROR_MODE; } else { newvbflags |= SINGLE_MODE; } /* Sync the accelerators */ (*pSiS->SyncAccel)(pScrn); pSiS->VBFlags = pSiS->VBFlags_backup = newvbflags; pSiS->skipswitchcheck = TRUE; if(!(pScrn->SwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode)))) { pSiS->skipswitchcheck = FALSE; return FALSE; } pSiS->skipswitchcheck = FALSE; SISAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); return TRUE; } static Bool SISSwitchOutputType(ScrnInfoPtr pScrn, ULong newvbflags, ULong newvbflags3, ULong newvbflags4, Bool quiet) { /* For future use */ return FALSE; } static ULong SiSCondToVBFlags(UShort cond, ULong GivenVBFlags) { ULong vbflags = GivenVBFlags; /* No special treatment for NTSC-J here; conditions equal NTSC */ if(cond) { vbflags &= ~(CRT2_ENABLE | CRT1_LCDA | TV_STANDARD | TV_INTERFACE); if((cond & SiS_CF2_TYPEMASK) == SiS_CF2_LCD) { vbflags |= CRT2_LCD; } else if((cond & SiS_CF2_TYPEMASK) == SiS_CF2_TV) { vbflags |= (CRT2_TV | TV_SVIDEO); if(cond & SiS_CF2_TVPAL) vbflags |= TV_PAL; else if(cond & SiS_CF2_TVPALM) vbflags |= (TV_PAL | TV_PALM); else if(cond & SiS_CF2_TVPALN) vbflags |= (TV_PAL | TV_PALN); else if(cond & SiS_CF2_TVNTSC) vbflags |= TV_NTSC; } else if((cond & SiS_CF2_TYPEMASK) == SiS_CF2_TVSPECIAL) { vbflags |= CRT2_TV; if((cond & SiS_CF2_TVSPECMASK) == SiS_CF2_TVHIVISION) vbflags |= TV_HIVISION; else if((cond & SiS_CF2_TVSPECMASK) == SiS_CF2_TVYPBPR525I) vbflags |= (TV_YPBPR | TV_YPBPR525I); else if((cond & SiS_CF2_TVSPECMASK) == SiS_CF2_TVYPBPR525P) vbflags |= (TV_YPBPR | TV_YPBPR525P); else if((cond & SiS_CF2_TVSPECMASK) == SiS_CF2_TVYPBPR625I) vbflags |= (TV_YPBPR | TV_YPBPR625I); else if((cond & SiS_CF2_TVSPECMASK) == SiS_CF2_TVYPBPR625P) vbflags |= (TV_YPBPR | TV_YPBPR625P); else if((cond & SiS_CF2_TVSPECMASK) == SiS_CF2_TVYPBPR750P) vbflags |= (TV_YPBPR | TV_YPBPR750P); else if((cond & SiS_CF2_TVSPECMASK) == SiS_CF2_TVYPBPR1080I) vbflags |= (TV_YPBPR | TV_YPBPR1080I); } else if((cond & SiS_CF2_TYPEMASK) == SiS_CF2_VGA2) { vbflags |= CRT2_VGA; } else if((cond & SiS_CF2_TYPEMASK) == SiS_CF2_CRT1LCDA) { vbflags |= CRT1_LCDA; } } return(vbflags); } static int SISCheckModeForCRT2Type(ScrnInfoPtr pScrn, DisplayModePtr mode, ULong vbflags, UShort cond, Bool quiet) { SISPtr pSiS = SISPTR(pScrn); DisplayModePtr mastermode; Bool hcm = pSiS->HaveCustomModes; int result = 0; mastermode = mode; #ifdef SISDUALHEAD if((!pSiS->DualHeadMode) || (!pSiS->SecondHead)) { #endif if(vbflags & CRT2_ENABLE) { #ifdef SISMERGED if(pSiS->MergedFB) { hcm = pSiS->HaveCustomModes2; if(mode->Private) { mode = ((SiSMergedDisplayModePtr)mode->Private)->CRT2; } } #endif /* For RandR */ if((mode->HDisplay > pScrn->virtualX) || (mode->VDisplay > pScrn->virtualY)) { if(!quiet) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Desired mode too large for current screen size\n"); } result |= 0x02; } /* Check if the desired mode is suitable for current CRT2 output device */ if(SiS_CheckModeCRT2(pScrn, mode, vbflags, hcm) < 0x14) { if((!cond) && (!quiet)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Desired mode not suitable for current CRT2 output device\n"); } result |= 0x01; } } #ifdef SISDUALHEAD } #endif mode = mastermode; #ifdef SISDUALHEAD if((!pSiS->DualHeadMode) || (pSiS->SecondHead)) { #endif if(vbflags & CRT1_LCDA) { #ifdef SISMERGED if(pSiS->MergedFB) { hcm = pSiS->HaveCustomModes; if(mode->Private) { mode = ((SiSMergedDisplayModePtr)mode->Private)->CRT1; } } #endif /* For RandR */ if((mode->HDisplay > pScrn->virtualX) || (mode->VDisplay > pScrn->virtualY)) { if(!quiet) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Desired mode too large for current screen size\n"); } result |= 0x02; } /* Check if the desired mode is suitable for current CRT1 output device */ if(SiS_CheckModeCRT1(pScrn, mode, vbflags, hcm) < 0x14) { if((!cond) && (!quiet)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Desired mode not suitable for current CRT1 output device\n"); } result |= 0x01; } } #ifdef SISDUALHEAD } #endif return result; } #ifdef XV_SD_DEPRECATED static int SISCheckModeIndexForCRT2Type(ScrnInfoPtr pScrn, UShort cond, UShort index, Bool quiet) { SISPtr pSiS = SISPTR(pScrn); DisplayModePtr mode = pScrn->modes; ULong vbflags; int i; /* Not only CRT2, but also LCDA */ /* returns 0 if mode ok, * 0x01 if mode not ok for CRT2 device, * 0x02 if mode too large for current root window * or combinations thereof */ vbflags = SiSCondToVBFlags(cond, pSiS->VBFlags); /* Find mode of given index */ if(index) { for(i = 0; i < index; i++) { if(!mode) return 0x03; mode = mode->next; } } return(SISCheckModeForCRT2Type(pScrn, mode, vbflags, cond, quiet)); } #endif static DisplayModePtr sisFindModeFromTiming(ScrnInfoPtr pScrn, UShort hdisplay, UShort vdisplay, UShort htotal, UShort vtotal, UShort hsyncstart, UShort hsyncend, UShort vsyncstart, UShort vsyncend, int clock) { DisplayModePtr mode = pScrn->modes, pmode = pScrn->modes; Bool found = FALSE; do { if( (mode->HDisplay == hdisplay) && (mode->VDisplay == vdisplay) && (mode->HTotal == htotal) && (mode->VTotal == vtotal) && (mode->HSyncStart == hsyncstart) && (mode->VSyncStart == vsyncstart) && (mode->HSyncEnd == hsyncend) && (mode->VSyncEnd == vsyncend) && (mode->Clock == clock) ) { found = TRUE; break; } mode = mode->next; } while((mode) && (mode != pmode)); if(found) return mode; else return NULL; } static int SISCheckModeTimingForCRT2Type(ScrnInfoPtr pScrn, UShort cond, UShort hdisplay, UShort vdisplay, UShort htotal, UShort vtotal, UShort hsyncstart, UShort hsyncend, UShort vsyncstart, UShort vsyncend, int clock, Bool quiet) { SISPtr pSiS = SISPTR(pScrn); DisplayModePtr mode; ULong vbflags; /* Not only CRT2, but also LCDA */ /* returns 0 if mode ok, * 0x01 if mode not ok for CRT2 device, * 0x02 if mode too large for current root window * or combinations thereof */ vbflags = SiSCondToVBFlags(cond, pSiS->VBFlags); /* Find mode with given timing */ mode = sisFindModeFromTiming(pScrn, hdisplay, vdisplay, htotal, vtotal, hsyncstart, hsyncend, vsyncstart, vsyncend, clock); if(!mode) return 0x03; return(SISCheckModeForCRT2Type(pScrn, mode, vbflags, cond, quiet)); } #ifdef SISMERGED static void SISGetMergedModeDetails(ScrnInfoPtr pScrn, int hd, int vd, int ht, int vt, int hss, int hse, int vss, int vse, int clk, unsigned int *pos, unsigned int *crt1x, unsigned int *crt1y, unsigned int *crt1clk, unsigned int *crt2x, unsigned int *crt2y, unsigned int *crt2clk) { SISPtr pSiS = SISPTR(pScrn); DisplayModePtr mode, tmode; if(!pSiS->MergedFB) { *pos = SDC_MMODE_POS_ERROR; return; } /* Find mode with given timing */ mode = sisFindModeFromTiming(pScrn, hd, vd, ht, vt, hss, hse, vss, vse, clk); if(!mode) { *pos = SDC_MMODE_POS_ERROR; return; } switch(((SiSMergedDisplayModePtr)mode->Private)->CRT2Position) { case sisLeftOf: *pos = SDC_MMODE_POS_LEFTOF; break; case sisRightOf: *pos = SDC_MMODE_POS_RIGHTOF; break; case sisAbove: *pos = SDC_MMODE_POS_ABOVE; break; case sisBelow: *pos = SDC_MMODE_POS_BELOW; break; default: *pos = SDC_MMODE_POS_CLONE; } tmode = ((SiSMergedDisplayModePtr)mode->Private)->CRT1; *crt1x = tmode->HDisplay; *crt1y = tmode->VDisplay; *crt1clk = (unsigned int)SiSCalcVRate(tmode); tmode = ((SiSMergedDisplayModePtr)mode->Private)->CRT2; *crt2x = tmode->HDisplay; *crt2y = tmode->VDisplay; *crt2clk = (unsigned int)SiSCalcVRate(tmode); } #endif /*********************************** * SiSCtrl extension interface * ***********************************/ static void sisutil_prepare_string(xSiSCtrlCommandReply *sdcbuf, char *mystring) { int slen = 0; sdcbuf->sdc_buffer[0] = 0; if(mystring) { slen = strlen(mystring); if(slen > 31) slen = 31; strncpy(&sdcbuf->sdc_buffer[0], mystring, slen); sdcbuf->sdc_buffer[slen] = 0; } sdcbuf->sdc_result[0] = slen; } static int SiSHandleSiSDirectCommand(xSiSCtrlCommandReply *sdcbuf) { ScrnInfoPtr pScrn = xf86ScreenToScrn(screenInfo.screens[sdcbuf->screen]); SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; #endif SISPortPrivPtr pPriv = NULL; int i; ULong j; if(sdcbuf->sdc_id != SDC_ID) return BadMatch; if(pSiS->adaptor) { pPriv = GET_PORT_PRIVATE(pScrn); } j = sdcbuf->sdc_command; for(i = 0; i < SDC_NUM_PARM_RESULT; i++) { j += sdcbuf->sdc_parm[i]; } if(j != sdcbuf->sdc_chksum) return BadMatch; sdcbuf->sdc_result_header = SDC_RESULT_OK; switch(sdcbuf->sdc_command) { case SDC_CMD_GETVERSION: sdcbuf->sdc_result[0] = SDC_VERSION; sdcbuf->sdc_result[1] = SDC_MAXCOMMAND; break; case SDC_CMD_GETHWINFO: { UShort romptr = 0; char *biosvers = NULL; int slen = 0; if(pSiS->BIOS) { romptr = pSiS->BIOS[0x16] | (pSiS->BIOS[0x17] << 8); if(romptr < 65530) { biosvers = (char *)&pSiS->BIOS[romptr]; slen = strlen(biosvers); if(slen > 10) slen = 10; } } sdcbuf->sdc_result[0] = pSiS->IsAGPCard ? SDC_BUS_TYPE_AGP : SDC_BUS_TYPE_PCI; if(pSiS->IsPCIExpress) sdcbuf->sdc_result[0] = SDC_BUS_TYPE_PCIE; sdcbuf->sdc_result[1] = pSiS->PciBus; sdcbuf->sdc_result[2] = pSiS->PciDevice; sdcbuf->sdc_result[3] = pSiS->PciFunc; sdcbuf->sdc_result[4] = pSiS->ROM661New ? 1 : (pSiS->HaveXGIBIOS ? 2 : 0), sdcbuf->sdc_result[5] = pSiS->ChipFlags; sdcbuf->sdc_result[6] = pSiS->ChipType; sdcbuf->sdc_result[7] = pSiS->ChipRev; sdcbuf->sdc_result[8] = SISDRIVERVERSIONYEAR; sdcbuf->sdc_result[9] = SISDRIVERVERSIONMONTH; sdcbuf->sdc_result[10] = SISDRIVERVERSIONDAY; sdcbuf->sdc_result[11] = SISDRIVERREVISION; sdcbuf->sdc_result[12] = pScrn->videoRam; sdcbuf->sdc_result[13] = pSiS->UMAsize; sdcbuf->sdc_result[14] = pSiS->LFBsize; if(slen) strncpy(&sdcbuf->sdc_buffer[0], biosvers, slen); sdcbuf->sdc_buffer[slen] = 0; } break; case SDC_CMD_GETALLFLAGS: sdcbuf->sdc_result[0] = SIS_VBFlagsVersion; sdcbuf->sdc_result[1] = pSiS->VBFlags; sdcbuf->sdc_result[2] = pSiS->SiS_SD_Flags; sdcbuf->sdc_result[3] = pSiS->SiS_SD2_Flags; sdcbuf->sdc_result[4] = pSiS->detectedCRT2Devices; sdcbuf->sdc_result[5] = pSiS->VBFlags2; sdcbuf->sdc_result[6] = pSiS->SiS_SD3_Flags; sdcbuf->sdc_result[7] = pSiS->SiS_SD4_Flags; sdcbuf->sdc_result[8] = pSiS->VBFlags3; sdcbuf->sdc_result[9] = pSiS->VBFlags4; break; case SDC_CMD_GETVBFLAGSVERSION: sdcbuf->sdc_result[0] = SIS_VBFlagsVersion; break; case SDC_CMD_GETVBFLAGS: sdcbuf->sdc_result[0] = pSiS->VBFlags; sdcbuf->sdc_result[1] = pSiS->VBFlags2; sdcbuf->sdc_result[2] = pSiS->VBFlags3; sdcbuf->sdc_result[3] = pSiS->VBFlags4; break; case SDC_CMD_CHECKMODEFORCRT2: { int clk, hd, hss, hse, ht, vd, vss, vse, vt, result; ULong flags; flags = sdcbuf->sdc_parm[0]; clk = sdcbuf->sdc_parm[1]; hd = sdcbuf->sdc_parm[2]; hss = sdcbuf->sdc_parm[3]; hse = sdcbuf->sdc_parm[4]; ht = sdcbuf->sdc_parm[5]; vd = sdcbuf->sdc_parm[6]; vss = sdcbuf->sdc_parm[7]; vse = sdcbuf->sdc_parm[8]; vt = sdcbuf->sdc_parm[9]; result = SISCheckModeTimingForCRT2Type(pScrn, (UShort)(flags & 0xff), hd, vd, ht, vt, hss, hse, vss, vse, clk, pSiS->SCLogQuiet) & 0xff; sdcbuf->sdc_result[0] = result; } break; case SDC_CMD_SETVBFLAGS: #ifdef SISDUALHEAD if(!pSiS->DualHeadMode) { #endif if(pSiS->xv_sisdirectunlocked) { SISSwitchCRT2Type(pScrn, (ULong)sdcbuf->sdc_parm[0], pSiS->SCLogQuiet); if(pPriv) SISUpdateVideoParms(pSiS, pPriv); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; #ifdef SISDUALHEAD } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; #endif break; case SDC_CMD_NEWSETVBFLAGS: #ifdef SISDUALHEAD if(!pSiS->DualHeadMode) { #endif if(pSiS->xv_sisdirectunlocked) { SISSwitchOutputType(pScrn, (ULong)sdcbuf->sdc_parm[0], (ULong)sdcbuf->sdc_parm[1], (ULong)sdcbuf->sdc_parm[2], pSiS->SCLogQuiet); if(pPriv) SISUpdateVideoParms(pSiS, pPriv); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; #ifdef SISDUALHEAD } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; #endif break; case SDC_CMD_GETDETECTEDDEVICES: sdcbuf->sdc_result[0] = pSiS->detectedCRT2Devices; break; case SDC_CMD_REDETECTCRT2DEVICES: #ifdef SISDUALHEAD if(!pSiS->DualHeadMode) { #endif if(pSiS->xv_sisdirectunlocked) { SISRedetectCRT2Devices(pScrn); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; #ifdef SISDUALHEAD } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; #endif break; case SDC_CMD_GETCRT1STATUS: sdcbuf->sdc_result[0] = pSiS->CRT1isoff ? 0 : 1; break; case SDC_CMD_SETCRT1STATUS: #ifdef SISDUALHEAD if(!pSiS->DualHeadMode) { #endif if(pSiS->xv_sisdirectunlocked) { SISSwitchCRT1Status(pScrn, (ULong)sdcbuf->sdc_parm[0], pSiS->SCLogQuiet); if(pPriv) SISUpdateVideoParms(pSiS, pPriv); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; #ifdef SISDUALHEAD } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; #endif break; case SDC_CMD_GETSDFLAGS: sdcbuf->sdc_result[0] = pSiS->SiS_SD_Flags; break; case SDC_CMD_GETSD2FLAGS: sdcbuf->sdc_result[0] = pSiS->SiS_SD2_Flags; break; case SDC_CMD_GETLOCKSTATUS: sdcbuf->sdc_result[0] = pSiS->xv_sisdirectunlocked; break; case SDC_CMD_SETLOCKSTATUS: if(pSiS->enablesisctrl) { if(sdcbuf->sdc_parm[0] == SIS_DIRECTKEY) { pSiS->xv_sisdirectunlocked++; } else if(pSiS->xv_sisdirectunlocked) { pSiS->xv_sisdirectunlocked--; } } else { pSiS->xv_sisdirectunlocked = 0; sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; } break; case SDC_CMD_GETTVANTIFLICKER: sdcbuf->sdc_result[0] = SiS_GetSISTVantiflicker(pScrn); break; case SDC_CMD_SETTVANTIFLICKER: if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVantiflicker(pScrn, (int)sdcbuf->sdc_parm[0]); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETTVSATURATION: sdcbuf->sdc_result[0] = SiS_GetSISTVsaturation(pScrn); break; case SDC_CMD_SETTVSATURATION: if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVsaturation(pScrn, (int)sdcbuf->sdc_parm[0]); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETTVEDGEENHANCE: sdcbuf->sdc_result[0] = SiS_GetSISTVedgeenhance(pScrn);; break; case SDC_CMD_SETTVEDGEENHANCE: if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVedgeenhance(pScrn, (int)sdcbuf->sdc_parm[0]); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETTVCFILTER: sdcbuf->sdc_result[0] = SiS_GetSISTVcfilter(pScrn); break; case SDC_CMD_SETTVCFILTER: if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVcfilter(pScrn, sdcbuf->sdc_parm[0] ? 1 : 0); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETTVYFILTER: sdcbuf->sdc_result[0] = SiS_GetSISTVyfilter(pScrn); break; case SDC_CMD_SETTVYFILTER: if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVyfilter(pScrn, sdcbuf->sdc_parm[0]); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETTVCOLORCALIB: sdcbuf->sdc_result[0] = SiS_GetSISTVcolcalib(pScrn, TRUE) + 32768; sdcbuf->sdc_result[1] = SiS_GetSISTVcolcalib(pScrn, FALSE) + 32768; break; case SDC_CMD_SETTVCOLORCALIB: if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVcolcalib(pScrn, (int)sdcbuf->sdc_parm[0] - 32768, TRUE); SiS_SetSISTVcolcalib(pScrn, (int)sdcbuf->sdc_parm[1] - 32768, FALSE); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETTVCHCONTRAST: sdcbuf->sdc_result[0] = SiS_GetCHTVcontrast(pScrn); break; case SDC_CMD_SETTVCHCONTRAST: if(pSiS->xv_sisdirectunlocked) { SiS_SetCHTVcontrast(pScrn, (int)sdcbuf->sdc_parm[0]); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETTVCHTEXTENHANCE: sdcbuf->sdc_result[0] = SiS_GetCHTVtextenhance(pScrn); break; case SDC_CMD_SETTVCHTEXTENHANCE: if(pSiS->xv_sisdirectunlocked) { SiS_SetCHTVtextenhance(pScrn, (int)sdcbuf->sdc_parm[0]); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETTVCHCHROMAFLICKERFILTER: sdcbuf->sdc_result[0] = SiS_GetCHTVchromaflickerfilter(pScrn); break; case SDC_CMD_SETTVCHCHROMAFLICKERFILTER: if(pSiS->xv_sisdirectunlocked) { SiS_SetCHTVchromaflickerfilter(pScrn, (int)sdcbuf->sdc_parm[0]); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETTVCHLUMAFLICKERFILTER: sdcbuf->sdc_result[0] = SiS_GetCHTVlumaflickerfilter(pScrn); break; case SDC_CMD_SETTVCHLUMAFLICKERFILTER: if(pSiS->xv_sisdirectunlocked) { SiS_SetCHTVlumaflickerfilter(pScrn, (int)sdcbuf->sdc_parm[0]); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETTVCHCVBSCOLOR: sdcbuf->sdc_result[0] = SiS_GetCHTVcvbscolor(pScrn); break; case SDC_CMD_SETTVCHCVBSCOLOR: if(pSiS->xv_sisdirectunlocked) { SiS_SetCHTVcvbscolor(pScrn, sdcbuf->sdc_parm[0] ? 1 : 0); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETCHTVOVERSCAN: { /* Changing of CRT2 settings not supported in DHM! */ int i = 0; if(pSiS->OptTVSOver == 1) i = 3; else if(pSiS->UseCHOverScan == 1) i = 2; else if(pSiS->UseCHOverScan == 0) i = 1; sdcbuf->sdc_result[0] = i; } break; case SDC_CMD_SETCHTVOVERSCAN: if(pSiS->xv_sisdirectunlocked) { pSiS->UseCHOverScan = -1; pSiS->OptTVSOver = FALSE; if(sdcbuf->sdc_parm[0] == 3) { if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTSOVER) { pSiS->OptTVSOver = TRUE; } pSiS->UseCHOverScan = 1; } else if(sdcbuf->sdc_parm[0] == 2) pSiS->UseCHOverScan = 1; else if(sdcbuf->sdc_parm[0] == 1) pSiS->UseCHOverScan = 0; } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETGAMMASTATUS: { int i = 0; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiSEnt->CRT1gamma) i |= 0x01; if(pSiSEnt->CRT2gamma) i |= 0x02; } else { #endif if(pSiS->CRT1gamma) i |= 0x01; if(pSiS->CRT2gamma) i |= 0x02; if(pSiS->CRT2SepGamma) i |= 0x08; #ifdef SISDUALHEAD } #endif if(pSiS->XvGamma) i |= 0x04; sdcbuf->sdc_result[0] = i; } break; case SDC_CMD_SETGAMMASTATUS: if(pSiS->xv_sisdirectunlocked) { int value = sdcbuf->sdc_parm[0]; Bool backup = pSiS->XvGamma; Bool backup2 = pSiS->CRT2SepGamma; pSiS->CRT1gamma = (value & 0x01) ? TRUE : FALSE; pSiS->CRT2gamma = (value & 0x02) ? TRUE : FALSE; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiSEnt->CRT1gamma = pSiS->CRT1gamma; pSiSEnt->CRT2gamma = pSiS->CRT2gamma; } #endif if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTSGRCRT2) { pSiS->CRT2SepGamma = (value & 0x08) ? TRUE : FALSE; if(pSiS->CRT2SepGamma != backup2) { if(pSiS->CRT2SepGamma) { SiS_UpdateGammaCRT2(pScrn); } #ifdef SISGAMMARAMP else { SISCalculateGammaRamp(pScrn->pScreen, pScrn); } #endif /* ATTN: When disabling CRT2 sep gamma, * as long as SISGAMMARAMP is not defined, * application needs to reset palette using * vidmodextension! (See SiS_SD_CANSETGAMMA) * * Note: Difference between setting gamma values * for CRT1 and CRT2: For CRT1, driver only * stores the values, but does nothing with them; * App needs to calc gamma ramp itself for CRT1, * and set it using the VidModExtention. * For CRT2, the driver will IMMEDIATELY recalc * the palette. */ } } else pSiS->CRT2SepGamma = FALSE; pSiS->XvGamma = (value & 0x04) ? TRUE : FALSE; if(pSiS->VGAEngine == SIS_315_VGA) { if(backup != pSiS->XvGamma) { if(pPriv) SiSUpdateXvGamma(pSiS, pPriv); } } } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETTVXSCALE: sdcbuf->sdc_result[0] = SiS_GetTVxscale(pScrn) + 32768; break; case SDC_CMD_SETTVXSCALE: { int value = sdcbuf->sdc_parm[0] - 32768; if((value < -16) || (value > 16)) { sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else if(pSiS->xv_sisdirectunlocked) { SiS_SetTVxscale(pScrn, value); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; } break; case SDC_CMD_GETTVYSCALE: sdcbuf->sdc_result[0] = SiS_GetTVyscale(pScrn) + 32768; break; case SDC_CMD_SETTVYSCALE: { int value = sdcbuf->sdc_parm[0] - 32768; if((value < -4) || (value > 3)) { sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else if(pSiS->xv_sisdirectunlocked) { SiS_SetTVyscale(pScrn, value); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; } break; case SDC_CMD_GETSCREENSIZE: sdcbuf->sdc_result[0] = (pScrn->virtualX << 16) | pScrn->virtualY; break; case SDC_CMD_GETGAMMABRIGHTNESS: /* xv_BRx, xv_PBx */ sdcbuf->sdc_result[0] = pSiS->GammaBriR; sdcbuf->sdc_result[1] = pSiS->GammaBriG; sdcbuf->sdc_result[2] = pSiS->GammaBriB; break; case SDC_CMD_GETNEWGAMMABRICON: /* no xv pendant */ sdcbuf->sdc_result[0] = (CARD32)(((int)(pSiS->NewGammaBriR * 1000.0)) + 1000); sdcbuf->sdc_result[1] = (CARD32)(((int)(pSiS->NewGammaBriG * 1000.0)) + 1000); sdcbuf->sdc_result[2] = (CARD32)(((int)(pSiS->NewGammaBriB * 1000.0)) + 1000); sdcbuf->sdc_result[3] = (CARD32)(((int)(pSiS->NewGammaConR * 1000.0)) + 1000); sdcbuf->sdc_result[4] = (CARD32)(((int)(pSiS->NewGammaConG * 1000.0)) + 1000); sdcbuf->sdc_result[5] = (CARD32)(((int)(pSiS->NewGammaConB * 1000.0)) + 1000); break; case SDC_CMD_SETGAMMABRIGHTNESS: /* xv_BRx, xv_PBx */ if(sdcbuf->sdc_parm[0] < 100 || sdcbuf->sdc_parm[0] > 10000 || sdcbuf->sdc_parm[1] < 100 || sdcbuf->sdc_parm[1] > 10000 || sdcbuf->sdc_parm[2] < 100 || sdcbuf->sdc_parm[2] > 10000) { sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else if(pSiS->xv_sisdirectunlocked) { pSiS->GammaBriR = sdcbuf->sdc_parm[0]; pSiS->GammaBriG = sdcbuf->sdc_parm[1]; pSiS->GammaBriB = sdcbuf->sdc_parm[2]; pSiS->NewGammaBriR = pSiS->NewGammaBriG = pSiS->NewGammaBriB = 0.0; pSiS->NewGammaConR = pSiS->NewGammaConG = pSiS->NewGammaConB = 0.0; pSiS->SiS_SD3_Flags |= SiS_SD3_OLDGAMMAINUSE; } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_SETNEWGAMMABRICON: /* no xv pendant */ if(sdcbuf->sdc_parm[0] > 2000 || sdcbuf->sdc_parm[1] > 2000 || sdcbuf->sdc_parm[2] > 2000 || sdcbuf->sdc_parm[3] > 2000 || sdcbuf->sdc_parm[4] > 2000 || sdcbuf->sdc_parm[5] > 2000) { sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else if(pSiS->xv_sisdirectunlocked) { pSiS->NewGammaBriR = ((float)((int)sdcbuf->sdc_parm[0] - 1000)) / 1000.0; pSiS->NewGammaBriG = ((float)((int)sdcbuf->sdc_parm[1] - 1000)) / 1000.0; pSiS->NewGammaBriB = ((float)((int)sdcbuf->sdc_parm[2] - 1000)) / 1000.0; pSiS->NewGammaConR = ((float)((int)sdcbuf->sdc_parm[3] - 1000)) / 1000.0; pSiS->NewGammaConG = ((float)((int)sdcbuf->sdc_parm[4] - 1000)) / 1000.0; pSiS->NewGammaConB = ((float)((int)sdcbuf->sdc_parm[5] - 1000)) / 1000.0; pSiS->GammaBriR = pSiS->GammaBriG = pSiS->GammaBriB = 1000; pSiS->SiS_SD3_Flags &= ~SiS_SD3_OLDGAMMAINUSE; } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETGAMMABRIGHTNESS2: /* xv_BRx2, xv_PBx2 */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { sdcbuf->sdc_result[0] = pSiSEnt->GammaBriR; sdcbuf->sdc_result[1] = pSiSEnt->GammaBriG; sdcbuf->sdc_result[2] = pSiSEnt->GammaBriB; break; } #endif sdcbuf->sdc_result[0] = pSiS->GammaBriR; sdcbuf->sdc_result[1] = pSiS->GammaBriG; sdcbuf->sdc_result[2] = pSiS->GammaBriB; break; case SDC_CMD_GETNEWGAMMABRICON2: /* no xv pendant */ #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { sdcbuf->sdc_result[0] = (CARD32)(((int)(pSiSEnt->NewGammaBriR * 1000.0)) + 1000); sdcbuf->sdc_result[1] = (CARD32)(((int)(pSiSEnt->NewGammaBriG * 1000.0)) + 1000); sdcbuf->sdc_result[2] = (CARD32)(((int)(pSiSEnt->NewGammaBriB * 1000.0)) + 1000); sdcbuf->sdc_result[3] = (CARD32)(((int)(pSiSEnt->NewGammaConR * 1000.0)) + 1000); sdcbuf->sdc_result[4] = (CARD32)(((int)(pSiSEnt->NewGammaConG * 1000.0)) + 1000); sdcbuf->sdc_result[5] = (CARD32)(((int)(pSiSEnt->NewGammaConB * 1000.0)) + 1000); break; } #endif sdcbuf->sdc_result[0] = (CARD32)(((int)(pSiS->NewGammaBriR * 1000.0)) + 1000); sdcbuf->sdc_result[1] = (CARD32)(((int)(pSiS->NewGammaBriG * 1000.0)) + 1000); sdcbuf->sdc_result[2] = (CARD32)(((int)(pSiS->NewGammaBriB * 1000.0)) + 1000); sdcbuf->sdc_result[3] = (CARD32)(((int)(pSiS->NewGammaConR * 1000.0)) + 1000); sdcbuf->sdc_result[4] = (CARD32)(((int)(pSiS->NewGammaConG * 1000.0)) + 1000); sdcbuf->sdc_result[5] = (CARD32)(((int)(pSiS->NewGammaConB * 1000.0)) + 1000); break; case SDC_CMD_SETGAMMABRIGHTNESS2: /* xv_BRx2, xv_PBx2 */ if(sdcbuf->sdc_parm[0] < 100 || sdcbuf->sdc_parm[0] > 10000 || sdcbuf->sdc_parm[1] < 100 || sdcbuf->sdc_parm[1] > 10000 || sdcbuf->sdc_parm[2] < 100 || sdcbuf->sdc_parm[2] > 10000) { sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else if(pSiS->xv_sisdirectunlocked) { pSiS->SiS_SD3_Flags |= SiS_SD3_OLDGAMMAINUSE; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiSEnt->GammaBriR = sdcbuf->sdc_parm[0]; pSiSEnt->GammaBriG = sdcbuf->sdc_parm[1]; pSiSEnt->GammaBriB = sdcbuf->sdc_parm[2]; pSiSEnt->NewGammaBriR = pSiSEnt->NewGammaBriG = pSiSEnt->NewGammaBriB = 0.0; pSiSEnt->NewGammaConR = pSiSEnt->NewGammaConG = pSiSEnt->NewGammaConB = 0.0; } #endif } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_SETNEWGAMMABRICON2: /* no xv pendant */ if(sdcbuf->sdc_parm[0] > 2000 || sdcbuf->sdc_parm[1] > 2000 || sdcbuf->sdc_parm[2] > 2000 || sdcbuf->sdc_parm[3] > 2000 || sdcbuf->sdc_parm[4] > 2000 || sdcbuf->sdc_parm[5] > 2000) { sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else if(pSiS->xv_sisdirectunlocked) { pSiS->SiS_SD3_Flags &= ~SiS_SD3_OLDGAMMAINUSE; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiSEnt->NewGammaBriR = ((float)((int)sdcbuf->sdc_parm[0] - 1000)) / 1000.0; pSiSEnt->NewGammaBriG = ((float)((int)sdcbuf->sdc_parm[1] - 1000)) / 1000.0; pSiSEnt->NewGammaBriB = ((float)((int)sdcbuf->sdc_parm[2] - 1000)) / 1000.0; pSiSEnt->NewGammaConR = ((float)((int)sdcbuf->sdc_parm[3] - 1000)) / 1000.0; pSiSEnt->NewGammaConG = ((float)((int)sdcbuf->sdc_parm[4] - 1000)) / 1000.0; pSiSEnt->NewGammaConB = ((float)((int)sdcbuf->sdc_parm[5] - 1000)) / 1000.0; pSiSEnt->GammaBriR = pSiSEnt->GammaBriG = pSiSEnt->GammaBriB = 1000; } #endif } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETGETGAMMACRT2: sdcbuf->sdc_result[0] = (ULong)(pSiS->GammaR2 * 1000); sdcbuf->sdc_result[1] = (ULong)(pSiS->GammaG2 * 1000); sdcbuf->sdc_result[2] = (ULong)(pSiS->GammaB2 * 1000); sdcbuf->sdc_result[3] = pSiS->GammaBriR2; sdcbuf->sdc_result[4] = pSiS->GammaBriG2; sdcbuf->sdc_result[5] = pSiS->GammaBriB2; break; case SDC_CMD_GETGETNEWGAMMACRT2: sdcbuf->sdc_result[0] = (ULong)(pSiS->GammaR2 * 1000); sdcbuf->sdc_result[1] = (ULong)(pSiS->GammaG2 * 1000); sdcbuf->sdc_result[2] = (ULong)(pSiS->GammaB2 * 1000); sdcbuf->sdc_result[3] = (CARD32)(((int)(pSiS->NewGammaBriR2 * 1000.0)) + 1000); sdcbuf->sdc_result[4] = (CARD32)(((int)(pSiS->NewGammaBriG2 * 1000.0)) + 1000); sdcbuf->sdc_result[5] = (CARD32)(((int)(pSiS->NewGammaBriB2 * 1000.0)) + 1000); sdcbuf->sdc_result[6] = (CARD32)(((int)(pSiS->NewGammaConR2 * 1000.0)) + 1000); sdcbuf->sdc_result[7] = (CARD32)(((int)(pSiS->NewGammaConG2 * 1000.0)) + 1000); sdcbuf->sdc_result[8] = (CARD32)(((int)(pSiS->NewGammaConB2 * 1000.0)) + 1000); break; case SDC_CMD_SETGETGAMMACRT2: if(sdcbuf->sdc_parm[0] < 100 || sdcbuf->sdc_parm[0] > 10000 || sdcbuf->sdc_parm[1] < 100 || sdcbuf->sdc_parm[1] > 10000 || sdcbuf->sdc_parm[2] < 100 || sdcbuf->sdc_parm[2] > 10000 || sdcbuf->sdc_parm[3] < 100 || sdcbuf->sdc_parm[3] > 10000 || sdcbuf->sdc_parm[4] < 100 || sdcbuf->sdc_parm[4] > 10000 || sdcbuf->sdc_parm[5] < 100 || sdcbuf->sdc_parm[5] > 10000) { sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else if(pSiS->xv_sisdirectunlocked) { pSiS->GammaR2 = (float)sdcbuf->sdc_parm[0] / (float)1000; pSiS->GammaG2 = (float)sdcbuf->sdc_parm[1] / (float)1000; pSiS->GammaB2 = (float)sdcbuf->sdc_parm[2] / (float)1000; pSiS->GammaBriR2 = sdcbuf->sdc_parm[3]; pSiS->GammaBriG2 = sdcbuf->sdc_parm[4]; pSiS->GammaBriB2 = sdcbuf->sdc_parm[5]; pSiS->NewGammaBriR2 = pSiS->NewGammaBriG2 = pSiS->NewGammaBriB2 = 0.0; pSiS->NewGammaConR2 = pSiS->NewGammaConG2 = pSiS->NewGammaConB2 = 0.0; pSiS->SiS_SD3_Flags |= SiS_SD3_OLDGAMMAINUSE; SiS_UpdateGammaCRT2(pScrn); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_SETGETNEWGAMMACRT2: if(sdcbuf->sdc_parm[0] < 100 || sdcbuf->sdc_parm[0] > 10000 || sdcbuf->sdc_parm[1] < 100 || sdcbuf->sdc_parm[1] > 10000 || sdcbuf->sdc_parm[2] < 100 || sdcbuf->sdc_parm[2] > 10000 || sdcbuf->sdc_parm[3] > 2000 || sdcbuf->sdc_parm[4] > 2000 || sdcbuf->sdc_parm[5] > 2000 || sdcbuf->sdc_parm[6] > 2000 || sdcbuf->sdc_parm[7] > 2000 || sdcbuf->sdc_parm[8] > 2000) { sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else if(pSiS->xv_sisdirectunlocked) { pSiS->GammaR2 = (float)sdcbuf->sdc_parm[0] / (float)1000; pSiS->GammaG2 = (float)sdcbuf->sdc_parm[1] / (float)1000; pSiS->GammaB2 = (float)sdcbuf->sdc_parm[2] / (float)1000; pSiS->NewGammaBriR2 = ((float)((int)sdcbuf->sdc_parm[3] - 1000)) / 1000.0; pSiS->NewGammaBriG2 = ((float)((int)sdcbuf->sdc_parm[4] - 1000)) / 1000.0; pSiS->NewGammaBriB2 = ((float)((int)sdcbuf->sdc_parm[5] - 1000)) / 1000.0; pSiS->NewGammaConR2 = ((float)((int)sdcbuf->sdc_parm[6] - 1000)) / 1000.0; pSiS->NewGammaConG2 = ((float)((int)sdcbuf->sdc_parm[7] - 1000)) / 1000.0; pSiS->NewGammaConB2 = ((float)((int)sdcbuf->sdc_parm[8] - 1000)) / 1000.0; pSiS->GammaBriR2 = pSiS->GammaBriG2 = pSiS->GammaBriB2 = 1000; pSiS->SiS_SD3_Flags &= ~SiS_SD3_OLDGAMMAINUSE; SiS_UpdateGammaCRT2(pScrn); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETHWCURSORSTATUS: sdcbuf->sdc_result[0] = pSiS->HideHWCursor ? 1 : 0; break; case SDC_CMD_SETHWCURSORSTATUS: if(pSiS->xv_sisdirectunlocked) { Bool VisibleBackup = pSiS->HWCursorIsVisible; pSiS->HideHWCursor = sdcbuf->sdc_parm[0] ? TRUE : FALSE; if(pSiS->CursorInfoPtr) { if(VisibleBackup) { if(sdcbuf->sdc_parm[0]) { (pSiS->CursorInfoPtr->HideCursor)(pScrn); } else { (pSiS->CursorInfoPtr->ShowCursor)(pScrn); } } pSiS->HWCursorIsVisible = VisibleBackup; } } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETPANELMODE: { int i = 0; if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTSCALE) { switch(pSiS->SiS_Pr->UsePanelScaler) { case -1: i |= 0x01; break; case 1: i |= 0x02; break; } if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTCENTER) { switch(pSiS->SiS_Pr->CenterScreen) { case -1: i |= 0x04; break; case 1: i |= 0x08; break; } } } sdcbuf->sdc_result[0] = i; } break; case SDC_CMD_SETPANELMODE: if(pSiS->xv_sisdirectunlocked) { int value = sdcbuf->sdc_parm[0]; if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTSCALE) { if(value & 0x01) pSiS->SiS_Pr->UsePanelScaler = -1; else if(value & 0x02) pSiS->SiS_Pr->UsePanelScaler = 1; else pSiS->SiS_Pr->UsePanelScaler = 0; if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTCENTER) { if(value & 0x04) pSiS->SiS_Pr->CenterScreen = -1; else if(value & 0x08) pSiS->SiS_Pr->CenterScreen = 1; else pSiS->SiS_Pr->CenterScreen = 0; } } } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; case SDC_CMD_GETMERGEDMODEDETAILS: #ifdef SISMERGED if(pSiS->MergedFB) { int clk, hd, hss, hse, ht, vd, vss, vse, vt; unsigned int pos, crt1x, crt1y, crt1clk, crt2x, crt2y, crt2clk; clk = sdcbuf->sdc_parm[0]; hd = sdcbuf->sdc_parm[1]; hss = sdcbuf->sdc_parm[2]; hse = sdcbuf->sdc_parm[3]; ht = sdcbuf->sdc_parm[4]; vd = sdcbuf->sdc_parm[5]; vss = sdcbuf->sdc_parm[6]; vse = sdcbuf->sdc_parm[7]; vt = sdcbuf->sdc_parm[8]; SISGetMergedModeDetails(pScrn, hd, vd, ht, vt, hss, hse, vss, vse, clk, &pos, &crt1x, &crt1y, &crt1clk, &crt2x, &crt2y, &crt2clk); sdcbuf->sdc_result[0] = pos; sdcbuf->sdc_result[1] = crt1x; sdcbuf->sdc_result[2] = crt1y; sdcbuf->sdc_result[3] = crt1clk; sdcbuf->sdc_result[4] = crt2x; sdcbuf->sdc_result[5] = crt2y; sdcbuf->sdc_result[6] = crt2clk; switch(pSiS->CRT2Position) { case sisLeftOf: sdcbuf->sdc_result[7] = SDC_MMODE_POS_LEFTOF; break; case sisRightOf: sdcbuf->sdc_result[7] = SDC_MMODE_POS_RIGHTOF; break; case sisAbove: sdcbuf->sdc_result[7] = SDC_MMODE_POS_ABOVE; break; case sisBelow: sdcbuf->sdc_result[7] = SDC_MMODE_POS_BELOW; break; default: sdcbuf->sdc_result[7] = SDC_MMODE_POS_CLONE; } } else #endif sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETDEVICENAME: /* In DualHead mode, this returns CRT1 data */ { SISPtr mypSiS = pSiS; sdcbuf->sdc_result[0] = 0; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiSEnt->pScrn_2) mypSiS = SISPTR(pSiSEnt->pScrn_2); } #endif sisutil_prepare_string(sdcbuf, mypSiS->devsectname); } break; case SDC_CMD_GETMONITORNAME: /* In DualHead mode, this returns CRT1 data */ { ScrnInfoPtr mypScrn = pScrn; sdcbuf->sdc_result[0] = 0; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiSEnt->pScrn_2) mypScrn = pSiSEnt->pScrn_2; } #endif if(mypScrn->monitor) { sisutil_prepare_string(sdcbuf, mypScrn->monitor->id); } } break; case SDC_CMD_GETDEVICENAME2: /* In DualHead mode, this returns CRT2 data */ sdcbuf->sdc_result[0] = 0; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiSEnt->pScrn_1) { sisutil_prepare_string(sdcbuf, SISPTR(pSiSEnt->pScrn_1)->devsectname); } } else #endif sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETMONITORNAME2: /* In DualHead mode, this returns CRT2 data */ sdcbuf->sdc_result[0] = 0; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(pSiSEnt->pScrn_1) { if(pSiSEnt->pScrn_1->monitor) { sisutil_prepare_string(sdcbuf, pSiSEnt->pScrn_1->monitor->id); } } } else #endif sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETXVBRIGHTNESS: if(pPriv) { int val = sdcbuf->sdc_parm[0] - 32768; if(val >= -128 && val <= 127) pPriv->brightness = val; else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETXVBRIGHTNESS: if(pPriv) { sdcbuf->sdc_result[0] = pPriv->brightness + 32768; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETXVCONTRAST: if(pPriv) { int val = sdcbuf->sdc_parm[0] - 32768; if(val >= 0 && val <= 7) pPriv->contrast = val; else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETXVCONTRAST: if(pPriv) { sdcbuf->sdc_result[0] = pPriv->contrast + 32768; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETXVHUE: if((pPriv) && (pSiS->SiS_SD2_Flags & SiS_SD2_SUPPORTXVHUESAT)) { int val = sdcbuf->sdc_parm[0] - 32768; if(val >= -8 && val <= 7) pPriv->hue = val; else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETXVHUE: if((pPriv) && (pSiS->SiS_SD2_Flags & SiS_SD2_SUPPORTXVHUESAT)) { sdcbuf->sdc_result[0] = pPriv->hue + 32768; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETXVSATURATION: if((pPriv) && (pSiS->SiS_SD2_Flags & SiS_SD2_SUPPORTXVHUESAT)) { int val = sdcbuf->sdc_parm[0] - 32768; if(val >= -7 && val <= 7) pPriv->saturation = val; else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETXVSATURATION: if((pPriv) && (pSiS->SiS_SD2_Flags & SiS_SD2_SUPPORTXVHUESAT)) { sdcbuf->sdc_result[0] = pPriv->saturation + 32768; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETXVGAMMA: if((pPriv) && (pSiS->SiS_SD_Flags & SiS_SD_SUPPORTXVGAMMA1)) { if(sdcbuf->sdc_parm[0] < 100 || sdcbuf->sdc_parm[0] > 10000 || sdcbuf->sdc_parm[1] < 100 || sdcbuf->sdc_parm[1] > 10000 || sdcbuf->sdc_parm[2] < 100 || sdcbuf->sdc_parm[2] > 10000) { sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else { pSiS->XvGammaRed = sdcbuf->sdc_parm[0]; pSiS->XvGammaGreen = sdcbuf->sdc_parm[1]; pSiS->XvGammaBlue = sdcbuf->sdc_parm[2]; SiSUpdateXvGamma(pSiS, pPriv); } } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETXVGAMMA: if((pPriv) && (pSiS->SiS_SD_Flags & SiS_SD_SUPPORTXVGAMMA1)) { sdcbuf->sdc_result[0] = pSiS->XvGammaRed; sdcbuf->sdc_result[1] = pSiS->XvGammaGreen; sdcbuf->sdc_result[2] = pSiS->XvGammaBlue; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETXVCOLORKEY: if(pPriv) { pPriv->colorKey = pSiS->colorKey = sdcbuf->sdc_parm[0]; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETXVCOLORKEY: if(pPriv) { sdcbuf->sdc_result[0] = pPriv->colorKey; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETXVAUTOPAINTCOLORKEY: if(pPriv) { pPriv->autopaintColorKey = sdcbuf->sdc_parm[0] ? 1 : 0; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETXVAUTOPAINTCOLORKEY: if(pPriv) { sdcbuf->sdc_result[0] = pPriv->autopaintColorKey ? 1 : 0; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETXVDEFAULTS: if(pPriv) { SISSetPortDefaults(pScrn, pPriv); } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETXVDISABLEGFX: if(pPriv) { pPriv->disablegfx = sdcbuf->sdc_parm[0] ? 1 : 0; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETXVDISABLEGFX: if(pPriv) { sdcbuf->sdc_result[0] = pPriv->disablegfx ? 1 : 0; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETXVDISABLEGFXLR: if(pPriv) { pPriv->disablegfxlr = sdcbuf->sdc_parm[0] ? 1 : 0; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETXVDISABLEGFXLR: if(pPriv) { sdcbuf->sdc_result[0] = pPriv->disablegfxlr ? 1 : 0; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETXVSWITCHCRT: if((pPriv) && (pSiS->VGAEngine == SIS_315_VGA)) { if(pPriv->AllowSwitchCRT) { pPriv->crtnum = sdcbuf->sdc_parm[0] ? 1 : 0; #ifdef SISDUALHEAD if(pPriv->dualHeadMode) pSiSEnt->curxvcrtnum = pPriv->crtnum; #endif } } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETXVSWITCHCRT: if((pPriv) && (pSiS->VGAEngine == SIS_315_VGA)) { #ifdef SISDUALHEAD if(pPriv->dualHeadMode) sdcbuf->sdc_result[0] = pSiSEnt->curxvcrtnum; else #endif sdcbuf->sdc_result[0] = pPriv->crtnum; } else sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_SETTVXPOS: { int value = sdcbuf->sdc_parm[0] - 32768; if((value < -32) || (value > 32)) { sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else if(pSiS->xv_sisdirectunlocked) { pPriv->tvxpos = value; SiS_SetTVxposoffset(pScrn, pPriv->tvxpos); pPriv->updatetvxpos = FALSE; } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; } break; case SDC_CMD_GETTVXPOS: sdcbuf->sdc_result[0] = SiS_GetTVxposoffset(pScrn) + 32768; break; case SDC_CMD_SETTVYPOS: { int value = sdcbuf->sdc_parm[0] - 32768; if((value < -32) || (value > 32)) { sdcbuf->sdc_result_header = SDC_RESULT_INVAL; } else if(pSiS->xv_sisdirectunlocked) { pPriv->tvypos = value; SiS_SetTVyposoffset(pScrn, pPriv->tvypos); pPriv->updatetvypos = FALSE; } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; } break; case SDC_CMD_GETTVYPOS: sdcbuf->sdc_result[0] = SiS_GetTVyposoffset(pScrn) + 32768; break; case SDC_CMD_SETXVDEINT: case SDC_CMD_GETXVDEINT: sdcbuf->sdc_result_header = SDC_RESULT_INVAL; break; case SDC_CMD_GETMONGAMMACRT1: sdcbuf->sdc_result[0] = pSiS->CRT1MonGamma; break; case SDC_CMD_GETMONGAMMACRT2: sdcbuf->sdc_result[0] = pSiS->CRT2MonGamma; break; case SDC_CMD_LOGQUIET: pSiS->SCLogQuiet = sdcbuf->sdc_parm[0] ? TRUE : FALSE; break; case SDC_CMD_GETCRT1SATGAIN: sdcbuf->sdc_result[0] = SiS_GetSISCRT1SaturationGain(pScrn); break; case SDC_CMD_SETCRT1SATGAIN: if(pSiS->xv_sisdirectunlocked) { SiS_SetSISCRT1SaturationGain(pScrn, (int)sdcbuf->sdc_parm[0]); } else sdcbuf->sdc_result_header = SDC_RESULT_NOPERM; break; default: sdcbuf->sdc_result_header = SDC_RESULT_UNDEFCMD; } return Success; } /* Proc */ static int SiSProcSiSCtrlQueryVersion(ClientPtr client) { xSiSCtrlQueryVersionReply rep; register int n; REQUEST_SIZE_MATCH(xSiSCtrlQueryVersionReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; rep.majorVersion = SISCTRL_MAJOR_VERSION; rep.minorVersion = SISCTRL_MINOR_VERSION; if(client->swapped) { _swaps(&rep.sequenceNumber, n); _swapl(&rep.length, n); _swaps(&rep.majorVersion, n); _swaps(&rep.minorVersion, n); } WriteToClient(client, sizeof(xSiSCtrlQueryVersionReply), (char *)&rep); return (client->noClientException); } static int SiSProcSiSCtrlCommand(ClientPtr client) { REQUEST(xSiSCtrlCommandReq); xSiSCtrlCommandReply rep; ExtensionEntry *myext; xSiSCtrlScreenTable *myctrl; register int n; int i, ret; REQUEST_SIZE_MATCH(xSiSCtrlCommandReq); memcpy(&rep, stuff, sizeof(xSiSCtrlCommandReply)); /* Get pointer to ExtensionEntry */ if(!(myext = CheckExtension(SISCTRL_PROTOCOL_NAME))) return BadMatch; /* Get pointer to our private */ if(!(myctrl = (xSiSCtrlScreenTable *)myext->extPrivate)) return BadMatch; /* Check if screen index is within out limits */ if(rep.screen > myctrl->maxscreens) return BadMatch; /* Check if this screen has added itself */ if(!(myctrl->HandleSiSDirectCommand[rep.screen])) return BadMatch; /* Finally, execute the command */ if((ret = (myctrl->HandleSiSDirectCommand[rep.screen])(&rep)) != Success) return ret; rep.type = X_Reply; rep.length = (sizeof(xSiSCtrlCommandReply) - sizeof(xGenericReply)) >> 2; rep.sequenceNumber = client->sequence; if(client->swapped) { _swaps(&rep.sequenceNumber, n); _swapl(&rep.length, n); _swapl(&rep.screen, n); _swapl(&rep.sdc_id, n); _swapl(&rep.sdc_command, n); _swapl(&rep.sdc_result_header, n); for(i = 0; i < SDC_NUM_PARM_RESULT; i++) { _swapl(&rep.sdc_parm[i], n); _swapl(&rep.sdc_result[i], n); } } WriteToClient(client, sizeof(xSiSCtrlCommandReply), (char *)&rep); return client->noClientException; } static int SiSProcSiSCtrlDispatch(ClientPtr client) { REQUEST(xReq); switch(stuff->data) { case X_SiSCtrlQueryVersion: return SiSProcSiSCtrlQueryVersion(client); case X_SiSCtrlCommand: return SiSProcSiSCtrlCommand(client); } return BadRequest; } /* SProc */ static int SiSSProcSiSCtrlQueryVersion(ClientPtr client) { REQUEST(xSiSCtrlQueryVersionReq); register int n; _swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xSiSCtrlQueryVersionReq); return SiSProcSiSCtrlQueryVersion(client); } static int SiSSProcSiSCtrlCommand(ClientPtr client) { REQUEST(xSiSCtrlCommandReq); register int n; int i; _swaps(&stuff->length, n); _swapl(&stuff->screen, n); _swapl(&stuff->sdc_id, n); _swapl(&stuff->sdc_command, n); _swapl(&stuff->sdc_result_header, n); for(i = 0; i < SDC_NUM_PARM_RESULT; i++) { _swapl(&stuff->sdc_parm[i], n); _swapl(&stuff->sdc_result[i], n); } REQUEST_SIZE_MATCH(xSiSCtrlCommandReq); return SiSProcSiSCtrlCommand(client); } static int SiSSProcSiSCtrlDispatch(ClientPtr client) { REQUEST(xReq); switch(stuff->data) { case X_SiSCtrlQueryVersion: return SiSSProcSiSCtrlQueryVersion(client); case X_SiSCtrlCommand: return SiSSProcSiSCtrlCommand(client); } return BadRequest; } static void SiSCtrlResetProc(ExtensionEntry* extEntry) { /* Called by CloseDownExtensions() */ /* (CloseDownExtensions() is called BEFORE CloseScreen, * which is why we must not use pSiS->SiSCtrlExtEntry * in SiSCtrlExtUnregister()) */ if(extEntry->extPrivate) { free(extEntry->extPrivate); extEntry->extPrivate = NULL; } } void SiSCtrlExtInit(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); ExtensionEntry *myext; xSiSCtrlScreenTable *myctrl; unsigned int version, revision; if((pSiS->VGAEngine != SIS_300_VGA) && (pSiS->VGAEngine != SIS_315_VGA)) return; pSiS->SCLogQuiet = FALSE; if(!(myext = CheckExtension(SISCTRL_PROTOCOL_NAME))) { if(!(myctrl = calloc(sizeof(xSiSCtrlScreenTable), 1))) return; if(!(myext = AddExtension(SISCTRL_PROTOCOL_NAME, 0, 0, SiSProcSiSCtrlDispatch, SiSSProcSiSCtrlDispatch, SiSCtrlResetProc, StandardMinorOpcode))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to add SISCTRL extension\n"); free(myctrl); return; } myext->extPrivate = (pointer)myctrl; myctrl->maxscreens = SISCTRL_MAX_SCREENS; myctrl->version_major = version = SISCTRL_MAJOR_VERSION; myctrl->version_minor = revision = SISCTRL_MINOR_VERSION; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initialized SISCTRL extension version %d.%d\n", version, revision); } else { if(!(myctrl = (xSiSCtrlScreenTable *)myext->extPrivate)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: Found SISCTRL extension with NULL-private!\n"); return; } version = myctrl->version_major; revision = myctrl->version_minor; } if(pScrn->scrnIndex < myctrl->maxscreens) { myctrl->HandleSiSDirectCommand[pScrn->scrnIndex] = SiSHandleSiSDirectCommand; pSiS->SiSCtrlExtEntry = myext; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Registered screen %d with SISCTRL extension version %d.%d\n", pScrn->scrnIndex, version, revision); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Screen number (%d) too high for SISCTRL extension %d.%d\n", pScrn->scrnIndex, version, revision); } } void SiSCtrlExtUnregister(SISPtr pSiS, int index) { ExtensionEntry *myext; xSiSCtrlScreenTable *myctrl; if(!pSiS->SiSCtrlExtEntry) return; /* Since CloseDownExtensions() is called before * our CloseScreen(), we must not use the saved * ptr here, but instead check for the extension. */ if((myext = CheckExtension(SISCTRL_PROTOCOL_NAME))) { if((myctrl = (xSiSCtrlScreenTable *)myext->extPrivate)) { myctrl->HandleSiSDirectCommand[index] = NULL; } } } /*********************************** * Xv attribute interface * ***********************************/ #ifdef XV_SD_DEPRECATED int SISSetPortUtilAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value, SISPortPrivPtr pPriv) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate;; #endif if(attribute == pSiS->xv_USD) { if(pSiS->enablesisctrl) { if(value == SIS_DIRECTKEY) { pSiS->xv_sisdirectunlocked++; } else if(pSiS->xv_sisdirectunlocked) { pSiS->xv_sisdirectunlocked--; } } else { pSiS->xv_sisdirectunlocked = 0; } } else if(attribute == pSiS->xv_SVF) { #ifdef SISDUALHEAD if(!pPriv->dualHeadMode) #endif if(pSiS->xv_sisdirectunlocked) { SISSwitchCRT2Type(pScrn, (ULong)value, FALSE); SISUpdateVideoParms(pSiS, pPriv); } } else if(attribute == pSiS->xv_CT1) { #ifdef SISDUALHEAD if(!pPriv->dualHeadMode) #endif if(pSiS->xv_sisdirectunlocked) { SISSwitchCRT1Status(pScrn, (ULong)value, FALSE); SISUpdateVideoParms(pSiS, pPriv); } } else if(attribute == pSiS->xv_RDT) { #ifdef SISDUALHEAD if(!pPriv->dualHeadMode) #endif if(pSiS->xv_sisdirectunlocked) { SISRedetectCRT2Devices(pScrn); } } else if(attribute == pSiS->xv_TAF) { if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVantiflicker(pScrn, (int)value); } } else if(attribute == pSiS->xv_TSA) { if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVsaturation(pScrn, (int)value); } } else if(attribute == pSiS->xv_TEE) { if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVedgeenhance(pScrn, (int)value); } } else if(attribute == pSiS->xv_CFI) { if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVcfilter(pScrn, value ? 1 : 0); } } else if(attribute == pSiS->xv_YFI) { if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVyfilter(pScrn, value); } } else if(attribute == pSiS->xv_COC) { if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVcolcalib(pScrn, (int)value, TRUE); } } else if(attribute == pSiS->xv_COF) { if(pSiS->xv_sisdirectunlocked) { SiS_SetSISTVcolcalib(pScrn, (int)value, FALSE); } } else if(attribute == pSiS->xv_TCO) { if(pSiS->xv_sisdirectunlocked) { SiS_SetCHTVcontrast(pScrn, (int)value); } } else if(attribute == pSiS->xv_TTE) { if(pSiS->xv_sisdirectunlocked) { SiS_SetCHTVtextenhance(pScrn, (int)value); } } else if(attribute == pSiS->xv_TCF) { if(pSiS->xv_sisdirectunlocked) { SiS_SetCHTVchromaflickerfilter(pScrn, (int)value); } } else if(attribute == pSiS->xv_TLF) { if(pSiS->xv_sisdirectunlocked) { SiS_SetCHTVlumaflickerfilter(pScrn, (int)value); } } else if(attribute == pSiS->xv_TCC) { if(pSiS->xv_sisdirectunlocked) { SiS_SetCHTVcvbscolor(pScrn, value ? 1 : 0); } } else if(attribute == pSiS->xv_OVR) { if(pSiS->xv_sisdirectunlocked) { pSiS->UseCHOverScan = -1; pSiS->OptTVSOver = FALSE; if(value == 3) { if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTSOVER) { pSiS->OptTVSOver = TRUE; } pSiS->UseCHOverScan = 1; } else if(value == 2) pSiS->UseCHOverScan = 1; else if(value == 1) pSiS->UseCHOverScan = 0; } } else if(attribute == pSiS->xv_CMD) { if(pSiS->xv_sisdirectunlocked) { int result = 0; pSiS->xv_sd_result = (value & 0xffffff00); result = SISCheckModeIndexForCRT2Type(pScrn, (UShort)(value & 0xff), (UShort)((value >> 8) & 0xff), FALSE); pSiS->xv_sd_result |= (result & 0xff); } } else if(attribute == pSiS->xv_SGA) { if(pSiS->xv_sisdirectunlocked) { Bool backup = pSiS->XvGamma; Bool backup2 = pSiS->CRT2SepGamma; pSiS->CRT1gamma = (value & 0x01) ? TRUE : FALSE; pSiS->CRT2gamma = (value & 0x02) ? TRUE : FALSE; #ifdef SISDUALHEAD if(pPriv->dualHeadMode) { pSiSEnt->CRT1gamma = pSiS->CRT1gamma; pSiSEnt->CRT2gamma = pSiS->CRT2gamma; } #endif if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTSGRCRT2) { pSiS->CRT2SepGamma = (value & 0x08) ? TRUE : FALSE; if(pSiS->CRT2SepGamma != backup2) { if(pSiS->CRT2SepGamma) { SiS_UpdateGammaCRT2(pScrn); } #ifdef SISGAMMARAMP else { SISCalculateGammaRamp(pScrn->pScreen, pScrn); } #endif /* ATTN: When disabling CRT2 sep gamma, * as long as SISGAMMARAMP is not defined, * application needs to reset palette using * vidmodextension! (See SiS_SD_CANSETGAMMA) * * Note: Difference between setting gamma values * for CRT1 and CRT2: For CRT1, driver only * stores the values, but does nothing with them. * For CRT2, the driver will IMMEDIATELY recalc * the palette. App needs to calc gamma ramp * itself for CRT1, and set it using the * VidModExtention. */ } } else pSiS->CRT2SepGamma = FALSE; pSiS->XvGamma = (value & 0x04) ? TRUE : FALSE; if(pSiS->VGAEngine == SIS_315_VGA) { if(backup != pSiS->XvGamma) { SiSUpdateXvGamma(pSiS, pPriv); } } } } else if(attribute == pSiS->xv_TXS) { if((value < -16) || (value > 16)) return BadValue; if(pSiS->xv_sisdirectunlocked) { SiS_SetTVxscale(pScrn, value); } } else if(attribute == pSiS->xv_TYS) { if((value < -4) || (value > 3)) return BadValue; if(pSiS->xv_sisdirectunlocked) { SiS_SetTVyscale(pScrn, value); } } else if(attribute == pSiS->xv_BRR) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { pSiS->GammaBriR = value; } } else if(attribute == pSiS->xv_BRG) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { pSiS->GammaBriG = value; } } else if(attribute == pSiS->xv_BRB) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { pSiS->GammaBriB = value; } } else if(attribute == pSiS->xv_PBR) { /* Nop */ } else if(attribute == pSiS->xv_PBG) { /* Nop */ } else if(attribute == pSiS->xv_PBB) { /* Nop */ } else if(attribute == pSiS->xv_BRR2) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { #ifdef SISDUALHEAD if(pPriv->dualHeadMode) pSiSEnt->GammaBriR = value; #endif } } else if(attribute == pSiS->xv_BRG2) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { #ifdef SISDUALHEAD if(pPriv->dualHeadMode) pSiSEnt->GammaBriG = value; #endif } } else if(attribute == pSiS->xv_BRB2) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { #ifdef SISDUALHEAD if(pPriv->dualHeadMode) pSiSEnt->GammaBriB = value; #endif } } else if(attribute == pSiS->xv_PBR2) { /* Nop */ } else if(attribute == pSiS->xv_PBG2) { /* Nop */ } else if(attribute == pSiS->xv_PBB2) { /* Nop */ } else if(attribute == pSiS->xv_GARC2) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { pSiS->GammaR2 = (float)value / (float)1000; SiS_UpdateGammaCRT2(pScrn); } } else if(attribute == pSiS->xv_GAGC2) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { pSiS->GammaG2 = (float)value / (float)1000; SiS_UpdateGammaCRT2(pScrn); } } else if(attribute == pSiS->xv_GABC2) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { pSiS->GammaB2 = (float)value / (float)1000; SiS_UpdateGammaCRT2(pScrn); } } else if(attribute == pSiS->xv_BRRC2) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { pSiS->GammaBriR2 = value; SiS_UpdateGammaCRT2(pScrn); } } else if(attribute == pSiS->xv_BRGC2) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { pSiS->GammaBriG2 = value; SiS_UpdateGammaCRT2(pScrn); } } else if(attribute == pSiS->xv_BRBC2) { if((value < 100) || (value > 10000)) return BadValue; if(pSiS->xv_sisdirectunlocked) { pSiS->GammaBriB2 = value; SiS_UpdateGammaCRT2(pScrn); } } else if(attribute == pSiS->xv_PBRC2) { /* Nop */ } else if(attribute == pSiS->xv_PBGC2) { /* Nop */ } else if(attribute == pSiS->xv_PBBC2) { /* Nop */ } else if(attribute == pSiS->xv_SHC) { if(pSiS->xv_sisdirectunlocked) { Bool VisibleBackup = pSiS->HWCursorIsVisible; pSiS->HideHWCursor = value ? TRUE : FALSE; if(pSiS->CursorInfoPtr) { if(VisibleBackup) { if(value) { (pSiS->CursorInfoPtr->HideCursor)(pScrn); } else { (pSiS->CursorInfoPtr->ShowCursor)(pScrn); } } pSiS->HWCursorIsVisible = VisibleBackup; } } } else if(attribute == pSiS->xv_PMD) { if(pSiS->xv_sisdirectunlocked) { if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTSCALE) { if(value & 0x01) pSiS->SiS_Pr->UsePanelScaler = -1; else if(value & 0x02) pSiS->SiS_Pr->UsePanelScaler = 1; else pSiS->SiS_Pr->UsePanelScaler = 0; if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTCENTER) { if(value & 0x04) pSiS->SiS_Pr->CenterScreen = -1; else if(value & 0x08) pSiS->SiS_Pr->CenterScreen = 1; else pSiS->SiS_Pr->CenterScreen = 0; } } } #ifdef TWDEBUG } else if(attribute == pSiS->xv_STR) { ULong port; CARD8 reg; switch((value & 0xff000000) >> 24) { case 0x00: port = SISSR; break; case 0x01: port = SISPART1; break; case 0x02: port = SISPART2; break; case 0x03: port = SISPART3; break; case 0x04: port = SISPART4; break; case 0x05: port = SISCR; break; case 0x06: port = SISVID; break; default: return BadValue; } outSISIDXREG(port,((value & 0x00ff0000) >> 16), ((value & 0x0000ff00) >> 8)); inSISIDXREG(port, ((value & 0x00ff0000) >> 16), reg); xf86DrvMsg(0, 0, "SetREG %x -> %x -> %x\n", ((value & 0x00ff0000) >> 16), ((value & 0x0000ff00) >> 8), reg); #endif } else { return BadMatch; } return Success; } int SISGetPortUtilAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 *value, SISPortPrivPtr pPriv) { SISPtr pSiS = SISPTR(pScrn); #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate;; #endif if(attribute == pSiS->xv_QVF) { *value = pSiS->VBFlags; } else if(attribute == pSiS->xv_GDV) { *value = SISDRIVERIVERSION; } else if(attribute == pSiS->xv_GHI) { *value = (pSiS->ChipFlags & 0xffff) | (pSiS->ChipType << 16) | (pSiS->ChipRev << 24); } else if(attribute == pSiS->xv_GBI) { *value = (pSiS->PciBus << 16) | (pSiS->PciDevice << 8) | pSiS->PciFunc; } else if(attribute == pSiS->xv_QVV) { *value = SIS_VBFlagsVersion; } else if(attribute == pSiS->xv_QDD) { *value = pSiS->detectedCRT2Devices; } else if(attribute == pSiS->xv_CT1) { *value = pSiS->CRT1isoff ? 0 : 1; } else if(attribute == pSiS->xv_GSF) { *value = pSiS->SiS_SD_Flags; } else if(attribute == pSiS->xv_GSF2) { *value = pSiS->SiS_SD2_Flags; } else if(attribute == pSiS->xv_USD) { *value = pSiS->xv_sisdirectunlocked; } else if(attribute == pSiS->xv_TAF) { *value = SiS_GetSISTVantiflicker(pScrn); } else if(attribute == pSiS->xv_TSA) { *value = SiS_GetSISTVsaturation(pScrn); } else if(attribute == pSiS->xv_TEE) { *value = SiS_GetSISTVedgeenhance(pScrn); } else if(attribute == pSiS->xv_CFI) { *value = SiS_GetSISTVcfilter(pScrn); } else if(attribute == pSiS->xv_YFI) { *value = SiS_GetSISTVyfilter(pScrn); } else if(attribute == pSiS->xv_COC) { *value = SiS_GetSISTVcolcalib(pScrn, TRUE); } else if(attribute == pSiS->xv_COF) { *value = SiS_GetSISTVcolcalib(pScrn, FALSE); } else if(attribute == pSiS->xv_TCO) { *value = SiS_GetCHTVcontrast(pScrn); } else if(attribute == pSiS->xv_TTE) { *value = SiS_GetCHTVtextenhance(pScrn); } else if(attribute == pSiS->xv_TCF) { *value = SiS_GetCHTVchromaflickerfilter(pScrn); } else if(attribute == pSiS->xv_TLF) { *value = SiS_GetCHTVlumaflickerfilter(pScrn); } else if(attribute == pSiS->xv_TCC) { *value = SiS_GetCHTVcvbscolor(pScrn); } else if(attribute == pSiS->xv_CMDR) { *value = pSiS->xv_sd_result; } else if(attribute == pSiS->xv_OVR) { /* Changing of CRT2 settings not supported in DHM! */ *value = 0; if(pSiS->OptTVSOver == 1) *value = 3; else if(pSiS->UseCHOverScan == 1) *value = 2; else if(pSiS->UseCHOverScan == 0) *value = 1; } else if(attribute == pSiS->xv_SGA) { *value = 0; #ifdef SISDUALHEAD if(pPriv->dualHeadMode) { if(pSiSEnt->CRT1gamma) *value |= 0x01; if(pSiSEnt->CRT2gamma) *value |= 0x02; } else { #endif if(pSiS->CRT1gamma) *value |= 0x01; if(pSiS->CRT2gamma) *value |= 0x02; if(pSiS->CRT2SepGamma) *value |= 0x08; #ifdef SISDUALHEAD } #endif if(pSiS->XvGamma) *value |= 0x04; } else if(attribute == pSiS->xv_TXS) { *value = SiS_GetTVxscale(pScrn); } else if(attribute == pSiS->xv_TYS) { *value = SiS_GetTVyscale(pScrn); } else if(attribute == pSiS->xv_GSS) { *value = (pScrn->virtualX << 16) | pScrn->virtualY; } else if(attribute == pSiS->xv_BRR) { *value = pSiS->GammaBriR; } else if(attribute == pSiS->xv_BRG) { *value = pSiS->GammaBriG; } else if(attribute == pSiS->xv_BRB) { *value = pSiS->GammaBriB; } else if(attribute == pSiS->xv_PBR) { *value = 1000; } else if(attribute == pSiS->xv_PBG) { *value = 1000; } else if(attribute == pSiS->xv_PBB) { *value = 1000; } else if(attribute == pSiS->xv_BRR2) { #ifdef SISDUALHEAD if(pPriv->dualHeadMode) *value = pSiSEnt->GammaBriR; else #endif *value = pSiS->GammaBriR; } else if(attribute == pSiS->xv_BRG2) { #ifdef SISDUALHEAD if(pPriv->dualHeadMode) *value = pSiSEnt->GammaBriG; else #endif *value = pSiS->GammaBriG; } else if(attribute == pSiS->xv_BRB2) { #ifdef SISDUALHEAD if(pPriv->dualHeadMode) *value = pSiSEnt->GammaBriB; else #endif *value = pSiS->GammaBriB; } else if(attribute == pSiS->xv_PBR2) { *value = 1000; } else if(attribute == pSiS->xv_PBG2) { *value = 1000; } else if(attribute == pSiS->xv_PBB2) { *value = 1000; } else if(attribute == pSiS->xv_GARC2) { *value = (int)(pSiS->GammaR2 * 1000); } else if(attribute == pSiS->xv_GAGC2) { *value = (int)(pSiS->GammaG2 * 1000); } else if(attribute == pSiS->xv_GABC2) { *value = (int)(pSiS->GammaB2 * 1000); } else if(attribute == pSiS->xv_BRRC2) { *value = pSiS->GammaBriR2; } else if(attribute == pSiS->xv_BRGC2) { *value = pSiS->GammaBriG2; } else if(attribute == pSiS->xv_BRBC2) { *value = pSiS->GammaBriB2; } else if(attribute == pSiS->xv_PBRC2) { *value = 1000; } else if(attribute == pSiS->xv_PBGC2) { *value = 1000; } else if(attribute == pSiS->xv_PBBC2) { *value = 1000; } else if(attribute == pSiS->xv_SHC) { *value = pSiS->HideHWCursor ? 1 : 0; } else if(attribute == pSiS->xv_PMD) { *value = 0; if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTSCALE) { switch(pSiS->SiS_Pr->UsePanelScaler) { case -1: *value |= 0x01; break; case 1: *value |= 0x02; break; } if(pSiS->SiS_SD_Flags & SiS_SD_SUPPORTCENTER) { switch(pSiS->SiS_Pr->CenterScreen) { case -1: *value |= 0x04; break; case 1: *value |= 0x08; break; } } } } else { return BadMatch; } return Success; } #endif /* XV_SD_DEPRECATED */ xf86-video-sis-0.10.7/src/sis_vga.c0000664000076400007640000020002011763614406013615 00000000000000/* * Mode setup and basic video bridge detection * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. * * The SISInit() function for old series (except TV and FIFO calculation) * was previously based on code which was Copyright (C) 1998,1999 by Alan * Hourihane, Wigan, England. However, the code has been rewritten entirely * and is - it its current representation - not covered by this old copyright. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "sis.h" #define SIS_NEED_inSISREG #define SIS_NEED_outSISREG #define SIS_NEED_inSISIDXREG #define SIS_NEED_outSISIDXREG #define SIS_NEED_orSISIDXREG #define SIS_NEED_andSISIDXREG #include "sis_regs.h" #include "sis_dac.h" static Bool SISInit(ScrnInfoPtr pScrn, DisplayModePtr mode); static Bool SIS300Init(ScrnInfoPtr pScrn, DisplayModePtr mode); static int SIS6326DoSense(ScrnInfoPtr pScrn, int tempbh, int tempbl, int tempch, int tempcl); static void SISSense6326(ScrnInfoPtr pScrn); static void SiS6326TVDelay(ScrnInfoPtr pScrn, int delay); extern void SISSense30x(ScrnInfoPtr pScrn, Bool quiet); extern void SISSenseChrontel(ScrnInfoPtr pScrn, Bool quiet); /* Our very own vgaHW functions */ void SiSVGASave(ScrnInfoPtr pScrn, SISRegPtr save, int flags); void SiSVGARestore(ScrnInfoPtr pScrn, SISRegPtr restore, int flags); void SiSVGASaveFonts(ScrnInfoPtr pScrn); void SiSVGARestoreFonts(ScrnInfoPtr pScrn); void SISVGALock(SISPtr pSiS); void SiSVGAUnlock(SISPtr pSiS); void SiSVGAProtect(ScrnInfoPtr pScrn, Bool on); #ifdef SIS_PC_PLATFORM Bool SiSVGAMapMem(ScrnInfoPtr pScrn); void SiSVGAUnmapMem(ScrnInfoPtr pScrn); #endif Bool SiSVGASaveScreen(ScreenPtr pScreen, int mode); static Bool SiSVGAInit(ScrnInfoPtr pScrn, DisplayModePtr mode, int fixsync); const CARD8 SiS6326TVRegs1[14] = { 0x00,0x01,0x02,0x03,0x04,0x11,0x12,0x13,0x21,0x26,0x27,0x3a,0x3c,0x43 }; const CARD8 SiS6326TVRegs1_NTSC[6][14] = { {0x81,0x3f,0x49,0x1b,0xa9,0x03,0x00,0x09,0x08,0x7d,0x00,0x88,0x30,0x60}, {0x81,0x3f,0x49,0x1d,0xa0,0x03,0x00,0x09,0x08,0x7d,0x00,0x88,0x30,0x60}, {0x81,0x45,0x24,0x8e,0x26,0x0b,0x00,0x09,0x02,0xfe,0x00,0x09,0x51,0x60}, {0x81,0x45,0x24,0x8e,0x26,0x07,0x00,0x29,0x04,0x30,0x10,0x3b,0x61,0x60}, {0x81,0x3f,0x24,0x8e,0x26,0x09,0x00,0x09,0x02,0x30,0x10,0x3b,0x51,0x60}, /* 640x400, 640x480 */ {0x83,0x5d,0x21,0xbe,0x75,0x03,0x00,0x09,0x08,0x42,0x10,0x4d,0x61,0x79} /* 640x480u */ }; const CARD8 SiS6326TVRegs2_NTSC[6][54] = { {0x11, 0x17, 0x03, 0x09, 0x94, 0x02, 0x05, 0x06, 0x09, 0x50, 0x0C, 0x0C, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0xFC, 0xDF, 0x94, 0x1F, 0x4A, 0x03, 0x71, 0x07, 0x97, 0x10, 0x40, 0x48, 0x00, 0x26, 0xB6, 0x10, 0x5C, 0xEC, 0x21, 0x2E, 0xBE, 0x10, 0x64, 0xF4, 0x21, 0x13, 0x75, 0x08, 0x31, 0x6A, 0x01, 0xA0}, {0x11, 0x17, 0x03, 0x0A, 0x94, 0x02, 0x05, 0x06, 0x09, 0x50, 0x0C, 0x0D, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0xFF, 0xDF, 0x94, 0x1F, 0x4A, 0x03, 0x71, 0x07, 0x97, 0x10, 0x40, 0x48, 0x00, 0x26, 0xB6, 0x10, 0x5C, 0xEC, 0x21, 0x2E, 0xBE, 0x10, 0x64, 0xF4, 0x21, 0x13, 0x75, 0x08, 0x31, 0x6A, 0x01, 0xA0}, {0x11, 0x17, 0x03, 0x0A, 0x94, 0x02, 0x05, 0x06, 0x09, 0x50, 0x0C, 0x0D, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0xFF, 0xDF, 0x94, 0x3F, 0x8C, 0x06, 0xCE, 0x07, 0x27, 0x30, 0x73, 0x7B, 0x00, 0x48, 0x68, 0x30, 0xB2, 0xD2, 0x52, 0x50, 0x70, 0x30, 0xBA, 0xDA, 0x52, 0xDC, 0x02, 0xD1, 0x53, 0xF7, 0x02, 0xA0}, {0x11, 0x17, 0x03, 0x09, 0x94, 0x02, 0x05, 0x06, 0x09, 0x50, 0x0C, 0x0C, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0xDC, 0xDF, 0x94, 0x3F, 0x8C, 0x06, 0xCE, 0x07, 0x27, 0x30, 0x73, 0x7B, 0x00, 0x48, 0x68, 0x30, 0xB2, 0xD2, 0x52, 0x50, 0x70, 0x30, 0xBA, 0xDA, 0x52, 0x00, 0x02, 0xF5, 0x53, 0xF7, 0x02, 0xA0}, {0x11, 0x17, 0x03, 0x09, 0x94, 0x02, 0x05, 0x06, 0x09, 0x50, 0x0C, 0x0C, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0xDC, 0xDF, 0x94, 0x3F, 0x8C, 0x06, 0xCE, 0x07, 0x27, 0x30, 0x73, 0x7B, 0x00, 0x48, 0x68, 0x30, 0xB2, 0xD2, 0x52, 0x50, 0x70, 0x30, 0xBA, 0xDA, 0x52, 0xDC, 0x02, 0xD1, 0x53, 0xF7, 0x02, 0xA0}, {0x11, 0x17, 0x03, 0x09, 0x94, 0x02, 0x05, 0x06, 0x09, 0x50, 0x0C, /* 640x480u */ 0x0C, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0x06, 0x0D, 0x04, 0x0A, 0x94, 0xDC, 0xDF, 0x94, 0xAF, 0x95, 0x06, 0xDD, 0x07, 0x5F, 0x30, 0x7E, 0x86, 0x00, 0x4C, 0xA4, 0x30, 0xE3, 0x3B, 0x62, 0x54, 0xAC, 0x30, 0xEB, 0x43, 0x62, 0x48, 0x34, 0x3D, 0x63, 0x29, 0x03, 0xA0} }; const CARD8 SiS6326TVRegs1_PAL[6][14] = { {0x81,0x2d,0xc8,0x07,0xb2,0x0b,0x00,0x09,0x02,0xed,0x00,0xf8,0x30,0x40}, {0x80,0x2d,0xa4,0x03,0xd9,0x0b,0x00,0x09,0x02,0xed,0x10,0xf8,0x71,0x40}, {0x81,0x2d,0xa4,0x03,0xd9,0x0b,0x00,0x09,0x02,0xed,0x10,0xf8,0x71,0x40}, /* 640x480 */ {0x81,0x2d,0xa4,0x03,0xd9,0x0b,0x00,0x09,0x02,0x8f,0x10,0x9a,0x71,0x40}, /* 800x600 */ {0x83,0x63,0xa1,0x7a,0xa3,0x0a,0x00,0x09,0x02,0xb5,0x11,0xc0,0x81,0x59}, /* 800x600u */ {0x81,0x63,0xa4,0x03,0xd9,0x01,0x00,0x09,0x10,0x9f,0x10,0xaa,0x71,0x59} /* 720x540 */ }; const CARD8 SiS6326TVRegs2_PAL[6][54] = { {0x15, 0x4E, 0x35, 0x6E, 0x94, 0x02, 0x04, 0x38, 0x3A, 0x50, 0x3D, 0x70, 0x06, 0x3E, 0x35, 0x6D, 0x94, 0x05, 0x3F, 0x36, 0x6E, 0x94, 0xE5, 0xDF, 0x94, 0xEF, 0x5A, 0x03, 0x7F, 0x07, 0xFF, 0x10, 0x4E, 0x56, 0x00, 0x2B, 0x23, 0x20, 0xB4, 0xAC, 0x31, 0x33, 0x2B, 0x20, 0xBC, 0xB4, 0x31, 0x83, 0xE1, 0x78, 0x31, 0xD6, 0x01, 0xA0}, {0x15, 0x4E, 0x35, 0x6E, 0x94, 0x02, 0x04, 0x38, 0x3A, 0x50, 0x3D, 0x70, 0x06, 0x3E, 0x35, 0x6D, 0x94, 0x05, 0x3F, 0x36, 0x6E, 0x94, 0xE5, 0xDF, 0x94, 0xDF, 0xB2, 0x07, 0xFB, 0x07, 0xF7, 0x30, 0x90, 0x98, 0x00, 0x4F, 0x3F, 0x40, 0x62, 0x52, 0x73, 0x57, 0x47, 0x40, 0x6A, 0x5A, 0x73, 0x03, 0xC1, 0xF8, 0x63, 0xB6, 0x03, 0xA0}, {0x15, 0x4E, 0x35, 0x6E, 0x94, 0x02, 0x04, 0x38, 0x3A, 0x50, 0x3D, /* 640x480 */ 0x70, 0x06, 0x3E, 0x35, 0x6D, 0x94, 0x05, 0x3F, 0x36, 0x6E, 0x94, 0xE5, 0xDF, 0x94, 0xDF, 0xB2, 0x07, 0xFB, 0x07, 0xF7, 0x30, 0x90, 0x98, 0x00, 0x4F, 0x3F, 0x40, 0x62, 0x52, 0x73, 0x57, 0x47, 0x40, 0x6A, 0x5A, 0x73, 0x03, 0xC1, 0xF8, 0x63, 0xB6, 0x03, 0xA0}, {0x15, 0x4E, 0x35, 0x6E, 0x94, 0x02, 0x04, 0x38, 0x3A, 0x50, 0x3D, /* 800x600 */ 0x70, 0x06, 0x3E, 0x35, 0x6D, 0x94, 0x05, 0x3F, 0x36, 0x6E, 0x94, 0xE5, 0xDF, 0x94, 0xDF, 0xB2, 0x07, 0xFB, 0x07, 0xF7, 0x30, 0x90, 0x98, 0x00, 0x4F, 0x3F, 0x40, 0x62, 0x52, 0x73, 0x57, 0x47, 0x40, 0x6A, 0x5A, 0x73, 0xA0, 0xC1, 0x95, 0x73, 0xB6, 0x03, 0xA0}, {0x15, 0x4E, 0x35, 0x6E, 0x94, 0x02, 0x04, 0x38, 0x3A, 0x50, 0x3D, /* 800x600u */ 0x70, 0x06, 0x3E, 0x35, 0x6D, 0x94, 0x05, 0x3F, 0x36, 0x6E, 0x94, 0xE5, 0xDF, 0x94, 0x7F, 0xBD, 0x08, 0x0E, 0x07, 0x47, 0x40, 0x9D, 0xA5, 0x00, 0x54, 0x94, 0x40, 0xA4, 0xE4, 0x73, 0x5C, 0x9C, 0x40, 0xAC, 0xEC, 0x73, 0x0B, 0x0E, 0x00, 0x84, 0x03, 0x04, 0xA0}, {0x15, 0x4E, 0x35, 0x6E, 0x94, 0x02, 0x04, 0x38, 0x3A, 0x50, 0x3D, /* 720x540 */ 0x70, 0x06, 0x3E, 0x35, 0x6D, 0x94, 0x05, 0x3F, 0x36, 0x6E, 0x94, 0xE5, 0xDF, 0x94, 0xDF, 0xB0, 0x07, 0xFB, 0x07, 0xF7, 0x30, 0x9D, 0xA5, 0x00, 0x4F, 0x3F, 0x40, 0x62, 0x52, 0x73, 0x57, 0x47, 0x40, 0x6A, 0x5A, 0x73, 0xA0, 0xC1, 0x95, 0x73, 0xB6, 0x03, 0xA0} }; const CARD8 SiS6326CR[9][15] = { {0x79,0x63,0x64,0x1d,0x6a,0x93,0x00,0x6f,0xf0,0x58,0x8a,0x57,0x57,0x70,0x20}, /* PAL 800x600 */ {0x79,0x4f,0x50,0x95,0x60,0x93,0x00,0x6f,0xba,0x14,0x86,0xdf,0xe0,0x30,0x00}, /* PAL 640x480 */ {0x5f,0x4f,0x50,0x82,0x53,0x9f,0x00,0x0b,0x3e,0xe9,0x8b,0xdf,0xe7,0x04,0x00}, /* NTSC 640x480 */ {0x5f,0x4f,0x50,0x82,0x53,0x9f,0x00,0x0b,0x3e,0xcb,0x8d,0x8f,0x96,0xe9,0x00}, /* NTSC 640x400 */ {0x83,0x63,0x64,0x1f,0x6d,0x9b,0x00,0x6f,0xf0,0x48,0x0a,0x23,0x57,0x70,0x20}, /* PAL 800x600u */ {0x79,0x59,0x5b,0x1d,0x66,0x93,0x00,0x6f,0xf0,0x42,0x04,0x1b,0x40,0x70,0x20}, /* PAL 720x540 */ {0x66,0x4f,0x51,0x0a,0x57,0x89,0x00,0x0b,0x3e,0xd9,0x0b,0xb6,0xe7,0x04,0x00}, /* NTSC 640x480u */ {0xce,0x9f,0x9f,0x92,0xa4,0x16,0x00,0x28,0x5a,0x00,0x04,0xff,0xff,0x29,0x39}, /* 1280x1024-75 */ {0x09,0xc7,0xc7,0x0d,0xd2,0x0a,0x01,0xe0,0x10,0xb0,0x04,0xaf,0xaf,0xe1,0x1f} /* 1600x1200-60 */ }; /* Initialize a display mode on 5597/5598, 6326 and 530/620 */ static Bool SISInit(ScrnInfoPtr pScrn, DisplayModePtr mode) { SISPtr pSiS = SISPTR(pScrn); SISRegPtr pReg = &pSiS->ModeReg; UChar temp; int mclk = pSiS->MemClock; int clock = mode->Clock; int width = mode->HDisplay; int height = mode->VDisplay; int rate = (int)SiSCalcVRate(mode); int buswidth = pSiS->BusWidth; unsigned int vclk[5]; UShort CRT_CPUthresholdLow, CRT_CPUthresholdHigh, CRT_ENGthreshold; double a, b, c; int d, factor, offset, fixsync = 1; int num, denum, div, sbit, scale; Bool sis6326tvmode, sis6326himode; /* Save the registers for further processing */ (*pSiS->SiSSave)(pScrn, pReg); /* Initialise the standard VGA registers */ if(!pSiS->UseVESA) { if(!SiSVGAInit(pScrn, mode, fixsync)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "SISInit: SiSVGAInit() failed\n"); return FALSE; } } /* Determine if chosen mode is suitable for TV on the 6326 * and if the mode is one of our special hi-res modes. */ sis6326tvmode = FALSE; sis6326himode = FALSE; if(pSiS->Chipset == PCI_CHIP_SIS6326) { if(pSiS->SiS6326Flags & SIS6326_HASTV) { if((pSiS->SiS6326Flags & SIS6326_TVDETECTED) && ((strcmp(mode->name, "PAL800x600") == 0) || /* Special TV modes */ (strcmp(mode->name, "PAL800x600U") == 0) || (strcmp(mode->name, "PAL720x540") == 0) || (strcmp(mode->name, "PAL640x480") == 0) || (strcmp(mode->name, "NTSC640x480") == 0) || (strcmp(mode->name, "NTSC640x480U") == 0) || (strcmp(mode->name, "NTSC640x400") == 0))) { sis6326tvmode = TRUE; } else { pReg->sis6326tv[0x00] &= 0xfb; } } if((strcmp(mode->name, "SIS1280x1024-75") == 0) || /* Special high-res modes */ (strcmp(mode->name, "SIS1600x1200-60") == 0)) { sis6326himode = TRUE; } } #ifdef UNLOCK_ALWAYS outSISIDXREG(SISSR, 0x05, 0x86); #endif if(!pSiS->UseVESA) { pReg->sisRegs3C4[0x06] &= 0x01; } /* set interlace */ if(!(mode->Flags & V_INTERLACE)) { offset = pSiS->CurrentLayout.displayWidth >> 3; } else { offset = pSiS->CurrentLayout.displayWidth >> 2; if(!pSiS->UseVESA) { pReg->sisRegs3C4[0x06] |= 0x20; } } /* Enable Linear and Enhanced Gfx Mode */ if(!pSiS->UseVESA) { pReg->sisRegs3C4[0x06] |= 0x82; } /* Enable MMIO at PCI Register 14H (D[6:5]: 11) */ if(pSiS->oldChipset >= OC_SIS5597) { pReg->sisRegs3C4[0x0B] |= 0x60; } else { pReg->sisRegs3C4[0x0B] |= 0x20; pReg->sisRegs3C4[0x0B] &= ~0x40; } if(!pSiS->UseVESA) { /* Enable 32bit mem access (D7), read-ahead cache (D5) */ pReg->sisRegs3C4[0x0C] |= 0x80; if(pSiS->oldChipset > OC_SIS6225) { pReg->sisRegs3C4[0x0C] |= 0x20; } /* Some speed-up stuff */ switch(pSiS->Chipset) { case PCI_CHIP_SIS5597: /* enable host bus */ if(!pSiS->HostBus) { pReg->sisRegs3C4[0x34] &= ~0x08; } else { pReg->sisRegs3C4[0x34] |= 0x08; } /* fall through */ case PCI_CHIP_SIS6326: case PCI_CHIP_SIS530: /* Enable "dual segment register mode" (D2) and "i/o gating while * write buffer is not empty" (D3) */ pReg->sisRegs3C4[0x0B] |= 0x0C; } /* set colordepth */ if(pSiS->Chipset == PCI_CHIP_SIS530) { pReg->sisRegs3C4[0x09] &= 0x7F; } switch(pSiS->CurrentLayout.bitsPerPixel) { case 8: break; case 16: offset <<= 1; if(pSiS->CurrentLayout.depth == 15) pReg->sisRegs3C4[0x06] |= 0x04; else pReg->sisRegs3C4[0x06] |= 0x08; break; case 24: offset += (offset << 1); pReg->sisRegs3C4[0x06] |= 0x10; pReg->sisRegs3C4[0x0B] |= 0x90; break; case 32: if(pSiS->Chipset == PCI_CHIP_SIS530) { offset <<= 2; if(pSiS->oldChipset != OC_SIS620) { pReg->sisRegs3C4[0x06] |= 0x10; } pReg->sisRegs3C4[0x0B] |= 0x90; pReg->sisRegs3C4[0x09] |= 0x80; } else return FALSE; break; } } /* save screen pitch for acceleration functions */ pSiS->scrnOffset = pSiS->CurrentLayout.displayWidth * ((pSiS->CurrentLayout.bitsPerPixel + 7) / 8); /* Set accelerator dest color depth to 0 - not supported on 530/620 */ pSiS->DstColor = 0; if(!pSiS->UseVESA) { /* set linear framebuffer addresses */ switch(pScrn->videoRam) { case 512: temp = 0x00; break; case 1024: temp = 0x20; break; case 2048: temp = 0x40; break; case 4096: temp = 0x60; break; case 8192: temp = 0x80; break; default: temp = 0x20; } pReg->sisRegs3C4[0x20] = (pSiS->FbAddress & 0x07F80000) >> 19; pReg->sisRegs3C4[0x21] = ((pSiS->FbAddress & 0xF8000000) >> 27) | temp; /* Set screen offset */ pReg->sisRegs3D4[0x13] = offset & 0xFF; /* Set CR registers for our built-in TV and hi-res modes */ if((sis6326tvmode) || (sis6326himode)) { int index,i; /* We need our very private data for hi-res and TV modes */ if(sis6326himode) { if(strcmp(mode->name, "SIS1280x1024-75") == 0) index = 7; else index = 8; } else { if(pSiS->SiS6326Flags & SIS6326_TVPAL) { switch(width) { case 800: if((strcmp(mode->name, "PAL800x600U") == 0)) index = 4; else index = 0; break; case 720: index = 5; break; case 640: default: index = 1; } } else { switch(height) { case 400: index = 3; break; case 480: default: if((strcmp(mode->name, "NTSC640x480U") == 0)) index = 6; else index = 2; } } } for(i=0; i<=5; i++) { pReg->sisRegs3D4[i] = SiS6326CR[index][i]; } pReg->sisRegs3C4[0x12] = SiS6326CR[index][6]; pReg->sisRegs3D4[6] = SiS6326CR[index][7]; pReg->sisRegs3D4[7] = SiS6326CR[index][8]; pReg->sisRegs3D4[0x10] = SiS6326CR[index][9]; pReg->sisRegs3D4[0x11] = SiS6326CR[index][10]; pReg->sisRegs3D4[0x12] = SiS6326CR[index][11]; pReg->sisRegs3D4[0x15] = SiS6326CR[index][12]; pReg->sisRegs3D4[0x16] = SiS6326CR[index][13]; pReg->sisRegs3D4[9] &= ~0x20; pReg->sisRegs3D4[9] |= (SiS6326CR[index][14] & 0x20); pReg->sisRegs3C4[0x0A] = ((offset & 0xF00) >> 4) | (SiS6326CR[index][14] & 0x0f); } else { /* Set extended vertical overflow register */ pReg->sisRegs3C4[0x0A] = ( ((offset & 0xF00) >> 4) | (((mode->CrtcVTotal - 2) & 0x400) >> 10) | (((mode->CrtcVDisplay - 1) & 0x400) >> 9) | (((mode->CrtcVBlankStart - 1) & 0x400) >> 8) | (((mode->CrtcVSyncStart - fixsync) & 0x400) >> 7)); /* Set extended horizontal overflow register */ pReg->sisRegs3C4[0x12] &= 0xE0; pReg->sisRegs3C4[0x12] |= ( ((((mode->CrtcHTotal >> 3) - 5) & 0x100) >> 8) | ((((mode->CrtcHDisplay >> 3) - 1) & 0x100) >> 7) | ((((mode->CrtcHBlankStart >> 3) - 1) & 0x100) >> 6) | ((((mode->CrtcHSyncStart >> 3) - fixsync)& 0x100) >> 5) | ((((mode->CrtcHBlankEnd >> 3) - 1) & 0x40) >> 2)); } /* enable (or disable) line compare */ if(mode->CrtcVDisplay >= 1024) pReg->sisRegs3C4[0x38] |= 0x04; else pReg->sisRegs3C4[0x38] &= 0xFB; /* Enable (or disable) high speed DCLK (some 6326 and 530/620 only) */ if( ( (pSiS->Chipset == PCI_CHIP_SIS6326) && ( (pSiS->ChipRev == 0xd0) || (pSiS->ChipRev == 0xd1) || (pSiS->ChipRev == 0xd2) || (pSiS->ChipRev == 0x92) || (pSiS->Flags & A6326REVAB) ) ) || (pSiS->oldChipset > OC_SIS6326) ) { if( (pSiS->CurrentLayout.bitsPerPixel == 24) || (pSiS->CurrentLayout.bitsPerPixel == 32) || (mode->CrtcHDisplay >= 1280) ) pReg->sisRegs3C4[0x3E] |= 0x01; else pReg->sisRegs3C4[0x3E] &= 0xFE; } /* We use the internal VCLK */ pReg->sisRegs3C4[0x38] &= 0xFC; /* Programmable Clock */ pReg->sisRegs3C2 = inSISREG(SISMISCR) | 0x0C; #if 0 if(pSiS->oldChipset <= OC_SIS86202) { /* TODO: Handle SR07 for clock selection */ /* 86C201 does not even have a programmable clock... */ /* pReg->sisRegs3C4[0x07] &= 0x??; */ } #endif /* Set VCLK */ if((sis6326tvmode) || (sis6326himode)) { /* For our built-in modes, the calculation is not suitable */ if(sis6326himode) { if((strcmp(mode->name, "SIS1280x1024-75") == 0)) { pReg->sisRegs3C4[0x2A] = 0x5d; /* 1280x1024-75 */ pReg->sisRegs3C4[0x2B] = 0xa4; } else { pReg->sisRegs3C4[0x2A] = 0x59; /* 1600x1200-60 */ pReg->sisRegs3C4[0x2B] = 0xa3; } pReg->sisRegs3C4[0x13] &= ~0x40; } else { if(pSiS->SiS6326Flags & SIS6326_TVPAL) { /* PAL: 31.500 Mhz */ if((strcmp(mode->name, "PAL800x600U") == 0)) { pReg->sisRegs3C4[0x2A] = 0x46; pReg->sisRegs3C4[0x2B] = 0x49; } else { pReg->sisRegs3C4[0x2A] = 0xab; pReg->sisRegs3C4[0x2B] = 0xe9; } pReg->sisRegs3C4[0x13] &= ~0x40; } else { /* NTSC: 27.000 Mhz */ if((strcmp(mode->name, "NTSC640x480U") == 0)) { pReg->sisRegs3C4[0x2A] = 0x5a; pReg->sisRegs3C4[0x2B] = 0x65; } else { pReg->sisRegs3C4[0x2A] = 0x29; pReg->sisRegs3C4[0x2B] = 0xe2; } pReg->sisRegs3C4[0x13] |= 0x40; } } } else if(SiS_compute_vclk(clock, &num, &denum, &div, &sbit, &scale)) { pReg->sisRegs3C4[0x2A] = (num - 1) & 0x7f ; pReg->sisRegs3C4[0x2A] |= (div == 2) ? 0x80 : 0; pReg->sisRegs3C4[0x2B] = ((denum - 1) & 0x1f); pReg->sisRegs3C4[0x2B] |= (((scale -1) & 3) << 5); /* When setting VCLK, we should set SR13 first */ if(sbit) pReg->sisRegs3C4[0x13] |= 0x40; else pReg->sisRegs3C4[0x13] &= 0xBF; #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "2a: %x 2b: %x 13: %x clock %d\n", pReg->sisRegs3C4[0x2A], pReg->sisRegs3C4[0x2B], pReg->sisRegs3C4[0x13], clock); #endif } else { /* if SiS_compute_vclk cannot handle the requested clock, try sisCalcClock */ SiSCalcClock(pScrn, clock, 2, vclk); #define Midx 0 #define Nidx 1 #define VLDidx 2 #define Pidx 3 #define PSNidx 4 pReg->sisRegs3C4[0x2A] = (vclk[Midx] - 1) & 0x7f; pReg->sisRegs3C4[0x2A] |= ((vclk[VLDidx] == 2) ? 1 : 0) << 7; /* D[4:0]: denumerator */ pReg->sisRegs3C4[0x2B] = (vclk[Nidx] - 1) & 0x1f; if(vclk[Pidx] <= 4){ /* postscale 1,2,3,4 */ pReg->sisRegs3C4[0x2B] |= (vclk[Pidx] - 1) << 5; pReg->sisRegs3C4[0x13] &= 0xBF; } else { /* postscale 6,8 */ pReg->sisRegs3C4[0x2B] |= ((vclk[Pidx] / 2) - 1) << 5; pReg->sisRegs3C4[0x13] |= 0x40; } pReg->sisRegs3C4[0x2B] |= 0x80 ; /* gain for high frequency */ } /* High speed DAC */ if(clock > 135000) pReg->sisRegs3C4[0x07] |= 0x02; if(pSiS->oldChipset > OC_SIS6225) { /* 1 or 2 cycle DRAM (set by option FastVram) */ if(pSiS->newFastVram == -1) { if(pSiS->oldChipset == OC_SIS620) { /* Use different default on the 620 */ pReg->sisRegs3C4[0x34] |= 0x40; pReg->sisRegs3C4[0x34] &= ~0x80; } else { pReg->sisRegs3C4[0x34] |= 0x80; pReg->sisRegs3C4[0x34] &= ~0x40; } } else if(pSiS->newFastVram == 1) pReg->sisRegs3C4[0x34] |= 0xC0; else pReg->sisRegs3C4[0x34] &= ~0xC0; if(pSiS->oldChipset == OC_SIS620) { /* Enable SGRAM burst timing (= bit clear) on the 620 */ if(pSiS->Flags & SYNCDRAM) { pReg->sisRegs3C4[0x35] &= ~0x20; } else { pReg->sisRegs3C4[0x35] |= 0x20; } } } } /* VESA */ /* Logical line length */ pSiS->ValidWidth = TRUE; pReg->sisRegs3C4[0x27] &= 0xCF; if(pSiS->CurrentLayout.bitsPerPixel == 24) { /* "Invalid logical width" */ pReg->sisRegs3C4[0x27] |= 0x30; pSiS->ValidWidth = FALSE; } else { switch(pScrn->virtualX * (pSiS->CurrentLayout.bitsPerPixel >> 3)) { case 1024: pReg->sisRegs3C4[0x27] |= 0x00; break; case 2048: pReg->sisRegs3C4[0x27] |= 0x10; break; case 4096: pReg->sisRegs3C4[0x27] |= 0x20; break; default: /* Invalid logical width */ pReg->sisRegs3C4[0x27] |= 0x30; pSiS->ValidWidth = FALSE; break; } } /* Acceleration stuff */ if(!pSiS->NoAccel) { pReg->sisRegs3C4[0x27] |= 0x40; /* Enable engine programming registers */ if( (pSiS->TurboQueue) && /* Handle TurboQueue */ (pSiS->oldChipset > OC_SIS6225) && ( (pSiS->Chipset != PCI_CHIP_SIS530) || (pSiS->CurrentLayout.bitsPerPixel != 24) ) ) { pReg->sisRegs3C4[0x27] |= 0x80; /* Enable TQ */ if((pSiS->Chipset == PCI_CHIP_SIS530) || ((pSiS->Chipset == PCI_CHIP_SIS6326 && (pSiS->ChipRev == 0xd0 || pSiS->ChipRev == 0xd1 || pSiS->ChipRev == 0xd2 || pSiS->ChipRev == 0x92 || pSiS->ChipRev == 0x0a || pSiS->ChipRev == 0x1a || pSiS->ChipRev == 0x2a || pSiS->ChipRev == 0x0b || pSiS->ChipRev == 0x1b || pSiS->ChipRev == 0x2b) ) ) ) { /* pReg->sisRegs3C4[0x3D] |= 0x80; */ /* Queue is 62K (530/620 specs) */ pReg->sisRegs3C4[0x3D] &= 0x7F; /* Queue is 30K (530/620 specs) */ } /* Locate the TQ at the beginning of the last 64K block of * video RAM. The address is to be specified in 32K steps. */ pReg->sisRegs3C4[0x2C] = (pScrn->videoRam - 64) / 32; if(pSiS->Chipset != PCI_CHIP_SIS530) { /* 530/620: Reserved (don't touch) */ pReg->sisRegs3C4[0x3C] &= 0xFC; /* 6326: Queue is all for 2D */ } /* 5597: Must be 0 */ } else { pReg->sisRegs3C4[0x27] &= 0x7F; } } if(!pSiS->UseVESA) { /* No idea what this does. The Windows driver does it, so we do it as well */ if(pSiS->Chipset == PCI_CHIP_SIS6326) { if((pSiS->ChipRev == 0xd0) || (pSiS->ChipRev == 0xd1) || (pSiS->ChipRev == 0xd2) || (pSiS->ChipRev == 0x92) || (pSiS->Flags & A6326REVAB)) { if((pSiS->Flags & (SYNCDRAM | RAMFLAG)) == (SYNCDRAM | RAMFLAG)) { if(!(pReg->sisRegs3C4[0x0E] & 0x03)) { pReg->sisRegs3C4[0x3E] |= 0x02; } } } } /* Set memclock */ #if 0 /* We don't need to do this; the SetMClk option was not used since 4.0. */ if((pSiS->Chipset == PCI_CHIP_SIS5597) || (pSiS->Chipset == PCI_CHIP_SIS6326)) { if(pSiS->MemClock > 66000) { SiSCalcClock(pScrn, pSiS->MemClock, 1, vclk); pReg->sisRegs3C4[0x28] = (vclk[Midx] - 1) & 0x7f ; pReg->sisRegs3C4[0x28] |= ((vclk[VLDidx] == 2 ) ? 1 : 0 ) << 7 ; pReg->sisRegs3C4[0x29] = (vclk[Nidx] -1) & 0x1f ; /* bits [4:0] contain denumerator -MC */ if(vclk[Pidx] <= 4) { pReg->sisRegs3C4[0x29] |= (vclk[Pidx] - 1) << 5 ; /* postscale 1,2,3,4 */ pReg->sisRegs3C4[0x13] &= 0x7F; } else { pReg->sisRegs3C4[0x29] |= ((vclk[Pidx] / 2) - 1) << 5 ; /* postscale 6,8 */ pReg->sisRegs3C4[0x13] |= 0x80; } /* Check programmed memory clock. Enable only to check the above code */ /* mclk = 14318 * ((pReg->sisRegs3C4[0x28] & 0x7f) + 1); mclk /= ((pReg->sisRegs3C4[0x29] & 0x0f) + 1); if(!(pReg->sisRegs3C4[0x13] & 0x80)) { mclk /= (((pReg->sisRegs3C4[0x29] & 0x60) >> 5) + 1); } else { if((pReg->sisRegs3C4[0x29] & 0x60) == 0x40) mclk /= 6; if((pReg->sisRegs3C4[0x29] & 0x60) == 0x60) mclk /= 8; } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO,2, "Setting memory clock to %.3f MHz\n", mclk/1000.0); */ } } #endif /* Set threshold values */ /* * CPU/CRT Threshold: FIFO * MCLK ___________ VCLK * cpu/engine <---o o--------->|___________| -----------> CRT * ^ ^ ^ ^ * \ / | | * \ / |< gap >| * \ / | | * selector switch Thrsh. low high * * CRT consumes the data in the FIFO during scanline display. When the * amount of data in the FIFO reaches the Threshold low value, the selector * switch will switch to the right, and the FIFO will be refilled with data. * When the amount of data in the FIFO reaches the Threshold high value, the * selector switch will switch to the left and allows the CPU and the chip * engines to access the video RAM. * * The Threshold low values should be increased at higher bpps, simply because * there is more data needed for the CRT. When Threshold low and high are very * close to each other, the selector switch will be activated more often, which * decreases performance. * */ switch(pSiS->Chipset) { case PCI_CHIP_SIS5597: factor = 65; break; case PCI_CHIP_SIS6326: factor = 30; break; case PCI_CHIP_SIS530: factor = (pSiS->Flags & UMA) ? 60 : 30; break; default: factor = (pScrn->videoRam > 1024) ? 24 : 12; } a = width * height * rate * 1.40 * factor * ((pSiS->CurrentLayout.bitsPerPixel + 1) / 8); b = (mclk / 1000) * 999488.0 * (buswidth / 8); c = ((a / b) + 1.0) / 2; d = (int)c + 2; CRT_CPUthresholdLow = d; if((pSiS->Flags & (RAMFLAG | SYNCDRAM)) == (RAMFLAG | SYNCDRAM)) { CRT_CPUthresholdLow += 2; } CRT_CPUthresholdHigh = CRT_CPUthresholdLow + 3; CRT_ENGthreshold = 0x0F; #if 0 /* See comment in sis_dac.c on why this is commented */ if(pSiS->Chipset == PCI_CHIP_SIS530) { if((pSiS->oldChipset == OC_SIS530A) && (pSiS->Flags & UMA) && (mclk == 100000) && (pSiS->Flags & ESS137xPRESENT)) { if(!(pSiS->Flags & SECRETFLAG)) index = 0; if((temp = SiS_CalcSpecial530Threshold(pSiS, mode, index)) { CRT_CPUthresholdLow = temp; break; } } } #endif switch(pSiS->Chipset) { case PCI_CHIP_SIS530: if(CRT_CPUthresholdLow > 0x1f) CRT_CPUthresholdLow = 0x1f; CRT_CPUthresholdHigh = 0x1f; break; case PCI_CHIP_SIS5597: case PCI_CHIP_SIS6326: default: if(CRT_CPUthresholdLow > 0x0f) CRT_CPUthresholdLow = 0x0f; if(CRT_CPUthresholdHigh > 0x0f) CRT_CPUthresholdHigh = 0x0f; } pReg->sisRegs3C4[0x08] = ((CRT_CPUthresholdLow & 0x0F) << 4) | (CRT_ENGthreshold & 0x0F); pReg->sisRegs3C4[0x09] &= 0xF0; pReg->sisRegs3C4[0x09] |= (CRT_CPUthresholdHigh & 0x0F); pReg->sisRegs3C4[0x3F] &= 0xEB; pReg->sisRegs3C4[0x3F] |= ((CRT_CPUthresholdHigh & 0x10) | ((CRT_CPUthresholdLow & 0x10) >> 2)); if(pSiS->oldChipset >= OC_SIS530A) { pReg->sisRegs3C4[0x3F] &= 0xDF; pReg->sisRegs3C4[0x3F] |= 0x58; } /* Set SiS6326 TV registers */ if((pSiS->Chipset == PCI_CHIP_SIS6326) && (sis6326tvmode)) { UChar tmp; int index=0, i, j, k; int fsc; if(pSiS->SiS6326Flags & SIS6326_TVPAL) { pReg->sisRegs3C4[0x0D] |= 0x04; switch(width) { case 800: if((strcmp(mode->name, "PAL800x600U") == 0)) index = 4; else index = 3; break; case 720: index = 5; break; case 640: default: index = 2; } for(i=0; i<14; i++) { pReg->sis6326tv[SiS6326TVRegs1[i]] = SiS6326TVRegs1_PAL[index][i]; } fsc = (SiS6326TVRegs1_PAL[index][2] << 16) | (SiS6326TVRegs1_PAL[index][3] << 8) | (SiS6326TVRegs1_PAL[index][4]); } else { pReg->sisRegs3C4[0x0D] &= ~0x04; if((strcmp(mode->name, "NTSC640x480U") == 0)) index = 5; else index = 4; for(i=0; i<14; i++) { pReg->sis6326tv[SiS6326TVRegs1[i]] = SiS6326TVRegs1_NTSC[index][i]; } fsc = (SiS6326TVRegs1_NTSC[index][2] << 16) | (SiS6326TVRegs1_NTSC[index][3] << 8) | (SiS6326TVRegs1_NTSC[index][4]); } if(pSiS->sis6326fscadjust) { fsc += pSiS->sis6326fscadjust; pReg->sis6326tv[2] = (fsc >> 16) & 0xff; pReg->sis6326tv[3] = (fsc >> 8) & 0xff; pReg->sis6326tv[4] = fsc & 0xff; } tmp = pReg->sis6326tv[0x43]; if(pSiS->SiS6326Flags & SIS6326_TVCVBS) tmp |= 0x10; tmp |= 0x08; pReg->sis6326tv[0x43] = tmp; j = 0; k = 0; for(i=0; i<=0x44; i++) { if(SiS6326TVRegs1[j] == i) { j++; continue; } if(pSiS->SiS6326Flags & SIS6326_TVPAL) { tmp = SiS6326TVRegs2_PAL[index][k]; } else { tmp = SiS6326TVRegs2_NTSC[index][k]; } pReg->sis6326tv[i] = tmp; k++; } pReg->sis6326tv[0x43] |= 0x08; if((pSiS->ChipRev == 0xc1) || (pSiS->ChipRev == 0xc2)) { pReg->sis6326tv[0x43] &= ~0x08; } tmp = pReg->sis6326tv[0]; tmp |= 0x18; if(pSiS->SiS6326Flags & SIS6326_TVCVBS) tmp &= ~0x10; if(pSiS->SiS6326Flags & SIS6326_TVSVIDEO) tmp &= ~0x08; tmp |= 0x04; pReg->sis6326tv[0] = tmp; } } /* VESA */ return TRUE; } /* Init a mode for SiS 300, 315, 330, 340 series * This function is now only used for setting up some * variables (eg. scrnOffset). */ Bool SIS300Init(ScrnInfoPtr pScrn, DisplayModePtr mode) { SISPtr pSiS = SISPTR(pScrn); SISRegPtr pReg = &pSiS->ModeReg; UShort temp; DisplayModePtr realmode = mode; PDEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4, "SIS300Init()\n")); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4, "virtualX = %d depth = %d Logical width = %d\n", pScrn->virtualX, pSiS->CurrentLayout.bitsPerPixel, pScrn->virtualX * pSiS->CurrentLayout.bitsPerPixel/8); #ifdef SISMERGED if(pSiS->MergedFB) { realmode = ((SiSMergedDisplayModePtr)mode->Private)->CRT1; } #endif /* Copy current register settings to structure */ (*pSiS->SiSSave)(pScrn, pReg); /* Calculate Offset/Display Pitch */ pSiS->scrnOffset = pSiS->CurrentLayout.displayWidth * ((pSiS->CurrentLayout.bitsPerPixel + 7) / 8); pSiS->scrnPitch = pSiS->scrnPitch2 = pSiS->scrnOffset; if(!(pSiS->VBFlags & CRT1_LCDA)) { if(realmode->Flags & V_INTERLACE) pSiS->scrnPitch <<= 1; } /* CRT2 mode can never be interlaced */ #ifdef UNLOCK_ALWAYS outSISIDXREG(SISSR, 0x05, 0x86); #endif switch(pSiS->CurrentLayout.bitsPerPixel) { case 8: pSiS->DstColor = 0x0000; pSiS->SiS310_AccelDepth = 0x00000000; break; case 16: if(pSiS->CurrentLayout.depth == 15) pSiS->DstColor = (short) 0x4000; else pSiS->DstColor = (short) 0x8000; pSiS->SiS310_AccelDepth = 0x00010000; break; case 32: pSiS->DstColor = (short) 0xC000; pSiS->SiS310_AccelDepth = 0x00020000; break; } /* Enable PCI LINEAR ADDRESSING (0x80), MMIO (0x01), PCI_IO (0x20) */ pReg->sisRegs3C4[0x20] = 0xA1; /* Now initialize TurboQueue. TB is always located at the very top of * the videoRAM (notably NOT the x framebuffer memory, which can/should * be limited by MaxXFbMem when using DRI). Also, enable the accelerators. */ if(!pSiS->NoAccel) { pReg->sisRegs3C4[0x1E] |= 0x42; /* Enable 2D accelerator */ pReg->sisRegs3C4[0x1E] |= 0x18; /* Enable 3D accelerator */ switch(pSiS->VGAEngine) { case SIS_300_VGA: if(pSiS->TurboQueue) { /* set Turbo Queue as 512k */ temp = ((pScrn->videoRam/64)-8); /* 8=512k, 4=256k, 2=128k, 1=64k */ pReg->sisRegs3C4[0x26] = temp & 0xFF; pReg->sisRegs3C4[0x27] = (pReg->sisRegs3C4[0x27] & 0xfc) | (((temp >> 8) & 3) | 0xF0); } /* line above new for saving D2&3 of status register */ break; case SIS_315_VGA: #ifndef SISVRAMQ /* See comments in sis_driver.c */ pReg->sisRegs3C4[0x27] = 0x1F; pReg->sisRegs3C4[0x26] = 0x22; pReg->sisMMIO85C0 = (pScrn->videoRam - 512) * 1024; #endif break; } } return TRUE; } static void SiS6326TVDelay(ScrnInfoPtr pScrn, int delay) { SISPtr pSiS = SISPTR(pScrn); int i; UChar temp; for(i=0; iSiS6326Flags &= (SIS6326_HASTV | SIS6326_TVPAL); temp = SiS6326GetTVReg(pScrn, 0x43); temp &= 0xfb; SiS6326SetTVReg(pScrn, 0x43, temp); result = SIS6326DoSense(pScrn, 0x01, 0xb0, 0x06, SIS6326_TVSVIDEO); /* 0x02 */ pSiS->SiS6326Flags |= result; result = SIS6326DoSense(pScrn, 0x01, 0xa0, 0x01, SIS6326_TVCVBS); /* 0x04 */ pSiS->SiS6326Flags |= result; temp = SiS6326GetTVReg(pScrn, 0x43); temp &= 0xfb; SiS6326SetTVReg(pScrn, 0x43, temp); if(pSiS->SiS6326Flags & (SIS6326_TVSVIDEO | SIS6326_TVCVBS)) { pSiS->SiS6326Flags |= SIS6326_TVDETECTED; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "SiS6326: Detected TV connected to %s output\n", (((pSiS->SiS6326Flags & (SIS6326_TVSVIDEO | SIS6326_TVCVBS)) == (SIS6326_TVSVIDEO | SIS6326_TVCVBS)) ? "both SVIDEO and COMPOSITE" : ((pSiS->SiS6326Flags & SIS6326_TVSVIDEO) ? "SVIDEO" : "COMPOSITE"))); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "SiS6326: No TV detected\n"); } } static Bool SISIsUMC(SISPtr pSiS) { UShort p4_0f, p4_25, p4_27, temp; inSISIDXREG(SISPART4, 0x0f, p4_0f); inSISIDXREG(SISPART4, 0x25, p4_25); inSISIDXREG(SISPART4, 0x27, p4_27); andSISIDXREG(SISPART4, 0x0f, 0x7f); orSISIDXREG(SISPART4, 0x25, 0x08); andSISIDXREG(SISPART4, 0x27, 0xfd); inSISIDXREG(SISPART4, 0x26, temp); outSISIDXREG(SISPART4, 0x27, p4_27); outSISIDXREG(SISPART4, 0x25, p4_25); outSISIDXREG(SISPART4, 0x0f, p4_0f); return((temp & 0x08) ? TRUE : FALSE); } /* Detect video bridge and set VBFlags accordingly */ void SISVGAPreInit(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); int temp,temp1,temp2,sistypeidx; int upperlimitlvds, lowerlimitlvds; int upperlimitch, lowerlimitch; int chronteltype, chrontelidreg, upperlimitvb; static const char *detectvb = "Detected SiS%s video bridge (%s, ID %d; Rev 0x%x)\n"; #if 0 UChar sr17=0; #endif static const char *ChrontelTypeStr[] = { "7004", "7005", "7007", "7006", "7008", "7013", "7019", "7020", "(unknown)" }; static const char *SiSVBTypeStr[] = { "301", /* 0 */ "301B", /* 1 */ "301B-DH", /* 2 */ "301LV", /* 3 */ "302LV", /* 4 */ "301C", /* 5 */ "302ELV", /* 6 */ "302B" /* 7 */ }; switch(pSiS->Chipset) { case PCI_CHIP_SIS300: case PCI_CHIP_SIS540: case PCI_CHIP_SIS630: case PCI_CHIP_SIS550: case PCI_CHIP_SIS315: case PCI_CHIP_SIS315H: case PCI_CHIP_SIS315PRO: case PCI_CHIP_SIS650: case PCI_CHIP_SIS330: case PCI_CHIP_SIS660: case PCI_CHIP_SIS340: case PCI_CHIP_XGIXG20: case PCI_CHIP_XGIXG40: pSiS->ModeInit = SIS300Init; break; default: pSiS->ModeInit = SISInit; } if((pSiS->Chipset == PCI_CHIP_SIS6326) && (pSiS->SiS6326Flags & SIS6326_HASTV)) { UChar sr0d; inSISIDXREG(SISSR, 0x0d, sr0d); if(sr0d & 0x04) { pSiS->SiS6326Flags |= SIS6326_TVPAL; } SISSense6326(pScrn); } pSiS->VBFlags = pSiS->VBFlags2 = 0; /* reset VBFlags */ pSiS->SiS_Pr->SiS_UseLCDA = FALSE; pSiS->SiS_Pr->Backup = FALSE; /* Videobridges only available for 300/315/330/340 series */ if((pSiS->VGAEngine != SIS_300_VGA) && (pSiS->VGAEngine != SIS_315_VGA)) return; /* No video bridge ever on XGI Z7 (XG20) */ if(pSiS->ChipType == XGI_20) return; inSISIDXREG(SISPART4, 0x00, temp); temp &= 0x0F; if(temp == 1) { inSISIDXREG(SISPART4, 0x01, temp1); temp1 &= 0xff; if(temp1 >= 0xC0) { if(SISIsUMC(pSiS)) pSiS->VBFlags2 |= VB2_SISUMC; } if(temp1 >= 0xE0) { inSISIDXREG(SISPART4, 0x39, temp2); if(temp2 == 0xff) { pSiS->VBFlags2 |= VB2_302LV; sistypeidx = 4; } else { pSiS->VBFlags2 |= VB2_301C; /* VB_302ELV; */ sistypeidx = 5; /* 6; */ } } else if(temp1 >= 0xD0) { pSiS->VBFlags2 |= VB2_301LV; sistypeidx = 3; } else if(temp1 >= 0xC0) { pSiS->VBFlags2 |= VB2_301C; sistypeidx = 5; } else if(temp1 >= 0xB0) { pSiS->VBFlags2 |= VB2_301B; sistypeidx = 1; inSISIDXREG(SISPART4, 0x23, temp2); if(!(temp2 & 0x02)) { pSiS->VBFlags2 |= VB2_30xBDH; sistypeidx = 2; } } else { pSiS->VBFlags2 |= VB2_301; sistypeidx = 0; } xf86DrvMsg(pScrn->scrnIndex, X_PROBED, detectvb, SiSVBTypeStr[sistypeidx], (pSiS->VBFlags2 & VB2_SISUMC) ? "UMC-0" : "Charter/UMC-1", 1, temp1); SISSense30x(pScrn, FALSE); } else if(temp == 2) { inSISIDXREG(SISPART4, 0x01, temp1); temp1 &= 0xff; if(temp1 >= 0xC0) { if(SISIsUMC(pSiS)) pSiS->VBFlags2 |= VB2_SISUMC; } if(temp1 >= 0xE0) { pSiS->VBFlags2 |= VB2_302LV; sistypeidx = 4; } else if(temp1 >= 0xD0) { pSiS->VBFlags2 |= VB2_301LV; sistypeidx = 3; } else { pSiS->VBFlags2 |= VB2_302B; sistypeidx = 7; } xf86DrvMsg(pScrn->scrnIndex, X_PROBED, detectvb, SiSVBTypeStr[sistypeidx], (pSiS->VBFlags2 & VB2_SISUMC) ? "UMC-0" : "Charter/UMC-1", 2, temp1); SISSense30x(pScrn, FALSE); } else if (temp == 3) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, detectvb, "303", "unsupported, unknown", temp, 0); } else { if(pSiS->NewCRLayout) { inSISIDXREG(SISCR, 0x38, temp); temp = (temp >> 5) & 0x07; } else { inSISIDXREG(SISCR, 0x37, temp); temp = (temp >> 1) & 0x07; } if(pSiS->VGAEngine == SIS_300_VGA) { lowerlimitlvds = 2; upperlimitlvds = 4; lowerlimitch = 4; upperlimitch = 5; chronteltype = 1; chrontelidreg = 0x25; upperlimitvb = upperlimitlvds; } else { lowerlimitlvds = 2; upperlimitlvds = 3; lowerlimitch = 3; upperlimitch = 3; chronteltype = 2; chrontelidreg = 0x4b; upperlimitvb = upperlimitlvds; if(pSiS->NewCRLayout) { upperlimitvb = 4; } } if((temp >= lowerlimitlvds) && (temp <= upperlimitlvds)) { pSiS->VBFlags2 |= VB2_LVDS; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected LVDS transmitter (External chip ID %d)\n", temp); } if((temp >= lowerlimitch) && (temp <= upperlimitch)) { /* Set global for init301.c */ pSiS->SiS_Pr->SiS_IF_DEF_CH70xx = chronteltype; if(chronteltype == 1) { /* Set general purpose IO for Chrontel communication */ SiS_SetChrontelGPIO(pSiS->SiS_Pr, 0x9c); } /* Read Chrontel version number */ temp1 = SiS_GetCH70xx(pSiS->SiS_Pr, chrontelidreg); if(chronteltype == 1) { /* See Chrontel TB31 for explanation */ temp2 = SiS_GetCH700x(pSiS->SiS_Pr, 0x0e); if(((temp2 & 0x07) == 0x01) || (temp2 & 0x04)) { SiS_SetCH700x(pSiS->SiS_Pr, 0x0e, 0x0b); SiS_DDC2Delay(pSiS->SiS_Pr, 300); } temp2 = SiS_GetCH70xx(pSiS->SiS_Pr, chrontelidreg); if(temp2 != temp1) temp1 = temp2; } if(temp1 == 0xFFFF) { /* 0xFFFF = error reading DDC port */ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Detected Chrontel 70xx, but encountered error reading I2C port\n"); andSISIDXREG(SISCR, 0x32, ~0x07); pSiS->postVBCR32 &= ~0x07; } else if((temp1 >= 0x19) && (temp1 <= 200)) { /* We only support device ids 0x19-200; other values may indicate DDC problems */ pSiS->VBFlags2 |= VB2_CHRONTEL; switch (temp1) { case 0x32: temp2 = 0; pSiS->ChrontelType = CHRONTEL_700x; break; case 0x3A: temp2 = 1; pSiS->ChrontelType = CHRONTEL_700x; break; case 0x50: temp2 = 2; pSiS->ChrontelType = CHRONTEL_700x; break; case 0x2A: temp2 = 3; pSiS->ChrontelType = CHRONTEL_700x; break; case 0x40: temp2 = 4; pSiS->ChrontelType = CHRONTEL_700x; break; case 0x22: temp2 = 5; pSiS->ChrontelType = CHRONTEL_700x; break; case 0x19: temp2 = 6; pSiS->ChrontelType = CHRONTEL_701x; break; case 0x20: temp2 = 7; pSiS->ChrontelType = CHRONTEL_701x; break; /* ID for 7020? */ default: temp2 = 8; pSiS->ChrontelType = CHRONTEL_701x; break; } xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel %s TV encoder (ID 0x%02x; chip ID %d)\n", ChrontelTypeStr[temp2], temp1, temp); /* Sense connected TV's */ SISSenseChrontel(pScrn, FALSE); } else if(temp1 == 0) { /* This indicates a communication problem, but it only occures if there * is no TV attached. So we don't use TV in this case. */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected Chrontel TV encoder in promiscuous state (DDC/I2C mix-up)\n"); andSISIDXREG(SISCR, 0x32, ~0x07); pSiS->postVBCR32 &= ~0x07; } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Chrontel: Unsupported device id (%d) detected\n",temp1); andSISIDXREG(SISCR, 0x32, ~0x07); pSiS->postVBCR32 &= ~0x07; } if(chronteltype == 1) { /* Set general purpose IO for Chrontel communication */ SiS_SetChrontelGPIO(pSiS->SiS_Pr, 0x00); } } if((pSiS->NewCRLayout) && (temp == 4)) { pSiS->VBFlags2 |= VB2_CONEXANT; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Conexant video bridge - UNSUPPORTED\n"); } if((pSiS->VGAEngine == SIS_300_VGA) && (temp == 3)) { pSiS->VBFlags2 |= VB2_TRUMPION; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Trumpion Zurac (I/II/III) LVDS scaler\n"); } if(temp > upperlimitvb) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Detected unknown bridge type (%d)\n", temp); } } /* Old BIOSes store the detected CRT2 type in SR17, 16 and 13 * instead of CR32. However, since our detection routines * store their results to CR32, we now copy the * remaining bits (for LCD and VGA) to CR32 for unified usage. * SR17[0] CRT1 [1] LCD [2] TV [3] VGA2 * [4] AVIDEO [5] SVIDEO * SR13[0] SCART [1] HiVision * SR16[5] PAL/NTSC [6] LCD-SCALE [7] OVERSCAN */ #if 0 inSISIDXREG(SISSR, 0x17, sr17); if( (pSiS->VGAEngine == SIS_300_VGA) && (pSiS->Chipset != PCI_CHIP_SIS300) && (sr17 & 0x0F) ) { UChar cr32; inSISIDXREG(SISCR, 0x32, cr32); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Converting SR17 (%02x) to CR32 (%02x)\n", sr17, cr32); if(sr17 & 0x01) { /* CRT1 */ orSISIDXREG(SISCR, 0x32, 0x20); pSiS->postVBCR32 |= 0x20; } else { andSISIDXREG(SISCR, 0x32, ~0x20); pSiS->postVBCR32 &= ~0x20; } if(sr17 & 0x02) { /* LCD */ orSISIDXREG(SISCR, 0x32, 0x08); pSiS->postVBCR32 |= 0x08; } else { andSISIDXREG(SISCR, 0x32, ~0x08); pSiS->postVBCR32 &= ~0x08; } /* No Hivision, no DVI here */ andSISIDXREG(SISCR,0x32,~0xc0); pSiS->postVBCR32 &= ~0xc0; } #endif /* Try to find out if the bridge uses LCDA for low resolution and * text modes. If sisfb saved this for us, use it. Otherwise, * check if we are running on a low mode on LCD and read the * relevant registers ourselves. */ if(pSiS->VGAEngine == SIS_315_VGA) { if(pSiS->VBFlags2 & VB2_SISLCDABRIDGE) { if(pSiS->sisfblcda != 0xff) { if((pSiS->sisfblcda & 0x03) == 0x03) { pSiS->SiS_Pr->SiS_UseLCDA = TRUE; pSiS->ChipFlags |= SiSCF_UseLCDA; } } else { inSISIDXREG(SISCR,0x34,temp); if(temp <= 0x13) { inSISIDXREG(SISCR,0x38,temp); if((temp & 0x03) == 0x03) { pSiS->SiS_Pr->SiS_UseLCDA = TRUE; pSiS->ChipFlags |= SiSCF_UseLCDA; pSiS->SiS_Pr->Backup = TRUE; } else { orSISIDXREG(SISPART1,0x2f,0x01); /* Unlock CRT2 */ inSISIDXREG(SISPART1,0x13,temp); if(temp & 0x04) { pSiS->SiS_Pr->SiS_UseLCDA = TRUE; pSiS->ChipFlags |= SiSCF_UseLCDA; pSiS->SiS_Pr->Backup = TRUE; } } } } if(pSiS->ChipFlags & SiSCF_UseLCDA) { xf86DrvMsgVerb(pScrn->scrnIndex, X_PROBED, 3, "BIOS uses LCDA for low resolution and text modes\n"); if(pSiS->SiS_Pr->Backup == TRUE) { inSISIDXREG(SISCR,0x34,pSiS->SiS_Pr->Backup_Mode); inSISIDXREG(SISPART1,0x14,pSiS->SiS_Pr->Backup_14); inSISIDXREG(SISPART1,0x15,pSiS->SiS_Pr->Backup_15); inSISIDXREG(SISPART1,0x16,pSiS->SiS_Pr->Backup_16); inSISIDXREG(SISPART1,0x17,pSiS->SiS_Pr->Backup_17); inSISIDXREG(SISPART1,0x18,pSiS->SiS_Pr->Backup_18); inSISIDXREG(SISPART1,0x19,pSiS->SiS_Pr->Backup_19); inSISIDXREG(SISPART1,0x1a,pSiS->SiS_Pr->Backup_1a); inSISIDXREG(SISPART1,0x1b,pSiS->SiS_Pr->Backup_1b); inSISIDXREG(SISPART1,0x1c,pSiS->SiS_Pr->Backup_1c); inSISIDXREG(SISPART1,0x1d,pSiS->SiS_Pr->Backup_1d); } } } } } static void SiS_WriteAttr(SISPtr pSiS, int index, int value) { (void)inSISREG(SISINPSTAT); index |= 0x20; outSISREG(SISAR, index); outSISREG(SISAR, value); } static int SiS_ReadAttr(SISPtr pSiS, int index) { (void)inSISREG(SISINPSTAT); index |= 0x20; outSISREG(SISAR, index); return(inSISREG(SISARR)); } static void SiS_EnablePalette(SISPtr pSiS) { (void)inSISREG(SISINPSTAT); outSISREG(SISAR, 0x00); pSiS->VGAPaletteEnabled = TRUE; } static void SiS_DisablePalette(SISPtr pSiS) { (void)inSISREG(SISINPSTAT); outSISREG(SISAR, 0x20); pSiS->VGAPaletteEnabled = FALSE; } void SISVGALock(SISPtr pSiS) { orSISIDXREG(SISCR, 0x11, 0x80); /* Protect CRTC[0-7] */ } void SiSVGAUnlock(SISPtr pSiS) { andSISIDXREG(SISCR, 0x11, 0x7f); /* Unprotect CRTC[0-7] */ } #define SIS_FONTS_SIZE (8 * 8192) void SiSVGASaveFonts(ScrnInfoPtr pScrn) { #ifdef SIS_PC_PLATFORM SISPtr pSiS = SISPTR(pScrn); pointer vgaMemBase = pSiS->VGAMemBase; UChar miscOut, attr10, gr4, gr5, gr6, seq2, seq4, scrn; if((pSiS->fonts) || (vgaMemBase == NULL)) return; /* If in graphics mode, don't save anything */ attr10 = SiS_ReadAttr(pSiS, 0x10); if(attr10 & 0x01) return; if(!(pSiS->fonts = malloc(SIS_FONTS_SIZE * 2))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not save console fonts, mem allocation failed\n"); return; } /* save the registers that are needed here */ miscOut = inSISREG(SISMISCR); inSISIDXREG(SISGR, 0x04, gr4); inSISIDXREG(SISGR, 0x05, gr5); inSISIDXREG(SISGR, 0x06, gr6); inSISIDXREG(SISSR, 0x02, seq2); inSISIDXREG(SISSR, 0x04, seq4); /* Force into color mode */ outSISREG(SISMISCW, miscOut | 0x01); inSISIDXREG(SISSR, 0x01, scrn); outSISIDXREG(SISSR, 0x00, 0x01); outSISIDXREG(SISSR, 0x01, scrn | 0x20); outSISIDXREG(SISSR, 0x00, 0x03); SiS_WriteAttr(pSiS, 0x10, 0x01); /* graphics mode */ /*font1 */ outSISIDXREG(SISSR, 0x02, 0x04); /* write to plane 2 */ outSISIDXREG(SISSR, 0x04, 0x06); /* enable plane graphics */ outSISIDXREG(SISGR, 0x04, 0x02); /* read plane 2 */ outSISIDXREG(SISGR, 0x05, 0x00); /* write mode 0, read mode 0 */ outSISIDXREG(SISGR, 0x06, 0x05); /* set graphics */ slowbcopy_frombus(vgaMemBase, pSiS->fonts, SIS_FONTS_SIZE); /* font2 */ outSISIDXREG(SISSR, 0x02, 0x08); /* write to plane 3 */ outSISIDXREG(SISSR, 0x04, 0x06); /* enable plane graphics */ outSISIDXREG(SISGR, 0x04, 0x03); /* read plane 3 */ outSISIDXREG(SISGR, 0x05, 0x00); /* write mode 0, read mode 0 */ outSISIDXREG(SISGR, 0x06, 0x05); /* set graphics */ slowbcopy_frombus(vgaMemBase, pSiS->fonts + SIS_FONTS_SIZE, SIS_FONTS_SIZE); inSISIDXREG(SISSR, 0x01, scrn); outSISIDXREG(SISSR, 0x00, 0x01); outSISIDXREG(SISSR, 0x01, scrn & ~0x20); outSISIDXREG(SISSR, 0x00, 0x03); /* Restore clobbered registers */ SiS_WriteAttr(pSiS, 0x10, attr10); outSISIDXREG(SISSR, 0x02, seq2); outSISIDXREG(SISSR, 0x04, seq4); outSISIDXREG(SISGR, 0x04, gr4); outSISIDXREG(SISGR, 0x05, gr5); outSISIDXREG(SISGR, 0x06, gr6); outSISREG(SISMISCW, miscOut); #endif } static void SiSVGASaveMode(ScrnInfoPtr pScrn, SISRegPtr save) { SISPtr pSiS = SISPTR(pScrn); int i; save->sisRegMiscOut = inSISREG(SISMISCR); for(i = 0; i < 25; i++) { inSISIDXREG(SISCR, i, save->sisRegs3D4[i]); } SiS_EnablePalette(pSiS); for(i = 0; i < 21; i++) { save->sisRegsATTR[i] = SiS_ReadAttr(pSiS, i); } SiS_DisablePalette(pSiS); for(i = 0; i < 9; i++) { inSISIDXREG(SISGR, i, save->sisRegsGR[i]); } for(i = 1; i < 5; i++) { inSISIDXREG(SISSR, i, save->sisRegs3C4[i]); } } static void SiSVGASaveColormap(ScrnInfoPtr pScrn, SISRegPtr save) { SISPtr pSiS = SISPTR(pScrn); int i; if(pSiS->VGACMapSaved) return; outSISREG(SISPEL, 0xff); outSISREG(SISCOLIDXR, 0x00); for(i = 0; i < 768; i++) { save->sisDAC[i] = inSISREG(SISCOLDATA); (void)inSISREG(SISINPSTAT); (void)inSISREG(SISINPSTAT); } SiS_DisablePalette(pSiS); pSiS->VGACMapSaved = TRUE; } void SiSVGASave(ScrnInfoPtr pScrn, SISRegPtr save, int flags) { if(save == NULL) return; if(flags & SISVGA_SR_CMAP) SiSVGASaveColormap(pScrn, save); if(flags & SISVGA_SR_MODE) SiSVGASaveMode(pScrn, save); if(flags & SISVGA_SR_FONTS) SiSVGASaveFonts(pScrn); } void SiSVGARestoreFonts(ScrnInfoPtr pScrn) { #ifdef SIS_PC_PLATFORM SISPtr pSiS = SISPTR(pScrn); pointer vgaMemBase = pSiS->VGAMemBase; UChar miscOut, attr10, gr1, gr3, gr4, gr5, gr6, gr8, seq2, seq4, scrn; if((!pSiS->fonts) || (vgaMemBase == NULL)) return; /* save the registers that are needed here */ miscOut = inSISREG(SISMISCR); attr10 = SiS_ReadAttr(pSiS, 0x10); inSISIDXREG(SISGR, 0x01, gr1); inSISIDXREG(SISGR, 0x03, gr3); inSISIDXREG(SISGR, 0x04, gr4); inSISIDXREG(SISGR, 0x05, gr5); inSISIDXREG(SISGR, 0x06, gr6); inSISIDXREG(SISGR, 0x08, gr8); inSISIDXREG(SISSR, 0x02, seq2); inSISIDXREG(SISSR, 0x04, seq4); /* Force into color mode */ outSISREG(SISMISCW, miscOut | 0x01); inSISIDXREG(SISSR, 0x01, scrn); outSISIDXREG(SISSR, 0x00, 0x01); outSISIDXREG(SISSR, 0x01, scrn | 0x20); outSISIDXREG(SISSR, 0x00, 0x03); SiS_WriteAttr(pSiS, 0x10, 0x01); /* graphics mode */ if(pScrn->depth == 4) { outSISIDXREG(SISGR, 0x03, 0x00); /* don't rotate, write unmodified */ outSISIDXREG(SISGR, 0x08, 0xFF); /* write all bits in a byte */ outSISIDXREG(SISGR, 0x01, 0x00); /* all planes come from CPU */ } outSISIDXREG(SISSR, 0x02, 0x04); /* write to plane 2 */ outSISIDXREG(SISSR, 0x04, 0x06); /* enable plane graphics */ outSISIDXREG(SISGR, 0x04, 0x02); /* read plane 2 */ outSISIDXREG(SISGR, 0x05, 0x00); /* write mode 0, read mode 0 */ outSISIDXREG(SISGR, 0x06, 0x05); /* set graphics */ slowbcopy_tobus(pSiS->fonts, vgaMemBase, SIS_FONTS_SIZE); outSISIDXREG(SISSR, 0x02, 0x08); /* write to plane 3 */ outSISIDXREG(SISSR, 0x04, 0x06); /* enable plane graphics */ outSISIDXREG(SISGR, 0x04, 0x03); /* read plane 3 */ outSISIDXREG(SISGR, 0x05, 0x00); /* write mode 0, read mode 0 */ outSISIDXREG(SISGR, 0x06, 0x05); /* set graphics */ slowbcopy_tobus(pSiS->fonts + SIS_FONTS_SIZE, vgaMemBase, SIS_FONTS_SIZE); inSISIDXREG(SISSR, 0x01, scrn); outSISIDXREG(SISSR, 0x00, 0x01); outSISIDXREG(SISSR, 0x01, scrn & ~0x20); outSISIDXREG(SISSR, 0x00, 0x03); /* restore the registers that were changed */ outSISREG(SISMISCW, miscOut); SiS_WriteAttr(pSiS, 0x10, attr10); outSISIDXREG(SISGR, 0x01, gr1); outSISIDXREG(SISGR, 0x03, gr3); outSISIDXREG(SISGR, 0x04, gr4); outSISIDXREG(SISGR, 0x05, gr5); outSISIDXREG(SISGR, 0x06, gr6); outSISIDXREG(SISGR, 0x08, gr8); outSISIDXREG(SISSR, 0x02, seq2); outSISIDXREG(SISSR, 0x04, seq4); #endif } static void SiSVGARestoreMode(ScrnInfoPtr pScrn, SISRegPtr restore) { SISPtr pSiS = SISPTR(pScrn); int i; outSISREG(SISMISCW, restore->sisRegMiscOut); for(i = 1; i < 5; i++) { outSISIDXREG(SISSR, i, restore->sisRegs3C4[i]); } outSISIDXREG(SISCR, 17, restore->sisRegs3D4[17] & ~0x80); for(i = 0; i < 25; i++) { outSISIDXREG(SISCR, i, restore->sisRegs3D4[i]); } for(i = 0; i < 9; i++) { outSISIDXREG(SISGR, i, restore->sisRegsGR[i]); } SiS_EnablePalette(pSiS); for(i = 0; i < 21; i++) { SiS_WriteAttr(pSiS, i, restore->sisRegsATTR[i]); } SiS_DisablePalette(pSiS); } static void SiSVGARestoreColormap(ScrnInfoPtr pScrn, SISRegPtr restore) { SISPtr pSiS = SISPTR(pScrn); int i; if(!pSiS->VGACMapSaved) return; outSISREG(SISPEL, 0xff); outSISREG(SISCOLIDX, 0x00); for(i = 0; i < 768; i++) { outSISREG(SISCOLDATA, restore->sisDAC[i]); (void)inSISREG(SISINPSTAT); (void)inSISREG(SISINPSTAT); } SiS_DisablePalette(pSiS); } void SiSVGARestore(ScrnInfoPtr pScrn, SISRegPtr restore, int flags) { if(restore == NULL) return; if(flags & SISVGA_SR_MODE) SiSVGARestoreMode(pScrn, restore); if(flags & SISVGA_SR_FONTS) SiSVGARestoreFonts(pScrn); if(flags & SISVGA_SR_CMAP) SiSVGARestoreColormap(pScrn, restore); } static void SiS_SeqReset(SISPtr pSiS, Bool start) { if(start) { outSISIDXREG(SISSR, 0x00, 0x01); /* Synchronous Reset */ } else { outSISIDXREG(SISSR, 0x00, 0x03); /* End Reset */ } } void SiSVGAProtect(ScrnInfoPtr pScrn, Bool on) { SISPtr pSiS = SISPTR(pScrn); UChar tmp; if(!pScrn->vtSema) return; if(on) { inSISIDXREG(SISSR, 0x01, tmp); SiS_SeqReset(pSiS, TRUE); /* start synchronous reset */ outSISIDXREG(SISSR, 0x01, tmp | 0x20); /* disable display */ SiS_EnablePalette(pSiS); } else { andSISIDXREG(SISSR, 0x01, ~0x20); /* enable display */ SiS_SeqReset(pSiS, FALSE); /* clear synchronous reset */ SiS_DisablePalette(pSiS); } } #ifdef SIS_PC_PLATFORM Bool SiSVGAMapMem(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); /* Map only once */ if(pSiS->VGAMemBase) return TRUE; if(pSiS->VGAMapSize == 0) pSiS->VGAMapSize = (64 * 1024); if(pSiS->VGAMapPhys == 0) pSiS->VGAMapPhys = 0xA0000; #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0) #if XSERVER_LIBPCIACCESS (void) pci_device_map_legacy(pSiS->PciInfo, pSiS->VGAMapPhys, pSiS->VGAMapSize, PCI_DEV_MAP_FLAG_WRITABLE, &pSiS->VGAMemBase); #else pSiS->VGAMemBase = xf86MapDomainMemory(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, pSiS->PciTag, pSiS->VGAMapPhys, pSiS->VGAMapSize); #endif #else pSiS->VGAMemBase = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, pSiS->VGAMapPhys, pSiS->VGAMapSize); #endif return(pSiS->VGAMemBase != NULL); } void SiSVGAUnmapMem(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); if(pSiS->VGAMemBase == NULL) return; #if XSERVER_LIBPCIACCESS (void) pci_device_unmap_legacy(pSiS->PciInfo, pSiS->VGAMemBase, pSiS->VGAMapSize); #else xf86UnMapVidMem(pScrn->scrnIndex, pSiS->VGAMemBase, pSiS->VGAMapSize); #endif pSiS->VGAMemBase = NULL; } #endif #if 0 static CARD32 SiS_HBlankKGA(DisplayModePtr mode, SISRegPtr regp, int nBits, unsigned int Flags) { int nExtBits = (nBits < 6) ? 0 : nBits - 6; CARD32 ExtBits; CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 6; regp->sisRegs3D4[3] = (regp->sisRegs3D4[3] & ~0x1F) | (((mode->CrtcHBlankEnd >> 3) - 1) & 0x1F); regp->sisRegs3D4[5] = (regp->sisRegs3D4[5] & ~0x80) | ((((mode->CrtcHBlankEnd >> 3) - 1) & 0x20) << 2); ExtBits = ((mode->CrtcHBlankEnd >> 3) - 1) & ExtBitMask; if( (Flags & SISKGA_FIX_OVERSCAN) && ((mode->CrtcHBlankEnd >> 3) == (mode->CrtcHTotal >> 3))) { int i = (regp->sisRegs3D4[3] & 0x1F) | ((regp->sisRegs3D4[5] & 0x80) >> 2) | ExtBits; if(Flags & SISKGA_ENABLE_ON_ZERO) { if( (i-- > (((mode->CrtcHBlankStart >> 3) - 1) & (0x3F | ExtBitMask))) && (mode->CrtcHBlankEnd == mode->CrtcHTotal) ) { i = 0; } } else if (Flags & SISKGA_BE_TOT_DEC) i--; regp->sisRegs3D4[3] = (regp->sisRegs3D4[3] & ~0x1F) | (i & 0x1F); regp->sisRegs3D4[5] = (regp->sisRegs3D4[5] & ~0x80) | ((i << 2) & 0x80); ExtBits = i & ExtBitMask; } return ExtBits >> 6; } #endif static CARD32 SiS_VBlankKGA(DisplayModePtr mode, SISRegPtr regp, int nBits, unsigned int Flags) { CARD32 nExtBits = (nBits < 8) ? 0 : (nBits - 8); CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 8; CARD32 ExtBits = (mode->CrtcVBlankEnd - 1) & ExtBitMask; CARD32 BitMask = (nBits < 7) ? 0 : ((1 << nExtBits) - 1); int VBlankStart = (mode->CrtcVBlankStart - 1) & 0xFF; regp->sisRegs3D4[22] = (mode->CrtcVBlankEnd - 1) & 0xFF; if((Flags & SISKGA_FIX_OVERSCAN) && (mode->CrtcVBlankEnd == mode->CrtcVTotal)) { int i = regp->sisRegs3D4[22] | ExtBits; if(Flags & SISKGA_ENABLE_ON_ZERO) { if( ((BitMask && ((i & BitMask) > (VBlankStart & BitMask))) || ((i > VBlankStart) && /* 8-bit case */ ((i & 0x7F) > (VBlankStart & 0x7F)))) && /* 7-bit case */ (!(regp->sisRegs3D4[9] & 0x9F)) ) { /* 1 scanline/row */ i = 0; } else { i--; } } else if(Flags & SISKGA_BE_TOT_DEC) i--; regp->sisRegs3D4[22] = i & 0xFF; ExtBits = i & 0xFF00; } return (ExtBits >> 8); } Bool SiSVGAInit(ScrnInfoPtr pScrn, DisplayModePtr mode, int fixsync) { SISPtr pSiS = SISPTR(pScrn); SISRegPtr regp = &pSiS->ModeReg; int depth = pScrn->depth; unsigned int i; /* Sync */ if((mode->Flags & (V_PHSYNC | V_NHSYNC)) && (mode->Flags & (V_PVSYNC | V_NVSYNC))) { regp->sisRegMiscOut = 0x23; if(mode->Flags & V_NHSYNC) regp->sisRegMiscOut |= 0x40; if(mode->Flags & V_NVSYNC) regp->sisRegMiscOut |= 0x80; } else { int VDisplay = mode->VDisplay; if(mode->Flags & V_DBLSCAN) VDisplay *= 2; if(mode->VScan > 1) VDisplay *= mode->VScan; if(VDisplay < 400) regp->sisRegMiscOut = 0xA3; /* +hsync -vsync */ else if (VDisplay < 480) regp->sisRegMiscOut = 0x63; /* -hsync +vsync */ else if (VDisplay < 768) regp->sisRegMiscOut = 0xE3; /* -hsync -vsync */ else regp->sisRegMiscOut = 0x23; /* +hsync +vsync */ } regp->sisRegMiscOut |= (mode->ClockIndex & 0x03) << 2; /* Seq */ if(depth == 4) regp->sisRegs3C4[0] = 0x02; else regp->sisRegs3C4[0] = 0x00; if(mode->Flags & V_CLKDIV2) regp->sisRegs3C4[1] = 0x09; else regp->sisRegs3C4[1] = 0x01; regp->sisRegs3C4[2] = 0x0F; regp->sisRegs3C4[3] = 0x00; if(depth < 8) regp->sisRegs3C4[4] = 0x06; else regp->sisRegs3C4[4] = 0x0E; /* CRTC */ regp->sisRegs3D4[0] = (mode->CrtcHTotal >> 3) - 5; regp->sisRegs3D4[1] = (mode->CrtcHDisplay >> 3) - 1; regp->sisRegs3D4[2] = (mode->CrtcHBlankStart >> 3) - 1; regp->sisRegs3D4[3] = (((mode->CrtcHBlankEnd >> 3) - 1) & 0x1F) | 0x80; i = (((mode->CrtcHSkew << 2) + 0x10) & ~0x1F); if(i < 0x80) regp->sisRegs3D4[3] |= i; regp->sisRegs3D4[4] = (mode->CrtcHSyncStart >> 3) - fixsync; regp->sisRegs3D4[5] = ((((mode->CrtcHBlankEnd >> 3) - 1) & 0x20) << 2) | (((mode->CrtcHSyncEnd >> 3) - fixsync) & 0x1F); regp->sisRegs3D4[6] = (mode->CrtcVTotal - 2) & 0xFF; regp->sisRegs3D4[7] = (((mode->CrtcVTotal - 2) & 0x100) >> 8) | (((mode->CrtcVDisplay - 1) & 0x100) >> 7) | (((mode->CrtcVSyncStart - fixsync) & 0x100) >> 6) | (((mode->CrtcVBlankStart - 1) & 0x100) >> 5) | 0x10 | (((mode->CrtcVTotal - 2) & 0x200) >> 4) | (((mode->CrtcVDisplay - 1) & 0x200) >> 3) | (((mode->CrtcVSyncStart - fixsync) & 0x200) >> 2); regp->sisRegs3D4[8] = 0x00; regp->sisRegs3D4[9] = (((mode->CrtcVBlankStart - 1) & 0x200) >> 4) | 0x40; if(mode->Flags & V_DBLSCAN) regp->sisRegs3D4[9] |= 0x80; if(mode->VScan >= 32) regp->sisRegs3D4[9] |= 0x1F; else if (mode->VScan > 1) regp->sisRegs3D4[9] |= mode->VScan - 1; regp->sisRegs3D4[10] = 0x00; regp->sisRegs3D4[11] = 0x00; regp->sisRegs3D4[12] = 0x00; regp->sisRegs3D4[13] = 0x00; regp->sisRegs3D4[14] = 0x00; regp->sisRegs3D4[15] = 0x00; regp->sisRegs3D4[16] = (mode->CrtcVSyncStart - fixsync) & 0xFF; regp->sisRegs3D4[17] = ((mode->CrtcVSyncEnd - fixsync) & 0x0F) | 0x20; regp->sisRegs3D4[18] = (mode->CrtcVDisplay - 1) & 0xFF; regp->sisRegs3D4[19] = pScrn->displayWidth >> 4; regp->sisRegs3D4[20] = 0x00; regp->sisRegs3D4[21] = (mode->CrtcVBlankStart - 1) & 0xFF; regp->sisRegs3D4[22] = (mode->CrtcVBlankEnd - 1) & 0xFF; if(depth < 8) regp->sisRegs3D4[23] = 0xE3; else regp->sisRegs3D4[23] = 0xC3; regp->sisRegs3D4[24] = 0xFF; #if 0 SiS_HBlankKGA(mode, regp, 0, SISKGA_FIX_OVERSCAN | SISKGA_ENABLE_ON_ZERO); #endif SiS_VBlankKGA(mode, regp, 0, SISKGA_FIX_OVERSCAN | SISKGA_ENABLE_ON_ZERO); /* GR */ regp->sisRegsGR[0] = 0x00; regp->sisRegsGR[1] = 0x00; regp->sisRegsGR[2] = 0x00; regp->sisRegsGR[3] = 0x00; regp->sisRegsGR[4] = 0x00; if(depth == 4) regp->sisRegsGR[5] = 0x02; else regp->sisRegsGR[5] = 0x40; regp->sisRegsGR[6] = 0x05; /* only map 64k VGA memory !!!! */ regp->sisRegsGR[7] = 0x0F; regp->sisRegsGR[8] = 0xFF; /* Attr */ for(i = 0; i <= 15; i++) { /* standard colormap translation */ regp->sisRegsATTR[i] = i; } if(depth == 4) regp->sisRegsATTR[16] = 0x81; else regp->sisRegsATTR[16] = 0x41; if(depth >= 4) regp->sisRegsATTR[17] = 0xFF; else regp->sisRegsATTR[17] = 0x01; regp->sisRegsATTR[18] = 0x0F; regp->sisRegsATTR[19] = 0x00; regp->sisRegsATTR[20] = 0x00; return TRUE; } static void SISVGABlankScreen(ScrnInfoPtr pScrn, Bool on) { SISPtr pSiS = SISPTR(pScrn); UChar tmp, orig; inSISIDXREG(SISSR, 0x01, tmp); orig = tmp; if(on) tmp &= ~0x20; else tmp |= 0x20; /* Only update the hardware if the state changes because the reset will * disrupt the output requiring the screen to resync. */ if(orig == tmp) return; SiS_SeqReset(pSiS, TRUE); outSISIDXREG(SISSR, 0x01, tmp); SiS_SeqReset(pSiS, FALSE); } Bool SiSVGASaveScreen(ScreenPtr pScreen, int mode) { ScrnInfoPtr pScrn = NULL; Bool on = xf86IsUnblank(mode); if(pScreen == NULL) return FALSE; pScrn = xf86ScreenToScrn(pScreen); if(pScrn->vtSema) { SISVGABlankScreen(pScrn, on); } return TRUE; } #undef SIS_FONTS_SIZE xf86-video-sis-0.10.7/src/sispcirename.h0000664000076400007640000001273711763614406014671 00000000000000/* * 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 SISPCIRENAME_H #define SISPCIRENAME_H #include enum region_type { REGION_MEM, REGION_IO }; #include "xf86Module.h" #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 12 #if (defined(__alpha__) || defined(__ia64__)) && defined (linux) #define PCI_DOM_MASK 0x01fful #else #define PCI_DOM_MASK 0x0ffu #endif #ifndef PCI_DOM_MASK # define PCI_DOM_MASK 0x0ffu #endif #define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu) static inline uint32_t pciTag(int busnum, int devnum, int funcnum) { uint32_t tag; tag = (busnum & (PCI_DOMBUS_MASK)) << 16; tag |= (devnum & 0x00001fu) << 11; tag |= (funcnum & 0x000007u) << 8; return tag; } #endif /* GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 12 */ #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 /* SISPCIRENAME_H */ xf86-video-sis-0.10.7/src/310vtbl.h0000664000076400007640000016434711763614406013407 00000000000000/* * Register settings for SiS 315/330/340 series * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * If distributed as part of the Linux kernel, the following license terms * apply: * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the named License, * * or any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA * * Otherwise, the following license terms apply: * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted provided that the following conditions * * are met: * * 1) Redistributions of source code must retain the above copyright * * notice, this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright * * notice, this list of conditions and the following disclaimer in the * * documentation and/or other materials provided with the distribution. * * 3) The name of the author may not be used to endorse or promote products * * derived from this software without specific prior written permission. * * * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * */ static const struct SiS_Ext SiS310_EModeIDTable[] = { {0x6a,0x2212,0x0102,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x? */ {0x2e,0x0a1b,0x0101,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x8 */ {0x2f,0x0a1b,0x0100,SIS_RI_640x400, 0x00,0x00,0x05,0x05,0x10, 0}, /* 640x400x8 */ {0x30,0x2a1b,0x0103,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x8 */ {0x31,0x4a1b,0x0000,SIS_RI_720x480, 0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x8 */ {0x32,0x4a1b,0x0000,SIS_RI_720x576, 0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x8 */ {0x33,0x4a1d,0x0000,SIS_RI_720x480, 0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x16 */ {0x34,0x6a1d,0x0000,SIS_RI_720x576, 0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x16 */ {0x35,0x4a1f,0x0000,SIS_RI_720x480, 0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x32 */ {0x36,0x6a1f,0x0000,SIS_RI_720x576, 0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x32 */ {0x37,0x0212,0x0104,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x? */ {0x38,0x0a1b,0x0105,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x8 */ {0x3a,0x0e3b,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x8 */ {0x3c,0x0e3b,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x8 */ {0x3d,0x0e7d,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x16 */ {0x40,0x9a1c,0x010d,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x15 */ {0x41,0x9a1d,0x010e,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x16 */ {0x43,0x0a1c,0x0110,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08, 2}, {0x44,0x0a1d,0x0111,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x16 */ {0x46,0x2a1c,0x0113,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00, 3}, {0x47,0x2a1d,0x0114,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x16 */ {0x49,0x0a3c,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x07,0x13, 4}, {0x4a,0x0a3d,0x0117,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x16 */ {0x4c,0x0e7c,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, {0x4d,0x0e7d,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x16 */ {0x50,0x9a1b,0x0132,SIS_RI_320x240, 0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x8 */ {0x51,0xba1b,0x0133,SIS_RI_400x300, 0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x8 */ {0x52,0xba1b,0x0134,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x8 */ {0x56,0x9a1d,0x0135,SIS_RI_320x240, 0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x16 */ {0x57,0xba1d,0x0136,SIS_RI_400x300, 0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x16 */ {0x58,0xba1d,0x0137,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x16 */ {0x59,0x9a1b,0x0138,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x8 */ {0x5a,0x021b,0x0138,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x3f, 2}, /* 320x240x8 fstn */ {0x5b,0x0a1d,0x0135,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x3f, 2}, /* 320x240x16 fstn */ {0x5c,0xba1f,0x0000,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x32 */ {0x5d,0x0a1d,0x0139,SIS_RI_640x400, 0x00,0x00,0x05,0x07,0x10, 0}, {0x5e,0x0a1f,0x0000,SIS_RI_640x400, 0x00,0x00,0x05,0x07,0x10, 0}, /* 640x400x32 */ {0x62,0x0a3f,0x013a,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x32 */ {0x63,0x2a3f,0x013b,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x32 */ {0x64,0x0a7f,0x013c,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x32 */ {0x65,0x0eff,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x32 */ {0x66,0x0eff,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x32 */ {0x68,0x067b,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x8 */ {0x69,0x06fd,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x16 */ {0x6b,0x07ff,0x0141,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x32 */ {0x6c,0x067b,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x8 */ {0x6d,0x06fd,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x16 */ {0x6e,0x07ff,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x32 */ {0x70,0x6a1b,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x8 */ {0x71,0x4a1b,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x8 */ {0x74,0x4a1d,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x16 */ {0x75,0x0a3d,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x16 */ {0x76,0x6a1f,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x32 */ {0x77,0x4a1f,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x32 */ {0x78,0x0a3f,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x32 */ {0x79,0x0a3b,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x8 */ {0x7a,0x6a1d,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x16 */ {0x7c,0x0e3b,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x8 */ {0x7d,0x0e7d,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x16 */ {0x7e,0x0eff,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x32 */ {0x23,0x0e3b,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x8 */ {0x24,0x0e7d,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x16 */ {0x25,0x0eff,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x32 */ {0x26,0x0e3b,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x43, 9}, /* 1400x1050x8 */ {0x27,0x0e7d,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x43, 9}, /* 1400x1050x16 */ {0x28,0x0eff,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x43, 9}, /* 1400x1050x32*/ {0x29,0x4e1b,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x45,-1}, /* 1152x864 */ {0x2a,0x4e3d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x45,-1}, {0x2b,0x4e7f,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x45,-1}, {0x39,0x6a1b,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x48,-1}, /* 848x480 */ {0x3b,0x6a3d,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x48,-1}, {0x3e,0x6a7f,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x48,-1}, {0x3f,0x6a1b,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x4a,-1}, /* 856x480 */ {0x42,0x6a3d,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x4a,-1}, {0x45,0x6a7f,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x4a,-1}, {0x48,0x6a3b,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x4c,-1}, /* 1360x768 */ {0x4b,0x6a7d,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x4c,-1}, {0x4e,0x6aff,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x4c,-1}, {0x4f,0x9a1f,0x0000,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x32 */ {0x53,0x9a1f,0x0000,SIS_RI_320x240, 0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x32 */ {0x54,0xba1f,0x0000,SIS_RI_400x300, 0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x32 */ {0x5f,0x6a1b,0x0000,SIS_RI_768x576, 0x00,0x00,0x06,0x06,0x4d,-1}, /* 768x576 */ {0x60,0x6a1d,0x0000,SIS_RI_768x576, 0x00,0x00,0x06,0x06,0x4d,-1}, {0x61,0x6a3f,0x0000,SIS_RI_768x576, 0x00,0x00,0x06,0x06,0x4d,-1}, {0x14,0x0e3b,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4e, 7}, /* 1280x800 */ {0x15,0x0e7d,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4e, 7}, {0x16,0x0eff,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4e, 7}, {0x17,0x0e3b,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x51, 9}, /* 1680x1050 */ {0x18,0x0e7d,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x51, 9}, {0x19,0x0eff,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x51, 9}, {0x2c,0x267b,0x0000,SIS_RI_1920x1080,0x00,0x00,0x00,0x00,0x52,-1}, /* 1920x1080(i) */ {0x2d,0x26fd,0x0000,SIS_RI_1920x1080,0x00,0x00,0x00,0x00,0x52,-1}, {0x73,0x27ff,0x0000,SIS_RI_1920x1080,0x00,0x00,0x00,0x00,0x52,-1}, {0x1d,0x6a1b,0x0000,SIS_RI_960x540, 0x00,0x00,0x00,0x00,0x53,-1}, /* 960x540 */ {0x1e,0x6a3d,0x0000,SIS_RI_960x540, 0x00,0x00,0x00,0x00,0x53,-1}, {0x1f,0x6a7f,0x0000,SIS_RI_960x540, 0x00,0x00,0x00,0x00,0x53,-1}, {0x20,0x6a1b,0x0000,SIS_RI_960x600, 0x00,0x00,0x00,0x00,0x54,-1}, /* 960x600 */ {0x21,0x6a3d,0x0000,SIS_RI_960x600, 0x00,0x00,0x00,0x00,0x54,-1}, {0x22,0x6a7f,0x0000,SIS_RI_960x600, 0x00,0x00,0x00,0x00,0x54,-1}, {0x1a,0x0e3b,0x0000,SIS_RI_1280x854, 0x00,0x00,0x00,0x00,0x55, 8}, /* 1280x854 */ {0x1b,0x0e7d,0x0000,SIS_RI_1280x854, 0x00,0x00,0x00,0x00,0x55, 8}, {0x1c,0x0eff,0x0000,SIS_RI_1280x854, 0x00,0x00,0x00,0x00,0x55, 8}, {0xff,0x0000,0x0000,0, 0x00,0x00,0x00,0x00,0x00,-1} }; static const struct SiS_Ext2 SiS310_RefIndex[] = { {0x085f,0x0d,0x03,0x05,0x05,0x6a, 800, 600, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x0 */ {0x0067,0x0e,0x04,0x05,0x05,0x6a, 800, 600, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x1 */ {0x0067,0x0f,0x08,0x48,0x05,0x6a, 800, 600, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x2 */ {0x0067,0x10,0x07,0x8b,0x05,0x6a, 800, 600, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x3 */ {0x0047,0x11,0x0a,0x00,0x05,0x6a, 800, 600, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x4 */ {0x0047,0x12,0x0d,0x00,0x05,0x6a, 800, 600, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x5 */ {0x0047,0x13,0x13,0x00,0x05,0x6a, 800, 600, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x6 */ {0x0107,0x14,0x1c,0x00,0x05,0x6a, 800, 600, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x7 */ {0xc85f,0x05,0x00,0x04,0x04,0x2e, 640, 480, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x8 */ {0xc067,0x06,0x02,0x04,0x04,0x2e, 640, 480, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x9 */ {0xc067,0x07,0x02,0x47,0x04,0x2e, 640, 480, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0xa */ {0xc067,0x08,0x03,0x8a,0x04,0x2e, 640, 480, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0xb */ {0xc047,0x09,0x05,0x00,0x04,0x2e, 640, 480, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0xc */ {0xc047,0x0a,0x09,0x00,0x04,0x2e, 640, 480, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0xd */ {0xc047,0x0b,0x0e,0x00,0x04,0x2e, 640, 480, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0xe */ {0xc047,0x0c,0x15,0x00,0x04,0x2e, 640, 480, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0xf */ {0x487f,0x04,0x00,0x00,0x00,0x2f, 640, 400, 0x30, 0x55, 0x6e, 0x00, 0x00, 0x00, 0x00}, /* 0x10 */ {0xc06f,0x3c,0x01,0x06,0x13,0x31, 720, 480, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x11 */ {0x006f,0x3d,0x6f,0x06,0x14,0x32, 720, 576, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x12 (6f was 03) */ {0x0087,0x15,0x06,0x00,0x06,0x37,1024, 768, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x13 */ {0xc877,0x16,0x0b,0x06,0x06,0x37,1024, 768, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x14 */ {0xc067,0x17,0x0f,0x49,0x06,0x37,1024, 768, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x15 */ {0x0067,0x18,0x11,0x00,0x06,0x37,1024, 768, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x16 */ {0x0047,0x19,0x16,0x8c,0x06,0x37,1024, 768, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x17 */ {0x0107,0x1a,0x1b,0x00,0x06,0x37,1024, 768, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x18 */ {0x0107,0x1b,0x1f,0x00,0x06,0x37,1024, 768, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x19 */ {0x0087,0x1c,0x11,0x00,0x07,0x3a,1280,1024, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x1a */ {0x0137,0x1d,0x19,0x07,0x07,0x3a,1280,1024, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x1b */ {0x0107,0x1e,0x1e,0x00,0x07,0x3a,1280,1024, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x1c */ {0x0207,0x1f,0x20,0x00,0x07,0x3a,1280,1024, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x1d */ {0x0227,0x20,0x21,0x09,0x09,0x3c,1600,1200, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x1e */ {0x0407,0x21,0x22,0x00,0x09,0x3c,1600,1200, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x1f */ {0x0407,0x22,0x23,0x00,0x09,0x3c,1600,1200, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x20 */ {0x0407,0x23,0x25,0x00,0x09,0x3c,1600,1200, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x21 */ {0x0007,0x24,0x26,0x00,0x09,0x3c,1600,1200, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x22 */ {0x0007,0x25,0x2c,0x00,0x09,0x3c,1600,1200, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x23 */ {0x0007,0x26,0x34,0x00,0x09,0x3c,1600,1200, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x24 */ {0x407f,0x00,0x00,0x00,0x00,0x40, 320, 200, 0x30, 0x56, 0x4e, 0x00, 0x00, 0x00, 0x00}, /* 0x25 */ {0xc07f,0x01,0x00,0x04,0x04,0x50, 320, 240, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x26 */ {0x007f,0x02,0x04,0x05,0x05,0x51, 400, 300, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x27 */ {0xc077,0x03,0x0b,0x06,0x06,0x52, 512, 384, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x28 */ {0x8007,0x27,0x27,0x00,0x00,0x68,1920,1440, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x29 */ {0x4007,0x28,0x29,0x00,0x00,0x68,1920,1440, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x2a */ {0x4007,0x29,0x2e,0x00,0x00,0x68,1920,1440, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x2b */ {0x4007,0x2a,0x30,0x00,0x00,0x68,1920,1440, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x2c */ {0x4007,0x2b,0x35,0x00,0x00,0x68,1920,1440, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x2d */ {0x4005,0x2c,0x39,0x00,0x00,0x68,1920,1440, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x2e */ {0x4007,0x2d,0x2b,0x00,0x00,0x6c,2048,1536, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x2f */ {0x4007,0x2e,0x31,0x00,0x00,0x6c,2048,1536, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x30 */ {0x4007,0x2f,0x33,0x00,0x00,0x6c,2048,1536, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x31 */ {0x4007,0x30,0x37,0x00,0x00,0x6c,2048,1536, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x32 */ {0x4005,0x31,0x38,0x00,0x00,0x6c,2048,1536, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x33 */ {0x2077,0x32,0x40,0x08,0x18,0x70, 800, 480, 0x30, 0x00, 0x00, 0x32, 0x40, 0x5e, 0x73}, /* 0x34 */ {0x2047,0x33,0x07,0x08,0x18,0x70, 800, 480, 0x30, 0x00, 0x00, 0x33, 0x07, 0xff, 0xff}, /* 0x35 */ {0x2047,0x34,0x0a,0x08,0x18,0x70, 800, 480, 0x30, 0x00, 0x00, 0x34, 0x0a, 0xff, 0xff}, /* 0x36 */ {0x2077,0x35,0x0b,0x09,0x19,0x71,1024, 576, 0x30, 0x00, 0x00, 0x35, 0x0b, 0x5f, 0x74}, /* 0x37 */ {0x2047,0x36,0x11,0x09,0x19,0x71,1024, 576, 0x30, 0x00, 0x00, 0x36, 0x11, 0xff, 0xff}, /* 0x38 */ {0x2047,0x37,0x16,0x09,0x19,0x71,1024, 576, 0x30, 0x00, 0x00, 0x37, 0x16, 0xff, 0xff}, /* 0x39 */ {0x3137,0x38,0x19,0x0a,0x0c,0x75,1280, 720, 0x30, 0x00, 0x00, 0x38, 0x19, 0x60, 0x75}, /* 0x3a */ {0x3107,0x39,0x1e,0x0a,0x0c,0x75,1280, 720, 0x30, 0x00, 0x00, 0x39, 0x1e, 0xff, 0xff}, /* 0x3b */ {0x3307,0x3a,0x20,0x0a,0x0c,0x75,1280, 720, 0x30, 0x00, 0x00, 0x3a, 0x20, 0xff, 0xff}, /* 0x3c */ {0x0127,0x3b,0x19,0x08,0x0a,0x7c,1280, 960, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x3d */ {0x0227,0x4c,0x59,0x08,0x0a,0x7c,1280, 960, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x3e */ {0xc07f,0x4e,0x00,0x06,0x04,0x5a, 320, 240, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x3f */ /* FSTN 320x240 */ {0x2077,0x42,0x5b,0x08,0x11,0x23,1280, 768, 0x30, 0x00, 0x00, 0x58, 0x19, 0x42, 0x5b}, /* 0x40 */ /* 0x5b was 0x12 */ {0x2077,0x42,0x5b,0x08,0x11,0x23,1280, 768, 0x30, 0x00, 0x00, 0x59, 0x1e, 0xff, 0xff}, /* 0x41 */ {0x2077,0x42,0x5b,0x08,0x11,0x23,1280, 768, 0x30, 0x00, 0x00, 0x5a, 0x20, 0xff, 0xff}, /* 0x42 */ {0x0127,0x43,0x4d,0x08,0x0b,0x26,1400,1050, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x43 */ {0x0207,0x4b,0x5a,0x08,0x0b,0x26,1400,1050, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x44 1400x1050-75Hz */ {0x0127,0x54,0x6d,0x00,0x1a,0x29,1152, 864, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x45 1152x864-60Hz */ {0x0127,0x44,0x19,0x00,0x1a,0x29,1152, 864, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x46 1152x864-75Hz */ {0x0127,0x4a,0x1e,0x00,0x1a,0x29,1152, 864, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x47 1152x864-85Hz */ {0x0087,0x45,0x57,0x00,0x16,0x39, 848, 480, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x48 848x480-38Hzi */ {0xc067,0x46,0x55,0x0b,0x16,0x39, 848, 480, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x49 848x480-60Hz */ {0x0087,0x47,0x57,0x00,0x17,0x3f, 856, 480, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x4a 856x480-38Hzi */ {0xc067,0x48,0x57,0x00,0x17,0x3f, 856, 480, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x4b 856x480-60Hz */ {0x0067,0x49,0x58,0x0c,0x1b,0x48,1360, 768, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x4c 1360x768-60Hz */ {0x006f,0x4d,0x71,0x06,0x15,0x5f, 768, 576, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x4d 768x576-56Hz */ {0x2067,0x4f,0x5c,0x08,0x0d,0x14,1280, 800, 0x30, 0x00, 0x00, 0x5b, 0x19, 0x4f, 0x5c}, /* 0x4e 1280x800-60Hz */ {0x2067,0x4f,0x5c,0x08,0x0d,0x14,1280, 800, 0x30, 0x00, 0x00, 0x5c, 0x1e, 0xff, 0xff}, /* 0x4f 1280x800-75Hz */ {0x2067,0x4f,0x5c,0x08,0x0d,0x14,1280, 800, 0x30, 0x00, 0x00, 0x5d, 0x20, 0xff, 0xff}, /* 0x50 1280x800-85Hz */ {0x0067,0x50,0x5d,0x0c,0x0e,0x17,1680,1050, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x51 1680x1050-60Hz */ {0x0087,0x51,0x69,0x00,0x00,0x2c,1920,1080, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x52 1920x1080 60Hzi */ {0x0077,0x52,0x6a,0x0c,0x1c,0x1d, 960, 540, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x53 960x540 60Hz */ {0x0077,0x53,0x6b,0x0b,0x1d,0x20, 960, 600, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x54 960x600 60Hz */ {0x2067,0x61,0x76,0x0d,0x22,0x1a,1280, 854, 0x30, 0x00, 0x00, 0x62, 0x19, 0x61, 0x76}, /* 0x55 1280x854-60Hz */ {0x2067,0x61,0x76,0x0d,0x22,0x1a,1280, 854, 0x30, 0x00, 0x00, 0x63, 0x1e, 0xff, 0xff}, /* 0x56 1280x854-75Hz */ {0x2067,0x61,0x76,0x0d,0x22,0x1a,1280, 854, 0x30, 0x00, 0x00, 0x64, 0x20, 0xff, 0xff}, /* 0x57 1280x854-85Hz */ {0xffff,0x00,0x00,0x00,0x00,0x00, 0, 0, 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; static const struct SiS_CRT1Table SiS310_CRT1Table[] = { {{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f, 0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x00, 0x00}}, /* 0x0 */ {{0x2d,0x27,0x28,0x90,0x2c,0x80,0x0b,0x3e, 0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x00, 0x00}}, /* 0x1 */ {{0x3d,0x31,0x31,0x81,0x37,0x1f,0x72,0xf0, 0x58,0x8c,0x57,0x57,0x73,0x20,0x00,0x05, 0x01}}, /* 0x2 */ {{0x4f,0x3f,0x3f,0x93,0x45,0x0d,0x24,0xf5, 0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x01, 0x01}}, /* 0x3 */ {{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, 0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x05, 0x00}}, /* 0x4 */ {{0x5f,0x4f,0x4f,0x83,0x55,0x81,0x0b,0x3e, /* corrected 640x480-60 */ 0xe9,0x8b,0xdf,0xe8,0x0c,0x00,0x00,0x05, 0x00}}, /* 0x5 */ {{0x63,0x4f,0x4f,0x87,0x56,0x9b,0x06,0x3e, /* corrected 640x480-72 */ 0xe8,0x8a,0xdf,0xe7,0x07,0x00,0x00,0x01, 0x00}}, /* 0x6 */ {{0x64,0x4f,0x4f,0x88,0x55,0x9d,0xf2,0x1f, 0xe0,0x83,0xdf,0xdf,0xf3,0x10,0x00,0x01, 0x00}}, /* 0x7 */ {{0x63,0x4f,0x4f,0x87,0x5a,0x81,0xfb,0x1f, 0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05, 0x00}}, /* 0x8 */ {{0x65,0x4f,0x4f,0x89,0x58,0x80,0xfb,0x1f, 0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05, /* Corrected VBE */ 0x61}}, /* 0x9 */ {{0x65,0x4f,0x4f,0x89,0x58,0x80,0x01,0x3e, 0xe0,0x83,0xdf,0xdf,0x02,0x00,0x00,0x05, 0x61}}, /* 0xa */ {{0x67,0x4f,0x4f,0x8b,0x58,0x81,0x0d,0x3e, 0xe0,0x83,0xdf,0xdf,0x0e,0x00,0x00,0x05, /* Corrected VBE */ 0x61}}, /* 0xb */ {{0x65,0x4f,0x4f,0x89,0x57,0x9f,0xfb,0x1f, 0xe6,0x8a,0xdf,0xdf,0xfc,0x10,0x00,0x01, /* Corrected VDE, VBE */ 0x00}}, /* 0xc */ {{0x7b,0x63,0x63,0x9f,0x6a,0x93,0x6f,0xf0, 0x58,0x8a,0x57,0x57,0x70,0x20,0x00,0x05, 0x01}}, /* 0xd */ {{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xf0, 0x58,0x8c,0x57,0x57,0x73,0x20,0x00,0x06, 0x01}}, /* 0xe */ {{0x7d,0x63,0x63,0x81,0x6e,0x1d,0x98,0xf0, 0x7c,0x82,0x57,0x57,0x99,0x00,0x00,0x06, 0x01}}, /* 0xf */ {{0x7f,0x63,0x63,0x83,0x69,0x13,0x6f,0xf0, 0x58,0x8b,0x57,0x57,0x70,0x20,0x00,0x06, 0x01}}, /* 0x10 */ {{0x7e,0x63,0x63,0x82,0x6b,0x13,0x75,0xf0, 0x58,0x8b,0x57,0x57,0x76,0x20,0x00,0x06, 0x01}}, /* 0x11 */ {{0x81,0x63,0x63,0x85,0x6d,0x18,0x7a,0xf0, 0x58,0x8b,0x57,0x57,0x7b,0x20,0x00,0x06, 0x61}}, /* 0x12 */ {{0x83,0x63,0x63,0x87,0x6e,0x19,0x81,0xf0, 0x58,0x8b,0x57,0x57,0x82,0x20,0x00,0x06, 0x61}}, /* 0x13 */ {{0x85,0x63,0x63,0x89,0x6f,0x1a,0x91,0xf0, 0x58,0x8b,0x57,0x57,0x92,0x20,0x00,0x06, 0x61}}, /* 0x14 */ {{0x99,0x7f,0x7f,0x9d,0x84,0x1a,0x96,0x1f, 0x7f,0x83,0x7f,0x7f,0x97,0x10,0x00,0x02, 0x00}}, /* 0x15 */ {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5, 0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02, 0x01}}, /* 0x16 */ {{0xa1,0x7f,0x7f,0x85,0x86,0x97,0x24,0xf5, 0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02, 0x01}}, /* 0x17 */ {{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf5, 0x00,0x83,0xff,0xff,0x1f,0x10,0x00,0x02, 0x01}}, /* 0x18 */ {{0xa7,0x7f,0x7f,0x8b,0x89,0x95,0x26,0xf5, 0x00,0x83,0xff,0xff,0x27,0x10,0x00,0x02, 0x01}}, /* 0x19 */ {{0xa9,0x7f,0x7f,0x8d,0x8c,0x9a,0x2c,0xf5, 0x00,0x83,0xff,0xff,0x2d,0x14,0x00,0x02, 0x62}}, /* 0x1a */ {{0xab,0x7f,0x7f,0x8f,0x8d,0x9b,0x35,0xf5, 0x00,0x83,0xff,0xff,0x36,0x14,0x00,0x02, 0x62}}, /* 0x1b */ {{0xcf,0x9f,0x9f,0x93,0xb2,0x01,0x14,0xba, 0x00,0x83,0xff,0xff,0x15,0x00,0x00,0x03, 0x00}}, /* 0x1c */ {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0x5a, 0x00,0x83,0xff,0xff,0x29,0x09,0x00,0x07, 0x01}}, /* 0x1d */ {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0x5a, 0x00,0x83,0xff,0xff,0x29,0x09,0x00,0x07, 0x01}}, /* 0x1e */ {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0x5a, 0x00,0x83,0xff,0xff,0x2f,0x09,0x00,0x07, 0x01}}, /* 0x1f */ {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, /* 0x20 */ {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, /* 0x21 */ {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, /* 0x22 */ {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, /* 0x23 */ {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, /* 0x24 */ {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, /* 0x25 */ {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10, 0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04, 0x00}}, /* 0x26 */ {{0x40,0xef,0xef,0x84,0x03,0x1d,0xda,0x1f, 0xa0,0x83,0x9f,0x9f,0xdb,0x1f,0x41,0x01, 0x00}}, /* 0x27 */ {{0x43,0xef,0xef,0x87,0x06,0x00,0xd4,0x1f, 0xa0,0x83,0x9f,0x9f,0xd5,0x1f,0x41,0x05, 0x63}}, /* 0x28 */ {{0x45,0xef,0xef,0x89,0x07,0x01,0xd9,0x1f, 0xa0,0x83,0x9f,0x9f,0xda,0x1f,0x41,0x05, 0x63}}, /* 0x29 */ {{0x40,0xef,0xef,0x84,0x03,0x1d,0xda,0x1f, 0xa0,0x83,0x9f,0x9f,0xdb,0x1f,0x41,0x01, 0x00}}, /* 0x2a */ {{0x40,0xef,0xef,0x84,0x03,0x1d,0xda,0x1f, 0xa0,0x83,0x9f,0x9f,0xdb,0x1f,0x41,0x01, 0x00}}, /* 0x2b */ {{0x40,0xef,0xef,0x84,0x03,0x1d,0xda,0x1f, 0xa0,0x83,0x9f,0x9f,0xdb,0x1f,0x41,0x01, 0x00}}, /* 0x2c */ {{0x59,0xff,0xff,0x9d,0x17,0x13,0x33,0xba, 0x00,0x83,0xff,0xff,0x34,0x0f,0x41,0x05, 0x44}}, /* 0x2d */ {{0x5b,0xff,0xff,0x9f,0x18,0x14,0x38,0xba, 0x00,0x83,0xff,0xff,0x39,0x0f,0x41,0x05, 0x44}}, /* 0x2e */ {{0x5b,0xff,0xff,0x9f,0x18,0x14,0x3d,0xba, 0x00,0x83,0xff,0xff,0x3e,0x0f,0x41,0x05, 0x44}}, /* 0x2f */ {{0x5d,0xff,0xff,0x81,0x19,0x95,0x41,0xba, 0x00,0x84,0xff,0xff,0x42,0x0f,0x41,0x05, 0x44}}, /* 0x30 */ {{0x55,0xff,0xff,0x99,0x0d,0x0c,0x3e,0xba, 0x00,0x84,0xff,0xff,0x3f,0x0f,0x41,0x05, 0x00}}, /* 0x31 */ {{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xba, 0x27,0x8b,0xdf,0xdf,0x73,0x00,0x00,0x06, 0x01}}, /* 0x32 */ {{0x7f,0x63,0x63,0x83,0x69,0x13,0x6f,0xba, 0x26,0x89,0xdf,0xdf,0x6f,0x00,0x00,0x06, 0x01}}, /* 0x33 */ {{0x7f,0x63,0x63,0x82,0x6b,0x13,0x75,0xba, 0x29,0x8c,0xdf,0xdf,0x75,0x00,0x00,0x06, 0x01}}, /* 0x34 */ {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf1, 0xaf,0x85,0x3f,0x3f,0x25,0x30,0x00,0x02, 0x01}}, /* 0x35 */ {{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf1, 0xad,0x81,0x3f,0x3f,0x1f,0x30,0x00,0x02, 0x01}}, /* 0x36 */ {{0xa7,0x7f,0x7f,0x88,0x89,0x95,0x26,0xf1, /* 95 was 15 - illegal HBE! */ 0xb1,0x85,0x3f,0x3f,0x27,0x30,0x00,0x02, 0x01}}, /* 0x37 */ {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xc4, 0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07, 0x01}}, /* 0x38 */ {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0xd4, 0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07, 0x01}}, /* 0x39 */ {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0xd4, 0x7d,0x81,0xcf,0xcf,0x2f,0x21,0x00,0x07, 0x01}}, /* 0x3a */ {{0xdc,0x9f,0x9f,0x80,0xaf,0x9d,0xe6,0xff, /* 1280x960-60 - corrected */ 0xc0,0x83,0xbf,0xbf,0xe7,0x10,0x00,0x07, 0x01}}, /* 0x3b */ {{0x6b,0x59,0x59,0x8f,0x5e,0x8c,0x0b,0x3e, 0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x05, 0x00}}, /* 0x3c */ {{0x6d,0x59,0x59,0x91,0x60,0x89,0x53,0xf0, /* 720x576, corrected to 60Hz */ 0x41,0x84,0x3f,0x3f,0x54,0x00,0x00,0x05, 0x41}}, /* 0x3d */ {{0x86,0x6a,0x6a,0x8a,0x74,0x06,0x8c,0x15, 0x4f,0x83,0xef,0xef,0x8d,0x30,0x00,0x02, 0x00}}, /* 0x3e */ {{0x81,0x6a,0x6a,0x85,0x70,0x00,0x0f,0x3e, 0xeb,0x8e,0xdf,0xdf,0x10,0x00,0x00,0x02, 0x00}}, /* 0x3f */ {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x1e,0xf1, 0xae,0x85,0x57,0x57,0x1f,0x30,0x00,0x02, 0x01}}, /* 0x40 */ {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5, 0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02, 0x01}}, /* 0x41 */ {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x20,0xf5, 0x03,0x88,0xff,0xff,0x21,0x10,0x00,0x07, 0x01}}, /* 0x42 */ {{0xe6,0xae,0xae,0x8a,0xbd,0x90,0x3d,0x10, 0x1a,0x8d,0x19,0x19,0x3e,0x2f,0x00,0x03, 0x00}}, /* 0x43 */ {{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef, /* 1152x864-75 */ 0x60,0x83,0x5f,0x5f,0x83,0x10,0x00,0x07, 0x01}}, /* 0x44 */ {{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15, /* 848x480-38i */ 0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02, 0x00}}, /* 0x45 */ {{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E, /* 848x480-60 */ 0xE5,0x8d,0xDF,0xe4,0x04,0x00,0x00,0x06, 0x00}}, /* 0x46 */ {{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15, /* 856x480-38i */ 0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02, 0x00}}, /* 0x47 */ {{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E, /* 856x480-60 */ 0xEB,0x8E,0xDF,0xDF,0x10,0x00,0x00,0x02, 0x00}}, /* 0x48 */ {{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd, /* 1360x768-60 */ 0x01,0x8d,0xff,0x00,0x27,0x10,0x00,0x03, 0x01}}, /* 0x49 */ {{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff, /* 1152x864-84 */ 0x60,0x8b,0x5f,0x5f,0x8b,0x10,0x00,0x03, 0x01}}, /* 0x4a */ {{0xea,0xae,0xae,0x8e,0xba,0x82,0x40,0x10, /* 1400x1050-75 */ 0x1b,0x87,0x19,0x1a,0x41,0x0f,0x00,0x03, 0x00}}, /* 0x4b */ {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff, /* 1280x960-85 */ 0xc0,0x83,0xbf,0xbf,0xf2,0x10,0x00,0x07, 0x01}}, /* 0x4c */ {{0x75,0x5f,0x5f,0x99,0x66,0x90,0x53,0xf0, /* 768x576, corrected to 60Hz */ 0x41,0x84,0x3f,0x3f,0x54,0x00,0x00,0x05, 0x41}}, /* 0x4d */ {{0x5f,0x27,0x4f,0x83,0x55,0x81,0x0b,0x3e, /* FSTN 320x240 (working) */ 0xe9,0x8b,0xdf,0xe8,0x0c,0x00,0x00,0x05, 0x00}}, /* 0x4e */ {{0xcd,0x9f,0x9f,0x91,0xab,0x1c,0x3a,0xff, /* 1280x800-60 */ 0x20,0x83,0x1f,0x1f,0x3b,0x10,0x00,0x07, 0x21}}, /* 0x4f */ {{0x15,0xd1,0xd1,0x99,0xe2,0x19,0x3d,0x10, /* 1680x1050-60 */ 0x1a,0x8d,0x19,0x19,0x3e,0x2f,0x01,0x0c, 0x20}}, /* 0x50 */ {{0x0e,0xef,0xef,0x92,0xfe,0x03,0x30,0xf0, /* 1920x1080-60i */ 0x1e,0x83,0x1b,0x1c,0x31,0x00,0x01,0x00, 0x61}}, /* 0x51 */ {{0x85,0x77,0x77,0x89,0x7d,0x01,0x31,0xf0, /* 960x540-60 */ 0x1e,0x84,0x1b,0x1c,0x32,0x00,0x00,0x02, 0x41}}, /* 0x52 */ {{0x87,0x77,0x77,0x8b,0x81,0x0b,0x68,0xf0, /* 960x600-60 */ 0x5a,0x80,0x57,0x57,0x69,0x00,0x00,0x02, 0x01}}, /* 0x53 */ {{0xcd,0x8f,0x8f,0x91,0x9b,0x1b,0x7a,0xff, /* 1152x864-60 */ 0x64,0x8c,0x5f,0x62,0x7b,0x10,0x00,0x07, 0x41}}, /* 0x54 */ {{0x5c,0x4f,0x4f,0x80,0x57,0x80,0xa3,0x1f, /* fake 640x400@60Hz (for LCD and TV, not actually used) */ 0x98,0x8c,0x8f,0x96,0xa4,0x30,0x00,0x05, 0x40}}, /* 0x55 */ {{0x2c,0x27,0x27,0x90,0x2d,0x92,0xa4,0x1f, /* fake 320x200@60Hz (for LCD and TV, not actually used) */ 0x98,0x8c,0x8f,0x96,0xa5,0x30,0x00,0x04, 0x00}}, /* 0x56 */ {{0xd7,0xc7,0xc7,0x9b,0xd1,0x15,0xd1,0x10, /* 1600x1200 for LCDA */ 0xb2,0x86,0xaf,0xb0,0xd2,0x2f,0x00,0x03, 0x00}}, /* 0x57 */ {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xdc, /* 1280x768 (1280x1024) 60 Hz */ 0x92,0x86,0xff,0x91,0x29,0x21,0x00,0x07, 0x01}}, /* 0x58 */ {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0xdc, /* 1280x768 (1280x1024) 75 Hz */ 0x92,0x86,0xff,0x91,0x29,0x21,0x00,0x07, 0x01}}, /* 0x59 */ {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0xdc, /* 1280x768 (1280x1024) 85 Hz */ 0x95,0x89,0xff,0x94,0x2f,0x21,0x00,0x07, 0x01}}, /* 0x5a */ {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xde, /* 1280x800 (1280x1024) 60 Hz */ 0xa2,0x86,0x1f,0xa1,0x29,0x01,0x00,0x07, 0x01}}, /* 0x5b */ {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0xde, /* 1280x800 (1280x1024) 75 Hz */ 0xa2,0x86,0x1f,0xa1,0x29,0x01,0x00,0x07, 0x01}}, /* 0x5c */ {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0xde, /* 1280x800 (1280x1024) 85 Hz */ 0xa5,0x89,0x1f,0xa4,0x2f,0x01,0x00,0x07, 0x01}}, /* 0x5d */ {{0x7f,0x63,0x63,0x83,0x6d,0x1d,0x0b,0x3e, /* 800x480 (wide) 60 Hz */ 0xe9,0x8b,0xdf,0xe8,0x0c,0x00,0x00,0x06, 0x00}}, /* 0x5e */ {{0xa0,0x7f,0x7f,0x84,0x85,0x97,0x52,0xf0, /* 1024x576 (wide) 60 Hz */ 0x41,0x85,0x3f,0x40,0x53,0x00,0x00,0x02, 0x01}}, /* 0x5f */ {{0xc9,0x9f,0x9f,0x8d,0xb0,0x15,0xec,0xf0, /* 1280x720 (wide) 60 Hz */ 0xd4,0x89,0xcf,0xd3,0xed,0x20,0x00,0x07, 0x01}}, /* 0x60 */ {{0xcb,0x9f,0x9f,0x8f,0xa5,0x13,0x5b,0xff, /* 1280x854-60 wide */ 0x56,0x89,0x55,0x55,0x5c,0x30,0x00,0x07, 0x01}}, /* 0x61 */ {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xde, /* 1280x854 (1280x1024) 60 Hz */ 0xbd,0x81,0x55,0xbc,0x29,0x01,0x00,0x07, 0x41}}, /* 0x62 */ {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0xde, /* 1280x854 (1280x1024) 75 Hz */ 0xbd,0x81,0x55,0xbc,0x29,0x01,0x00,0x07, 0x41}}, /* 0x63 */ {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0xde, /* 1280x854 (1280x1024) 85 Hz */ 0xc0,0x84,0x55,0xbf,0x2f,0x01,0x00,0x07, 0x41}} /* 0x64 */ }; static const struct SiS_MCLKData SiS310_MCLKData_0_315[] = { { 0x3b,0x22,0x01,143}, { 0x5c,0x23,0x01,166}, { 0x5c,0x23,0x01,166}, { 0x5c,0x23,0x01,166}, { 0x5c,0x23,0x01,166}, { 0x5c,0x23,0x01,166}, { 0x5c,0x23,0x01,166}, { 0x5c,0x23,0x01,166} }; static const struct SiS_MCLKData SiS310_MCLKData_0_650[] = { { 0x5a,0x64,0x82, 66}, { 0xb3,0x45,0x82, 83}, { 0x37,0x61,0x82,100}, { 0x37,0x22,0x82,133}, { 0x37,0x61,0x82,100}, { 0x37,0x22,0x82,133}, { 0x37,0x22,0x82,133}, { 0x37,0x22,0x82,133} }; static const struct SiS_MCLKData SiS310_MCLKData_0_330[] = { { 0x5c,0x23,0x01,166}, { 0x5c,0x23,0x01,166}, { 0x7c,0x08,0x01,200}, { 0x79,0x06,0x01,250}, { 0x7c,0x08,0x01,200}, { 0x7c,0x08,0x01,200}, { 0x7c,0x08,0x01,200}, { 0x79,0x06,0x01,250} }; static const struct SiS_MCLKData SiS310_MCLKData_0_660[] = { { 0x5c,0x23,0x82,166}, { 0x5c,0x23,0x82,166}, { 0x37,0x21,0x82,200}, { 0x37,0x22,0x82,133}, { 0x29,0x21,0x82,150}, { 0x5c,0x23,0x82,166}, { 0x65,0x23,0x82,183}, { 0x37,0x21,0x82,200} }; static const struct SiS_MCLKData SiS310_MCLKData_0_760[] = { { 0x37,0x22,0x82,133}, { 0x5c,0x23,0x82,166}, { 0x65,0x23,0x82,183}, { 0x7c,0x08,0x82,200}, { 0x29,0x21,0x82,150}, { 0x5c,0x23,0x82,166}, { 0x65,0x23,0x82,183}, { 0x37,0x21,0x82,200} }; static const struct SiS_MCLKData SiS310_MCLKData_0_761[] = { { 0x37,0x22,0x82,133}, /* Preliminary */ { 0x5c,0x23,0x82,166}, { 0x65,0x23,0x82,183}, { 0x7c,0x08,0x82,200}, { 0x29,0x21,0x82,150}, { 0x5c,0x23,0x82,166}, { 0x65,0x23,0x82,183}, { 0x37,0x21,0x82,200} }; static const struct SiS_MCLKData SiS310_MCLKData_0_340[] = { { 0x79,0x06,0x01,250}, { 0x7c,0x08,0x01,200}, { 0x7c,0x08,0x80,200}, { 0x79,0x06,0x80,250}, { 0x29,0x01,0x81,300}, { 0x29,0x01,0x81,300}, { 0x29,0x01,0x81,300}, { 0x29,0x01,0x81,300} }; static const struct SiS_MCLKData SiS310_MCLKData_1[] = /* ECLK */ { { 0x29,0x21,0x82,150}, { 0x5c,0x23,0x82,166}, { 0x65,0x23,0x82,183}, { 0x37,0x21,0x82,200}, { 0x37,0x22,0x82,133}, { 0x37,0x22,0x82,133}, { 0x37,0x22,0x82,133}, { 0x37,0x22,0x82,133} }; static const struct SiS_MCLKData SiS310_MCLKData_1_340[] = { { 0x7c,0x08,0x01,200}, { 0x7c,0x08,0x01,200}, { 0x7c,0x08,0x80,200}, { 0x79,0x06,0x80,250}, { 0x29,0x01,0x81,300}, { 0x29,0x01,0x81,300}, { 0x29,0x01,0x81,300}, { 0x29,0x01,0x81,300} }; static struct SiS_VCLKData SiS310_VCLKData[] = { { 0x1b,0xe1, 25}, /* 0x00 */ { 0x4e,0xe4, 28}, /* 0x01 */ { 0x57,0xe4, 31}, /* 0x02 */ { 0xc3,0xc8, 36}, /* 0x03 */ { 0x42,0xe2, 40}, /* 0x04 */ { 0xfe,0xcd, 43}, /* 0x05 */ { 0x5d,0xc4, 44}, /* 0x06 */ { 0x52,0xe2, 49}, /* 0x07 */ { 0x53,0xe2, 50}, /* 0x08 */ { 0x74,0x67, 52}, /* 0x09 */ { 0x6d,0x66, 56}, /* 0x0a */ { 0x5a,0x64, 65}, /* 0x0b */ /* was 6c c3 - WRONG */ { 0x46,0x44, 67}, /* 0x0c */ { 0xb1,0x46, 68}, /* 0x0d */ { 0xd3,0x4a, 72}, /* 0x0e */ { 0x29,0x61, 75}, /* 0x0f */ { 0x6e,0x46, 76}, /* 0x10 */ { 0x2b,0x61, 78}, /* 0x11 */ { 0x31,0x42, 79}, /* 0x12 */ { 0xab,0x44, 83}, /* 0x13 */ { 0x46,0x25, 84}, /* 0x14 */ { 0x78,0x29, 86}, /* 0x15 */ { 0x62,0x44, 94}, /* 0x16 */ { 0x2b,0x41,104}, /* 0x17 */ { 0x3a,0x23,105}, /* 0x18 */ { 0x70,0x44,108}, /* 0x19 */ { 0x3c,0x23,109}, /* 0x1a */ { 0x5e,0x43,113}, /* 0x1b */ { 0xbc,0x44,116}, /* 0x1c */ { 0xe0,0x46,132}, /* 0x1d */ { 0x54,0x42,135}, /* 0x1e */ { 0xea,0x2a,139}, /* 0x1f */ { 0x41,0x22,157}, /* 0x20 */ { 0x70,0x24,162}, /* 0x21 */ { 0x30,0x21,175}, /* 0x22 */ { 0x4e,0x22,189}, /* 0x23 */ { 0xde,0x26,194}, /* 0x24 */ { 0x62,0x06,202}, /* 0x25 */ { 0x3f,0x03,229}, /* 0x26 */ { 0xb8,0x06,234}, /* 0x27 */ { 0x34,0x02,253}, /* 0x28 */ { 0x58,0x04,255}, /* 0x29 */ { 0x24,0x01,265}, /* 0x2a */ { 0x9b,0x02,267}, /* 0x2b */ { 0x70,0x05,270}, /* 0x2c */ { 0x25,0x01,272}, /* 0x2d */ { 0x9c,0x02,277}, /* 0x2e */ { 0x27,0x01,286}, /* 0x2f */ { 0x3c,0x02,291}, /* 0x30 */ { 0xef,0x0a,292}, /* 0x31 */ { 0xf6,0x0a,310}, /* 0x32 */ { 0x95,0x01,315}, /* 0x33 */ { 0xf0,0x09,324}, /* 0x34 */ { 0xfe,0x0a,331}, /* 0x35 */ { 0xf3,0x09,332}, /* 0x36 */ { 0xea,0x08,340}, /* 0x37 */ { 0xe8,0x07,376}, /* 0x38 */ { 0xde,0x06,389}, /* 0x39 */ { 0x52,0x2a, 54}, /* 0x3a 301 TV */ { 0x52,0x6a, 27}, /* 0x3b 301 TV */ { 0x62,0x24, 70}, /* 0x3c 301 TV */ { 0x62,0x64, 70}, /* 0x3d 301 TV */ { 0xa8,0x4c, 30}, /* 0x3e 301 TV */ { 0x20,0x26, 33}, /* 0x3f 301 TV */ { 0x31,0xc2, 39}, /* 0x40 */ { 0x60,0x36, 30}, /* 0x41 Chrontel */ { 0x40,0x4a, 28}, /* 0x42 Chrontel */ { 0x9f,0x46, 44}, /* 0x43 Chrontel */ { 0x97,0x2c, 26}, /* 0x44 */ { 0x44,0xe4, 25}, /* 0x45 Chrontel */ { 0x7e,0x32, 47}, /* 0x46 Chrontel */ { 0x8a,0x24, 31}, /* 0x47 Chrontel */ { 0x97,0x2c, 26}, /* 0x48 Chrontel */ { 0xce,0x3c, 39}, /* 0x49 */ { 0x52,0x4a, 36}, /* 0x4a Chrontel */ { 0x34,0x61, 95}, /* 0x4b */ { 0x78,0x27,108}, /* 0x4c - was 102 */ { 0x66,0x43,123}, /* 0x4d Modes 0x26-0x28 (1400x1050) */ { 0x41,0x4e, 21}, /* 0x4e */ { 0xa1,0x4a, 29}, /* 0x4f Chrontel */ { 0x19,0x42, 42}, /* 0x50 */ { 0x54,0x46, 58}, /* 0x51 Chrontel */ { 0x25,0x42, 61}, /* 0x52 */ { 0x44,0x44, 66}, /* 0x53 Chrontel */ { 0x3a,0x62, 70}, /* 0x54 Chrontel */ { 0x62,0xc6, 34}, /* 0x55 848x480-60 */ { 0x6a,0xc6, 37}, /* 0x56 848x480-75 - TEMP */ { 0xbf,0xc8, 35}, /* 0x57 856x480-38i,60 */ { 0x30,0x23, 88}, /* 0x58 1360x768-62 (is 60Hz!) */ { 0x52,0x07,149}, /* 0x59 1280x960-85 */ { 0x56,0x07,156}, /* 0x5a 1400x1050-75 */ { 0x70,0x29, 81}, /* 0x5b 1280x768 LCD */ { 0x45,0x25, 83}, /* 0x5c 1280x800 */ { 0x70,0x0a,147}, /* 0x5d 1680x1050 */ { 0x70,0x24,162}, /* 0x5e 1600x1200 */ { 0x5a,0x64, 65}, /* 0x5f 1280x720 - temp */ { 0x63,0x46, 68}, /* 0x60 1280x768_2 */ { 0x31,0x42, 79}, /* 0x61 1280x768_3 - temp */ { 0, 0, 0}, /* 0x62 - custom (will be filled out at run-time) */ { 0x5a,0x64, 65}, /* 0x63 1280x720 (LCD LVDS) */ { 0x70,0x28, 90}, /* 0x64 1152x864@60 */ { 0x41,0xc4, 32}, /* 0x65 848x480@60 */ { 0x5c,0xc6, 32}, /* 0x66 856x480@60 */ { 0x76,0xe7, 27}, /* 0x67 720x480@60 */ { 0x5f,0xc6, 33}, /* 0x68 720/768x576@60 */ { 0x52,0x27, 75}, /* 0x69 1920x1080i 60Hz interlaced */ { 0x7c,0x6b, 38}, /* 0x6a 960x540@60 */ { 0xe3,0x56, 41}, /* 0x6b 960x600@60 */ { 0x45,0x25, 83}, /* 0x6c 1280x800 */ { 0x70,0x28, 90}, /* 0x6d 1152x864@60 */ { 0x15,0xe1, 20}, /* 0x6e 640x400@60 (fake, not actually used) */ { 0x5f,0xc6, 33}, /* 0x6f 720x576@60 */ { 0x37,0x5a, 10}, /* 0x70 320x200@60 (fake, not actually used) */ { 0x2b,0xc2, 35}, /* 0x71 768x576@60 */ { 0xa8,0x42,131}, /* 0x72 1600x1200@60 for LCDA */ { 0x1b,0xc1, 34}, /* 0x73 800x480 60Hz (wide) */ { 0x41,0x64, 48}, /* 0x74 1024x576 60Hz (wide) */ { 0x52,0x27, 75}, /* 0x75 1280x720 60Hz (wide) */ { 0x75,0x13, 84} /* 0x76 1280x854 60Hz (wide) */ }; static struct SiS_VBVCLKData SiS310_VBVCLKData[] = { { 0x1b,0xe1, 25}, /* 0x00 */ { 0x4e,0xe4, 28}, /* 0x01 */ { 0x57,0xe4, 31}, /* 0x02 */ { 0xc3,0xc8, 36}, /* 0x03 */ { 0x42,0x47, 40}, /* 0x04 */ { 0xfe,0xcd, 43}, /* 0x05 */ { 0x5d,0xc4, 44}, /* 0x06 */ { 0x52,0x47, 49}, /* 0x07 */ { 0x53,0x47, 50}, /* 0x08 */ { 0x74,0x67, 52}, /* 0x09 */ { 0x6d,0x66, 56}, /* 0x0a */ { 0x35,0x62, 65}, /* 0x0b */ /* Was 0x5a,0x64 - 650/LVDS+301: 35,62 */ { 0x46,0x44, 67}, /* 0x0c */ { 0xb1,0x46, 68}, /* 0x0d */ { 0xd3,0x4a, 72}, /* 0x0e */ { 0x29,0x61, 75}, /* 0x0f */ { 0x6d,0x46, 75}, /* 0x10 */ { 0x41,0x43, 78}, /* 0x11 */ { 0x31,0x42, 79}, /* 0x12 */ { 0xab,0x44, 83}, /* 0x13 */ { 0x46,0x25, 84}, /* 0x14 */ { 0x78,0x29, 86}, /* 0x15 */ { 0x62,0x44, 94}, /* 0x16 */ { 0x2b,0x22,104}, /* 0x17 */ { 0x49,0x24,105}, /* 0x18 */ { 0xf8,0x2f,108}, /* 0x19 */ /* 1400x1050 LCD */ { 0x3c,0x23,109}, /* 0x1a */ { 0x5e,0x43,113}, /* 0x1b */ { 0xbc,0x44,116}, /* 0x1c */ { 0xe0,0x46,132}, /* 0x1d */ { 0xe2,0x46,135}, /* 0x1e */ /* 1280x1024-75, better clock for VGA2 */ { 0xe5,0x46,139}, /* 0x1f */ /* 1024x768-120, better clock for VGA2 */ { 0x15,0x01,157}, /* 0x20 */ /* 1280x1024-85, better clock for VGA2 */ { 0x70,0x09,162}, /* 0x21 */ /* 1600x1200-60, better clock for VGA2 */ { 0x30,0x21,175}, /* 0x22 */ { 0x4e,0x22,189}, /* 0x23 */ { 0xde,0x26,194}, /* 0x24 */ { 0x70,0x07,202}, /* 0x25 */ { 0x3f,0x03,229}, /* 0x26 */ { 0xb8,0x06,234}, /* 0x27 */ { 0x34,0x02,253}, /* 0x28 */ { 0x58,0x04,255}, /* 0x29 */ { 0x24,0x01,265}, /* 0x2a */ { 0x9b,0x02,267}, /* 0x2b */ { 0x70,0x05,270}, /* 0x2c */ { 0x25,0x01,272}, /* 0x2d */ { 0x9c,0x02,277}, /* 0x2e */ { 0x27,0x01,286}, /* 0x2f */ { 0x3c,0x02,291}, /* 0x30 */ { 0xef,0x0a,292}, /* 0x31 */ { 0xf6,0x0a,310}, /* 0x32 */ { 0x95,0x01,315}, /* 0x33 */ { 0xf0,0x09,324}, /* 0x34 */ { 0xfe,0x0a,331}, /* 0x35 */ { 0xf3,0x09,332}, /* 0x36 */ { 0xea,0x08,340}, /* 0x37 */ { 0xe8,0x07,376}, /* 0x38 */ { 0xde,0x06,389}, /* 0x39 */ { 0x52,0x2a, 54}, /* 0x3a 301 TV - start */ { 0x52,0x6a, 27}, /* 0x3b 301 TV */ { 0x62,0x24, 70}, /* 0x3c 301 TV */ { 0x62,0x64, 70}, /* 0x3d 301 TV */ { 0xa8,0x4c, 30}, /* 0x3e 301 TV */ { 0x20,0x26, 33}, /* 0x3f 301 TV */ { 0x31,0xc2, 39}, /* 0x40 */ { 0x2e,0x48, 25}, /* 0x41 Replacement for LCD on 315 for index 0 */ { 0x24,0x46, 25}, /* 0x42 Replacement for LCD on 315 for modes 0x01, 0x03, 0x0f, 0x10, 0x12 */ { 0x26,0x64, 28}, /* 0x43 Replacement for LCD on 315 for index 1 */ { 0x37,0x64, 40}, /* 0x44 Replacement for LCD on 315 for index 4 */ { 0xa1,0x42,108}, /* 0x45 1280x960 LCD */ { 0x37,0x61,100}, /* 0x46 1280x960 LCD */ { 0x78,0x27,108}, /* 0x47 */ { 0x97,0x2c, 26}, /* 0x48 UNUSED */ { 0xce,0x3c, 39}, /* 0x49 UNUSED */ { 0x52,0x4a, 36}, /* 0x4a UNUSED */ { 0x34,0x61, 95}, /* 0x4b UNUSED */ { 0x78,0x27,108}, /* 0x4c UNUSED */ { 0x66,0x43,123}, /* 0x4d 1400x1050-60 */ { 0x41,0x4e, 21}, /* 0x4e */ { 0xa1,0x4a, 29}, /* 0x4f UNUSED */ { 0x19,0x42, 42}, /* 0x50 UNUSED */ { 0x54,0x46, 58}, /* 0x51 UNUSED */ { 0x25,0x42, 61}, /* 0x52 UNUSED */ { 0x44,0x44, 66}, /* 0x53 UNUSED */ { 0x3a,0x62, 70}, /* 0x54 UNUSED */ { 0x62,0xc6, 34}, /* 0x55 848x480-60 */ { 0x6a,0xc6, 37}, /* 0x56 848x480-75 - TEMP, UNUSED */ { 0xbf,0xc8, 35}, /* 0x57 856x480-38i,60 */ { 0x30,0x23, 88}, /* 0x58 1360x768-62 (is 60Hz!) TEMP, UNUSED */ { 0x52,0x07,149}, /* 0x59 1280x960-85 */ { 0x56,0x07,156}, /* 0x5a 1400x1050-75 */ { 0x70,0x29, 81}, /* 0x5b 1280x768 LCD (TMDS) */ { 0xce,0x1e, 73}, /* 0x5c 1280x800_2 LCD (SiS LVDS) - (CRT1: 45 25 83) */ { 0xbe,0x44,121}, /* 0x5d 1680x1050 LCD */ { 0x70,0x24,162}, /* 0x5e 1600x1200 LCD */ { 0x52,0x27, 75}, /* 0x5f 1280x720 (TMDS + HDTV) (correct) */ { 0xc8,0x48, 77}, /* 0x60 1280x768_2 (SiS LVDS) */ { 0x31,0x42, 79}, /* 0x61 1280x768_3 (SiS LVDS) - temp */ { 0, 0, 0}, /* 0x62 - custom (will be filled out at run-time) */ { 0x9c,0x62, 69}, /* 0x63 1280x720 (SiS LVDS) */ { 0x70,0x28, 90}, /* 0x64 1152x864@60 */ { 0x41,0xc4, 32}, /* 0x65 848x480@60 */ { 0x5c,0xc6, 32}, /* 0x66 856x480@60 */ { 0x76,0xe7, 27}, /* 0x67 720x480@60 */ { 0x5f,0xc6, 33}, /* 0x68 720/768x576@60 */ { 0x52,0x27, 75}, /* 0x69 1920x1080i 60Hz interlaced (UNUSED) */ { 0x7c,0x6b, 38}, /* 0x6a 960x540@60 */ { 0xe3,0x56, 41}, /* 0x6b 960x600@60 */ { 0x9c,0x62, 69}, /* 0x6c 1280x800 (SiS TMDS) (special) */ { 0x70,0x28, 90}, /* 0x6d 1152x864@60 */ { 0x15,0xe1, 20}, /* 0x6e 640x400@60 (fake, not actually used) */ { 0x5f,0xc6, 33}, /* 0x6f 720x576@60 */ { 0x37,0x5a, 10}, /* 0x70 320x200@60 (fake, not actually used) */ { 0x2b,0xc2, 35}, /* 0x71 768@576@60 */ { 0xa8,0x42,131}, /* 0x72 1600x1200@60 for LCDA */ { 0x1b,0xc1, 34}, /* 0x73 800x480 60Hz (wide) */ { 0x41,0x64, 48}, /* 0x74 1024x576 60Hz (wide) */ { 0x52,0x27, 75}, /* 0x75 1280x720 60Hz (wide) */ { 0x75,0x13, 84} /* 0x76 1280x854 60Hz (SiS LVDS) LCD */ }; static const unsigned char SiS310_SR15[4 * 8] = { 0x00,0x04,0x60,0x60, 0x0f,0x0f,0x0f,0x0f, 0xba,0xba,0xba,0xba, 0xa9,0xa9,0xac,0xac, 0xa0,0xa0,0xa0,0xa8, 0x00,0x00,0x02,0x02, 0x30,0x30,0x40,0x40, 0x00,0xa5,0xfb,0xf6 }; static const struct SiS_PanelDelayTbl SiS310_PanelDelayTbl[] = { {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}}, {{0x10,0x40}} }; static const struct SiS_PanelDelayTbl SiS310_PanelDelayTblLVDS[] = { {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}}, {{0x28,0xc8}} }; /**************************************************************/ /* SIS VIDEO BRIDGE ----------------------------------------- */ /**************************************************************/ static const struct SiS_LCDData SiS310_St2LCD1024x768Data[] = { { 62, 25, 800, 546,1344, 806}, { 32, 15, 930, 546,1344, 806}, { 62, 25, 800, 546,1344, 806}, { 104, 45, 945, 496,1344, 806}, { 62, 25, 800, 546,1344, 806}, { 31, 18,1008, 624,1344, 806}, { 1, 1,1344, 806,1344, 806} }; static const struct SiS_LCDData SiS310_ExtLCD1024x768Data[] = { { 42, 25,1536, 419,1344, 806}, { 48, 25,1536, 369,1344, 806}, { 42, 25,1536, 419,1344, 806}, { 48, 25,1536, 369,1344, 806}, { 12, 5, 896, 500,1344, 806}, { 42, 25,1024, 625,1344, 806}, { 1, 1,1344, 806,1344, 806} }; static const struct SiS_LCDData SiS310_St2LCD1280x1024Data[] = { { 22, 5, 800, 510,1650,1088}, { 22, 5, 800, 510,1650,1088}, { 176, 45, 900, 510,1650,1088}, { 176, 45, 900, 510,1650,1088}, { 22, 5, 800, 510,1650,1088}, { 13, 5,1024, 675,1560,1152}, { 16, 9,1266, 804,1688,1072}, { 1, 1,1688,1066,1688,1066} }; static const struct SiS_LCDData SiS310_ExtLCD1280x1024Data[] = { { 211, 60,1024, 501,1688,1066}, { 211, 60,1024, 508,1688,1066}, { 211, 60,1024, 501,1688,1066}, { 211, 60,1024, 508,1688,1066}, { 211, 60,1024, 500,1688,1066}, { 211, 75,1024, 625,1688,1066}, { 211, 120,1280, 798,1688,1066}, { 1, 1,1688,1066,1688,1066} }; static const struct SiS_Part2PortTbl SiS310_CRT2Part2_1024x768_1[] = { {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}, {{0x2c,0x12,0x9a,0xae,0x88,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}, {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, {{0x38,0x13,0x16,0x0c,0xe6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}, {{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}, {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}} }; /**************************************************************/ /* LVDS, CHRONTEL ------------------------------------------- */ /**************************************************************/ static const struct SiS_LVDSData SiS310_CHTVUPALData[] = { {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, { 840, 625, 840, 625}, { 960, 750, 960, 750}, {1400,1000,1400,1000} }; static const struct SiS_LVDSData SiS310_CHTVOPALData[] = { {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, { 840, 625, 840, 625}, { 944, 625, 944, 625}, {1400, 875,1400, 875} }; static const struct SiS_LVDSData SiS310_CHTVUPALMData[] = { { 840, 600, 840, 600}, { 840, 600, 840, 600}, { 840, 600, 840, 600}, { 840, 600, 840, 600}, { 784, 600, 784, 600}, {1064, 750,1064, 750}, {1160, 945,1160, 945} }; static const struct SiS_LVDSData SiS310_CHTVOPALMData[] = { { 840, 525, 840, 525}, { 840, 525, 840, 525}, { 840, 525, 840, 525}, { 840, 525, 840, 525}, { 784, 525, 784, 525}, {1040, 700,1040, 700}, {1160, 840,1160, 840} }; static const struct SiS_LVDSData SiS310_CHTVUPALNData[] = { {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, { 840, 625, 840, 625}, { 960, 750, 960, 750}, {1400,1000,1400,1000} }; static const struct SiS_LVDSData SiS310_CHTVOPALNData[] = { {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, { 840, 625, 840, 625}, { 944, 625, 944, 625}, {1400, 875,1400, 875} }; static const struct SiS_LVDSData SiS310_CHTVSOPALData[] = /* (super overscan - no effect on 7019) */ { {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, {1008, 625,1008, 625}, { 840, 625, 840, 625}, { 944, 625, 944, 625}, {1400, 875,1400, 875} }; /* CRT1 CRTC for Chrontel TV slave modes */ static const struct SiS_LVDSCRT1Data SiS310_CHTVCRT1UNTSC[] = { {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e, 0xe8,0x84,0x8f,0x57,0x20,0x00,0x01, 0x00 }}, {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e, 0xd0,0x82,0x5d,0x57,0x00,0x00,0x01, 0x00 }}, {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e, 0xe8,0x84,0x8f,0x57,0x20,0x00,0x01, 0x00 }}, {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e, 0xd0,0x82,0x5d,0x57,0x00,0x00,0x01, 0x00 }}, {{0x5d,0x4f,0x81,0x56,0x99,0x56,0xba, 0x0a,0x84,0xdf,0x57,0x00,0x00,0x01, 0x00 }}, {{0x80,0x63,0x84,0x6d,0x0f,0xec,0xf0, 0x7a,0x8f,0x57,0xed,0x20,0x00,0x06, 0x01 }}, {{0x8c,0x7f,0x90,0x86,0x09,0xaf,0xf5, 0x36,0x88,0xff,0xb0,0x10,0x00,0x02, 0x01}} }; static const struct SiS_LVDSCRT1Data SiS310_CHTVCRT1ONTSC[] = { {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e, 0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01, 0x00 }}, {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e, 0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01, 0x00 }}, {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e, 0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01, 0x00 }}, {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e, 0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01, 0x00 }}, {{0x5d,0x4f,0x81,0x58,0x9d,0x0b,0x3e, 0xe8,0x84,0xdf,0x0c,0x00,0x00,0x01, 0x00 }}, {{0x7d,0x63,0x81,0x68,0x0e,0xba,0xf0, 0x78,0x8a,0x57,0xbb,0x20,0x00,0x06, 0x01 }}, {{0x8c,0x7f,0x90,0x82,0x06,0x46,0xf5, 0x15,0x88,0xff,0x47,0x70,0x00,0x02, 0x01 }} }; static const struct SiS_LVDSCRT1Data SiS310_CHTVCRT1UPAL[] = { {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf8,0x83,0x8f,0x70,0x20,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xde,0x81,0x5d,0x70,0x00,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf8,0x83,0x8f,0x70,0x20,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xde,0x81,0x5d,0x70,0x00,0x00,0x05, 0x00 }}, {{0x64,0x4f,0x88,0x5a,0x9f,0x6f,0xba, 0x15,0x83,0xdf,0x70,0x00,0x00,0x01, 0x00 }}, {{0x73,0x63,0x97,0x69,0x8b,0xec,0xf0, 0x90,0x8c,0x57,0xed,0x20,0x00,0x05, 0x01 }}, {{0xaa,0x7f,0x8e,0x8e,0x96,0xe6,0xf5, 0x50,0x88,0xff,0xe7,0x10,0x00,0x02, 0x01}} }; static const struct SiS_LVDSCRT1Data SiS310_CHTVCRT1OPAL[] = { {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf0,0x83,0x8f,0x70,0x20,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xde,0x81,0x5d,0x70,0x00,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf0,0x83,0x8f,0x70,0x20,0x00,0x05, 0x00 }}, {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xde,0x81,0x5d,0x70,0x00,0x00,0x05, 0x00 }}, {{0x64,0x4f,0x88,0x58,0x9d,0x6f,0xba, 0x15,0x83,0xdf,0x70,0x00,0x00,0x01, 0x00 }}, {{0x71,0x63,0x95,0x69,0x8c,0x6f,0xf0, 0x5a,0x8b,0x57,0x70,0x20,0x00,0x05, 0x01 }}, {{0xaa,0x7f,0x8e,0x8f,0x96,0x69,0xf5, 0x28,0x88,0xff,0x6a,0x10,0x00,0x02, 0x01 }} }; static const struct SiS_CHTVRegData SiS310_CHTVReg_UNTSC[] = { {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x6a,0x77,0xbb,0x6e,0x84,0x2e,0x02,0x5a,0x04,0x00,0x80,0x20,0x7e,0x80,0x98,0x00}}, {{0xcf,0x77,0xb7,0xc8,0x84,0x3b,0x02,0x5a,0x04,0x00,0x80,0x19,0x88,0x30,0x7f,0x00}}, {{0xee,0x77,0xbb,0x66,0x87,0x32,0x01,0x5a,0x04,0x00,0x80,0x1b,0xd3,0xf2,0x36,0x00}} }; /* WRONG: 0x02: should be 0xfx, because if CIVEnable is clear, this should be set; 0x07: Blacklevel: NTSC/PAL-M: Should be 131 (0x83), and not 0x50/0x5a PAL/PAL-N: 110 (0x6e) NTSC-J: 102 (0x66) 0x0c-0x0f: CIV is not default as in datasheet MISSING: 0x21: Should set D1 to ZERO (for NTSC, PAL-M) or ONE (PAL, NTSC-J) Most of this is wrong in all NTSC and PAL register arrays. But I won't correct it as long as it works. For NTSC-J, the blacklevel is corrected in init301.c; for PAL-M and PAL-N all above is corrected. */ static const struct SiS_CHTVRegData SiS310_CHTVReg_ONTSC[] = { {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x69,0x77,0xbb,0x6e,0x84,0x1e,0x00,0x5a,0x04,0x00,0x80,0x25,0x1a,0x43,0x04,0x00}}, {{0xce,0x77,0xb7,0xb6,0x83,0x2c,0x02,0x5a,0x04,0x00,0x80,0x1c,0x00,0x82,0x97,0x00}}, {{0xed,0x77,0xbb,0x66,0x8c,0x21,0x02,0x5a,0x04,0x00,0x80,0x1f,0x9f,0xc1,0x0c,0x00}} }; static const struct SiS_CHTVRegData SiS310_CHTVReg_UPAL[] = { {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x41,0x7f,0xb7,0x12,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x26,0x2a,0x55,0x5d,0x00}}, {{0xc3,0x7f,0xb7,0x7a,0x84,0x40,0x02,0x5a,0x05,0x00,0x80,0x1f,0x84,0x3d,0x28,0x00}}, {{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x5a,0x05,0x00,0x80,0x20,0x3e,0xe4,0x22,0x00}} }; static const struct SiS_CHTVRegData SiS310_CHTVReg_OPAL[] = { {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x26,0x2a,0x55,0x5d,0x00}}, {{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x5a,0x05,0x00,0x80,0x26,0x78,0x19,0x34,0x00}}, {{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x5a,0x05,0x00,0x80,0x25,0x8c,0xb2,0x2a,0x00}} }; static const struct SiS_CHTVRegData SiS310_CHTVReg_UPALM[] = { {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x72,0x77,0xfb,0x6e,0x84,0x2e,0x02,0x83,0x04,0x00,0x80,0x20,0x76,0xdb,0x6e,0x00}}, {{0xd7,0x77,0xf7,0xc8,0x84,0x3b,0x02,0x83,0x04,0x00,0x80,0x19,0x84,0x0a,0xc7,0x00}}, {{0xf6,0x77,0xfb,0x66,0x87,0x32,0x01,0x83,0x04,0x00,0x80,0x1b,0xdc,0xb0,0x8d,0x00}} #if 0 /* Correct blacklevel and CFRB */ {{0x72,0x77,0xbb,0x6e,0x84,0x2e,0x02,0x5a,0x04,0x00,0x80,0x20,0x76,0xdb,0x6e,0x00}}, {{0xd7,0x77,0xb7,0xc8,0x84,0x3b,0x02,0x5a,0x04,0x00,0x80,0x19,0x84,0x0a,0xc7,0x00}}, {{0xf6,0x77,0xbb,0x66,0x87,0x32,0x01,0x5a,0x04,0x00,0x80,0x1b,0xdc,0xb0,0x8d,0x00}} #endif }; static const struct SiS_CHTVRegData SiS310_CHTVReg_OPALM[] = { {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}}, {{0x71,0x77,0xfb,0x6e,0x84,0x1e,0x00,0x83,0x04,0x00,0x80,0x25,0x1a,0x1f,0x59,0x00}}, {{0xd6,0x77,0xf7,0xb6,0x83,0x2c,0x02,0x83,0x04,0x00,0x80,0x1b,0xf8,0x1f,0x82,0x00}}, {{0xf5,0x77,0xfb,0x66,0x8c,0x21,0x02,0x83,0x04,0x00,0x80,0x1f,0x58,0x46,0x9f,0x00}} #if 0 /* Correct blacklevel and CFRB */ {{0x71,0x77,0xbb,0x6e,0x84,0x1e,0x00,0x5a,0x04,0x00,0x80,0x25,0x1a,0x1f,0x59,0x00}}, {{0xd6,0x77,0xb7,0xb6,0x83,0x2c,0x02,0x5a,0x04,0x00,0x80,0x1b,0xf8,0x1f,0x82,0x00}}, {{0xf5,0x77,0xbb,0x66,0x8c,0x21,0x02,0x5a,0x04,0x00,0x80,0x1f,0x58,0x46,0x9f,0x00}} #endif }; static const struct SiS_CHTVRegData SiS310_CHTVReg_UPALN[] = { {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0x41,0x7f,0xb7,0x12,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0xc3,0x7f,0xb7,0x7a,0x84,0x40,0x02,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}} #if 0 /* Correct blacklevel, CIV and CFRB */ {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x1f,0x0d,0x54,0x5e,0x00}}, {{0xc3,0x7f,0xb7,0x7a,0x84,0x40,0x02,0x5a,0x05,0x00,0x80,0x19,0x78,0xef,0x35,0x00}}, {{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x5a,0x05,0x00,0x80,0x1a,0x33,0x3f,0x2f,0x00}} #endif }; static const struct SiS_CHTVRegData SiS310_CHTVReg_OPALN[] = { {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}, {{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}} #if 0 /* Correct blacklevel, CIV and CFRB */ {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x1f,0x0d,0x54,0x5e,0x00}}, {{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x5a,0x05,0x00,0x80,0x1f,0x15,0xc0,0x1e,0x00}}, {{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x5a,0x05,0x00,0x80,0x1d,0xf1,0x6c,0xcb,0x00}} #endif }; static const unsigned char SiS310_CHTVVCLKUNTSC[] = { 0x41,0x41,0x41,0x41,0x42,0x46,0x53 }; static const unsigned char SiS310_CHTVVCLKONTSC[] = { 0x48,0x48,0x48,0x48,0x45,0x43,0x51 }; static const unsigned char SiS310_CHTVVCLKUPAL[] = { 0x47,0x47,0x47,0x47,0x48,0x4a,0x54 }; static const unsigned char SiS310_CHTVVCLKOPAL[] = { 0x47,0x47,0x47,0x47,0x48,0x4f,0x52 }; static const unsigned char SiS310_CHTVVCLKUPALM[] = { 0x41,0x41,0x41,0x41,0x42,0x46,0x53 }; static const unsigned char SiS310_CHTVVCLKOPALM[] = { 0x48,0x48,0x48,0x48,0x45,0x43,0x51 }; static const unsigned char SiS310_CHTVVCLKUPALN[] = { 0x47,0x47,0x47,0x47,0x48,0x4a,0x54 }; static const unsigned char SiS310_CHTVVCLKOPALN[] = { 0x47,0x47,0x47,0x47,0x48,0x4f,0x52 }; xf86-video-sis-0.10.7/src/sis_regs.h0000664000076400007640000006454511763614406014031 00000000000000/* * Register access macros and register definitions * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef _SIS_REGS_H_ #define _SIS_REGS_H_ /* #define SIS_NEED_inSISREG #define SIS_NEED_inSISREGW #define SIS_NEED_inSISREGL #define SIS_NEED_outSISREG #define SIS_NEED_outSISREGW #define SIS_NEED_outSISREGL #define SIS_NEED_orSISREG #define SIS_NEED_andSISREG #define SIS_NEED_inSISIDXREG #define SIS_NEED_outSISIDXREG #define SIS_NEED_orSISIDXREG #define SIS_NEED_andSISIDXREG #define SIS_NEED_setSISIDXREG #define SIS_NEED_setSISIDXREGmask */ /* Video RAM access macros */ /* (Currently, these are use on all platforms; USB2VGA is handled * entirely different in a dedicated driver) */ /* dest is video RAM, src is system RAM */ #define sisfbwritel(dest, data) *(dest) = (data) #define sisfbwritelinc(dest, data) *((dest)++) = (data) #define sisfbwritelp(dest, dataptr) *(dest) = *(dataptr) #define sisfbwritelpinc(dest, dataptr) *((dest)++) = *((dataptr)++) #define sisfbwritew(dest, data) *(dest) = (data) #define sisfbwritewinc(dest, data) *((dest)++) = (data) #define sisfbwritewp(dest, dataptr) *(dest) = *(dataptr) #define sisfbwritewpinc(dest, dataptr) *((dest)++) = *((dataptr)++) #define sisfbwriteb(dest, data) *(dest) = (data) #define sisfbwritebinc(dest, data) *((dest)++) = (data) #define sisfbwritebp(dest, dataptr) *(dest) = *(dataptr) #define sisfbwritebpinc(dest, dataptr) *((dest)++) = *((dataptr)++) /* Source is video RAM */ #define sisfbreadl(src) *(src) #define sisfbreadlinc(src) *((src)++) #define sisfbreadw(src) *(src) #define sisfbreadwinc(src) *((src)++) #define sisfbreadb(src) *(src) #define sisfbreadbinc(src) *((src)++) /* Register access macros --------------- */ #ifndef SISUSEDEVPORT #define inSISREG(base) inb(base) #define inSISREGW(base) inw(base) #define inSISREGL(base) inl(base) #define outSISREG(base,val) outb(base,val) #define outSISREGW(base,val) outw(base,val) #define outSISREGL(base,val) outl(base,val) #define orSISREG(base,val) \ do { \ UChar __Temp = inSISREG(base); \ outSISREG(base, __Temp | (val)); \ } while (0) #define andSISREG(base,val) \ do { \ UChar __Temp = inSISREG(base); \ outSISREG(base, __Temp & (val)); \ } while (0) #define inSISIDXREG(base,idx,var) \ do { \ outSISREG(base, idx); \ var = inSISREG((base)+1); \ } while (0) #define outSISIDXREG(base,idx,val) \ do { \ outSISREG(base, idx); \ outSISREG((base)+1, val); \ } while (0) #define orSISIDXREG(base,idx,val) \ do { \ UChar __Temp; \ outSISREG(base, idx); \ __Temp = inSISREG((base)+1) | (val); \ outSISREG((base)+1, __Temp); \ } while (0) #define andSISIDXREG(base,idx,and) \ do { \ UChar __Temp; \ outSISREG(base, idx); \ __Temp = inSISREG((base)+1) & (and); \ outSISREG((base)+1, __Temp); \ } while (0) #define setSISIDXREG(base,idx,and,or) \ do { \ UChar __Temp; \ outSISREG(base, idx); \ __Temp = (inSISREG((base)+1) & (and)) | (or); \ outSISREG((base)+1, __Temp); \ } while (0) #define setSISIDXREGmask(base,idx,data,mask) \ do { \ UChar __Temp; \ outSISREG(base, idx); \ __Temp = (inSISREG((base)+1)) & (~(mask));\ __Temp |= ((data) & (mask)); \ outSISREG((base)+1, __Temp); \ } while(0) #else /* USEDEVPORT */ extern int sisdevport; /* Note to self: SEEK_SET is faster than SEEK_CUR */ #ifdef SIS_NEED_inSISREG static UChar inSISREG(ULong base) { UChar tmp; lseek(sisdevport, base, SEEK_SET); read(sisdevport, &tmp, 1); return tmp; } #endif #ifdef SIS_NEED_inSISREGW static __inline UShort inSISREGW(ULong base) { UShort tmp; lseek(sisdevport, base, SEEK_SET); read(sisdevport, &tmp, 2); return tmp; } #endif #ifdef SIS_NEED_inSISREGL static __inline unsigned int inSISREGL(ULong base) { ULong tmp; lseek(sisdevport, base, SEEK_SET); read(sisdevport, &tmp, 4); return tmp; } #endif #ifdef SIS_NEED_outSISREG static void outSISREG(ULong base, UChar val) { lseek(sisdevport, base, SEEK_SET); write(sisdevport, &val, 1); } #endif #ifdef SIS_NEED_outSISREGW static __inline void outSISREGW(ULong base, UShort val) { lseek(sisdevport, base, SEEK_SET); write(sisdevport, &val, 2); } #endif #ifdef SIS_NEED_outSISREGL static __inline void outSISREGL(ULong base, unsigned int val) { lseek(sisdevport, base, SEEK_SET); write(sisdevport, &val, 4); } #endif #ifdef SIS_NEED_orSISREG static void orSISREG(ULong base, UChar val) { UChar tmp; lseek(sisdevport, base, SEEK_SET); read(sisdevport, &tmp, 1); tmp |= val; lseek(sisdevport, base, SEEK_SET); write(sisdevport, &tmp, 1); } #endif #ifdef SIS_NEED_andSISREG static void andSISREG(ULong base, UChar val) { UChar tmp; lseek(sisdevport, base, SEEK_SET); read(sisdevport, &tmp, 1); tmp &= val; lseek(sisdevport, base, SEEK_SET); write(sisdevport, &tmp, 1); } #endif #ifdef SIS_NEED_outSISIDXREG static void outSISIDXREG(ULong base, UChar idx, UChar val) { UChar value[2]; value[0] = idx; /* sic! reads/writes bytewise! */ value[1] = val; lseek(sisdevport, base, SEEK_SET); write(sisdevport, &value[0], 2); } #endif #ifdef SIS_NEED_inSISIDXREG static UChar __inSISIDXREG(ULong base, UChar idx) { UChar tmp; lseek(sisdevport, base, SEEK_SET); write(sisdevport, &idx, 1); read(sisdevport, &tmp, 1); return tmp; } #define inSISIDXREG(base,idx,var) var = __inSISIDXREG(base, idx); #endif #ifdef SIS_NEED_orSISIDXREG static void orSISIDXREG(ULong base, UChar idx, UChar val) { UChar tmp; lseek(sisdevport, base, SEEK_SET); write(sisdevport, &idx, 1); read(sisdevport, &tmp, 1); tmp |= val; lseek(sisdevport, base + 1, SEEK_SET); write(sisdevport, &tmp, 1); } #endif #ifdef SIS_NEED_andSISIDXREG static void andSISIDXREG(ULong base, UChar idx, UChar val) { UChar tmp; lseek(sisdevport, base, SEEK_SET); write(sisdevport, &idx, 1); read(sisdevport, &tmp, 1); tmp &= val; lseek(sisdevport, base + 1, SEEK_SET); write(sisdevport, &tmp, 1); } #endif #ifdef SIS_NEED_setSISIDXREG static void setSISIDXREG(ULong base, UChar idx, UChar myand, UChar myor) { UChar tmp; lseek(sisdevport, base, SEEK_SET); write(sisdevport, &idx, 1); read(sisdevport, &tmp, 1); tmp &= myand; tmp |= myor; lseek(sisdevport, base + 1, SEEK_SET); write(sisdevport, &tmp, 1); } #endif #ifdef SIS_NEED_setSISIDXREGmask static void setSISIDXREGmask(ULong base, UChar idx, UChar data, UChar mask) { UChar tmp; lseek(sisdevport, base, SEEK_SET); write(sisdevport, &idx, 1); read(sisdevport, &tmp, 1); tmp &= ~(mask); tmp |= (data & mask); lseek(sisdevport, base + 1, SEEK_SET); write(sisdevport, &tmp, 1); } #endif #endif /* SISUSEDEVPORT */ /* Video RAM and MMIO access macros ----- */ #define sisclearvram(where, howmuch) bzero(where, howmuch) /* MMIO */ #define SIS_MMIO_OUT8 MMIO_OUT8 #define SIS_MMIO_OUT16 MMIO_OUT16 #define SIS_MMIO_OUT32 MMIO_OUT32 #define SIS_MMIO_IN8 MMIO_IN8 #define SIS_MMIO_IN16 MMIO_IN16 #define SIS_MMIO_IN32 MMIO_IN32 /* VRAM queue acceleration */ #define SiSWriteQueue(tt) #define SIS_WQINDEX(i) ((CARD32 *)(tt))[(i)] #define SIS_RQINDEX(i) ((volatile CARD32 *)(tt))[(i)] /* Port offsets --------------- */ #define AROFFSET 0x40 #define ARROFFSET 0x41 #define GROFFSET 0x4e #define SROFFSET 0x44 #define CROFFSET 0x54 #define MISCROFFSET 0x4c #define MISCWOFFSET 0x42 #define INPUTSTATOFFSET 0x5A #define PART1OFFSET 0x04 #define PART2OFFSET 0x10 #define PART3OFFSET 0x12 #define PART4OFFSET 0x14 #define PART5OFFSET 0x16 #define CAPTUREOFFSET 0x00 #define VIDEOOFFSET 0x02 #define COLREGOFFSET 0x48 #define PELMASKOFFSET 0x46 #define SISAR pSiS->RelIO + AROFFSET #define SISARR pSiS->RelIO + ARROFFSET #define SISGR pSiS->RelIO + GROFFSET #define SISSR pSiS->RelIO + SROFFSET #define SISCR pSiS->RelIO + CROFFSET #define SISMISCR pSiS->RelIO + MISCROFFSET #define SISMISCW pSiS->RelIO + MISCWOFFSET #define SISINPSTAT pSiS->RelIO + INPUTSTATOFFSET #define SISPART1 pSiS->RelIO + PART1OFFSET #define SISPART2 pSiS->RelIO + PART2OFFSET #define SISPART3 pSiS->RelIO + PART3OFFSET #define SISPART4 pSiS->RelIO + PART4OFFSET #define SISPART5 pSiS->RelIO + PART5OFFSET #define SISCAP pSiS->RelIO + CAPTUREOFFSET #define SISVID pSiS->RelIO + VIDEOOFFSET #define SISCOLIDXR pSiS->RelIO + COLREGOFFSET - 1 #define SISCOLIDX pSiS->RelIO + COLREGOFFSET #define SISCOLDATA pSiS->RelIO + COLREGOFFSET + 1 #define SISCOL2IDX SISPART5 #define SISCOL2DATA SISPART5 + 1 #define SISPEL pSiS->RelIO + PELMASKOFFSET /* Video registers (300/315/330/340 series only) --------------- */ #define Index_VI_Passwd 0x00 /* Video overlay horizontal start/end, unit=screen pixels */ #define Index_VI_Win_Hor_Disp_Start_Low 0x01 #define Index_VI_Win_Hor_Disp_End_Low 0x02 #define Index_VI_Win_Hor_Over 0x03 /* Overflow */ /* Video overlay vertical start/end, unit=screen pixels */ #define Index_VI_Win_Ver_Disp_Start_Low 0x04 #define Index_VI_Win_Ver_Disp_End_Low 0x05 #define Index_VI_Win_Ver_Over 0x06 /* Overflow */ /* Y Plane (4:2:0) or YUV (4:2:2) buffer start address, unit=word */ #define Index_VI_Disp_Y_Buf_Start_Low 0x07 #define Index_VI_Disp_Y_Buf_Start_Middle 0x08 #define Index_VI_Disp_Y_Buf_Start_High 0x09 /* U Plane (4:2:0) buffer start address, unit=word */ #define Index_VI_U_Buf_Start_Low 0x0A #define Index_VI_U_Buf_Start_Middle 0x0B #define Index_VI_U_Buf_Start_High 0x0C /* V Plane (4:2:0) buffer start address, unit=word */ #define Index_VI_V_Buf_Start_Low 0x0D #define Index_VI_V_Buf_Start_Middle 0x0E #define Index_VI_V_Buf_Start_High 0x0F /* Pitch for Y, UV Planes, unit=word */ #define Index_VI_Disp_Y_Buf_Pitch_Low 0x10 #define Index_VI_Disp_UV_Buf_Pitch_Low 0x11 #define Index_VI_Disp_Y_UV_Buf_Pitch_Middle 0x12 /* What is this ? */ #define Index_VI_Disp_Y_Buf_Preset_Low 0x13 #define Index_VI_Disp_Y_Buf_Preset_Middle 0x14 #define Index_VI_UV_Buf_Preset_Low 0x15 #define Index_VI_UV_Buf_Preset_Middle 0x16 #define Index_VI_Disp_Y_UV_Buf_Preset_High 0x17 /* Scaling control registers */ #define Index_VI_Hor_Post_Up_Scale_Low 0x18 #define Index_VI_Hor_Post_Up_Scale_High 0x19 #define Index_VI_Ver_Up_Scale_Low 0x1A #define Index_VI_Ver_Up_Scale_High 0x1B #define Index_VI_Scale_Control 0x1C /* Playback line buffer control */ #define Index_VI_Play_Threshold_Low 0x1D #define Index_VI_Play_Threshold_High 0x1E #define Index_VI_Line_Buffer_Size 0x1F /* Destination color key */ #define Index_VI_Overlay_ColorKey_Red_Min 0x20 #define Index_VI_Overlay_ColorKey_Green_Min 0x21 #define Index_VI_Overlay_ColorKey_Blue_Min 0x22 #define Index_VI_Overlay_ColorKey_Red_Max 0x23 #define Index_VI_Overlay_ColorKey_Green_Max 0x24 #define Index_VI_Overlay_ColorKey_Blue_Max 0x25 /* Source color key, YUV color space */ #define Index_VI_Overlay_ChromaKey_Red_Y_Min 0x26 #define Index_VI_Overlay_ChromaKey_Green_U_Min 0x27 #define Index_VI_Overlay_ChromaKey_Blue_V_Min 0x28 #define Index_VI_Overlay_ChromaKey_Red_Y_Max 0x29 #define Index_VI_Overlay_ChromaKey_Green_U_Max 0x2A #define Index_VI_Overlay_ChromaKey_Blue_V_Max 0x2B /* Contrast enhancement and brightness control */ #define Index_VI_Contrast_Factor 0x2C /* obviously unused/undefined */ #define Index_VI_Brightness 0x2D #define Index_VI_Contrast_Enh_Ctrl 0x2E #define Index_VI_Key_Overlay_OP 0x2F #define Index_VI_Control_Misc0 0x30 #define Index_VI_Control_Misc1 0x31 #define Index_VI_Control_Misc2 0x32 /* Subpicture registers */ #define Index_VI_SubPict_Buf_Start_Low 0x33 #define Index_VI_SubPict_Buf_Start_Middle 0x34 #define Index_VI_SubPict_Buf_Start_High 0x35 /* What is this ? */ #define Index_VI_SubPict_Buf_Preset_Low 0x36 #define Index_VI_SubPict_Buf_Preset_Middle 0x37 /* Subpicture pitch, unit=16 bytes */ #define Index_VI_SubPict_Buf_Pitch 0x38 /* Subpicture scaling control */ #define Index_VI_SubPict_Hor_Scale_Low 0x39 #define Index_VI_SubPict_Hor_Scale_High 0x3A #define Index_VI_SubPict_Vert_Scale_Low 0x3B #define Index_VI_SubPict_Vert_Scale_High 0x3C #define Index_VI_SubPict_Scale_Control 0x3D /* (0x40 = enable/disable subpicture) */ /* Subpicture line buffer control */ #define Index_VI_SubPict_Threshold 0x3E /* What is this? */ #define Index_VI_FIFO_Max 0x3F /* Subpicture palette; 16 colors, total 32 bytes address space */ #define Index_VI_SubPict_Pal_Base_Low 0x40 #define Index_VI_SubPict_Pal_Base_High 0x41 /* I wish I knew how to use these ... */ #define Index_MPEG_Read_Ctrl0 0x60 /* MPEG auto flip */ #define Index_MPEG_Read_Ctrl1 0x61 /* MPEG auto flip */ #define Index_MPEG_Read_Ctrl2 0x62 /* MPEG auto flip */ #define Index_MPEG_Read_Ctrl3 0x63 /* MPEG auto flip */ /* MPEG AutoFlip scale */ #define Index_MPEG_Ver_Up_Scale_Low 0x64 #define Index_MPEG_Ver_Up_Scale_High 0x65 #define Index_MPEG_Y_Buf_Preset_Low 0x66 #define Index_MPEG_Y_Buf_Preset_Middle 0x67 #define Index_MPEG_UV_Buf_Preset_Low 0x68 #define Index_MPEG_UV_Buf_Preset_Middle 0x69 #define Index_MPEG_Y_UV_Buf_Preset_High 0x6A /* The following registers only exist on the 315/330/340 series */ /* Bit 16:24 of Y_U_V buf start address */ #define Index_VI_Y_Buf_Start_Over 0x6B #define Index_VI_U_Buf_Start_Over 0x6C #define Index_VI_V_Buf_Start_Over 0x6D #define Index_VI_Disp_Y_Buf_Pitch_High 0x6E #define Index_VI_Disp_UV_Buf_Pitch_High 0x6F /* Hue and saturation */ #define Index_VI_Hue 0x70 #define Index_VI_Saturation 0x71 #define Index_VI_SubPict_Start_Over 0x72 #define Index_VI_SubPict_Buf_Pitch_High 0x73 #define Index_VI_Control_Misc3 0x74 /* 340 and later: */ /* DDA registers 0x75 - 0xb4 */ /* threshold high 0xb5, 0xb6 */ #define Index_VI_Line_Buffer_Size_High 0xb7 /* Bits in Scale control (0x1c) */ #define VI_Scale_Ctrl_Horiz_DDA 0x20 #define VI_Scale_Ctrl_Vert_DDA 0x40 /* Bits (and helpers) for Index_VI_Control_Misc0 */ #define VI_Misc0_Enable_Capture_AutoFlip 0x01 /* 340 only? */ #define VI_Misc0_Enable_Overlay 0x02 #define VI_Misc0_420_Plane_Enable 0x04 /* Select Plane or Packed mode */ #define VI_Misc0_422_Enable 0x20 /* Select 422 or 411 mode */ #define VI_Misc0_Fmt_YVU420P 0x0C /* YUV420 Planar (I420, YV12) */ #define VI_Misc0_Fmt_YUYV 0x28 /* YUYV Packed (=YUY2) */ #define VI_Misc0_Fmt_UYVY 0x08 /* (UYVY) */ #define VI_Misc0_Fmt_YVYU 0x38 /* (YVYU) (315 series only?) */ #define VI_Misc0_Fmt_NV21 0x5c /* (330 series only?) */ #define VI_Misc0_Fmt_NV12 0x4c /* (330 series only?) */ #define VI_Misc0_ChromaKeyRGBYUV 0x40 /* 300 series only: 0 = RGB, 1 = YUV */ /* Bits for Index_VI_Control_Misc1 */ #define VI_Misc1_DisableGraphicsAtOverlay 0x01 /* Disables graphics display in overlay area */ #define VI_Misc1_BOB_Enable 0x02 /* Enable BOB de-interlacer */ #define VI_Misc1_Line_Merge 0x04 #define VI_Misc1_Field_Mode 0x08 /* ? Assume even/odd fields interleaved in memory ? */ #define VI_Misc1_Non_Interleave 0x10 /* ? Odd and Even fields are not interleaved ? */ #define VI_Misc1_Buf_Addr_Lock 0x20 /* 315 series only? */ /* #define VI_Misc1_? 0x40 */ /* #define VI_Misc1_? 0x80 */ /* Bits for Index_VI_Control_Misc2 */ #define VI_Misc2_Select_Video2 0x01 #define VI_Misc2_Video2_On_Top 0x02 #define VI_Misc2_DisableGraphics 0x04 /* Disable graphics display entirely (<= 650 only, not >= M650, 651) */ #define VI_Misc2_Vertical_Interpol 0x08 #define VI_Misc2_Dual_Line_Merge 0x10 /* dual-overlay chips only; "dual video windows relative line buffer merge" */ #define VI_Misc2_All_Line_Merge 0x20 /* > 315 only */ #define VI_Misc2_Auto_Flip_Enable 0x40 #define VI_Misc2_Video_Reg_Write_Enable 0x80 /* 315 series only? */ /* Bits for Index_VI_Control_Misc3 */ #define VI_Misc3_Submit_Video_1 0x01 /* AKA "address ready" */ #define VI_Misc3_Submit_Video_2 0x02 /* AKA "address ready" */ #define VI_Misc3_Submit_SubPict 0x04 /* AKA "address ready" */ /* Values for Index_VI_Key_Overlay_OP (0x2F) */ #define VI_ROP_Never 0x00 #define VI_ROP_DestKey 0x03 #define VI_ROP_ChromaKey 0x05 #define VI_ROP_NotChromaKey 0x0A #define VI_ROP_Always 0x0F /* Video registers (559x, 6326 and 530/620) --------------- */ #define Index_VI6326_Passwd 0x80 /* Video overlay horizontal start/end, unit=screen pixels */ #define Index_VI6326_Win_Hor_Disp_Start_Low 0x81 #define Index_VI6326_Win_Hor_Disp_End_Low 0x82 #define Index_VI6326_Win_Hor_Over 0x83 /* Overflow */ /* Video overlay vertical start/end, unit=screen pixels */ #define Index_VI6326_Win_Ver_Disp_Start_Low 0x84 #define Index_VI6326_Win_Ver_Disp_End_Low 0x85 #define Index_VI6326_Win_Ver_Over 0x86 /* Overflow */ /* Y Plane (4:2:0) or YUV (4:2:2) buffer start address, unit=dword */ #define Index_VI6326_Disp_Y_Buf_Start_Low 0x8A #define Index_VI6326_Disp_Y_Buf_Start_Middle 0x8B #define Index_VI6326_Disp_Capt_Y_Buf_Start_High 0x89 /* 6326: 7:4 display, 3:0 capture */ /* 530/620: 7:3 display. 2:0 reserved */ /* End address of Y plane (in 16k unit) - 6326 ONLY */ #define Index_VI6326_Disp_Y_End 0x8D /* U Plane (4:2:0) buffer start address, unit=dword */ #define Index_VI6326_U_Buf_Start_Low 0xB7 #define Index_VI6326_U_Buf_Start_Middle 0xB8 /* V Plane (4:2:0) buffer start address, unit=dword */ #define Index_VI6326_V_Buf_Start_Low 0xBA #define Index_VI6326_V_Buf_Start_Middle 0xBB /* U/V plane start address overflow bits 19:16 */ #define Index_VI6326_UV_Buf_Start_High 0xB9 /* Pitch for Y, UV Planes, unit=dword(6326 & 530/620) */ #define Index_VI6326_Disp_Y_Buf_Pitch_Low 0x8C /* 7:0 */ #define Index_VI6326_Disp_Y_Buf_Pitch_High 0x8E /* 11:8 (3:0 here) */ #define Index_VI6326_Disp_UV_Buf_Pitch_Low 0xBC /* 7:0 */ #define Index_VI6326_Disp_UV_Buf_Pitch_High 0xBD /* 11:8 (3:0 here) */ /* Scaling control registers */ #define Index_VI6326_Hor_Scale 0x92 #define Index_VI6326_Hor_Scale_Integer 0x94 #define Index_VI6326_Ver_Scale 0x93 /* Playback line buffer control */ #define Index_VI6326_Play_Threshold_Low 0x9E #define Index_VI6326_Play_Threshold_High 0x9F #define Index_VI6326_Line_Buffer_Size 0xA0 /* 530 & 6326: quad-word */ /* Destination color key */ #define Index_VI6326_Overlay_ColorKey_Red_Min 0x97 #define Index_VI6326_Overlay_ColorKey_Green_Min 0x96 #define Index_VI6326_Overlay_ColorKey_Blue_Min 0x95 #define Index_VI6326_Overlay_ColorKey_Red_Max 0xA3 #define Index_VI6326_Overlay_ColorKey_Green_Max 0xA2 #define Index_VI6326_Overlay_ColorKey_Blue_Max 0xA1 /* Source color key */ #define Index_VI6326_Overlay_ChromaKey_Red_Y_Min 0x9C #define Index_VI6326_Overlay_ChromaKey_Green_U_Min 0x9B #define Index_VI6326_Overlay_ChromaKey_Blue_V_Min 0x9A #define Index_VI6326_Overlay_ChromaKey_Red_Y_Max 0xA6 #define Index_VI6326_Overlay_ChromaKey_Green_U_Max 0xA5 #define Index_VI6326_Overlay_ChromaKey_Blue_V_Max 0xA4 /* Contrast enhancement and brightness control */ #define Index_VI6326_Contrast_Factor 0xB3 #define Index_VI6326_Brightness 0xB4 #define Index_VI6326_Contrast_Enh_Ctrl 0xB5 /* Alpha */ #define Index_VI6326_AlphaGraph 0xA7 #define Index_VI6326_AlphaVideo 0xA8 #define Index_VI6326_Key_Overlay_OP 0xA9 #define Index_VI6326_Control_Misc0 0x98 #define Index_VI6326_Control_Misc1 0x99 /* (Datasheet: 6326 ONLY - not correct?) */ #define Index_VI6326_Control_Misc3 0x9D #define Index_VI6326_Control_Misc4 0xB6 #define Index_VI6326_VideoFormatSelect Index_VI6326_Ver_Scale #define Index_VI6326_Control_Misc5 0xBE /* (Datasheet: 530/620 ONLY - not correct) */ #define Index_VI6326_Control_Misc6 0xB2 /* 5597 and 6326 only! */ /* What is this? not a register, obviously */ #define Index_VI6326_FIFO_Max 0x3F /* Bits (and helpers) for Index_VI6326_Control_Misc0 */ #define VI6326_Misc0_EnableCapture 0x01 /* 1 = on, 0 = off (6326 only) */ #define VI6326_Misc0_EnableOverlay 0x02 /* 1 = on, 0 = off */ #define VI6326_Misc0_VideoOnly 0x10 /* 1 = video only, 0 = gfx + video */ #define VI6326_Misc0_CaptureInterlace 0x20 /* 1 = capture data is interlace, 0 = not (6326 only) */ #define VI6326_Misc0_VideoFormat 0x40 /* 1 = YUV, 0 = RGB */ #define VI6326_Misc0_FieldPolarity 0x80 /* 1 = *Odd / Even, 0 = Odd / *Even (6326 only) */ /* Bits for Index_VI6326_Control_Misc1 (ALL 6326 ONLY) */ #define VI6326_Misc1_EnableYUVCapture 0x01 /* 0 = RGB, 1 = YUV */ #define VI6326_Misc1_EnableCaptureDithering 0x02 /* 0 = disable, 1 = enable */ #define VI6326_Misc1_CaptureFormat555 0x04 /* 1 = 555, 0 = 565 */ #define VI6326_Misc1_FilterModeMask 0x38 #define VI6326_Misc1_FilterMode0 0x00 /* 1 */ #define VI6326_Misc1_FilterMode1 0x08 /* 1/8(1+3z^-1+3z^-2+z^-3)*/ #define VI6326_Misc1_FilterMode2 0x10 /* 1/4(1+2z^-1+z^-2) */ #define VI6326_Misc1_FilterMode3 0x18 /* 1/2(1+z^-1) */ #define VI6326_Misc1_FilterMode4 0x20 /* 1/8(1+2z^-1+2z^-2+2z^-3+z^-4) */ #define VI6326_Misc1_EnableVBSyncIRQ 0x40 /* 1 = Enable IRQ on vertical blank */ #define VI6326_Misc1_ClearVBSyncIRQ 0x80 /* Clear pending irq */ /* Bits for Index_VI6326_Control_Misc3 */ #define VI6326_Misc3_UVCaptureFormat 0x01 /* 1 = 2's complement, 0 = CCIR 601 (6326 only) */ #define VI6326_Misc3_UVOverlayFormat 0x02 /* 1 = 2's complement, 0 = CCIR 601 */ #define VI6326_Misc3_ChromaKeyFormat 0x04 /* 1 = YUV, 0 = RGB */ #define VI6326_Misc3_VMIAccess 0x08 /* 1 = enable, 0 = disable (6326 only) */ #define VI6326_Misc3_VMIEnable 0x10 /* 1 = enable, 0 = disable (6326 only) */ #define VI6326_Misc3_VMIIRQ 0x20 /* 1 = enable, 0 = disable (6326 only) */ #define VI6326_Misc3_BT819A 0x40 /* 1 = enable, 0 = disable (6326 only) */ #define VI6326_Misc3_SystemMemFB 0x80 /* 1 = enable, 0 = disable (6326 only) */ /* Bits for Index_VI6326_Control_Misc4 */ #define VI6326_Misc4_CPUVideoFormatMask 0x03 #define VI6326_Misc4_CPUVideoFormatRGB555 0x00 #define VI6326_Misc4_CPUVideoFormatYUV422 0x01 #define VI6326_Misc4_CPUVideoFormatRGB565 0x02 #define VI6326_Misc4_EnableYUV420 0x04 /* 1 = enable, 0 = disable */ /* #define WHATISTHIS 0x40 */ /* Bits for Index_VI6326_Control_Misc5 (all 530/620 only) */ #define VI6326_Misc5_LineBufferMerge 0x10 /* 0 = disable, 1=enable */ #define VI6326_Misc5_VPlaneBit20 0x04 #define VI6326_Misc5_UPlaneBit20 0x02 /* Bits for Index_VI6326_Control_Misc6 (5597 and 6326 only) */ #define VI6326_Misc6_Decimation 0x80 /* 0=disable 1=enable video decimation */ /* Video format selection */ #define VI_6326_VideoUYVY422 0x00 #define VI_6326_VideoVYUY422 0x40 #define VI_6326_VideoYUYV422 0x80 #define VI_6326_VideoYVYU422 0xC0 #define VI_6326_VideoRGB555 0x00 #define VI_6326_VideoRGB565 0x40 /* Values for Index_VI6326_Key_Overlay_OP */ #define VI6326_ROP_Never 0x00 #define VI6326_ROP_DestKey 0x03 #define VI6326_ROP_Always 0x0F /* --- end of 6326 video registers ---------------------------------- */ /* TV register base (6326 only) */ #define Index_TV6326_TVOutIndex 0xE0 #define Index_TV6326_TVOutData 0xE1 /* mmio registers for video */ #define REG_PRIM_CRT_COUNTER 0x8514 /* MPEG MMIO registers (630 and later) ----------------------------------------- */ /* Not public (yet?) */ #endif /* SIS_REGS_H_ */ xf86-video-sis-0.10.7/src/sis_driver.h0000664000076400007640000014546611763614406014366 00000000000000/* * Global data and definitions * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * */ /* VESA */ /* The following is included because there are BIOSes out there that * report incomplete mode lists. These are 630 BIOS versions <2.01.2x * -) VBE 3.0 on SiS300 and 315 series do not support 24 fpp modes * -) Only SiS315 series support 1920x1440x32 */ static const UShort VESAModeIndices[] = { /* x y 8 16 (24) 32 */ 320, 200, 0x138, 0x10e, 0x000, 0x000, 320, 240, 0x132, 0x135, 0x000, 0x000, 400, 300, 0x133, 0x136, 0x000, 0x000, 512, 384, 0x134, 0x137, 0x000, 0x000, 640, 400, 0x100, 0x139, 0x000, 0x000, 640, 480, 0x101, 0x111, 0x000, 0x13a, 800, 600, 0x103, 0x114, 0x000, 0x13b, 1024, 768, 0x105, 0x117, 0x000, 0x13c, 1280,1024, 0x107, 0x11a, 0x000, 0x13d, 1600,1200, 0x130, 0x131, 0x000, 0x13e, 1920,1440, 0x13f, 0x140, 0x000, 0x141, 9999,9999, 0, 0, 0, 0 }; /* For calculating refresh rate index (CR33) */ static const struct _sis_vrate { CARD16 idx; CARD16 xres; CARD16 yres; CARD16 refresh; Bool SiS730valid32bpp; } sisx_vrate[] = { {1, 320, 200, 60, TRUE}, {1, 320, 200, 70, TRUE}, {1, 320, 240, 60, TRUE}, {1, 400, 300, 60, TRUE}, {1, 512, 384, 60, TRUE}, {1, 640, 400, 60, TRUE}, {1, 640, 400, 72, TRUE}, {1, 640, 480, 60, TRUE}, {2, 640, 480, 72, TRUE}, {3, 640, 480, 75, TRUE}, {4, 640, 480, 85, TRUE}, {5, 640, 480, 100, TRUE}, {6, 640, 480, 120, TRUE}, {7, 640, 480, 160, FALSE}, {8, 640, 480, 200, FALSE}, {1, 720, 480, 60, TRUE}, {1, 720, 576, 60, TRUE}, {1, 768, 576, 60, TRUE}, {1, 800, 480, 60, TRUE}, {2, 800, 480, 75, TRUE}, {3, 800, 480, 85, TRUE}, {1, 800, 600, 56, TRUE}, {2, 800, 600, 60, TRUE}, {3, 800, 600, 72, TRUE}, {4, 800, 600, 75, TRUE}, {5, 800, 600, 85, TRUE}, {6, 800, 600, 105, TRUE}, {7, 800, 600, 120, FALSE}, {8, 800, 600, 160, FALSE}, {1, 848, 480, 39, TRUE}, {2, 848, 480, 60, TRUE}, {1, 856, 480, 39, TRUE}, {2, 856, 480, 60, TRUE}, {1, 960, 540, 60, TRUE}, {1, 960, 600, 60, TRUE}, {1, 1024, 576, 60, TRUE}, {2, 1024, 576, 75, TRUE}, {3, 1024, 576, 85, TRUE}, {1, 1024, 600, 60, TRUE}, {1, 1024, 768, 43, TRUE}, {2, 1024, 768, 60, TRUE}, {3, 1024, 768, 70, FALSE}, {4, 1024, 768, 75, FALSE}, {5, 1024, 768, 85, TRUE}, {6, 1024, 768, 100, TRUE}, {7, 1024, 768, 120, TRUE}, {1, 1152, 768, 60, TRUE}, {1, 1152, 864, 60, TRUE}, {2, 1152, 864, 75, TRUE}, {3, 1152, 864, 84, FALSE}, {1, 1280, 720, 60, TRUE}, {2, 1280, 720, 75, FALSE}, {3, 1280, 720, 85, TRUE}, {1, 1280, 768, 60, TRUE}, {2, 1280, 768, 75, TRUE}, {3, 1280, 768, 85, TRUE}, {1, 1280, 800, 60, TRUE}, {2, 1280, 800, 75, TRUE}, {3, 1280, 800, 85, TRUE}, {1, 1280, 854, 60, TRUE}, {2, 1280, 854, 75, TRUE}, {3, 1280, 854, 85, TRUE}, {1, 1280, 960, 60, TRUE}, {2, 1280, 960, 85, TRUE}, {1, 1280, 1024, 43, FALSE}, {2, 1280, 1024, 60, TRUE}, {3, 1280, 1024, 75, FALSE}, {4, 1280, 1024, 85, TRUE}, {1, 1360, 768, 60, TRUE}, {1, 1400, 1050, 60, TRUE}, {2, 1400, 1050, 75, TRUE}, {1, 1600, 1200, 60, TRUE}, {2, 1600, 1200, 65, TRUE}, {3, 1600, 1200, 70, TRUE}, {4, 1600, 1200, 75, TRUE}, {5, 1600, 1200, 85, TRUE}, {6, 1600, 1200, 100, TRUE}, {7, 1600, 1200, 120, TRUE}, {1, 1680, 1050, 60, TRUE}, {1, 1920, 1080, 30, TRUE}, {1, 1920, 1440, 60, TRUE}, {2, 1920, 1440, 65, TRUE}, {3, 1920, 1440, 70, TRUE}, {4, 1920, 1440, 75, TRUE}, {5, 1920, 1440, 85, TRUE}, {6, 1920, 1440, 100, TRUE}, {1, 2048, 1536, 60, TRUE}, {2, 2048, 1536, 65, TRUE}, {3, 2048, 1536, 70, TRUE}, {4, 2048, 1536, 75, TRUE}, {5, 2048, 1536, 85, TRUE}, {0, 0, 0, 0, FALSE} }; /* Some 300-series laptops have a badly designed BIOS and make it * impossible to detect the correct panel delay compensation. This * table used to detect such machines by their PCI subsystem IDs; * however, I don't know how reliable this method is. (With Asus * machines, it is to general, ASUS uses the same ID for different * boxes) */ static const pdctable mypdctable[] = { { 0x1071, 0x7522, 32, "Mitac", "7521T" }, { 0, 0, 0, "" , "" } }; /* These machines require setting/clearing a GPIO bit for enabling/ * disabling communication with the Chrontel TV encoder */ static const chswtable mychswtable[] = { { 0x1631, 0x1002, "Mitachi", "0x1002" }, { 0x1071, 0x7521, "Mitac" , "7521P" }, { 0, 0, "" , "" } }; /* These machines require special timing/handling */ const customttable SiS_customttable[] = { { SIS_630, "2.00.07", "09/27/2002-13:38:25", 0x3240A8, { 0x220, 0x227, 0x228, 0x229, 0x0ee }, { 0x01, 0xe3, 0x9a, 0x6a, 0xef }, 0x1039, 0x6300, "Barco", "iQ R200L/300/400", CUT_BARCO1366, "BARCO_1366" }, { SIS_630, "2.00.07", "09/27/2002-13:38:25", 0x323FBD, { 0x220, 0x227, 0x228, 0x229, 0x0ee }, { 0x00, 0x5a, 0x64, 0x41, 0xef }, 0x1039, 0x6300, "Barco", "iQ G200L/300/400/500", CUT_BARCO1024, "BARCO_1024" }, { SIS_650, "", "", 0, { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x0e11, 0x083c, "Inventec (Compaq)", "3017cl/3045US", CUT_COMPAQ12802, "COMPAQ_1280" }, { SIS_650, "", "", 0, /* Special 1024x768 / dual link */ { 0x00c, 0, 0, 0, 0 }, { 'e' , 0, 0, 0, 0 }, 0x1558, 0x0287, "Clevo", "L285/L287 (Version 1)", CUT_CLEVO1024, "CLEVO_L28X_1" }, { SIS_650, "", "", 0, /* Special 1024x768 / single link */ { 0x00c, 0, 0, 0, 0 }, { 'y' , 0, 0, 0, 0 }, 0x1558, 0x0287, "Clevo", "L285/L287 (Version 2)", CUT_CLEVO10242, "CLEVO_L28X_2" }, { SIS_650, "", "", 0, /* Special 1400x1050 */ { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x1558, 0x0400, /* possibly 401 and 402 as well; not panelsize specific? */ "Clevo", "D400S/D410S/D400H/D410H", CUT_CLEVO1400, "CLEVO_D4X0" }, { SIS_650, "", "", 0, /* Shift LCD in LCD-via-CRT1 mode */ { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x1558, 0x2263, "Clevo", "D22ES/D27ES", CUT_UNIWILL1024, "CLEVO_D2X0ES" }, { SIS_650, "", "", 0, /* Shift LCD in LCD-via-CRT1 mode */ { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x1734, 0x101f, "Uniwill", "N243S9", CUT_UNIWILL1024, "UNIWILL_N243S9" }, { SIS_650, "", "", 0, /* Shift LCD in LCD-via-CRT1 mode */ { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x1584, 0x5103, "Uniwill", "N35BS1", CUT_UNIWILL10242, "UNIWILL_N35BS1" }, { SIS_650, "1.09.2c", "", /* Other versions, too? */ 0, /* Shift LCD in LCD-via-CRT1 mode */ { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x1019, 0x0f05, "ECS", "A928", CUT_UNIWILL1024, "ECS_A928" }, { SIS_740, "1.11.27a", "", 0, { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x1043, 0x1612, "Asus", "L3000D/L3500D", CUT_ASUSL3000D, "ASUS_L3X00" }, { SIS_650, "1.10.9k", "", 0, /* For EMI */ { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x1025, 0x0028, "Acer", "Aspire 1700", CUT_ACER1280, "ACER_ASPIRE1700" }, { SIS_650, "1.10.7w", "", 0, /* For EMI */ { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x14c0, 0x0012, "Compal", "??? (V1)", CUT_COMPAL1400_1, "COMPAL_1400_1" }, { SIS_650, "1.10.7x", "", /* New BIOS on its way (from BG.) */ 0, /* For EMI */ { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x14c0, 0x0012, "Compal", "??? (V2)", CUT_COMPAL1400_2, "COMPAL_1400_2" }, { SIS_650, "1.10.8o", "", 0, /* For EMI (unknown) */ { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x1043, 0x1612, "Asus", "A2H (V1)", CUT_ASUSA2H_1, "ASUS_A2H_1" }, { SIS_650, "1.10.8q", "", 0, /* For EMI */ { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0x1043, 0x1612, "Asus", "A2H (V2)", CUT_ASUSA2H_2, "ASUS_A2H_2" }, #if 0 { SIS_550, "1.02.0z", "", 0x317f37, /* 320x240 LCD panel */ { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0, 0, "AAEON", "AOP-8060", CUT_AOP8060, "AAEON_AOP_8060" }, #endif { 4321, "", "", /* never autodetected */ 0, { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0, 0, "Generic", "LVDS/Parallel 848x480", CUT_PANEL848, "PANEL848x480" }, { 4322, "", "", /* never autodetected */ 0, { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, 0, 0, "Generic", "LVDS/Parallel 856x480", CUT_PANEL856, "PANEL856x480" }, { 0, "", "", 0, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 0, 0, "", "", CUT_NONE, "" } }; /* Our TV modes for the 6326. The data in these structures * is mainly correct, but since we use our private CR and * clock values anyway, small errors do no matter. */ static DisplayModeRec SiS6326PAL800x600Mode = { NULL, NULL, /* prev, next */ "PAL800x600", /* identifier of this mode */ MODE_OK, /* mode status */ M_T_BUILTIN, /* mode type */ 36000, /* Clock frequency */ 800, /* HDisplay */ 848, /* HSyncStart */ 912, /* HSyncEnd */ 1008, /* HTotal */ 0, /* HSkew */ 600, /* VDisplay */ 600, /* VSyncStart */ 602, /* VSyncEnd */ 625, /* VTotal */ 0, /* VScan */ V_PHSYNC | V_PVSYNC, /* Flags */ -1, /* ClockIndex */ 36000, /* SynthClock */ 800, /* CRTC HDisplay */ 808, /* CRTC HBlankStart */ 848, /* CRTC HSyncStart */ 912, /* CRTC HSyncEnd */ 1008, /* CRTC HBlankEnd */ 1008, /* CRTC HTotal */ 0, /* CRTC HSkew */ 600, /* CRTC VDisplay */ 600, /* CRTC VBlankStart */ 600, /* CRTC VSyncStart */ 602, /* CRTC VSyncEnd */ 625, /* CRTC VBlankEnd */ 625, /* CRTC VTotal */ FALSE, /* CrtcHAdjusted */ FALSE, /* CrtcVAdjusted */ 0, /* PrivSize */ NULL, /* Private */ 0.0, /* HSync */ 0.0 /* VRefresh */ }; /* Due to the scaling method this mode uses, the vertical data here * does not match the CR data. But this does not matter, we use our * private CR data anyway. */ static DisplayModeRec SiS6326PAL800x600UMode = { NULL, /* prev */ &SiS6326PAL800x600Mode, /* next */ "PAL800x600U", /* identifier of this mode */ MODE_OK, /* mode status */ M_T_BUILTIN, /* mode type */ 37120, /* Clock frequency */ 800, /* HDisplay */ 872, /* HSyncStart */ 984, /* HSyncEnd */ 1088, /* HTotal */ 0, /* HSkew */ 600, /* VDisplay (548 due to scaling) */ 600, /* VSyncStart (584) */ 602, /* VSyncEnd (586) */ 625, /* VTotal */ 0, /* VScan */ V_PHSYNC | V_PVSYNC, /* Flags */ -1, /* ClockIndex */ 37120, /* SynthClock */ 800, /* CRTC HDisplay */ 808, /* CRTC HBlankStart */ 872, /* CRTC HSyncStart */ 984, /* CRTC HSyncEnd */ 1024, /* CRTC HBlankEnd */ 1088, /* CRTC HTotal */ 0, /* CRTC HSkew */ 600, /* CRTC VDisplay (548 due to scaling) */ 600, /* CRTC VBlankStart (600) */ 600, /* CRTC VSyncStart (584) */ 602, /* CRTC VSyncEnd (586) */ 625, /* CRTC VBlankEnd */ 625, /* CRTC VTotal */ FALSE, /* CrtcHAdjusted */ FALSE, /* CrtcVAdjusted */ 0, /* PrivSize */ NULL, /* Private */ 0.0, /* HSync */ 0.0 /* VRefresh */ }; static DisplayModeRec SiS6326PAL720x540Mode = { NULL, /* prev */ &SiS6326PAL800x600UMode, /* next */ "PAL720x540", /* identifier of this mode */ MODE_OK, /* mode status */ M_T_BUILTIN, /* mode type */ 36000, /* Clock frequency */ 720, /* HDisplay */ 816, /* HSyncStart */ 920, /* HSyncEnd */ 1008, /* HTotal */ 0, /* HSkew */ 540, /* VDisplay */ 578, /* VSyncStart */ 580, /* VSyncEnd */ 625, /* VTotal */ 0, /* VScan */ V_PHSYNC | V_PVSYNC, /* Flags */ -1, /* ClockIndex */ 36000, /* SynthClock */ 720, /* CRTC HDisplay */ 736, /* CRTC HBlankStart */ 816, /* CRTC HSyncStart */ 920, /* CRTC HSyncEnd */ 1008, /* CRTC HBlankEnd */ 1008, /* CRTC HTotal */ 0, /* CRTC HSkew */ 540, /* CRTC VDisplay */ 577, /* CRTC VBlankStart */ 578, /* CRTC VSyncStart */ 580, /* CRTC VSyncEnd */ 625, /* CRTC VBlankEnd */ 625, /* CRTC VTotal */ FALSE, /* CrtcHAdjusted */ FALSE, /* CrtcVAdjusted */ 0, /* PrivSize */ NULL, /* Private */ 0.0, /* HSync */ 0.0 /* VRefresh */ }; static DisplayModeRec SiS6326PAL640x480Mode = { NULL, /* prev */ &SiS6326PAL720x540Mode, /* next */ "PAL640x480", /* identifier of this mode */ MODE_OK, /* mode status */ M_T_BUILTIN, /* mode type */ 36000, /* Clock frequency */ 640, /* HDisplay */ 768, /* HSyncStart */ 920, /* HSyncEnd */ 1008, /* HTotal */ 0, /* HSkew */ 480, /* VDisplay */ 532, /* VSyncStart */ 534, /* VSyncEnd */ 625, /* VTotal */ 0, /* VScan */ V_NHSYNC | V_NVSYNC, /* Flags */ -1, /* ClockIndex */ 36000, /* SynthClock */ 640, /* CRTC HDisplay */ 648, /* CRTC HBlankStart */ 768, /* CRTC HSyncStart */ 920, /* CRTC HSyncEnd */ 944, /* CRTC HBlankEnd */ 1008, /* CRTC HTotal */ 0, /* CRTC HSkew */ 480, /* CRTC VDisplay */ 481, /* CRTC VBlankStart */ 532, /* CRTC VSyncStart */ 534, /* CRTC VSyncEnd */ 561, /* CRTC VBlankEnd */ 625, /* CRTC VTotal */ FALSE, /* CrtcHAdjusted */ FALSE, /* CrtcVAdjusted */ 0, /* PrivSize */ NULL, /* Private */ 0.0, /* HSync */ 0.0 /* VRefresh */ }; static DisplayModeRec SiS6326NTSC640x480Mode = { NULL, NULL, /* prev, next */ "NTSC640x480", /* identifier of this mode */ MODE_OK, /* mode status */ M_T_BUILTIN, /* mode type */ 27000, /* Clock frequency */ 640, /* HDisplay */ 664, /* HSyncStart */ 760, /* HSyncEnd */ 800, /* HTotal */ 0, /* HSkew */ 480, /* VDisplay */ 489, /* VSyncStart */ 491, /* VSyncEnd */ 525, /* VTotal */ 0, /* VScan */ V_NHSYNC | V_NVSYNC, /* Flags */ -1, /* ClockIndex */ 27000, /* SynthClock */ 640, /* CRTC HDisplay */ 648, /* CRTC HBlankStart */ 664, /* CRTC HSyncStart */ 760, /* CRTC HSyncEnd */ 792, /* CRTC HBlankEnd */ 800, /* CRTC HTotal */ 0, /* CRTC HSkew */ 480, /* CRTC VDisplay */ 488, /* CRTC VBlankStart */ 489, /* CRTC VSyncStart */ 491, /* CRTC VSyncEnd */ 517, /* CRTC VBlankEnd */ 525, /* CRTC VTotal */ FALSE, /* CrtcHAdjusted */ FALSE, /* CrtcVAdjusted */ 0, /* PrivSize */ NULL, /* Private */ 0.0, /* HSync */ 0.0 /* VRefresh */ }; /* Due to the scaling method this mode uses, the vertical data here * does not match the CR data. But this does not matter, we use our * private CR data anyway. */ static DisplayModeRec SiS6326NTSC640x480UMode = { NULL, /* prev */ &SiS6326NTSC640x480Mode, /* next */ "NTSC640x480U", /* identifier of this mode */ MODE_OK, /* mode status */ M_T_BUILTIN, /* mode type */ 32215, /* Clock frequency */ 640, /* HDisplay */ 696, /* HSyncStart */ 840, /* HSyncEnd */ 856, /* HTotal */ 0, /* HSkew */ 480, /* VDisplay (439 due to scaling) */ 489, /* VSyncStart (473) */ 491, /* VSyncEnd (475) */ 525, /* VTotal */ 0, /* VScan */ V_NHSYNC | V_NVSYNC, /* Flags */ -1, /* ClockIndex */ 32215, /* SynthClock */ 640, /* CRTC HDisplay */ 656, /* CRTC HBlankStart */ 696, /* CRTC HSyncStart */ 840, /* CRTC HSyncEnd */ 856, /* CRTC HBlankEnd */ 856, /* CRTC HTotal */ 0, /* CRTC HSkew */ 480, /* CRTC VDisplay */ 488, /* CRTC VBlankStart */ 489, /* CRTC VSyncStart */ 491, /* CRTC VSyncEnd */ 517, /* CRTC VBlankEnd */ 525, /* CRTC VTotal */ FALSE, /* CrtcHAdjusted */ FALSE, /* CrtcVAdjusted */ 0, /* PrivSize */ NULL, /* Private */ 0.0, /* HSync */ 0.0 /* VRefresh */ }; static DisplayModeRec SiS6326NTSC640x400Mode = { NULL, /* prev */ &SiS6326NTSC640x480UMode, /* next */ "NTSC640x400", /* identifier of this mode */ MODE_OK, /* mode status */ M_T_BUILTIN, /* mode type */ 27000, /* Clock frequency */ 640, /* HDisplay */ 664, /* HSyncStart */ 760, /* HSyncEnd */ 800, /* HTotal */ 0, /* HSkew */ 400, /* VDisplay */ 459, /* VSyncStart */ 461, /* VSyncEnd */ 525, /* VTotal */ 0, /* VScan */ V_NHSYNC | V_NVSYNC, /* Flags */ -1, /* ClockIndex */ 27000, /* SynthClock */ 640, /* CRTC HDisplay */ 648, /* CRTC HBlankStart */ 664, /* CRTC HSyncStart */ 760, /* CRTC HSyncEnd */ 792, /* CRTC HBlankEnd */ 800, /* CRTC HTotal */ 0, /* CRTC HSkew */ 400, /* CRTC VDisplay */ 407, /* CRTC VBlankStart */ 459, /* CRTC VSyncStart */ 461, /* CRTC VSyncEnd */ 490, /* CRTC VBlankEnd */ 525, /* CRTC VTotal */ FALSE, /* CrtcHAdjusted */ FALSE, /* CrtcVAdjusted */ 0, /* PrivSize */ NULL, /* Private */ 0.0, /* HSync */ 0.0 /* VRefresh */ }; /* Built-in hi-res modes for the 6326. * For some reason, our default mode lines and the * clock calculation functions in sis_dac.c do no * good job on higher clocks. It seems, the hardware * needs some tricks so make mode with higher clock * rates than ca. 120MHz work. I didn't bother trying * to find out what exactly is going wrong, so I * implemented two special modes instead for 1280x1024 * and 1600x1200. These two are automatically added * to the list if they are supported with the current * depth. * The data in the strucures below is a proximation, * in sis_vga.c the register contents are fetched from * fixed tables anyway. */ static DisplayModeRec SiS6326SIS1280x1024_75Mode = { NULL, /* prev */ NULL, /* next */ "SIS1280x1024-75", /* identifier of this mode */ MODE_OK, /* mode status */ M_T_BUILTIN, /* mode type */ 135000, /* Clock frequency */ 1280, /* HDisplay */ 1296, /* HSyncStart */ 1440, /* HSyncEnd */ 1688, /* HTotal */ 0, /* HSkew */ 1024, /* VDisplay */ 1025, /* VSyncStart */ 1028, /* VSyncEnd */ 1066, /* VTotal */ 0, /* VScan */ V_PHSYNC | V_PVSYNC, /* Flags */ -1, /* ClockIndex */ 135000, /* SynthClock */ 1280, /* CRTC HDisplay */ 1280, /* CRTC HBlankStart */ 1296, /* CRTC HSyncStart */ 1440, /* CRTC HSyncEnd */ 1680, /* CRTC HBlankEnd */ 1688, /* CRTC HTotal */ 0, /* CRTC HSkew */ 1024, /* CRTC VDisplay */ 1024, /* CRTC VBlankStart */ 1025, /* CRTC VSyncStart */ 1028, /* CRTC VSyncEnd */ 1065, /* CRTC VBlankEnd */ 1066, /* CRTC VTotal */ FALSE, /* CrtcHAdjusted */ FALSE, /* CrtcVAdjusted */ 0, /* PrivSize */ NULL, /* Private */ 0.0, /* HSync */ 0.0 /* VRefresh */ }; static DisplayModeRec SiS6326SIS1600x1200_60Mode = { NULL, /* prev */ NULL, /* next */ "SIS1600x1200-60", /* identifier of this mode */ MODE_OK, /* mode status */ M_T_BUILTIN, /* mode type */ 162000, /* Clock frequency */ 1600, /* HDisplay */ 1664, /* HSyncStart */ 1856, /* HSyncEnd */ 2160, /* HTotal */ 0, /* HSkew */ 1200, /* VDisplay */ 1201, /* VSyncStart */ 1204, /* VSyncEnd */ 1250, /* VTotal */ 0, /* VScan */ V_PHSYNC | V_PVSYNC, /* Flags */ -1, /* ClockIndex */ 162000, /* SynthClock */ 1600, /* CRTC HDisplay */ 1600, /* CRTC HBlankStart */ 1664, /* CRTC HSyncStart */ 1856, /* CRTC HSyncEnd */ 2152, /* CRTC HBlankEnd */ 2160, /* CRTC HTotal */ 0, /* CRTC HSkew */ 1200, /* CRTC VDisplay */ 1200, /* CRTC VBlankStart */ 1201, /* CRTC VSyncStart */ 1204, /* CRTC VSyncEnd */ 1249, /* CRTC VBlankEnd */ 1250, /* CRTC VTotal */ FALSE, /* CrtcHAdjusted */ FALSE, /* CrtcVAdjusted */ 0, /* PrivSize */ NULL, /* Private */ 0.0, /* HSync */ 0.0 /* VRefresh */ }; /* TV scaling data for SiS video bridges */ typedef struct _SiSTVVScale { UShort ScaleVDE; int sindex; UShort RealVDE; UShort reg[4]; } MySiSTVVScale, *MySiSTVVScalePtr; static const MySiSTVVScale SiSTVVScale[] = { { 470, 3, 480, /* NTSC 640x480 */ { 893, 508, 0x004c, 0x008f } }, { 460, 2, 480, { 874, 513, 0x004c, 0x008f } }, { 450, 1, 480, { 855, 518, 0x004c, 0x008f } }, { 440, 0, 480, /* default */ { 836, 523, 0x004c, 0x008f } }, { 430, -1, 480, { 860, 528, 0x0050, 0x008f } }, { 420, -2, 480, { 840, 533, 0x0050, 0x008f } }, { 410, -3, 480, { 820, 538, 0x0050, 0x008f } }, { 470, 3, 480, /* NTSC 720x480 */ { 893, 509, 0x004c, 0x008f } }, { 460, 2, 480, { 874, 514, 0x004c, 0x008f } }, { 450, 1, 480, { 855, 519, 0x004c, 0x008f } }, { 440, 0, 480, /* default */ { 836, 524, 0x004c, 0x008f } }, { 430, -1, 480, { 860, 529, 0x0050, 0x008f } }, { 420, -2, 480, { 840, 534, 0x0050, 0x008f } }, { 410, -3, 480, { 820, 539, 0x0050, 0x008f } }, { 470, 3, 600, /* NTSC 800x600 */ { 1081, 628, 0x0073, 0x008f } }, { 460, 2, 600, { 1058, 633, 0x0073, 0x008f } }, { 450, 1, 600, { 1044, 638, 0x0074, 0x008f } }, { 440, 0, 600, /* default */ { 1056, 643, 0x0078, 0x008f } }, { 430, -1, 600, { 1032, 648, 0x0078, 0x008f } }, { 420, -2, 600, { 1008, 653, 0x0078, 0x008f } }, { 410, -3, 600, { 1066, 658, 0x0082, 0x008f } }, { 560, 3, 480, /* PAL 640x480 */ { 882, 513, 0x0007, 0x0010 } }, { 550, 2, 480, { 900, 518, 0x0005, 0x000b } }, { 540, 1, 480, { 864, 523, 0x0004, 0x0009 } }, { 530, 0, 480, /* default */ { 848, 528, 0x0004, 0x0009 } }, { 520, -1, 480, { 832, 533, 0x0004, 0x0009 } }, { 510, -2, 480, { 918, 538, 0x0001, 0x0002 } }, { 500, -3, 480, { 900, 543, 0x0001, 0x0002 } }, { 560, 2, 576, /* PAL 720x576 */ { 960, 610, 0x0004, 0x0007 } }, { 550, 1, 576, { 990, 614, 0x0003, 0x0005 } }, { 540, 0, 576, /* default */ { 1080, 620, 0x0002, 0x0003 } }, { 530, -1, 576, { 1060, 625, 0x8002, 0x0003 } }, { 520, -2, 576, { 1040, 630, 0x0002, 0x0003 } }, { 510, -3, 576, { 1020, 635, 0x0002, 0x0003 } }, { 500, -4, 576, { 1000, 640, 0x0002, 0x0003 } }, { 560, 3, 600, /* PAL 800x600 */ { 1152, 633, 0x0005, 0x0007 } }, { 550, 2, 600, { 1100, 638, 0x0019, 0x0024 } }, { 540, 1, 600, { 1080, 643, 0x0019, 0x0024 } }, { 530, 0, 600, /* default */ { 1060, 648, 0x0019, 0x0024 } }, { 520, -1, 600, { 1040, 653, 0x0019, 0x0024 } }, { 510, -2, 600, { 1020, 658, 0x0019, 0x0024 } }, { 500, -3, 600, { 1080, 663, 0x0003, 0x0004 } }, { 720, 3, 480, /* 750p 640x480 (42) */ { 1238, 500, 0x0001, 0x0002 } }, { 693, 2, 480, { 1191, 519, 0x0001, 0x0002 } }, { 667, 1, 480, { 1146, 540, 0x0001, 0x0002 } }, { 640, 0, 480, { 1100, 563, 0x0001, 0x0002 } }, { 613, -1, 480, { 1054, 587, 0x0001, 0x0002 } }, { 587, -2, 480, { 1009, 613, 0x0001, 0x0002 } }, { 560, -3, 480, { 963, 643, 0x0001, 0x0002 } }, { 720, 3, 480, /* 750p 720x480 (49) */ { 1238, 500, 0x0001, 0x0002 } }, { 693, 2, 480, { 1191, 519, 0x0001, 0x0002 } }, { 667, 1, 480, { 1146, 540, 0x0001, 0x0002 } }, { 640, 0, 480, { 1100, 563, 0x0001, 0x0002 } }, { 613, -1, 480, { 1054, 587, 0x0001, 0x0002 } }, { 587, -2, 480, { 1009, 613, 0x0001, 0x0002 } }, { 560, -3, 480, { 963, 643, 0x0001, 0x0002 } }, { 720, 3, 576, /* 750p 720/768x576 (56) */ { 1238, 600, 0x0003, 0x0005 } }, { 693, 2, 576, { 1191, 623, 0x0003, 0x0005 } }, { 667, 1, 576, { 1146, 648, 0x0003, 0x0005 } }, { 640, 0, 576, { 1100, 675, 0x0003, 0x0005 } }, { 613, -1, 576, { 1054, 705, 0x0003, 0x0005 } }, { 587, -2, 576, { 1009, 736, 0x0003, 0x0005 } }, { 560, -3, 576, { 963, 771, 0x0003, 0x0005 } }, { 720, 3, 480, /* 750p 800x480 (63) */ { 1238, 500, 0x0001, 0x0002 } }, { 693, 2, 480, { 1191, 519, 0x0001, 0x0002 } }, { 667, 1, 480, { 1146, 540, 0x0001, 0x0002 } }, { 640, 0, 480, { 1100, 563, 0x0001, 0x0002 } }, { 613, -1, 480, { 1054, 587, 0x0001, 0x0002 } }, { 587, -2, 480, { 1009, 613, 0x0001, 0x0002 } }, { 560, -3, 480, { 963, 643, 0x0001, 0x0002 } }, { 720, 3, 600, /* 750p 800x600 (70) */ { 1320, 625, 0x0002, 0x0003 } }, { 700, 2, 600, { 1283, 643, 0x0002, 0x0003 } }, { 680, 1, 600, { 1247, 662, 0x0002, 0x0003 } }, { 660, 0, 600, { 1210, 682, 0x0002, 0x0003 } }, { 640, -1, 600, { 1173, 703, 0x0002, 0x0003 } }, { 620, -2, 600, { 1137, 726, 0x0002, 0x0003 } }, { 600, -3, 600, { 1100, 750, 0x0002, 0x0003 } }, { 720, 3, 576, /* 750p 1024x576 (77) */ { 1238, 600, 0x0003, 0x0005 } }, { 693, 2, 576, { 1191, 623, 0x0003, 0x0005 } }, { 667, 1, 576, { 1146, 648, 0x0003, 0x0005 } }, { 640, 0, 576, { 1100, 675, 0x0003, 0x0005 } }, { 630, -1, 576, { 1083, 686, 0x0003, 0x0005 } }, { 620, -2, 576, { 1066, 697, 0x0003, 0x0005 } }, { 616, -3, 576, { 1059, 701, 0x0003, 0x0005 } }, { 720, 3, 768, /* 750p 1024x768 (84) */ { 1547, 800, 0x0001, 0x0001 } }, { 693, 2, 768, { 1489, 831, 0x0001, 0x0001 } }, { 667, 1, 768, { 1433, 864, 0x0001, 0x0001 } }, { 640, 0, 768, { 1375, 900, 0x0001, 0x0001 } }, { 613, -1, 768, { 1317, 940, 0x0001, 0x0001 } }, { 587, -2, 768, { 1261, 981, 0x0001, 0x0001 } }, { 560, -3, 768, { 1203, 1029, 0x0001, 0x0001 } }, #ifdef OLD1280720P { 720, 3, 720, /* 750p 1280x720-old (91) */ { 1584, 750, 0x0018, 0x0019 } }, { 707, 2, 720, { 1555, 764, 0x0018, 0x0019 } }, { 693, 1, 720, { 1525, 779, 0x0018, 0x0019 } }, { 680, 0, 720, { 1496, 794, 0x0018, 0x0019 } }, { 667, -1, 720, { 1467, 810, 0x0018, 0x0019 } }, { 653, -2, 720, { 1437, 827, 0x0018, 0x0019 } }, { 640, -3, 720, { 1408, 844, 0x0018, 0x0019 } }, #endif #ifndef OLD1280720P { 720, 3, 720, /* 750p 1280x720-new (91) */ { 1650, 750, 0x0001, 0x0001 } }, { 720, 2, 720, { 1650, 750, 0x0001, 0x0001 } }, { 720, 1, 720, { 1650, 750, 0x0001, 0x0001 } }, { 720, 0, 720, { 1650, 750, 0x0001, 0x0001 } }, { 704, -1, 720, { 1613, 767, 0x0001, 0x0001 } }, { 688, -2, 720, { 1577, 785, 0x0001, 0x0001 } }, { 672, -3, 720, { 1540, 804, 0x0001, 0x0001 } }, #endif { 1080, 3, 480, /* 1080i 640x480 (98) */ { 945, 500, 0x8001, 0x0005 } }, { 1040, 2, 480, { 910, 519, 0x8001, 0x0005 } }, { 1000, 1, 480, { 875, 540, 0x8001, 0x0005 } }, { 960, 0, 480, { 840, 563, 0x8001, 0x0005 } }, { 920, -1, 480, { 805, 587, 0x8001, 0x0005 } }, { 880, -2, 480, { 770, 614, 0x8001, 0x0005 } }, { 840, -3, 480, { 735, 643, 0x8001, 0x0005 } }, { 1080, 3, 480, /* 1080i 800x480 (105) */ { 1181, 500, 0x8001, 0x0004 } }, { 1040, 2, 480, { 1138, 519, 0x8001, 0x0004 } }, { 1000, 1, 480, { 1094, 540, 0x8001, 0x0004 } }, { 960, 0, 480, { 1050, 563, 0x8001, 0x0004 } }, { 920, -1, 480, { 1006, 587, 0x8001, 0x0004 } }, { 880, -2, 480, { 963, 614, 0x8001, 0x0004 } }, { 840, -3, 480, { 919, 643, 0x8001, 0x0004 } }, { 1080, 3, 600, /* 1080i 800x600 (112) */ { 1181, 625, 0x8005, 0x0010 } }, { 1040, 2, 600, { 1138, 649, 0x8005, 0x0010 } }, { 1000, 1, 600, { 1094, 675, 0x8005, 0x0010 } }, { 960, 0, 600, { 1050, 703, 0x8005, 0x0010 } }, { 920, -1, 600, { 1006, 734, 0x8005, 0x0010 } }, { 880, -2, 600, { 963, 767, 0x8005, 0x0010 } }, { 840, -3, 600, { 919, 804, 0x8005, 0x0010 } }, { 1080, 3, 576, /* 1080i 1024x576 (119) */ { 1575, 600, 0x0002, 0x0005 } }, { 1040, 2, 576, { 1517, 623, 0x0002, 0x0005 } }, { 1000, 1, 576, { 1458, 648, 0x0002, 0x0005 } }, { 960, 0, 576, { 1400, 675, 0x0002, 0x0005 } }, { 920, -1, 576, { 1342, 704, 0x0002, 0x0005 } }, { 880, -2, 576, { 1283, 736, 0x0002, 0x0005 } }, { 840, -3, 576, { 1225, 771, 0x0002, 0x0005 } }, { 1080, 3, 768, /* 1080i 1024x768 (126) */ { 1418, 800, 0x000c, 0x0019 } }, { 1040, 2, 768, { 1365, 831, 0x000c, 0x0019 } }, { 1000, 1, 768, { 1313, 864, 0x000c, 0x0019 } }, { 960, 0, 768, { 1260, 900, 0x000c, 0x0019 } }, { 920, -1, 768, { 1208, 939, 0x000c, 0x0019 } }, { 880, -2, 768, { 1155, 982, 0x000c, 0x0019 } }, { 840, -3, 768, { 1103, 1029, 0x000c, 0x0019 } }, { 1080, 3, 720, /* 1080i 1280x720 (133) */ { 1969, 750, 0x0005, 0x0008 } }, { 1040, 2, 720, { 1896, 779, 0x0005, 0x0008 } }, { 1000, 1, 720, { 1823, 810, 0x0005, 0x0008 } }, { 960, 0, 720, { 1750, 844, 0x0005, 0x0008 } }, { 920, -1, 720, { 1677, 880, 0x0005, 0x0008 } }, { 880, -2, 720, { 1604, 920, 0x0005, 0x0008 } }, { 840, -3, 720, { 1531, 964, 0x0005, 0x0008 } }, { 1080, 3, 1024, /* 1080i 1280x1024 (140) */ { 1772, 1067, 0x0004, 0x0005 } }, { 1040, 2, 1024, { 1706, 1108, 0x0004, 0x0005 } }, { 1000, 1, 1024, { 1641, 1152, 0x0004, 0x0005 } }, { 960, 0, 1024, { 1575, 1200, 0x0004, 0x0005 } }, { 920, -1, 1024, { 1509, 1252, 0x0004, 0x0005 } }, { 880, -2, 1024, { 1444, 1309, 0x0004, 0x0005 } }, { 840, -3, 1024, { 1378, 1371, 0x0004, 0x0005 } }, { 470, 3, 576, /* NTSC 720x576 (147) */ { 1175, 602, 0x8078, 0x008f } }, { 460, 2, 576, { 1150, 614, 0x8078, 0x008f } }, { 450, 1, 576, { 1125, 628, 0x8078, 0x008f } }, { 440, 0, 576, { 1100, 643, 0x8078, 0x008f } }, { 430, -1, 576, { 1075, 658, 0x8078, 0x008f } }, { 420, -2, 576, { 1050, 673, 0x8078, 0x008f } }, { 410, -3, 576, { 1025, 680, 0x8078, 0x008f } }, { 550, 3, 768, /* PAL 1024x768 (154) */ { 1238, 776, 0x0001, 0x0001 } }, { 540, 2, 768, { 1215, 790, 0x0001, 0x0001 } }, { 530, 1, 768, { 1193, 805, 0x0001, 0x0001 } }, { 520, 0, 768, { 1170, 821, 0x0001, 0x0001 } }, { 510, -1, 768, { 1148, 837, 0x0001, 0x0001 } }, { 500, -2, 768, { 1125, 853, 0x0001, 0x0001 } }, { 490, -3, 768, { 1103, 871, 0x0001, 0x0001 } }, { 470, 3, 768, /* NTSC 1024 i (161) */ { 1175, 759, 0x8001, 0x0001 } }, { 460, 2, 768, { 1150, 775, 0x8001, 0x0001 } }, { 450, 1, 768, { 1125, 792, 0x8001, 0x0001 } }, { 440, 0, 768, { 1100, 811, 0x8001, 0x0001 } }, { 430, -1, 768, { 1075, 829, 0x8001, 0x0001 } }, { 430, -2, 768, { 1075, 829, 0x8001, 0x0001 } }, { 430, -3, 768, { 1075, 829, 0x8001, 0x0001 } }, { 470, 3, 768, /* NTSC 1024 p (168) */ { 1175, 792, 0x0001, 0x0001 } }, { 460, 2, 768, { 1150, 809, 0x0001, 0x0001 } }, { 450, 1, 768, { 1125, 827, 0x0001, 0x0001 } }, { 440, 0, 768, { 1100, 846, 0x0001, 0x0001 } }, { 430, -1, 768, { 1075, 865, 0x0001, 0x0001 } }, { 430, -2, 768, { 1075, 865, 0x0001, 0x0001 } }, { 430, -3, 768, { 1075, 865, 0x0001, 0x0001 } }, { 470, 3, 480, /* NTSC 800x480 (175) */ { 893, 509, 0x004c, 0x008f } }, { 460, 2, 480, { 874, 514, 0x004c, 0x008f } }, { 450, 1, 480, { 855, 519, 0x004c, 0x008f } }, { 440, 0, 480, /* default */ { 836, 524, 0x004c, 0x008f } }, { 430, -1, 480, { 860, 529, 0x0050, 0x008f } }, { 420, -2, 480, { 840, 534, 0x0050, 0x008f } }, { 420, -3, 480, { 840, 534, 0x0050, 0x008f } }, { 470, 3, 576, /* NTSC 1024x576 (182) */ { 1175, 602, 0x8078, 0x008f } }, { 460, 2, 576, { 1150, 614, 0x8078, 0x008f } }, { 450, 1, 576, { 1125, 628, 0x8078, 0x008f } }, { 440, 0, 576, { 1100, 643, 0x8078, 0x008f } }, { 430, -1, 576, { 1075, 658, 0x8078, 0x008f } }, { 430, -2, 576, { 1075, 658, 0x8078, 0x008f } }, { 430, -3, 576, { 1075, 658, 0x8078, 0x008f } }, { 564, 3, 576, /* PAL 1024x576 (189) */ { 1128, 592, 0x0002, 0x0003 } }, { 556, 2, 576, { 1112, 601, 0x0002, 0x0003 } }, { 548, 1, 576, { 1096, 610, 0x0002, 0x0003 } }, { 540, 0, 576, { 1080, 619, 0x0002, 0x0003 } }, { 532, -1, 576, { 1064, 628, 0x0002, 0x0003 } }, { 532, -2, 576, { 1064, 628, 0x0002, 0x0003 } }, { 532, -3, 576, { 1064, 628, 0x0002, 0x0003 } }, { 1080, 3, 540, /* 1080i 960x540 (196) */ { 1050, 600, 0x0001, 0x0004 } }, { 1080, 2, 540, { 1050, 600, 0x0001, 0x0004 } }, { 1080, 1, 540, { 1050, 600, 0x0001, 0x0004 } }, { 1080, 0, 540, { 1050, 600, 0x0001, 0x0004 } }, { 1040, -1, 540, { 1011, 623, 0x0001, 0x0004 } }, { 1000, -2, 540, { 1944, 648, 0x0001, 0x0002 } }, { 960, -3, 540, { 1866, 675, 0x0001, 0x0002 } }, { 1080, 3, 600, /* 1080i 960x600 (203) */ { 1418, 670, 0x0003, 0x0008 } }, { 1040, 2, 600, { 1365, 700, 0x0003, 0x0008 } }, { 1000, 1, 600, { 1313, 816, 0x0003, 0x0008 } }, { 960, 0, 600, { 1260, 851, 0x0003, 0x0008 } }, { 920, -1, 600, { 1208, 887, 0x0003, 0x0008 } }, { 880, -2, 600, { 1155, 928, 0x0003, 0x0008 } }, { 840, -3, 600, { 1103, 972, 0x0003, 0x0008 } } }; static unsigned const char SiSScalingP1Regs[] = { 0x08,0x09,0x0b,0x0c,0x0d,0x0e,0x10,0x11,0x12 }; static unsigned const char SiSScalingP4Regs[] = { 0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b }; /* TV filters for SiS video bridges */ static const struct _SiSTVFilter301 { UChar filter[7][4]; } SiSTVFilter301[] = { {{ {0x00,0xE0,0x10,0x60}, /* NTSCFilter - 320 */ {0x00,0xEE,0x10,0x44}, {0x00,0xF4,0x10,0x38}, {0xF8,0xF4,0x18,0x38}, {0xFC,0xFB,0x14,0x2A}, {0x00,0x00,0x10,0x20}, {0x00,0x04,0x10,0x18} }}, {{ {0xF5,0xEE,0x1B,0x44}, /* NTSCFilter - 640 */ {0xF8,0xF4,0x18,0x38}, {0xEB,0x04,0x25,0x18}, {0xF1,0x05,0x1F,0x16}, {0xF6,0x06,0x1A,0x14}, {0xFA,0x06,0x16,0x14}, {0x00,0x04,0x10,0x18} }}, {{ {0xEB,0x04,0x25,0x18}, /* NTSCFilter - 720 */ {0xE7,0x0E,0x29,0x04}, {0xEE,0x0C,0x22,0x08}, {0xF6,0x0B,0x1A,0x0A}, {0xF9,0x0A,0x17,0x0C}, {0xFC,0x0A,0x14,0x0C}, {0x00,0x08,0x10,0x10} }}, {{ {0xEC,0x02,0x24,0x1C}, /* NTSCFilter - 800/400 */ {0xF2,0x04,0x1E,0x18}, {0xEB,0x15,0x25,0xF6}, {0xF4,0x10,0x1C,0x00}, {0xF8,0x0F,0x18,0x02}, {0x00,0x04,0x10,0x18}, {0x01,0x06,0x0F,0x14} }}, {{ {0x00,0xE0,0x10,0x60}, /* PALFilter - 320 */ {0x00,0xEE,0x10,0x44}, {0x00,0xF4,0x10,0x38}, {0xF8,0xF4,0x18,0x38}, {0xFC,0xFB,0x14,0x2A}, {0x00,0x00,0x10,0x20}, {0x00,0x04,0x10,0x18} }}, {{ {0xF5,0xEE,0x1B,0x44}, /* PALFilter - 640 */ {0xF8,0xF4,0x18,0x38}, {0xF1,0xF7,0x1F,0x32}, {0xF5,0xFB,0x1B,0x2A}, {0xF9,0xFF,0x17,0x22}, {0xFB,0x01,0x15,0x1E}, {0x00,0x04,0x10,0x18} }}, {{ {0xF5,0xEE,0x1B,0x2A}, /* PALFilter - 720 */ {0xEE,0xFE,0x22,0x24}, {0xF3,0x00,0x1D,0x20}, {0xF9,0x03,0x17,0x1A}, {0xFB,0x02,0x14,0x1E}, {0xFB,0x04,0x15,0x18}, {0x00,0x06,0x10,0x14} }}, {{ {0xF5,0xEE,0x1B,0x44}, /* PALFilter - 800/400 */ {0xF8,0xF4,0x18,0x38}, {0xFC,0xFB,0x14,0x2A}, {0xEB,0x05,0x25,0x16}, {0xF1,0x05,0x1F,0x16}, {0xFA,0x07,0x16,0x12}, {0x00,0x07,0x10,0x12} }} }; static const struct _SiSTVFilter301B { UChar filter[7][7]; } SiSTVFilter301B[] = { {{ {0x01,0x02,0xfb,0xf8,0x06,0x27,0x3a}, /* NTSC - 640 */ {0x01,0x02,0xfe,0xf7,0x03,0x27,0x3c}, {0x01,0x01,0x00,0xf6,0x00,0x28,0x40}, {0xff,0x03,0x02,0xf6,0xfc,0x27,0x46}, {0xff,0x01,0x04,0xf8,0xfa,0x27,0x46}, {0xff,0x01,0x05,0xf9,0xf7,0x26,0x4a}, {0xff,0xff,0x05,0xfc,0xf4,0x24,0x52} }}, {{ {0x01,0x00,0xfb,0xfb,0x0b,0x25,0x32}, /* NTSC - 720 (?) */ {0x01,0x01,0xfb,0xf9,0x09,0x26,0x36}, {0x01,0x02,0xfc,0xf8,0x06,0x27,0x38}, {0x01,0x02,0xfe,0xf7,0x03,0x27,0x3c}, {0x01,0x03,0xff,0xf6,0x00,0x27,0x40}, {0xff,0x03,0x02,0xf6,0xfe,0x27,0x42}, {0xff,0x02,0x03,0xf7,0xfb,0x27,0x46} }}, {{ {0x01,0xfe,0xfb,0xfe,0x0e,0x23,0x2e}, /* NTSC - 800 */ {0x01,0xff,0xfb,0xfc,0x0c,0x25,0x30}, {0x01,0x00,0xfb,0xfa,0x0a,0x26,0x34}, {0x01,0x01,0xfc,0xf8,0x08,0x26,0x38}, {0x01,0x02,0xfd,0xf7,0x06,0x27,0x38}, {0x01,0x02,0xfe,0xf7,0x03,0x27,0x3c}, {0xff,0x03,0x00,0xf6,0x00,0x27,0x42} }}, {{ {0xff,0xfd,0xfe,0x05,0x11,0x1e,0x24}, /* NTSC - 1024 */ {0xff,0xfd,0xfd,0x04,0x11,0x1f,0x26}, {0xff,0xfd,0xfc,0x02,0x10,0x22,0x28}, {0xff,0xff,0xfc,0x00,0x0f,0x22,0x28}, {0x01,0xfe,0xfb,0xff,0x0e,0x23,0x2c}, {0x01,0xff,0xfb,0xfd,0x0d,0x24,0x2e}, {0x01,0xff,0xfb,0xfb,0x0c,0x25,0x32} }}, {{ {0x01,0x02,0xfb,0xf8,0x06,0x27,0x3a}, /* PAL - 640 */ {0x01,0x02,0xfe,0xf7,0x03,0x27,0x3c}, {0x01,0x01,0x00,0xf6,0x00,0x28,0x40}, {0xff,0x03,0x02,0xf6,0xfc,0x27,0x46}, {0xff,0x01,0x04,0xf8,0xfa,0x27,0x46}, {0xff,0x01,0x05,0xf9,0xf7,0x26,0x4a}, {0xff,0xff,0x05,0xfc,0xf4,0x24,0x52} }}, {{ {0x01,0x00,0xfb,0xfb,0x0b,0x25,0x32}, /* PAL - 720/768 */ {0x01,0x01,0xfb,0xf9,0x09,0x26,0x36}, {0x01,0x02,0xfc,0xf8,0x06,0x27,0x38}, {0x01,0x02,0xfe,0xf7,0x03,0x27,0x3c}, {0x01,0x03,0xff,0xf6,0x00,0x27,0x40}, {0xff,0x03,0x02,0xf6,0xfe,0x27,0x42}, {0xff,0x02,0x03,0xf7,0xfb,0x27,0x46} }}, {{ {0x01,0xfe,0xfb,0xfe,0x0e,0x23,0x2e}, /* PAL - 800 */ {0x01,0xff,0xfb,0xfc,0x0c,0x25,0x30}, {0x01,0x00,0xfb,0xfa,0x0a,0x26,0x34}, {0x01,0x01,0xfc,0xf8,0x08,0x26,0x38}, {0x01,0x02,0xfd,0xf7,0x06,0x27,0x38}, {0x01,0x02,0xfe,0xf7,0x03,0x27,0x3c}, {0xff,0x03,0x00,0xf6,0x00,0x27,0x42} }}, {{ {0xff,0xfd,0xfe,0x05,0x11,0x1e,0x24}, /* PAL - 1024 */ {0xff,0xfd,0xfd,0x04,0x11,0x1f,0x26}, {0xff,0xfd,0xfc,0x02,0x10,0x22,0x28}, {0xff,0xff,0xfc,0x00,0x0f,0x22,0x28}, {0x01,0xfe,0xfb,0xff,0x0e,0x23,0x2c}, {0x01,0xff,0xfb,0xfd,0x0d,0x24,0x2e}, {0x01,0xff,0xfb,0xfb,0x0c,0x25,0x32} }}, {{ {0x54,0x69,0x6c,0x6c,0x20,0x53,0x6f}, /* PAL-M - 1024 */ {0x66,0x69,0x61,0x20,0x42,0x65,0x72}, {0x6e,0x74,0x73,0x73,0x6f,0x6e,0x20}, {0x2d,0x20,0x42,0x72,0x6f,0x75,0x67}, {0x68,0x74,0x20,0x74,0x6f,0x20,0x79}, {0x6f,0x75,0x20,0x62,0x79,0x20,0x6e}, {0x6f,0x74,0x20,0x61,0x20,0x6d,0x65,} }}, {{ {0x72,0x65,0x20,0x57,0x69,0x7a,0x61}, /* PAL-N - 1024 */ {0x72,0x64,0x20,0x62,0x75,0x74,0x20}, {0x74,0x68,0x65,0x20,0x57,0x69,0x7a}, {0x61,0x72,0x64,0x20,0x45,0x78,0x74}, {0x72,0x61,0x6f,0x72,0x64,0x69,0x6e}, {0x61,0x69,0x72,0x65,0x21,0x20,0x48}, {0x69,0x20,0x44,0x61,0x6c,0x65,0x21} }} }; /* For communication with the SiS Linux framebuffer driver (sisfb) */ /* ioctl for identifying and giving some info (esp. memory heap start) */ #define SISFB_GET_INFO_SIZE 0x8004f300 #define SISFB_GET_INFO 0x8000f301 /* Must be patched with result from ..._SIZE at D[29:16] */ /* deprecated ioctl number (for older versions of sisfb) */ #define SISFB_GET_INFO_OLD 0x80046ef8 /* ioctls for tv parameters (position) */ #define SISFB_SET_TVPOSOFFSET 0x4004f304 /* lock sisfb from register access */ #define SISFB_SET_LOCK 0x4004f306 /* Magic value for USB device */ #ifndef SISFB_USB_MAGIC #define SISFB_USB_MAGIC 0x55aa2011 #endif /* Structure argument for SISFB_GET_INFO ioctl */ typedef struct _SISFB_INFO sisfb_info, *psisfb_info; struct _SISFB_INFO { CARD32 sisfb_id; /* for identifying sisfb */ #ifndef SISFB_ID #define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */ #endif CARD32 chip_id; /* PCI ID of detected chip */ CARD32 memory; /* video memory in KB which sisfb manages */ CARD32 heapstart; /* heap start (= sisfb "mem" argument) in KB */ CARD8 fbvidmode; /* current sisfb mode */ CARD8 sisfb_version; CARD8 sisfb_revision; CARD8 sisfb_patchlevel; CARD8 sisfb_caps; /* sisfb's capabilities */ CARD32 sisfb_tqlen; /* turbo queue length (in KB) */ CARD32 sisfb_pcibus; /* The card's PCI bus ID. For USB, bus = SISFB_USB_MAGIC */ CARD32 sisfb_pcislot; /* alias usbbus */ CARD32 sisfb_pcifunc; /* alias usbdev */ CARD8 sisfb_lcdpdc; CARD8 sisfb_lcda; CARD32 sisfb_vbflags; CARD32 sisfb_currentvbflags; CARD32 sisfb_scalelcd; CARD32 sisfb_specialtiming; CARD8 sisfb_haveemi; CARD8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33; CARD8 sisfb_haveemilcd; CARD8 sisfb_lcdpdca; CARD16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */ CARD32 sisfb_heapsize; /* heap size (in KB) */ CARD32 sisfb_videooffset; /* Offset of viewport in video memory (in bytes) */ CARD32 sisfb_curfstn; /* currently running FSTN/DSTN mode */ CARD32 sisfb_curdstn; CARD16 sisfb_pci_vendor; /* PCI vendor (SiS or XGI) */ CARD32 sisfb_vbflags2; CARD8 sisfb_can_post; /* sisfb can POST this card */ CARD8 sisfb_card_posted; /* card is POSTED */ CARD8 sisfb_was_boot_device; /* This card was the boot video device (ie is primary) */ CARD8 reserved[183]; /* for future use */ }; /* Mandatory functions */ static void SISIdentify(int flags); static Bool SISProbe(DriverPtr drv, int flags); static Bool SISPreInit(ScrnInfoPtr pScrn, int flags); static Bool SISScreenInit(SCREEN_INIT_ARGS_DECL); static Bool SISEnterVT(VT_FUNC_ARGS_DECL); static void SISLeaveVT(VT_FUNC_ARGS_DECL); static Bool SISCloseScreen(CLOSE_SCREEN_ARGS_DECL); static Bool SISSaveScreen(ScreenPtr pScreen, int mode); static Bool SISSwitchMode(SWITCH_MODE_ARGS_DECL); void SISAdjustFrame(ADJUST_FRAME_ARGS_DECL); /* Optional functions */ #ifdef SISDUALHEAD static Bool SISSaveScreenDH(ScreenPtr pScreen, int mode); #endif static void SISFreeScreen(FREE_SCREEN_ARGS_DECL); static ModeStatus SISValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags); /* Internally used functions */ static Bool SISMapMem(ScrnInfoPtr pScrn); static Bool SISUnmapMem(ScrnInfoPtr pScrn); #ifdef SIS_NEED_MAP_IOP static Bool SISMapIOPMem(ScrnInfoPtr pScrn); static Bool SISUnmapIOPMem(ScrnInfoPtr pScrn); #endif static void SISSave(ScrnInfoPtr pScrn); static void SISRestore(ScrnInfoPtr pScrn); static Bool SISModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); static void SISModifyModeInfo(DisplayModePtr mode); static void SiSPreSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int viewmode); static void SiSPostSetMode(ScrnInfoPtr pScrn, SISRegPtr sisReg); static void SiS6326PostSetMode(ScrnInfoPtr pScrn, SISRegPtr sisReg); static Bool SiSSetVESAMode(ScrnInfoPtr pScrn, DisplayModePtr pMode); static void SISVESARestore(ScrnInfoPtr pScrn); static void SiSBuildVesaModeList(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe); static UShort SiSCalcVESAModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode); static void SISVESASaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function); static void SISBridgeRestore(ScrnInfoPtr pScrn); static void SiSEnableTurboQueue(ScrnInfoPtr pScrn); static void SiSRestoreQueueMode(SISPtr pSiS, SISRegPtr sisReg); UChar SISSearchCRT1Rate(ScrnInfoPtr pScrn, DisplayModePtr mode); static void SISWaitVBRetrace(ScrnInfoPtr pScrn); void SISWaitRetraceCRT1(ScrnInfoPtr pScrn); void SISWaitRetraceCRT2(ScrnInfoPtr pScrn); UShort SiS_CheckModeCRT1(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags, Bool hcm); UShort SiS_CheckModeCRT2(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags, Bool hcm); #ifdef SISMERGED static Bool InRegion(int x, int y, region r); static void SISMergedPointerMoved(SCRN_ARG_TYPE arg, int x, int y); #endif Bool SiSBridgeIsInSlaveMode(ScrnInfoPtr pScrn); UShort SiS_GetModeNumber(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags); UChar SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, UShort offset, UChar value); #ifdef DEBUG static void SiSDumpModeInfo(ScrnInfoPtr pScrn, DisplayModePtr mode); #endif Bool SISDetermineLCDACap(ScrnInfoPtr pScrn); void SISSaveDetectedDevices(ScrnInfoPtr pScrn); #ifdef SISGAMMARAMP void SISCalculateGammaRamp(ScreenPtr pScreen, ScrnInfoPtr pScrn); #endif /* Our very own vgaHW functions (sis_vga.c) */ extern void SiSVGASave(ScrnInfoPtr pScrn, SISRegPtr save, int flags); extern void SiSVGARestore(ScrnInfoPtr pScrn, SISRegPtr restore, int flags); extern void SiSVGASaveFonts(ScrnInfoPtr pScrn); extern void SiSVGARestoreFonts(ScrnInfoPtr pScrn); extern void SISVGALock(SISPtr pSiS); extern void SiSVGAUnlock(SISPtr pSiS); extern void SiSVGAProtect(ScrnInfoPtr pScrn, Bool on); extern Bool SiSVGAMapMem(ScrnInfoPtr pScrn); extern void SiSVGAUnmapMem(ScrnInfoPtr pScrn); extern Bool SiSVGASaveScreen(ScreenPtr pScreen, int mode); /* shadow */ extern void SISPointerMoved(SCRN_ARG_TYPE arg, int x, int y); extern void SISPointerMovedReflect(SCRN_ARG_TYPE arg, int x, int y); extern void SISRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox); extern void SISRefreshAreaReflect(ScrnInfoPtr pScrn, int num, BoxPtr pbox); extern void SISRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox); extern void SISRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox); extern void SISRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox); extern void SISRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox); /* vb */ extern void SISCRT1PreInit(ScrnInfoPtr pScrn); extern void SISLCDPreInit(ScrnInfoPtr pScrn, Bool quiet); extern void SISTVPreInit(ScrnInfoPtr pScrn, Bool quiet); extern void SISCRT2PreInit(ScrnInfoPtr pScrn, Bool quiet); extern void SISSense30x(ScrnInfoPtr pScrn, Bool quiet); extern void SISSenseChrontel(ScrnInfoPtr pScrn, Bool quiet); extern void SiSSetupPseudoPanel(ScrnInfoPtr pScrn); /* utility */ extern void SiSCtrlExtInit(ScrnInfoPtr pScrn); extern void SiSCtrlExtUnregister(SISPtr pSiS, int index); /* init.c, init301.c ----- (use their data types!) */ extern unsigned short SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN, int LCDwith, int LCDheight); extern unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN, unsigned short CustomT, int LCDwith, int LCDheight, unsigned int VBFlags2); extern unsigned short SiS_GetModeID_TV(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, int Depth, unsigned int VBFlags2); extern unsigned short SiS_GetModeID_VGA2(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, int Depth, unsigned int VBFlags2); extern int SiSTranslateToVESA(ScrnInfoPtr pScrn, int modenumber); extern int SiSTranslateToOldMode(int modenumber); extern BOOLEAN SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); extern BOOLEAN SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, DisplayModePtr mode, BOOLEAN IsCustom); extern BOOLEAN SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, BOOLEAN dosetpitch); extern BOOLEAN SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, DisplayModePtr mode, BOOLEAN IsCustom); extern BOOLEAN SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, DisplayModePtr mode, BOOLEAN IsCustom); extern DisplayModePtr SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfordvi, BOOLEAN fakecrt2modes, BOOLEAN IsForCRT2); extern void SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr); extern void SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr); extern void SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr); extern void SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr); extern void SiS_CalcXTapScaler(struct SiS_Private *SiS_Pr, int srcsize, int destsize, int taps, Bool ishoriz); /* End of init.c, init301.c ----- */ xf86-video-sis-0.10.7/src/sis_dri.h0000664000076400007640000001003511763614406013630 00000000000000/* * SiS DRI wrapper * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * Licensed under the following terms: * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appears in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * and that the name of the copyright holder not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. The copyright holder makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without expressed or implied warranty. * * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Authors: Can-Ru Yeou, SiS Inc., * Thomas Winischhofer , * others. * * Previously taken and modified from tdfx_dri.h */ #ifndef _SIS_DRI_H_ #define _SIS_DRI_H_ #include "xf86drm.h" /* Hack: When the types were changed, the typedefs * went into drm.h. This file did not exist earlier. */ #ifndef _DRM_H_ #define drm_handle_t drmHandle #define drm_context_t drmContext #endif #define SIS_MAX_DRAWABLES 256 #define SISIOMAPSIZE (64*1024) typedef struct { int CtxOwner; int QueueLength; /* (300: current, 315/etc: total) length of command queue */ unsigned int AGPCmdBufNext; /* (rename to AGPVtxBufNext) */ unsigned int FrameCount; #ifdef SIS315DRI unsigned int sharedWPoffset; /* Offset to current queue position (shared with 2D) */ unsigned int cmdQueueOffset; /* Offset of start of command queue in VRAM */ #endif } SISSAREAPriv, *SISSAREAPrivPtr; #define AGPVtxBufNext AGPCmdBufNext #define SIS_FRONT 0 #define SIS_BACK 1 #define SIS_DEPTH 2 typedef struct { drm_handle_t handle; drmSize size; #ifndef SISISXORG6899900 drmAddress map; #endif } sisRegion, *sisRegionPtr; typedef struct { sisRegion regs; /* MMIO registers */ sisRegion agp; /* AGP public area */ int deviceID; /* = pSiS->Chipset (PCI ID) */ int width; /* = pScrn->virtualX */ int height; /* = pScrn->virtualY */ int mem; /* total video RAM; seems unused */ int bytesPerPixel; /* Screen's bpp/8 */ int priv1; /* unused */ int priv2; /* unused */ int fbOffset; /* Front buffer; set up, but unused by DRI driver*/ int backOffset; /* unused (handled by the DRI driver) */ int depthOffset; /* unused (handled by the DRI driver) */ int textureOffset; /* unused (handled by the DRI driver) */ int textureSize; /* unused (handled by the DRI driver) */ unsigned int AGPCmdBufOffset; /* (rename to AGPVtxBufOffset) */ unsigned int AGPCmdBufSize; /* (rename to AGPVtxBufSize) */ int irqEnabled; unsigned int scrnX; /* TODO: = width = pScrn->virtualX */ unsigned int scrnY; /* TODO: = height = pScrn->virtualY */ #ifdef SIS315DRI unsigned char *AGPCmdBufBase; unsigned long AGPCmdBufAddr; unsigned long AGPCmdBufOffset2; /* (rename to AGPCmdBufOffset) */ unsigned int AGPCmdBufSize2; /* (rename to AGPCmdBufSize) */ int deviceRev; /* Chip revision */ #endif } SISDRIRec, *SISDRIPtr; #define AGPVtxBufOffset AGPCmdBufOffset #define AGPVtxBufSize AGPCmdBufSize typedef struct { /* Nothing here yet */ int dummy; } SISConfigPrivRec, *SISConfigPrivPtr; typedef struct { /* Nothing here yet */ int dummy; } SISDRIContextRec, *SISDRIContextPtr; #include "screenint.h" Bool SISDRIScreenInit(ScreenPtr pScreen); void SISDRICloseScreen(ScreenPtr pScreen); Bool SISDRIFinishScreenInit(ScreenPtr pScreen); #endif xf86-video-sis-0.10.7/src/sis_common.h0000664000076400007640000000363611763614406014353 00000000000000/* * Common header definitions for SiS 2D/3D/DRM suite * * Copyright (C) 2003 Eric Anholt * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appears in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * and that the name of the copyright holder not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. The copyright holder makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without expressed or implied warranty. * * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Author: * Eric Anholt * */ #ifndef _SIS_COMMON_H_ #define _SIS_COMMON_H_ #define DRM_SIS_FB_ALLOC 0x04 #define DRM_SIS_FB_FREE 0x05 #define DRM_SIS_FLIP 0x08 #define DRM_SIS_FLIP_INIT 0x09 #define DRM_SIS_FLIP_FINAL 0x10 #define DRM_SIS_AGP_INIT 0x13 #define DRM_SIS_AGP_ALLOC 0x14 #define DRM_SIS_AGP_FREE 0x15 #define DRM_SIS_FB_INIT 0x16 typedef struct { int context; unsigned long offset; unsigned long size; void *free; } drm_sis_mem_t; typedef struct { unsigned long offset, size; } drm_sis_agp_t; typedef struct { unsigned long offset, size; } drm_sis_fb_t; typedef struct { unsigned int left, right; } drm_sis_flip_t; #endif /* _SIS_COMMON_H_ */ xf86-video-sis-0.10.7/src/sis_dri.c0000664000076400007640000006550011763614406013632 00000000000000/* * DRI wrapper for 300 and 315 series * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * Preliminary 315/330 support by Thomas Winischhofer * Portions of Mesa 4/5/6 changes by Eric Anholt * * Licensed under the following terms: * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appears in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * and that the name of the copyright holder not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. The copyright holder makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without expressed or implied warranty. * * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Previously taken and modified from tdfx_dri.c, mga_dri.c * * Authors: Can-Ru Yeou, SiS Inc. * Alan Hourihane, Wigan, England, * Thomas Winischhofer * others. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "sis.h" #include "sis_regs.h" #include "fb.h" #include "GL/glxtokens.h" #ifndef SISHAVEDRMWRITE # if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) extern Bool drmSiSAgpInit(int driSubFD, int offset, int size); # else # include "xf86drmCompat.h" # endif #endif #ifdef XORG_VERSION_CURRENT #define SISHAVECREATEBUSID #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(6,7,99,1,0) #ifndef XSERVER_LIBPCIACCESS extern char *DRICreatePCIBusID(pciVideoPtr PciInfo); #endif #endif #else # if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,4,99,9,0) # undef SISHAVECREATEBUSID # endif #endif #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0) #include "sis_common.h" #endif #ifndef DRIINFO_MAJOR_VERSION #define DRIINFO_MAJOR_VERSION 4 #endif #ifndef DRIINFO_MINOR_VERSION #define DRIINFO_MINOR_VERSION 0 #endif /* Idle function for 300 series */ #define BR(x) (0x8200 | (x) << 2) #define SiSIdle \ while((SIS_MMIO_IN16(pSiS->IOBase, BR(16)+2) & 0xE000) != 0xE000){}; \ while((SIS_MMIO_IN16(pSiS->IOBase, BR(16)+2) & 0xE000) != 0xE000){}; \ SIS_MMIO_IN16(pSiS->IOBase, 0x8240); /* Idle function for 315/330/340 series and XGI */ #define Q_STATUS 0x85CC #define SiS315Idle \ { \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000){}; \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000){}; \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000){}; \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000){}; \ } extern void GlxSetVisualConfigs( int nconfigs, __GLXvisualConfig *configs, void **configprivs ); /* The kernel's "sis" DRM module handles all chipsets */ static char SISKernelDriverName[] = "sis"; /* The client side DRI drivers are different: */ static char SISClientDriverNameSiS300[] = "sis"; /* 300, 540, 630, 730 */ static char SISClientDriverNameSiS315[] = "sis315"; /* All of 315/330 series */ static char SISClientDriverNameXGI[] = "xgi"; /* XGI V3, V5, V8 */ static Bool SISInitVisualConfigs(ScreenPtr pScreen); static Bool SISCreateContext(ScreenPtr pScreen, VisualPtr visual, drm_context_t hwContext, void *pVisualConfigPriv, DRIContextType contextStore); static void SISDestroyContext(ScreenPtr pScreen, drm_context_t hwContext, DRIContextType contextStore); static void SISDRISwapContext(ScreenPtr pScreen, DRISyncType syncType, DRIContextType readContextType, void *readContextStore, DRIContextType writeContextType, void *writeContextStore); static void SISDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index); static void SISDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, RegionPtr prgnSrc, CARD32 index); static Bool SISInitVisualConfigs(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSIS = SISPTR(pScrn); int numConfigs = 0; __GLXvisualConfig *pConfigs = 0; SISConfigPrivPtr pSISConfigs = 0; SISConfigPrivPtr *pSISConfigPtrs = 0; int i, db, z_stencil, accum; Bool useZ16 = FALSE; if(getenv("SIS_FORCE_Z16")) { useZ16 = TRUE; } switch (pScrn->bitsPerPixel) { case 8: case 24: break; case 16: case 32: numConfigs = (useZ16) ? 8 : 16; if(!(pConfigs = (__GLXvisualConfig*)calloc(sizeof(__GLXvisualConfig), numConfigs))) { return FALSE; } if(!(pSISConfigs = (SISConfigPrivPtr)calloc(sizeof(SISConfigPrivRec), numConfigs))) { free(pConfigs); return FALSE; } if(!(pSISConfigPtrs = (SISConfigPrivPtr*)calloc(sizeof(SISConfigPrivPtr), numConfigs))) { free(pConfigs); free(pSISConfigs); return FALSE; } for(i=0; ibitsPerPixel == 16) { pConfigs[i].redSize = 5; pConfigs[i].greenSize = 6; pConfigs[i].blueSize = 5; pConfigs[i].alphaSize = 0; pConfigs[i].redMask = 0x0000F800; pConfigs[i].greenMask = 0x000007E0; pConfigs[i].blueMask = 0x0000001F; pConfigs[i].alphaMask = 0x00000000; } else { pConfigs[i].redSize = 8; pConfigs[i].greenSize = 8; pConfigs[i].blueSize = 8; pConfigs[i].alphaSize = 8; pConfigs[i].redMask = 0x00FF0000; pConfigs[i].greenMask = 0x0000FF00; pConfigs[i].blueMask = 0x000000FF; pConfigs[i].alphaMask = 0xFF000000; } if(accum) { pConfigs[i].accumRedSize = 16; pConfigs[i].accumGreenSize = 16; pConfigs[i].accumBlueSize = 16; if(pConfigs[i].alphaMask == 0) pConfigs[i].accumAlphaSize = 0; else pConfigs[i].accumAlphaSize = 16; } else { pConfigs[i].accumRedSize = 0; pConfigs[i].accumGreenSize = 0; pConfigs[i].accumBlueSize = 0; pConfigs[i].accumAlphaSize = 0; } if(db) pConfigs[i].doubleBuffer = TRUE; else pConfigs[i].doubleBuffer = FALSE; pConfigs[i].stereo = FALSE; pConfigs[i].bufferSize = -1; switch(z_stencil) { case 0: pConfigs[i].depthSize = 0; pConfigs[i].stencilSize = 0; break; case 1: pConfigs[i].depthSize = 16; pConfigs[i].stencilSize = 0; break; case 2: pConfigs[i].depthSize = 32; pConfigs[i].stencilSize = 0; break; case 3: pConfigs[i].depthSize = 24; pConfigs[i].stencilSize = 8; break; } pConfigs[i].auxBuffers = 0; pConfigs[i].level = 0; if(pConfigs[i].accumRedSize != 0) pConfigs[i].visualRating = GLX_SLOW_CONFIG; else pConfigs[i].visualRating = GLX_NONE_EXT; pConfigs[i].transparentPixel = GLX_NONE; pConfigs[i].transparentRed = 0; pConfigs[i].transparentGreen = 0; pConfigs[i].transparentBlue = 0; pConfigs[i].transparentAlpha = 0; pConfigs[i].transparentIndex = 0; i++; } } } if(i != numConfigs) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] Incorrect initialization of visuals. Disabling the DRI.\n"); return FALSE; } break; } pSIS->numVisualConfigs = numConfigs; pSIS->pVisualConfigs = pConfigs; pSIS->pVisualConfigsPriv = pSISConfigs; GlxSetVisualConfigs(numConfigs, pConfigs, (void**)pSISConfigPtrs); return TRUE; } Bool SISDRIScreenInit(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSIS = SISPTR(pScrn); DRIInfoPtr pDRIInfo; SISDRIPtr pSISDRI; #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0) drmVersionPtr version; #endif pSIS->cmdQueueLenPtrBackup = NULL; #ifdef SIS315DRI pSIS->cmdQ_SharedWritePortBackup = NULL; #endif /* Check that the GLX, DRI, and DRM modules have been loaded by testing * for canonical symbols in each module. */ if(!xf86LoaderCheckSymbol("GlxSetVisualConfigs")) return FALSE; if(!xf86LoaderCheckSymbol("drmAvailable")) return FALSE; if(!xf86LoaderCheckSymbol("DRIQueryVersion")) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] SISDRIScreenInit failed (libdri.a too old). Disabling the DRI.\n"); return FALSE; } /* Check the DRI version */ { int major, minor, patch; DRIQueryVersion(&major, &minor, &patch); if(major != DRIINFO_MAJOR_VERSION || minor < DRIINFO_MINOR_VERSION) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] SISDRIScreenInit failed because of a version mismatch.\n" "\t[dri] libdri version is %d.%d.%d but version %d.%d.x is needed.\n" "\t[dri] Disabling the DRI.\n", major, minor, patch, DRIINFO_MAJOR_VERSION, DRIINFO_MINOR_VERSION); return FALSE; } } pDRIInfo = DRICreateInfoRec(); if(!pDRIInfo) return FALSE; pSIS->pDRIInfo = pDRIInfo; pDRIInfo->drmDriverName = SISKernelDriverName; if(pSIS->VGAEngine == SIS_300_VGA) { pDRIInfo->clientDriverName = SISClientDriverNameSiS300; } else if(pSIS->ChipFlags & SiSCF_IsXGI) { pDRIInfo->clientDriverName = SISClientDriverNameXGI; } else { pDRIInfo->clientDriverName = SISClientDriverNameSiS315; } #ifdef SISHAVECREATEBUSID if(xf86LoaderCheckSymbol("DRICreatePCIBusID")) { pDRIInfo->busIdString = DRICreatePCIBusID(pSIS->PciInfo); } else { #endif pDRIInfo->busIdString = malloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", pSIS->PciBus, pSIS->PciDevice, pSIS->PciFunc); #ifdef SISHAVECREATEBUSID } #endif /* Hack to keep old DRI working -- checked for major==1 and * minor==1. */ #ifdef SISNEWDRI pDRIInfo->ddxDriverMajorVersion = SIS_MAJOR_VERSION; pDRIInfo->ddxDriverMinorVersion = SIS_MINOR_VERSION; pDRIInfo->ddxDriverPatchVersion = SIS_PATCHLEVEL; #else pDRIInfo->ddxDriverMajorVersion = 0; pDRIInfo->ddxDriverMinorVersion = 1; pDRIInfo->ddxDriverPatchVersion = 0; #endif /* Strictly for mapping the framebuffer, * NOT for memory management! * Note: For 315/330/340 series, the * framebuffer area also contains * the (non-AGP) command queue, located * at the offset sarea->cmdQueueOffset */ #if DRIINFO_MAJOR_VERSION <= 4 pDRIInfo->frameBufferPhysicalAddress = pSIS->realFbAddress; #else pDRIInfo->frameBufferPhysicalAddress = (pointer)pSIS->realFbAddress; #endif pDRIInfo->frameBufferSize = pSIS->FbMapSize; /* scrnOffset is being calulated in sis_vga.c */ pDRIInfo->frameBufferStride = pSIS->scrnOffset; pDRIInfo->ddxDrawableTableEntry = SIS_MAX_DRAWABLES; if(SAREA_MAX_DRAWABLES < SIS_MAX_DRAWABLES) pDRIInfo->maxDrawableTableEntry = SAREA_MAX_DRAWABLES; else pDRIInfo->maxDrawableTableEntry = SIS_MAX_DRAWABLES; #ifdef NOT_DONE /* FIXME need to extend DRI protocol to pass this size back to client * for SAREA mapping that includes a device private record */ pDRIInfo->SAREASize = ((sizeof(XF86DRISAREARec) + getpagesize() - 1) & getpagesize()); /* round to page */ /* ((sizeof(XF86DRISAREARec) + 0xfff) & 0x1000); */ /* round to page */ /* + shared memory device private rec */ #else /* For now the mapping works by using a fixed size defined * in the SAREA header */ if(sizeof(XF86DRISAREARec) + sizeof(SISSAREAPriv) > SAREA_MAX) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] Data does not fit in SAREA. Disabling the DRI.\n"); return FALSE; } pDRIInfo->SAREASize = SAREA_MAX; #endif if(!(pSISDRI = (SISDRIPtr)calloc(sizeof(SISDRIRec), 1))) { DRIDestroyInfoRec(pSIS->pDRIInfo); pSIS->pDRIInfo = 0; return FALSE; } pDRIInfo->devPrivate = pSISDRI; pDRIInfo->devPrivateSize = sizeof(SISDRIRec); pDRIInfo->contextSize = sizeof(SISDRIContextRec); pDRIInfo->CreateContext = SISCreateContext; pDRIInfo->DestroyContext = SISDestroyContext; pDRIInfo->SwapContext = SISDRISwapContext; pDRIInfo->InitBuffers = SISDRIInitBuffers; pDRIInfo->MoveBuffers = SISDRIMoveBuffers; pDRIInfo->bufferRequests = DRI_ALL_WINDOWS; if(!DRIScreenInit(pScreen, pDRIInfo, &pSIS->drmSubFD)) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] DRIScreenInit failed. Disabling the DRI.\n"); free(pDRIInfo->devPrivate); pDRIInfo->devPrivate = 0; DRIDestroyInfoRec(pSIS->pDRIInfo); pSIS->pDRIInfo = 0; pSIS->drmSubFD = -1; return FALSE; } #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0) /* Check DRM kernel version */ version = drmGetVersion(pSIS->drmSubFD); if(version) { if((version->version_major != 1) || (version->version_minor < 0)) { /* incompatible drm version */ xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] SISDRIScreenInit failed because of a version mismatch.\n" "\t[dri] sis DRM kernel module version is %d.%d.%d but version >=1.0.x\n" "\t[dri] is needed. Disabling the DRI.\n", version->version_major, version->version_minor, version->version_patchlevel); drmFreeVersion(version); SISDRICloseScreen(pScreen); return FALSE; } if(version->version_minor >= 1) { /* Includes support for framebuffer memory allocation without sisfb */ drm_sis_fb_t fb; fb.offset = pSIS->DRIheapstart; fb.size = pSIS->DRIheapend - pSIS->DRIheapstart; drmCommandWrite(pSIS->drmSubFD, DRM_SIS_FB_INIT, &fb, sizeof(fb)); xf86DrvMsg(pScreen->myNum, X_INFO, "[dri] Video RAM memory heap: 0x%0x to 0x%0x (%dKB)\n", pSIS->DRIheapstart, pSIS->DRIheapend, (int)((pSIS->DRIheapend - pSIS->DRIheapstart) >> 10)); } drmFreeVersion(version); } #endif /* MMIO */ pSISDRI->regs.size = SISIOMAPSIZE; #ifndef SISISXORG6899900 pSISDRI->regs.map = 0; #endif if(drmAddMap(pSIS->drmSubFD, (drm_handle_t)pSIS->IOAddress, pSISDRI->regs.size, DRM_REGISTERS, 0, &pSISDRI->regs.handle) < 0) { SISDRICloseScreen(pScreen); return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] MMIO registers mapped to 0x%0x\n", pSISDRI->regs.handle); /* AGP */ do { unsigned long agpmodemask = 0; pSIS->agpWantedSize = pSIS->agpWantedPages * AGP_PAGE_SIZE; pSIS->agpSize = 0; pSIS->agpCmdBufSize = 0; pSISDRI->AGPCmdBufSize = 0; if(!pSIS->IsAGPCard) break; if(drmAgpAcquire(pSIS->drmSubFD) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] Failed to acquire AGP, AGP disabled\n"); break; } switch(pSIS->VGAEngine) { #ifdef SIS315DRI case SIS_315_VGA: /* Default to 1X agp mode in SIS315 */ agpmodemask = ~0x00000002; break; #endif case SIS_300_VGA: /* TODO: default value is 2x? */ agpmodemask = ~0x0; break; } if(drmAgpEnable(pSIS->drmSubFD, drmAgpGetMode(pSIS->drmSubFD) & agpmodemask) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] Failed to enable AGP, AGP disabled\n"); break; } xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] AGP enabled\n"); #define AGP_DEFAULT_SIZE_MB 8 #define AGP_DEFAULT_SIZE (AGP_DEFAULT_SIZE_MB * 1024 * 1024) if(drmAgpAlloc(pSIS->drmSubFD, pSIS->agpWantedSize, 0, NULL, &pSIS->agpHandle) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] Failed to allocate %dMB AGP memory\n", (int)(pSIS->agpWantedSize / (1024 * 1024))); if(pSIS->agpWantedSize > AGP_DEFAULT_SIZE) { xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Retrying with %dMB\n", AGP_DEFAULT_SIZE_MB); pSIS->agpWantedSize = AGP_DEFAULT_SIZE; if(drmAgpAlloc(pSIS->drmSubFD, pSIS->agpWantedSize, 0, NULL, &pSIS->agpHandle) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] Failed to allocate %dMB AGP memory, AGP disabled\n", AGP_DEFAULT_SIZE_MB); drmAgpRelease(pSIS->drmSubFD); break; } } else { drmAgpRelease(pSIS->drmSubFD); break; } } xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Allocated %dMB AGP memory\n", (int)(pSIS->agpWantedSize / (1024 * 1024))); if(drmAgpBind(pSIS->drmSubFD, pSIS->agpHandle, 0) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] Failed to bind AGP memory\n"); drmAgpFree(pSIS->drmSubFD, pSIS->agpHandle); if(pSIS->agpWantedSize > AGP_DEFAULT_SIZE) { xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Retrying with %dMB\n", AGP_DEFAULT_SIZE_MB); pSIS->agpWantedSize = AGP_DEFAULT_SIZE; if(drmAgpAlloc(pSIS->drmSubFD, pSIS->agpWantedSize, 0, NULL, &pSIS->agpHandle) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] Failed to re-allocate AGP memory, AGP disabled\n"); drmAgpRelease(pSIS->drmSubFD); break; } else if(drmAgpBind(pSIS->drmSubFD, pSIS->agpHandle, 0) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] Failed to bind AGP memory again, AGP disabled\n"); drmAgpFree(pSIS->drmSubFD, pSIS->agpHandle); drmAgpRelease(pSIS->drmSubFD); break; } } else { drmAgpRelease(pSIS->drmSubFD); break; } } xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Bound %dMB AGP memory\n", (int)(pSIS->agpWantedSize / (1024 * 1024))); pSIS->agpSize = pSIS->agpWantedSize; pSIS->agpAddr = drmAgpBase(pSIS->drmSubFD); /* pSIS->agpBase = */ pSISDRI->agp.size = pSIS->agpSize; if(drmAddMap(pSIS->drmSubFD, (drm_handle_t)0, pSISDRI->agp.size, DRM_AGP, 0, &pSISDRI->agp.handle) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] Failed to map public AGP area, AGP disabled\n"); drmAgpUnbind(pSIS->drmSubFD, pSIS->agpHandle); drmAgpFree(pSIS->drmSubFD, pSIS->agpHandle); drmAgpRelease(pSIS->drmSubFD); pSIS->agpSize = pSISDRI->agp.size = 0; break; } switch(pSIS->VGAEngine) { #ifdef SIS315DRI case SIS_315_VGA: pSIS->agpVtxBufSize = AGP_VTXBUF_SIZE; /* = 2MB */ pSIS->agpVtxBufAddr = pSIS->agpAddr; pSIS->agpVtxBufBase = pSIS->agpVtxBufAddr - pSIS->agpAddr + pSIS->agpBase; pSIS->agpVtxBufFree = 0; pSISDRI->AGPVtxBufOffset = pSIS->agpVtxBufAddr - pSIS->agpAddr; pSISDRI->AGPVtxBufSize = pSIS->agpVtxBufSize; #ifndef SISHAVEDRMWRITE drmSiSAgpInit(pSIS->drmSubFD, AGP_VTXBUF_SIZE, (pSIS->agpSize - AGP_VTXBUF_SIZE)); #else { drm_sis_agp_t agp; agp.offset = AGP_VTXBUF_SIZE; agp.size = pSIS->agpSize - AGP_VTXBUF_SIZE; drmCommandWrite(pSIS->drmSubFD, DRM_SIS_AGP_INIT, &agp, sizeof(agp)); } #endif break; #endif case SIS_300_VGA: pSIS->agpCmdBufSize = AGP_CMDBUF_SIZE; pSIS->agpCmdBufAddr = pSIS->agpAddr; pSIS->agpCmdBufBase = pSIS->agpCmdBufAddr - pSIS->agpAddr + pSIS->agpBase; pSIS->agpCmdBufFree = 0; pSISDRI->AGPCmdBufOffset = pSIS->agpCmdBufAddr - pSIS->agpAddr; pSISDRI->AGPCmdBufSize = pSIS->agpCmdBufSize; #ifndef SISHAVEDRMWRITE drmSiSAgpInit(pSIS->drmSubFD, AGP_CMDBUF_SIZE, (pSIS->agpSize - AGP_CMDBUF_SIZE)); #else { drm_sis_agp_t agp; agp.offset = AGP_CMDBUF_SIZE; agp.size = pSIS->agpSize - AGP_CMDBUF_SIZE; drmCommandWrite(pSIS->drmSubFD, DRM_SIS_AGP_INIT, &agp, sizeof(agp)); } #endif break; } } while(0); /* Eventually grab and enable IRQ */ pSIS->irqEnabled = FALSE; pSIS->irq = drmGetInterruptFromBusID(pSIS->drmSubFD, pSIS->PciBus, pSIS->PciDevice, pSIS->PciFunc); if(pSIS->irq < 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] No valid IRQ number for device %d:%d:%d (code %d)\n", pSIS->PciBus, pSIS->PciDevice, pSIS->PciFunc, pSIS->irq); } else if((drmCtlInstHandler(pSIS->drmSubFD, pSIS->irq)) != 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Failed to add IRQ %d handler\n", pSIS->irq); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Successfully installed handler for IRQ %d\n", pSIS->irq); pSIS->irqEnabled = TRUE; } pSISDRI->irqEnabled = pSIS->irqEnabled; if(!(SISInitVisualConfigs(pScreen))) { SISDRICloseScreen(pScreen); return FALSE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] Visual configs initialized\n" ); return TRUE; } Bool SISDRIFinishScreenInit(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); SISDRIPtr pSISDRI; pSiS->pDRIInfo->driverSwapMethod = DRI_HIDE_X_CONTEXT; /* pSiS->pDRIInfo->driverSwapMethod = DRI_SERVER_SWAP; */ pSISDRI = (SISDRIPtr)pSiS->pDRIInfo->devPrivate; pSISDRI->deviceID = pSiS->Chipset; #ifdef SIS315DRI pSISDRI->deviceRev= pSiS->ChipRev; #endif pSISDRI->width = pScrn->virtualX; pSISDRI->height = pScrn->virtualY; pSISDRI->mem = pScrn->videoRam * 1024; pSISDRI->bytesPerPixel = (pScrn->bitsPerPixel+7) / 8; /* TODO */ pSISDRI->scrnX = pSISDRI->width; pSISDRI->scrnY = pSISDRI->height; /* Offset of the front buffer (relative from beginning * of video RAM). This is usually 0, but eventually not * if running on a SiS76x with LFB and UMA memory. * THE DRI DRIVER DOES NOT USE THIS YET (MESA 6.2.1) */ pSISDRI->fbOffset = pSiS->FbBaseOffset; /* These are unused. Offsets are set up by the DRI */ pSISDRI->textureOffset = 0; pSISDRI->textureSize = 0; pSISDRI->backOffset = 0; pSISDRI->depthOffset = 0; /* set SAREA value */ { SISSAREAPriv *saPriv; saPriv = (SISSAREAPriv *)DRIGetSAREAPrivate(pScreen); assert(saPriv); saPriv->CtxOwner = -1; switch(pSiS->VGAEngine) { #ifdef SIS315DRI case SIS_315_VGA: saPriv->AGPVtxBufNext = 0; saPriv->QueueLength = pSiS->cmdQueueSize; /* Total (not: current) size, in bytes! */ /* Copy current queue position to sarea */ saPriv->sharedWPoffset = *(pSiS->cmdQ_SharedWritePort); /* Delegate our shared offset to current queue position */ pSiS->cmdQ_SharedWritePortBackup = pSiS->cmdQ_SharedWritePort; pSiS->cmdQ_SharedWritePort = &(saPriv->sharedWPoffset); saPriv->cmdQueueOffset = pSiS->cmdQueueOffset; /* TODO: Reset frame control */ break; #endif case SIS_300_VGA: saPriv->AGPCmdBufNext = 0; /* Delegate our shared pointer to current queue length */ saPriv->QueueLength = *(pSiS->cmdQueueLenPtr); pSiS->cmdQueueLenPtrBackup = pSiS->cmdQueueLenPtr; pSiS->cmdQueueLenPtr = &(saPriv->QueueLength); /* frame control */ saPriv->FrameCount = 0; *(CARD32 *)(pSiS->IOBase+0x8a2c) = 0; SiSIdle break; } } return DRIFinishScreenInit(pScreen); } void SISDRICloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSIS = SISPTR(pScrn); switch(pSIS->VGAEngine) { #ifdef SIS315DRI case SIS_315_VGA: if(pSIS->cmdQ_SharedWritePortBackup) { /* Re-instate our shared offset to current queue position */ pSIS->cmdQ_SharedWritePort_2D = *(pSIS->cmdQ_SharedWritePort); pSIS->cmdQ_SharedWritePort = pSIS->cmdQ_SharedWritePortBackup; pSIS->cmdQ_SharedWritePortBackup = 0; } break; #endif case SIS_300_VGA: if(pSIS->cmdQueueLenPtrBackup) { /* Re-instate our shared pointer to current queue length */ pSIS->cmdQueueLenPtr = pSIS->cmdQueueLenPtrBackup; *(pSIS->cmdQueueLenPtr) = 0; } break; } if(pSIS->irqEnabled) { xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Removing IRQ handler\n"); drmCtlUninstHandler(pSIS->drmSubFD); pSIS->irqEnabled = FALSE; pSIS->irq = 0; } if(pSIS->agpSize){ xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Freeing AGP memory\n"); drmAgpUnbind(pSIS->drmSubFD, pSIS->agpHandle); drmAgpFree(pSIS->drmSubFD, pSIS->agpHandle); xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Releasing AGP module\n"); drmAgpRelease(pSIS->drmSubFD); pSIS->agpSize = 0; } DRICloseScreen(pScreen); if(pSIS->pDRIInfo) { if(pSIS->pDRIInfo->devPrivate) { free(pSIS->pDRIInfo->devPrivate); pSIS->pDRIInfo->devPrivate = NULL; } DRIDestroyInfoRec(pSIS->pDRIInfo); pSIS->pDRIInfo = NULL; } if(pSIS->pVisualConfigs) { free(pSIS->pVisualConfigs); pSIS->pVisualConfigs = NULL; } if(pSIS->pVisualConfigsPriv) { free(pSIS->pVisualConfigsPriv); pSIS->pVisualConfigsPriv = NULL; } } /* TODO: xserver receives driver's swapping event and do something * according the data initialized in this function */ static Bool SISCreateContext(ScreenPtr pScreen, VisualPtr visual, drm_context_t hwContext, void *pVisualConfigPriv, DRIContextType contextStore) { return TRUE; } static void SISDestroyContext(ScreenPtr pScreen, drm_context_t hwContext, DRIContextType contextStore) { } static void SISDRISwapContext(ScreenPtr pScreen, DRISyncType syncType, DRIContextType oldContextType, void *oldContext, DRIContextType newContextType, void *newContext) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); #if 0 if ((syncType==DRI_3D_SYNC) && (oldContextType==DRI_2D_CONTEXT) && (newContextType==DRI_2D_CONTEXT)) { /* Entering from Wakeup */ SISSwapContextPrivate(pScreen); } if ((syncType==DRI_2D_SYNC) && (oldContextType==DRI_NO_CONTEXT) && (newContextType==DRI_2D_CONTEXT)) { /* Exiting from Block Handler */ SISLostContext(pScreen); } #endif /* mEndPrimitive */ /* * TODO: do this only if X-Server get lock. If kernel supports delayed * signal, needless to do this */ switch(pSiS->VGAEngine) { #ifdef SIS315DRI case SIS_315_VGA: /* ? */ break; #endif case SIS_300_VGA: *((unsigned char *)pSiS->IOBase + 0x8B50) = 0xff; *(CARD32 *)(pSiS->IOBase + 0x8B60) = 0xffffffff; break; } } static void SISDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index) { ScreenPtr pScreen = pWin->drawable.pScreen; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); switch(pSiS->VGAEngine) { #ifdef SIS315DRI case SIS_315_VGA: SiS315Idle break; #endif case SIS_300_VGA: SiSIdle break; } } static void SISDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, RegionPtr prgnSrc, CARD32 index) { ScreenPtr pScreen = pParent->drawable.pScreen; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); switch(pSiS->VGAEngine) { #ifdef SIS315DRI case SIS_315_VGA: SiS315Idle break; #endif case SIS_300_VGA: SiSIdle break; } } #if 0 void SISLostContext(ScreenPtr pScreen) { } void SISSwapContextPrivate(ScreenPtr pScreen) { } #endif xf86-video-sis-0.10.7/src/sis_dga.c0000664000076400007640000003216611763614406013611 00000000000000/* * SiS DGA handling * * Copyright (C) 2000 by Alan Hourihane, Sychdyn, North Wales, UK. * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * Portions from radeon_dga.c which is * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. * * Licensed under the following terms: * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of the providers not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. The providers make no representations * about the suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. * * THE PROVIDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE PROVIDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Authors: Alan Hourihane, * Thomas Winischhofer */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "sis.h" #include "dgaproc.h" #include "sis_regs.h" #ifndef NEW_DGAOPENFRAMEBUFFER static Bool SIS_OpenFramebuffer(ScrnInfoPtr, char **, UChar **, int *, int *, int *); #else static Bool SIS_OpenFramebuffer(ScrnInfoPtr, char **, unsigned int *, unsigned int *, unsigned int *, unsigned int *); #endif static Bool SIS_SetMode(ScrnInfoPtr, DGAModePtr); static void SIS_Sync(ScrnInfoPtr); static int SIS_GetViewport(ScrnInfoPtr); static void SIS_SetViewport(ScrnInfoPtr, int, int, int); static void SIS_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void SIS_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); static void SIS_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, unsigned long); static DGAFunctionRec SISDGAFuncs = { SIS_OpenFramebuffer, NULL, SIS_SetMode, SIS_SetViewport, SIS_GetViewport, SIS_Sync, SIS_FillRect, SIS_BlitRect, NULL }; static DGAFunctionRec SISDGAFuncs3xx = { SIS_OpenFramebuffer, NULL, SIS_SetMode, SIS_SetViewport, SIS_GetViewport, SIS_Sync, SIS_FillRect, SIS_BlitRect, SIS_BlitTransRect }; static DGAModePtr SISSetupDGAMode( ScrnInfoPtr pScrn, DGAModePtr modes, int *num, int bitsPerPixel, int depth, Bool pixmap, int secondPitch, ULong red, ULong green, ULong blue, short visualClass ){ SISPtr pSiS = SISPTR(pScrn); DGAModePtr newmodes = NULL, currentMode; DisplayModePtr pMode, firstMode; int otherPitch, Bpp = bitsPerPixel >> 3; Bool oneMore; pMode = firstMode = pScrn->modes; while(pMode) { #ifdef SISMERGED if(pSiS->MergedFB) { Bool nogood = FALSE; /* Filter out all meta modes that would require driver-side panning */ switch(((SiSMergedDisplayModePtr)pMode->Private)->CRT2Position) { case sisClone: if( (((SiSMergedDisplayModePtr)pMode->Private)->CRT1->HDisplay != ((SiSMergedDisplayModePtr)pMode->Private)->CRT2->HDisplay) || (((SiSMergedDisplayModePtr)pMode->Private)->CRT1->VDisplay != ((SiSMergedDisplayModePtr)pMode->Private)->CRT2->VDisplay) || (((SiSMergedDisplayModePtr)pMode->Private)->CRT1->HDisplay != pMode->HDisplay) || (((SiSMergedDisplayModePtr)pMode->Private)->CRT1->VDisplay != pMode->VDisplay) ) nogood = TRUE; break; case sisRightOf: case sisLeftOf: if( (((SiSMergedDisplayModePtr)pMode->Private)->CRT1->VDisplay != ((SiSMergedDisplayModePtr)pMode->Private)->CRT2->VDisplay) || (((SiSMergedDisplayModePtr)pMode->Private)->CRT1->VDisplay != pMode->VDisplay) ) nogood = TRUE; break; default: if( (((SiSMergedDisplayModePtr)pMode->Private)->CRT1->HDisplay != ((SiSMergedDisplayModePtr)pMode->Private)->CRT2->HDisplay) || (((SiSMergedDisplayModePtr)pMode->Private)->CRT1->HDisplay != pMode->HDisplay) ) nogood = TRUE; } if(nogood) { if(depth == 16) { /* Print this only the first time */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DGA: MetaMode %dx%d not suitable for DGA, skipping\n", pMode->HDisplay, pMode->VDisplay); } goto mode_nogood; } } #endif otherPitch = secondPitch ? secondPitch : pMode->HDisplay; if(pMode->HDisplay != otherPitch) { newmodes = realloc(modes, (*num + 2) * sizeof(DGAModeRec)); oneMore = TRUE; } else { newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec)); oneMore = FALSE; } if(!newmodes) { free(modes); return NULL; } modes = newmodes; SECOND_PASS: currentMode = modes + *num; (*num)++; currentMode->mode = pMode; currentMode->flags = DGA_CONCURRENT_ACCESS; if(pixmap) currentMode->flags |= DGA_PIXMAP_AVAILABLE; if(!pSiS->NoAccel) { currentMode->flags |= DGA_FILL_RECT | DGA_BLIT_RECT; if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA) || (pSiS->VGAEngine == SIS_530_VGA)) { currentMode->flags |= 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 = depth; currentMode->bitsPerPixel = bitsPerPixel; currentMode->red_mask = red; currentMode->green_mask = green; currentMode->blue_mask = blue; currentMode->visualClass = visualClass; currentMode->viewportWidth = pMode->HDisplay; currentMode->viewportHeight = pMode->VDisplay; currentMode->xViewportStep = 1; currentMode->yViewportStep = 1; currentMode->viewportFlags = DGA_FLIP_RETRACE; currentMode->offset = 0; currentMode->address = pSiS->FbBase; if(oneMore) { /* first one is narrow width */ currentMode->bytesPerScanline = (((pMode->HDisplay * Bpp) + 3) & ~3L); currentMode->imageWidth = pMode->HDisplay; currentMode->imageHeight = pMode->VDisplay; currentMode->pixmapWidth = currentMode->imageWidth; currentMode->pixmapHeight = currentMode->imageHeight; currentMode->maxViewportX = currentMode->imageWidth - currentMode->viewportWidth; /* this might need to get clamped to some maximum */ currentMode->maxViewportY = (currentMode->imageHeight - currentMode->viewportHeight); oneMore = FALSE; goto SECOND_PASS; } else { currentMode->bytesPerScanline = ((otherPitch * Bpp) + 3) & ~3L; currentMode->imageWidth = otherPitch; currentMode->imageHeight = pMode->VDisplay; currentMode->pixmapWidth = currentMode->imageWidth; currentMode->pixmapHeight = currentMode->imageHeight; currentMode->maxViewportX = (currentMode->imageWidth - currentMode->viewportWidth); /* this might need to get clamped to some maximum */ currentMode->maxViewportY = (currentMode->imageHeight - currentMode->viewportHeight); } #ifdef SISMERGED mode_nogood: #endif pMode = pMode->next; if(pMode == firstMode) break; } return modes; } Bool SISDGAInit(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); DGAModePtr modes = NULL; int num = 0; /* 8 */ /* We don't support 8bpp modes in dual head or MergedFB mode, * so don't offer them to DGA either. */ #ifdef SISDUALHEAD if(!pSiS->DualHeadMode) { #endif #ifdef SISMERGED if(!(pSiS->MergedFB)) { #endif modes = SISSetupDGAMode(pScrn, modes, &num, 8, 8, (pScrn->bitsPerPixel == 8), ((pScrn->bitsPerPixel != 8) ? 0 : pScrn->displayWidth), 0, 0, 0, PseudoColor); #ifdef SISMERGED } #endif #ifdef SISDUALHEAD } #endif /* 16 */ modes = SISSetupDGAMode(pScrn, modes, &num, 16, 16, (pScrn->bitsPerPixel == 16), ((pScrn->depth != 16) ? 0 : pScrn->displayWidth), 0xf800, 0x07e0, 0x001f, TrueColor); if((pSiS->VGAEngine == SIS_530_VGA) || (pSiS->VGAEngine == SIS_OLD_VGA)) { /* 24 */ modes = SISSetupDGAMode(pScrn, modes, &num, 24, 24, (pScrn->bitsPerPixel == 24), ((pScrn->bitsPerPixel != 24) ? 0 : pScrn->displayWidth), 0xff0000, 0x00ff00, 0x0000ff, TrueColor); } if(pSiS->VGAEngine != SIS_OLD_VGA) { /* 32 */ modes = SISSetupDGAMode(pScrn, modes, &num, 32, 24, (pScrn->bitsPerPixel == 32), ((pScrn->bitsPerPixel != 32) ? 0 : pScrn->displayWidth), 0xff0000, 0x00ff00, 0x0000ff, TrueColor); } pSiS->numDGAModes = num; pSiS->DGAModes = modes; if(num) { if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA) || (pSiS->VGAEngine == SIS_530_VGA)) { return DGAInit(pScreen, &SISDGAFuncs3xx, modes, num); } else { return DGAInit(pScreen, &SISDGAFuncs, modes, num); } } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "No DGA-suitable modes found, disabling DGA\n"); return TRUE; } } static Bool SIS_OpenFramebuffer( ScrnInfoPtr pScrn, char **name, #ifndef NEW_DGAOPENFRAMEBUFFER UChar **mem, int *size, int *offset, int *flags #else unsigned int *mem, unsigned int *size, unsigned int *offset, unsigned int *flags #endif ){ SISPtr pSiS = SISPTR(pScrn); *name = NULL; /* no special device */ #ifndef NEW_DGAOPENFRAMEBUFFER *mem = (UChar *)pSiS->FbAddress; #else *mem = pSiS->FbAddress; #endif *size = pSiS->maxxfbmem; *offset = 0; #ifndef NEW_DGAOPENFRAMEBUFFER *flags = DGA_NEED_ROOT; #else *flags = 0; #endif return TRUE; } static Bool SIS_SetMode( ScrnInfoPtr pScrn, DGAModePtr pMode ){ static SISFBLayout BackupLayouts[MAXSCREENS]; int index = pScrn->pScreen->myNum; SISPtr pSiS = SISPTR(pScrn); if(!pMode) { /* restore the original mode */ if(pSiS->DGAactive) { /* put the ScreenParameters back */ memcpy(&pSiS->CurrentLayout, &BackupLayouts[index], sizeof(SISFBLayout)); } pScrn->currentMode = pSiS->CurrentLayout.mode; pSiS->DGAactive = FALSE; (*pScrn->SwitchMode)(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode)); (*pScrn->AdjustFrame)(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); } else { /* set new mode */ if(!pSiS->DGAactive) { /* save the old parameters */ memcpy(&BackupLayouts[index], &pSiS->CurrentLayout, sizeof(SISFBLayout)); pSiS->DGAactive = TRUE; } pSiS->CurrentLayout.bitsPerPixel = pMode->bitsPerPixel; pSiS->CurrentLayout.depth = pMode->depth; pSiS->CurrentLayout.displayWidth = pMode->bytesPerScanline / (pMode->bitsPerPixel >> 3); pSiS->CurrentLayout.displayHeight = pMode->imageHeight; (*pScrn->SwitchMode)(SWITCH_MODE_ARGS(pScrn, pMode->mode)); /* Adjust viewport to 0/0 after mode switch */ /* This fixes the vmware-in-dualhead problems */ (*pScrn->AdjustFrame)(ADJUST_FRAME_ARGS(pScrn, 0, 0)); pSiS->CurrentLayout.DGAViewportX = pSiS->CurrentLayout.DGAViewportY = 0; } return TRUE; } static int SIS_GetViewport( ScrnInfoPtr pScrn ){ SISPtr pSiS = SISPTR(pScrn); return pSiS->DGAViewportStatus; } static void SIS_SetViewport( ScrnInfoPtr pScrn, int x, int y, int flags ){ SISPtr pSiS = SISPTR(pScrn); (*pScrn->AdjustFrame)(ADJUST_FRAME_ARGS(pScrn, x, y)); pSiS->DGAViewportStatus = 0; /* There are never pending Adjusts */ pSiS->CurrentLayout.DGAViewportX = x; pSiS->CurrentLayout.DGAViewportY = y; } static void SIS_Sync( ScrnInfoPtr pScrn ){ SISPtr pSiS = SISPTR(pScrn); (*pSiS->SyncAccel)(pScrn); } static void SIS_FillRect( ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned long color ){ SISPtr pSiS = SISPTR(pScrn); if(pSiS->FillRect) { (*pSiS->FillRect)(pScrn, x, y, w, h, (int)color); #ifdef SIS_USE_XAA if(!pSiS->useEXA && pSiS->AccelInfoPtr) { SET_SYNC_FLAG(pSiS->AccelInfoPtr); } #endif } } static void SIS_BlitRect( ScrnInfoPtr pScrn, int srcx, int srcy, int w, int h, int dstx, int dsty ){ SISPtr pSiS = SISPTR(pScrn); if(pSiS->BlitRect) { (*pSiS->BlitRect)(pScrn, srcx, srcy, dstx, dsty, w, h, -1); #ifdef SIS_USE_XAA if(!pSiS->useEXA && pSiS->AccelInfoPtr) { SET_SYNC_FLAG(pSiS->AccelInfoPtr); } #endif } } static void SIS_BlitTransRect( ScrnInfoPtr pScrn, int srcx, int srcy, int w, int h, int dstx, int dsty, ULong color ){ SISPtr pSiS = SISPTR(pScrn); if(pSiS->BlitRect) { (*pSiS->BlitRect)(pScrn, srcx, srcy, dstx, dsty, w, h, (int)color); #ifdef SIS_USE_XAA if(!pSiS->useEXA && pSiS->AccelInfoPtr) { SET_SYNC_FLAG(pSiS->AccelInfoPtr); } #endif } } xf86-video-sis-0.10.7/src/oem300.h0000664000076400007640000004740611763614406013213 00000000000000/* * OEM Data for 300 series * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * If distributed as part of the Linux kernel, the following license terms * apply: * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the named License, * * or any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA * * Otherwise, the following license terms apply: * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted provided that the following conditions * * are met: * * 1) Redistributions of source code must retain the above copyright * * notice, this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright * * notice, this list of conditions and the following disclaimer in the * * documentation and/or other materials provided with the distribution. * * 3) The name of the author may not be used to endorse or promote products * * derived from this software without specific prior written permission. * * * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * */ static const unsigned char SiS300_OEMTVDelay301[8][4] = { {0x08,0x08,0x08,0x08}, {0x08,0x08,0x08,0x08}, {0x08,0x08,0x08,0x08}, {0x2c,0x2c,0x2c,0x2c}, {0x08,0x08,0x08,0x08}, {0x08,0x08,0x08,0x08}, {0x08,0x08,0x08,0x08}, {0x20,0x20,0x20,0x20} }; static const unsigned char SiS300_OEMTVDelayLVDS[8][4] = { {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20} }; static const unsigned char SiS300_OEMTVFlicker[8][4] = { {0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00} }; static const unsigned char SiS300_OEMLCDDelay2[64][4] = /* for 301/301b/302b/301LV/302LV */ { {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20} }; static const unsigned char SiS300_OEMLCDDelay4[12][4] = { {0x2c,0x2c,0x2c,0x2c}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x2c,0x2c,0x2c,0x2c}, {0x2c,0x2c,0x2c,0x2c}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x24,0x24,0x24,0x24}, {0x24,0x24,0x24,0x24}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x24,0x24,0x24,0x24} }; static const unsigned char SiS300_OEMLCDDelay5[32][4] = { {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, }; static const unsigned char SiS300_OEMLCDDelay3[64][4] = /* For LVDS */ { {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20}, {0x20,0x20,0x20,0x20} }; static const unsigned char SiS300_Phase1[8][5][4] = { { {0x21,0xed,0x00,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} }, { {0x21,0xed,0x00,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} } }; static const unsigned char SiS300_Phase2[8][5][4] = { { {0x21,0xed,0x00,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} }, { {0x21,0xed,0x00,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08}, {0x21,0xed,0x8a,0x08} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} }, { {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00}, {0x2a,0x05,0xd3,0x00} } }; static const unsigned char SiS300_Filter1[10][16][4] = { { {0x00,0xf4,0x10,0x38}, {0x00,0xf4,0x10,0x38}, {0xeb,0x04,0x10,0x18}, {0xf7,0x06,0x19,0x14}, {0x00,0xf4,0x10,0x38}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x15,0x25,0xf6}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18} }, { {0x00,0xf4,0x10,0x38}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x10,0x32}, {0xf3,0x00,0x1d,0x20}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xfc,0xfb,0x14,0x2a}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32} }, { {0x00,0xf4,0x10,0x38}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x10,0x32}, {0xf3,0x00,0x1d,0x20}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xfc,0xfb,0x14,0x2a}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32} }, { {0x00,0xf4,0x10,0x38}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x10,0x32}, {0xf3,0x00,0x1d,0x20}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xfc,0xfb,0x14,0x2a}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32} }, { {0x00,0xf4,0x10,0x38}, {0x00,0xf4,0x10,0x38}, {0xeb,0x04,0x10,0x18}, {0xf7,0x06,0x19,0x14}, {0x00,0xf4,0x10,0x38}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x15,0x25,0xf6}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18} }, { {0x00,0xf4,0x10,0x38}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x10,0x32}, {0xf3,0x00,0x1d,0x20}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xfc,0xfb,0x14,0x2a}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32} }, { {0x00,0xf4,0x10,0x38}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x10,0x32}, {0xf3,0x00,0x1d,0x20}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xfc,0xfb,0x14,0x2a}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32} }, { {0x00,0xf4,0x10,0x38}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x10,0x32}, {0xf3,0x00,0x1d,0x20}, {0x00,0xf4,0x10,0x38}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xfc,0xfb,0x14,0x2a}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32}, {0xf1,0xf7,0x1f,0x32} }, { {0x00,0xf4,0x10,0x38}, {0x00,0xf4,0x10,0x38}, {0xeb,0x04,0x10,0x18}, {0xf7,0x06,0x19,0x14}, {0x00,0xf4,0x10,0x38}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x15,0x25,0xf6}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18} }, { {0x00,0xf4,0x10,0x38}, {0x00,0xf4,0x10,0x38}, {0xeb,0x04,0x10,0x18}, {0xf7,0x06,0x19,0x14}, {0x00,0xf4,0x10,0x38}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x15,0x25,0xf6}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18}, {0xeb,0x04,0x25,0x18} }, }; static const unsigned char SiS300_Filter2[10][9][7] = { { {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} }, { {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} }, { {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} }, { {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} }, { {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} }, { {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} }, { {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} }, { {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} }, { {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} }, { {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} } }; /* Custom data for Barco iQ Pro R300 */ static const unsigned char barco_p1[2][9][7][3] = { { { { 0x16, 0xcf, 0x00 }, { 0x18, 0x00, 0x00 }, { 0x1a, 0xe7, 0x00 }, { 0x1b, 0x26, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0x1e, 0x19, 0x00 } }, { { 0x16, 0xcf, 0x00 }, { 0x18, 0x00, 0x00 }, { 0x1a, 0xe7, 0x00 }, { 0x1b, 0x1e, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0x1e, 0x16, 0x00 } }, { { 0x16, 0xcf, 0x00 }, { 0x1a, 0xe7, 0x00 }, { 0x1b, 0x26, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0x1e, 0x19, 0x00 }, { 0, 0, 0 } }, { { 0, 0, 0 } }, { { 0x16, 0xcf, 0x00 }, { 0x1a, 0xe7, 0x00 }, { 0x1b, 0x26, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0x1e, 0x1e, 0x00 }, { 0, 0, 0 } }, { { 0x16, 0xd1, 0x00 }, { 0x18, 0x00, 0x00 }, { 0x1a, 0xe7, 0x00 }, { 0x1b, 0x11, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0x1e, 0x26, 0x00 } }, { { 0x16, 0xd1, 0x00 }, { 0x1a, 0xe7, 0x00 }, { 0x1b, 0x26, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0x1e, 0x30, 0x00 }, { 0, 0, 0 } }, { { 0x16, 0x00, 0x00 }, { 0x17, 0xa0, 0x00 }, { 0x1a, 0xa0, 0x00 }, { 0x1b, 0x2a, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0, 0, 0 } }, { { 0x16, 0x00, 0x00 }, { 0x17, 0xaa, 0x00 }, { 0x1a, 0xa0, 0x00 }, { 0x1b, 0x2a, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0, 0, 0 } } }, { { { 0x16, 0xcf, 0x00 }, { 0x18, 0x00, 0x00 }, { 0x1a, 0xe7, 0x00 }, { 0x1b, 0x26, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0x1e, 0x19, 0x00 } }, { { 0, 0, 0 } }, { { 0x16, 0xcf, 0x00 }, { 0x18, 0x00, 0x00 }, { 0x1a, 0xe7, 0x00 }, { 0x1b, 0x26, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0x1e, 0x19, 0x00 }, }, { { 0, 0, 0 } }, { { 0x16, 0xcf, 0x00 }, { 0x18, 0x00, 0x00 }, { 0x1a, 0xe7, 0x00 }, { 0x1b, 0x26, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0x1e, 0x1e, 0x00 } }, { { 0x16, 0xd1, 0x00 }, { 0x18, 0x00, 0x00 }, { 0x1a, 0xe6, 0x00 }, { 0x1b, 0x11, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0x1e, 0x26, 0x00 } }, { { 0x18, 0x00, 0x00 }, { 0x1a, 0xe0, 0x00 }, { 0x1b, 0x26, 0x00 }, { 0x1c, 0xff, 0x00 }, { 0x1d, 0x1c, 0x00 }, { 0x1e, 0x30, 0x00 }, { 0, 0, 0 } }, { { 0, 0, 0 } }, { { 0, 0, 0 } } } }; xf86-video-sis-0.10.7/src/sis6326_video.c0000664000076400007640000014040311763614406014477 00000000000000/* * Xv driver for SiS 5597/5598, 6326 and 530/620. * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "sis.h" #ifdef SIS_USE_XAA #include "xf86fbman.h" #endif #include "xf86xv.h" #include "regionstr.h" #include #include "dixstruct.h" #include "fourcc.h" #define SIS_NEED_inSISREG #define SIS_NEED_outSISREG #define SIS_NEED_inSISIDXREG #define SIS_NEED_outSISIDXREG #define SIS_NEED_setSISIDXREGmask #include "sis_regs.h" #define OFF_DELAY 200 /* milliseconds */ #define FREE_DELAY 60000 #define OFF_TIMER 0x01 #define FREE_TIMER 0x02 #define CLIENT_VIDEO_ON 0x04 #define TIMER_MASK (OFF_TIMER | FREE_TIMER) #define WATCHDOG_DELAY 500000 /* Watchdog counter for Vertical Restrace waiting */ static XF86VideoAdaptorPtr SIS6326SetupImageVideo(ScreenPtr); static void SIS6326StopVideo(ScrnInfoPtr, pointer, Bool); static int SIS6326SetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer); static int SIS6326GetPortAttribute(ScrnInfoPtr, Atom ,INT32 *, pointer); static void SIS6326QueryBestSize(ScrnInfoPtr, Bool, short, short, short, short, unsigned int *,unsigned int *, pointer); static int SIS6326PutImage( ScrnInfoPtr, short, short, short, short, short, short, short, short, int, unsigned char*, short, short, Bool, RegionPtr, pointer, DrawablePtr); static int SIS6326QueryImageAttributes(ScrnInfoPtr, int, unsigned short *, unsigned short *, int *, int *); static void SIS6326VideoTimerCallback(ScrnInfoPtr pScrn, Time now); static void SIS6326InitOffscreenImages(ScreenPtr pScrn); extern unsigned int SISAllocateFBMemory(ScrnInfoPtr pScrn, void **handle, int bytesize); extern void SISFreeFBMemory(ScrnInfoPtr pScrn, void **handle); #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) static Atom xvBrightness, xvContrast, xvColorKey; static Atom xvAutopaintColorKey, xvSetDefaults; static Atom xvDisableGfx; #define IMAGE_MIN_WIDTH 32 /* Minimum and maximum image sizes */ #define IMAGE_MIN_HEIGHT 24 #define IMAGE_MAX_WIDTH 720 /* Are these correct for the chips ? */ #define IMAGE_MAX_HEIGHT 576 #define IMAGE_MAX_WIDTH_5597 384 #define IMAGE_MAX_HEIGHT_5597 288 #if 0 static int oldH, oldW; #endif /**************************************************************************** * Raw register access : These routines directly interact with the sis's * control aperature. Must not be called until after * the board's pci memory has been mapped. ****************************************************************************/ #if 0 static CARD32 _sisread(SISPtr pSiS, CARD32 reg) { return *(pSiS->IOBase + reg); } static void _siswrite(SISPtr pSiS, CARD32 reg, CARD32 data) { *(pSiS->IOBase + reg) = data; } #endif static CARD8 getvideoreg(SISPtr pSiS, CARD8 reg) { CARD8 ret; inSISIDXREG(SISCR, reg, ret); return ret; } static __inline void setvideoreg(SISPtr pSiS, CARD8 reg, CARD8 data) { outSISIDXREG(SISCR, reg, data); } static __inline void setvideoregmask(SISPtr pSiS, CARD8 reg, CARD8 data, CARD8 mask) { setSISIDXREGmask(SISCR, reg, data, mask); } /* VBlank */ static CARD8 vblank_active_CRT1(SISPtr pSiS) { return (inSISREG(SISINPSTAT) & 0x08); } /* Scanline - unused */ #if 0 static CARD32 get_scanline_CRT1(SISPtr pSiS) { CARD8 temp; temp = getvideoreg(pSiS, 0x20); temp = getvideoreg(pSiS, 0x1b); return((getvideoreg(pSiS, 0x1d) << 8) | getvideoreg(pSiS, 0x1c)); } #endif void SIS6326InitVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; XF86VideoAdaptorPtr newAdaptor = NULL; int num_adaptors; newAdaptor = SIS6326SetupImageVideo(pScreen); if(newAdaptor) { SIS6326InitOffscreenImages(pScreen); } num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); if(newAdaptor) { if(!num_adaptors) { num_adaptors = 1; adaptors = &newAdaptor; } else { /* need to free this someplace */ newAdaptors = malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); if(newAdaptors) { memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr)); newAdaptors[num_adaptors] = newAdaptor; adaptors = newAdaptors; num_adaptors++; } } } if(num_adaptors) xf86XVScreenInit(pScreen, adaptors, num_adaptors); if(newAdaptors) free(newAdaptors); } /* client libraries expect an encoding */ static XF86VideoEncodingRec DummyEncoding = { 0, "XV_IMAGE", IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT, {1, 1} }; static XF86VideoEncodingRec DummyEncoding5597 = { 0, "XV_IMAGE", IMAGE_MAX_WIDTH_5597, IMAGE_MAX_HEIGHT_5597, {1, 1} }; #define NUM_FORMATS 4 static XF86VideoFormatRec SIS6326Formats[NUM_FORMATS] = { { 8, PseudoColor}, {15, TrueColor}, {16, TrueColor}, {24, TrueColor} }; #define NUM_ATTRIBUTES 6 static XF86AttributeRec SIS6326Attributes[NUM_ATTRIBUTES] = { {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"}, {XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"}, {XvSettable | XvGettable, 0, 7, "XV_CONTRAST"}, {XvSettable | XvGettable, 0, 1, "XV_AUTOPAINT_COLORKEY"}, {XvSettable , 0, 0, "XV_SET_DEFAULTS"}, {XvSettable | XvGettable, 0, 1, "XV_DISABLE_GRAPHICS"} }; #define NUM_IMAGES 6 #define NUM_IMAGES_NOYV12 4 #define PIXEL_FMT_YV12 FOURCC_YV12 /* 0x32315659 */ #define PIXEL_FMT_UYVY FOURCC_UYVY /* 0x59565955 */ #define PIXEL_FMT_YUY2 FOURCC_YUY2 /* 0x32595559 */ #define PIXEL_FMT_I420 FOURCC_I420 /* 0x30323449 */ #define PIXEL_FMT_RGB5 0x35315652 #define PIXEL_FMT_RGB6 0x36315652 static XF86ImageRec SIS6326Images[NUM_IMAGES] = { XVIMAGE_YUY2, /* If order is changed, SIS6326OffscreenImages must be adapted */ XVIMAGE_UYVY, XVIMAGE_YV12, XVIMAGE_I420, { 0x35315652, XvRGB, LSBFirst, {'R','V','1','5', 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 16, XvPacked, 1, 15, 0x7C00, 0x03E0, 0x001F, 0, 0, 0, 0, 0, 0, 0, 0, 0, {'R', 'V', 'B',0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, XvTopToBottom }, { 0x36315652, XvRGB, LSBFirst, {'R','V','1','6', 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 16, XvPacked, 1, 16, 0xF800, 0x07E0, 0x001F, 0, 0, 0, 0, 0, 0, 0, 0, 0, {'R', 'V', 'B',0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, XvTopToBottom } }; static XF86ImageRec SIS6326ImagesNoYV12[NUM_IMAGES_NOYV12] = { XVIMAGE_YUY2, /* If order is changed, SIS6326OffscreenImages must be adapted */ XVIMAGE_UYVY, { 0x35315652, XvRGB, LSBFirst, {'R','V','1','5', 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 16, XvPacked, 1, 15, 0x7C00, 0x03E0, 0x001F, 0, 0, 0, 0, 0, 0, 0, 0, 0, {'R', 'V', 'B',0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, XvTopToBottom }, { 0x36315652, XvRGB, LSBFirst, {'R','V','1','6', 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 16, XvPacked, 1, 16, 0xF800, 0x07E0, 0x001F, 0, 0, 0, 0, 0, 0, 0, 0, 0, {'R', 'V', 'B',0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, XvTopToBottom } }; typedef struct { int pixelFormat; CARD16 pitch; CARD8 keyOP; CARD8 HUSF; CARD8 VUSF; CARD8 HIntBit; CARD8 wHPre; CARD8 PitchMult; CARD16 srcW; CARD16 srcH; BoxRec dstBox; CARD32 PSY; CARD32 PSV; CARD32 PSU; CARD8 YUVEnd; CARD8 lineBufSize; CARD8 (*VBlankActiveFunc)(SISPtr); /* CARD32 (*GetScanLineFunc)(SISPtr pSiS); */ } SISOverlayRec, *SISOverlayPtr; typedef struct { void * handle; CARD32 bufAddr[2]; unsigned char currentBuf; short drw_x, drw_y, drw_w, drw_h; short src_x, src_y, src_w, src_h; int id; short srcPitch, height, width; CARD32 totalSize; char brightness; unsigned char contrast; RegionRec clip; CARD32 colorKey; Bool autopaintColorKey; Bool disablegfx; CARD32 videoStatus; Time offTime; Time freeTime; short oldx1, oldx2, oldy1, oldy2; int mustwait; Bool grabbedByV4L; /* V4L stuff */ int pitch; int offset; } SISPortPrivRec, *SISPortPrivPtr; #define GET_PORT_PRIVATE(pScrn) \ (SISPortPrivPtr)((SISPTR(pScrn))->adaptor->pPortPrivates[0].ptr) static void SIS6326SetPortDefaults(ScrnInfoPtr pScrn, SISPortPrivPtr pPriv) { SISPtr pSiS = SISPTR(pScrn); pPriv->colorKey = 0x000101fe; pPriv->videoStatus = 0; pPriv->brightness = pSiS->XvDefBri; /* 0; - see sis_opt.c */ pPriv->contrast = pSiS->XvDefCon; /* 4; */ pPriv->autopaintColorKey = TRUE; pPriv->disablegfx = pSiS->XvDefDisableGfx; } static void SIS6326ResetVideo(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); /* Unlock registers */ #ifdef UNLOCK_ALWAYS sisSaveUnlockExtRegisterLock(pSiS, NULL, NULL); #endif if(getvideoreg(pSiS, Index_VI6326_Passwd) != 0xa1) { setvideoreg(pSiS, Index_VI6326_Passwd, 0x86); if(getvideoreg(pSiS, Index_VI6326_Passwd) != 0xa1) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Xv: Video password could not unlock video registers\n"); } /* Initialize the overlay ----------------------------------- */ switch(pSiS->Chipset) { case PCI_CHIP_SIS5597: /* Disable overlay (D[1]) & capture (D[0]) */ setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x03); /* What do these do? (Datasheet names these bits "reserved") */ setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x18); setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x0c); /* Select YUV format (D[6]) and "gfx + video" mode (D[4]), odd polarity? (D[7]) */ setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x40, 0xD0); /* No interrupt, no filter, disable dithering */ setvideoregmask(pSiS, Index_VI6326_Control_Misc1, 0x00, 0x7A); /* Disable Brooktree support (D[6]) and system memory framebuffer (D[7]) */ setvideoregmask(pSiS, Index_VI6326_Control_Misc3, 0x00, 0xC0); /* Disable video decimation (has a really strange effect if enabled) */ setvideoregmask(pSiS, Index_VI6326_Control_Misc6, 0x00, 0x80); break; case PCI_CHIP_SIS6326: /* Disable overlay (D[1]) & capture (D[0]) */ setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x03); /* What do these do? (Datasheet names these bits "reserved") */ setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x18); setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x0c); /* Select YUV format (D[6]) and "gfx + video" mode (D[4]), odd polarity? (D[7]) */ setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x40, 0xD0); /* No interrupt, no filter, disable dithering */ setvideoregmask(pSiS, Index_VI6326_Control_Misc1, 0x00, 0x7A); /* Disable VMI (D[4:3]), Brooktree support (D[6]) and system memory framebuffer (D[7]) */ setvideoregmask(pSiS, Index_VI6326_Control_Misc3, 0x00, 0xF8); /* Disable video decimation */ setvideoregmask(pSiS, Index_VI6326_Control_Misc6, 0x00, 0x80); break; case PCI_CHIP_SIS530: setvideoregmask(pSiS, Index_VI6326_Control_Misc4, 0x40, 0x40); /* Disable overlay (D[1]) */ setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x02); /* What do D[3:2] do? (Datasheet names these bits "reserved") */ setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x18); setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x0c); /* Select YUV format (D[6]) and "gfx + video" mode (D[4]) */ setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x40, 0x50); break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: SiS6326ResetVideo() called with invalid chipset (%x)\n", pSiS->Chipset); return; } /* Clear format selection */ setvideoregmask(pSiS, Index_VI6326_Control_Misc1, 0x00, 0x04); if(pSiS->oldChipset >= OC_SIS5597) { setvideoregmask(pSiS, Index_VI6326_Control_Misc4, 0x00, 0x05); } /* Select RGB Chromakey format (D[2]=0), CCIR 601 UV data format (D[1]=0) */ /* D[1]: 1 = 2's complement, 0 = CCIR 601 format */ setvideoregmask(pSiS, Index_VI6326_Control_Misc3, 0x00, 0x06); /* Reset contrast control */ setvideoregmask(pSiS, Index_VI6326_Contrast_Enh_Ctrl, 0x04, 0x1F); /* Set threshold */ if(pSiS->oldChipset < OC_SIS6326) { CARD8 temp; inSISIDXREG(SISSR, 0x33, temp); /* Synchronous DRAM Timing? */ if(temp & 0x01) temp = 0x50; else temp = 0; setvideoreg(pSiS, Index_VI6326_Play_Threshold_Low, temp); setvideoreg(pSiS, Index_VI6326_Play_Threshold_High, temp); } else { CARD8 temp; setvideoreg(pSiS, Index_VI6326_Play_Threshold_Low, 0x00); setvideoreg(pSiS, Index_VI6326_Play_Threshold_High, 0x00); inSISIDXREG(SISSR, 0x33, temp); /* Are we using SGRAM Timing? */ if(temp & 0x01) temp = 0x10; else temp = 0; setvideoregmask(pSiS, Index_VI6326_Control_Misc4, temp, 0x10); } /* set default properties for overlay ------------------------------- */ setvideoregmask(pSiS, Index_VI6326_Contrast_Enh_Ctrl, 0x04, 0x07); setvideoreg(pSiS, Index_VI6326_Brightness, 0x20); if(pSiS->oldChipset < OC_SIS6205A || pSiS->oldChipset > OC_SIS82204) { setvideoregmask(pSiS, Index_VI6326_AlphaGraph, 0x00, 0xF8); setvideoregmask(pSiS, Index_VI6326_AlphaVideo, 0xF8, 0xF8); } else { setvideoregmask(pSiS, Index_VI6326_AlphaGraph, 0x00, 0xE1); setvideoregmask(pSiS, Index_VI6326_AlphaVideo, 0xE1, 0xE1); } } static XF86VideoAdaptorPtr SIS6326SetupImageVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SISPtr pSiS = SISPTR(pScrn); XF86VideoAdaptorPtr adapt; SISPortPrivPtr pPriv; #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,1,99,1,0) XAAInfoRecPtr pXAA = pSiS->AccelInfoPtr; if(!pXAA || !pXAA->FillSolidRects) return NULL; #endif if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + sizeof(SISPortPrivRec) + sizeof(DevUnion)))) return NULL; adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; adapt->name = "SIS 5597/5598/6326/530/620 Video Overlay"; adapt->nEncodings = 1; if(pSiS->oldChipset < OC_SIS6326) { adapt->pEncodings = &DummyEncoding5597; } else { adapt->pEncodings = &DummyEncoding; } adapt->nFormats = NUM_FORMATS; adapt->pFormats = SIS6326Formats; adapt->nPorts = 1; adapt->pPortPrivates = (DevUnion*)(&adapt[1]); pPriv = (SISPortPrivPtr)(&adapt->pPortPrivates[1]); adapt->pPortPrivates[0].ptr = (pointer)(pPriv); adapt->pAttributes = SIS6326Attributes; adapt->nAttributes = NUM_ATTRIBUTES; if(pSiS->NoYV12 == 1) { adapt->nImages = NUM_IMAGES_NOYV12; adapt->pImages = SIS6326ImagesNoYV12; } else { adapt->nImages = NUM_IMAGES; adapt->pImages = SIS6326Images; } adapt->PutVideo = NULL; adapt->PutStill = NULL; adapt->GetVideo = NULL; adapt->GetStill = NULL; adapt->StopVideo = SIS6326StopVideo; adapt->SetPortAttribute = SIS6326SetPortAttribute; adapt->GetPortAttribute = SIS6326GetPortAttribute; adapt->QueryBestSize = SIS6326QueryBestSize; adapt->PutImage = SIS6326PutImage; adapt->QueryImageAttributes = SIS6326QueryImageAttributes; pPriv->videoStatus = 0; pPriv->currentBuf = 0; pPriv->handle = NULL; pPriv->grabbedByV4L= FALSE; SIS6326SetPortDefaults(pScrn, pPriv); /* gotta uninit this someplace */ #if defined(REGION_NULL) REGION_NULL(pScreen, &pPriv->clip); #else REGION_INIT(pScreen, &pPriv->clip, NullBox, 0); #endif pSiS->adaptor = adapt; xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); xvContrast = MAKE_ATOM("XV_CONTRAST"); xvColorKey = MAKE_ATOM("XV_COLORKEY"); xvAutopaintColorKey = MAKE_ATOM("XV_AUTOPAINT_COLORKEY"); xvSetDefaults = MAKE_ATOM("XV_SET_DEFAULTS"); xvDisableGfx = MAKE_ATOM("XV_DISABLE_GRAPHICS"); SIS6326ResetVideo(pScrn); pSiS->ResetXv = SIS6326ResetVideo; return adapt; } #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,3,0) static Bool RegionsEqual(RegionPtr A, RegionPtr B) { int *dataA, *dataB; int num; num = REGION_NUM_RECTS(A); if(num != REGION_NUM_RECTS(B)) return FALSE; if((A->extents.x1 != B->extents.x1) || (A->extents.x2 != B->extents.x2) || (A->extents.y1 != B->extents.y1) || (A->extents.y2 != B->extents.y2)) return FALSE; dataA = (int*)REGION_RECTS(A); dataB = (int*)REGION_RECTS(B); while(num--) { if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1])) return FALSE; dataA += 2; dataB += 2; } return TRUE; } #endif static int SIS6326SetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value, pointer data) { SISPortPrivPtr pPriv = (SISPortPrivPtr)data; if(attribute == xvBrightness) { if((value < -128) || (value > 127)) return BadValue; pPriv->brightness = value; } else if(attribute == xvContrast) { if((value < 0) || (value > 7)) return BadValue; pPriv->contrast = value; } else if(attribute == xvColorKey) { pPriv->colorKey = value; REGION_EMPTY(pScrn->pScreen, &pPriv->clip); } else if (attribute == xvAutopaintColorKey) { if((value < 0) || (value > 1)) return BadValue; pPriv->autopaintColorKey = value; } else if(attribute == xvDisableGfx) { if((value < 0) || (value > 1)) return BadValue; pPriv->disablegfx = value; } else if (attribute == xvSetDefaults) { SIS6326SetPortDefaults(pScrn, pPriv); } else return BadMatch; return Success; } static int SIS6326GetPortAttribute( ScrnInfoPtr pScrn, Atom attribute, INT32 *value, pointer data ){ SISPortPrivPtr pPriv = (SISPortPrivPtr)data; if(attribute == xvBrightness) { *value = pPriv->brightness; } else if(attribute == xvContrast) { *value = pPriv->contrast; } else if(attribute == xvColorKey) { *value = pPriv->colorKey; } else if (attribute == xvAutopaintColorKey) { *value = (pPriv->autopaintColorKey) ? 1 : 0; } else if (attribute == xvDisableGfx) { *value = (pPriv->disablegfx) ? 1 : 0; } else return BadMatch; return Success; } static void SIS6326QueryBestSize( ScrnInfoPtr pScrn, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, unsigned int *p_h, pointer data ){ *p_w = drw_w; *p_h = drw_h; /* TODO: report the HW limitation */ } static void /* V 530/6326 */ calc_scale_factor(SISPtr pSiS, SISOverlayPtr pOverlay, ScrnInfoPtr pScrn, SISPortPrivPtr pPriv) { CARD32 temp=0; int dstW = pOverlay->dstBox.x2 - pOverlay->dstBox.x1; int dstH = pOverlay->dstBox.y2 - pOverlay->dstBox.y1; int srcW = pOverlay->srcW; int srcH = pOverlay->srcH; /* For double scan modes, we need to double the height */ if(pSiS->CurrentLayout.mode->Flags & V_DBLSCAN) { dstH <<= 1; } /* For interlace modes, we need to half the height */ if(pSiS->CurrentLayout.mode->Flags & V_INTERLACE) { dstH >>= 1; } /* Horizontal */ if(dstW < IMAGE_MIN_WIDTH) dstW = IMAGE_MIN_WIDTH; if(dstW == srcW) { pOverlay->HUSF = 0x00; pOverlay->HIntBit = 0x01; } else if(dstW > srcW) { pOverlay->HIntBit = 0x00; temp = srcW * 64 / (dstW + 1); if(temp > 63) temp = 63; pOverlay->HUSF = temp; } else { /* 6326 can't scale below factor .440 - to check with 530/620 */ if(((dstW * 1000) / srcW) < 440) dstW = ((srcW * 440) / 1000) + 1; temp = srcW / dstW; if(temp > 15) temp = 15; pOverlay->HIntBit = temp; temp = srcW * 64 / dstW; pOverlay->HUSF = temp - (pOverlay->HIntBit * 64); } /* Vertical */ if(dstH < IMAGE_MIN_HEIGHT) dstH = IMAGE_MIN_HEIGHT; if(dstH == srcH) { pOverlay->VUSF = 0x00; pOverlay->PitchMult = 1; } else if(dstH > srcH) { temp = srcH * 64 / (dstH + 1); if (temp > 63) temp = 63; pOverlay->VUSF = temp; pOverlay->PitchMult = 1; } else { /* 6326 can't scale below factor .440 - to check with 530/620 */ if(((dstH * 1000) / srcH) < 440) dstH = ((srcH * 440) / 1000) + 1; temp = srcH / dstH; if(srcH % dstH) { temp++; pOverlay->VUSF = (srcH * 64) / (temp * dstH); } else { pOverlay->VUSF = 0x00; } pOverlay->PitchMult = temp; } } static void calc_line_buf_size(SISOverlayPtr pOverlay) { CARD32 I; CARD32 line = pOverlay->srcW; if( (pOverlay->pixelFormat == PIXEL_FMT_YV12) || (pOverlay->pixelFormat == PIXEL_FMT_I420) ) { I = (line >> 5) + (((line >> 6) * 2)) + 3; I <<= 5; } else { /* YUV2, UYVY, RGB */ I = line << 1; if(I & 7) I += 8; } I += 8; I >>= 3; pOverlay->lineBufSize = (CARD8)I; } static void merge_line_buf(SISPtr pSiS, SISPortPrivPtr pPriv, Bool enable) { if(enable) { setvideoregmask(pSiS, Index_VI6326_Control_Misc5, 0x10, 0x10); } else { setvideoregmask(pSiS, Index_VI6326_Control_Misc5, 0x00, 0x10); } } static void set_format(SISPtr pSiS, SISOverlayPtr pOverlay) { CARD8 fmt, misc0, misc1, misc4; switch(pOverlay->pixelFormat) { case PIXEL_FMT_YV12: case PIXEL_FMT_I420: /* V/530 V/6326 */ fmt = 0x80; /* D[7:6] 10 YUV2(=YUYV), 01 VYUY, 00 UYVY, 11 YVYU / 00 RGB 555, 01 RGB 565 */ misc0 = 0x40; /* D[6]: 1 = YUV, 0 = RGB */ misc4 = 0x05; /* D[1:0] 00 RGB 555, 01 YUV 422, 10 RGB 565; D[2] 1 = YUV420 mode */ misc1 = 0xff; break; case PIXEL_FMT_UYVY: fmt = 0x00; /* D[7:6] 10 YUV2(=YUYV), 01 VYUY, 00 UYVY, 11 YVYU / 00 RGB 555, 01 RGB 565 */ misc0 = 0x40; /* D[6]: 1 = YUV, 0 = RGB */ misc4 = 0x00; /* D[1:0] 00 RGB 555, 01 YUV 422, 10 RGB 565; D[2] 1 = YUV420 mode */ misc1 = 0xff; break; case PIXEL_FMT_YUY2: /* V/530 V/6326 */ fmt = 0x80; /* D[7:6] 10 YUV2(=YUYV), 01 VYUY, 00 UYVY, 11 YVYU / 00 RGB 555, 01 RGB 565 */ misc0 = 0x40; /* D[6]: 1 = YUV, 0 = RGB */ misc4 = 0x00; /* D[1:0] 00 RGB 555, 01 YUV 422, 10 RGB 565; D[2] 1 = YUV420 mode */ misc1 = 0xff; break; case PIXEL_FMT_RGB6: /* V/530 V/6326 */ fmt = 0x40; /* D[7:6] 10 YUV2(=YUYV), 01 VYUY, 00 UYVY, 11 YVYU / 00 RGB 555, 01 RGB 565 */ misc0 = 0x00; /* D[6]: 1 = YUV, 0 = RGB */ misc4 = 0xff; misc1 = 0x00; /* D[2] = Capture format selection (DS5597) - WDR sets this */ break; case PIXEL_FMT_RGB5: /* V/530 V/6326 */ default: fmt = 0x00; /* D[7:6] 10 YUV2(=YUYV), 01 VYUY, 00 UYVY, 11 YVYU / 00 RGB 555, 01 RGB 565 */ misc0 = 0x00; /* D[6]: 1 = YUV, 0 = RGB */ misc4 = 0xff; misc1 = 0x04; /* D[2] = Capture format selection (DS5597) - WDR sets this */ break; } setvideoregmask(pSiS, Index_VI6326_VideoFormatSelect, fmt, 0xC0); setvideoregmask(pSiS, Index_VI6326_Control_Misc0, misc0, 0x40); if(misc4 == 0xff) { setvideoregmask(pSiS, Index_VI6326_Control_Misc1, misc1, 0x04); if(pSiS->oldChipset >= OC_SIS5597) { setvideoregmask(pSiS, Index_VI6326_Control_Misc4, 0x00, 0x05); } } else { if(pSiS->oldChipset >= OC_SIS5597) { setvideoregmask(pSiS, Index_VI6326_Control_Misc4, misc4, 0x05); } setvideoregmask(pSiS, Index_VI6326_Control_Misc1, 0x00, 0x04); } } static void set_colorkey(SISPtr pSiS, CARD32 colorkey) { CARD8 r, g, b, s; b = (CARD8)(colorkey & 0xFF); g = (CARD8)((colorkey >> 8) & 0xFF); r = (CARD8)((colorkey >> 16) & 0xFF); if(pSiS->CurrentLayout.bitsPerPixel >= 24) { s = b; b = r; r = s; } setvideoreg(pSiS, Index_VI6326_Overlay_ColorKey_Blue_Min ,(CARD8)b); setvideoreg(pSiS, Index_VI6326_Overlay_ColorKey_Green_Min ,(CARD8)g); setvideoreg(pSiS, Index_VI6326_Overlay_ColorKey_Red_Min ,(CARD8)r); setvideoreg(pSiS, Index_VI6326_Overlay_ColorKey_Blue_Max ,(CARD8)b); setvideoreg(pSiS, Index_VI6326_Overlay_ColorKey_Green_Max ,(CARD8)g); setvideoreg(pSiS, Index_VI6326_Overlay_ColorKey_Red_Max ,(CARD8)r); } static __inline void set_brightness(SISPtr pSiS, CARD8 brightness) { setvideoreg(pSiS, Index_VI6326_Brightness, brightness); } static __inline void set_contrast(SISPtr pSiS, CARD8 contrast) { setvideoregmask(pSiS, Index_VI6326_Contrast_Enh_Ctrl, contrast, 0x07); } static void set_contrast_data(SISPtr pSiS, int value) { unsigned long temp; if(value < 10000) temp = 0; else temp = (value - 10000) / 20000; if(temp > 3) temp = 3; setvideoregmask(pSiS, Index_VI6326_Contrast_Enh_Ctrl, (temp << 6), 0xC0); switch(temp) { case 0: temp = 2048; break; case 1: temp = 4096; break; case 2: temp = 8192; break; case 3: temp = 16384; break; } temp <<= 10; temp /= value; setvideoreg(pSiS, Index_VI6326_Contrast_Factor, temp); } static __inline void set_disablegfx(SISPtr pSiS, Bool mybool) { setvideoregmask(pSiS, Index_VI6326_Control_Misc0, mybool ? 0x10 : 0x00, 0x10); } static void set_overlay(SISPtr pSiS, SISOverlayPtr pOverlay, SISPortPrivPtr pPriv, int index) { ScrnInfoPtr pScrn = pSiS->pScrn; CARD16 pitch=0; CARD8 h_over=0, v_over=0; CARD16 top, bottom, left, right; CARD16 screenX = pSiS->CurrentLayout.mode->HDisplay; CARD16 screenY = pSiS->CurrentLayout.mode->VDisplay; CARD32 watchdog; top = pOverlay->dstBox.y1; bottom = pOverlay->dstBox.y2; if(bottom > screenY) { bottom = screenY; } left = pOverlay->dstBox.x1; right = pOverlay->dstBox.x2; if(right > screenX) { right = screenX; } /* TW: DoubleScan modes require Y coordinates * 2 */ if(pSiS->CurrentLayout.mode->Flags & V_DBLSCAN) { top <<= 1; bottom <<= 1; } /* TW: Interlace modes require Y coordinates / 2 */ if(pSiS->CurrentLayout.mode->Flags & V_INTERLACE) { top >>= 1; bottom >>= 1; } h_over = (((left>>8) & 0x07) | ((right>>4) & 0x70)); v_over = (((top>>8) & 0x07) | ((bottom>>4) & 0x70)); pitch = pOverlay->pitch * pOverlay->PitchMult; pitch >>= 2; /* Datasheet: Unit = double word - verified */ if(pitch > 0xfff) { pitch = pOverlay->pitch * (0xFFF * 2 / pOverlay->pitch); pOverlay->VUSF = 0x3F; } /* set color key */ set_colorkey(pSiS, pPriv->colorKey); /* set color key mode */ setvideoregmask(pSiS, Index_VI6326_Key_Overlay_OP, pOverlay->keyOP, 0x0f); setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x0c); setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x18); /* Set Y buf pitch */ /* Datasheet: Unit = double word - verified */ setvideoreg(pSiS, Index_VI6326_Disp_Y_Buf_Pitch_Low, (CARD8)(pitch)); setvideoregmask(pSiS, Index_VI6326_Disp_Y_Buf_Pitch_High, (CARD8)(pitch>>8), 0x0f); /* Set U/V pitch if using planar formats */ if( (pOverlay->pixelFormat == PIXEL_FMT_YV12) || (pOverlay->pixelFormat == PIXEL_FMT_I420) ) { /* Set U/V pitch */ /* Datasheet: Unit = double word - verified */ setvideoreg(pSiS, Index_VI6326_Disp_UV_Buf_Pitch_Low, (CARD8)pitch >> 1); setvideoregmask(pSiS, Index_VI6326_Disp_UV_Buf_Pitch_High, (CARD8)(pitch >> 9), 0x0f); } /* set line buffer size */ setvideoreg(pSiS, Index_VI6326_Line_Buffer_Size, pOverlay->lineBufSize); /* set scale factor */ setvideoreg(pSiS, Index_VI6326_Hor_Scale, (CARD8)((pOverlay->HUSF) | 0xC0)); setvideoregmask(pSiS, Index_VI6326_Hor_Scale_Integer, (CARD8)(pOverlay->HIntBit), 0x0F); setvideoregmask(pSiS, Index_VI6326_Ver_Scale, (CARD8)(pOverlay->VUSF), 0x3F); /* TW: We don't have to wait for vertical retrace in all cases */ if(pPriv->mustwait) { watchdog = WATCHDOG_DELAY; while ((!pOverlay->VBlankActiveFunc(pSiS)) && --watchdog); if(!watchdog) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Xv: Waiting for vertical retrace timed-out\n"); } /* set destination window position */ setvideoreg(pSiS, Index_VI6326_Win_Hor_Disp_Start_Low, (CARD8)left); setvideoreg(pSiS, Index_VI6326_Win_Hor_Disp_End_Low, (CARD8)right); setvideoreg(pSiS, Index_VI6326_Win_Hor_Over, (CARD8)h_over); setvideoreg(pSiS, Index_VI6326_Win_Ver_Disp_Start_Low, (CARD8)top); setvideoreg(pSiS, Index_VI6326_Win_Ver_Disp_End_Low, (CARD8)bottom); setvideoreg(pSiS, Index_VI6326_Win_Ver_Over, (CARD8)v_over); /* Set Y start address */ setvideoreg(pSiS, Index_VI6326_Disp_Y_Buf_Start_Low, (CARD8)(pOverlay->PSY)); setvideoreg(pSiS, Index_VI6326_Disp_Y_Buf_Start_Middle, (CARD8)((pOverlay->PSY)>>8)); if(pSiS->oldChipset <= OC_SIS6326) { /* all old chipsets incl 6326 */ /* Set overflow bits */ setvideoregmask(pSiS, Index_VI6326_Disp_Capt_Y_Buf_Start_High, (CARD8)(((pOverlay->PSY)>>12) & 0xF0), 0xF0); /* Set framebuffer end address */ setvideoreg(pSiS, Index_VI6326_Disp_Y_End, (CARD8)(pOverlay->YUVEnd)); } else { /* 530/620 */ /* Set overflow bits */ setvideoregmask(pSiS, Index_VI6326_Disp_Capt_Y_Buf_Start_High, (CARD8)(((pOverlay->PSY)>>13) & 0xF8), 0xF8); } /* Set U/V start addresses if using plane formats */ if( (pOverlay->pixelFormat == PIXEL_FMT_YV12) || (pOverlay->pixelFormat == PIXEL_FMT_I420) ) { CARD32 PSU = pOverlay->PSU; CARD32 PSV = pOverlay->PSV; /* set U/V start address */ setvideoreg(pSiS, Index_VI6326_U_Buf_Start_Low, (CARD8)PSU); setvideoreg(pSiS, Index_VI6326_U_Buf_Start_Middle,(CARD8)(PSU >> 8)); setvideoreg(pSiS, Index_VI6326_V_Buf_Start_Low, (CARD8)PSV); setvideoreg(pSiS, Index_VI6326_V_Buf_Start_Middle,(CARD8)(PSV >> 8)); setvideoreg(pSiS, Index_VI6326_UV_Buf_Start_High, (CARD8)(((PSU >> 16) & 0x0F) | ((PSV >> 12) & 0xF0)) ); if(pSiS->oldChipset > OC_SIS6326) { /* Set bit 20 of the addresses in Misc5 (530/620 only) */ setvideoreg(pSiS, Index_VI6326_Control_Misc5, (CARD8)(((PSU >> (20-1)) & 0x02) | ((PSV >> (20-2)) & 0x04)) ); } } /* set brightness and contrast */ set_brightness(pSiS, pPriv->brightness); if(pSiS->oldChipset > OC_SIS6205C) { set_contrast_data(pSiS, (pOverlay->dstBox.x2 - pOverlay->dstBox.x1) * (pOverlay->dstBox.y2 - pOverlay->dstBox.y1)); set_contrast(pSiS, pPriv->contrast); } /* enable/disable graphics display around overlay */ set_disablegfx(pSiS, pPriv->disablegfx); /* set format */ set_format(pSiS, pOverlay); } /* Overlay MUST NOT be switched off while beam is over it */ static void close_overlay(SISPtr pSiS, SISPortPrivPtr pPriv) { CARD32 watchdog; watchdog = WATCHDOG_DELAY; while((!vblank_active_CRT1(pSiS)) && --watchdog); if(pSiS->oldChipset > OC_SIS6326) { /* what is this? */ setvideoregmask(pSiS, Index_VI6326_Control_Misc4, 0x40, 0x40); } /* disable overlay */ setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x00, 0x02); } static void SIS6326DisplayVideo(ScrnInfoPtr pScrn, SISPortPrivPtr pPriv) { SISPtr pSiS = SISPTR(pScrn); short srcPitch = pPriv->srcPitch; short height = pPriv->height; short width = pPriv->width; SISOverlayRec overlay; int srcOffsetX=0, srcOffsetY=0; int sx, sy; int index = 0; int pitch; memset(&overlay, 0, sizeof(overlay)); overlay.pixelFormat = pPriv->id; overlay.pitch = srcPitch; overlay.keyOP = VI6326_ROP_DestKey; /* DestKey mode */ overlay.dstBox.x1 = pPriv->drw_x - pScrn->frameX0; overlay.dstBox.x2 = pPriv->drw_x + pPriv->drw_w - pScrn->frameX0; overlay.dstBox.y1 = pPriv->drw_y - pScrn->frameY0; overlay.dstBox.y2 = pPriv->drw_y + pPriv->drw_h - pScrn->frameY0; if((overlay.dstBox.x1 > overlay.dstBox.x2) || (overlay.dstBox.y1 > overlay.dstBox.y2)) return; if((overlay.dstBox.x2 < 0) || (overlay.dstBox.y2 < 0)) return; if(overlay.dstBox.x1 < 0) { srcOffsetX = pPriv->src_w * (-overlay.dstBox.x1) / pPriv->drw_w; overlay.dstBox.x1 = 0; } if(overlay.dstBox.y1 < 0) { srcOffsetY = pPriv->src_h * (-overlay.dstBox.y1) / pPriv->drw_h; overlay.dstBox.y1 = 0; } switch(pPriv->id){ case PIXEL_FMT_YV12: sx = (pPriv->src_x + srcOffsetX) & ~7; sy = (pPriv->src_y + srcOffsetY) & ~1; pitch = (width + 3) & ~3; overlay.PSY = pPriv->bufAddr[pPriv->currentBuf] + sx + sy * pitch; overlay.PSV = overlay.PSY + pitch * height; overlay.PSU = overlay.PSV + ((((width >> 1) + 3) & ~3) * (height >> 1)); overlay.PSY >>= 2; overlay.PSV >>= 2; overlay.PSU >>= 2; break; case PIXEL_FMT_I420: sx = (pPriv->src_x + srcOffsetX) & ~7; sy = (pPriv->src_y + srcOffsetY) & ~1; pitch = (width + 3) & ~3; overlay.PSY = pPriv->bufAddr[pPriv->currentBuf] + sx + sy * pitch; overlay.PSU = overlay.PSY + pitch * height; overlay.PSV = overlay.PSU + ((((width >> 1) + 3) & ~3) * (height >> 1)); overlay.PSY >>= 2; overlay.PSV >>= 2; overlay.PSU >>= 2; break; case PIXEL_FMT_YUY2: case PIXEL_FMT_UYVY: case PIXEL_FMT_RGB6: case PIXEL_FMT_RGB5: default: sx = (pPriv->src_x + srcOffsetX) & ~1; sy = (pPriv->src_y + srcOffsetY); overlay.PSY = (pPriv->bufAddr[pPriv->currentBuf] + sx*2 + sy*srcPitch); overlay.PSY >>= 2; break; } /* FIXME: Is this correct? (Is it required to set the end address? * Datasheet is not clear) - (reg does not exist on 530/620) */ overlay.YUVEnd = (pPriv->bufAddr[pPriv->currentBuf] + pPriv->totalSize) >> 14; /* FIXME: is it possible that srcW < 0 */ overlay.srcW = pPriv->src_w - (sx - pPriv->src_x); overlay.srcH = pPriv->src_h - (sy - pPriv->src_y); if( (pPriv->oldx1 != overlay.dstBox.x1) || (pPriv->oldx2 != overlay.dstBox.x2) || (pPriv->oldy1 != overlay.dstBox.y1) || (pPriv->oldy2 != overlay.dstBox.y2) ) { pPriv->mustwait = 1; pPriv->oldx1 = overlay.dstBox.x1; pPriv->oldx2 = overlay.dstBox.x2; pPriv->oldy1 = overlay.dstBox.y1; pPriv->oldy2 = overlay.dstBox.y2; } /* calculate line buffer length */ calc_line_buf_size(&overlay); overlay.VBlankActiveFunc = vblank_active_CRT1; /* overlay.GetScanLineFunc = get_scanline_CRT1; */ /* calculate scale factor */ calc_scale_factor(pSiS, &overlay, pScrn, pPriv); /* set (not only determine) if line buffer is to be merged */ if(pSiS->oldChipset > OC_SIS5597) { int temp = 384; if(pSiS->oldChipset <= OC_SIS6326) temp = 352; merge_line_buf(pSiS, pPriv, (overlay.srcW > temp)); } /* set overlay */ set_overlay(pSiS, &overlay, pPriv, index); /* enable overlay */ if(pSiS->oldChipset > OC_SIS6326) { setvideoregmask(pSiS, Index_VI6326_Control_Misc4, 0x40, 0x40); } setvideoregmask(pSiS, Index_VI6326_Control_Misc0, 0x02, 0x02); pPriv->mustwait = 0; } static void SIS6326StopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) { SISPortPrivPtr pPriv = (SISPortPrivPtr)data; SISPtr pSiS = SISPTR(pScrn); if(pPriv->grabbedByV4L) return; REGION_EMPTY(pScrn->pScreen, &pPriv->clip); if(shutdown) { if(pPriv->videoStatus & CLIENT_VIDEO_ON) { close_overlay(pSiS, pPriv); pPriv->mustwait = 1; } SISFreeFBMemory(pScrn, &pPriv->handle); pPriv->videoStatus = 0; pSiS->VideoTimerCallback = NULL; } else { if(pPriv->videoStatus & CLIENT_VIDEO_ON) { pPriv->videoStatus = OFF_TIMER | CLIENT_VIDEO_ON; pPriv->offTime = currentTime.milliseconds + OFF_DELAY; pSiS->VideoTimerCallback = SIS6326VideoTimerCallback; } } } static int SIS6326PutImage( ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int id, unsigned char* buf, short width, short height, Bool sync, RegionPtr clipBoxes, pointer data, DrawablePtr pDraw ){ SISPtr pSiS = SISPTR(pScrn); SISPortPrivPtr pPriv = (SISPortPrivPtr)data; int totalSize=0; CARD32 *src, *dest; unsigned long i; if(pPriv->grabbedByV4L) return Success; pPriv->drw_x = drw_x; pPriv->drw_y = drw_y; pPriv->drw_w = drw_w; pPriv->drw_h = drw_h; pPriv->src_x = src_x; pPriv->src_y = src_y; pPriv->src_w = src_w; pPriv->src_h = src_h; pPriv->id = id; pPriv->height = height; pPriv->width = width; /* Pixel formats: 1. YU12: 3 planes: H V Y sample period 1 1 (8 bit per pixel) V sample period 2 2 (8 bit per pixel, subsampled) U sample period 2 2 (8 bit per pixel, subsampled) Y plane is fully sampled (width*height), U and V planes are sampled in 2x2 blocks, hence a group of 4 pixels requires 4 + 1 + 1 = 6 bytes. The data is planar, ie in single planes for Y, U and V. 2. UYVY: 3 planes: H V Y sample period 1 1 (8 bit per pixel) V sample period 2 1 (8 bit per pixel, subsampled) U sample period 2 1 (8 bit per pixel, subsampled) Y plane is fully sampled (width*height), U and V planes are sampled in 2x1 blocks, hence a group of 4 pixels requires 4 + 2 + 2 = 8 bytes. The data is bit packed, there are no separate Y, U or V planes. Bit order: U0 Y0 V0 Y1 U2 Y2 V2 Y3 ... 3. I420: Like YU12, but planes U and V are in reverse order. 4. YUY2: Like UYVY, but order is Y0 U0 Y1 V0 Y2 U2 Y3 V2 ... */ switch(id){ case PIXEL_FMT_YV12: case PIXEL_FMT_I420: pPriv->srcPitch = (width + 7) & ~7; /* Size = width * height * 3 / 2 */ totalSize = (pPriv->srcPitch * height * 3) >> 1; break; case PIXEL_FMT_YUY2: case PIXEL_FMT_UYVY: case PIXEL_FMT_RGB5: case PIXEL_FMT_RGB6: default: pPriv->srcPitch = ((width << 1) + 3) & ~3; /* Size = width * 2 * height */ totalSize = pPriv->srcPitch * height; } /* make it a multiple of 16 to simplify to copy loop */ totalSize += 15; totalSize &= ~15; /* in bytes */ pPriv->totalSize = totalSize; /* allocate memory (we do doublebuffering) - size is in bytes */ if(!(pPriv->bufAddr[0] = SISAllocateFBMemory(pScrn, &pPriv->handle, totalSize << 1))) return BadAlloc; pPriv->bufAddr[1] = pPriv->bufAddr[0] + totalSize; /* copy data */ if((pSiS->XvUseMemcpy) || (totalSize < 16)) { SiSMemCopyToVideoRam(pSiS, pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf], buf, totalSize); } else { dest = (CARD32 *)(pSiS->FbBase + pPriv->bufAddr[pPriv->currentBuf]); src = (CARD32 *)buf; for(i = 0; i < (totalSize/16); i++) { *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; } } SIS6326DisplayVideo(pScrn, pPriv); /* update cliplist */ if( pPriv->autopaintColorKey && (pPriv->grabbedByV4L || #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,3,0) !RegionsEqual(&pPriv->clip, clipBoxes)) ) { #else !REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) ) { #endif /* We always paint colorkey for V4L */ if(!pPriv->grabbedByV4L) REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); /* draw these */ #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,1,99,1,0) (*pSiS->AccelInfoPtr->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy, ~0, REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes)); #else xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes); #endif } pPriv->currentBuf ^= 1; pPriv->videoStatus = CLIENT_VIDEO_ON; pSiS->VideoTimerCallback = SIS6326VideoTimerCallback; return Success; } static int SIS6326QueryImageAttributes( ScrnInfoPtr pScrn, int id, unsigned short *w, unsigned short *h, int *pitches, int *offsets ){ SISPtr pSiS = SISPTR(pScrn); int pitchY, pitchUV; int size, sizeY, sizeUV; if(*w < IMAGE_MIN_WIDTH) *w = IMAGE_MIN_WIDTH; if(*h < IMAGE_MIN_HEIGHT) *h = IMAGE_MIN_HEIGHT; if(pSiS->oldChipset < OC_SIS6326) { if(*w > IMAGE_MAX_WIDTH_5597) *w = IMAGE_MAX_WIDTH_5597; if(*h > IMAGE_MAX_HEIGHT_5597) *h = IMAGE_MAX_HEIGHT_5597; } else { if(*w > IMAGE_MAX_WIDTH) *w = IMAGE_MAX_WIDTH; if(*h > IMAGE_MAX_HEIGHT) *h = IMAGE_MAX_HEIGHT; } switch(id) { case PIXEL_FMT_YV12: case PIXEL_FMT_I420: *w = (*w + 7) & ~7; *h = (*h + 1) & ~1; pitchY = *w; pitchUV = *w >> 1; if(pitches) { pitches[0] = pitchY; pitches[1] = pitches[2] = pitchUV; } sizeY = pitchY * (*h); sizeUV = pitchUV * ((*h) >> 1); if(offsets) { offsets[0] = 0; offsets[1] = sizeY; offsets[2] = sizeY + sizeUV; } size = sizeY + (sizeUV << 1); break; case PIXEL_FMT_YUY2: case PIXEL_FMT_UYVY: case PIXEL_FMT_RGB5: case PIXEL_FMT_RGB6: default: *w = (*w + 1) & ~1; pitchY = *w << 1; if(pitches) pitches[0] = pitchY; if(offsets) offsets[0] = 0; size = pitchY * (*h); break; } return size; } static void SIS6326VideoTimerCallback(ScrnInfoPtr pScrn, Time now) { SISPtr pSiS = SISPTR(pScrn); SISPortPrivPtr pPriv = NULL; unsigned char sridx, cridx; pSiS->VideoTimerCallback = NULL; if(!pScrn->vtSema) return; if(pSiS->adaptor) { pPriv = GET_PORT_PRIVATE(pScrn); if(!pPriv->videoStatus) pPriv = NULL; } if(pPriv) { if(pPriv->videoStatus & TIMER_MASK) { if(pPriv->videoStatus & OFF_TIMER) { if(pPriv->offTime < now) { /* Turn off the overlay */ sridx = inSISREG(SISSR); cridx = inSISREG(SISCR); close_overlay(pSiS, pPriv); outSISREG(SISSR, sridx); outSISREG(SISCR, cridx); pPriv->mustwait = 1; pPriv->videoStatus = FREE_TIMER; pPriv->freeTime = now + FREE_DELAY; pSiS->VideoTimerCallback = SIS6326VideoTimerCallback; } } else if(pPriv->videoStatus & FREE_TIMER) { if(pPriv->freeTime < now) { SISFreeFBMemory(pScrn, &pPriv->handle); pPriv->mustwait = 1; pPriv->videoStatus = 0; } } else pSiS->VideoTimerCallback = SIS6326VideoTimerCallback; } } } /* Offscreen surface stuff for v4l */ static int SIS6326AllocSurface ( ScrnInfoPtr pScrn, int id, unsigned short w, unsigned short h, XF86SurfacePtr surface ) { SISPtr pSiS = SISPTR(pScrn); SISPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); int size; if((w < IMAGE_MIN_WIDTH) || (h < IMAGE_MIN_HEIGHT)) return BadValue; if(pSiS->oldChipset < OC_SIS6326) { if((w > IMAGE_MAX_WIDTH_5597) || (h > IMAGE_MAX_HEIGHT_5597)) return BadValue; } else { if((w > IMAGE_MAX_WIDTH) || (h > IMAGE_MAX_HEIGHT)) return BadValue; } if(pPriv->grabbedByV4L) return BadAlloc; w = (w + 1) & ~1; pPriv->pitch = ((w << 1) + 63) & ~63; /* Only packed pixel modes supported */ size = h * pPriv->pitch; if(!(pPriv->offset = SISAllocateFBMemory(pScrn, &pPriv->handle, size))) return BadAlloc; pPriv->totalSize = size; surface->width = w; surface->height = h; surface->pScrn = pScrn; surface->id = id; surface->pitches = &pPriv->pitch; surface->offsets = &pPriv->offset; surface->devPrivate.ptr = (pointer)pPriv; close_overlay(pSiS, pPriv); pPriv->videoStatus = 0; REGION_EMPTY(pScrn->pScreen, &pPriv->clip); pSiS->VideoTimerCallback = NULL; pPriv->grabbedByV4L = TRUE; return Success; } static int SIS6326StopSurface (XF86SurfacePtr surface) { SISPortPrivPtr pPriv = (SISPortPrivPtr)(surface->devPrivate.ptr); SISPtr pSiS = SISPTR(surface->pScrn); if(pPriv->grabbedByV4L && pPriv->videoStatus) { close_overlay(pSiS, pPriv); pPriv->mustwait = 1; pPriv->videoStatus = 0; } return Success; } static int SIS6326FreeSurface (XF86SurfacePtr surface) { SISPortPrivPtr pPriv = (SISPortPrivPtr)(surface->devPrivate.ptr); if(pPriv->grabbedByV4L) { SIS6326StopSurface(surface); SISFreeFBMemory(surface->pScrn, &pPriv->handle); pPriv->grabbedByV4L = FALSE; } return Success; } static int SIS6326GetSurfaceAttribute ( ScrnInfoPtr pScrn, Atom attribute, INT32 *value ) { SISPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); return SIS6326GetPortAttribute(pScrn, attribute, value, (pointer)pPriv); } static int SIS6326SetSurfaceAttribute( ScrnInfoPtr pScrn, Atom attribute, INT32 value ) { SISPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn);; return SIS6326SetPortAttribute(pScrn, attribute, value, (pointer)pPriv); } static int SIS6326DisplaySurface ( XF86SurfacePtr surface, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, RegionPtr clipBoxes ) { ScrnInfoPtr pScrn = surface->pScrn; SISPortPrivPtr pPriv = (SISPortPrivPtr)(surface->devPrivate.ptr); if(!pPriv->grabbedByV4L) return Success; pPriv->drw_x = drw_x; pPriv->drw_y = drw_y; pPriv->drw_w = drw_w; pPriv->drw_h = drw_h; pPriv->src_x = src_x; pPriv->src_y = src_y; pPriv->src_w = src_w; pPriv->src_h = src_h; pPriv->id = surface->id; pPriv->height = surface->height; pPriv->bufAddr[0] = surface->offsets[0]; pPriv->currentBuf = 0; pPriv->srcPitch = surface->pitches[0]; SIS6326DisplayVideo(pScrn, pPriv); if(pPriv->autopaintColorKey) { #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,1,99,1,0) (*XAAPTR(pScrn)->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy, ~0, REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes)); #else xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes); #endif } pPriv->videoStatus = CLIENT_VIDEO_ON; return Success; } XF86OffscreenImageRec SIS6326OffscreenImages[2] = { { &SIS6326Images[0], /* YUV2 */ VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT, SIS6326AllocSurface, SIS6326FreeSurface, SIS6326DisplaySurface, SIS6326StopSurface, SIS6326GetSurfaceAttribute, SIS6326SetSurfaceAttribute, IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT, NUM_ATTRIBUTES, &SIS6326Attributes[0] /* Support all attributes */ }, { &SIS6326Images[1], /* UYVY */ VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT, SIS6326AllocSurface, SIS6326FreeSurface, SIS6326DisplaySurface, SIS6326StopSurface, SIS6326GetSurfaceAttribute, SIS6326SetSurfaceAttribute, IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT, NUM_ATTRIBUTES, &SIS6326Attributes[0] /* Support all attributes */ }, }; static void SIS6326InitOffscreenImages(ScreenPtr pScrn) { xf86XVRegisterOffscreenImages(pScrn, SIS6326OffscreenImages, 2); } xf86-video-sis-0.10.7/src/sis310_accel.h0000664000076400007640000007566311763614406014367 00000000000000/* * 2D Acceleration for SiS 315 and Xabre series * Definitions for the SIS engine communication. * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * * 2003/08/18: Added VRAM queue support * */ /* SiS315 and 330 engine commands */ #define BITBLT 0x00000000 /* Blit */ #define COLOREXP 0x00000001 /* Color expand */ #define ENCOLOREXP 0x00000002 /* Enhanced color expand (315 only?) */ #define MULTIPLE_SCANLINE 0x00000003 /* 315 only, not 330 */ #define LINE 0x00000004 /* Draw line */ #define TRAPAZOID_FILL 0x00000005 /* Fill trapezoid */ #define TRANSPARENT_BITBLT 0x00000006 /* Transparent Blit */ #define ALPHA_BLEND 0x00000007 /* Alpha blended BitBlt */ #define A3D_FUNCTION 0x00000008 /* 3D command ? */ #define CLEAR_Z_BUFFER 0x00000009 /* ? */ #define GRADIENT_FILL 0x0000000A /* Gradient fill */ #define STRETCH_BITBLT 0x0000000B /* Stretched BitBlit */ #define YUVRGB_BLIT_325 0x0000000C #define YUVRGB_BLIT_330 0x00000003 /* Command bits */ /* Source selection */ #define SRCVIDEO 0x00000000 /* source is video RAM */ #define SRCSYSTEM 0x00000010 /* source is system memory */ #define SRCCPUBLITBUF SRCSYSTEM /* source is CPU-driven BitBuffer (for color expand) */ #define SRCAGP 0x00000020 /* source is AGP memory (?) */ /* Pattern source selection */ #define PATFG 0x00000000 /* foreground color */ #define PATPATREG 0x00000040 /* pattern in pattern buffer (0x8300) */ #define PATMONO 0x00000080 /* mono pattern */ /* Clipping flags */ #define NOCLIP 0x00000000 #define NOMERGECLIP 0x04000000 #define CLIPENABLE 0x00040000 #define CLIPWITHOUTMERGE 0x04040000 /* Subfunctions for BitBlt: Transparency */ #define OPAQUE 0x00000000 #define TRANSPARENT 0x00100000 /* Subfunctions for Alpha Blended BitBlt */ #define A_CONSTANTALPHA 0x00000000 #define A_PERPIXELALPHA 0x00080000 #define A_NODESTALPHA 0x00100000 #define A_3DFULLSCENE 0x00180000 /* Destination */ #define DSTAGP 0x02000000 #define DSTVIDEO 0x00000000 /* Subfunctions for Color/Enhanced Color Expansion */ #define COLOR_TO_MONO 0x00100000 #define AA_TEXT 0x00200000 /* Line */ #define LINE_STYLE 0x00800000 #define NO_RESET_COUNTER 0x00400000 #define NO_LAST_PIXEL 0x00200000 /* Trapezoid (315 only?) */ #define T_XISMAJORL 0x00800000 /* X axis is driving axis (left) */ #define T_XISMAJORR 0x08000000 /* X axis is driving axis (right) */ #define T_L_Y_INC 0x00000020 /* left edge direction Y */ #define T_L_X_INC 0x00000010 /* left edge direction X */ #define T_R_Y_INC 0x00400000 /* right edge direction Y */ #define T_R_X_INC 0x00200000 /* right edge direction X */ /* YUV to RGB blit */ #define YUV_FORMAT_YUY2 0x00000000 #define YUV_FORMAT_YVYU 0x00002000 #define YUV_FORMAT_UYVY 0x00004000 #define YUV_FORMAT_VYUY 0x00006000 #define YUV_FORMAT_NV12 0x00008000 /* Only supported one */ #define YUV_FORMAT_NV21 0x0000A000 #define YUV_CMD_YUV 0x00800000 /* Scanline trigger (315 only, not 330) */ #define SCANLINE_TR_CRT1 0x00000000 #define SCANLINE_TR_CRT2 0x01000000 #define SCANLINE_TRIGGER_ENABLE 0x80000000 /* Some general registers */ #define SRC_ADDR 0x8200 #define SRC_PITCH 0x8204 #define AGP_BASE 0x8206 /* color-depth dependent value */ #define SRC_Y 0x8208 #define SRC_X 0x820A #define DST_Y 0x820C #define DST_X 0x820E #define DST_ADDR 0x8210 #define DST_PITCH 0x8214 #define DST_HEIGHT 0x8216 #define RECT_WIDTH 0x8218 #define RECT_HEIGHT 0x821A #define PAT_FGCOLOR 0x821C #define PAT_BGCOLOR 0x8220 #define SRC_FGCOLOR 0x8224 #define SRC_BGCOLOR 0x8228 #define MONO_MASK 0x822C #define LEFT_CLIP 0x8234 #define TOP_CLIP 0x8236 #define RIGHT_CLIP 0x8238 #define BOTTOM_CLIP 0x823A #define COMMAND_READY 0x823C #define FIRE_TRIGGER 0x8240 #define PATTERN_REG 0x8300 /* 384 bytes pattern buffer */ /* Line registers */ #define LINE_X0 SRC_Y #define LINE_X1 DST_Y #define LINE_Y0 SRC_X #define LINE_Y1 DST_X #define LINE_COUNT RECT_WIDTH #define LINE_STYLE_PERIOD RECT_HEIGHT #define LINE_STYLE_0 MONO_MASK #define LINE_STYLE_1 0x8230 #define LINE_XN PATTERN_REG #define LINE_YN PATTERN_REG+2 /* Transparent bitblit registers */ #define TRANS_DST_KEY_HIGH PAT_FGCOLOR #define TRANS_DST_KEY_LOW PAT_BGCOLOR #define TRANS_SRC_KEY_HIGH SRC_FGCOLOR #define TRANS_SRC_KEY_LOW SRC_BGCOLOR #define ALPHA_ALPHA PAT_FGCOLOR /* Trapezoid registers */ #define TRAP_YH SRC_Y /* 0x8208 */ #define TRAP_LR DST_Y /* 0x820C */ #define TRAP_DL 0x8244 #define TRAP_DR 0x8248 #define TRAP_EL 0x824C #define TRAP_ER 0x8250 /* Queue */ #define Q_BASE_ADDR 0x85C0 /* Base address of software queue */ #define Q_WRITE_PTR 0x85C4 /* Current write pointer */ #define Q_READ_PTR 0x85C8 /* Current read pointer */ #define Q_STATUS 0x85CC /* queue status */ /* VRAM queue operation command header definitions */ #define SIS_SPKC_HEADER 0x16800000L #define SIS_BURST_HEADER0 0x568A0000L #define SIS_BURST_HEADER1 0x62100000L #define SIS_PACKET_HEARER0 0x968A0000L #define SIS_PACKET_HEADER1 0x62100000L #define SIS_NIL_CMD 0x168F0000L #define SIS_PACKET12_HEADER0 0x968A000CL #define SIS_PACKET12_HEADER1 0x62100010L #define SIS_PACKET12_LENGTH 80 /* Macros to do useful things with the SiS315/330 BitBLT engine */ /* Q_STATUS: bit 31 = 1: All engines idle and all queues empty bit 30 = 1: Hardware Queue (=HW CQ, 2D queue, 3D queue) empty bit 29 = 1: 2D engine is idle bit 28 = 1: 3D engine is idle bit 27 = 1: HW command queue empty bit 26 = 1: 2D queue empty bit 25 = 1: 3D queue empty bit 24 = 1: SW command queue empty bits 23:16: 2D counter 3 bits 15:8: 2D counter 2 bits 7:0: 2D counter 1 */ /* As sis_dri.c and dual head mode relocate the cmd-q len to the sarea/entity, * don't use it directly here */ #define CmdQueLen (*(pSiS->cmdQueueLenPtr)) #define SiSQEmpty \ { \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x0400) != 0x0400) {}; \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x0400) != 0x0400) {}; \ } #define SiSResetCmd pSiS->CommandReg = 0; #define SiSSetupCMDFlag(flags) pSiS->CommandReg |= (flags); /* --- VRAM mode --- */ #define SiSGetSwWP() (CARD32)(*(pSiS->cmdQ_SharedWritePort)) #define SiSGetHwRP() (CARD32)(SIS_MMIO_IN32(pSiS->IOBase, Q_READ_PTR)) #define SiSFlushCmdBuf \ if(pSiS->NeedFlush) { \ CARD32 ttt = ((SiSGetSwWP()) - 4) & pSiS->cmdQueueSizeMask; \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ dummybuf = SIS_RQINDEX(0); \ } #define SiSSyncWP \ SiSFlushCmdBuf; \ SIS_MMIO_OUT32(pSiS->IOBase, Q_WRITE_PTR, (CARD32)(*(pSiS->cmdQ_SharedWritePort))); #define SiSSetHwWP(p) \ *(pSiS->cmdQ_SharedWritePort) = (p); \ SIS_MMIO_OUT32(pSiS->IOBase, Q_WRITE_PTR, (p)); #define SiSSetSwWP(p) *(pSiS->cmdQ_SharedWritePort) = (p); #define SiSCheckQueue(amount) #if 0 { \ CARD32 mcurrent, i=0, ttt = SiSGetSwWP(); \ if((ttt + amount) >= pSiS->cmdQueueSize) { \ do { \ mcurrent = SIS_MMIO_IN32(pSiS->IOBase, Q_READ_PTR); \ i++; \ } while((mcurrent > ttt) || (mcurrent < ((ttt + amount) & pSiS->cmdQueueSizeMask))); \ } else { \ do { \ mcurrent = SIS_MMIO_IN32(pSiS->IOBase, Q_READ_PTR); \ i++; \ } while((mcurrent > ttt) && (mcurrent < (ttt + amount))); \ } \ } #endif #define SiSUpdateQueue \ SiSWriteQueue(tt); \ ttt += 16; \ ttt &= pSiS->cmdQueueSizeMask; \ if(!ttt) { \ while(SIS_MMIO_IN32(pSiS->IOBase, Q_READ_PTR) < pSiS->cmdQueueSize_div4) {} \ } else if(ttt == pSiS->cmdQueueSize_div4) { \ CARD32 temppp; \ do { \ temppp = SIS_MMIO_IN32(pSiS->IOBase, Q_READ_PTR); \ } while(temppp >= ttt && temppp <= pSiS->cmdQueueSize_div2); \ } else if(ttt == pSiS->cmdQueueSize_div2) { \ CARD32 temppp; \ do { \ temppp = SIS_MMIO_IN32(pSiS->IOBase, Q_READ_PTR); \ } while(temppp >= ttt && temppp <= pSiS->cmdQueueSize_4_3); \ } else if(ttt == pSiS->cmdQueueSize_4_3) { \ while(SIS_MMIO_IN32(pSiS->IOBase, Q_READ_PTR) > ttt) {} \ } /* Write-updates MUST be 128bit aligned. */ #define SiSNILandUpdateSWQueue \ SIS_WQINDEX(2) = (CARD32)(SIS_NIL_CMD); \ SIS_WQINDEX(3) = (CARD32)(SIS_NIL_CMD); \ SiSUpdateQueue; \ SiSSetSwWP(ttt); #ifdef SISVRAMQ #define SiSIdle \ { \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) {}; \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) {}; \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) {}; \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) {}; \ } #define SiSSetupSRCDSTBase(srcbase,dstbase) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + SRC_ADDR); \ SIS_WQINDEX(1) = (CARD32)(srcbase); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + DST_ADDR); \ SIS_WQINDEX(3) = (CARD32)(dstbase); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupSRCDSTXY(sx,sy,dx,dy) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + SRC_Y); \ SIS_WQINDEX(1) = (CARD32)(((sx)<<16) | (sy)); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + DST_Y); \ SIS_WQINDEX(3) = (CARD32)(((dx)<<16) | (dy)); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupDSTXYRect(x,y,w,h) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + DST_Y); \ SIS_WQINDEX(1) = (CARD32)(((x)<<16) | (y)); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + RECT_WIDTH); \ SIS_WQINDEX(3) = (CARD32)(((h)<<16) | (w)); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupSRCPitchDSTRect(pitch,x,y) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + SRC_PITCH); \ SIS_WQINDEX(1) = (CARD32)(pitch); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + DST_PITCH); \ SIS_WQINDEX(3) = (CARD32)(((y)<<16) | (x)); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupSRCBase(base) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + SRC_ADDR); \ SIS_WQINDEX(1) = (CARD32)(base); \ SiSNILandUpdateSWQueue \ } #define SiSSetupSRCPitch(pitch) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + SRC_PITCH); \ SIS_WQINDEX(1) = (CARD32)(pitch); \ SiSNILandUpdateSWQueue \ } #define SiSSetupSRCXY(x,y) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + SRC_Y); \ SIS_WQINDEX(1) = (CARD32)(((x)<<16) | (y)); \ SiSNILandUpdateSWQueue \ } #define SiSSetupDSTBase(base) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + DST_ADDR); \ SIS_WQINDEX(1) = (CARD32)(base); \ SiSNILandUpdateSWQueue \ } #define SiSSetupDSTXY(x,y) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + DST_Y); \ SIS_WQINDEX(1) = (CARD32)(((x)<<16) | (y)); \ SiSNILandUpdateSWQueue \ } #define SiSSetupDSTRect(x,y) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + DST_PITCH); \ SIS_WQINDEX(1) = (CARD32)(((y)<<16) | (x)); \ SiSNILandUpdateSWQueue \ } #define SiSSetupDSTRectBurstHeader(x,y,reg,num) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + DST_PITCH); \ SIS_WQINDEX(1) = (CARD32)(((y)<<16) | (x)); \ SIS_WQINDEX(2) = (CARD32)(SIS_BURST_HEADER0 + reg); \ SIS_WQINDEX(3) = (CARD32)(SIS_BURST_HEADER1 + num); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupDSTColorDepth(bpp) \ pSiS->CommandReg = (((CARD32)(bpp)) & (GENMASK(17:16))); #define SiSSetupPATFGDSTRect(color,x,y) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + PAT_FGCOLOR); \ SIS_WQINDEX(1) = (CARD32)(color); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + DST_PITCH); \ SIS_WQINDEX(3) = (CARD32)(((y)<<16) | (x)); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupSRCFGDSTRect(color,x,y) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + SRC_FGCOLOR); \ SIS_WQINDEX(1) = (CARD32)(color); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + DST_PITCH); \ SIS_WQINDEX(3) = (CARD32)(((y)<<16) | (x)); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupRectSRCPitch(w,h,pitch) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + RECT_WIDTH); \ SIS_WQINDEX(1) = (CARD32)(((h)<<16) | (w)); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + SRC_PITCH); \ SIS_WQINDEX(3) = (CARD32)(pitch); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupRect(w,h) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + RECT_WIDTH); \ SIS_WQINDEX(1) = (CARD32)(((h)<<16) | (w)); \ SiSNILandUpdateSWQueue \ } #define SiSSetupPATFG(color) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + PAT_FGCOLOR); \ SIS_WQINDEX(1) = (CARD32)(color); \ SiSNILandUpdateSWQueue \ } #define SiSSetupPATBG(color) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + PAT_BGCOLOR); \ SIS_WQINDEX(1) = (CARD32)(color); \ SiSNILandUpdateSWQueue \ } #define SiSSetupSRCFG(color) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + SRC_FGCOLOR); \ SIS_WQINDEX(1) = (CARD32)(color); \ SiSNILandUpdateSWQueue \ } #define SiSSetupSRCBG(color) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + SRC_BGCOLOR); \ SIS_WQINDEX(1) = (CARD32)(color); \ SiSNILandUpdateSWQueue \ } #define SiSSetupSRCTrans(color) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + TRANS_SRC_KEY_HIGH); \ SIS_WQINDEX(1) = (CARD32)(color); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + TRANS_SRC_KEY_LOW); \ SIS_WQINDEX(3) = (CARD32)(color); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupDSTTrans(color) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + TRANS_DST_KEY_HIGH); \ SIS_WQINDEX(1) = (CARD32)(color); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + TRANS_DST_KEY_LOW); \ SIS_WQINDEX(3) = (CARD32)(color); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupMONOPAT(p0,p1) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + MONO_MASK); \ SIS_WQINDEX(1) = (CARD32)(p0); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + MONO_MASK + 4); \ SIS_WQINDEX(3) = (CARD32)(p1); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupClip(left,top,right,bottom) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + LEFT_CLIP); \ SIS_WQINDEX(1) = (CARD32)(((left) & 0xFFFF) | ((top)<<16)); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + RIGHT_CLIP); \ SIS_WQINDEX(3) = (CARD32)(((right) & 0xFFFF)|((bottom)<<16)); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupDSTBaseDoCMD(base) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + DST_ADDR); \ SIS_WQINDEX(1) = (CARD32)(base); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + COMMAND_READY); \ SIS_WQINDEX(3) = (CARD32)(pSiS->CommandReg); \ if(pSiS->NeedFlush) dummybuf = SIS_RQINDEX(3); \ SiSUpdateQueue \ SiSSetHwWP(ttt); \ } #define SiSSetRectDoCMD(w,h) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + RECT_WIDTH); \ SIS_WQINDEX(1) = (CARD32)(((h)<<16) | (w)); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + COMMAND_READY); \ SIS_WQINDEX(3) = (CARD32)(pSiS->CommandReg); \ if(pSiS->NeedFlush) dummybuf = SIS_RQINDEX(3); \ SiSUpdateQueue \ SiSSetHwWP(ttt); \ } #define SiSSetupROP(rop) \ pSiS->CommandReg |= (rop) << 8; #define SiSDoCMD \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + COMMAND_READY); \ SIS_WQINDEX(1) = (CARD32)(pSiS->CommandReg); \ SIS_WQINDEX(2) = (CARD32)(SIS_NIL_CMD); \ SIS_WQINDEX(3) = (CARD32)(SIS_NIL_CMD); \ if(pSiS->NeedFlush) dummybuf = SIS_RQINDEX(3); \ SiSUpdateQueue \ SiSSetHwWP(ttt); \ } #define SiSDualPipe(disable) \ { \ CARD32 ttt = SiSGetSwWP(); \ CARD32 _tmp = SIS_MMIO_IN32(pSiS->IOBase, FIRE_TRIGGER) & ~(1 << 10); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + FIRE_TRIGGER); \ SIS_WQINDEX(1) = (CARD32)(_tmp | ((disable & 1) << 10)); \ SIS_WQINDEX(2) = (CARD32)(SIS_NIL_CMD); \ SIS_WQINDEX(3) = (CARD32)(SIS_NIL_CMD); \ if(pSiS->NeedFlush) dummybuf = SIS_RQINDEX(3); \ SiSUpdateQueue \ SiSSetHwWP(ttt); \ } /* Line */ #define SiSSetupX0Y0X1Y1(x1,y1,x2,y2) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + LINE_X0); \ SIS_WQINDEX(1) = (CARD32)(((y1)<<16) | (x1)); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + LINE_X1); \ SIS_WQINDEX(3) = (CARD32)(((y2)<<16) | (x2)); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupX0Y0(x,y) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + LINE_X0); \ SIS_WQINDEX(1) = (CARD32)(((y)<<16) | (x)); \ SiSNILandUpdateSWQueue \ } #define SiSSetupX1Y1(x,y) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + LINE_X1); \ SIS_WQINDEX(1) = (CARD32)(((y)<<16) | (x)); \ SiSNILandUpdateSWQueue \ } #define SiSSetupLineCountPeriod(c, p) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + LINE_COUNT); \ SIS_WQINDEX(1) = (CARD32)(((p) << 16) | (c)); \ SiSNILandUpdateSWQueue \ } #define SiSSetupStyle(ls,hs) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + LINE_STYLE_0); \ SIS_WQINDEX(1) = (CARD32)(ls); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + LINE_STYLE_1); \ SIS_WQINDEX(3) = (CARD32)(hs); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } /* Trapezoid */ #define SiSSetupYHLR(y,h,left,right) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + TRAP_YH); \ SIS_WQINDEX(1) = (CARD32)(((y)<<16) | (h)); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + TRAP_LR); \ SIS_WQINDEX(3) = (CARD32)(((right)<<16) | (left)); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupdLdR(dxL,dyL,fxR,dyR) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + TRAP_DL); \ SIS_WQINDEX(1) = (CARD32)(((dyL)<<16) | (dxL)); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + TRAP_DR); \ SIS_WQINDEX(3) = (CARD32)(((dyR)<<16) | (dxR)); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #define SiSSetupELER(eL,eR) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + TRAP_EL); \ SIS_WQINDEX(1) = (CARD32)(eL); \ SIS_WQINDEX(2) = (CARD32)(SIS_SPKC_HEADER + TRAP_ER); \ SIS_WQINDEX(3) = (CARD32)(eR); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } /* (Constant) Alpha blended BitBlt (alpha = 8 bit) */ #define SiSSetupAlpha(alpha) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + ALPHA_ALPHA); \ SIS_WQINDEX(1) = (CARD32)(alpha); \ SiSNILandUpdateSWQueue \ } #define SiSSetPattern(num, value) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(SIS_SPKC_HEADER + (PATTERN_REG + (num * 4))); \ SIS_WQINDEX(1) = (CARD32)(value); \ SiSNILandUpdateSWQueue \ } #define SiSSetupPatternRegBurst(pat1, pat2, pat3, pat4) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(pat1); \ SIS_WQINDEX(1) = (CARD32)(pat2); \ SIS_WQINDEX(2) = (CARD32)(pat3); \ SIS_WQINDEX(3) = (CARD32)(pat4); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } typedef struct _SiS_Packet12_YUV { CARD32 P12_Header0; CARD32 P12_Header1; CARD16 P12_UVPitch; /* 8200 UV if planar, Y if packed */ CARD16 P12_Unused0; /* 8202 */ CARD16 P12_YPitch; /* 8204 Y if planar */ CARD16 P12_AGPBase; /* 8206 */ CARD16 P12_Unused1; /* 8208 */ CARD16 P12_Unused2; /* 820a */ CARD16 P12_DstY; /* 820c */ CARD16 P12_DstX; /* 820e */ CARD32 P12_DstAddr; /* 8210 */ CARD16 P12_DstPitch; /* 8214 */ CARD16 P12_DstHeight; /* 8216 */ CARD16 P12_RectWidth; /* 8218 */ CARD16 P12_RectHeight; /* 821a */ CARD32 P12_Unused3; /* 821c */ CARD32 P12_Unused4; /* 8220 */ CARD32 P12_UVSrcAddr; /* 8224 UV if planar, Y if packed */ CARD32 P12_YSrcAddr; /* 8228 Y if planar */ CARD32 P12_Unused5; /* 822c */ CARD32 P12_Unused6; /* 8230 */ CARD16 P12_ClipLeft; /* 8234 */ CARD16 P12_ClipTop; /* 8236 */ CARD16 P12_ClipRight; /* 8238 */ CARD16 P12_ClipBottom; /* 823a */ CARD32 P12_Command; /* 823c */ CARD32 P12_Null1; CARD32 P12_Null2; } SiS_Packet12_YUV; #define SiSWritePacketPart(part1, part2, part3, part4) \ { \ CARD32 ttt = SiSGetSwWP(); \ pointer tt = (char *)pSiS->cmdQueueBase + ttt; \ SIS_WQINDEX(0) = (CARD32)(part1); \ SIS_WQINDEX(1) = (CARD32)(part2); \ SIS_WQINDEX(2) = (CARD32)(part3); \ SIS_WQINDEX(3) = (CARD32)(part4); \ SiSUpdateQueue \ SiSSetSwWP(ttt); \ } #endif /* VRAM mode */ /* ---- MMIO mode ---- */ #ifndef SISVRAMQ /* We assume a length of 4 bytes per command; since 512K of * of RAM are allocated, the number of commands is easily * calculated (and written to the address pointed to by * CmdQueueLenPtr, since sis_dri.c relocates this) * UPDATE: using the command queue without syncing totally * (ie assuming a QueueLength of 0) decreases system latency * dramatically on the integrated chipsets (sound gets interrupted, * etc.). We now sync every time... this is a little slower, * but it keeps the rest of the box somewhat alive. * This was the reason for switching to VRAM queue mode. */ #define SiSIdle \ { \ if(pSiS->ChipFlags & SiSCF_Integrated) { \ CmdQueLen = 0; \ } else { \ CmdQueLen = ((512 * 1024) / 4) - 64; \ } \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) {}; \ while( (SIS_MMIO_IN16(pSiS->IOBase, Q_STATUS+2) & 0x8000) != 0x8000) {}; \ } #define SiSSetupSRCBase(base) \ if (CmdQueLen <= 0) SiSIdle; \ SIS_MMIO_OUT32(pSiS->IOBase, SRC_ADDR, base); \ CmdQueLen--; #define SiSSetupSRCPitch(pitch) \ if (CmdQueLen <= 0) SiSIdle; \ SIS_MMIO_OUT16(pSiS->IOBase, SRC_PITCH, pitch); \ CmdQueLen--; #define SiSSetupSRCXY(x,y) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, SRC_Y, (x)<<16 | (y) );\ CmdQueLen--; #define SiSSetupDSTBase(base) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, DST_ADDR, base);\ CmdQueLen--; #define SiSSetupDSTXY(x,y) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, DST_Y, (x)<<16 | (y) );\ CmdQueLen--; #define SiSSetupDSTRect(x,y) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, DST_PITCH, (y)<<16 | (x) );\ CmdQueLen--; #define SiSSetupDSTColorDepth(bpp) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT16(pSiS->IOBase, AGP_BASE, bpp);\ CmdQueLen--; #define SiSSetupRect(w,h) \ if(CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, RECT_WIDTH, (h)<<16 | (w) );\ CmdQueLen--; #define SiSSetupPATFG(color) \ if(CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, PAT_FGCOLOR, color);\ CmdQueLen--; #define SiSSetupPATBG(color) \ if(CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, PAT_BGCOLOR, color);\ CmdQueLen--; #define SiSSetupSRCFG(color) \ if(CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, SRC_FGCOLOR, color);\ CmdQueLen--; #define SiSSetupSRCBG(color) \ if(CmdQueLen <= 0) SiSIdle; \ SIS_MMIO_OUT32(pSiS->IOBase, SRC_BGCOLOR, color); \ CmdQueLen--; #define SiSSetupSRCTrans(color) \ if(CmdQueLen <= 1) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, TRANS_SRC_KEY_HIGH, color);\ SIS_MMIO_OUT32(pSiS->IOBase, TRANS_SRC_KEY_LOW, color);\ CmdQueLen -= 2; #define SiSSetupDSTTrans(color) \ if(CmdQueLen <= 1) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, TRANS_DST_KEY_HIGH, color); \ SIS_MMIO_OUT32(pSiS->IOBase, TRANS_DST_KEY_LOW, color); \ CmdQueLen -= 2; #define SiSSetupMONOPAT(p0,p1) \ if(CmdQueLen <= 1) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, MONO_MASK, p0);\ SIS_MMIO_OUT32(pSiS->IOBase, MONO_MASK+4, p1);\ CmdQueLen=CmdQueLen-2; #define SiSSetupClipLT(left,top) \ if(CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, LEFT_CLIP, ((left) & 0xFFFF) | (top)<<16); \ CmdQueLen--; #define SiSSetupClipRB(right,bottom) \ if(CmdQueLen <= 0) SiSIdle; \ SIS_MMIO_OUT32(pSiS->IOBase, RIGHT_CLIP, ((right) & 0xFFFF) | (bottom)<<16); \ CmdQueLen--; #define SiSSetupROP(rop) \ pSiS->CommandReg = (rop) << 8; #define SiSDoCMD \ if (CmdQueLen <= 1) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, COMMAND_READY, pSiS->CommandReg); \ SIS_MMIO_OUT32(pSiS->IOBase, FIRE_TRIGGER, 0); \ CmdQueLen -= 2; /* Line */ #define SiSSetupX0Y0(x,y) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, LINE_X0, (y)<<16 | (x) );\ CmdQueLen--; #define SiSSetupX1Y1(x,y) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, LINE_X1, (y)<<16 | (x) );\ CmdQueLen--; #define SiSSetupLineCount(c) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT16(pSiS->IOBase, LINE_COUNT, c);\ CmdQueLen--; #define SiSSetupStylePeriod(p) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT16(pSiS->IOBase, LINE_STYLE_PERIOD, p);\ CmdQueLen--; #define SiSSetupStyleLow(ls) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, LINE_STYLE_0, ls);\ CmdQueLen--; #define SiSSetupStyleHigh(ls) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, LINE_STYLE_1, ls);\ CmdQueLen--; /* Trapezoid */ #define SiSSetupYH(y,h) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, TRAP_YH, (y)<<16 | (h) );\ CmdQueLen--; #define SiSSetupLR(left,right) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, TRAP_LR, (right)<<16 | (left) );\ CmdQueLen--; #define SiSSetupdL(dxL,dyL) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, TRAP_DL, (dyL)<<16 | (dxL) );\ CmdQueLen--; #define SiSSetupdR(dxR,dyR) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, TRAP_DR, (dyR)<<16 | (dxR) );\ CmdQueLen--; #define SiSSetupEL(eL) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, TRAP_EL, eL);\ CmdQueLen--; #define SiSSetupER(eR) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, TRAP_ER, eR);\ CmdQueLen--; /* (Constant) alpha blended BitBlt (alpha = 8 bit) */ #define SiSSetupAlpha(alpha) \ if (CmdQueLen <= 0) SiSIdle;\ SIS_MMIO_OUT32(pSiS->IOBase, ALPHA_ALPHA, alpha);\ CmdQueLen--; /* Set Pattern register */ #define SiSSetPattern(num, value) \ if (CmdQueLen <= 0) SiSIdle; \ SIS_MMIO_OUT32(pSiS->IOBase, (PATTERN_REG + (num * 4)), value); \ CmdQueLen--; #endif /* MMIO mode */ xf86-video-sis-0.10.7/src/init301.c0000664000076400007640000124750111763614406013371 00000000000000/* * Mode initializing code (CRT2 section) * for SiS 300/305/540/630/730, * SiS 315/550/[M]650/651/[M]661[FGM]X/[M]74x[GX]/330/[M]76x[GX], * XGI V3XT/V5/V8, Z7 * (Universal module for Linux kernel framebuffer and X.org/XFree86 4.x) * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * If distributed as part of the Linux kernel, the following license terms * apply: * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the named License, * * or any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA * * Otherwise, the following license terms apply: * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted provided that the following conditions * * are met: * * 1) Redistributions of source code must retain the above copyright * * notice, this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright * * notice, this list of conditions and the following disclaimer in the * * documentation and/or other materials provided with the distribution. * * 3) The name of the author may not be used to endorse or promote products * * derived from this software without specific prior written permission. * * * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * * Formerly based on non-functional code-fragements for 300 series by SiS, Inc. * Used by permission. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #if 1 #define SET_EMI /* 302LV/ELV: Set EMI values */ #endif #if 1 #define SET_PWD /* 301/302LV: Set PWD */ #endif #define COMPAL_HACK /* Needed for Compal 1400x1050 (EMI) */ #define COMPAQ_HACK /* Needed for Inventec/Compaq 1280x1024 (EMI) */ #define ASUS_HACK /* Needed for Asus A2H 1024x768 (EMI) */ #include "init301.h" #ifdef SIS300 #include "oem300.h" #endif #ifdef SIS315H #include "oem310.h" #endif #define SiS_I2CDELAY 1000 #define SiS_I2CDELAYSHORT 150 static unsigned short SiS_GetBIOSLCDResInfo(struct SiS_Private *SiS_Pr); #ifdef SIS_LINUX_KERNEL static void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); #endif /*********************************************/ /* HELPER: Lock/Unlock CRT2 */ /*********************************************/ void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr) { if(SiS_Pr->ChipType == XGI_20) return; else if(SiS_Pr->ChipType >= SIS_315H) SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2f,0x01); else SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01); } #ifdef SIS_LINUX_KERNEL static #endif void SiS_LockCRT2(struct SiS_Private *SiS_Pr) { if(SiS_Pr->ChipType == XGI_20) return; else if(SiS_Pr->ChipType >= SIS_315H) SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2F,0xFE); else SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x24,0xFE); } /*********************************************/ /* HELPER: Write SR11 */ /*********************************************/ static void SiS_SetRegSR11ANDOR(struct SiS_Private *SiS_Pr, unsigned short DataAND, unsigned short DataOR) { if(SiS_Pr->ChipType >= SIS_661) { DataAND &= 0x0f; DataOR &= 0x0f; } SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,DataAND,DataOR); } /*********************************************/ /* HELPER: Get Pointer to LCD structure */ /*********************************************/ #ifdef SIS315H static unsigned char * GetLCDStructPtr661(struct SiS_Private *SiS_Pr) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned char *myptr = NULL; unsigned short romindex = 0, reg = 0, idx = 0; /* Use the BIOS tables only for LVDS panels; TMDS is unreliable * due to the variaty of panels the BIOS doesn't know about. * Exception: If the BIOS has better knowledge (such as in case * of machines with a 301C and a panel that does not support DDC) * use the BIOS data as well. */ if((SiS_Pr->SiS_ROMNew) && ( (SiS_Pr->SiS_VBType & VB_SISLVDS) || (!SiS_Pr->PanelSelfDetected) )) { if(SiS_Pr->ChipType < SIS_661) reg = 0x3c; else reg = 0x7d; idx = (SiS_GetReg(SiS_Pr->SiS_P3d4,reg) & 0x1f) * 26; if(idx < (8*26)) { myptr = (unsigned char *)&SiS_LCDStruct661[idx]; } romindex = SISGETROMW(0x100); if(romindex) { romindex += idx; myptr = &ROMAddr[romindex]; } } return myptr; } static unsigned short GetLCDStructPtr661_2(struct SiS_Private *SiS_Pr) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short romptr = 0; /* Use the BIOS tables only for LVDS panels; TMDS is unreliable * due to the variaty of panels the BIOS doesn't know about. * Exception: If the BIOS has better knowledge (such as in case * of machines with a 301C and a panel that does not support DDC) * use the BIOS data as well. */ if((SiS_Pr->SiS_ROMNew) && ( (SiS_Pr->SiS_VBType & VB_SISLVDS) || (!SiS_Pr->PanelSelfDetected) )) { romptr = SISGETROMW(0x102); romptr += ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) * SiS_Pr->SiS661LCD2TableSize); } return romptr; } #endif /*********************************************/ /* Adjust Rate for CRT2 */ /*********************************************/ static BOOLEAN SiS_AdjustCRT2Rate(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RRTI, unsigned short *i) { unsigned short checkmask=0, modeid, infoflag; modeid = SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID; if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { checkmask |= SupportRAMDAC2; if(SiS_Pr->ChipType >= SIS_315H) { checkmask |= SupportRAMDAC2_135; if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { checkmask |= SupportRAMDAC2_162; if(SiS_Pr->SiS_VBType & VB_SISRAMDAC202) { checkmask |= SupportRAMDAC2_202; } } } } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { checkmask |= SupportLCD; if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_VBType & VB_SISVB) { if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) { if(modeid == 0x2e) checkmask |= Support64048060Hz; } } } } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { checkmask |= SupportHiVision; } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToYPbPr525750|SetCRT2ToAVIDEO|SetCRT2ToSVIDEO|SetCRT2ToSCART)) { checkmask |= SupportTV; if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { checkmask |= SupportTV1024; if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { checkmask |= SupportYPbPr750p; } } } } } else { /* LVDS */ if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { checkmask |= SupportCHTV; } } if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { checkmask |= SupportLCD; } } /* Look backwards in table for matching CRT2 mode */ for(; SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID == modeid; (*i)--) { infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag; if(infoflag & checkmask) return TRUE; if((*i) == 0) break; } /* Look through the whole mode-section of the table from the beginning * for a matching CRT2 mode if no mode was found yet. */ for((*i) = 0; ; (*i)++) { if(SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID != modeid) break; infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag; if(infoflag & checkmask) return TRUE; } return FALSE; } /*********************************************/ /* Get rate index */ /*********************************************/ unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned short RRTI,i,backup_i; unsigned short modeflag,index,temp,backupindex; static const unsigned short LCDRefreshIndex[] = { 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 }; /* Do NOT check for UseCustomMode here, will skrew up FIFO */ if(ModeNo == 0xfe) return 0; if(ModeNo <= 0x13) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; } else { modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; } if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { if(modeflag & HalfDCLK) return 0; } } if(ModeNo < 0x14) return 0xFFFF; index = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x33) >> SiS_Pr->SiS_SelectCRT2Rate) & 0x0F; backupindex = index; if(index > 0) index--; if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { if(SiS_Pr->SiS_VBType & VB_NoLCD) index = 0; else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index = backupindex = 0; } if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(!(SiS_Pr->SiS_VBType & VB_NoLCD)) { temp = LCDRefreshIndex[SiS_GetBIOSLCDResInfo(SiS_Pr)]; if(index > temp) index = temp; } } } else { if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) index = 0; if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) index = 0; } } } RRTI = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex; ModeNo = SiS_Pr->SiS_RefIndex[RRTI].ModeID; if(SiS_Pr->ChipType >= SIS_315H) { if(!(SiS_Pr->SiS_VBInfo & DriverMode)) { if( (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x105) || (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x107) ) { if(backupindex <= 1) RRTI++; } } } i = 0; do { if(SiS_Pr->SiS_RefIndex[RRTI + i].ModeID != ModeNo) break; temp = SiS_Pr->SiS_RefIndex[RRTI + i].Ext_InfoFlag; temp &= ModeTypeMask; if(temp < SiS_Pr->SiS_ModeType) break; i++; index--; } while(index != 0xFFFF); if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { temp = SiS_Pr->SiS_RefIndex[RRTI + i - 1].Ext_InfoFlag; if(temp & InterlaceMode) i++; } } i--; if((SiS_Pr->SiS_SetFlag & ProgrammingCRT2) && (!(SiS_Pr->SiS_VBInfo & DisableCRT2Display))) { backup_i = i; if(!(SiS_AdjustCRT2Rate(SiS_Pr, ModeNo, ModeIdIndex, RRTI, &i))) { i = backup_i; } } return (RRTI + i); } /*********************************************/ /* STORE CRT2 INFO in CR34 */ /*********************************************/ static void SiS_SaveCRT2Info(struct SiS_Private *SiS_Pr, unsigned short ModeNo) { unsigned short temp1, temp2; /* Store CRT1 ModeNo in CR34 */ SiS_SetReg(SiS_Pr->SiS_P3d4,0x34,ModeNo); temp1 = (SiS_Pr->SiS_VBInfo & SetInSlaveMode) >> 8; temp2 = ~(SetInSlaveMode >> 8); SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x31,temp2,temp1); } /*********************************************/ /* HELPER: GET SOME DATA FROM BIOS ROM */ /*********************************************/ #ifdef SIS300 static BOOLEAN SiS_CR36BIOSWord23b(struct SiS_Private *SiS_Pr) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short temp,temp1; if(SiS_Pr->SiS_UseROM) { if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); temp1 = SISGETROMW(0x23b); if(temp1 & temp) return TRUE; } } return FALSE; } static BOOLEAN SiS_CR36BIOSWord23d(struct SiS_Private *SiS_Pr) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short temp,temp1; if(SiS_Pr->SiS_UseROM) { if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); temp1 = SISGETROMW(0x23d); if(temp1 & temp) return TRUE; } } return FALSE; } #endif /*********************************************/ /* HELPER: DELAY FUNCTIONS */ /*********************************************/ void SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime) { unsigned int i, j; for(i = 0; i < delaytime; i++) { j += SiS_GetReg(SiS_Pr->SiS_P3c4,0x05); } } #if defined(SIS300) || defined(SIS315H) static void SiS_GenericDelay(struct SiS_Private *SiS_Pr, unsigned short delay) { SiS_DDC2Delay(SiS_Pr, delay * 36); } #endif #ifdef SIS315H static void SiS_LongDelay(struct SiS_Private *SiS_Pr, unsigned short delay) { while(delay--) { SiS_GenericDelay(SiS_Pr, 6623); } } #endif #if defined(SIS300) || defined(SIS315H) static void SiS_ShortDelay(struct SiS_Private *SiS_Pr, unsigned short delay) { while(delay--) { SiS_GenericDelay(SiS_Pr, 66); } } #endif static void SiS_PanelDelay(struct SiS_Private *SiS_Pr, unsigned short DelayTime) { #if defined(SIS300) || defined(SIS315H) unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short PanelID, DelayIndex, Delay=0; #endif if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_VBType & VB_SIS301) PanelID &= 0xf7; if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x18) & 0x10)) PanelID = 0x12; } DelayIndex = PanelID >> 4; if((DelayTime >= 2) && ((PanelID & 0x0f) == 1)) { Delay = 3; } else { if(DelayTime >= 2) DelayTime -= 2; if(!(DelayTime & 0x01)) { Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; } else { Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1]; } if(SiS_Pr->SiS_UseROM) { if(ROMAddr[0x220] & 0x40) { if(!(DelayTime & 0x01)) Delay = (unsigned short)ROMAddr[0x225]; else Delay = (unsigned short)ROMAddr[0x226]; } } } SiS_ShortDelay(SiS_Pr, Delay); #endif /* SIS300 */ } else { #ifdef SIS315H if((SiS_Pr->ChipType >= SIS_661) || (SiS_Pr->ChipType <= SIS_315PRO) || (SiS_Pr->ChipType == SIS_330) || (SiS_Pr->SiS_ROMNew)) { if(!(DelayTime & 0x01)) { SiS_DDC2Delay(SiS_Pr, 0x1000); } else { SiS_DDC2Delay(SiS_Pr, 0x4000); } } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* || (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || (SiS_Pr->SiS_CustomT == CUT_CLEVO1400) */ ) { /* 315 series, LVDS; Special */ if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); if(SiS_Pr->SiS_CustomT == CUT_CLEVO1400) { if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1b) & 0x10)) PanelID = 0x12; } if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { DelayIndex = PanelID & 0x0f; } else { DelayIndex = PanelID >> 4; } if((DelayTime >= 2) && ((PanelID & 0x0f) == 1)) { Delay = 3; } else { if(DelayTime >= 2) DelayTime -= 2; if(!(DelayTime & 0x01)) { Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[0]; } else { Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[1]; } if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { if(ROMAddr[0x13c] & 0x40) { if(!(DelayTime & 0x01)) { Delay = (unsigned short)ROMAddr[0x17e]; } else { Delay = (unsigned short)ROMAddr[0x17f]; } } } } SiS_ShortDelay(SiS_Pr, Delay); } } else if(SiS_Pr->SiS_VBType & VB_SISVB) { /* 315 series, all bridges */ DelayIndex = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; if(!(DelayTime & 0x01)) { Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; } else { Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1]; } Delay <<= 8; SiS_DDC2Delay(SiS_Pr, Delay); } #endif /* SIS315H */ } } #ifdef SIS315H static void SiS_PanelDelayLoop(struct SiS_Private *SiS_Pr, unsigned short DelayTime, unsigned short DelayLoop) { int i; for(i = 0; i < DelayLoop; i++) { SiS_PanelDelay(SiS_Pr, DelayTime); } } #endif /*********************************************/ /* HELPER: WAIT-FOR-RETRACE FUNCTIONS */ /*********************************************/ void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr) { unsigned short watchdog; if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f) & 0xc0) return; if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80)) return; watchdog = 65535; while((SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08) && --watchdog); watchdog = 65535; while((!(SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog); } #if defined(SIS300) || defined(SIS315H) static void SiS_WaitRetrace2(struct SiS_Private *SiS_Pr, unsigned short reg) { unsigned short watchdog; watchdog = 65535; while((SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02) && --watchdog); watchdog = 65535; while((!(SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02)) && --watchdog); } #endif static void SiS_WaitVBRetrace(struct SiS_Private *SiS_Pr) { if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x20)) return; } if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x80)) { SiS_WaitRetrace1(SiS_Pr); } else { SiS_WaitRetrace2(SiS_Pr, 0x25); } #endif } else { #ifdef SIS315H if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x40)) { SiS_WaitRetrace1(SiS_Pr); } else { SiS_WaitRetrace2(SiS_Pr, 0x30); } #endif } } static void SiS_VBWait(struct SiS_Private *SiS_Pr) { unsigned short tempal,temp,i,j; temp = 0; for(i = 0; i < 3; i++) { for(j = 0; j < 100; j++) { tempal = SiS_GetRegByte(SiS_Pr->SiS_P3da); if(temp & 0x01) { if((tempal & 0x08)) continue; else break; } else { if(!(tempal & 0x08)) continue; else break; } } temp ^= 0x01; } } static void SiS_VBLongWait(struct SiS_Private *SiS_Pr) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { SiS_VBWait(SiS_Pr); } else { SiS_WaitRetrace1(SiS_Pr); } } /*********************************************/ /* HELPER: MISC */ /*********************************************/ #ifdef SIS300 static BOOLEAN SiS_Is301B(struct SiS_Private *SiS_Pr) { if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01) >= 0xb0) return TRUE; return FALSE; } #endif static BOOLEAN SiS_CRT2IsLCD(struct SiS_Private *SiS_Pr) { if(SiS_Pr->ChipType == SIS_730) { if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x20) return TRUE; } if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & 0x20) return TRUE; return FALSE; } BOOLEAN SiS_IsDualEdge(struct SiS_Private *SiS_Pr) { #ifdef SIS315H if(SiS_Pr->ChipType >= SIS_315H) { if((SiS_Pr->ChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) { if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return TRUE; } } #endif return FALSE; } BOOLEAN SiS_IsVAMode(struct SiS_Private *SiS_Pr) { #ifdef SIS315H unsigned short flag; if(SiS_Pr->ChipType >= SIS_315H) { flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); if((flag & EnableDualEdge) && (flag & SetToLCDA)) return TRUE; } #endif return FALSE; } #ifdef SIS315H static BOOLEAN SiS_IsVAorLCD(struct SiS_Private *SiS_Pr) { if(SiS_IsVAMode(SiS_Pr)) return TRUE; if(SiS_CRT2IsLCD(SiS_Pr)) return TRUE; return FALSE; } #endif static BOOLEAN SiS_IsDualLink(struct SiS_Private *SiS_Pr) { #ifdef SIS315H if(SiS_Pr->ChipType >= SIS_315H) { if((SiS_CRT2IsLCD(SiS_Pr)) || (SiS_IsVAMode(SiS_Pr))) { if(SiS_Pr->SiS_LCDInfo & LCDDualLink) return TRUE; } } #endif return FALSE; } #ifdef SIS315H static BOOLEAN SiS_TVEnabled(struct SiS_Private *SiS_Pr) { if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return TRUE; if(SiS_Pr->SiS_VBType & VB_SISYPBPR) { if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return TRUE; } return FALSE; } #endif #ifdef SIS315H static BOOLEAN SiS_LCDAEnabled(struct SiS_Private *SiS_Pr) { if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) return TRUE; return FALSE; } #endif #ifdef SIS315H static BOOLEAN SiS_WeHaveBacklightCtrl(struct SiS_Private *SiS_Pr) { if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) { if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0x10) return TRUE; } return FALSE; } #endif #ifdef SIS315H static BOOLEAN SiS_IsNotM650orLater(struct SiS_Private *SiS_Pr) { unsigned short flag; if(SiS_Pr->ChipType == SIS_650) { flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0; /* Check for revision != A0 only */ if((flag == 0xe0) || (flag == 0xc0) || (flag == 0xb0) || (flag == 0x90)) return FALSE; } else if(SiS_Pr->ChipType >= SIS_661) return FALSE; return TRUE; } #endif #ifdef SIS315H static BOOLEAN SiS_IsYPbPr(struct SiS_Private *SiS_Pr) { if(SiS_Pr->ChipType >= SIS_315H) { /* YPrPb = 0x08 */ if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHYPbPr) return TRUE; } return FALSE; } #endif #ifdef SIS315H static BOOLEAN SiS_IsChScart(struct SiS_Private *SiS_Pr) { if(SiS_Pr->ChipType >= SIS_315H) { /* Scart = 0x04 */ if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHScart) return TRUE; } return FALSE; } #endif #ifdef SIS315H static BOOLEAN SiS_IsTVOrYPbPrOrScart(struct SiS_Private *SiS_Pr) { unsigned short flag; if(SiS_Pr->ChipType >= SIS_315H) { flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); if(flag & SetCRT2ToTV) return TRUE; flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); if(flag & EnableCHYPbPr) return TRUE; /* = YPrPb = 0x08 */ if(flag & EnableCHScart) return TRUE; /* = Scart = 0x04 - TW */ } else { flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); if(flag & SetCRT2ToTV) return TRUE; } return FALSE; } #endif #ifdef SIS315H static BOOLEAN SiS_IsLCDOrLCDA(struct SiS_Private *SiS_Pr) { unsigned short flag; if(SiS_Pr->ChipType >= SIS_315H) { flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); if(flag & SetCRT2ToLCD) return TRUE; flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); if(flag & SetToLCDA) return TRUE; } else { flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); if(flag & SetCRT2ToLCD) return TRUE; } return FALSE; } #endif static BOOLEAN SiS_HaveBridge(struct SiS_Private *SiS_Pr) { unsigned short flag; if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { return TRUE; } else if(SiS_Pr->SiS_VBType & VB_SISVB) { flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00); if((flag == 1) || (flag == 2)) return TRUE; } return FALSE; } static BOOLEAN SiS_BridgeIsEnabled(struct SiS_Private *SiS_Pr) { unsigned short flag; if(SiS_HaveBridge(SiS_Pr)) { flag = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); if(SiS_Pr->ChipType < SIS_315H) { flag &= 0xa0; if((flag == 0x80) || (flag == 0x20)) return TRUE; } else { flag &= 0x50; if((flag == 0x40) || (flag == 0x10)) return TRUE; } } return FALSE; } static BOOLEAN SiS_BridgeInSlavemode(struct SiS_Private *SiS_Pr) { unsigned short flag1; flag1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); if(flag1 & (SetInSlaveMode >> 8)) return TRUE; return FALSE; } /*********************************************/ /* GET VIDEO BRIDGE CONFIG INFO */ /*********************************************/ /* Setup general purpose IO for Chrontel communication */ #ifdef SIS300 void SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo) { unsigned int acpibase; unsigned short temp; if(!(SiS_Pr->SiS_ChSW)) return; #ifdef SIS_LINUX_KERNEL acpibase = sisfb_read_lpc_pci_dword(SiS_Pr, 0x74); #else acpibase = sis_pci_read_device_u32(1, 0x74); #endif acpibase &= 0xFFFF; if(!acpibase) return; temp = SiS_GetRegShort((acpibase + 0x3c)); /* ACPI register 0x3c: GP Event 1 I/O mode select */ temp &= 0xFEFF; SiS_SetRegShort((acpibase + 0x3c), temp); temp = SiS_GetRegShort((acpibase + 0x3c)); temp = SiS_GetRegShort((acpibase + 0x3a)); /* ACPI register 0x3a: GP Pin Level (low/high) */ temp &= 0xFEFF; if(!(myvbinfo & SetCRT2ToTV)) temp |= 0x0100; SiS_SetRegShort((acpibase + 0x3a), temp); temp = SiS_GetRegShort((acpibase + 0x3a)); } #endif void SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, int checkcrt2mode) { unsigned short tempax, tempbx, temp; unsigned short modeflag, resinfo = 0; SiS_Pr->SiS_SetFlag = 0; modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); SiS_Pr->SiS_ModeType = modeflag & ModeTypeMask; if((ModeNo > 0x13) && (!SiS_Pr->UseCustomMode)) { resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; } tempbx = 0; if(SiS_HaveBridge(SiS_Pr)) { temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); tempbx |= temp; tempax = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) << 8; tempax &= (DriverMode | LoadDACFlag | SetNotSimuMode | SetPALTV); tempbx |= tempax; #ifdef SIS315H if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_VBType & VB_SISLCDA) { if(ModeNo == 0x03) { /* Mode 0x03 is never in driver mode */ SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x31,0xbf); } if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8))) { /* Reset LCDA setting if not driver mode */ SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc); } if(IS_SIS650) { if(SiS_Pr->SiS_UseLCDA) { if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xF0) { if((ModeNo <= 0x13) || (!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8)))) { SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x38,(EnableDualEdge | SetToLCDA)); } } } } temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); if((temp & (EnableDualEdge | SetToLCDA)) == (EnableDualEdge | SetToLCDA)) { tempbx |= SetCRT2ToLCDA; } } if(SiS_Pr->ChipType >= SIS_661) { /* New CR layout */ tempbx &= ~(SetCRT2ToYPbPr525750 | SetCRT2ToHiVision); if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & 0x04) { temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35) & 0xe0; if(temp == 0x60) tempbx |= SetCRT2ToHiVision; else if(SiS_Pr->SiS_VBType & VB_SISYPBPR) { tempbx |= SetCRT2ToYPbPr525750; } } } if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); if(temp & SetToLCDA) { tempbx |= SetCRT2ToLCDA; } if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if(temp & EnableCHYPbPr) { tempbx |= SetCRT2ToCHYPbPr; } } } } #endif /* SIS315H */ if(!(SiS_Pr->SiS_VBType & VB_SISVGA2)) { tempbx &= ~(SetCRT2ToRAMDAC); } if(SiS_Pr->SiS_VBType & VB_SISVB) { temp = SetCRT2ToSVIDEO | SetCRT2ToAVIDEO | SetCRT2ToSCART | SetCRT2ToLCDA | SetCRT2ToLCD | SetCRT2ToRAMDAC | SetCRT2ToHiVision | SetCRT2ToYPbPr525750; } else { if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { temp = SetCRT2ToAVIDEO | SetCRT2ToSVIDEO | SetCRT2ToSCART | SetCRT2ToLCDA | SetCRT2ToLCD | SetCRT2ToCHYPbPr; } else { temp = SetCRT2ToLCDA | SetCRT2ToLCD; } } else { if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { temp = SetCRT2ToTV | SetCRT2ToLCD; } else { temp = SetCRT2ToLCD; } } } if(!(tempbx & temp)) { tempax = DisableCRT2Display; tempbx = 0; } if(SiS_Pr->SiS_VBType & VB_SISVB) { unsigned short clearmask = ( DriverMode | DisableCRT2Display | LoadDACFlag | SetNotSimuMode | SetInSlaveMode | SetPALTV | SwitchCRT2 | SetSimuScanMode ); if(tempbx & SetCRT2ToLCDA) tempbx &= (clearmask | SetCRT2ToLCDA); if(tempbx & SetCRT2ToRAMDAC) tempbx &= (clearmask | SetCRT2ToRAMDAC); if(tempbx & SetCRT2ToLCD) tempbx &= (clearmask | SetCRT2ToLCD); if(tempbx & SetCRT2ToSCART) tempbx &= (clearmask | SetCRT2ToSCART); if(tempbx & SetCRT2ToHiVision) tempbx &= (clearmask | SetCRT2ToHiVision); if(tempbx & SetCRT2ToYPbPr525750) tempbx &= (clearmask | SetCRT2ToYPbPr525750); } else { if(SiS_Pr->ChipType >= SIS_315H) { if(tempbx & SetCRT2ToLCDA) { tempbx &= (0xFF00|SwitchCRT2|SetSimuScanMode); } } if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if(tempbx & SetCRT2ToTV) { tempbx &= (0xFF00|SetCRT2ToTV|SwitchCRT2|SetSimuScanMode); } } if(tempbx & SetCRT2ToLCD) { tempbx &= (0xFF00|SetCRT2ToLCD|SwitchCRT2|SetSimuScanMode); } if(SiS_Pr->ChipType >= SIS_315H) { if(tempbx & SetCRT2ToLCDA) { tempbx |= SetCRT2ToLCD; } } } if(tempax & DisableCRT2Display) { if(!(tempbx & (SwitchCRT2 | SetSimuScanMode))) { tempbx = SetSimuScanMode | DisableCRT2Display; } } if(!(tempbx & DriverMode)) tempbx |= SetSimuScanMode; /* LVDS/CHRONTEL (LCD/TV) and 301BDH (LCD) can only be slave in 8bpp modes */ if(SiS_Pr->SiS_ModeType <= ModeVGA) { if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) || ((SiS_Pr->SiS_VBType & VB_NoLCD) && (tempbx & SetCRT2ToLCD)) ) { modeflag &= (~CRT2Mode); } } if(!(tempbx & SetSimuScanMode)) { if(tempbx & SwitchCRT2) { if((!(modeflag & CRT2Mode)) && (checkcrt2mode)) { if(resinfo != SIS_RI_1600x1200) { tempbx |= SetSimuScanMode; } } } else { if(SiS_BridgeIsEnabled(SiS_Pr)) { if(!(tempbx & DriverMode)) { if(SiS_BridgeInSlavemode(SiS_Pr)) { tempbx |= SetSimuScanMode; } } } } } if(!(tempbx & DisableCRT2Display)) { if(tempbx & DriverMode) { if(tempbx & SetSimuScanMode) { if((!(modeflag & CRT2Mode)) && (checkcrt2mode)) { if(resinfo != SIS_RI_1600x1200) { tempbx |= SetInSlaveMode; } } } } else { tempbx |= SetInSlaveMode; } } } SiS_Pr->SiS_VBInfo = tempbx; #ifdef SIS300 if(SiS_Pr->ChipType == SIS_630) { SiS_SetChrontelGPIO(SiS_Pr, SiS_Pr->SiS_VBInfo); } #endif #ifdef SIS_LINUX_KERNEL #if 0 printk(KERN_DEBUG "sisfb: (init301: VBInfo= 0x%04x, SetFlag=0x%04x)\n", SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); #endif #endif #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_PROBED, "(init301: VBInfo=0x%04x, SetFlag=0x%04x)\n", SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); #endif #endif } /*********************************************/ /* DETERMINE YPbPr MODE */ /*********************************************/ void SiS_SetYPbPr(struct SiS_Private *SiS_Pr) { unsigned char temp; /* Note: This variable is only used on 30xLV systems. * CR38 has a different meaning on LVDS/CH7019 systems. * On 661 and later, these bits moved to CR35. * * On 301, 301B, only HiVision 1080i is supported. * On 30xLV, 301C, only YPbPr 1080i is supported. */ SiS_Pr->SiS_YPbPr = 0; if(SiS_Pr->ChipType >= SIS_661) return; if(SiS_Pr->SiS_VBType) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { SiS_Pr->SiS_YPbPr = YPbPrHiVision; } } if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_VBType & VB_SISYPBPR) { temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); if(temp & 0x08) { switch((temp >> 4)) { case 0x00: SiS_Pr->SiS_YPbPr = YPbPr525i; break; case 0x01: SiS_Pr->SiS_YPbPr = YPbPr525p; break; case 0x02: SiS_Pr->SiS_YPbPr = YPbPr750p; break; case 0x03: SiS_Pr->SiS_YPbPr = YPbPrHiVision; break; } } } } } /*********************************************/ /* DETERMINE TVMode flag */ /*********************************************/ void SiS_SetTVMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short temp, temp1, resinfo = 0, romindex = 0; unsigned char OutputSelect = *SiS_Pr->pSiS_OutputSelect; SiS_Pr->SiS_TVMode = 0; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) return; if(SiS_Pr->UseCustomMode) return; if(ModeNo > 0x13) { resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; } if(SiS_Pr->ChipType < SIS_661) { if(SiS_Pr->SiS_VBInfo & SetPALTV) SiS_Pr->SiS_TVMode |= TVSetPAL; if(SiS_Pr->SiS_VBType & VB_SISVB) { temp = 0; if((SiS_Pr->ChipType == SIS_630) || (SiS_Pr->ChipType == SIS_730)) { temp = 0x35; romindex = 0xfe; } else if(SiS_Pr->ChipType >= SIS_315H) { temp = 0x38; if(SiS_Pr->ChipType < XGI_20) { romindex = 0xf3; if(SiS_Pr->ChipType >= SIS_330) romindex = 0x11b; } } if(temp) { if(romindex && SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { OutputSelect = ROMAddr[romindex]; if(!(OutputSelect & EnablePALMN)) { SiS_SetRegAND(SiS_Pr->SiS_P3d4,temp,0x3F); } } temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,temp); if(SiS_Pr->SiS_TVMode & TVSetPAL) { if(temp1 & EnablePALM) { /* 0x40 */ SiS_Pr->SiS_TVMode |= TVSetPALM; SiS_Pr->SiS_TVMode &= ~TVSetPAL; } else if(temp1 & EnablePALN) { /* 0x80 */ SiS_Pr->SiS_TVMode |= TVSetPALN; } } else { if(temp1 & EnableNTSCJ) { /* 0x40 */ SiS_Pr->SiS_TVMode |= TVSetNTSCJ; } } } /* Translate HiVision/YPbPr to our new flags */ if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { if(SiS_Pr->SiS_YPbPr == YPbPr750p) { SiS_Pr->SiS_TVMode |= TVSetYPbPr750p; } else if(SiS_Pr->SiS_YPbPr == YPbPr525p) { if(SiS_Pr->SiS_TVMode & TVSetPAL) { SiS_Pr->SiS_TVMode |= TVSetYPbPr625p; } else { SiS_Pr->SiS_TVMode |= TVSetYPbPr525p; } } else if(SiS_Pr->SiS_YPbPr == YPbPrHiVision) { SiS_Pr->SiS_TVMode |= TVSetHiVision; } else { if(SiS_Pr->SiS_TVMode & TVSetPAL) { SiS_Pr->SiS_TVMode |= TVSetYPbPr625i; } else { SiS_Pr->SiS_TVMode |= TVSetYPbPr525i; } } if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetYPbPr525p | TVSetYPbPr625p | TVSetYPbPr525i | TVSetYPbPr625i)) { SiS_Pr->SiS_VBInfo &= ~SetCRT2ToHiVision; SiS_Pr->SiS_VBInfo |= SetCRT2ToYPbPr525750; SiS_Pr->SiS_TVMode &= ~TVSetPAL; } else if(SiS_Pr->SiS_TVMode & TVSetHiVision) { SiS_Pr->SiS_TVMode |= TVSetPAL; } } } else if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if(SiS_Pr->SiS_CHOverScan) { if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); if((temp & TVOverScan) || (SiS_Pr->SiS_CHOverScan == 1)) { SiS_Pr->SiS_TVMode |= TVSetCHOverScan; } } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x79); if((temp & 0x80) || (SiS_Pr->SiS_CHOverScan == 1)) { SiS_Pr->SiS_TVMode |= TVSetCHOverScan; } } if(SiS_Pr->SiS_CHSOverScan) { SiS_Pr->SiS_TVMode |= TVSetCHOverScan; } } if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); if(SiS_Pr->SiS_TVMode & TVSetPAL) { if(temp & EnablePALM) SiS_Pr->SiS_TVMode |= TVSetPALM; else if(temp & EnablePALN) SiS_Pr->SiS_TVMode |= TVSetPALN; } else { if(temp & EnableNTSCJ) { SiS_Pr->SiS_TVMode |= TVSetNTSCJ; } } } } } else { /* 661 and later */ temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); if(temp1 & 0x01) { SiS_Pr->SiS_TVMode |= TVSetPAL; if(temp1 & 0x08) { SiS_Pr->SiS_TVMode |= TVSetPALN; } else if(temp1 & 0x04) { if(SiS_Pr->SiS_VBType & VB_SISVB) { SiS_Pr->SiS_TVMode &= ~TVSetPAL; } SiS_Pr->SiS_TVMode |= TVSetPALM; } } else { if(temp1 & 0x02) { SiS_Pr->SiS_TVMode |= TVSetNTSCJ; } } if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { if(SiS_Pr->SiS_CHOverScan) { if((temp1 & 0x10) || (SiS_Pr->SiS_CHOverScan == 1)) { SiS_Pr->SiS_TVMode |= TVSetCHOverScan; } } } if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { temp1 &= 0xe0; if(temp1 == 0x00) { if(SiS_Pr->SiS_TVMode & TVSetPAL) { SiS_Pr->SiS_TVMode |= TVSetYPbPr625i; } else { SiS_Pr->SiS_TVMode |= TVSetYPbPr525i; } } else if(temp1 == 0x20) { if(SiS_Pr->SiS_TVMode & TVSetPAL) { SiS_Pr->SiS_TVMode |= TVSetYPbPr625p; } else { SiS_Pr->SiS_TVMode |= TVSetYPbPr525p; } } else if(temp1 == 0x40) { SiS_Pr->SiS_TVMode |= TVSetYPbPr750p; } SiS_Pr->SiS_TVMode &= ~TVSetPAL; } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { SiS_Pr->SiS_TVMode |= (TVSetHiVision | TVSetPAL); } if(SiS_Pr->SiS_VBInfo & (SetCRT2ToYPbPr525750 | SetCRT2ToHiVision)) { if(resinfo == SIS_RI_800x480 || resinfo == SIS_RI_1024x576 || resinfo == SIS_RI_1280x720) { SiS_Pr->SiS_TVMode |= TVAspect169; } else { temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x39); if(temp1 & 0x02) { if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetHiVision)) { SiS_Pr->SiS_TVMode |= TVAspect169; } else { SiS_Pr->SiS_TVMode |= TVAspect43LB; } } else { SiS_Pr->SiS_TVMode |= TVAspect43; } } } } } if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) SiS_Pr->SiS_TVMode |= TVSetPAL; if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { SiS_Pr->SiS_TVMode |= TVSetPAL; SiS_Pr->SiS_TVMode &= ~(TVSetPALM | TVSetPALN | TVSetNTSCJ); } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525i | TVSetYPbPr625i | TVSetYPbPr525p | TVSetYPbPr625p | TVSetYPbPr750p)) { SiS_Pr->SiS_TVMode &= ~(TVSetPAL | TVSetNTSCJ | TVSetPALM | TVSetPALN); } } if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { SiS_Pr->SiS_TVMode |= TVSetTVSimuMode; } } if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { if(resinfo == SIS_RI_1024x768) { if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { SiS_Pr->SiS_TVMode |= TVSet525p1024; } else if(!(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr750p | TVSetYPbPr625p | TVSetYPbPr625i))) { SiS_Pr->SiS_TVMode |= TVSetNTSC1024; } } } if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { if(resinfo == SIS_RI_960x540) { SiS_Pr->SiS_TVMode |= TVSetHiVi960540; } } SiS_Pr->SiS_TVMode |= TVRPLLDIV2XO; if((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) && (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; } else if(SiS_Pr->SiS_TVMode & TVSetYPbPrProg) { SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; } else if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) { if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; } } } SiS_Pr->SiS_VBInfo &= ~SetPALTV; #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "(init301: TVMode %x, VBInfo %x)\n", SiS_Pr->SiS_TVMode, SiS_Pr->SiS_VBInfo); #endif #endif } /*********************************************/ /* GET LCD INFO */ /*********************************************/ static unsigned short SiS_GetBIOSLCDResInfo(struct SiS_Private *SiS_Pr) { unsigned short temp = SiS_Pr->SiS_LCDResInfo; /* Translate my LCDResInfo to BIOS value */ switch(temp) { case Panel_1280x768_2: temp = Panel_1280x768; break; case Panel_1280x800_2: temp = Panel_1280x800; break; case Panel_1280x854: temp = Panel661_1280x854; break; } return temp; } static void SiS_GetLCDInfoBIOS(struct SiS_Private *SiS_Pr) { #ifdef SIS315H unsigned char *ROMAddr; unsigned short temp; #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "Paneldata driver: [%d %d] [H %d %d] [V %d %d] [C %d 0x%02x 0x%02x]\n", SiS_Pr->PanelHT, SiS_Pr->PanelVT, SiS_Pr->PanelHRS, SiS_Pr->PanelHRE, SiS_Pr->PanelVRS, SiS_Pr->PanelVRE, SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].CLOCK, SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_A, SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_B); #endif #endif if((ROMAddr = GetLCDStructPtr661(SiS_Pr))) { if((temp = SISGETROMW(6)) != SiS_Pr->PanelHT) { SiS_Pr->SiS_NeedRomModeData = TRUE; SiS_Pr->PanelHT = temp; } if((temp = SISGETROMW(8)) != SiS_Pr->PanelVT) { SiS_Pr->SiS_NeedRomModeData = TRUE; SiS_Pr->PanelVT = temp; } SiS_Pr->PanelHRS = SISGETROMW(10); SiS_Pr->PanelHRE = SISGETROMW(12); SiS_Pr->PanelVRS = SISGETROMW(14); SiS_Pr->PanelVRE = SISGETROMW(16); SiS_Pr->PanelVCLKIdx315 = VCLK_CUSTOM_315; SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].CLOCK = SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].CLOCK = (unsigned short)((unsigned char)ROMAddr[18]); SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2B = SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_A = ROMAddr[19]; SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2C = SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_B = ROMAddr[20]; #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "Paneldata BIOS: [%d %d] [H %d %d] [V %d %d] [C %d 0x%02x 0x%02x]\n", SiS_Pr->PanelHT, SiS_Pr->PanelVT, SiS_Pr->PanelHRS, SiS_Pr->PanelHRE, SiS_Pr->PanelVRS, SiS_Pr->PanelVRE, SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].CLOCK, SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_A, SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_B); #endif #endif } #endif } static void SiS_CheckScaling(struct SiS_Private *SiS_Pr, unsigned short resinfo, const unsigned char *nonscalingmodes) { int i = 0; while(nonscalingmodes[i] != 0xff) { if(nonscalingmodes[i++] == resinfo) { if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) || (SiS_Pr->UsePanelScaler == -1)) { SiS_Pr->SiS_LCDInfo |= DontExpandLCD; } break; } } } void SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned short temp,modeflag,resinfo=0,modexres=0,modeyres=0; BOOLEAN panelcanscale = FALSE; #ifdef SIS300 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; static const unsigned char SiS300SeriesLCDRes[] = { 0, 1, 2, 3, 7, 4, 5, 8, 0, 0, 10, 0, 0, 0, 0, 15 }; #endif #ifdef SIS315H unsigned char *myptr = NULL; #endif SiS_Pr->SiS_LCDResInfo = 0; SiS_Pr->SiS_LCDTypeInfo = 0; SiS_Pr->SiS_LCDInfo = 0; SiS_Pr->PanelHRS = 999; /* HSync start */ SiS_Pr->PanelHRE = 999; /* HSync end */ SiS_Pr->PanelVRS = 999; /* VSync start */ SiS_Pr->PanelVRE = 999; /* VSync end */ SiS_Pr->SiS_NeedRomModeData = FALSE; /* Alternative 1600x1200@60 timing for 1600x1200 LCDA */ SiS_Pr->Alternate1600x1200 = FALSE; if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))) return; modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); if((ModeNo > 0x13) && (!SiS_Pr->UseCustomMode)) { resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; modexres = SiS_Pr->SiS_ModeResInfo[resinfo].HTotal; modeyres = SiS_Pr->SiS_ModeResInfo[resinfo].VTotal; } temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); /* For broken BIOSes: Assume 1024x768 */ if(temp == 0) temp = 0x02; if((SiS_Pr->ChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { SiS_Pr->SiS_LCDTypeInfo = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x7c) >> 2; } else if((SiS_Pr->ChipType < SIS_315H) || (SiS_Pr->ChipType >= SIS_661)) { SiS_Pr->SiS_LCDTypeInfo = temp >> 4; } else { SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1; } temp &= 0x0f; #ifdef SIS300 if(SiS_Pr->ChipType < SIS_315H) { /* Very old BIOSes only know 7 sizes (NetVista 2179, 1.01g) */ if(SiS_Pr->SiS_VBType & VB_SIS301) { if(temp < 0x0f) temp &= 0x07; } /* Translate 300 series LCDRes to 315 series for unified usage */ temp = SiS300SeriesLCDRes[temp]; } #endif /* Translate to our internal types */ #ifdef SIS315H if(SiS_Pr->ChipType == SIS_550) { if (temp == Panel310_1152x768) temp = Panel_320x240_2; /* Verified working */ else if(temp == Panel310_320x240_2) temp = Panel_320x240_2; else if(temp == Panel310_320x240_3) temp = Panel_320x240_3; } else if(SiS_Pr->ChipType >= SIS_661) { if(temp == Panel661_1280x854) temp = Panel_1280x854; } #endif if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* SiS LVDS */ if(temp == Panel310_1280x768) { temp = Panel_1280x768_2; } if(SiS_Pr->SiS_ROMNew) { if(temp == Panel661_1280x800) { temp = Panel_1280x800_2; } } } SiS_Pr->SiS_LCDResInfo = temp; #ifdef SIS300 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { SiS_Pr->SiS_LCDResInfo = Panel_Barco1366; } else if(SiS_Pr->SiS_CustomT == CUT_PANEL848) { SiS_Pr->SiS_LCDResInfo = Panel_848x480; } else if(SiS_Pr->SiS_CustomT == CUT_PANEL856) { SiS_Pr->SiS_LCDResInfo = Panel_856x480; } } #endif if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMin301) SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMin301; } else { if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMinLVDS) SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMinLVDS; } temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); SiS_Pr->SiS_LCDInfo = temp & ~0x000e; /* Need temp below! */ /* These must/can't scale no matter what */ switch(SiS_Pr->SiS_LCDResInfo) { case Panel_320x240_1: case Panel_320x240_2: case Panel_320x240_3: case Panel_1280x960: SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; break; case Panel_640x480: SiS_Pr->SiS_LCDInfo |= DontExpandLCD; } panelcanscale = (SiS_Pr->SiS_LCDInfo & DontExpandLCD) ? TRUE : FALSE; if(!SiS_Pr->UsePanelScaler) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD; /* Dual link, Pass 1:1 BIOS default, etc. */ #ifdef SIS315H if(SiS_Pr->ChipType >= SIS_661) { if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11; } if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { if(SiS_Pr->SiS_ROMNew) { if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; } else if((myptr = GetLCDStructPtr661(SiS_Pr))) { if(myptr[2] & 0x01) SiS_Pr->SiS_LCDInfo |= LCDDualLink; } } } else if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x01) SiS_Pr->SiS_LCDInfo |= LCDPass11; } if((SiS_Pr->SiS_ROMNew) && (!(SiS_Pr->PanelSelfDetected))) { SiS_Pr->SiS_LCDInfo &= ~(LCDRGB18Bit); temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); if(temp & 0x01) SiS_Pr->SiS_LCDInfo |= LCDRGB18Bit; if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; } } else if(!(SiS_Pr->SiS_ROMNew)) { if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { if((SiS_Pr->SiS_CustomT == CUT_CLEVO1024) && (SiS_Pr->SiS_LCDResInfo == Panel_1024x768)) { SiS_Pr->SiS_LCDInfo |= LCDDualLink; } if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) || (SiS_Pr->SiS_LCDResInfo == Panel_1680x1050)) { SiS_Pr->SiS_LCDInfo |= LCDDualLink; } } } } #endif /* Pass 1:1 */ if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { /* Always center screen on LVDS (if scaling is disabled) */ SiS_Pr->SiS_LCDInfo &= ~LCDPass11; } else if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* Always center screen on SiS LVDS (if scaling is disabled) */ SiS_Pr->SiS_LCDInfo &= ~LCDPass11; } else { /* By default, pass 1:1 on SiS TMDS (if scaling is supported) */ if(panelcanscale) SiS_Pr->SiS_LCDInfo |= LCDPass11; if(SiS_Pr->CenterScreen == 1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11; } } SiS_Pr->PanelVCLKIdx300 = VCLK65_300; SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; switch(SiS_Pr->SiS_LCDResInfo) { case Panel_320x240_1: case Panel_320x240_2: case Panel_320x240_3: SiS_Pr->PanelXRes = 640; SiS_Pr->PanelYRes = 480; SiS_Pr->PanelVRS = 24; SiS_Pr->PanelVRE = 3; SiS_Pr->PanelVCLKIdx300 = VCLK28; SiS_Pr->PanelVCLKIdx315 = VCLK28; break; case Panel_640x480: SiS_Pr->PanelXRes = 640; SiS_Pr->PanelYRes = 480; SiS_Pr->PanelVRE = 3; SiS_Pr->PanelVCLKIdx300 = VCLK28; SiS_Pr->PanelVCLKIdx315 = VCLK28; break; case Panel_800x600: SiS_Pr->PanelXRes = 800; SiS_Pr->PanelYRes = 600; SiS_Pr->PanelHT = 1056; SiS_Pr->PanelVT = 628; SiS_Pr->PanelHRS = 40; SiS_Pr->PanelHRE = 128; SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 4; SiS_Pr->PanelVCLKIdx300 = VCLK40; SiS_Pr->PanelVCLKIdx315 = VCLK40; break; case Panel_1024x600: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 600; SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 800; SiS_Pr->PanelHRS = 24; SiS_Pr->PanelHRE = 136; SiS_Pr->PanelVRS = 2 /* 88 */ ; SiS_Pr->PanelVRE = 6; SiS_Pr->PanelVCLKIdx300 = VCLK65_300; SiS_Pr->PanelVCLKIdx315 = VCLK65_315; break; case Panel_1024x768: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 768; SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; SiS_Pr->PanelHRS = 24; SiS_Pr->PanelHRE = 136; SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; if(SiS_Pr->ChipType < SIS_315H) { SiS_Pr->PanelHRS = 23; SiS_Pr->PanelVRE = 5; } SiS_Pr->PanelVCLKIdx300 = VCLK65_300; SiS_Pr->PanelVCLKIdx315 = VCLK65_315; SiS_GetLCDInfoBIOS(SiS_Pr); break; case Panel_1152x768: SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes = 768; SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; SiS_Pr->PanelHRS = 24; SiS_Pr->PanelHRE = 136; SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; if(SiS_Pr->ChipType < SIS_315H) { SiS_Pr->PanelHRS = 23; SiS_Pr->PanelVRE = 5; } SiS_Pr->PanelVCLKIdx300 = VCLK65_300; SiS_Pr->PanelVCLKIdx315 = VCLK65_315; break; case Panel_1152x864: SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes = 864; break; case Panel_1280x720: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 720; SiS_Pr->PanelHT = 1650; SiS_Pr->PanelVT = 750; SiS_Pr->PanelHRS = 110; SiS_Pr->PanelHRE = 40; SiS_Pr->PanelVRS = 5; SiS_Pr->PanelVRE = 5; SiS_Pr->PanelVCLKIdx315 = VCLK_1280x720; /* Data above for TMDS (projector); get from BIOS for LVDS */ SiS_GetLCDInfoBIOS(SiS_Pr); break; case Panel_1280x768: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768; if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { SiS_Pr->PanelHT = 1408; SiS_Pr->PanelVT = 806; SiS_Pr->PanelVCLKIdx300 = VCLK81_300; /* ? */ SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */ } else { SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 802; SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRS = 112; SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; SiS_Pr->PanelVCLKIdx300 = VCLK81_300; SiS_Pr->PanelVCLKIdx315 = VCLK81_315; } break; case Panel_1280x768_2: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768; SiS_Pr->PanelHT = 1660; SiS_Pr->PanelVT = 806; SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; SiS_Pr->PanelVCLKIdx315 = VCLK_1280x768_2; SiS_GetLCDInfoBIOS(SiS_Pr); break; case Panel_1280x800: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 800; SiS_Pr->PanelHT = 1408; SiS_Pr->PanelVT = 816; SiS_Pr->PanelHRS = 21; SiS_Pr->PanelHRE = 24; SiS_Pr->PanelVRS = 4; SiS_Pr->PanelVRE = 3; SiS_Pr->PanelVCLKIdx315 = VCLK_1280x800_315; SiS_GetLCDInfoBIOS(SiS_Pr); break; case Panel_1280x800_2: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 800; SiS_Pr->PanelHT = 1552; SiS_Pr->PanelVT = 812; SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; SiS_Pr->PanelVRS = 4; SiS_Pr->PanelVRE = 3; SiS_Pr->PanelVCLKIdx315 = VCLK_1280x800_315_2; SiS_GetLCDInfoBIOS(SiS_Pr); break; case Panel_1280x854: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 854; SiS_Pr->PanelHT = 1664; SiS_Pr->PanelVT = 861; SiS_Pr->PanelHRS = 16; SiS_Pr->PanelHRE = 112; SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; SiS_Pr->PanelVCLKIdx315 = VCLK_1280x854; SiS_GetLCDInfoBIOS(SiS_Pr); break; case Panel_1280x960: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 960; SiS_Pr->PanelHT = 1800; SiS_Pr->PanelVT = 1000; SiS_Pr->PanelVCLKIdx300 = VCLK108_3_300; SiS_Pr->PanelVCLKIdx315 = VCLK108_3_315; if(resinfo == SIS_RI_1280x1024) { SiS_Pr->PanelVCLKIdx300 = VCLK100_300; SiS_Pr->PanelVCLKIdx315 = VCLK100_315; } break; case Panel_1280x1024: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 1024; SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; SiS_Pr->PanelVCLKIdx300 = VCLK108_3_300; SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; SiS_GetLCDInfoBIOS(SiS_Pr); break; case Panel_1400x1050: SiS_Pr->PanelXRes = 1400; SiS_Pr->PanelYRes = 1050; SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; SiS_GetLCDInfoBIOS(SiS_Pr); break; case Panel_1600x1200: SiS_Pr->PanelXRes = 1600; SiS_Pr->PanelYRes = 1200; SiS_Pr->PanelHT = 2160; SiS_Pr->PanelVT = 1250; SiS_Pr->PanelHRS = 64; SiS_Pr->PanelHRE = 192; SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; SiS_Pr->PanelVCLKIdx315 = VCLK162_315; if(SiS_Pr->SiS_VBType & VB_SISTMDSLCDA) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { SiS_Pr->PanelHT = 1760; SiS_Pr->PanelVT = 1235; SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 32; SiS_Pr->PanelVRS = 2; SiS_Pr->PanelVRE = 4; SiS_Pr->PanelVCLKIdx315 = VCLK130_315; SiS_Pr->Alternate1600x1200 = TRUE; } } else if(SiS_Pr->SiS_IF_DEF_LVDS) { SiS_Pr->PanelHT = 2048; SiS_Pr->PanelVT = 1320; SiS_Pr->PanelHRS = SiS_Pr->PanelHRE = 999; SiS_Pr->PanelVRS = SiS_Pr->PanelVRE = 999; } SiS_GetLCDInfoBIOS(SiS_Pr); break; case Panel_1680x1050: SiS_Pr->PanelXRes = 1680; SiS_Pr->PanelYRes = 1050; SiS_Pr->PanelHT = 1900; SiS_Pr->PanelVT = 1066; SiS_Pr->PanelHRS = 26; SiS_Pr->PanelHRE = 76; SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; SiS_Pr->PanelVCLKIdx315 = VCLK121_315; SiS_GetLCDInfoBIOS(SiS_Pr); break; case Panel_Barco1366: SiS_Pr->PanelXRes = 1360; SiS_Pr->PanelYRes = 1024; SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; break; case Panel_848x480: SiS_Pr->PanelXRes = 848; SiS_Pr->PanelYRes = 480; SiS_Pr->PanelHT = 1088; SiS_Pr->PanelVT = 525; break; case Panel_856x480: SiS_Pr->PanelXRes = 856; SiS_Pr->PanelYRes = 480; SiS_Pr->PanelHT = 1088; SiS_Pr->PanelVT = 525; break; case Panel_Custom: SiS_Pr->PanelXRes = SiS_Pr->CP_MaxX; SiS_Pr->PanelYRes = SiS_Pr->CP_MaxY; SiS_Pr->PanelHT = SiS_Pr->CHTotal; SiS_Pr->PanelVT = SiS_Pr->CVTotal; if(SiS_Pr->CP_PreferredIndex != -1) { SiS_Pr->PanelXRes = SiS_Pr->CP_HDisplay[SiS_Pr->CP_PreferredIndex]; SiS_Pr->PanelYRes = SiS_Pr->CP_VDisplay[SiS_Pr->CP_PreferredIndex]; SiS_Pr->PanelHT = SiS_Pr->CP_HTotal[SiS_Pr->CP_PreferredIndex]; SiS_Pr->PanelVT = SiS_Pr->CP_VTotal[SiS_Pr->CP_PreferredIndex]; SiS_Pr->PanelHRS = SiS_Pr->CP_HSyncStart[SiS_Pr->CP_PreferredIndex]; SiS_Pr->PanelHRE = SiS_Pr->CP_HSyncEnd[SiS_Pr->CP_PreferredIndex]; SiS_Pr->PanelVRS = SiS_Pr->CP_VSyncStart[SiS_Pr->CP_PreferredIndex]; SiS_Pr->PanelVRE = SiS_Pr->CP_VSyncEnd[SiS_Pr->CP_PreferredIndex]; SiS_Pr->PanelHRS -= SiS_Pr->PanelXRes; SiS_Pr->PanelHRE -= SiS_Pr->PanelHRS; SiS_Pr->PanelVRS -= SiS_Pr->PanelYRes; SiS_Pr->PanelVRE -= SiS_Pr->PanelVRS; if(SiS_Pr->CP_PrefClock) { int idx; SiS_Pr->PanelVCLKIdx315 = VCLK_CUSTOM_315; SiS_Pr->PanelVCLKIdx300 = VCLK_CUSTOM_300; if(SiS_Pr->ChipType < SIS_315H) idx = VCLK_CUSTOM_300; else idx = VCLK_CUSTOM_315; SiS_Pr->SiS_VCLKData[idx].CLOCK = SiS_Pr->SiS_VBVCLKData[idx].CLOCK = SiS_Pr->CP_PrefClock; SiS_Pr->SiS_VCLKData[idx].SR2B = SiS_Pr->SiS_VBVCLKData[idx].Part4_A = SiS_Pr->CP_PrefSR2B; SiS_Pr->SiS_VCLKData[idx].SR2C = SiS_Pr->SiS_VBVCLKData[idx].Part4_B = SiS_Pr->CP_PrefSR2C; } } break; default: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 768; SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; break; } /* Special cases */ if( (SiS_Pr->SiS_IF_DEF_FSTN) || (SiS_Pr->SiS_IF_DEF_DSTN) || (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || (SiS_Pr->SiS_CustomT == CUT_PANEL848) || (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) { SiS_Pr->PanelHRS = 999; SiS_Pr->PanelHRE = 999; } if( (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || (SiS_Pr->SiS_CustomT == CUT_PANEL848) || (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) { SiS_Pr->PanelVRS = 999; SiS_Pr->PanelVRE = 999; } /* DontExpand overrule */ if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (modeflag & NoSupportLCDScale)) { /* No scaling for this mode on any panel (LCD=CRT2)*/ SiS_Pr->SiS_LCDInfo |= DontExpandLCD; } switch(SiS_Pr->SiS_LCDResInfo) { case Panel_Custom: case Panel_1152x864: case Panel_1280x768: /* TMDS only */ SiS_Pr->SiS_LCDInfo |= DontExpandLCD; break; case Panel_800x600: { static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, 0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); break; } case Panel_1024x768: { static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600, 0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); break; } case Panel_1280x720: { static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600, 0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); if(SiS_Pr->PanelHT == 1650) { SiS_Pr->SiS_LCDInfo |= DontExpandLCD; } break; } case Panel_1280x768_2: { /* LVDS only */ static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600, SIS_RI_1152x768,0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); switch(resinfo) { case SIS_RI_1280x720: if(SiS_Pr->UsePanelScaler == -1) { SiS_Pr->SiS_LCDInfo |= DontExpandLCD; } break; } break; } case Panel_1280x800: { /* SiS TMDS special (Averatec 6200 series) */ static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600, SIS_RI_1152x768,SIS_RI_1280x720,SIS_RI_1280x768,0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); break; } case Panel_1280x800_2: { /* SiS LVDS */ static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600, SIS_RI_1152x768,0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); switch(resinfo) { case SIS_RI_1280x720: case SIS_RI_1280x768: if(SiS_Pr->UsePanelScaler == -1) { SiS_Pr->SiS_LCDInfo |= DontExpandLCD; } break; } break; } case Panel_1280x854: { /* SiS LVDS */ static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600, SIS_RI_1152x768,0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); switch(resinfo) { case SIS_RI_1280x720: case SIS_RI_1280x768: case SIS_RI_1280x800: if(SiS_Pr->UsePanelScaler == -1) { SiS_Pr->SiS_LCDInfo |= DontExpandLCD; } break; } break; } case Panel_1280x960: { static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600, SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x720,SIS_RI_1280x768,SIS_RI_1280x800, SIS_RI_1280x854,0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); break; } case Panel_1280x1024: { static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600, SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x720,SIS_RI_1280x768,SIS_RI_1280x800, SIS_RI_1280x854,SIS_RI_1280x960,0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); break; } case Panel_1400x1050: { static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600, SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x768,SIS_RI_1280x800,SIS_RI_1280x854, SIS_RI_1280x960,0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); switch(resinfo) { case SIS_RI_1280x720: if(SiS_Pr->UsePanelScaler == -1) { SiS_Pr->SiS_LCDInfo |= DontExpandLCD; } break; case SIS_RI_1280x1024: SiS_Pr->SiS_LCDInfo |= DontExpandLCD; break; } break; } case Panel_1600x1200: { static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600, SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x720,SIS_RI_1280x768,SIS_RI_1280x800, SIS_RI_1280x854,SIS_RI_1280x960,SIS_RI_1360x768,SIS_RI_1360x1024,0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); break; } case Panel_1680x1050: { static const unsigned char nonscalingmodes[] = { SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600, SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x854,SIS_RI_1280x960,SIS_RI_1360x768, SIS_RI_1360x1024,0xff }; SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); break; } } } #ifdef SIS300 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20; /* neg h/v sync, RGB24(D0 = 0) */ } } if(SiS_Pr->ChipType < SIS_315H) { if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { if(SiS_Pr->SiS_UseROM) { if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { if(!(ROMAddr[0x235] & 0x02)) { SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD); } } } } else if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { if((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10))) { SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD); } } } #endif /* Special cases */ if(modexres == SiS_Pr->PanelXRes && modeyres == SiS_Pr->PanelYRes) { SiS_Pr->SiS_LCDInfo &= ~LCDPass11; } if(SiS_Pr->SiS_IF_DEF_TRUMPION) { SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); } switch(SiS_Pr->SiS_LCDResInfo) { case Panel_640x480: SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); break; case Panel_1280x800: /* Don't pass 1:1 by default (TMDS special) */ if(SiS_Pr->CenterScreen == -1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11; break; case Panel_1280x960: SiS_Pr->SiS_LCDInfo &= ~LCDPass11; break; case Panel_Custom: if((!SiS_Pr->CP_PrefClock) || (modexres > SiS_Pr->PanelXRes) || (modeyres > SiS_Pr->PanelYRes)) { SiS_Pr->SiS_LCDInfo |= LCDPass11; } break; } if((SiS_Pr->UseCustomMode) || (SiS_Pr->SiS_CustomT == CUT_UNKNOWNLCD)) { SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); } /* (In)validate LCDPass11 flag */ if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { SiS_Pr->SiS_LCDInfo &= ~LCDPass11; } /* LVDS DDA */ if(!((SiS_Pr->ChipType < SIS_315H) && (SiS_Pr->SiS_SetFlag & SetDOSMode))) { if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) { if(ModeNo == 0x12) { if(SiS_Pr->SiS_LCDInfo & LCDPass11) { SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; } } else if(ModeNo > 0x13) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x600) { if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { if((resinfo == SIS_RI_800x600) || (resinfo == SIS_RI_400x300)) { SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; } } } } } } if(modeflag & HalfDCLK) { if(SiS_Pr->SiS_IF_DEF_TRUMPION == 1) { SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; } else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; } else if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) { SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; } else if(ModeNo > 0x13) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if(resinfo == SIS_RI_512x384) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; } else if(SiS_Pr->SiS_LCDResInfo == Panel_800x600) { if(resinfo == SIS_RI_400x300) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; } } } } /* VESA timing */ if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { if(SiS_Pr->SiS_VBInfo & SetNotSimuMode) { SiS_Pr->SiS_SetFlag |= LCDVESATiming; } } else { SiS_Pr->SiS_SetFlag |= LCDVESATiming; } #ifdef SIS_LINUX_KERNEL #if 0 printk(KERN_DEBUG "sisfb: (LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x)\n", SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo); #endif #endif #ifdef SIS_XORG_XF86 xf86DrvMsgVerb(0, X_PROBED, 4, "(init301: LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x SetFlag=0x%04x)\n", SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo, SiS_Pr->SiS_SetFlag); #endif } /*********************************************/ /* GET VCLK */ /*********************************************/ unsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short CRT2Index, VCLKIndex = 0, VCLKIndexGEN = 0, VCLKIndexGENCRT = 0; unsigned short modeflag, resinfo, tempbx; const unsigned char *CHTVVCLKPtr = NULL; if(ModeNo <= 0x13) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; VCLKIndexGEN = (SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)) >> 2) & 0x03; VCLKIndexGENCRT = VCLKIndexGEN; } else { modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; CRT2Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; VCLKIndexGEN = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; VCLKIndexGENCRT = SiS_GetRefCRTVCLK(SiS_Pr, RefreshRateTableIndex, (SiS_Pr->SiS_SetFlag & ProgrammingCRT2) ? SiS_Pr->SiS_UseWideCRT2 : SiS_Pr->SiS_UseWide); } if(SiS_Pr->SiS_VBType & VB_SISVB) { /* 30x/B/LV */ if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { CRT2Index >>= 6; if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { /* LCD */ if(SiS_Pr->ChipType < SIS_315H) { VCLKIndex = SiS_Pr->PanelVCLKIdx300; if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) { VCLKIndex = VCLKIndexGEN; } } else { VCLKIndex = SiS_Pr->PanelVCLKIdx315; if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) { switch(resinfo) { /* Correct those whose IndexGEN doesn't match VBVCLK array */ case SIS_RI_720x480: VCLKIndex = VCLK_720x480; break; case SIS_RI_720x576: VCLKIndex = VCLK_720x576; break; case SIS_RI_768x576: VCLKIndex = VCLK_768x576; break; case SIS_RI_848x480: VCLKIndex = VCLK_848x480; break; case SIS_RI_856x480: VCLKIndex = VCLK_856x480; break; case SIS_RI_800x480: VCLKIndex = VCLK_800x480; break; case SIS_RI_1024x576: VCLKIndex = VCLK_1024x576; break; case SIS_RI_1152x864: VCLKIndex = VCLK_1152x864; break; case SIS_RI_1280x720: VCLKIndex = VCLK_1280x720; break; case SIS_RI_1360x768: VCLKIndex = VCLK_1360x768; break; default: VCLKIndex = VCLKIndexGEN; } if(ModeNo <= 0x13) { if(SiS_Pr->ChipType <= SIS_315PRO) { if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x42; } else { if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x00; } } if(SiS_Pr->ChipType <= SIS_315PRO) { if(VCLKIndex == 0) VCLKIndex = 0x41; if(VCLKIndex == 1) VCLKIndex = 0x43; if(VCLKIndex == 4) VCLKIndex = 0x44; } } } } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* TV */ if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) VCLKIndex = HiTVVCLKDIV2; else VCLKIndex = HiTVVCLK; if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) VCLKIndex = HiTVSimuVCLK; } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) VCLKIndex = YPbPr750pVCLK; else if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr625p | TVRPLLDIV2XO)) VCLKIndex = TVVCLKDIV2; else VCLKIndex = TVVCLK; if(SiS_Pr->ChipType < SIS_315H) VCLKIndex += TVCLKBASE_300; else VCLKIndex += TVCLKBASE_315; } else { /* VGA2 */ VCLKIndex = VCLKIndexGENCRT; if(SiS_Pr->ChipType < SIS_315H) { if(ModeNo > 0x13) { if( (SiS_Pr->ChipType == SIS_630) && (SiS_Pr->ChipRevision >= 0x30)) { if(VCLKIndex == 0x14) VCLKIndex = 0x34; } /* Better VGA2 clock for 1280x1024@75 */ if(VCLKIndex == 0x17) VCLKIndex = 0x45; } } } } else { /* If not programming CRT2 */ VCLKIndex = VCLKIndexGENCRT; if(SiS_Pr->ChipType < SIS_315H) { if(ModeNo > 0x13) { if( (SiS_Pr->ChipType != SIS_630) && (SiS_Pr->ChipType != SIS_300) ) { if(VCLKIndex == 0x1b) VCLKIndex = 0x48; } } } } } else { /* LVDS */ VCLKIndex = CRT2Index; if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { if( (SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) ) { VCLKIndex &= 0x1f; tempbx = 0; if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; if(SiS_Pr->SiS_TVMode & TVSetPAL) { tempbx += 2; if(SiS_Pr->SiS_ModeType > ModeVGA) { if(SiS_Pr->SiS_CHSOverScan) tempbx = 8; } if(SiS_Pr->SiS_TVMode & TVSetPALM) { tempbx = 4; if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; } else if(SiS_Pr->SiS_TVMode & TVSetPALN) { tempbx = 6; if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; } } switch(tempbx) { case 0: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUNTSC; break; case 1: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKONTSC; break; case 2: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPAL; break; case 3: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL; break; case 4: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALM; break; case 5: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALM; break; case 6: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALN; break; case 7: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALN; break; case 8: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKSOPAL; break; default: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL; break; } VCLKIndex = CHTVVCLKPtr[VCLKIndex]; } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { if(SiS_Pr->ChipType < SIS_315H) { VCLKIndex = SiS_Pr->PanelVCLKIdx300; } else { VCLKIndex = SiS_Pr->PanelVCLKIdx315; } #ifdef SIS300 /* Special Timing: Barco iQ Pro R series */ if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) VCLKIndex = 0x44; /* Special Timing: 848x480 and 856x480 parallel lvds panels */ if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { if(SiS_Pr->ChipType < SIS_315H) { VCLKIndex = VCLK34_300; /* if(resinfo == SIS_RI_1360x768) VCLKIndex = ?; */ } else { VCLKIndex = VCLK34_315; /* if(resinfo == SIS_RI_1360x768) VCLKIndex = ?; */ } } #endif } else { VCLKIndex = VCLKIndexGENCRT; if(SiS_Pr->ChipType < SIS_315H) { if(ModeNo > 0x13) { if( (SiS_Pr->ChipType == SIS_630) && (SiS_Pr->ChipRevision >= 0x30) ) { if(VCLKIndex == 0x14) VCLKIndex = 0x2e; } } } } } else { /* if not programming CRT2 */ VCLKIndex = VCLKIndexGENCRT; if(SiS_Pr->ChipType < SIS_315H) { if(ModeNo > 0x13) { if( (SiS_Pr->ChipType != SIS_630) && (SiS_Pr->ChipType != SIS_300) ) { if(VCLKIndex == 0x1b) VCLKIndex = 0x48; } #if 0 if(SiS_Pr->ChipType == SIS_730) { if(VCLKIndex == 0x0b) VCLKIndex = 0x40; /* 1024x768-70 */ if(VCLKIndex == 0x0d) VCLKIndex = 0x41; /* 1024x768-75 */ } #endif } } } } #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "VCLKIndex %d (0x%x)\n", VCLKIndex, VCLKIndex); #endif #endif return VCLKIndex; } /*********************************************/ /* SET CRT2 MODE TYPE REGISTERS */ /*********************************************/ static void SiS_SetCRT2ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned short i, j, modeflag, tempah=0; short tempcl; #if defined(SIS300) || defined(SIS315H) unsigned short tempbl; #endif #ifdef SIS315H unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short tempah2, tempbl2; #endif modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xAF,0x40); SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2E,0xF7); } else { for(i=0,j=4; i<3; i++,j++) SiS_SetReg(SiS_Pr->SiS_Part1Port,j,0); if(SiS_Pr->ChipType >= SIS_315H) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0x7F); } tempcl = SiS_Pr->SiS_ModeType; if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 /* ---- 300 series ---- */ /* For 301BDH: (with LCD via LVDS) */ if(SiS_Pr->SiS_VBType & VB_NoLCD) { tempbl = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32); tempbl &= 0xef; tempbl |= 0x02; if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) || (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { tempbl |= 0x10; tempbl &= 0xfd; } SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,tempbl); } if(ModeNo > 0x13) { tempcl -= ModeVGA; if(tempcl >= 0) { tempah = ((0x10 >> tempcl) | 0x80); } } else tempah = 0x80; if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0xA0; #endif /* SIS300 */ } else { #ifdef SIS315H /* ------- 315/330 series ------ */ if(ModeNo > 0x13) { tempcl -= ModeVGA; if(tempcl >= 0) { tempah = (0x08 >> tempcl); if (tempah == 0) tempah = 1; tempah |= 0x40; } } else tempah = 0x40; if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0x50; #endif /* SIS315H */ } if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; if(SiS_Pr->ChipType < SIS_315H) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); } else { #ifdef SIS315H if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); } else if(SiS_Pr->SiS_VBType & VB_SISVB) { if(IS_SIS740) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); } else { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); } } #endif } if(SiS_Pr->SiS_VBType & VB_SISVB) { tempah = 0x01; if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { tempah |= 0x02; } if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { tempah ^= 0x05; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { tempah ^= 0x01; } } if(SiS_Pr->ChipType < SIS_315H) { if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; tempah = (tempah << 5) & 0xFF; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); tempah = (tempah >> 5) & 0xFF; } else { if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x08; else if(!(SiS_IsDualEdge(SiS_Pr))) tempah |= 0x08; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2E,0xF0,tempah); tempah &= ~0x08; } if((SiS_Pr->SiS_ModeType == ModeVGA) && (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))) { tempah |= 0x10; } tempah |= 0x80; if(SiS_Pr->SiS_VBType & VB_SIS301) { if(SiS_Pr->PanelXRes < 1280 && SiS_Pr->PanelYRes < 960) tempah &= ~0x80; } if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { if(!(SiS_Pr->SiS_TVMode & TVSetYPbPrProg)) { if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { tempah |= 0x20; } } } SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0D,0x40,tempah); tempah = 0x80; if(SiS_Pr->SiS_VBType & VB_SIS301) { if(SiS_Pr->PanelXRes < 1280 && SiS_Pr->PanelYRes < 960) tempah = 0; } if(SiS_IsDualLink(SiS_Pr)) tempah |= 0x40; if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) { tempah |= 0x40; } } SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0C,tempah); } else { /* LVDS */ if(SiS_Pr->ChipType >= SIS_315H) { #ifdef SIS315H /* LVDS can only be slave in 8bpp modes */ tempah = 0x80; if((modeflag & CRT2Mode) && (SiS_Pr->SiS_ModeType > ModeVGA)) { if(SiS_Pr->SiS_VBInfo & DriverMode) { tempah |= 0x02; } } if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) tempah |= 0x02; if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempah ^= 0x01; if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 1; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2e,0xF0,tempah); #endif } else { #ifdef SIS300 tempah = 0; if( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) && (SiS_Pr->SiS_ModeType > ModeVGA) ) { tempah |= 0x02; } tempah <<= 5; if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); #endif } } } /* LCDA */ if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->ChipType >= SIS_315H) { #ifdef SIS315H /* unsigned char bridgerev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01); */ /* The following is nearly unpreditable and varies from machine * to machine. Especially the 301DH seems to be a real trouble * maker. Some BIOSes simply set the registers (like in the * NoLCD-if-statements here), some set them according to the * LCDA stuff. It is very likely that some machines are not * treated correctly in the following, very case-orientated * code. What do I do then...? */ /* 740 variants match for 30xB, 301B-DH, 30xLV */ if(!(IS_SIS740)) { tempah = 0x04; /* For all bridges */ tempbl = 0xfb; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { tempah = 0x00; if(SiS_IsDualEdge(SiS_Pr)) { tempbl = 0xff; } } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); } /* The following two are responsible for eventually wrong colors * in TV output. The DH (VB_NoLCD) conditions are unknown; the * b0 was found in some 651 machine (Pim; P4_23=0xe5); the b1 version * in a 650 box (Jake). What is the criteria? * Addendum: Another combination 651+301B-DH(b1) (Rapo) needs same * treatment like the 651+301B-DH(b0) case. Seems more to be the * chipset than the bridge revision. */ if((IS_SIS740) || (SiS_Pr->ChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { tempah = 0x30; tempbl = 0xc0; if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) || ((SiS_Pr->SiS_ROMNew) && (!(ROMAddr[0x5b] & 0x04)))) { tempah = 0x00; tempbl = 0x00; } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,0xcf,tempah); SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0x3f,tempbl); } else if(SiS_Pr->SiS_VBType & VB_SIS301) { /* Fixes "TV-blue-bug" on 315+301 */ SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2c,0xcf); /* For 301 */ SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); } else if(SiS_Pr->SiS_VBType & VB_SISLVDS) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); /* For 30xLV */ SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x21,0xc0); } else if(SiS_Pr->SiS_VBType & VB_NoLCD) { /* For 301B-DH */ tempah = 0x30; tempah2 = 0xc0; tempbl = 0xcf; tempbl2 = 0x3f; if(SiS_Pr->SiS_TVBlue == 0) { tempah = tempah2 = 0x00; } else if(SiS_Pr->SiS_TVBlue == -1) { /* Set on 651/M650, clear on 315/650 */ if(!(IS_SIS65x)) /* (bridgerev != 0xb0) */ { tempah = tempah2 = 0x00; } } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah); SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2); } else { tempah = 0x30; tempah2 = 0xc0; /* For 30xB, 301C */ tempbl = 0xcf; tempbl2 = 0x3f; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { tempah = tempah2 = 0x00; if(SiS_IsDualEdge(SiS_Pr)) { tempbl = tempbl2 = 0xff; } } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah); SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2); } if(IS_SIS740) { tempah = 0x80; if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x00; SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,0x7f,tempah); } else { tempah = 0x00; tempbl = 0x7f; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { tempbl = 0xff; if(!(SiS_IsDualEdge(SiS_Pr))) tempah = 0x80; } SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah); } #endif /* SIS315H */ } else if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { #ifdef SIS300 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) || ((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD))) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x23,0x7F); } else { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x23,0x80); } #endif } if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x0D,0x80); if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3A,0xC0); } } } else { /* LVDS */ #ifdef SIS315H if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { tempah = 0x04; tempbl = 0xfb; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { tempah = 0x00; if(SiS_IsDualEdge(SiS_Pr)) tempbl = 0xff; } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); } SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); } else if(SiS_Pr->ChipType == SIS_550) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); } } #endif } } /*********************************************/ /* GET RESOLUTION DATA */ /*********************************************/ unsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { if(ModeNo <= 0x13) return ((unsigned short)SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo); else return ((unsigned short)SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO); } static void SiS_GetCRT2ResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned short xres, yres, modeflag=0, resindex; if(SiS_Pr->UseCustomMode) { xres = SiS_Pr->CHDisplay; if(SiS_Pr->CModeFlag & HalfDCLK) xres <<= 1; SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres; /* DoubleScanMode-check done in CheckCalcCustomMode()! */ SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = SiS_Pr->CVDisplay; return; } resindex = SiS_GetResInfo(SiS_Pr,ModeNo,ModeIdIndex); if(ModeNo <= 0x13) { xres = SiS_Pr->SiS_StResInfo[resindex].HTotal; yres = SiS_Pr->SiS_StResInfo[resindex].VTotal; } else { xres = SiS_Pr->SiS_ModeResInfo[resindex].HTotal; yres = SiS_Pr->SiS_ModeResInfo[resindex].VTotal; modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; } if(!SiS_Pr->SiS_IF_DEF_DSTN && !SiS_Pr->SiS_IF_DEF_FSTN) { if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_IF_DEF_LVDS == 1)) { if((ModeNo != 0x03) && (SiS_Pr->SiS_SetFlag & SetDOSMode)) { if(yres == 350) yres = 400; } if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x3a) & 0x01) { if(ModeNo == 0x12) yres = 400; } } if(modeflag & HalfDCLK) xres <<= 1; if(modeflag & DoubleScanMode) yres <<= 1; } if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { switch(SiS_Pr->SiS_LCDResInfo) { case Panel_1024x768: if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { if(yres == 350) yres = 357; if(yres == 400) yres = 420; if(yres == 480) yres = 525; } } break; case Panel_1280x1024: if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { /* BIOS bug - does this regardless of scaling */ if(yres == 400) yres = 405; } if(yres == 350) yres = 360; if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { if(yres == 360) yres = 375; } break; case Panel_1600x1200: if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { if(yres == 1024) yres = 1056; } break; } } } else { if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToHiVision)) { if(xres == 720) xres = 640; } } else if(xres == 720) xres = 640; if(SiS_Pr->SiS_SetFlag & SetDOSMode) { yres = 400; if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480; } else { if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480; } if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) yres = 480; } } SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres; SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = yres; } /*********************************************/ /* GET CRT2 TIMING DATA */ /*********************************************/ static void SiS_GetCRT2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, unsigned short *CRT2Index, unsigned short *ResIndex) { unsigned short tempbx=0, tempal=0, resinfo=0; if(ModeNo <= 0x13) { tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; } else { tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; } if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_IF_DEF_LVDS == 0)) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { /* LCD */ tempbx = SiS_Pr->SiS_LCDResInfo; if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 32; /* patch index */ if(SiS_Pr->SiS_LCDResInfo == Panel_1680x1050) { if (resinfo == SIS_RI_1280x800) tempal = 9; else if(resinfo == SIS_RI_1400x1050) tempal = 11; } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x800) || (SiS_Pr->SiS_LCDResInfo == Panel_1280x800_2) || (SiS_Pr->SiS_LCDResInfo == Panel_1280x854)) { if (resinfo == SIS_RI_1280x768) tempal = 9; } if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { /* Pass 1:1 only (center-screen handled outside) */ /* This is never called for the panel's native resolution */ /* since Pass1:1 will not be set in this case */ tempbx = 100; if(ModeNo >= 0x13) { tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC_NS; } } #ifdef SIS315H if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { tempbx = 200; if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx++; } } } #endif } else { /* TV */ if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { /* if(SiS_Pr->SiS_VGAVDE > 480) SiS_Pr->SiS_TVMode &= (~TVSetTVSimuMode); */ tempbx = 2; if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { tempbx = 13; if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) tempbx = 14; } } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempbx = 7; else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tempbx = 6; else if(SiS_Pr->SiS_TVMode & TVSetYPbPr625i) tempbx = 15; else if(SiS_Pr->SiS_TVMode & TVSetYPbPr625p) tempbx = 16; else tempbx = 5; if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) tempbx += 5; } else { if(SiS_Pr->SiS_TVMode & TVSetPAL) tempbx = 3; else tempbx = 4; if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) tempbx += 5; } } tempal &= 0x3F; if(ModeNo > 0x13) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) { switch(resinfo) { case SIS_RI_720x480: tempal = 9; if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempal = 6; break; case SIS_RI_720x576: case SIS_RI_768x576: case SIS_RI_1024x576: tempal = 6; if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { tempal = 8; if(resinfo == SIS_RI_1024x576) tempal = 10; } break; case SIS_RI_800x480: tempal = 4; if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempal = 9; break; case SIS_RI_512x384: case SIS_RI_1024x768: tempal = 7; if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr625p)) { tempal = 8; } break; case SIS_RI_1280x720: if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempal = 11; break; } } } *CRT2Index = tempbx; *ResIndex = tempal; } else { /* LVDS, 301B-DH (if running on LCD) */ tempbx = 0; if((SiS_Pr->SiS_IF_DEF_CH70xx) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { tempbx = 90; if(SiS_Pr->SiS_TVMode & TVSetPAL) { tempbx = 92; if(SiS_Pr->SiS_ModeType > ModeVGA) { if(SiS_Pr->SiS_CHSOverScan) tempbx = 99; } if(SiS_Pr->SiS_TVMode & TVSetPALM) tempbx = 94; else if(SiS_Pr->SiS_TVMode & TVSetPALN) tempbx = 96; } if(tempbx != 99) { if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx++; } } else { switch(SiS_Pr->SiS_LCDResInfo) { case Panel_640x480: tempbx = 12; break; case Panel_320x240_1: tempbx = 10; break; case Panel_320x240_2: case Panel_320x240_3: tempbx = 14; break; case Panel_800x600: tempbx = 16; break; case Panel_1024x600: tempbx = 18; break; case Panel_1152x768: case Panel_1024x768: tempbx = 20; break; case Panel_1280x768: tempbx = 22; break; case Panel_1280x1024: tempbx = 24; break; case Panel_1400x1050: tempbx = 26; break; case Panel_1600x1200: tempbx = 28; break; #ifdef SIS300 case Panel_Barco1366: tempbx = 80; break; #endif } switch(SiS_Pr->SiS_LCDResInfo) { case Panel_320x240_1: case Panel_320x240_2: case Panel_320x240_3: case Panel_640x480: break; default: if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; } if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempbx = 30; #ifdef SIS300 if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { tempbx = 82; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; } else if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { tempbx = 84; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; } #endif } (*CRT2Index) = tempbx; (*ResIndex) = tempal & 0x1F; } } static void SiS_GetRAMDAC2DATA(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short tempax=0, tempbx=0, index, dotclock; unsigned short temp1=0, modeflag=0, tempcx=0; SiS_Pr->SiS_RVBHCMAX = 1; SiS_Pr->SiS_RVBHCFACT = 1; if(ModeNo <= 0x13) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; index = SiS_GetModePtr(SiS_Pr,ModeNo,ModeIdIndex); tempax = SiS_Pr->SiS_StandTable[index].CRTC[0]; tempbx = SiS_Pr->SiS_StandTable[index].CRTC[6]; temp1 = SiS_Pr->SiS_StandTable[index].CRTC[7]; dotclock = (modeflag & Charx8Dot) ? 8 : 9; } else { modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; index = SiS_GetRefCRT1CRTC(SiS_Pr, RefreshRateTableIndex, SiS_Pr->SiS_UseWideCRT2); tempax = SiS_Pr->SiS_CRT1Table[index].CR[0]; tempax |= (SiS_Pr->SiS_CRT1Table[index].CR[14] << 8); tempax &= 0x03FF; tempbx = SiS_Pr->SiS_CRT1Table[index].CR[6]; tempcx = SiS_Pr->SiS_CRT1Table[index].CR[13] << 8; tempcx &= 0x0100; tempcx <<= 2; tempbx |= tempcx; temp1 = SiS_Pr->SiS_CRT1Table[index].CR[7]; dotclock = 8; } if(temp1 & 0x01) tempbx |= 0x0100; if(temp1 & 0x20) tempbx |= 0x0200; tempax += 5; tempax *= dotclock; if(modeflag & HalfDCLK) tempax <<= 1; tempbx++; SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax; SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = tempbx; } static void SiS_CalcPanelLinkTiming(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short ResIndex; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { if(SiS_Pr->SiS_LCDInfo & LCDPass11) { if(SiS_Pr->UseCustomMode) { ResIndex = SiS_Pr->CHTotal; if(SiS_Pr->CModeFlag & HalfDCLK) ResIndex <<= 1; SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = ResIndex; SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal; } else { if(ModeNo < 0x13) { ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; } else { ResIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC_NS; } if(ResIndex == 0x09) { if(SiS_Pr->Alternate1600x1200) ResIndex = 0x20; /* 1600x1200 LCDA */ else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) ResIndex = 0x21; /* 1600x1200 LVDS */ } SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_NoScaleData[ResIndex].VGAHT; SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_NoScaleData[ResIndex].VGAVT; SiS_Pr->SiS_HT = SiS_Pr->SiS_NoScaleData[ResIndex].LCDHT; SiS_Pr->SiS_VT = SiS_Pr->SiS_NoScaleData[ResIndex].LCDVT; } } else { SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = SiS_Pr->PanelHT; SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->PanelVT; } } else { /* This handles custom modes and custom panels */ SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes; SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes; SiS_Pr->SiS_HT = SiS_Pr->PanelHT; SiS_Pr->SiS_VT = SiS_Pr->PanelVT; SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT - (SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE); SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT - (SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE); } } static void SiS_GetCRT2DataLVDS(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short CRT2Index, ResIndex, backup; const struct SiS_LVDSData *LVDSData = NULL; SiS_GetCRT2ResInfo(SiS_Pr, ModeNo, ModeIdIndex); if(SiS_Pr->SiS_VBType & VB_SISVB) { SiS_Pr->SiS_RVBHCMAX = 1; SiS_Pr->SiS_RVBHCFACT = 1; SiS_Pr->SiS_NewFlickerMode = 0; SiS_Pr->SiS_RVBHRS = 50; SiS_Pr->SiS_RY1COE = 0; SiS_Pr->SiS_RY2COE = 0; SiS_Pr->SiS_RY3COE = 0; SiS_Pr->SiS_RY4COE = 0; SiS_Pr->SiS_RVBHRS2 = 0; } if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { #ifdef SIS315H SiS_CalcPanelLinkTiming(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); SiS_CalcLCDACRT1Timing(SiS_Pr, ModeNo, ModeIdIndex); #endif } else { /* 301BDH needs LVDS Data */ backup = SiS_Pr->SiS_IF_DEF_LVDS; if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { SiS_Pr->SiS_IF_DEF_LVDS = 1; } SiS_GetCRT2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, &CRT2Index, &ResIndex); SiS_Pr->SiS_IF_DEF_LVDS = backup; switch(CRT2Index) { case 10: LVDSData = SiS_Pr->SiS_LVDS320x240Data_1; break; case 14: LVDSData = SiS_Pr->SiS_LVDS320x240Data_2; break; case 12: LVDSData = SiS_Pr->SiS_LVDS640x480Data_1; break; case 16: LVDSData = SiS_Pr->SiS_LVDS800x600Data_1; break; case 18: LVDSData = SiS_Pr->SiS_LVDS1024x600Data_1; break; case 20: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1; break; #ifdef SIS300 case 80: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_1; break; case 81: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_2; break; case 82: LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_1; break; case 84: LVDSData = SiS_Pr->SiS_LVDS848x480Data_1; break; case 85: LVDSData = SiS_Pr->SiS_LVDS848x480Data_2; break; #endif case 90: LVDSData = SiS_Pr->SiS_CHTVUNTSCData; break; case 91: LVDSData = SiS_Pr->SiS_CHTVONTSCData; break; case 92: LVDSData = SiS_Pr->SiS_CHTVUPALData; break; case 93: LVDSData = SiS_Pr->SiS_CHTVOPALData; break; case 94: LVDSData = SiS_Pr->SiS_CHTVUPALMData; break; case 95: LVDSData = SiS_Pr->SiS_CHTVOPALMData; break; case 96: LVDSData = SiS_Pr->SiS_CHTVUPALNData; break; case 97: LVDSData = SiS_Pr->SiS_CHTVOPALNData; break; case 99: LVDSData = SiS_Pr->SiS_CHTVSOPALData; break; } if(LVDSData) { SiS_Pr->SiS_VGAHT = (LVDSData+ResIndex)->VGAHT; SiS_Pr->SiS_VGAVT = (LVDSData+ResIndex)->VGAVT; SiS_Pr->SiS_HT = (LVDSData+ResIndex)->LCDHT; SiS_Pr->SiS_VT = (LVDSData+ResIndex)->LCDVT; } else { SiS_CalcPanelLinkTiming(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } if( (!(SiS_Pr->SiS_VBType & VB_SISVB)) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) ) { if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || (SiS_Pr->SiS_SetFlag & SetDOSMode) ) { SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes; SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes; #ifdef SIS300 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { if(ResIndex < 0x08) { SiS_Pr->SiS_HDE = 1280; SiS_Pr->SiS_VDE = 1024; } } #endif } } } } static void SiS_GetCRT2Data301(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned char *ROMAddr = NULL; unsigned short tempax, tempbx, modeflag, romptr=0; unsigned short resinfo, CRT2Index, ResIndex; const struct SiS_LCDData *LCDPtr = NULL; const struct SiS_TVData *TVPtr = NULL; #ifdef SIS315H short resinfo661; #endif if(ModeNo <= 0x13) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; } else if(SiS_Pr->UseCustomMode) { modeflag = SiS_Pr->CModeFlag; resinfo = 0; } else { modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; #ifdef SIS315H resinfo661 = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].ROMMODEIDX661; if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->SiS_SetFlag & LCDVESATiming) && (resinfo661 >= 0) && (SiS_Pr->SiS_NeedRomModeData) ) { if((ROMAddr = GetLCDStructPtr661(SiS_Pr))) { if((romptr = (SISGETROMW(21)))) { romptr += (resinfo661 * 10); ROMAddr = SiS_Pr->VirtualRomBase; } } } #endif } SiS_Pr->SiS_NewFlickerMode = 0; SiS_Pr->SiS_RVBHRS = 50; SiS_Pr->SiS_RY1COE = 0; SiS_Pr->SiS_RY2COE = 0; SiS_Pr->SiS_RY3COE = 0; SiS_Pr->SiS_RY4COE = 0; SiS_Pr->SiS_RVBHRS2 = 0; SiS_GetCRT2ResInfo(SiS_Pr,ModeNo,ModeIdIndex); if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { if(SiS_Pr->UseCustomMode) { SiS_Pr->SiS_RVBHCMAX = 1; SiS_Pr->SiS_RVBHCFACT = 1; SiS_Pr->SiS_HDE = SiS_Pr->SiS_VGAHDE; SiS_Pr->SiS_VDE = SiS_Pr->SiS_VGAVDE; tempax = SiS_Pr->CHTotal; if(modeflag & HalfDCLK) tempax <<= 1; SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax; SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal; } else { SiS_GetRAMDAC2DATA(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex, &CRT2Index,&ResIndex); switch(CRT2Index) { case 2: TVPtr = SiS_Pr->SiS_ExtHiTVData; break; case 3: TVPtr = SiS_Pr->SiS_ExtPALData; break; case 4: TVPtr = SiS_Pr->SiS_ExtNTSCData; break; case 5: TVPtr = SiS_Pr->SiS_Ext525iData; break; case 6: TVPtr = SiS_Pr->SiS_Ext525pData; break; case 7: TVPtr = SiS_Pr->SiS_Ext750pData; break; case 8: TVPtr = SiS_Pr->SiS_StPALData; break; case 9: TVPtr = SiS_Pr->SiS_StNTSCData; break; case 10: TVPtr = SiS_Pr->SiS_St525iData; break; case 11: TVPtr = SiS_Pr->SiS_St525pData; break; case 12: TVPtr = SiS_Pr->SiS_St750pData; break; case 13: TVPtr = SiS_Pr->SiS_St1HiTVData; break; case 14: TVPtr = SiS_Pr->SiS_St2HiTVData; break; case 15: TVPtr = SiS_Pr->SiS_Ext625iData; break; case 16: TVPtr = SiS_Pr->SiS_Ext625pData; break; case 20: TVPtr = SiS_Pr->SiS_St625iData; break; case 21: TVPtr = SiS_Pr->SiS_St625pData; break; default: TVPtr = SiS_Pr->SiS_StPALData; break; } SiS_Pr->SiS_RVBHCMAX = (TVPtr+ResIndex)->RVBHCMAX; SiS_Pr->SiS_RVBHCFACT = (TVPtr+ResIndex)->RVBHCFACT; SiS_Pr->SiS_VGAHT = (TVPtr+ResIndex)->VGAHT; SiS_Pr->SiS_VGAVT = (TVPtr+ResIndex)->VGAVT; SiS_Pr->SiS_HDE = (TVPtr+ResIndex)->TVHDE; SiS_Pr->SiS_VDE = (TVPtr+ResIndex)->TVVDE; SiS_Pr->SiS_RVBHRS2 = (TVPtr+ResIndex)->RVBHRS2 & 0x0fff; if(modeflag & HalfDCLK) { SiS_Pr->SiS_RVBHRS = (TVPtr+ResIndex)->HALFRVBHRS; if(SiS_Pr->SiS_RVBHRS2) { SiS_Pr->SiS_RVBHRS2 = ((SiS_Pr->SiS_RVBHRS2 + 3) >> 1) - 3; tempax = ((TVPtr+ResIndex)->RVBHRS2 >> 12) & 0x07; if((TVPtr+ResIndex)->RVBHRS2 & 0x8000) SiS_Pr->SiS_RVBHRS2 -= tempax; else SiS_Pr->SiS_RVBHRS2 += tempax; } } else { SiS_Pr->SiS_RVBHRS = (TVPtr+ResIndex)->RVBHRS; } SiS_Pr->SiS_NewFlickerMode = ((TVPtr+ResIndex)->FlickerMode) << 7; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { if((resinfo == SIS_RI_960x540) || (resinfo == SIS_RI_960x600) || (resinfo == SIS_RI_1024x768) || (resinfo == SIS_RI_1280x1024) || (resinfo == SIS_RI_1280x720)) { SiS_Pr->SiS_NewFlickerMode = 0x40; } if(SiS_Pr->SiS_VGAVDE == 350) SiS_Pr->SiS_TVMode |= TVSetTVSimuMode; SiS_Pr->SiS_HT = ExtHiTVHT; SiS_Pr->SiS_VT = ExtHiTVVT; if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { SiS_Pr->SiS_HT = StHiTVHT; SiS_Pr->SiS_VT = StHiTVVT; } } } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { SiS_Pr->SiS_HT = 1650; SiS_Pr->SiS_VT = 750; } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { SiS_Pr->SiS_HT = NTSCHT; if(SiS_Pr->SiS_TVMode & TVSet525p1024) SiS_Pr->SiS_HT = NTSC2HT; SiS_Pr->SiS_VT = NTSCVT; } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) { SiS_Pr->SiS_HT = NTSCHT; if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT; SiS_Pr->SiS_VT = NTSCVT; } else { SiS_Pr->SiS_HT = PALHT; SiS_Pr->SiS_VT = PALVT; } } else { SiS_Pr->SiS_RY1COE = (TVPtr+ResIndex)->RY1COE; SiS_Pr->SiS_RY2COE = (TVPtr+ResIndex)->RY2COE; SiS_Pr->SiS_RY3COE = (TVPtr+ResIndex)->RY3COE; SiS_Pr->SiS_RY4COE = (TVPtr+ResIndex)->RY4COE; if(modeflag & HalfDCLK) { SiS_Pr->SiS_RY1COE = 0x00; SiS_Pr->SiS_RY2COE = 0xf4; SiS_Pr->SiS_RY3COE = 0x10; SiS_Pr->SiS_RY4COE = 0x38; } if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { SiS_Pr->SiS_HT = NTSCHT; if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT; SiS_Pr->SiS_VT = NTSCVT; } else { SiS_Pr->SiS_HT = PALHT; SiS_Pr->SiS_VT = PALVT; } } } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { SiS_Pr->SiS_RVBHCMAX = 1; SiS_Pr->SiS_RVBHCFACT = 1; if(SiS_Pr->UseCustomMode) { SiS_Pr->SiS_HDE = SiS_Pr->SiS_VGAHDE; SiS_Pr->SiS_VDE = SiS_Pr->SiS_VGAVDE; tempax = SiS_Pr->CHTotal; if(modeflag & HalfDCLK) tempax <<= 1; SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax; SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal; } else { BOOLEAN gotit = FALSE; if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT; SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT; SiS_Pr->SiS_HT = SiS_Pr->PanelHT; SiS_Pr->SiS_VT = SiS_Pr->PanelVT; gotit = TRUE; } else if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) && (romptr) && (ROMAddr) ) { #ifdef SIS315H SiS_Pr->SiS_RVBHCMAX = ROMAddr[romptr]; SiS_Pr->SiS_RVBHCFACT = ROMAddr[romptr+1]; SiS_Pr->SiS_VGAHT = ROMAddr[romptr+2] | ((ROMAddr[romptr+3] & 0x0f) << 8); SiS_Pr->SiS_VGAVT = (ROMAddr[romptr+4] << 4) | ((ROMAddr[romptr+3] & 0xf0) >> 4); SiS_Pr->SiS_HT = ROMAddr[romptr+5] | ((ROMAddr[romptr+6] & 0x0f) << 8); SiS_Pr->SiS_VT = (ROMAddr[romptr+7] << 4) | ((ROMAddr[romptr+6] & 0xf0) >> 4); SiS_Pr->SiS_RVBHRS2 = ROMAddr[romptr+8] | ((ROMAddr[romptr+9] & 0x0f) << 8); if((SiS_Pr->SiS_RVBHRS2) && (modeflag & HalfDCLK)) { SiS_Pr->SiS_RVBHRS2 = ((SiS_Pr->SiS_RVBHRS2 + 3) >> 1) - 3; tempax = (ROMAddr[romptr+9] >> 4) & 0x07; if(ROMAddr[romptr+9] & 0x80) SiS_Pr->SiS_RVBHRS2 -= tempax; else SiS_Pr->SiS_RVBHRS2 += tempax; } if(SiS_Pr->SiS_VGAHT) gotit = TRUE; else { SiS_Pr->SiS_LCDInfo |= DontExpandLCD; SiS_Pr->SiS_LCDInfo &= ~LCDPass11; SiS_Pr->SiS_RVBHCMAX = 1; SiS_Pr->SiS_RVBHCFACT = 1; SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT; SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT; SiS_Pr->SiS_HT = SiS_Pr->PanelHT; SiS_Pr->SiS_VT = SiS_Pr->PanelVT; SiS_Pr->SiS_RVBHRS2 = 0; gotit = TRUE; } #endif } if(!gotit) { SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex, &CRT2Index,&ResIndex); switch(CRT2Index) { case Panel_1024x768 : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data; break; case Panel_1024x768 + 32: LCDPtr = SiS_Pr->SiS_St2LCD1024x768Data; break; case Panel_1280x720 : case Panel_1280x720 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x720Data; break; case Panel_1280x768_2 : LCDPtr = SiS_Pr->SiS_ExtLCD1280x768_2Data; break; case Panel_1280x768_2+ 32: LCDPtr = SiS_Pr->SiS_StLCD1280x768_2Data; break; case Panel_1280x800 : case Panel_1280x800 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x800Data; break; case Panel_1280x800_2 : case Panel_1280x800_2+ 32: LCDPtr = SiS_Pr->SiS_LCD1280x800_2Data; break; case Panel_1280x854 : case Panel_1280x854 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x854Data; break; case Panel_1280x960 : case Panel_1280x960 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x960Data; break; case Panel_1280x1024 : LCDPtr = SiS_Pr->SiS_ExtLCD1280x1024Data; break; case Panel_1280x1024 + 32: LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data; break; case Panel_1400x1050 : LCDPtr = SiS_Pr->SiS_ExtLCD1400x1050Data; break; case Panel_1400x1050 + 32: LCDPtr = SiS_Pr->SiS_StLCD1400x1050Data; break; case Panel_1600x1200 : LCDPtr = SiS_Pr->SiS_ExtLCD1600x1200Data; break; case Panel_1600x1200 + 32: LCDPtr = SiS_Pr->SiS_StLCD1600x1200Data; break; case Panel_1680x1050 : case Panel_1680x1050 + 32: LCDPtr = SiS_Pr->SiS_LCD1680x1050Data; break; case 100 : LCDPtr = SiS_Pr->SiS_NoScaleData; break; #ifdef SIS315H case 200 : LCDPtr = SiS310_ExtCompaq1280x1024Data; break; case 201 : LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data; break; #endif default : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data; break; } #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "GetCRT2Data: Index %d ResIndex %d\n", CRT2Index, ResIndex); #endif #endif SiS_Pr->SiS_RVBHCMAX = (LCDPtr+ResIndex)->RVBHCMAX; SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT; SiS_Pr->SiS_VGAHT = (LCDPtr+ResIndex)->VGAHT; SiS_Pr->SiS_VGAVT = (LCDPtr+ResIndex)->VGAVT; SiS_Pr->SiS_HT = (LCDPtr+ResIndex)->LCDHT; SiS_Pr->SiS_VT = (LCDPtr+ResIndex)->LCDVT; } tempax = SiS_Pr->PanelXRes; tempbx = SiS_Pr->PanelYRes; switch(SiS_Pr->SiS_LCDResInfo) { case Panel_1024x768: if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { if(SiS_Pr->ChipType < SIS_315H) { if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 560; else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640; } } else { if (SiS_Pr->SiS_VGAVDE == 357) tempbx = 527; else if(SiS_Pr->SiS_VGAVDE == 420) tempbx = 620; else if(SiS_Pr->SiS_VGAVDE == 525) tempbx = 775; else if(SiS_Pr->SiS_VGAVDE == 600) tempbx = 775; else if(SiS_Pr->SiS_VGAVDE == 350) tempbx = 560; else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640; } break; case Panel_1280x960: if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 700; else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 800; else if(SiS_Pr->SiS_VGAVDE == 1024) tempbx = 960; break; case Panel_1280x1024: if (SiS_Pr->SiS_VGAVDE == 360) tempbx = 768; else if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 800; else if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 864; break; case Panel_1600x1200: if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 875; else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 1000; } break; } if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { tempax = SiS_Pr->SiS_VGAHDE; tempbx = SiS_Pr->SiS_VGAVDE; } SiS_Pr->SiS_HDE = tempax; SiS_Pr->SiS_VDE = tempbx; } } } static void SiS_GetCRT2Data(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } else { if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { /* Need LVDS Data for LCD on 301B-DH */ SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } else { SiS_GetCRT2Data301(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } } } else { SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } } /*********************************************/ /* GET LVDS DES (SKEW) DATA */ /*********************************************/ static const struct SiS_LVDSDes * SiS_GetLVDSDesPtr(struct SiS_Private *SiS_Pr) { const struct SiS_LVDSDes *PanelDesPtr = NULL; #ifdef SIS300 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { if(SiS_Pr->ChipType < SIS_315H) { if(SiS_Pr->SiS_LCDTypeInfo == 4) { if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { PanelDesPtr = SiS_Pr->SiS_PanelType04_1a; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { PanelDesPtr = SiS_Pr->SiS_PanelType04_2a; } } else if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { PanelDesPtr = SiS_Pr->SiS_PanelType04_1b; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { PanelDesPtr = SiS_Pr->SiS_PanelType04_2b; } } } } } #endif return PanelDesPtr; } static void SiS_GetLVDSDesData(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short modeflag, ResIndex; const struct SiS_LVDSDes *PanelDesPtr = NULL; SiS_Pr->SiS_LCDHDES = 0; SiS_Pr->SiS_LCDVDES = 0; /* Some special cases */ if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { /* Trumpion */ if(SiS_Pr->SiS_IF_DEF_TRUMPION) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; } } return; } /* 640x480 on LVDS */ if(SiS_Pr->ChipType < SIS_315H) { if(SiS_Pr->SiS_LCDResInfo == Panel_640x480 && SiS_Pr->SiS_LCDTypeInfo == 3) { SiS_Pr->SiS_LCDHDES = 8; if (SiS_Pr->SiS_VGAVDE >= 480) SiS_Pr->SiS_LCDVDES = 512; else if(SiS_Pr->SiS_VGAVDE >= 400) SiS_Pr->SiS_LCDVDES = 436; else if(SiS_Pr->SiS_VGAVDE >= 350) SiS_Pr->SiS_LCDVDES = 440; return; } } } /* LCD */ if( (SiS_Pr->UseCustomMode) || (SiS_Pr->SiS_LCDResInfo == Panel_Custom) || (SiS_Pr->SiS_CustomT == CUT_PANEL848) || (SiS_Pr->SiS_CustomT == CUT_PANEL856) || (SiS_Pr->SiS_LCDInfo & LCDPass11) ) { return; } if(ModeNo <= 0x13) ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; else ResIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { #ifdef SIS315H if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { /* non-pass 1:1 only, see above */ if(SiS_Pr->SiS_VGAHDE != SiS_Pr->PanelXRes) { SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE) / 2); } if(SiS_Pr->SiS_VGAVDE != SiS_Pr->PanelYRes) { SiS_Pr->SiS_LCDVDES = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE) / 2); } } if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { switch(SiS_Pr->SiS_CustomT) { case CUT_UNIWILL1024: case CUT_UNIWILL10242: case CUT_CLEVO1400: if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; } break; } switch(SiS_Pr->SiS_LCDResInfo) { case Panel_1280x1024: if(SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) { SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; } break; case Panel_1280x800: /* Verified for Averatec 6240 */ case Panel_1280x800_2: /* Verified for Asus A4L */ case Panel_1280x854: /* Not verified yet FIXME */ SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; break; } } #endif } else { if((SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { if((SiS_Pr->SiS_TVMode & TVSetPAL) && (!(SiS_Pr->SiS_TVMode & TVSetPALM))) { if(ResIndex <= 3) SiS_Pr->SiS_LCDHDES = 256; } } else if((PanelDesPtr = SiS_GetLVDSDesPtr(SiS_Pr))) { SiS_Pr->SiS_LCDHDES = (PanelDesPtr+ResIndex)->LCDHDES; SiS_Pr->SiS_LCDVDES = (PanelDesPtr+ResIndex)->LCDVDES; } else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { if(SiS_Pr->SiS_VGAHDE != SiS_Pr->PanelXRes) { SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE) / 2); } if(SiS_Pr->SiS_VGAVDE != SiS_Pr->PanelYRes) { SiS_Pr->SiS_LCDVDES = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE) / 2); } else { if(SiS_Pr->ChipType < SIS_315H) { SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; } else { switch(SiS_Pr->SiS_LCDResInfo) { case Panel_800x600: case Panel_1024x768: case Panel_1280x1024: SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT; break; case Panel_1400x1050: SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; break; } } } } else { if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 switch(SiS_Pr->SiS_LCDResInfo) { case Panel_800x600: if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; } else { SiS_Pr->SiS_LCDHDES = SiS_Pr->PanelHT + 3; SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT; if(SiS_Pr->SiS_VGAVDE == 400) SiS_Pr->SiS_LCDVDES -= 2; else SiS_Pr->SiS_LCDVDES -= 4; } break; case Panel_1024x768: if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; } else { SiS_Pr->SiS_LCDHDES = SiS_Pr->PanelHT - 1; if(SiS_Pr->SiS_VGAVDE <= 400) SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 8; if(SiS_Pr->SiS_VGAVDE <= 350) SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 12; } break; case Panel_1024x600: default: if( (SiS_Pr->SiS_VGAHDE == SiS_Pr->PanelXRes) && (SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) ) { SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; } else { SiS_Pr->SiS_LCDHDES = SiS_Pr->PanelHT - 1; } break; } switch(SiS_Pr->SiS_LCDTypeInfo) { case 1: SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0; break; case 3: /* 640x480 only? */ SiS_Pr->SiS_LCDHDES = 8; if (SiS_Pr->SiS_VGAVDE >= 480) SiS_Pr->SiS_LCDVDES = 512; else if(SiS_Pr->SiS_VGAVDE >= 400) SiS_Pr->SiS_LCDVDES = 436; else if(SiS_Pr->SiS_VGAVDE >= 350) SiS_Pr->SiS_LCDVDES = 440; break; } #endif } else { #ifdef SIS315H switch(SiS_Pr->SiS_LCDResInfo) { case Panel_1024x768: case Panel_1280x1024: if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; } break; case Panel_320x240_1: case Panel_320x240_2: case Panel_320x240_3: SiS_Pr->SiS_LCDVDES = 524; break; } #endif } } if((ModeNo <= 0x13) && (SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 632; } else if(!(SiS_Pr->SiS_SetFlag & SetDOSMode)) { if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) { if(SiS_Pr->SiS_LCDResInfo >= Panel_1024x768) { if(SiS_Pr->ChipType < SIS_315H) { if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 320; } else { #ifdef SIS315H if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) SiS_Pr->SiS_LCDHDES = 480; if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 804; if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 704; if(!(modeflag & HalfDCLK)) { SiS_Pr->SiS_LCDHDES = 320; if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 632; if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 542; } #endif } } } } } } } /*********************************************/ /* DISABLE VIDEO BRIDGE */ /*********************************************/ #ifdef SIS315H static int SiS_HandlePWD(struct SiS_Private *SiS_Pr) { int ret = 0; #ifdef SET_PWD unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short romptr = GetLCDStructPtr661_2(SiS_Pr); unsigned char drivermode = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40; unsigned short temp; if( (SiS_Pr->SiS_VBType & VB_SISPWD) && (romptr) && (SiS_Pr->SiS_PWDOffset) ) { SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2b,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 0]); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2c,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 1]); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2d,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 2]); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2e,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 3]); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2f,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 4]); temp = 0x00; if((ROMAddr[romptr + 2] & (0x06 << 1)) && !drivermode) { temp = 0x80; ret = 1; } SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x27,0x7f,temp); #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, 0, "Setting PWD %x\n", temp); #endif #endif } #endif return ret; } #endif /* NEVER use any variables (VBInfo), this will be called * from outside the context of modeswitch! * MUST call getVBType before calling this */ void SiS_DisableBridge(struct SiS_Private *SiS_Pr) { #ifdef SIS315H unsigned short tempah, pushax=0, modenum; #endif unsigned short temp=0; if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* ===== For 30xB/C/LV ===== */ if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 /* 300 series */ if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { if(SiS_Pr->SiS_VBType & VB_SISLVDS) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); } else { SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); } SiS_PanelDelay(SiS_Pr, 3); } if(SiS_Is301B(SiS_Pr)) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f); SiS_ShortDelay(SiS_Pr,1); } SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); SiS_DisplayOff(SiS_Pr); SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); SiS_UnLockCRT2(SiS_Pr); if(!(SiS_Pr->SiS_VBType & VB_SISLVDS)) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); } if( (!(SiS_CRT2IsLCD(SiS_Pr))) || (!(SiS_CR36BIOSWord23d(SiS_Pr))) ) { SiS_PanelDelay(SiS_Pr, 2); if(SiS_Pr->SiS_VBType & VB_SISLVDS) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); } else { SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); } } #endif /* SIS300 */ } else { #ifdef SIS315H /* 315 series */ int didpwd = 0; BOOLEAN custom1 = ((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) ? TRUE : FALSE; modenum = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34) & 0x7f; if(SiS_Pr->SiS_VBType & VB_SISLVDS) { #ifdef SET_EMI if(SiS_Pr->SiS_VBType & VB_SISEMI) { if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); } } #endif didpwd = SiS_HandlePWD(SiS_Pr); if( (modenum <= 0x13) || (SiS_IsVAMode(SiS_Pr)) || (!(SiS_IsDualEdge(SiS_Pr))) ) { if(!didpwd) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xfe); if(custom1) SiS_PanelDelay(SiS_Pr, 3); } else { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xfc); } } if(!custom1) { SiS_DDC2Delay(SiS_Pr,0xff00); SiS_DDC2Delay(SiS_Pr,0xe000); SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); if(IS_SIS740) { SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); } SiS_PanelDelay(SiS_Pr, 3); } } if(!(SiS_IsNotM650orLater(SiS_Pr))) { /* if(SiS_Pr->ChipType < SIS_340) {*/ tempah = 0xef; if(SiS_IsVAMode(SiS_Pr)) tempah = 0xf7; SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah); /*}*/ } if(SiS_Pr->SiS_VBType & VB_SISLVDS) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,~0x10); } tempah = 0x3f; if(SiS_IsDualEdge(SiS_Pr)) { tempah = 0x7f; if(!(SiS_IsVAMode(SiS_Pr))) tempah = 0xbf; } SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah); if((SiS_IsVAMode(SiS_Pr)) || ((SiS_Pr->SiS_VBType & VB_SISLVDS) && (modenum <= 0x13))) { SiS_DisplayOff(SiS_Pr); if(SiS_Pr->SiS_VBType & VB_SISLVDS) { SiS_PanelDelay(SiS_Pr, 2); } SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF); } if((!(SiS_IsVAMode(SiS_Pr))) || ((SiS_Pr->SiS_VBType & VB_SISLVDS) && (modenum <= 0x13))) { if(!(SiS_IsDualEdge(SiS_Pr))) { SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf); SiS_DisplayOff(SiS_Pr); } SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); if(SiS_Pr->SiS_VBType & VB_SISLVDS) { SiS_PanelDelay(SiS_Pr, 2); } SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); } if(SiS_IsNotM650orLater(SiS_Pr)) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); } if(SiS_Pr->SiS_VBType & VB_SISLVDS) { if( (!(SiS_IsVAMode(SiS_Pr))) && (!(SiS_CRT2IsLCD(SiS_Pr))) && (!(SiS_IsDualEdge(SiS_Pr))) ) { if(custom1) SiS_PanelDelay(SiS_Pr, 2); if(!didpwd) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); } if(custom1) SiS_PanelDelay(SiS_Pr, 4); } if(!custom1) { SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); if(SiS_Pr->SiS_VBType & VB_SISEMI) { if(SiS_IsVAorLCD(SiS_Pr)) { SiS_PanelDelayLoop(SiS_Pr, 3, 20); } } } } #endif /* SIS315H */ } } else { /* ============ For 301 ================ */ if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); SiS_PanelDelay(SiS_Pr, 3); } #endif } SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); /* disable VB */ SiS_DisplayOff(SiS_Pr); if(SiS_Pr->ChipType >= SIS_315H) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); } SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); /* disable lock mode */ if(SiS_Pr->ChipType >= SIS_315H) { temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); } else { #ifdef SIS300 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); /* disable CRT2 */ if( (!(SiS_CRT2IsLCD(SiS_Pr))) || (!(SiS_CR36BIOSWord23d(SiS_Pr))) ) { SiS_PanelDelay(SiS_Pr, 2); SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); } #endif } } } else { /* ============ For LVDS =============*/ if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 /* 300 series */ if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { SiS_SetCH700x(SiS_Pr,0x0E,0x09); } if(SiS_Pr->ChipType == SIS_730) { if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { SiS_WaitVBRetrace(SiS_Pr); } if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); SiS_PanelDelay(SiS_Pr, 3); } } else { if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { SiS_WaitVBRetrace(SiS_Pr); if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x1c)) { SiS_DisplayOff(SiS_Pr); } SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); SiS_PanelDelay(SiS_Pr, 3); } } } } SiS_DisplayOff(SiS_Pr); SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); SiS_UnLockCRT2(SiS_Pr); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); if( (!(SiS_CRT2IsLCD(SiS_Pr))) || (!(SiS_CR36BIOSWord23d(SiS_Pr))) ) { SiS_PanelDelay(SiS_Pr, 2); SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); } #endif /* SIS300 */ } else { #ifdef SIS315H /* 315 series */ if(!(SiS_IsNotM650orLater(SiS_Pr))) { /*if(SiS_Pr->ChipType < SIS_340) { */ /* XGI needs this */ SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,~0x18); /* } */ } if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if(SiS_Pr->ChipType == SIS_740) { temp = SiS_GetCH701x(SiS_Pr,0x61); if(temp < 1) { SiS_SetCH701x(SiS_Pr,0x76,0xac); SiS_SetCH701x(SiS_Pr,0x66,0x00); } if( (!(SiS_IsDualEdge(SiS_Pr))) || (SiS_IsTVOrYPbPrOrScart(SiS_Pr)) ) { SiS_SetCH701x(SiS_Pr,0x49,0x3e); } } if( (!(SiS_IsDualEdge(SiS_Pr))) || (SiS_IsVAMode(SiS_Pr)) ) { SiS_Chrontel701xBLOff(SiS_Pr); SiS_Chrontel701xOff(SiS_Pr); } if(SiS_Pr->ChipType != SIS_740) { if( (!(SiS_IsDualEdge(SiS_Pr))) || (SiS_IsTVOrYPbPrOrScart(SiS_Pr)) ) { SiS_SetCH701x(SiS_Pr,0x49,0x01); } } } if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); SiS_PanelDelay(SiS_Pr, 3); } if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || (!(SiS_IsDualEdge(SiS_Pr))) || (!(SiS_IsTVOrYPbPrOrScart(SiS_Pr))) ) { SiS_DisplayOff(SiS_Pr); } if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || (!(SiS_IsDualEdge(SiS_Pr))) || (!(SiS_IsVAMode(SiS_Pr))) ) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); } if(SiS_Pr->ChipType == SIS_740) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); } SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || (!(SiS_IsDualEdge(SiS_Pr))) || (!(SiS_IsVAMode(SiS_Pr))) ) { SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); } if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { if(SiS_CRT2IsLCD(SiS_Pr)) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); if(SiS_Pr->ChipType == SIS_550) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xbf); SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xef); } } } else { if(SiS_Pr->ChipType == SIS_740) { if(SiS_IsLCDOrLCDA(SiS_Pr)) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); } } else if(SiS_IsVAMode(SiS_Pr)) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); } } if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if(SiS_IsDualEdge(SiS_Pr)) { /* SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xff); */ } else { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); } } SiS_UnLockCRT2(SiS_Pr); if(SiS_Pr->ChipType == SIS_550) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); /* DirectDVD PAL?*/ SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); /* VB clock / 4 ? */ } else if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || (!(SiS_IsDualEdge(SiS_Pr))) || (!(SiS_IsVAMode(SiS_Pr))) ) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); } if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { if(SiS_CRT2IsLCD(SiS_Pr)) { if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { SiS_PanelDelay(SiS_Pr, 2); SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); } } } #endif /* SIS315H */ } /* 315 series */ } /* LVDS */ } /*********************************************/ /* ENABLE VIDEO BRIDGE */ /*********************************************/ /* NEVER use any variables (VBInfo), this will be called * from outside the context of a mode switch! * MUST call getVBType before calling this */ #ifdef SIS_LINUX_KERNEL static #endif void SiS_EnableBridge(struct SiS_Private *SiS_Pr) { unsigned short temp=0, tempah; #ifdef SIS315H unsigned short temp1, pushax=0; BOOLEAN delaylong = FALSE; #endif if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* ====== For 301B et al ====== */ if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 /* 300 series */ if(SiS_CRT2IsLCD(SiS_Pr)) { if(SiS_Pr->SiS_VBType & VB_SISLVDS) { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); } else if(SiS_Pr->SiS_VBType & VB_NoLCD) { SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); } if(SiS_Pr->SiS_VBType & (VB_SISLVDS | VB_NoLCD)) { if(!(SiS_CR36BIOSWord23d(SiS_Pr))) { SiS_PanelDelay(SiS_Pr, 0); } } } if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_CRT2IsLCD(SiS_Pr))) { SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* Enable CRT2 */ SiS_DisplayOn(SiS_Pr); SiS_UnLockCRT2(SiS_Pr); SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); if(SiS_BridgeInSlavemode(SiS_Pr)) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); } else { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); } if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { SiS_PanelDelay(SiS_Pr, 1); } SiS_WaitVBRetrace(SiS_Pr); SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); } } } else { temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ if(SiS_BridgeInSlavemode(SiS_Pr)) { tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); if(!(tempah & SetCRT2ToRAMDAC)) temp |= 0x20; } SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0); SiS_DisplayOn(SiS_Pr); if(SiS_Pr->SiS_VBType & VB_SISLVDS) { if(SiS_CRT2IsLCD(SiS_Pr)) { if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { SiS_PanelDelay(SiS_Pr, 1); } SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); } } } } #endif /* SIS300 */ } else { #ifdef SIS315H /* 315 series */ #ifdef SET_EMI unsigned char r30=0, r31=0, r32=0, r33=0, cr36=0; int didpwd = 0; /* unsigned short emidelay=0; */ #endif if(SiS_Pr->SiS_VBType & VB_SISLVDS) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0xef); #ifdef SET_EMI if(SiS_Pr->SiS_VBType & VB_SISEMI) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); } #endif } if(!(SiS_IsNotM650orLater(SiS_Pr))) { /*if(SiS_Pr->ChipType < SIS_340) { */ tempah = 0x10; if(SiS_LCDAEnabled(SiS_Pr)) { if(SiS_TVEnabled(SiS_Pr)) tempah = 0x18; else tempah = 0x08; } SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4c,tempah); /*}*/ } if(SiS_Pr->SiS_VBType & VB_SISLVDS) { SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); SiS_DisplayOff(SiS_Pr); pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); if(IS_SIS740) { SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); } didpwd = SiS_HandlePWD(SiS_Pr); if(SiS_IsVAorLCD(SiS_Pr)) { if(!didpwd) { if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { SiS_PanelDelayLoop(SiS_Pr, 3, 2); SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); SiS_PanelDelayLoop(SiS_Pr, 3, 2); if(SiS_Pr->SiS_VBType & VB_SISEMI) { SiS_GenericDelay(SiS_Pr, 17664); } } } else { SiS_PanelDelayLoop(SiS_Pr, 3, 2); if(SiS_Pr->SiS_VBType & VB_SISEMI) { SiS_GenericDelay(SiS_Pr, 17664); } } } if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40)) { SiS_PanelDelayLoop(SiS_Pr, 3, 10); delaylong = TRUE; } } if(!(SiS_IsVAMode(SiS_Pr))) { temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; if(SiS_BridgeInSlavemode(SiS_Pr)) { tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); if(!(tempah & SetCRT2ToRAMDAC)) { if(!(SiS_LCDAEnabled(SiS_Pr))) temp |= 0x20; } } SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); if(SiS_Pr->SiS_VBType & VB_SISLVDS) { SiS_PanelDelay(SiS_Pr, 2); } } else { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x20); } SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); if(SiS_Pr->SiS_VBType & VB_SISPOWER) { if( (SiS_LCDAEnabled(SiS_Pr)) || (SiS_CRT2IsLCD(SiS_Pr)) ) { /* Enable "LVDS PLL power on" (even on 301C) */ SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x2a,0x7f); /* Enable "LVDS Driver Power on" (even on 301C) */ SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x7f); } } tempah = 0xc0; if(SiS_IsDualEdge(SiS_Pr)) { tempah = 0x80; if(!(SiS_IsVAMode(SiS_Pr))) tempah = 0x40; } SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah); if(SiS_Pr->SiS_VBType & VB_SISLVDS) { SiS_PanelDelay(SiS_Pr, 2); SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1f,0x10); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) { #ifdef SET_EMI if(SiS_Pr->SiS_VBType & VB_SISEMI) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); SiS_GenericDelay(SiS_Pr, 2048); } #endif SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c); if(SiS_Pr->SiS_VBType & VB_SISEMI) { #ifdef SET_EMI cr36 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); if(SiS_Pr->SiS_ROMNew) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short romptr = GetLCDStructPtr661_2(SiS_Pr); if(romptr) { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); /* Reset */ SiS_Pr->EMI_30 = 0; SiS_Pr->EMI_31 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 0]; SiS_Pr->EMI_32 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 1]; SiS_Pr->EMI_33 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 2]; if(ROMAddr[romptr + 1] & 0x10) SiS_Pr->EMI_30 = 0x40; /* emidelay = SISGETROMW((romptr + 0x22)); */ SiS_Pr->HaveEMI = SiS_Pr->HaveEMILCD = SiS_Pr->OverruleEMI = TRUE; } } /* (P4_30|0x40) */ /* Compal 1400x1050: 0x05, 0x60, 0x00 YES (1.10.7w; CR36=69) */ /* Compal 1400x1050: 0x0d, 0x70, 0x40 YES (1.10.7x; CR36=69) */ /* Acer 1280x1024: 0x12, 0xd0, 0x6b NO (1.10.9k; CR36=73) */ /* Compaq 1280x1024: 0x0d, 0x70, 0x6b YES (1.12.04b; CR36=03) */ /* Clevo 1024x768: 0x05, 0x60, 0x33 NO (1.10.8e; CR36=12, DL!) */ /* Clevo 1024x768: 0x0d, 0x70, 0x40 (if type == 3) YES (1.10.8y; CR36=?2) */ /* Clevo 1024x768: 0x05, 0x60, 0x33 (if type != 3) YES (1.10.8y; CR36=?2) */ /* Asus 1024x768: ? ? (1.10.8o; CR36=?2) */ /* Asus 1024x768: 0x08, 0x10, 0x3c (problematic) YES (1.10.8q; CR36=22) */ if(SiS_Pr->HaveEMI) { r30 = SiS_Pr->EMI_30; r31 = SiS_Pr->EMI_31; r32 = SiS_Pr->EMI_32; r33 = SiS_Pr->EMI_33; } else { r30 = 0; } /* EMI_30 is read at driver start; however, the BIOS sets this * (if it is used) only if the LCD is in use. In case we caught * the machine while on TV output, this bit is not set and we * don't know if it should be set - hence our detection is wrong. * Work-around this here: */ if((!SiS_Pr->HaveEMI) || (!SiS_Pr->HaveEMILCD)) { switch((cr36 & 0x0f)) { case 2: r30 |= 0x40; if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) r30 &= ~0x40; if(!SiS_Pr->HaveEMI) { r31 = 0x05; r32 = 0x60; r33 = 0x33; if((cr36 & 0xf0) == 0x30) { r31 = 0x0d; r32 = 0x70; r33 = 0x40; } } break; case 3: /* 1280x1024 */ if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) r30 |= 0x40; if(!SiS_Pr->HaveEMI) { r31 = 0x12; r32 = 0xd0; r33 = 0x6b; if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { r31 = 0x0d; r32 = 0x70; r33 = 0x6b; } } break; case 9: /* 1400x1050 */ r30 |= 0x40; if(!SiS_Pr->HaveEMI) { r31 = 0x05; r32 = 0x60; r33 = 0x00; if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) { r31 = 0x0d; r32 = 0x70; r33 = 0x40; /* BIOS values */ } } break; case 11: /* 1600x1200 - unknown */ r30 |= 0x40; if(!SiS_Pr->HaveEMI) { r31 = 0x05; r32 = 0x60; r33 = 0x00; } } } /* BIOS values don't work so well sometimes */ if(!SiS_Pr->OverruleEMI) { #ifdef COMPAL_HACK if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) { if((cr36 & 0x0f) == 0x09) { r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x00; } } #endif #ifdef COMPAQ_HACK if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { if((cr36 & 0x0f) == 0x03) { r30 = 0x20; r31 = 0x12; r32 = 0xd0; r33 = 0x6b; } } #endif #ifdef ASUS_HACK if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { if((cr36 & 0x0f) == 0x02) { /* r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x33; */ /* rev 2 */ /* r30 = 0x20; r31 = 0x05; r32 = 0x60; r33 = 0x33; */ /* rev 3 */ /* r30 = 0x60; r31 = 0x0d; r32 = 0x70; r33 = 0x40; */ /* rev 4 */ /* r30 = 0x20; r31 = 0x0d; r32 = 0x70; r33 = 0x40; */ /* rev 5 */ } } #endif } if(!(SiS_Pr->OverruleEMI && (!r30) && (!r31) && (!r32) && (!r33))) { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); /* Reset */ SiS_GenericDelay(SiS_Pr, 2048); } SiS_SetReg(SiS_Pr->SiS_Part4Port,0x31,r31); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x32,r32); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x33,r33); #endif /* SET_EMI */ SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); #ifdef SET_EMI if( (SiS_LCDAEnabled(SiS_Pr)) || (SiS_CRT2IsLCD(SiS_Pr)) ) { if(r30 & 0x40) { /*SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x2a,0x80);*/ SiS_PanelDelayLoop(SiS_Pr, 3, 5); if(delaylong) { SiS_PanelDelayLoop(SiS_Pr, 3, 5); delaylong = FALSE; } SiS_WaitVBRetrace(SiS_Pr); SiS_WaitVBRetrace(SiS_Pr); if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { SiS_GenericDelay(SiS_Pr, 1280); } SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40); /* Enable */ /*SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x2a,0x7f);*/ } } #endif } } if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { if(SiS_IsVAorLCD(SiS_Pr)) { SiS_PanelDelayLoop(SiS_Pr, 3, 10); if(delaylong) { SiS_PanelDelayLoop(SiS_Pr, 3, 10); } SiS_WaitVBRetrace(SiS_Pr); if(SiS_Pr->SiS_VBType & VB_SISEMI) { SiS_GenericDelay(SiS_Pr, 2048); SiS_WaitVBRetrace(SiS_Pr); } if(!didpwd) { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); } else { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x03); } } } SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); SiS_DisplayOn(SiS_Pr); SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xff); } if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); } #endif /* SIS315H */ } } else { /* ============ For 301 ================ */ if(SiS_Pr->ChipType < SIS_315H) { if(SiS_CRT2IsLCD(SiS_Pr)) { SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); SiS_PanelDelay(SiS_Pr, 0); } } temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ if(SiS_BridgeInSlavemode(SiS_Pr)) { tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); if(!(tempah & SetCRT2ToRAMDAC)) temp |= 0x20; } SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ if(SiS_Pr->ChipType >= SIS_315H) { temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); if(!(temp & 0x80)) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); /* BVBDOENABLE=1 */ } } SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ SiS_VBLongWait(SiS_Pr); SiS_DisplayOn(SiS_Pr); if(SiS_Pr->ChipType >= SIS_315H) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); } SiS_VBLongWait(SiS_Pr); if(SiS_Pr->ChipType < SIS_315H) { if(SiS_CRT2IsLCD(SiS_Pr)) { SiS_PanelDelay(SiS_Pr, 1); SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); } } } } else { /* =================== For LVDS ================== */ if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 /* 300 series */ if(SiS_CRT2IsLCD(SiS_Pr)) { if(SiS_Pr->ChipType == SIS_730) { SiS_PanelDelay(SiS_Pr, 1); SiS_PanelDelay(SiS_Pr, 1); SiS_PanelDelay(SiS_Pr, 1); } SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); if(!(SiS_CR36BIOSWord23d(SiS_Pr))) { SiS_PanelDelay(SiS_Pr, 0); } } SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); SiS_DisplayOn(SiS_Pr); SiS_UnLockCRT2(SiS_Pr); SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); if(SiS_BridgeInSlavemode(SiS_Pr)) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); } else { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); } if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { if(!(SiS_CRT2IsLCD(SiS_Pr))) { SiS_WaitVBRetrace(SiS_Pr); SiS_SetCH700x(SiS_Pr,0x0E,0x0B); } } if(SiS_CRT2IsLCD(SiS_Pr)) { if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { SiS_PanelDelay(SiS_Pr, 1); SiS_PanelDelay(SiS_Pr, 1); } SiS_WaitVBRetrace(SiS_Pr); SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); } } } #endif /* SIS300 */ } else { #ifdef SIS315H /* 315 series */ if(!(SiS_IsNotM650orLater(SiS_Pr))) { /*if(SiS_Pr->ChipType < SIS_340) {*/ /* XGI needs this */ SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x4c,0x18); /*}*/ } if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { if(SiS_CRT2IsLCD(SiS_Pr)) { SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); SiS_PanelDelay(SiS_Pr, 0); } } SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); SiS_UnLockCRT2(SiS_Pr); SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { temp = SiS_GetCH701x(SiS_Pr,0x66); temp &= 0x20; SiS_Chrontel701xBLOff(SiS_Pr); } if(SiS_Pr->ChipType != SIS_550) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); } if(SiS_Pr->ChipType == SIS_740) { if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { if(SiS_IsLCDOrLCDA(SiS_Pr)) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); } } } temp1 = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); if(!(temp1 & 0x80)) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); } if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { if(temp) { SiS_Chrontel701xBLOn(SiS_Pr); } } if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { if(SiS_CRT2IsLCD(SiS_Pr)) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); if(SiS_Pr->ChipType == SIS_550) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x40); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x10); } } } else if(SiS_IsVAMode(SiS_Pr)) { if(SiS_Pr->ChipType != SIS_740) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); } } if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); } if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { if(SiS_IsTVOrYPbPrOrScart(SiS_Pr)) { SiS_Chrontel701xOn(SiS_Pr); } if( (SiS_IsVAMode(SiS_Pr)) || (SiS_IsLCDOrLCDA(SiS_Pr)) ) { SiS_ChrontelDoSomething1(SiS_Pr); } } if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { if( (SiS_IsVAMode(SiS_Pr)) || (SiS_IsLCDOrLCDA(SiS_Pr)) ) { SiS_Chrontel701xBLOn(SiS_Pr); SiS_ChrontelInitTVVSync(SiS_Pr); } } } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { if(SiS_CRT2IsLCD(SiS_Pr)) { SiS_PanelDelay(SiS_Pr, 1); SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); } } } #endif /* SIS315H */ } /* 310 series */ } /* LVDS */ } /*********************************************/ /* SET PART 1 REGISTER GROUP */ /*********************************************/ /* Set CRT2 OFFSET / PITCH */ static void SiS_SetCRT2Offset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RRTI) { unsigned short offset; unsigned char temp; if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) return; offset = SiS_GetOffset(SiS_Pr,ModeNo,ModeIdIndex,RRTI); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,(offset & 0xFF)); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x09,(offset >> 8)); temp = (unsigned char)(((offset >> 3) & 0xFF) + 1); if(offset & 0x07) temp++; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,temp); } /* Set CRT2 sync and PanelLink mode */ static void SiS_SetCRT2Sync(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short RefreshRateTableIndex) { unsigned short tempah=0, tempbl, infoflag; tempbl = 0xC0; if(SiS_Pr->UseCustomMode) { infoflag = SiS_Pr->CInfoFlag; } else { infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag; } if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { /* LVDS */ if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { tempah = 0; } else if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->SiS_LCDInfo & LCDSync)) { tempah = SiS_Pr->SiS_LCDInfo; } else tempah = infoflag >> 8; tempah &= 0xC0; tempah |= 0x20; if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { tempah |= 0xf0; } if( (SiS_Pr->SiS_IF_DEF_FSTN) || (SiS_Pr->SiS_IF_DEF_DSTN) || (SiS_Pr->SiS_IF_DEF_TRUMPION) || (SiS_Pr->SiS_CustomT == CUT_PANEL848) || (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) { tempah |= 0x30; } if( (SiS_Pr->SiS_IF_DEF_FSTN) || (SiS_Pr->SiS_IF_DEF_DSTN) ) { tempah &= ~0xc0; } } if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { if(SiS_Pr->ChipType >= SIS_315H) { tempah >>= 3; tempah &= 0x18; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xE7,tempah); /* Don't care about 12/18/24 bit mode - TV is via VGA, not PL */ } else { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,0xe0); } } else { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); } } else if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 /* ---- 300 series --- */ if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* 630 - 301B(-DH) */ tempah = infoflag >> 8; tempbl = 0; if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { if(SiS_Pr->SiS_LCDInfo & LCDSync) { tempah = SiS_Pr->SiS_LCDInfo; tempbl = (tempah >> 6) & 0x03; } } tempah &= 0xC0; tempah |= 0x20; if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; tempah |= 0xc0; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); } } else { /* 630 - 301 */ tempah = ((infoflag >> 8) & 0xc0) | 0x20; if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); } #endif /* SIS300 */ } else { #ifdef SIS315H /* ------- 315 series ------ */ if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* 315 - LVDS */ tempbl = 0; if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) && (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { tempah = infoflag >> 8; if(SiS_Pr->SiS_LCDInfo & LCDSync) { tempbl = ((SiS_Pr->SiS_LCDInfo & 0xc0) >> 6); } } else if((SiS_Pr->SiS_CustomT == CUT_CLEVO1400) && (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050)) { tempah = infoflag >> 8; tempbl = 0x03; } else { tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); tempbl = (tempah >> 6) & 0x03; tempbl |= 0x08; if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempbl |= 0x04; } tempah &= 0xC0; tempah |= 0x20; if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) tempah |= 0xc0; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); } } } else { /* 315 - TMDS */ tempah = tempbl = infoflag >> 8; if(!SiS_Pr->UseCustomMode) { tempbl = 0; if((SiS_Pr->SiS_VBType & VB_SIS30xC) && (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { if(ModeNo <= 0x13) { tempah = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); } } if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { if(SiS_Pr->SiS_LCDInfo & LCDSync) { tempah = SiS_Pr->SiS_LCDInfo; tempbl = (tempah >> 6) & 0x03; } } } } tempah &= 0xC0; tempah |= 0x20; if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; if(SiS_Pr->SiS_VBType & VB_NoLCD) { /* Imitate BIOS bug */ if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempah |= 0xc0; } if((SiS_Pr->SiS_VBType & VB_SIS30xC) && (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { tempah >>= 3; tempah &= 0x18; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xe7,tempah); } else { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); } } } } #endif /* SIS315H */ } } } /* Set CRT2 FIFO on 300/540/630/730 */ #ifdef SIS300 static void SiS_SetCRT2FIFO_300(struct SiS_Private *SiS_Pr,unsigned short ModeNo) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short temp, index, modeidindex, refreshratetableindex; unsigned short VCLK = 0, MCLK, colorth = 0, data2 = 0; unsigned short tempbx, tempcl, CRT1ModeNo, CRT2ModeNo, SelectRate_backup; unsigned int data, pci50, pciA0; static const unsigned char colortharray[] = { 1, 1, 2, 2, 3, 4 }; SelectRate_backup = SiS_Pr->SiS_SelectCRT2Rate; if(!SiS_Pr->CRT1UsesCustomMode) { CRT1ModeNo = SiS_Pr->SiS_CRT1Mode; /* get CRT1 ModeNo */ SiS_SearchModeID(SiS_Pr, &CRT1ModeNo, &modeidindex); SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); SiS_Pr->SiS_SelectCRT2Rate = 0; refreshratetableindex = SiS_GetRatePtr(SiS_Pr, CRT1ModeNo, modeidindex); if(CRT1ModeNo >= 0x13) { /* Get VCLK */ index = SiS_GetRefCRTVCLK(SiS_Pr, refreshratetableindex, SiS_Pr->SiS_UseWide); VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; /* Get colordepth */ colorth = SiS_GetColorDepth(SiS_Pr,CRT1ModeNo,modeidindex) >> 1; if(!colorth) colorth++; } } else { CRT1ModeNo = 0xfe; /* Get VCLK */ VCLK = SiS_Pr->CSRClock_CRT1; /* Get color depth */ colorth = colortharray[((SiS_Pr->CModeFlag_CRT1 & ModeTypeMask) - 2)]; } if(CRT1ModeNo >= 0x13) { /* Get MCLK */ if(SiS_Pr->ChipType == SIS_300) { index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x3A); } else { index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1A); } index &= 0x07; MCLK = SiS_Pr->SiS_MCLKData_0[index].CLOCK; temp = ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) >> 6) & 0x03) << 1; if(!temp) temp++; temp <<= 2; data2 = temp - ((colorth * VCLK) / MCLK); temp = (28 * 16) % data2; data2 = (28 * 16) / data2; if(temp) data2++; if(SiS_Pr->ChipType == SIS_300) { SiS_GetFIFOThresholdIndex300(SiS_Pr, &tempbx, &tempcl); data = SiS_GetFIFOThresholdB300(tempbx, tempcl); } else { #ifdef SIS_LINUX_KERNEL pci50 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50); pciA0 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xa0); #else pci50 = sis_pci_read_host_bridge_u32(0x50); pciA0 = sis_pci_read_host_bridge_u32(0xA0); #endif if(SiS_Pr->ChipType == SIS_730) { index = (unsigned short)(((pciA0 >> 28) & 0x0f) * 3); index += (unsigned short)(((pci50 >> 9)) & 0x03); /* BIOS BUG (2.04.5d, 2.04.6a use ah here, which is unset!) */ index = 0; /* -- do it like the BIOS anyway... */ } else { pci50 >>= 24; pciA0 >>= 24; index = (pci50 >> 1) & 0x07; if(pci50 & 0x01) index += 6; if(!(pciA0 & 0x01)) index += 24; if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x80) index += 12; } data = SiS_GetLatencyFactor630(SiS_Pr, index) + 15; if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x80)) data += 5; } data += data2; /* CRT1 Request Period */ SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup; if(!SiS_Pr->UseCustomMode) { CRT2ModeNo = ModeNo; SiS_SearchModeID(SiS_Pr, &CRT2ModeNo, &modeidindex); refreshratetableindex = SiS_GetRatePtr(SiS_Pr, CRT2ModeNo, modeidindex); /* Get VCLK */ index = SiS_GetVCLK2Ptr(SiS_Pr, CRT2ModeNo, modeidindex, refreshratetableindex); VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { if(SiS_Pr->SiS_UseROM) { if(ROMAddr[0x220] & 0x01) { VCLK = ROMAddr[0x229] | (ROMAddr[0x22a] << 8); } } } } else { /* Get VCLK */ CRT2ModeNo = 0xfe; VCLK = SiS_Pr->CSRClock; } /* Get colordepth */ colorth = SiS_GetColorDepth(SiS_Pr,CRT2ModeNo,modeidindex) >> 1; if(!colorth) colorth++; data = data * VCLK * colorth; temp = data % (MCLK << 4); data = data / (MCLK << 4); if(temp) data++; if(data < 6) data = 6; else if(data > 0x14) data = 0x14; if(SiS_Pr->ChipType == SIS_300) { temp = 0x16; if((data <= 0x0f) || (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) temp = 0x13; } else { temp = 0x16; if(( (SiS_Pr->ChipType == SIS_630) || (SiS_Pr->ChipType == SIS_730) ) && (SiS_Pr->ChipRevision >= 0x30)) temp = 0x1b; } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0xe0,temp); if((SiS_Pr->ChipType == SIS_630) && (SiS_Pr->ChipRevision >= 0x30)) { if(data > 0x13) data = 0x13; } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,0xe0,data); } else { /* If mode <= 0x13, we just restore everything */ SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup; } } #endif /* Set CRT2 FIFO on 315/330 series */ #ifdef SIS315H static void SiS_SetCRT2FIFO_310(struct SiS_Private *SiS_Pr) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3B); if( (SiS_Pr->ChipType == SIS_760) && (SiS_Pr->SiS_SysFlags & SF_760LFB) && (SiS_Pr->SiS_ModeType == Mode32Bpp) && (SiS_Pr->SiS_VGAHDE >= 1280) && (SiS_Pr->SiS_VGAVDE >= 1024) ) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x03); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3b); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x01); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,0x6e); } else { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,~0x3f,0x04); } } #endif static unsigned short SiS_GetVGAHT2(struct SiS_Private *SiS_Pr) { unsigned int tempax,tempbx; tempbx = (SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) * SiS_Pr->SiS_RVBHCMAX; tempax = (SiS_Pr->SiS_VT - SiS_Pr->SiS_VDE) * SiS_Pr->SiS_RVBHCFACT; tempax = (tempax * SiS_Pr->SiS_HT) / tempbx; return (unsigned short)tempax; } /* Set Part 1 / SiS bridge slave mode */ static void SiS_SetGroup1_301(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short temp, modeflag, i, j, xres=0, VGAVDE; static const unsigned short CRTranslation[] = { /* CR0 CR1 CR2 CR3 CR4 CR5 CR6 CR7 */ 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, /* CR8 CR9 SR0A SR0B SR0C SR0D SR0E CR0F */ 0x00, 0x0b, 0x17, 0x18, 0x19, 0x00, 0x1a, 0x00, /* CR10 CR11 CR12 CR13 CR14 CR15 CR16 CR17 */ 0x0c, 0x0d, 0x0e, 0x00, 0x0f, 0x10, 0x11, 0x00 }; if(ModeNo <= 0x13) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; } else if(SiS_Pr->UseCustomMode) { modeflag = SiS_Pr->CModeFlag; xres = SiS_Pr->CHDisplay; } else { modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; xres = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes; } /* The following is only done if bridge is in slave mode: */ if(SiS_Pr->ChipType >= SIS_315H) { if(xres >= 1600) { /* BIOS: == 1600 */ SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x31,0x04); } } SiS_Pr->CHTotal = 8224; /* Max HT, 0x2020, results in 0x3ff in registers */ SiS_Pr->CHDisplay = SiS_Pr->SiS_VGAHDE; if(modeflag & HalfDCLK) SiS_Pr->CHDisplay >>= 1; SiS_Pr->CHBlankStart = SiS_Pr->CHDisplay; if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { SiS_Pr->CHBlankStart += 16; } SiS_Pr->CHBlankEnd = 32; if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { if(xres == 1600) SiS_Pr->CHBlankEnd += 80; } temp = SiS_Pr->SiS_VGAHT - 96; if(!(modeflag & HalfDCLK)) temp -= 32; if(SiS_Pr->SiS_LCDInfo & LCDPass11) { temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x04); temp |= ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x0b) & 0xc0) << 2); temp -= 3; temp <<= 3; } else { if(SiS_Pr->SiS_RVBHRS2) temp = SiS_Pr->SiS_RVBHRS2; } SiS_Pr->CHSyncStart = temp; SiS_Pr->CHSyncEnd = 0xffe8; /* results in 0x2000 in registers */ SiS_Pr->CVTotal = 2049; /* Max VT, 0x0801, results in 0x7ff in registers */ VGAVDE = SiS_Pr->SiS_VGAVDE; if (VGAVDE == 357) VGAVDE = 350; else if(VGAVDE == 360) VGAVDE = 350; else if(VGAVDE == 375) VGAVDE = 350; else if(VGAVDE == 405) VGAVDE = 400; else if(VGAVDE == 420) VGAVDE = 400; else if(VGAVDE == 525) VGAVDE = 480; else if(VGAVDE == 1056) VGAVDE = 1024; SiS_Pr->CVDisplay = VGAVDE; SiS_Pr->CVBlankStart = SiS_Pr->CVDisplay; SiS_Pr->CVBlankEnd = 1; if(ModeNo == 0x3c) SiS_Pr->CVBlankEnd = 226; temp = (SiS_Pr->SiS_VGAVT - VGAVDE) >> 1; SiS_Pr->CVSyncStart = VGAVDE + temp; temp >>= 3; SiS_Pr->CVSyncEnd = SiS_Pr->CVSyncStart + temp; SiS_CalcCRRegisters(SiS_Pr, 0); SiS_Pr->CCRT1CRTC[16] &= ~0xE0; for(i = 0; i <= 7; i++) { SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[i]); } for(i = 0x10, j = 8; i <= 0x12; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[j]); } for(i = 0x15, j = 11; i <= 0x16; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[j]); } for(i = 0x0a, j = 13; i <= 0x0c; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[j]); } temp = SiS_Pr->CCRT1CRTC[16] & 0xE0; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,CRTranslation[0x0E],0x1F,temp); temp = (SiS_Pr->CCRT1CRTC[16] & 0x01) << 5; if(modeflag & DoubleScanMode) temp |= 0x80; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,CRTranslation[0x09],0x5F,temp); temp = 0; temp |= (SiS_GetReg(SiS_Pr->SiS_P3c4,0x01) & 0x01); if(modeflag & HalfDCLK) temp |= 0x08; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* SR01: HalfDCLK[3], 8/9 div dotclock[0] */ SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,0x00); /* CR14: (text mode: underline location) */ SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,0x00); /* CR17: n/a */ temp = 0; if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { temp = (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) << 7; } SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* SR0E, dither[7] */ temp = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); /* ? */ #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "%d %d %d %d %d %d %d %d (%d %d %d %d)\n", SiS_Pr->CHDisplay, SiS_Pr->CHSyncStart, SiS_Pr->CHSyncEnd, SiS_Pr->CHTotal, SiS_Pr->CVDisplay, SiS_Pr->CVSyncStart, SiS_Pr->CVSyncEnd, SiS_Pr->CVTotal, SiS_Pr->CHBlankStart, SiS_Pr->CHBlankEnd, SiS_Pr->CVBlankStart, SiS_Pr->CVBlankEnd); xf86DrvMsg(0, X_INFO, " {{0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", SiS_Pr->CCRT1CRTC[0], SiS_Pr->CCRT1CRTC[1], SiS_Pr->CCRT1CRTC[2], SiS_Pr->CCRT1CRTC[3], SiS_Pr->CCRT1CRTC[4], SiS_Pr->CCRT1CRTC[5], SiS_Pr->CCRT1CRTC[6], SiS_Pr->CCRT1CRTC[7]); xf86DrvMsg(0, X_INFO, " 0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", SiS_Pr->CCRT1CRTC[8], SiS_Pr->CCRT1CRTC[9], SiS_Pr->CCRT1CRTC[10], SiS_Pr->CCRT1CRTC[11], SiS_Pr->CCRT1CRTC[12], SiS_Pr->CCRT1CRTC[13], SiS_Pr->CCRT1CRTC[14], SiS_Pr->CCRT1CRTC[15]); xf86DrvMsg(0, X_INFO, " 0x%02x}},\n", SiS_Pr->CCRT1CRTC[16]); #endif #endif } /* Setup panel link * This is used for LVDS, LCDA and Chrontel TV output * 300/LVDS+TV, 300/301B-DH, 315/LVDS+TV, 315/LCDA */ static void SiS_SetGroup1_LVDS(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short modeflag, resinfo = 0; unsigned short push2, tempax, tempbx, tempcx, temp; unsigned int tempeax = 0, tempebx, tempecx, tempvcfact = 0; BOOLEAN islvds = FALSE, issis = FALSE, chkdclkfirst = FALSE; BOOLEAN lvds550 = FALSE; #ifdef SIS300 unsigned short crt2crtc = 0; #endif #ifdef SIS315H unsigned short pushcx; #endif if(ModeNo <= 0x13) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; #ifdef SIS300 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; #endif } else if(SiS_Pr->UseCustomMode) { modeflag = SiS_Pr->CModeFlag; } else { modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; #ifdef SIS300 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; #endif } /* is lvds if really LVDS, or 301B-DH with external LVDS transmitter */ if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { islvds = TRUE; } if(SiS_Pr->ChipType == SIS_550 && SiS_Pr->SiS_IF_DEF_LVDS && !SiS_Pr->SiS_IF_DEF_FSTN && !SiS_Pr->SiS_IF_DEF_DSTN) { lvds550 = TRUE; } /* is really sis if sis bridge, but not 301B-DH */ if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { issis = TRUE; } if((SiS_Pr->ChipType >= SIS_315H) && (islvds) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA))) { if(!SiS_Pr->SiS_IF_DEF_FSTN && !SiS_Pr->SiS_IF_DEF_DSTN && !lvds550) { chkdclkfirst = TRUE; } } #ifdef SIS315H if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { if(IS_SIS330) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); } else if(IS_SIS740) { if(islvds) { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x03); } else if(SiS_Pr->SiS_VBType & VB_SISVB) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); } } else { if(islvds) { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x00); } else if(SiS_Pr->SiS_VBType & VB_SISVB) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2D,0x0f); if(SiS_Pr->SiS_VBType & VB_SIS30xC) { if((SiS_Pr->SiS_LCDResInfo == Panel_1024x768) || (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x20); } } } } } #endif /* Horizontal */ tempax = SiS_Pr->SiS_LCDHDES; if(islvds) { if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(!SiS_Pr->SiS_IF_DEF_FSTN && !SiS_Pr->SiS_IF_DEF_DSTN && !lvds550) { if((SiS_Pr->SiS_LCDResInfo == Panel_640x480) && (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))) { tempax -= 8; } } } } temp = (tempax & 0x0007); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* BPLHDESKEW[2:0] */ temp = (tempax >> 3) & 0x00FF; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* BPLHDESKEW[10:3] */ tempbx = SiS_Pr->SiS_HDE; if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { tempbx = SiS_Pr->PanelXRes; } if((SiS_Pr->SiS_LCDResInfo == Panel_320x240_1) || (SiS_Pr->SiS_LCDResInfo == Panel_320x240_2) || (SiS_Pr->SiS_LCDResInfo == Panel_320x240_3)) { tempbx >>= 1; } } tempax += tempbx; if(tempax >= SiS_Pr->SiS_HT) tempax -= SiS_Pr->SiS_HT; temp = tempax; if(temp & 0x07) temp += 8; temp >>= 3; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp); /* BPLHDEE */ tempcx = (SiS_Pr->SiS_HT - tempbx) >> 2; if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { if(SiS_Pr->PanelHRS != 999) tempcx = SiS_Pr->PanelHRS; } } tempcx += tempax; if(tempcx >= SiS_Pr->SiS_HT) tempcx -= SiS_Pr->SiS_HT; temp = (tempcx >> 3) & 0x00FF; if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(SiS_Pr->SiS_IF_DEF_TRUMPION) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { switch(ModeNo) { case 0x04: case 0x05: case 0x0d: temp = 0x56; break; case 0x10: temp = 0x60; break; case 0x13: temp = 0x5f; break; case 0x40: case 0x41: case 0x4f: case 0x43: case 0x44: case 0x62: case 0x56: case 0x53: case 0x5d: case 0x5e: temp = 0x54; break; } } } } SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,temp); /* BPLHRS */ if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { temp += 2; if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { temp += 8; if(SiS_Pr->PanelHRE != 999) { temp = tempcx + SiS_Pr->PanelHRE; if(temp >= SiS_Pr->SiS_HT) temp -= SiS_Pr->SiS_HT; temp >>= 3; } } } else { temp += 10; } temp &= 0x1F; temp |= ((tempcx & 0x07) << 5); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,temp); /* BPLHRE */ /* Vertical */ tempax = SiS_Pr->SiS_VGAVDE; if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { tempax = SiS_Pr->PanelYRes; } } tempbx = SiS_Pr->SiS_LCDVDES + tempax; if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT; push2 = tempbx; tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE; if((SiS_Pr->ChipType < SIS_315H) || lvds550) { if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->PanelYRes; } } } if(islvds) tempcx >>= 1; else tempcx >>= 2; if( (SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) && (SiS_Pr->PanelVRS != 999) ) { tempcx = SiS_Pr->PanelVRS; tempbx += tempcx; if(issis || lvds550) tempbx++; } else { tempbx += tempcx; if(SiS_Pr->ChipType < SIS_315H) tempbx++; else if(issis || lvds550) tempbx++; } if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT; temp = tempbx & 0x00FF; if(SiS_Pr->SiS_IF_DEF_TRUMPION) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if(ModeNo == 0x10) temp = 0xa9; } } SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); /* BPLVRS */ tempcx >>= 3; tempcx++; if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { if(SiS_Pr->PanelVRE != 999) tempcx = SiS_Pr->PanelVRE; } } tempcx += tempbx; temp = tempcx & 0x000F; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp); /* BPLVRE */ temp = ((tempbx >> 8) & 0x07) << 3; if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN || lvds550) { if(SiS_Pr->SiS_HDE != 640) { if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; } } else if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) temp |= 0x40; tempbx = 0x87; if((SiS_Pr->ChipType >= SIS_315H) || (SiS_Pr->ChipRevision >= 0x30)) { tempbx = 0x07; if((SiS_Pr->SiS_IF_DEF_CH70xx == 1) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x03) temp |= 0x80; } /* Chrontel 701x operates in 24bit mode (8-8-8, 2x12bit multiplexed) via VGA2 */ if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x10) temp |= 0x80; } else { if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) temp |= 0x80; } } } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,tempbx,temp); tempbx = push2; /* BPLVDEE */ tempcx = SiS_Pr->SiS_LCDVDES; /* BPLVDES */ if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { switch(SiS_Pr->SiS_LCDResInfo) { case Panel_640x480: tempbx = SiS_Pr->SiS_VGAVDE - 1; tempcx = SiS_Pr->SiS_VGAVDE; break; case Panel_800x600: if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { if(resinfo == SIS_RI_800x600) tempcx++; } break; case Panel_1024x600: if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { if(resinfo == SIS_RI_1024x600) tempcx++; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { if(resinfo == SIS_RI_800x600) tempcx++; } } break; case Panel_1024x768: if(SiS_Pr->ChipType < SIS_315H) { if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { if(resinfo == SIS_RI_1024x768) tempcx++; } } break; } } temp = ((tempbx >> 8) & 0x07) << 3; temp |= ((tempcx >> 8) & 0x07); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1D,temp); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1C,tempbx); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1B,tempcx); /* Vertical scaling */ if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 /* 300 series */ tempeax = SiS_Pr->SiS_VGAVDE << 6; temp = (tempeax % (unsigned int)SiS_Pr->SiS_VDE); tempeax = tempeax / (unsigned int)SiS_Pr->SiS_VDE; if(temp) tempeax++; if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) tempeax = 0x3F; temp = (unsigned short)(tempeax & 0x00FF); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp); /* BPLVCFACT */ tempvcfact = temp; #endif /* SIS300 */ } else { #ifdef SIS315H /* 315 series */ tempeax = SiS_Pr->SiS_VGAVDE << 18; tempebx = SiS_Pr->SiS_VDE; temp = (tempeax % tempebx); tempeax = tempeax / tempebx; if(temp) tempeax++; tempvcfact = tempeax; temp = (unsigned short)(tempeax & 0x00FF); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,temp); temp = (unsigned short)((tempeax & 0x00FF00) >> 8); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,temp); temp = (unsigned short)((tempeax & 0x00030000) >> 16); if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,temp); if(SiS_Pr->SiS_VBType & VB_SISPART4SCALER) { temp = (unsigned short)(tempeax & 0x00FF); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3c,temp); temp = (unsigned short)((tempeax & 0x00FF00) >> 8); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3b,temp); temp = (unsigned short)(((tempeax & 0x00030000) >> 16) << 6); SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0x3f,temp); temp = 0; if(SiS_Pr->SiS_VDE != SiS_Pr->SiS_VGAVDE) temp |= 0x08; SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x30,0xf3,temp); } #endif } /* Horizontal scaling */ tempeax = SiS_Pr->SiS_VGAHDE; /* 1f = ( (VGAHDE * 65536) / ( (VGAHDE * 65536) / HDE ) ) - 1*/ if(chkdclkfirst) { if(modeflag & HalfDCLK) tempeax >>= 1; } tempebx = tempeax << 16; if(SiS_Pr->SiS_HDE == tempeax) { tempecx = 0xFFFF; } else { tempecx = tempebx / SiS_Pr->SiS_HDE; if(SiS_Pr->ChipType >= SIS_315H) { if(tempebx % SiS_Pr->SiS_HDE) tempecx++; } } if(SiS_Pr->ChipType >= SIS_315H) { tempeax = (tempebx / tempecx) - 1; } else { tempeax = ((SiS_Pr->SiS_VGAHT << 16) / tempecx) - 1; } tempecx = (tempecx << 16) | (tempeax & 0xFFFF); temp = (unsigned short)(tempecx & 0x00FF); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1F,temp); if(SiS_Pr->ChipType >= SIS_315H) { tempeax = (SiS_Pr->SiS_VGAVDE << 18) / tempvcfact; tempbx = (unsigned short)(tempeax & 0xFFFF); } else { tempeax = SiS_Pr->SiS_VGAVDE << 6; tempbx = tempvcfact & 0x3f; if(tempbx == 0) tempbx = 64; tempeax /= tempbx; tempbx = (unsigned short)(tempeax & 0xFFFF); } if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tempbx--; if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) { if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) tempbx = 1; else if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) tempbx = 1; } temp = ((tempbx >> 8) & 0x07) << 3; temp = temp | ((tempecx >> 8) & 0x07); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x20,temp); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x21,tempbx); tempecx >>= 16; /* BPLHCFACT */ if(!chkdclkfirst) { if(modeflag & HalfDCLK) tempecx >>= 1; } temp = (unsigned short)((tempecx & 0xFF00) >> 8); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x22,temp); temp = (unsigned short)(tempecx & 0x00FF); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp); #ifdef SIS315H if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { if((islvds) || (SiS_Pr->SiS_VBInfo & VB_SISLVDS)) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x20); } } else { if(islvds) { if(SiS_Pr->ChipType == SIS_740) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); } else { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x23); } } } } #endif #ifdef SIS300 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned char *trumpdata; int i, j = crt2crtc; unsigned char TrumpMode13[4] = { 0x01, 0x10, 0x2c, 0x00 }; unsigned char TrumpMode10_1[4] = { 0x01, 0x10, 0x27, 0x00 }; unsigned char TrumpMode10_2[4] = { 0x01, 0x16, 0x10, 0x00 }; if(SiS_Pr->SiS_UseROM) { trumpdata = &ROMAddr[0x8001 + (j * 80)]; } else { if(SiS_Pr->SiS_LCDTypeInfo == 0x0e) j += 7; trumpdata = &SiS300_TrumpionData[j][0]; } SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xbf); for(i=0; i<5; i++) { SiS_SetTrumpionBlock(SiS_Pr, trumpdata); } if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if(ModeNo == 0x13) { for(i=0; i<4; i++) { SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode13[0]); } } else if(ModeNo == 0x10) { for(i=0; i<4; i++) { SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_1[0]); SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_2[0]); } } } SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); } #endif #ifdef SIS315H if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x25,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x26,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x27,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x28,0x87); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x29,0x5A); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2A,0x4B); SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x07,0x03); tempax = SiS_Pr->SiS_HDE; /* Blps = lcdhdee(lcdhdes+HDE) + 64 */ if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; tempax += 64; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,tempax & 0xff); temp = (tempax >> 8) << 3; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,~0x078,temp); tempax += 32; /* Blpe = lBlps+32 */ SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,tempax & 0xff); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3A,0x00); /* Bflml = 0 */ SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x3C,~0x007); tempax = SiS_Pr->SiS_VDE; if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; tempax >>= 1; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3B,tempax & 0xff); temp = (tempax >> 8) << 3; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x038,temp); tempeax = SiS_Pr->SiS_HDE; if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempeax >>= 1; tempeax <<= 2; /* BDxFIFOSTOP = (HDE*4)/128 */ temp = tempeax & 0x7f; tempeax >>= 7; if(temp) tempeax++; temp = tempeax & 0x3f; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,temp); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3F,0x00); /* BDxWadrst0 */ SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3E,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3D,0x10); SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x3C,~0x040); tempax = SiS_Pr->SiS_HDE; if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; tempax >>= 4; /* BDxWadroff = HDE*4/8/8 */ pushcx = tempax; temp = tempax & 0x00FF; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,temp); temp = ((tempax & 0xFF00) >> 8) << 3; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x0F8,temp); tempax = SiS_Pr->SiS_VDE; /* BDxWadrst1 = BDxWadrst0 + BDxWadroff * VDE */ if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; tempeax = tempax * pushcx; temp = tempeax & 0xFF; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,temp); temp = (tempeax & 0xFF00) >> 8; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,temp); temp = ((tempeax & 0xFF0000) >> 16) | 0x10; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,temp); temp = ((tempeax & 0x01000000) >> 24) << 7; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x080,temp); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x03); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0x50); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x04,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x01); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0x38); if(SiS_Pr->SiS_IF_DEF_FSTN) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2b,0x02); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2c,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,0x0c); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,0x80); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,0xA0); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3a,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3b,0xf0); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3c,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3d,0x10); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3e,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3f,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,0x10); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,0x25); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,0x80); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,0x14); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x44,0x03); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,0x0a); } } #endif /* SIS315H */ } /* Set Part 1 */ static void SiS_SetGroup1(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { #if defined(SIS300) || defined(SIS315H) unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; #endif unsigned short temp=0, tempax=0, tempbx=0, tempcx=0, bridgeadd=0; unsigned short pushbx=0, CRT1Index=0, modeflag, resinfo=0, lvds550=0; #ifdef SIS315H unsigned short tempbl=0; #endif if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); return; } if(ModeNo <= 0x13) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; } else if(SiS_Pr->UseCustomMode) { modeflag = SiS_Pr->CModeFlag; } else { CRT1Index = SiS_GetRefCRT1CRTC(SiS_Pr, RefreshRateTableIndex, SiS_Pr->SiS_UseWideCRT2); resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; } if(SiS_Pr->ChipType == SIS_550 && SiS_Pr->SiS_IF_DEF_LVDS && !SiS_Pr->SiS_IF_DEF_DSTN && !SiS_Pr->SiS_IF_DEF_FSTN) { lvds550 = 1; } SiS_SetCRT2Offset(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); if( ! ((SiS_Pr->ChipType >= SIS_315H) && (!lvds550) && (SiS_Pr->SiS_IF_DEF_LVDS == 1) && (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) { if(SiS_Pr->ChipType < SIS_315H ) { #ifdef SIS300 SiS_SetCRT2FIFO_300(SiS_Pr, ModeNo); #endif } else { #ifdef SIS315H SiS_SetCRT2FIFO_310(SiS_Pr); #endif } /* 1. Horizontal setup */ if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 /* ------------- 300 series --------------*/ temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp); /* CRT2 Horizontal Total */ temp = (((SiS_Pr->SiS_VGAHT - 1) & 0xFF00) >> 8) << 4; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0f,temp); /* CRT2 Horizontal Total Overflow [7:4] */ temp = (SiS_Pr->SiS_VGAHDE + 12) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */ SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp); /* CRT2 Horizontal Display Enable End */ pushbx = SiS_Pr->SiS_VGAHDE + 12; /* bx BTVGA2HRS 0x0B,0x0C */ tempcx = (SiS_Pr->SiS_VGAHT - SiS_Pr->SiS_VGAHDE) >> 2; tempbx = pushbx + tempcx; tempcx <<= 1; tempcx += tempbx; bridgeadd = 12; #endif /* SIS300 */ } else { #ifdef SIS315H /* ------------------- 315/330 series --------------- */ tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HT 0x08,0x09 */ if(modeflag & HalfDCLK) { if((SiS_Pr->SiS_VBType & VB_SISVB) || lvds550) { tempcx >>= 1; } else { tempax = SiS_Pr->SiS_VGAHDE >> 1; tempcx = SiS_Pr->SiS_HT - SiS_Pr->SiS_HDE + tempax; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { tempcx = SiS_Pr->SiS_HT - tempax; } } } tempcx--; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,tempcx); /* CRT2 Horizontal Total */ temp = (tempcx >> 4) & 0xF0; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0F,temp); /* CRT2 Horizontal Total Overflow [7:4] */ tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HDEE 0x0A,0x0C */ tempbx = SiS_Pr->SiS_VGAHDE; tempcx -= tempbx; tempcx >>= 2; if(modeflag & HalfDCLK) { tempbx >>= 1; tempcx >>= 1; } tempbx += 16; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,tempbx); /* CRT2 Horizontal Display Enable End */ pushbx = tempbx; if(!lvds550) tempcx >>= 1; tempbx += tempcx; tempcx += tempbx; if(lvds550) tempcx += 20; bridgeadd = 16; if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->ChipType >= SIS_661) { if((SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) || (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { if(resinfo == SIS_RI_1280x1024) { tempcx = (tempcx & 0xff00) | 0x30; } else if(resinfo == SIS_RI_1600x1200) { tempcx = (tempcx & 0xff00) | 0xff; } } } } #endif /* SIS315H */ } /* 315/330 series */ if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->UseCustomMode) { tempbx = SiS_Pr->CHSyncStart + bridgeadd; tempcx = SiS_Pr->CHSyncEnd + bridgeadd; tempax = SiS_Pr->SiS_VGAHT; if(modeflag & HalfDCLK) tempax >>= 1; tempax--; if(tempcx > tempax) tempcx = tempax; } if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { unsigned char cr4, cr14, cr5, cr15; if(SiS_Pr->UseCustomMode) { cr4 = SiS_Pr->CCRT1CRTC[4]; cr14 = SiS_Pr->CCRT1CRTC[14]; cr5 = SiS_Pr->CCRT1CRTC[5]; cr15 = SiS_Pr->CCRT1CRTC[15]; } else { cr4 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[4]; cr14 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14]; cr5 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[5]; cr15 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[15]; } tempbx = ((cr4 | ((cr14 & 0xC0) << 2)) - 3) << 3; /* (VGAHRS-3)*8 */ tempcx = (((cr5 & 0x1f) | ((cr15 & 0x04) << (5-2))) - 3) << 3; /* (VGAHRE-3)*8 */ tempcx &= 0x00FF; tempcx |= (tempbx & 0xFF00); tempbx += bridgeadd; tempcx += bridgeadd; tempax = SiS_Pr->SiS_VGAHT; if(modeflag & HalfDCLK) tempax >>= 1; tempax--; if(tempcx > tempax) tempcx = tempax; } if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSet525p1024)) { tempbx = 1040; tempcx = 1044; /* HWCursor bug! */ } } SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,tempbx); /* CRT2 Horizontal Retrace Start */ SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0D,tempcx); /* CRT2 Horizontal Retrace End */ temp = ((tempbx >> 8) & 0x0F) | ((pushbx >> 4) & 0xF0); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0C,temp); /* Overflow */ /* 2. Vertical setup */ tempcx = SiS_Pr->SiS_VGAVT - 1; temp = tempcx & 0x00FF; if((SiS_Pr->ChipType < SIS_661) && !lvds550) { if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { if(SiS_Pr->ChipType < SIS_315H) { if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) { temp--; } } } else { temp--; } } else if(SiS_Pr->ChipType >= SIS_315H) { temp--; } } SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0E,temp); /* CRT2 Vertical Total */ tempbx = SiS_Pr->SiS_VGAVDE - 1; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,tempbx); /* CRT2 Vertical Display Enable End */ temp = ((tempbx >> 5) & 0x38) | ((tempcx >> 8) & 0x07); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,temp); /* Overflow */ if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661) && !lvds550) { tempcx = (SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 2; tempbx = SiS_Pr->SiS_VGAVDE + tempcx; if(tempcx < 4) tempcx = 4; tempcx = (tempcx >> 2) + tempbx + 1; } else { tempbx = (SiS_Pr->SiS_VGAVT + SiS_Pr->SiS_VGAVDE) >> 1; /* BTVGA2VRS 0x10,0x11 */ tempcx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 4) + tempbx + 1; /* BTVGA2VRE 0x11 */ } if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->UseCustomMode) { tempbx = SiS_Pr->CVSyncStart; tempcx = SiS_Pr->CVSyncEnd; } if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { unsigned char cr8, cr7, cr13; if(SiS_Pr->UseCustomMode) { cr8 = SiS_Pr->CCRT1CRTC[8]; cr7 = SiS_Pr->CCRT1CRTC[7]; cr13 = SiS_Pr->CCRT1CRTC[13]; tempcx = SiS_Pr->CCRT1CRTC[9]; } else { cr8 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[8]; cr7 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[7]; cr13 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[13]; tempcx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[9]; } tempbx = cr8; if(cr7 & 0x04) tempbx |= 0x0100; if(cr7 & 0x80) tempbx |= 0x0200; if(cr13 & 0x08) tempbx |= 0x0400; } } SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,tempbx); /* CRT2 Vertical Retrace Start */ temp = ((tempbx >> 4) & 0x70) | (tempcx & 0x0F); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x11,temp); /* CRT2 Vert. Retrace End; Overflow */ /* 3. Panel delay compensation */ if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 /* ---------- 300 series -------------- */ if(SiS_Pr->SiS_VBType & VB_SISVB) { temp = 0x20; if(SiS_Pr->ChipType == SIS_300) { temp = 0x10; if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) temp = 0x2c; if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; } if(SiS_Pr->SiS_VBType & VB_SIS301) { if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; } if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) temp = 0x24; if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) temp = 0x2c; if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x08; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) temp = 0x2c; else temp = 0x20; } if(SiS_Pr->SiS_UseROM) { if(ROMAddr[0x220] & 0x80) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) temp = ROMAddr[0x221]; else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp = ROMAddr[0x222]; else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = ROMAddr[0x223]; else temp = ROMAddr[0x224]; } } if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { if(SiS_Pr->PDC != -1) temp = SiS_Pr->PDC; } } else { temp = 0x20; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) temp = 0x04; } if(SiS_Pr->SiS_UseROM) { if(ROMAddr[0x220] & 0x80) { temp = ROMAddr[0x220]; } } if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { if(SiS_Pr->PDC != -1) temp = SiS_Pr->PDC; } } temp &= 0x3c; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* Panel Link Delay Compensation; (Software Command Reset; Power Saving) */ #endif /* SIS300 */ } else { #ifdef SIS315H /* --------------- 315/330 series ---------------*/ if(SiS_Pr->ChipType < SIS_661) { if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { if(SiS_Pr->ChipType == SIS_740) temp = 0x03; else temp = 0x00; if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x0a; tempbl = 0xF0; if(SiS_Pr->ChipType == SIS_650) { if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempbl = 0x0F; } } if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN || lvds550) { temp = 0x08; tempbl = 0; if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { if(ROMAddr[0x13c] & 0x80) tempbl = 0xf0; } } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,tempbl,temp); /* Panel Link Delay Compensation */ } } /* < 661 */ tempax = 0; if(modeflag & DoubleScanMode) tempax |= 0x80; if(modeflag & HalfDCLK) tempax |= 0x40; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax); #endif /* SIS315H */ } } /* Slavemode */ if(SiS_Pr->SiS_VBType & VB_SISVB) { if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { /* For 301BDH with LCD, we set up the Panel Link */ SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { SiS_SetGroup1_301(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } } else { if(SiS_Pr->ChipType < SIS_315H) { SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } else { if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if((!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) || (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } } else { SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } } } } /*********************************************/ /* SET PART 2 REGISTER GROUP */ /*********************************************/ #ifdef SIS315H static BOOLEAN SiS_GetCRT2Part2Ptr(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex,unsigned short *CRT2Index, unsigned short *ResIndex) { if(SiS_Pr->ChipType < SIS_315H) return FALSE; if(ModeNo <= 0x13) (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; else (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; (*ResIndex) &= 0x3f; (*CRT2Index) = 0; if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { (*CRT2Index) = 200; } } if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if(SiS_Pr->SiS_SetFlag & LCDVESATiming) (*CRT2Index) = 206; } } return (((*CRT2Index) != 0)); } #endif #ifdef SIS300 static void SiS_Group2LCDSpecial(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short crt2crtc) { unsigned short tempcx; static const unsigned char atable[] = { 0xc3,0x9e,0xc3,0x9e,0x02,0x02,0x02, 0xab,0x87,0xab,0x9e,0xe7,0x02,0x02 }; if(!SiS_Pr->UseCustomMode) { if( ( ( (SiS_Pr->ChipType == SIS_630) || (SiS_Pr->ChipType == SIS_730) ) && (SiS_Pr->ChipRevision > 2) ) && (SiS_Pr->SiS_LCDResInfo == Panel_1024x768) && (!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) && (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) ) { if(ModeNo == 0x13) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xB9); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0xCC); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xA6); } else if((crt2crtc & 0x3F) == 4) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x2B); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x13); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xE5); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0x08); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xE2); } } if(SiS_Pr->ChipType < SIS_315H) { if(SiS_Pr->SiS_LCDTypeInfo == 0x0c) { crt2crtc &= 0x1f; tempcx = 0; if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { tempcx += 7; } } tempcx += crt2crtc; if(crt2crtc >= 4) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xff); } if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { if(crt2crtc == 4) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x28); } } } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x18); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,atable[tempcx]); } } } } /* For ECS A907. Highly preliminary. */ static void SiS_Set300Part2Regs(struct SiS_Private *SiS_Pr, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, unsigned short ModeNo) { const struct SiS_Part2PortTbl *CRT2Part2Ptr = NULL; unsigned short crt2crtc, resindex; int i, j; if(SiS_Pr->ChipType != SIS_300) return; if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) return; if(SiS_Pr->UseCustomMode) return; if(ModeNo <= 0x13) { crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; } else { crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; } resindex = crt2crtc & 0x3F; if(SiS_Pr->SiS_SetFlag & LCDVESATiming) CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; else CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_2; /* The BIOS code (1.16.51,56) is obviously a fragment! */ if(ModeNo > 0x13) { CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; resindex = 4; } SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); for(i = 2, j = 0x04; j <= 0x06; i++, j++ ) { SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); } for(j = 0x1c; j <= 0x1d; i++, j++ ) { SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); } for(j = 0x1f; j <= 0x21; i++, j++ ) { SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); } #endif static void SiS_SetTVSpecial(struct SiS_Private *SiS_Pr, unsigned short ModeNo) { if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) return; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) return; if(SiS_Pr->SiS_TVMode & (TVSetYPbPr625i | TVSetYPbPr625p)) return; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { if(SiS_Pr->SiS_TVMode & TVSetHiVi960540) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x47); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,0xea); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0f,0x00); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2b,0xf0,0x0e); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x42,0x0f,0x00); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,0xe6); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x44,0x90); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xc0,0x09); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xf8,0x03); } } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { #ifndef OLD1280720P if(ModeNo == 0x79 || ModeNo == 0x75 || ModeNo == 0x78) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x19); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x23); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,0x1c); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0f,0x10); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2b,0xf0,0x0b); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x42,0x0f,0x10); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,0x2c); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x44,0x68); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xc0,0x01); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xf8,0x05); } #endif } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { if(SiS_Pr->SiS_TVMode & TVSet525p1024) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,0x77); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x20,0x13); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2b,0x78); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2c,0x04); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x42,0x14); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,0x73); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1c,0xaf); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1e,0x71); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,0xbb); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,0xb5); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x26,0xdc); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x46,0x3c); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x45,0x11); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x44,0x00); } } else if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { static const unsigned char specialtv[] = { 0xa7,0x07,0xf2,0x6e,0x17,0x8b,0x73,0x53, 0x13,0x40,0x34,0xf4,0x63,0xbb,0xcc,0x7a, 0x58,0xe4,0x73,0xda,0x13 }; int i, j; for(i = 0x1c, j = 0; i <= 0x30; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,specialtv[j]); } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,0x72); if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750)) { if(SiS_Pr->SiS_TVMode & TVSetPALM) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1b); } else { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); /* 15 */ SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1a); /* 1b */ } } } } else { if((ModeNo == 0x38) || (ModeNo == 0x4a) || (ModeNo == 0x64) || (ModeNo == 0x52) || (ModeNo == 0x58) || (ModeNo == 0x5c)) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); /* 21 */ SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); /* 5a */ } else { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1a); /* 21 */ SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x53); /* 5a */ } } } static void SiS_SetGroup2_Tail(struct SiS_Private *SiS_Pr, unsigned short ModeNo) { unsigned short temp; if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { if(SiS_Pr->SiS_VGAVDE == 525) { temp = 0xc3; if(SiS_Pr->SiS_ModeType <= ModeVGA) { temp++; if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) temp += 2; } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xb3); } else if(SiS_Pr->SiS_VGAVDE == 420) { temp = 0x4d; if(SiS_Pr->SiS_ModeType <= ModeVGA) { temp++; if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) temp++; } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); } } if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) { if(SiS_Pr->SiS_VBType & VB_SIS30xB) { SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x1a,0x03); /* Not always for LV, see SetGrp2 */ } temp = 1; if(ModeNo <= 0x13) temp = 3; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0b,temp); } } } static void SiS_SetGroup2(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short i, j, tempax, tempbx, tempcx, tempch, tempcl, temp; unsigned short push2, modeflag, crt2crtc, bridgeoffset; unsigned int longtemp, PhaseIndex; BOOLEAN newtvphase; const unsigned char *TimingPoint; #ifdef SIS315H unsigned short resindex, CRT2Index; const struct SiS_Part2PortTbl *CRT2Part2Ptr = NULL; if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; #endif if(ModeNo <= 0x13) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; } else if(SiS_Pr->UseCustomMode) { modeflag = SiS_Pr->CModeFlag; crt2crtc = 0; } else { modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; } temp = 0; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO)) temp |= 0x08; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSVIDEO)) temp |= 0x04; if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) temp |= 0x02; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp |= 0x01; if(!(SiS_Pr->SiS_TVMode & TVSetPALTiming)) temp |= 0x10; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x00,temp); PhaseIndex = 0x01; /* SiS_PALPhase */ TimingPoint = SiS_Pr->SiS_PALTiming; newtvphase = FALSE; if( (SiS_Pr->SiS_VBType & VB_SIS30xBLV) && ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) { newtvphase = TRUE; } if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { TimingPoint = SiS_Pr->SiS_HiTVExtTiming; if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { TimingPoint = SiS_Pr->SiS_HiTVSt2Timing; if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { TimingPoint = SiS_Pr->SiS_HiTVSt1Timing; } } } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { i = 0; if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) i = 2; else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) i = 1; else if(SiS_Pr->SiS_TVMode & TVSetYPbPr625i) i = 3; else if(SiS_Pr->SiS_TVMode & TVSetYPbPr625p) i = 4; TimingPoint = &SiS_YPbPrTable[i][0]; PhaseIndex = 0x00; /* SiS_NTSCPhase */ } else if(SiS_Pr->SiS_TVMode & TVSetPAL) { if(newtvphase) PhaseIndex = 0x09; /* SiS_PALPhase2 */ } else { TimingPoint = SiS_Pr->SiS_NTSCTiming; PhaseIndex = (SiS_Pr->SiS_TVMode & TVSetNTSCJ) ? 0x01 : 0x00; /* SiS_PALPhase : SiS_NTSCPhase */ if(newtvphase) PhaseIndex += 8; /* SiS_PALPhase2 : SiS_NTSCPhase2 */ } if(SiS_Pr->SiS_TVMode & (TVSetPALM | TVSetPALN)) { PhaseIndex = (SiS_Pr->SiS_TVMode & TVSetPALM) ? 0x02 : 0x03; /* SiS_PALMPhase : SiS_PALNPhase */ if(newtvphase) PhaseIndex += 8; /* SiS_PALMPhase2 : SiS_PALNPhase2 */ } if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { if(SiS_Pr->SiS_TVMode & TVSetPALM) { PhaseIndex = 0x05; /* SiS_SpecialPhaseM */ } else if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) { PhaseIndex = 0x11; /* SiS_SpecialPhaseJ */ } else { PhaseIndex = 0x10; /* SiS_SpecialPhase */ } } for(i = 0x31, j = 0; i <= 0x34; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS_TVPhase[(PhaseIndex * 4) + j]); } for(i = 0x01, j = 0; i <= 0x2D; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]); } for(i = 0x39; i <= 0x45; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]); } if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { if(SiS_Pr->SiS_ModeType != ModeText) { SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x3A,0x1F); } } SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x0A,SiS_Pr->SiS_NewFlickerMode); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x35,SiS_Pr->SiS_RY1COE); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x36,SiS_Pr->SiS_RY2COE); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x37,SiS_Pr->SiS_RY3COE); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x38,SiS_Pr->SiS_RY4COE); if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempax = 950; else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempax = 680; else if(SiS_Pr->SiS_TVMode & TVSetPALTiming) tempax = 520; else tempax = 440; /* NTSC, YPbPr 525 */ if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && (SiS_Pr->SiS_VDE <= tempax)) { tempax -= SiS_Pr->SiS_VDE; tempax >>= 1; if(!(SiS_Pr->SiS_TVMode & TVSetYPbPrProg)) { tempax >>= 1; } tempax &= 0x00ff; temp = tempax + (unsigned short)TimingPoint[0]; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); temp = tempax + (unsigned short)TimingPoint[1]; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); } if((SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) && (SiS_Pr->SiS_VGAHDE >= 1024)) { if(SiS_Pr->SiS_TVMode & TVSetPAL) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); } else { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x17); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1d); } } tempcx = SiS_Pr->SiS_HT; if(SiS_IsDualLink(SiS_Pr)) tempcx >>= 1; tempcx--; if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) tempcx--; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1B,tempcx); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0xF0,((tempcx >> 8) & 0x0f)); tempcx = SiS_Pr->SiS_HT >> 1; if(SiS_IsDualLink(SiS_Pr)) tempcx >>= 1; tempcx += 7; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4; SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x22,0x0F,((tempcx << 4) & 0xf0)); tempbx = TimingPoint[j] | (TimingPoint[j+1] << 8); tempbx += tempcx; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x24,tempbx); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0F,((tempbx >> 4) & 0xf0)); tempbx += 8; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { tempbx -= 4; tempcx = tempbx; } SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x29,0x0F,((tempbx << 4) & 0xf0)); j += 2; tempcx += (TimingPoint[j] | (TimingPoint[j+1] << 8)); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x27,tempcx); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x28,0x0F,((tempcx >> 4) & 0xf0)); tempcx += 8; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4; SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2A,0x0F,((tempcx << 4) & 0xf0)); tempcx = SiS_Pr->SiS_HT >> 1; if(SiS_IsDualLink(SiS_Pr)) tempcx >>= 1; j += 2; tempcx -= (TimingPoint[j] | ((TimingPoint[j+1]) << 8)); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2D,0x0F,((tempcx << 4) & 0xf0)); tempcx -= 11; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { tempcx = SiS_GetVGAHT2(SiS_Pr) - 1; } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2E,tempcx); tempbx = SiS_Pr->SiS_VDE; if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { if(SiS_Pr->SiS_VGAVDE == 360) tempbx = 746; else if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 746; else if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 853; } else if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && (!(SiS_Pr->SiS_TVMode & TVSetYPbPrProg)) ) { tempbx >>= 1; if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { if((ModeNo <= 0x13) && (crt2crtc == 1)) tempbx++; } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { if(SiS_Pr->SiS_ModeType <= ModeVGA) { if(crt2crtc == 4) tempbx++; } } } if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { if((ModeNo == 0x2f) || (ModeNo == 0x5d) || (ModeNo == 0x5e)) tempbx++; } if(!(SiS_Pr->SiS_TVMode & TVSetPALTiming)) { if(ModeNo == 0x03) tempbx++; /* From 1.10.7w - doesn't make sense */ } } } tempbx -= 2; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2F,tempbx); temp = (tempcx >> 8) & 0x0F; temp |= ((tempbx >> 2) & 0xC0); if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) { temp |= 0x10; if(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO) temp |= 0x20; } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,temp); if(SiS_Pr->SiS_VBType & VB_SISPART4OVERFLOW) { SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xdf,((tempbx & 0x0400) >> 5)); } if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { tempbx = SiS_Pr->SiS_VDE; if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && (!(SiS_Pr->SiS_TVMode & TVSetYPbPrProg)) ) { tempbx >>= 1; } tempbx -= 3; temp = ((tempbx >> 3) & 0x60) | 0x18; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x46,temp); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x47,tempbx); if(SiS_Pr->SiS_VBType & VB_SISPART4OVERFLOW) { SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xbf,((tempbx & 0x0400) >> 4)); } } tempax = tempbx = tempcx = 0; if(!(modeflag & HalfDCLK)) { if(SiS_Pr->SiS_VGAHDE >= SiS_Pr->SiS_HDE) { tempbx |= 0x20; } } tempch = tempcl = 1; if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { if(SiS_Pr->SiS_VGAHDE >= 960) { if(!(modeflag & HalfDCLK)) { tempcl = 32; if(SiS_Pr->SiS_VGAHDE >= 1280) { tempch = 20; tempbx &= ~0x20; } else if(SiS_Pr->SiS_VGAHDE >= 1024) { tempch = 25; } else { tempch = 25; /* OK */ } } } } if(!(tempbx & 0x20)) { if(modeflag & HalfDCLK) tempcl <<= 1; longtemp = ((SiS_Pr->SiS_VGAHDE * tempch) / tempcl) << 13; if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) longtemp <<= 3; tempax = longtemp / SiS_Pr->SiS_HDE; if(longtemp % SiS_Pr->SiS_HDE) tempax++; tempbx |= ((tempax >> 8) & 0x1F); tempcx = tempax >> 13; } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x44,tempax); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xC0,tempbx); if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xF8,(tempcx & 0x07)); if(SiS_Pr->SiS_TVMode & TVSetPALTiming) { tempbx = 0x0382; tempcx = 0x007e; } else { tempbx = 0x0369; tempcx = 0x0061; } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4B,tempbx); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4C,tempcx); temp = (tempcx & 0x0300) >> 6; temp |= ((tempbx >> 8) & 0x03); if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { temp |= 0x10; if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p|TVSetYPbPr625p)) temp |= 0x20; else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp |= 0x40; } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4D,temp); temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,(temp - 3)); SiS_SetTVSpecial(SiS_Pr, ModeNo); if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) { temp = 0; if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 8; SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xf7,temp); } } if(SiS_Pr->SiS_TVMode & TVSetPALM) { if(!(SiS_Pr->SiS_TVMode & TVSetNTSC1024)) { temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,(temp - 1)); } SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xEF); } if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,0x00); } } if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) return; /* From here: Part2 LCD setup */ tempbx = SiS_Pr->SiS_HDE; if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; tempbx--; /* RHACTE = HDE - 1 */ SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2C,tempbx); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2B,0x0F,((tempbx >> 4) & 0xf0)); temp = 0x01; if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { if(SiS_Pr->SiS_ModeType == ModeEGA) { if(SiS_Pr->SiS_VGAHDE >= 1024) { temp = 0x02; if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { temp = 0x01; } } } } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,temp); tempbx = SiS_Pr->SiS_VDE - 1; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x03,tempbx); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0C,0xF8,((tempbx >> 8) & 0x07)); tempcx = SiS_Pr->SiS_VT - 1; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x19,tempcx); temp = (tempcx >> 3) & 0xE0; if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { /* Enable dithering; only do this for 32bpp mode */ if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) { temp |= 0x10; } } SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1A,0x0f,temp); SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x09,0xF0); SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x0A,0xF0); SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x17,0xFB); SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x18,0xDF); #ifdef SIS315H if(SiS_GetCRT2Part2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, &CRT2Index, &resindex)) { switch(CRT2Index) { case 206: CRT2Part2Ptr = SiS310_CRT2Part2_Asus1024x768_3; break; default: case 200: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; break; } SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); for(i = 2, j = 0x04; j <= 0x06; i++, j++ ) { SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); } for(j = 0x1c; j <= 0x1d; i++, j++ ) { SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); } for(j = 0x1f; j <= 0x21; i++, j++ ) { SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); } SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); SiS_SetGroup2_Tail(SiS_Pr, ModeNo); } else { #endif /* Checked for 1024x768, 1280x1024, 1400x1050, 1600x1200 */ /* Clevo dual-link 1024x768 */ /* Compaq 1280x1024 has HT 1696 sometimes (calculation OK, if given HT is correct) */ /* Acer: OK, but uses different setting for VESA timing at 640/800/1024 and 640x400 */ if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { if((SiS_Pr->SiS_LCDInfo & LCDPass11) || (SiS_Pr->PanelYRes == SiS_Pr->SiS_VDE)) { tempbx = SiS_Pr->SiS_VDE - 1; tempcx = SiS_Pr->SiS_VT - 1; } else { tempbx = SiS_Pr->SiS_VDE + ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VDE) / 2); tempcx = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VDE) / 2); } } else { tempbx = SiS_Pr->PanelYRes; tempcx = SiS_Pr->SiS_VT; tempax = 1; if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { tempax = SiS_Pr->PanelYRes; /* if(SiS_Pr->SiS_VGAVDE == 525) tempax += 0x3c; */ /* 651+301C */ if(SiS_Pr->PanelYRes < SiS_Pr->SiS_VDE) { tempax = tempcx = 0; } else { tempax -= SiS_Pr->SiS_VDE; } tempax >>= 1; } tempcx -= tempax; /* lcdvdes */ tempbx -= tempax; /* lcdvdee */ } /* Non-expanding: lcdvdes = tempcx = VT-1; lcdvdee = tempbx = VDE-1 */ #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "lcdvdes 0x%x lcdvdee 0x%x\n", tempcx, tempbx); #endif #endif SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempcx); /* lcdvdes */ SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempbx); /* lcdvdee */ temp = (tempbx >> 5) & 0x38; temp |= ((tempcx >> 8) & 0x07); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); tempax = SiS_Pr->SiS_VDE; if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { tempax = SiS_Pr->PanelYRes; } tempcx = (SiS_Pr->SiS_VT - tempax) >> 4; if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { tempcx = (SiS_Pr->SiS_VT - tempax) / 10; } } tempbx = ((SiS_Pr->SiS_VT + SiS_Pr->SiS_VDE) >> 1) - 1; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { /* ? */ tempax = SiS_Pr->SiS_VT - SiS_Pr->PanelYRes; if(tempax % 4) { tempax >>= 2; tempax++; } else { tempax >>= 2; } tempbx -= (tempax - 1); } else { tempbx -= 10; if(tempbx <= SiS_Pr->SiS_VDE) tempbx = SiS_Pr->SiS_VDE + 1; } } } if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { tempbx++; if((!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || (crt2crtc == 6)) { if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { tempbx = 770; tempcx = 3; } } } /* non-expanding: lcdvrs = ((VT + VDE) / 2) - 10 */ if(SiS_Pr->UseCustomMode) { tempbx = SiS_Pr->CVSyncStart; } #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "lcdvrs 0x%x\n", tempbx); #endif #endif SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx); /* lcdvrs */ temp = (tempbx >> 4) & 0xF0; tempbx += (tempcx + 1); temp |= (tempbx & 0x0F); if(SiS_Pr->UseCustomMode) { temp &= 0xf0; temp |= (SiS_Pr->CVSyncEnd & 0x0f); } #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "lcdvre[3:0] 0x%x\n", (temp & 0x0f)); #endif #endif SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); #ifdef SIS300 SiS_Group2LCDSpecial(SiS_Pr, ModeNo, crt2crtc); #endif bridgeoffset = 7; if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) bridgeoffset += 2; if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) bridgeoffset += 2; /* OK for Averatec 1280x800 (301C) */ if(SiS_IsDualLink(SiS_Pr)) bridgeoffset++; else if(SiS_Pr->SiS_VBType & VB_SIS302LV) bridgeoffset++; /* OK for Asus A4L 1280x800 */ /* Higher bridgeoffset shifts to the LEFT */ temp = 0; if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) { temp = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_HDE) / 2); if(SiS_IsDualLink(SiS_Pr)) temp >>= 1; } } temp += bridgeoffset; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1F,temp); /* lcdhdes */ SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0F,((temp >> 4) & 0xf0)); tempcx = SiS_Pr->SiS_HT; tempax = tempbx = SiS_Pr->SiS_HDE; if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) { tempax = SiS_Pr->PanelXRes; tempbx = SiS_Pr->PanelXRes - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_HDE) / 2); } } if(SiS_IsDualLink(SiS_Pr)) { tempcx >>= 1; tempbx >>= 1; tempax >>= 1; } #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "lcdhdee 0x%x\n", tempbx); #endif #endif tempbx += bridgeoffset; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempbx); /* lcdhdee */ SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0xF0,((tempbx >> 8) & 0x0f)); tempcx = (tempcx - tempax) >> 2; tempbx += tempcx; push2 = tempbx; if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { if(SiS_Pr->SiS_LCDInfo & LCDPass11) { if(SiS_Pr->SiS_HDE == 1280) tempbx = (tempbx & 0xff00) | 0x47; } } } if(SiS_Pr->UseCustomMode) { tempbx = SiS_Pr->CHSyncStart; if(modeflag & HalfDCLK) tempbx <<= 1; if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; tempbx += bridgeoffset; } #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "lcdhrs 0x%x\n", tempbx); #endif #endif SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,tempbx); /* lcdhrs */ SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,((tempbx >> 4) & 0xf0)); tempbx = push2; tempcx <<= 1; if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) tempcx >>= 2; } tempbx += tempcx; if(SiS_Pr->UseCustomMode) { tempbx = SiS_Pr->CHSyncEnd; if(modeflag & HalfDCLK) tempbx <<= 1; if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; tempbx += bridgeoffset; } #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "lcdhre 0x%x\n", tempbx); #endif #endif SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempbx); /* lcdhre */ SiS_SetGroup2_Tail(SiS_Pr, ModeNo); #ifdef SIS300 SiS_Set300Part2Regs(SiS_Pr, ModeIdIndex, RefreshRateTableIndex, ModeNo); #endif #ifdef SIS315H } /* CRT2-LCD from table */ #endif } /*********************************************/ /* SET PART 3 REGISTER GROUP */ /*********************************************/ static void SiS_SetGroup3(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned short i; const unsigned char *tempdi; if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; #ifndef SIS_CP SiS_SetReg(SiS_Pr->SiS_Part3Port,0x00,0x00); #else SIS_CP_INIT301_CP #endif if(SiS_Pr->SiS_TVMode & TVSetPALTiming) { SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); } else { SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xF5); SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xB7); } if(SiS_Pr->SiS_TVMode & TVSetPALM) { SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); SiS_SetReg(SiS_Pr->SiS_Part3Port,0x3D,0xA8); } tempdi = NULL; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { tempdi = SiS_Pr->SiS_HiTVGroup3Data; if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { tempdi = SiS_Pr->SiS_HiTVGroup3Simu; } } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { if(!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525i | TVSetYPbPr625i))) { if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempdi = SiS_HiTVGroup3_2; else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tempdi = SiS_HiTVGroup3_1; } } if(tempdi) { for(i=0; i<=0x3E; i++) { SiS_SetReg(SiS_Pr->SiS_Part3Port,i,tempdi[i]); } if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) { if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { SiS_SetReg(SiS_Pr->SiS_Part3Port,0x28,0x3f); } } } #ifdef SIS_CP SIS_CP_INIT301_CP2 #endif } /*********************************************/ /* SET PART 4 REGISTER GROUP */ /*********************************************/ #ifdef SIS315H #if 0 static void SiS_ShiftXPos(struct SiS_Private *SiS_Pr, int shift) { unsigned short temp, temp1, temp2; temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x1f); temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x20); temp = (unsigned short)((int)((temp1 | ((temp2 & 0xf0) << 4))) + shift); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,temp); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0f,((temp >> 4) & 0xf0)); temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x2b) & 0x0f; temp = (unsigned short)((int)(temp) + shift); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2b,0xf0,(temp & 0x0f)); temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43); temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x42); temp = (unsigned short)((int)((temp1 | ((temp2 & 0xf0) << 4))) + shift); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,temp); SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x42,0x0f,((temp >> 4) & 0xf0)); } #endif static void SiS_SetGroup4_C_ELV(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned short temp, temp1, resinfo = 0; unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; if(!(SiS_Pr->SiS_VBType & VB_SIS30xCLV)) return; if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToHiVision | SetCRT2ToYPbPr525750))) return; if(SiS_Pr->ChipType >= XGI_20) return; if((SiS_Pr->ChipType >= SIS_661) && (SiS_Pr->SiS_ROMNew)) { if(!(ROMAddr[0x61] & 0x04)) return; } if(ModeNo > 0x13) { resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; } SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3a,0x08); temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x3a); if(!(temp & 0x01)) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3a,0xdf); SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xfc); if((SiS_Pr->ChipType < SIS_661) && (!(SiS_Pr->SiS_ROMNew))) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xf8); } SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x0f,0xfb); if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp = 0x0000; else if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p|TVSetYPbPr625p)) temp = 0x0002; else if(SiS_Pr->SiS_TVMode & TVSetHiVision) temp = 0x0400; else temp = 0x0402; if((SiS_Pr->ChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { temp1 = 0; if(SiS_Pr->SiS_TVMode & TVAspect43) temp1 = 4; SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0f,0xfb,temp1); if(SiS_Pr->SiS_TVMode & TVAspect43LB) temp |= 0x01; SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0x7c,(temp & 0xff)); SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8)); if(ModeNo > 0x13) { SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x39,0xfd); } } else { temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x3b) & 0x03; if(temp1 == 0x01) temp |= 0x01; if(temp1 == 0x03) temp |= 0x04; /* ? why not 0x10? */ SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xf8,(temp & 0xff)); SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8)); if(ModeNo > 0x13) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3b,0xfd); } } #if 0 if(SiS_Pr->ChipType >= SIS_661) { /* ? */ if(SiS_Pr->SiS_TVMode & TVAspect43) { if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { if(resinfo == SIS_RI_1024x768) { SiS_ShiftXPos(SiS_Pr, 97); } else { SiS_ShiftXPos(SiS_Pr, 111); } } else if(SiS_Pr->SiS_TVMode & TVSetHiVision) { SiS_ShiftXPos(SiS_Pr, 136); } } } #endif } } #endif static void SiS_SetCRT2VCLK(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short vclkindex, temp, reg1, reg2; if(SiS_Pr->UseCustomMode) { reg1 = SiS_Pr->CSR2B; reg2 = SiS_Pr->CSR2C; } else { vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); reg1 = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_A; reg2 = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_B; } if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSet525p1024)) { SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x57); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,0x46); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1f,0xf6); } else { SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); } } else { SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x01); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); } SiS_SetReg(SiS_Pr->SiS_Part4Port,0x12,0x00); temp = 0x08; if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) temp |= 0x20; SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x12,temp); } static void SiS_SetDualLinkEtc(struct SiS_Private *SiS_Pr) { if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { if((SiS_CRT2IsLCD(SiS_Pr)) || (SiS_IsVAMode(SiS_Pr))) { if(SiS_Pr->SiS_LCDInfo & LCDDualLink) { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c); } else { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x27,~0x20); } } } } if(SiS_Pr->SiS_VBType & VB_SISEMI) { SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); #ifdef SET_EMI SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); #endif SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); } } static void SiS_SetGroup4(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short tempax, tempcx, tempbx, modeflag, temp, resinfo; unsigned int tempebx, tempeax, templong; if(ModeNo <= 0x13) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; } else if(SiS_Pr->UseCustomMode) { modeflag = SiS_Pr->CModeFlag; resinfo = 0; } else { modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; } if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_VBType & VB_SISLVDS) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); } } } if(SiS_Pr->SiS_VBType & (VB_SIS30xCLV | VB_SIS302LV)) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x10,0x9f); } } if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { SiS_SetDualLinkEtc(SiS_Pr); return; } } SiS_SetReg(SiS_Pr->SiS_Part4Port,0x13,SiS_Pr->SiS_RVBHCFACT); tempbx = SiS_Pr->SiS_RVBHCMAX; SiS_SetReg(SiS_Pr->SiS_Part4Port,0x14,tempbx); temp = (tempbx >> 1) & 0x80; tempcx = SiS_Pr->SiS_VGAHT - 1; SiS_SetReg(SiS_Pr->SiS_Part4Port,0x16,tempcx); temp |= ((tempcx >> 5) & 0x78); tempcx = SiS_Pr->SiS_VGAVT - 1; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempcx -= 5; SiS_SetReg(SiS_Pr->SiS_Part4Port,0x17,tempcx); temp |= ((tempcx >> 8) & 0x07); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x15,temp); tempbx = SiS_Pr->SiS_VGAHDE; if(modeflag & HalfDCLK) tempbx >>= 1; if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { temp = 0; if(tempbx > 800) temp = 0x60; } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { temp = 0; if(tempbx > 1024) temp = 0xC0; else if(tempbx >= 960) temp = 0xA0; } else if(SiS_Pr->SiS_TVMode & TVSetYPbPrProg) { temp = 0; if(tempbx >= 1280) temp = 0x40; else if(tempbx >= 1024) temp = 0x20; } else { temp = 0x80; if(tempbx >= 1024) temp = 0xA0; } temp |= SiS_Pr->Init_P4_0E; if(SiS_Pr->SiS_VBType & VB_SIS301) { if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) { temp &= 0xf0; temp |= 0x0A; } } SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0E,0x10,temp); tempeax = SiS_Pr->SiS_VGAVDE; tempebx = SiS_Pr->SiS_VDE; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { if(!(temp & 0xE0)) tempebx >>= 1; } tempcx = SiS_Pr->SiS_RVBHRS; SiS_SetReg(SiS_Pr->SiS_Part4Port,0x18,tempcx); tempcx >>= 8; tempcx |= 0x40; if(tempeax <= tempebx) { tempcx ^= 0x40; } else { tempeax -= tempebx; } tempeax *= (256 * 1024); templong = tempeax % tempebx; tempeax /= tempebx; if(templong) tempeax++; temp = (unsigned short)(tempeax & 0x000000FF); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1B,temp); temp = (unsigned short)((tempeax & 0x0000FF00) >> 8); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1A,temp); temp = (unsigned short)((tempeax >> 12) & 0x70); /* sic! */ temp |= (tempcx & 0x4F); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x19,temp); if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1C,0x28); /* Calc Linebuffer max address and set/clear decimode */ tempbx = 0; if(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr750p)) tempbx = 0x08; tempax = SiS_Pr->SiS_VGAHDE; if(modeflag & HalfDCLK) tempax >>= 1; if(SiS_IsDualLink(SiS_Pr)) tempax >>= 1; if(tempax > 800) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { tempax -= 800; } else { tempbx = 0x08; if(tempax == 960) tempax *= 25; /* Correct */ else if(tempax == 1024) tempax *= 25; else tempax *= 20; temp = tempax % 32; tempax /= 32; if(temp) tempax++; tempax++; if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { if(resinfo == SIS_RI_1024x768 || resinfo == SIS_RI_1024x576 || resinfo == SIS_RI_1280x1024 || resinfo == SIS_RI_1280x720) { /* Otherwise white line or garbage at right edge */ tempax = (tempax & 0xff00) | 0x20; } else if(resinfo == SIS_RI_960x540) { tempax = (tempax & 0xff00) | 0xed; } } } } tempax--; temp = ((tempax >> 4) & 0x30) | tempbx; SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1D,tempax); SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1E,temp); temp = 0x0036; tempbx = 0xD0; if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { temp = 0x0026; tempbx = 0xC0; /* See En/DisableBridge() */ } if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { if(!(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetHiVision | TVSetYPbPrProg))) { temp |= 0x01; if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { temp &= ~0x01; } } } } SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x1F,tempbx,temp); tempbx = SiS_Pr->SiS_HT >> 1; if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; tempbx -= 2; SiS_SetReg(SiS_Pr->SiS_Part4Port,0x22,tempbx); temp = (tempbx >> 5) & 0x38; SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0xC0,temp); if(SiS_Pr->SiS_VBType & VB_SISLVDS) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); /* LCD-too-dark-error-source, see FinalizeLCD() */ } } SiS_SetDualLinkEtc(SiS_Pr); } /* 301B */ SiS_SetCRT2VCLK(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } /*********************************************/ /* SET PART 5 REGISTER GROUP */ /*********************************************/ static void SiS_SetGroup5(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; if(SiS_Pr->SiS_ModeType == ModeVGA) { if(!(SiS_Pr->SiS_VBInfo & (SetInSlaveMode | LoadDACFlag))) { SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); SiS_LoadDAC(SiS_Pr, ModeNo, ModeIdIndex); } } } /*********************************************/ /* MODIFY CRT1 GROUP FOR SLAVE MODE */ /*********************************************/ static BOOLEAN SiS_GetLVDSCRT1Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, unsigned short *ResIndex, unsigned short *DisplayType) { unsigned short modeflag = 0; BOOLEAN checkhd = TRUE; /* Pass 1:1 not supported here */ if(ModeNo <= 0x13) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; } else { modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; } (*ResIndex) &= 0x3F; if((SiS_Pr->SiS_IF_DEF_CH70xx) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { (*DisplayType) = 80; if((SiS_Pr->SiS_TVMode & TVSetPAL) && (!(SiS_Pr->SiS_TVMode & TVSetPALM))) { (*DisplayType) = 82; if(SiS_Pr->SiS_ModeType > ModeVGA) { if(SiS_Pr->SiS_CHSOverScan) (*DisplayType) = 84; } } if((*DisplayType) != 84) { if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) (*DisplayType)++; } } else { (*DisplayType = 0); switch(SiS_Pr->SiS_LCDResInfo) { case Panel_320x240_1: (*DisplayType) = 50; checkhd = FALSE; break; case Panel_320x240_2: (*DisplayType) = 14; break; case Panel_320x240_3: (*DisplayType) = 18; break; case Panel_640x480: (*DisplayType) = 10; break; case Panel_1024x600: (*DisplayType) = 26; break; default: return TRUE; } if(checkhd) { if(modeflag & HalfDCLK) (*DisplayType)++; } if(SiS_Pr->SiS_LCDResInfo == Panel_1024x600) { if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) (*DisplayType) += 2; } } return TRUE; } static void SiS_ModCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short tempah, i, modeflag, j, ResIndex, DisplayType; const struct SiS_LVDSCRT1Data *LVDSCRT1Ptr = NULL; static const unsigned short CRIdx[] = { 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x15, 0x16 }; if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || (SiS_Pr->SiS_CustomT == CUT_PANEL848) || (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) return; if(SiS_Pr->SiS_IF_DEF_LVDS) { if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return; } } else if(SiS_Pr->SiS_VBType & VB_SISVB) { if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return; } else return; if(SiS_Pr->SiS_LCDInfo & LCDPass11) return; if(SiS_Pr->ChipType < SIS_315H) { if(SiS_Pr->SiS_SetFlag & SetDOSMode) return; } if(!(SiS_GetLVDSCRT1Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, &ResIndex, &DisplayType))) { return; } switch(DisplayType) { case 50: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_1; break; /* xSTN */ case 14: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_2; break; /* xSTN */ case 15: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_2_H; break; /* xSTN */ case 18: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_3; break; /* xSTN */ case 19: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_3_H; break; /* xSTN */ case 10: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_1; break; case 11: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_1_H; break; #if 0 /* Works better with calculated numbers */ case 26: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_1; break; case 27: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_1_H; break; case 28: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_2; break; case 29: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_2_H; break; #endif case 80: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1UNTSC; break; case 81: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1ONTSC; break; case 82: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1UPAL; break; case 83: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1OPAL; break; case 84: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1SOPAL; break; } if(LVDSCRT1Ptr) { SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f); for(i = 0; i <= 10; i++) { tempah = (LVDSCRT1Ptr + ResIndex)->CR[i]; SiS_SetReg(SiS_Pr->SiS_P3d4,CRIdx[i],tempah); } for(i = 0x0A, j = 11; i <= 0x0C; i++, j++) { tempah = (LVDSCRT1Ptr + ResIndex)->CR[j]; SiS_SetReg(SiS_Pr->SiS_P3c4,i,tempah); } tempah = (LVDSCRT1Ptr + ResIndex)->CR[14] & 0xE0; SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0x1f,tempah); if(ModeNo <= 0x13) modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; else modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; tempah = ((LVDSCRT1Ptr + ResIndex)->CR[14] & 0x01) << 5; if(modeflag & DoubleScanMode) tempah |= 0x80; SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,~0x020,tempah); } else { SiS_CalcLCDACRT1Timing(SiS_Pr, ModeNo, ModeIdIndex); } } /*********************************************/ /* SET CRT2 ECLK */ /*********************************************/ static void SiS_SetCRT2ECLK(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short clkbase, vclkindex = 0; unsigned char sr2b, sr2c; if(SiS_Pr->SiS_LCDInfo & LCDPass11) { SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK == 2) { RefreshRateTableIndex--; } vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; } else { vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } sr2b = SiS_Pr->SiS_VCLKData[vclkindex].SR2B; sr2c = SiS_Pr->SiS_VCLKData[vclkindex].SR2C; if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { if(SiS_Pr->SiS_UseROM) { if(ROMAddr[0x220] & 0x01) { sr2b = ROMAddr[0x227]; sr2c = ROMAddr[0x228]; } } } clkbase = 0x02B; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { clkbase += 3; } } SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x20); SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x10); SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x00); SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); } /*********************************************/ /* SET UP CHRONTEL CHIPS */ /*********************************************/ static void SiS_SetCHTVReg(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned short TVType, resindex; const struct SiS_CHTVRegData *CHTVRegData = NULL; if(ModeNo <= 0x13) resindex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; else resindex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; resindex &= 0x3F; TVType = 0; if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; if(SiS_Pr->SiS_TVMode & TVSetPAL) { TVType += 2; if(SiS_Pr->SiS_ModeType > ModeVGA) { if(SiS_Pr->SiS_CHSOverScan) TVType = 8; } if(SiS_Pr->SiS_TVMode & TVSetPALM) { TVType = 4; if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; } else if(SiS_Pr->SiS_TVMode & TVSetPALN) { TVType = 6; if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; } } switch(TVType) { case 0: CHTVRegData = SiS_Pr->SiS_CHTVReg_UNTSC; break; case 1: CHTVRegData = SiS_Pr->SiS_CHTVReg_ONTSC; break; case 2: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPAL; break; case 3: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL; break; case 4: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALM; break; case 5: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALM; break; case 6: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALN; break; case 7: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALN; break; case 8: CHTVRegData = SiS_Pr->SiS_CHTVReg_SOPAL; break; default: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL; break; } if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { #ifdef SIS300 /* Chrontel 7005 - I assume that it does not come with a 315 series chip */ /* We don't support modes >800x600 */ if (resindex > 5) return; if(SiS_Pr->SiS_TVMode & TVSetPAL) { SiS_SetCH700x(SiS_Pr,0x04,0x43); /* 0x40=76uA (PAL); 0x03=15bit non-multi RGB*/ SiS_SetCH700x(SiS_Pr,0x09,0x69); /* Black level for PAL (105)*/ } else { SiS_SetCH700x(SiS_Pr,0x04,0x03); /* upper nibble=71uA (NTSC), 0x03=15bit non-multi RGB*/ SiS_SetCH700x(SiS_Pr,0x09,0x71); /* Black level for NTSC (113)*/ } SiS_SetCH700x(SiS_Pr,0x00,CHTVRegData[resindex].Reg[0]); /* Mode register */ SiS_SetCH700x(SiS_Pr,0x07,CHTVRegData[resindex].Reg[1]); /* Start active video register */ SiS_SetCH700x(SiS_Pr,0x08,CHTVRegData[resindex].Reg[2]); /* Position overflow register */ SiS_SetCH700x(SiS_Pr,0x0a,CHTVRegData[resindex].Reg[3]); /* Horiz Position register */ SiS_SetCH700x(SiS_Pr,0x0b,CHTVRegData[resindex].Reg[4]); /* Vertical Position register */ /* Set minimum flicker filter for Luma channel (SR1-0=00), minimum text enhancement (S3-2=10), maximum flicker filter for Chroma channel (S5-4=10) =00101000=0x28 (When reading, S1-0->S3-2, and S3-2->S1-0!) */ SiS_SetCH700x(SiS_Pr,0x01,0x28); /* Set video bandwidth High bandwith Luma composite video filter(S0=1) low bandwith Luma S-video filter (S2-1=00) disable peak filter in S-video channel (S3=0) high bandwidth Chroma Filter (S5-4=11) =00110001=0x31 */ SiS_SetCH700x(SiS_Pr,0x03,0xb1); /* old: 3103 */ /* Register 0x3D does not exist in non-macrovision register map (Maybe this is a macrovision register?) */ #ifndef SIS_CP SiS_SetCH70xx(SiS_Pr,0x3d,0x00); #endif /* Register 0x10 only contains 1 writable bit (S0) for sensing, all other bits a read-only. Macrovision? */ SiS_SetCH70xxANDOR(SiS_Pr,0x10,0x00,0x1F); /* Register 0x11 only contains 3 writable bits (S0-S2) for contrast enhancement (set to 010 -> gain 1 Yout = 17/16*(Yin-30) ) */ SiS_SetCH70xxANDOR(SiS_Pr,0x11,0x02,0xF8); /* Clear DSEN */ SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x00,0xEF); if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { /* ---- NTSC ---- */ if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) { if(resindex == 0x04) { /* 640x480 overscan: Mode 16 */ SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); /* ACIV on, no need to set FSCI */ } else if(resindex == 0x05) { /* 800x600 overscan: Mode 23 */ SiS_SetCH70xxANDOR(SiS_Pr,0x18,0x01,0xF0); /* 0x18-0x1f: FSCI 469,762,048 */ SiS_SetCH70xxANDOR(SiS_Pr,0x19,0x0C,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x1a,0x00,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x1b,0x00,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x00,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x1d,0x00,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x1e,0x00,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x1f,0x00,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x01,0xEF); /* Loop filter on for mode 23 */ SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x00,0xFE); /* ACIV off, need to set FSCI */ } } else { if(resindex == 0x04) { /* ----- 640x480 underscan; Mode 17 */ SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); } else if(resindex == 0x05) { /* ----- 800x600 underscan: Mode 24 */ #if 0 SiS_SetCH70xxANDOR(SiS_Pr,0x18,0x01,0xF0); /* (FSCI was 0x1f1c71c7 - this is for mode 22) */ SiS_SetCH70xxANDOR(SiS_Pr,0x19,0x09,0xF0); /* FSCI for mode 24 is 428,554,851 */ SiS_SetCH70xxANDOR(SiS_Pr,0x1a,0x08,0xF0); /* 198b3a63 */ SiS_SetCH70xxANDOR(SiS_Pr,0x1b,0x0b,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x04,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x1d,0x01,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x1e,0x06,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x1f,0x05,0xF0); SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off for mode 24 */ SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x00,0xFE); * ACIV off, need to set FSCI */ #endif /* All alternatives wrong (datasheet wrong?), don't use FSCI */ SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); } } } else { /* ---- PAL ---- */ /* We don't play around with FSCI in PAL mode */ if(resindex == 0x04) { SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); /* ACIV on */ } else { SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); /* ACIV on */ } } #endif /* 300 */ } else { /* Chrontel 7019 - assumed that it does not come with a 300 series chip */ #ifdef SIS315H unsigned short temp; /* We don't support modes >1024x768 */ if (resindex > 6) return; temp = CHTVRegData[resindex].Reg[0]; if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp |= 0x10; SiS_SetCH701x(SiS_Pr,0x00,temp); SiS_SetCH701x(SiS_Pr,0x01,CHTVRegData[resindex].Reg[1]); SiS_SetCH701x(SiS_Pr,0x02,CHTVRegData[resindex].Reg[2]); SiS_SetCH701x(SiS_Pr,0x04,CHTVRegData[resindex].Reg[3]); SiS_SetCH701x(SiS_Pr,0x03,CHTVRegData[resindex].Reg[4]); SiS_SetCH701x(SiS_Pr,0x05,CHTVRegData[resindex].Reg[5]); SiS_SetCH701x(SiS_Pr,0x06,CHTVRegData[resindex].Reg[6]); temp = CHTVRegData[resindex].Reg[7]; if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp = 0x66; SiS_SetCH701x(SiS_Pr,0x07,temp); SiS_SetCH701x(SiS_Pr,0x08,CHTVRegData[resindex].Reg[8]); SiS_SetCH701x(SiS_Pr,0x15,CHTVRegData[resindex].Reg[9]); SiS_SetCH701x(SiS_Pr,0x1f,CHTVRegData[resindex].Reg[10]); SiS_SetCH701x(SiS_Pr,0x0c,CHTVRegData[resindex].Reg[11]); SiS_SetCH701x(SiS_Pr,0x0d,CHTVRegData[resindex].Reg[12]); SiS_SetCH701x(SiS_Pr,0x0e,CHTVRegData[resindex].Reg[13]); SiS_SetCH701x(SiS_Pr,0x0f,CHTVRegData[resindex].Reg[14]); SiS_SetCH701x(SiS_Pr,0x10,CHTVRegData[resindex].Reg[15]); temp = SiS_GetCH701x(SiS_Pr,0x21) & ~0x02; /* D1 should be set for PAL, PAL-N and NTSC-J, but I won't do that for PAL unless somebody tells me to do so. Since the BIOS uses non-default CIV values and blacklevels, this might be compensated anyway. */ if(SiS_Pr->SiS_TVMode & (TVSetPALN | TVSetNTSCJ)) temp |= 0x02; SiS_SetCH701x(SiS_Pr,0x21,temp); #endif /* 315 */ } #ifdef SIS_CP SIS_CP_INIT301_CP3 #endif } #ifdef SIS315H /* ----------- 315 series only ---------- */ void SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr) { unsigned short temp; /* Enable Chrontel 7019 LCD panel backlight */ if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { if(SiS_Pr->ChipType == SIS_740) { SiS_SetCH701x(SiS_Pr,0x66,0x65); } else { temp = SiS_GetCH701x(SiS_Pr,0x66); temp |= 0x20; SiS_SetCH701x(SiS_Pr,0x66,temp); } } } void SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr) { unsigned short temp; /* Disable Chrontel 7019 LCD panel backlight */ if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { temp = SiS_GetCH701x(SiS_Pr,0x66); temp &= 0xDF; SiS_SetCH701x(SiS_Pr,0x66,temp); } } static void SiS_ChrontelPowerSequencing(struct SiS_Private *SiS_Pr) { static const unsigned char regtable[] = { 0x67, 0x68, 0x69, 0x6a, 0x6b }; static const unsigned char table1024_740[] = { 0x01, 0x02, 0x01, 0x01, 0x01 }; static const unsigned char table1400_740[] = { 0x01, 0x6e, 0x01, 0x01, 0x01 }; static const unsigned char asus1024_740[] = { 0x19, 0x6e, 0x01, 0x19, 0x09 }; static const unsigned char asus1400_740[] = { 0x19, 0x6e, 0x01, 0x19, 0x09 }; static const unsigned char table1024_650[] = { 0x01, 0x02, 0x01, 0x01, 0x02 }; static const unsigned char table1400_650[] = { 0x01, 0x02, 0x01, 0x01, 0x02 }; const unsigned char *tableptr = NULL; int i; /* Set up Power up/down timing */ if(SiS_Pr->ChipType == SIS_740) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1024_740; else tableptr = table1024_740; } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200)) { if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1400_740; else tableptr = table1400_740; } else return; } else { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { tableptr = table1024_650; } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200)) { tableptr = table1400_650; } else return; } for(i=0; i<5; i++) { SiS_SetCH701x(SiS_Pr, regtable[i], tableptr[i]); } } static void SiS_SetCH701xForLCD(struct SiS_Private *SiS_Pr) { const unsigned char *tableptr = NULL; unsigned short tempbh; int i; static const unsigned char regtable[] = { 0x1c, 0x5f, 0x64, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x76, 0x78, 0x7d, 0x66 }; static const unsigned char table1024_740[] = { 0x60, 0x02, 0x00, 0x07, 0x40, 0xed, 0xa3, 0xc8, 0xc7, 0xac, 0xe0, 0x02, 0x44 }; static const unsigned char table1280_740[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3, 0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02, 0x44 }; static const unsigned char table1400_740[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3, 0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02, 0x44 }; static const unsigned char table1600_740[] = { 0x60, 0x04, 0x11, 0x00, 0x40, 0xe3, 0xad, 0xde, 0xf6, 0xac, 0x60, 0x1a, 0x44 }; static const unsigned char table1024_650[] = { 0x60, 0x02, 0x00, 0x07, 0x40, 0xed, 0xa3, 0xc8, 0xc7, 0xac, 0x60, 0x02 }; static const unsigned char table1280_650[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3, 0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02 }; static const unsigned char table1400_650[] = { 0x60, 0x03, 0x11, 0x00, 0x40, 0xef, 0xad, 0xdb, 0xf6, 0xac, 0x60, 0x02 }; static const unsigned char table1600_650[] = { 0x60, 0x04, 0x11, 0x00, 0x40, 0xe3, 0xad, 0xde, 0xf6, 0xac, 0x60, 0x1a }; if(SiS_Pr->ChipType == SIS_740) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tableptr = table1024_740; else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) tableptr = table1280_740; else if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) tableptr = table1400_740; else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) tableptr = table1600_740; else return; } else { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tableptr = table1024_650; else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) tableptr = table1280_650; else if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) tableptr = table1400_650; else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) tableptr = table1600_650; else return; } tempbh = SiS_GetCH701x(SiS_Pr,0x74); if((tempbh == 0xf6) || (tempbh == 0xc7)) { tempbh = SiS_GetCH701x(SiS_Pr,0x73); if(tempbh == 0xc8) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) return; } else if(tempbh == 0xdb) { if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) return; if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) return; } else if(tempbh == 0xde) { if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) return; } } if(SiS_Pr->ChipType == SIS_740) tempbh = 0x0d; else tempbh = 0x0c; for(i = 0; i < tempbh; i++) { SiS_SetCH701x(SiS_Pr, regtable[i], tableptr[i]); } SiS_ChrontelPowerSequencing(SiS_Pr); tempbh = SiS_GetCH701x(SiS_Pr,0x1e); tempbh |= 0xc0; SiS_SetCH701x(SiS_Pr,0x1e,tempbh); if(SiS_Pr->ChipType == SIS_740) { tempbh = SiS_GetCH701x(SiS_Pr,0x1c); tempbh &= 0xfb; SiS_SetCH701x(SiS_Pr,0x1c,tempbh); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); tempbh = SiS_GetCH701x(SiS_Pr,0x64); tempbh |= 0x40; SiS_SetCH701x(SiS_Pr,0x64,tempbh); tempbh = SiS_GetCH701x(SiS_Pr,0x03); tempbh &= 0x3f; SiS_SetCH701x(SiS_Pr,0x03,tempbh); } } static void SiS_ChrontelResetVSync(struct SiS_Private *SiS_Pr) { unsigned char temp, temp1; temp1 = SiS_GetCH701x(SiS_Pr,0x49); SiS_SetCH701x(SiS_Pr,0x49,0x3e); temp = SiS_GetCH701x(SiS_Pr,0x47); temp &= 0x7f; /* Use external VSYNC */ SiS_SetCH701x(SiS_Pr,0x47,temp); SiS_LongDelay(SiS_Pr, 3); temp = SiS_GetCH701x(SiS_Pr,0x47); temp |= 0x80; /* Use internal VSYNC */ SiS_SetCH701x(SiS_Pr,0x47,temp); SiS_SetCH701x(SiS_Pr,0x49,temp1); } static void SiS_Chrontel701xOn(struct SiS_Private *SiS_Pr) { unsigned short temp; if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { if(SiS_Pr->ChipType == SIS_740) { temp = SiS_GetCH701x(SiS_Pr,0x1c); temp |= 0x04; /* Invert XCLK phase */ SiS_SetCH701x(SiS_Pr,0x1c,temp); } if(SiS_IsYPbPr(SiS_Pr)) { temp = SiS_GetCH701x(SiS_Pr,0x01); temp &= 0x3f; temp |= 0x80; /* Enable YPrPb (HDTV) */ SiS_SetCH701x(SiS_Pr,0x01,temp); } if(SiS_IsChScart(SiS_Pr)) { temp = SiS_GetCH701x(SiS_Pr,0x01); temp &= 0x3f; temp |= 0xc0; /* Enable SCART + CVBS */ SiS_SetCH701x(SiS_Pr,0x01,temp); } if(SiS_Pr->ChipType == SIS_740) { SiS_ChrontelResetVSync(SiS_Pr); SiS_SetCH701x(SiS_Pr,0x49,0x20); /* Enable TV path */ } else { SiS_SetCH701x(SiS_Pr,0x49,0x20); /* Enable TV path */ temp = SiS_GetCH701x(SiS_Pr,0x49); if(SiS_IsYPbPr(SiS_Pr)) { temp = SiS_GetCH701x(SiS_Pr,0x73); temp |= 0x60; SiS_SetCH701x(SiS_Pr,0x73,temp); } temp = SiS_GetCH701x(SiS_Pr,0x47); temp &= 0x7f; SiS_SetCH701x(SiS_Pr,0x47,temp); SiS_LongDelay(SiS_Pr, 2); temp = SiS_GetCH701x(SiS_Pr,0x47); temp |= 0x80; SiS_SetCH701x(SiS_Pr,0x47,temp); } } } static void SiS_Chrontel701xOff(struct SiS_Private *SiS_Pr) { unsigned short temp; /* Complete power down of LVDS */ if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { if(SiS_Pr->ChipType == SIS_740) { SiS_LongDelay(SiS_Pr, 1); SiS_GenericDelay(SiS_Pr, 5887); SiS_SetCH701x(SiS_Pr,0x76,0xac); SiS_SetCH701x(SiS_Pr,0x66,0x00); } else { SiS_LongDelay(SiS_Pr, 2); temp = SiS_GetCH701x(SiS_Pr,0x76); temp &= 0xfc; SiS_SetCH701x(SiS_Pr,0x76,temp); SiS_SetCH701x(SiS_Pr,0x66,0x00); } } } static void SiS_ChrontelResetDB(struct SiS_Private *SiS_Pr) { unsigned short temp; if(SiS_Pr->ChipType == SIS_740) { temp = SiS_GetCH701x(SiS_Pr,0x4a); /* Version ID */ temp &= 0x01; if(!temp) { if(SiS_WeHaveBacklightCtrl(SiS_Pr)) { temp = SiS_GetCH701x(SiS_Pr,0x49); SiS_SetCH701x(SiS_Pr,0x49,0x3e); } /* Reset Chrontel 7019 datapath */ SiS_SetCH701x(SiS_Pr,0x48,0x10); SiS_LongDelay(SiS_Pr, 1); SiS_SetCH701x(SiS_Pr,0x48,0x18); if(SiS_WeHaveBacklightCtrl(SiS_Pr)) { SiS_ChrontelResetVSync(SiS_Pr); SiS_SetCH701x(SiS_Pr,0x49,temp); } } else { /* Clear/set/clear GPIO */ temp = SiS_GetCH701x(SiS_Pr,0x5c); temp &= 0xef; SiS_SetCH701x(SiS_Pr,0x5c,temp); temp = SiS_GetCH701x(SiS_Pr,0x5c); temp |= 0x10; SiS_SetCH701x(SiS_Pr,0x5c,temp); temp = SiS_GetCH701x(SiS_Pr,0x5c); temp &= 0xef; SiS_SetCH701x(SiS_Pr,0x5c,temp); temp = SiS_GetCH701x(SiS_Pr,0x61); if(!temp) { SiS_SetCH701xForLCD(SiS_Pr); } } } else { /* 650 */ /* Reset Chrontel 7019 datapath */ SiS_SetCH701x(SiS_Pr,0x48,0x10); SiS_LongDelay(SiS_Pr, 1); SiS_SetCH701x(SiS_Pr,0x48,0x18); } } static void SiS_ChrontelInitTVVSync(struct SiS_Private *SiS_Pr) { unsigned short temp; if(SiS_Pr->ChipType == SIS_740) { if(SiS_WeHaveBacklightCtrl(SiS_Pr)) { SiS_ChrontelResetVSync(SiS_Pr); } } else { SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* Power up LVDS block */ temp = SiS_GetCH701x(SiS_Pr,0x49); temp &= 1; if(temp != 1) { /* TV block powered? (0 = yes, 1 = no) */ temp = SiS_GetCH701x(SiS_Pr,0x47); temp &= 0x70; SiS_SetCH701x(SiS_Pr,0x47,temp); /* enable VSYNC */ SiS_LongDelay(SiS_Pr, 3); temp = SiS_GetCH701x(SiS_Pr,0x47); temp |= 0x80; SiS_SetCH701x(SiS_Pr,0x47,temp); /* disable VSYNC */ } } } static void SiS_ChrontelDoSomething3(struct SiS_Private *SiS_Pr, unsigned short ModeNo) { unsigned short temp,temp1; if(SiS_Pr->ChipType == SIS_740) { temp = SiS_GetCH701x(SiS_Pr,0x61); if(temp < 1) { temp++; SiS_SetCH701x(SiS_Pr,0x61,temp); } SiS_SetCH701x(SiS_Pr,0x66,0x45); /* Panel power on */ SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* All power on */ SiS_LongDelay(SiS_Pr, 1); SiS_GenericDelay(SiS_Pr, 5887); } else { /* 650 */ temp1 = 0; temp = SiS_GetCH701x(SiS_Pr,0x61); if(temp < 2) { temp++; SiS_SetCH701x(SiS_Pr,0x61,temp); temp1 = 1; } SiS_SetCH701x(SiS_Pr,0x76,0xac); temp = SiS_GetCH701x(SiS_Pr,0x66); temp |= 0x5f; SiS_SetCH701x(SiS_Pr,0x66,temp); if(ModeNo > 0x13) { if(SiS_WeHaveBacklightCtrl(SiS_Pr)) { SiS_GenericDelay(SiS_Pr, 1023); } else { SiS_GenericDelay(SiS_Pr, 767); } } else { if(!temp1) SiS_GenericDelay(SiS_Pr, 767); } temp = SiS_GetCH701x(SiS_Pr,0x76); temp |= 0x03; SiS_SetCH701x(SiS_Pr,0x76,temp); temp = SiS_GetCH701x(SiS_Pr,0x66); temp &= 0x7f; SiS_SetCH701x(SiS_Pr,0x66,temp); SiS_LongDelay(SiS_Pr, 1); } } static void SiS_ChrontelDoSomething2(struct SiS_Private *SiS_Pr) { unsigned short temp,tempcl,tempch; SiS_LongDelay(SiS_Pr, 1); tempcl = 3; tempch = 0; do { temp = SiS_GetCH701x(SiS_Pr,0x66); temp &= 0x04; /* PLL stable? -> bail out */ if(temp == 0x04) break; if(SiS_Pr->ChipType == SIS_740) { /* Power down LVDS output, PLL normal operation */ SiS_SetCH701x(SiS_Pr,0x76,0xac); } SiS_SetCH701xForLCD(SiS_Pr); if(tempcl == 0) { if(tempch == 3) break; SiS_ChrontelResetDB(SiS_Pr); tempcl = 3; tempch++; } tempcl--; temp = SiS_GetCH701x(SiS_Pr,0x76); temp &= 0xfb; /* Reset PLL */ SiS_SetCH701x(SiS_Pr,0x76,temp); SiS_LongDelay(SiS_Pr, 2); temp = SiS_GetCH701x(SiS_Pr,0x76); temp |= 0x04; /* PLL normal operation */ SiS_SetCH701x(SiS_Pr,0x76,temp); if(SiS_Pr->ChipType == SIS_740) { SiS_SetCH701x(SiS_Pr,0x78,0xe0); /* PLL loop filter */ } else { SiS_SetCH701x(SiS_Pr,0x78,0x60); } SiS_LongDelay(SiS_Pr, 2); } while(0); SiS_SetCH701x(SiS_Pr,0x77,0x00); /* MV? */ } static void SiS_ChrontelDoSomething1(struct SiS_Private *SiS_Pr) { unsigned short temp; temp = SiS_GetCH701x(SiS_Pr,0x03); temp |= 0x80; /* Set datapath 1 to TV */ temp &= 0xbf; /* Set datapath 2 to LVDS */ SiS_SetCH701x(SiS_Pr,0x03,temp); if(SiS_Pr->ChipType == SIS_740) { temp = SiS_GetCH701x(SiS_Pr,0x1c); temp &= 0xfb; /* Normal XCLK phase */ SiS_SetCH701x(SiS_Pr,0x1c,temp); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); temp = SiS_GetCH701x(SiS_Pr,0x64); temp |= 0x40; /* ? Bit not defined */ SiS_SetCH701x(SiS_Pr,0x64,temp); temp = SiS_GetCH701x(SiS_Pr,0x03); temp &= 0x3f; /* D1 input to both LVDS and TV */ SiS_SetCH701x(SiS_Pr,0x03,temp); if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) { SiS_SetCH701x(SiS_Pr,0x63,0x40); /* LVDS off */ SiS_LongDelay(SiS_Pr, 1); SiS_SetCH701x(SiS_Pr,0x63,0x00); /* LVDS on */ SiS_ChrontelResetDB(SiS_Pr); SiS_ChrontelDoSomething2(SiS_Pr); SiS_ChrontelDoSomething3(SiS_Pr, 0); } else { temp = SiS_GetCH701x(SiS_Pr,0x66); if(temp != 0x45) { SiS_ChrontelResetDB(SiS_Pr); SiS_ChrontelDoSomething2(SiS_Pr); SiS_ChrontelDoSomething3(SiS_Pr, 0); } } } else { /* 650 */ SiS_ChrontelResetDB(SiS_Pr); SiS_ChrontelDoSomething2(SiS_Pr); temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34); SiS_ChrontelDoSomething3(SiS_Pr,temp); SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* All power on, LVDS normal operation */ } } #endif /* 315 series */ /*********************************************/ /* MAIN: SET CRT2 REGISTER GROUP */ /*********************************************/ BOOLEAN SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo) { #ifdef SIS300 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; #endif unsigned short ModeIdIndex, RefreshRateTableIndex; SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; if(!SiS_Pr->UseCustomMode) { SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex); } else { ModeIdIndex = 0; } /* Used for shifting CR33 */ SiS_Pr->SiS_SelectCRT2Rate = 4; SiS_UnLockCRT2(SiS_Pr); RefreshRateTableIndex = SiS_GetRatePtr(SiS_Pr, ModeNo, ModeIdIndex); SiS_SaveCRT2Info(SiS_Pr,ModeNo); if(SiS_Pr->SiS_SetFlag & LowModeTests) { SiS_DisableBridge(SiS_Pr); if((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (SiS_Pr->ChipType == SIS_730)) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,0x80); } SiS_SetCRT2ModeRegs(SiS_Pr, ModeNo, ModeIdIndex); } if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) { SiS_LockCRT2(SiS_Pr); SiS_DisplayOn(SiS_Pr); return TRUE; } SiS_GetCRT2Data(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); /* Set up Panel Link for LVDS and LCDA */ SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0; if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) || ((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) || ((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS30xBLV)) ) { SiS_GetLVDSDesData(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "(init301: LCDHDES 0x%03x LCDVDES 0x%03x)\n", SiS_Pr->SiS_LCDHDES, SiS_Pr->SiS_LCDVDES); xf86DrvMsg(0, X_INFO, "(init301: HDE 0x%03x VDE 0x%03x)\n", SiS_Pr->SiS_HDE, SiS_Pr->SiS_VDE); xf86DrvMsg(0, X_INFO, "(init301: VGAHDE 0x%03x VGAVDE 0x%03x)\n", SiS_Pr->SiS_VGAHDE, SiS_Pr->SiS_VGAVDE); xf86DrvMsg(0, X_INFO, "(init301: HT 0x%03x VT 0x%03x)\n", SiS_Pr->SiS_HT, SiS_Pr->SiS_VT); xf86DrvMsg(0, X_INFO, "(init301: VGAHT 0x%03x VGAVT 0x%03x)\n", SiS_Pr->SiS_VGAHT, SiS_Pr->SiS_VGAVT); #endif #endif if(SiS_Pr->SiS_SetFlag & LowModeTests) { SiS_SetGroup1(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_SetFlag & LowModeTests) { SiS_SetGroup2(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); #ifdef SIS315H SiS_SetGroup2_C_ELV(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); #endif SiS_SetGroup3(SiS_Pr, ModeNo, ModeIdIndex); SiS_SetGroup4(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); #ifdef SIS315H SiS_SetGroup4_C_ELV(SiS_Pr, ModeNo, ModeIdIndex); #endif SiS_SetGroup5(SiS_Pr, ModeNo, ModeIdIndex); SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex); /* For 301BDH (Panel link initialization): */ if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { if(!((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10)))) { if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { SiS_ModCRT1CRTC(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } } SiS_SetCRT2ECLK(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } } } else { SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex); SiS_ModCRT1CRTC(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex); SiS_SetCRT2ECLK(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex); if(SiS_Pr->SiS_SetFlag & LowModeTests) { if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { #ifdef SIS315H SiS_SetCH701xForLCD(SiS_Pr); #endif } } if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { SiS_SetCHTVReg(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex); } } } } #ifdef SIS300 if(SiS_Pr->ChipType < SIS_315H) { if(SiS_Pr->SiS_SetFlag & LowModeTests) { if(SiS_Pr->SiS_UseOEM) { if((SiS_Pr->SiS_UseROM) && (SiS_Pr->SiS_UseOEM == -1)) { if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { SiS_OEM300Setting(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } } else { SiS_OEM300Setting(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } } if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { SetOEMLCDData2(SiS_Pr, ModeNo, ModeIdIndex,RefreshRateTableIndex); } SiS_DisplayOn(SiS_Pr); } } } #endif #ifdef SIS315H if(SiS_Pr->ChipType >= SIS_315H) { if(SiS_Pr->SiS_SetFlag & LowModeTests) { if(SiS_Pr->ChipType < SIS_661) { SiS_FinalizeLCD(SiS_Pr, ModeNo, ModeIdIndex); SiS_OEM310Setting(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } else { SiS_OEM661Setting(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); } SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40); } } #endif if(SiS_Pr->SiS_SetFlag & LowModeTests) { SiS_EnableBridge(SiS_Pr); } SiS_DisplayOn(SiS_Pr); if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* Disable LCD panel when using TV */ SiS_SetRegSR11ANDOR(SiS_Pr,0xFF,0x0C); } else { /* Disable TV when using LCD */ SiS_SetCH70xxANDOR(SiS_Pr,0x0e,0x01,0xf8); } } if(SiS_Pr->SiS_SetFlag & LowModeTests) { SiS_LockCRT2(SiS_Pr); } return TRUE; } /*********************************************/ /* ENABLE/DISABLE LCD BACKLIGHT (SIS) */ /*********************************************/ void SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr) { /* Switch on LCD backlight on SiS30xLV */ SiS_DDC2Delay(SiS_Pr,0xff00); if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); SiS_WaitVBRetrace(SiS_Pr); } if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x01)) { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); } } void SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr) { /* Switch off LCD backlight on SiS30xLV */ SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); SiS_DDC2Delay(SiS_Pr,0xff00); } /*********************************************/ /* DDC RELATED FUNCTIONS */ /*********************************************/ static void SiS_SetupDDCN(struct SiS_Private *SiS_Pr) { SiS_Pr->SiS_DDC_NData = ~SiS_Pr->SiS_DDC_Data; SiS_Pr->SiS_DDC_NClk = ~SiS_Pr->SiS_DDC_Clk; if((SiS_Pr->SiS_DDC_Index == 0x11) && (SiS_Pr->SiS_SensibleSR11)) { SiS_Pr->SiS_DDC_NData &= 0x0f; SiS_Pr->SiS_DDC_NClk &= 0x0f; } } #ifdef SIS300 static unsigned char * SiS_SetTrumpBlockLoop(struct SiS_Private *SiS_Pr, unsigned char *dataptr) { int i, j, num; unsigned short tempah,temp; unsigned char *mydataptr; for(i=0; i<20; i++) { /* Do 20 attempts to write */ mydataptr = dataptr; num = *mydataptr++; if(!num) return mydataptr; if(i) { SiS_SetStop(SiS_Pr); SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT * 2); } if(SiS_SetStart(SiS_Pr)) continue; /* Set start condition */ tempah = SiS_Pr->SiS_DDC_DeviceAddr; temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write DAB (S0=0=write) */ if(temp) continue; /* (ERROR: no ack) */ tempah = *mydataptr++; temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write register number */ if(temp) continue; /* (ERROR: no ack) */ for(j=0; jSiS_DDC_DeviceAddr = 0xF0; /* DAB (Device Address Byte) */ SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ SiS_SetupDDCN(SiS_Pr); SiS_SetSwitchDDC2(SiS_Pr); while(*dataptr) { dataptr = SiS_SetTrumpBlockLoop(SiS_Pr, dataptr); if(!dataptr) return FALSE; } #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "Trumpion block success\n"); #endif #endif return TRUE; } #endif /* The Chrontel 700x is connected to the 630/730 via * the 630/730's DDC/I2C port. * * On 630(S)T chipset, the index changed from 0x11 to * 0x0a, possibly for working around the DDC problems */ static BOOLEAN SiS_SetChReg(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val, unsigned short myor) { unsigned short temp, i; for(i=0; i<20; i++) { /* Do 20 attempts to write */ if(i) { SiS_SetStop(SiS_Pr); SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT * 4); } if(SiS_SetStart(SiS_Pr)) continue; /* Set start condition */ temp = SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_DeviceAddr); /* Write DAB (S0=0=write) */ if(temp) continue; /* (ERROR: no ack) */ temp = SiS_WriteDDC2Data(SiS_Pr, (reg | myor)); /* Write RAB (700x: set bit 7, see datasheet) */ if(temp) continue; /* (ERROR: no ack) */ temp = SiS_WriteDDC2Data(SiS_Pr, val); /* Write data */ if(temp) continue; /* (ERROR: no ack) */ if(SiS_SetStop(SiS_Pr)) continue; /* Set stop condition */ SiS_Pr->SiS_ChrontelInit = 1; return TRUE; } return FALSE; } /* Write to Chrontel 700x */ void SiS_SetCH700x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val) { SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); if(!(SiS_Pr->SiS_ChrontelInit)) { SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ SiS_SetupDDCN(SiS_Pr); } if( (!(SiS_SetChReg(SiS_Pr, reg, val, 0x80))) && (!(SiS_Pr->SiS_ChrontelInit)) ) { SiS_Pr->SiS_DDC_Index = 0x0a; SiS_Pr->SiS_DDC_Data = 0x80; SiS_Pr->SiS_DDC_Clk = 0x40; SiS_SetupDDCN(SiS_Pr); SiS_SetChReg(SiS_Pr, reg, val, 0x80); } } /* Write to Chrontel 701x */ /* Parameter is [Data (S15-S8) | Register no (S7-S0)] */ void SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val) { SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ SiS_SetupDDCN(SiS_Pr); SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ SiS_SetChReg(SiS_Pr, reg, val, 0); } #ifdef SIS_LINUX_KERNEL static #endif void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val) { if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) SiS_SetCH700x(SiS_Pr, reg, val); else SiS_SetCH701x(SiS_Pr, reg, val); } static unsigned short SiS_GetChReg(struct SiS_Private *SiS_Pr, unsigned short myor) { unsigned short tempah, temp, i; for(i=0; i<20; i++) { /* Do 20 attempts to read */ if(i) { SiS_SetStop(SiS_Pr); SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT * 4); } if(SiS_SetStart(SiS_Pr)) continue; /* Set start condition */ temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_DeviceAddr); /* Write DAB (S0=0=write) */ if(temp) continue; /* (ERROR: no ack) */ temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_ReadAddr | myor); /* Write RAB (700x: | 0x80) */ if(temp) continue; /* (ERROR: no ack) */ if (SiS_SetStart(SiS_Pr)) continue; /* Re-start */ temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_DeviceAddr | 0x01);/* DAB (S0=1=read) */ if(temp) continue; /* (ERROR: no ack) */ tempah = SiS_ReadDDC2Data(SiS_Pr); /* Read byte */ if(SiS_SetStop(SiS_Pr)) continue; /* Stop condition */ SiS_Pr->SiS_ChrontelInit = 1; return tempah; } return 0xFFFF; } /* Read from Chrontel 700x */ /* Parameter is [Register no (S7-S0)] */ unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempbx) { unsigned short result; SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); if(!(SiS_Pr->SiS_ChrontelInit)) { SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ SiS_SetupDDCN(SiS_Pr); } SiS_Pr->SiS_DDC_ReadAddr = tempbx; if( ((result = SiS_GetChReg(SiS_Pr,0x80)) == 0xFFFF) && (!SiS_Pr->SiS_ChrontelInit) ) { SiS_Pr->SiS_DDC_Index = 0x0a; SiS_Pr->SiS_DDC_Data = 0x80; SiS_Pr->SiS_DDC_Clk = 0x40; SiS_SetupDDCN(SiS_Pr); result = SiS_GetChReg(SiS_Pr,0x80); } return result; } /* Read from Chrontel 701x */ /* Parameter is [Register no (S7-S0)] */ unsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempbx) { SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ SiS_SetupDDCN(SiS_Pr); SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ SiS_Pr->SiS_DDC_ReadAddr = tempbx; return SiS_GetChReg(SiS_Pr,0); } /* Read from Chrontel 70xx */ /* Parameter is [Register no (S7-S0)] */ #ifdef SIS_LINUX_KERNEL static #endif unsigned short SiS_GetCH70xx(struct SiS_Private *SiS_Pr, unsigned short tempbx) { if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) return SiS_GetCH700x(SiS_Pr, tempbx); else return SiS_GetCH701x(SiS_Pr, tempbx); } void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char myor, unsigned short myand) { unsigned short tempbl; tempbl = (SiS_GetCH70xx(SiS_Pr, (reg & 0xFF)) & myand) | myor; SiS_SetCH70xx(SiS_Pr, reg, tempbl); } /* Our own DDC functions */ #ifndef SIS_XORG_XF86 static #endif unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, BOOLEAN checkcr32, unsigned int VBFlags2) { unsigned char ddcdtype[] = { 0xa0, 0xa0, 0xa0, 0xa2, 0xa6 }; unsigned char flag, cr32; unsigned short temp = 0, myadaptnum = adaptnum; if(adaptnum != 0) { if(!(VBFlags2 & VB2_SISTMDSBRIDGE)) return 0xFFFF; if((VBFlags2 & VB2_30xBDH) && (adaptnum == 1)) return 0xFFFF; } /* adapternum for SiS bridges: 0 = CRT1, 1 = LCD, 2 = VGA2 */ SiS_Pr->SiS_ChrontelInit = 0; /* force re-detection! */ SiS_Pr->SiS_DDC_SecAddr = 0; SiS_Pr->SiS_DDC_DeviceAddr = ddcdtype[DDCdatatype]; SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_P3c4; SiS_Pr->SiS_DDC_Index = 0x11; flag = 0xff; cr32 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x32); #if 0 if(VBFlags2 & VB2_SISBRIDGE) { if(myadaptnum == 0) { if(!(cr32 & 0x20)) { myadaptnum = 2; if(!(cr32 & 0x10)) { myadaptnum = 1; if(!(cr32 & 0x08)) { myadaptnum = 0; } } } } } #endif if(VGAEngine == SIS_300_VGA) { /* 300 series */ if(myadaptnum != 0) { flag = 0; if(VBFlags2 & VB2_SISBRIDGE) { SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_Part4Port; SiS_Pr->SiS_DDC_Index = 0x0f; } } if(!(VBFlags2 & VB2_301)) { if((cr32 & 0x80) && (checkcr32)) { if(myadaptnum >= 1) { if(!(cr32 & 0x08)) { myadaptnum = 1; if(!(cr32 & 0x10)) return 0xFFFF; } } } } temp = 4 - (myadaptnum * 2); if(flag) temp = 0; } else { /* 315/330 series */ /* here we simplify: 0 = CRT1, 1 = CRT2 (VGA, LCD) */ if(VBFlags2 & VB2_SISBRIDGE) { if(myadaptnum == 2) { myadaptnum = 1; } } if(myadaptnum == 1) { flag = 0; if(VBFlags2 & VB2_SISBRIDGE) { SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_Part4Port; SiS_Pr->SiS_DDC_Index = 0x0f; } } if((cr32 & 0x80) && (checkcr32)) { if(myadaptnum >= 1) { if(!(cr32 & 0x08)) { myadaptnum = 1; if(!(cr32 & 0x10)) return 0xFFFF; } } } temp = myadaptnum; if(myadaptnum == 1) { temp = 0; if(VBFlags2 & VB2_LVDS) flag = 0xff; } if(flag) temp = 0; } SiS_Pr->SiS_DDC_Data = 0x02 << temp; SiS_Pr->SiS_DDC_Clk = 0x01 << temp; SiS_SetupDDCN(SiS_Pr); #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "DDC Port %x Index %x Shift %d\n", SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, temp); #endif #endif return 0; } static unsigned short SiS_WriteDABDDC(struct SiS_Private *SiS_Pr) { if(SiS_SetStart(SiS_Pr)) return 0xFFFF; if(SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_DeviceAddr)) { return 0xFFFF; } if(SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_SecAddr)) { return 0xFFFF; } return 0; } static unsigned short SiS_PrepareReadDDC(struct SiS_Private *SiS_Pr) { if(SiS_SetStart(SiS_Pr)) return 0xFFFF; if(SiS_WriteDDC2Data(SiS_Pr, (SiS_Pr->SiS_DDC_DeviceAddr | 0x01))) { return 0xFFFF; } return 0; } static unsigned short SiS_PrepareDDC(struct SiS_Private *SiS_Pr) { if(SiS_WriteDABDDC(SiS_Pr)) SiS_WriteDABDDC(SiS_Pr); if(SiS_PrepareReadDDC(SiS_Pr)) return (SiS_PrepareReadDDC(SiS_Pr)); return 0; } static void SiS_SendACK(struct SiS_Private *SiS_Pr, unsigned short yesno) { SiS_SetSCLKLow(SiS_Pr); if(yesno) { SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NData, SiS_Pr->SiS_DDC_Data); } else { SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NData, 0); } SiS_SetSCLKHigh(SiS_Pr); } static unsigned short SiS_DoProbeDDC(struct SiS_Private *SiS_Pr) { unsigned char mask, value; unsigned short temp, ret=0; BOOLEAN failed = FALSE; SiS_SetSwitchDDC2(SiS_Pr); if(SiS_PrepareDDC(SiS_Pr)) { SiS_SetStop(SiS_Pr); #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "Probe: Prepare failed\n"); #endif #endif return 0xFFFF; } mask = 0xf0; value = 0x20; if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { temp = (unsigned char)SiS_ReadDDC2Data(SiS_Pr); SiS_SendACK(SiS_Pr, 0); if(temp == 0) { mask = 0xff; value = 0xff; } else { failed = TRUE; ret = 0xFFFF; #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "Probe: Read 1 failed\n"); #endif #endif } } if(failed == FALSE) { temp = (unsigned char)SiS_ReadDDC2Data(SiS_Pr); SiS_SendACK(SiS_Pr, 1); temp &= mask; if(temp == value) ret = 0; else { ret = 0xFFFF; #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "Probe: Read 2 failed\n"); #endif #endif if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { if(temp == 0x30) ret = 0; } } } SiS_SetStop(SiS_Pr); return ret; } #ifndef SIS_XORG_XF86 static #endif unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr) { unsigned short flag; flag = 0x180; SiS_Pr->SiS_DDC_DeviceAddr = 0xa0; if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x02; SiS_Pr->SiS_DDC_DeviceAddr = 0xa2; if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x08; SiS_Pr->SiS_DDC_DeviceAddr = 0xa6; if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x10; if(!(flag & 0x1a)) flag = 0; return flag; } #ifndef SIS_XORG_XF86 static #endif unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, unsigned char *buffer) { unsigned short flag, length, i; unsigned char chksum,gotcha; if(DDCdatatype > 4) return 0xFFFF; flag = 0; SiS_SetSwitchDDC2(SiS_Pr); if(!(SiS_PrepareDDC(SiS_Pr))) { length = 127; if(DDCdatatype != 1) length = 255; chksum = 0; gotcha = 0; for(i=0; i 0: Returns 0 if reading OK (included a correct checksum) if DDCdatatype = 0: Returns supported DDC modes */ unsigned short SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, unsigned char *buffer, unsigned int VBFlags2) { unsigned char sr1f, cr17=1; unsigned short result; if(adaptnum > 2) return 0xFFFF; if(DDCdatatype > 4) return 0xFFFF; if((!(VBFlags2 & VB2_VIDEOBRIDGE)) && (adaptnum > 0)) return 0xFFFF; if(SiS_InitDDCRegs(SiS_Pr, VBFlags, VGAEngine, adaptnum, DDCdatatype, FALSE, VBFlags2) == 0xFFFF) return 0xFFFF; sr1f = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f); SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x1f,0x3f,0x04); if(VGAEngine == SIS_300_VGA) { cr17 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80; if(!cr17) { SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x17,0x80); SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x01); SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x03); } } if((sr1f) || (!cr17)) { SiS_WaitRetrace1(SiS_Pr); SiS_WaitRetrace1(SiS_Pr); SiS_WaitRetrace1(SiS_Pr); SiS_WaitRetrace1(SiS_Pr); } if(DDCdatatype == 0) { result = SiS_ProbeDDC(SiS_Pr); } else { result = SiS_ReadDDC(SiS_Pr, DDCdatatype, buffer); if((!result) && (DDCdatatype == 1)) { if((buffer[0] == 0x00) && (buffer[1] == 0xff) && (buffer[2] == 0xff) && (buffer[3] == 0xff) && (buffer[4] == 0xff) && (buffer[5] == 0xff) && (buffer[6] == 0xff) && (buffer[7] == 0x00) && (buffer[0x12] == 1)) { if(!SiS_Pr->DDCPortMixup) { if(adaptnum == 1) { if(!(buffer[0x14] & 0x80)) result = 0xFFFE; } else { if(buffer[0x14] & 0x80) result = 0xFFFE; } } } } } SiS_SetReg(SiS_Pr->SiS_P3c4,0x1f,sr1f); if(VGAEngine == SIS_300_VGA) { SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x17,0x7f,cr17); } return result; } /* Generic I2C functions for Chrontel & DDC --------- */ static void SiS_SetSwitchDDC2(struct SiS_Private *SiS_Pr) { SiS_SetSCLKHigh(SiS_Pr); SiS_WaitRetrace1(SiS_Pr); SiS_SetSCLKLow(SiS_Pr); SiS_WaitRetrace1(SiS_Pr); } unsigned short SiS_ReadDDC1Bit(struct SiS_Private *SiS_Pr) { SiS_WaitRetrace1(SiS_Pr); return ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x02) >> 1); } /* Set I2C start condition */ /* This is done by a SD high-to-low transition while SC is high */ static unsigned short SiS_SetStart(struct SiS_Private *SiS_Pr) { if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NData, SiS_Pr->SiS_DDC_Data); /* SD->high */ if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NData, 0x00); /* SD->low = start condition */ if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->low) */ return 0; } /* Set I2C stop condition */ /* This is done by a SD low-to-high transition while SC is high */ static unsigned short SiS_SetStop(struct SiS_Private *SiS_Pr) { if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NData, 0x00); /* SD->low */ if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NData, SiS_Pr->SiS_DDC_Data); /* SD->high = stop condition */ if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->high) */ return 0; } /* Write 8 bits of data */ static unsigned short SiS_WriteDDC2Data(struct SiS_Private *SiS_Pr, unsigned short tempax) { unsigned short i,flag,temp; flag = 0x80; for(i = 0; i < 8; i++) { SiS_SetSCLKLow(SiS_Pr); /* SC->low */ if(tempax & flag) { SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NData, SiS_Pr->SiS_DDC_Data); /* Write bit (1) to SD */ } else { SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NData, 0x00); /* Write bit (0) to SD */ } SiS_SetSCLKHigh(SiS_Pr); /* SC->high */ flag >>= 1; } temp = SiS_CheckACK(SiS_Pr); /* Check acknowledge */ return temp; } static unsigned short SiS_ReadDDC2Data(struct SiS_Private *SiS_Pr) { unsigned short i, temp, getdata; getdata = 0; for(i = 0; i < 8; i++) { getdata <<= 1; SiS_SetSCLKLow(SiS_Pr); SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NData, SiS_Pr->SiS_DDC_Data); SiS_SetSCLKHigh(SiS_Pr); temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); if(temp & SiS_Pr->SiS_DDC_Data) getdata |= 0x01; } return getdata; } static unsigned short SiS_SetSCLKLow(struct SiS_Private *SiS_Pr) { SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NClk, 0x00); /* SetSCLKLow() */ SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); return 0; } static unsigned short SiS_SetSCLKHigh(struct SiS_Private *SiS_Pr) { unsigned short temp, watchdog=1000; SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NClk, SiS_Pr->SiS_DDC_Clk); /* SetSCLKHigh() */ do { temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); } while((!(temp & SiS_Pr->SiS_DDC_Clk)) && --watchdog); if (!watchdog) { #ifdef SIS_XORG_XF86 #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "SetClkHigh failed\n"); #endif #endif return 0xFFFF; } SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); return 0; } /* Check I2C acknowledge */ /* Returns 0 if ack ok, non-0 if ack not ok */ static unsigned short SiS_CheckACK(struct SiS_Private *SiS_Pr) { unsigned short tempah; SiS_SetSCLKLow(SiS_Pr); /* (SC->low) */ SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, SiS_Pr->SiS_DDC_NData, SiS_Pr->SiS_DDC_Data); /* (SD->high) */ SiS_SetSCLKHigh(SiS_Pr); /* SC->high = clock impulse for ack */ tempah = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); /* Read SD */ SiS_SetSCLKLow(SiS_Pr); /* SC->low = end of clock impulse */ if(tempah & SiS_Pr->SiS_DDC_Data) return 1; /* Ack OK if bit = 0 */ return 0; } /* End of I2C functions ----------------------- */ /* =============== SiS 315/330 O.E.M. ================= */ #ifdef SIS315H static unsigned short GetRAMDACromptr(struct SiS_Private *SiS_Pr) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short romptr; if(SiS_Pr->ChipType < SIS_330) { romptr = SISGETROMW(0x128); if(SiS_Pr->SiS_VBType & VB_SIS30xB) romptr = SISGETROMW(0x12a); } else { romptr = SISGETROMW(0x1a8); if(SiS_Pr->SiS_VBType & VB_SIS30xB) romptr = SISGETROMW(0x1aa); } return romptr; } static unsigned short GetLCDromptr(struct SiS_Private *SiS_Pr) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short romptr; if(SiS_Pr->ChipType < SIS_330) { romptr = SISGETROMW(0x120); if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) romptr = SISGETROMW(0x122); } else { romptr = SISGETROMW(0x1a0); if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) romptr = SISGETROMW(0x1a2); } return romptr; } static unsigned short GetTVromptr(struct SiS_Private *SiS_Pr) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short romptr; if(SiS_Pr->ChipType < SIS_330) { romptr = SISGETROMW(0x114); if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) romptr = SISGETROMW(0x11a); } else { romptr = SISGETROMW(0x194); if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) romptr = SISGETROMW(0x19a); } return romptr; } static unsigned short GetLCDPtrIndexBIOS(struct SiS_Private *SiS_Pr) { unsigned short index; if((IS_SIS650) && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { if(!(SiS_IsNotM650orLater(SiS_Pr))) { if((index = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0)) { index >>= 4; index *= 3; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; return index; } } } index = SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F; if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) index -= 5; if(SiS_Pr->SiS_VBType & VB_SIS301C) { /* 1.15.20 and later (not VB specific) */ if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) index -= 5; if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768) index -= 5; } else { if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) index -= 6; } index--; index *= 3; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; return index; } static unsigned short GetLCDPtrIndex(struct SiS_Private *SiS_Pr) { unsigned short index; index = ((SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F) - 1) * 3; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; return index; } static unsigned short GetTVPtrIndex(struct SiS_Private *SiS_Pr) { unsigned short index; index = 0; if(SiS_Pr->SiS_TVMode & TVSetPALTiming) index = 1; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) index = 2; index <<= 1; if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { index++; } return index; } static unsigned int GetOEMTVPtr661_2_GEN(struct SiS_Private *SiS_Pr, int addme) { unsigned short index = 0, temp = 0; if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 1; if(SiS_Pr->SiS_TVMode & TVSetPALM) index = 2; if(SiS_Pr->SiS_TVMode & TVSetPALN) index = 3; if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) index = 6; if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { index = 4; if(SiS_Pr->SiS_TVMode & TVSetPALM) index++; if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) index = 7; } if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { index += addme; temp++; } temp += 0x0100; } return (unsigned int)(index | (temp << 16)); } static unsigned int GetOEMTVPtr661_2_OLD(struct SiS_Private *SiS_Pr) { return (GetOEMTVPtr661_2_GEN(SiS_Pr, 8)); } #if 0 static unsigned int GetOEMTVPtr661_2_NEW(struct SiS_Private *SiS_Pr) { return (GetOEMTVPtr661_2_GEN(SiS_Pr, 6)); } #endif static int GetOEMTVPtr661(struct SiS_Private *SiS_Pr) { int index = 0; if(SiS_Pr->SiS_TVMode & (TVSetYPbPr625i | TVSetYPbPr625p)) return 0xffff; if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 2; if(SiS_Pr->SiS_ROMNew) { if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 4; if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 6; if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 8; if(SiS_Pr->SiS_TVMode & TVSetHiVision) index = 10; } else { if(SiS_Pr->SiS_TVMode & TVSetHiVision) index = 4; if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 6; if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 8; if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 10; } if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) index++; return index; } static void SetDelayComp(struct SiS_Private *SiS_Pr, unsigned short ModeNo) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short delay=0,index,myindex,temp,romptr=0; BOOLEAN dochiptest = TRUE; if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x20,0xbf); } else { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x35,0x7f); } /* Find delay (from ROM, internal tables, PCI subsystem) */ if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { /* ------------ VGA */ if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { romptr = GetRAMDACromptr(SiS_Pr); } if(romptr) delay = ROMAddr[romptr]; else { delay = 0x04; if(SiS_Pr->SiS_VBType & VB_SIS30xB) { if(IS_SIS650) { delay = 0x0a; } else if(IS_SIS740) { delay = 0x00; } else if(SiS_Pr->ChipType < SIS_330) { delay = 0x0c; } else { delay = 0x0c; } } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { delay = 0x00; } } } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD|SetCRT2ToLCDA)) { /* ---------- LCD/LCDA */ BOOLEAN gotitfrompci = FALSE; /* Could we detect a PDC for LCD or did we get a user-defined? If yes, use it */ if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { if(SiS_Pr->PDC != -1) { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((SiS_Pr->PDC >> 1) & 0x0f)); SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((SiS_Pr->PDC & 0x01) << 7)); return; } } else { if(SiS_Pr->PDCA != -1) { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((SiS_Pr->PDCA << 3) & 0xf0)); SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((SiS_Pr->PDCA & 0x01) << 6)); return; } } /* Custom Panel? */ if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { delay = 0x00; if((SiS_Pr->PanelXRes <= 1280) && (SiS_Pr->PanelYRes <= 1024)) { delay = 0x20; } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,delay); } else { delay = 0x0c; if(SiS_Pr->SiS_VBType & VB_SIS301C) { delay = 0x03; if((SiS_Pr->PanelXRes > 1280) && (SiS_Pr->PanelYRes > 1024)) { delay = 0x00; } } else if(SiS_Pr->SiS_VBType & VB_SISLVDS) { if(IS_SIS740) delay = 0x01; else delay = 0x03; } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,delay); } return; } /* This is a piece of typical SiS crap: They code the OEM LCD * delay into the code, at no defined place in the BIOS. * We now have to start doing a PCI subsystem check here. */ switch(SiS_Pr->SiS_CustomT) { case CUT_COMPAQ1280: case CUT_COMPAQ12802: if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { gotitfrompci = TRUE; dochiptest = FALSE; delay = 0x03; } break; case CUT_CLEVO1400: case CUT_CLEVO14002: gotitfrompci = TRUE; dochiptest = FALSE; delay = 0x02; break; case CUT_CLEVO1024: case CUT_CLEVO10242: if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { gotitfrompci = TRUE; dochiptest = FALSE; delay = 0x33; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); delay &= 0x0f; } break; } /* Could we find it through the PCI ID? If no, use ROM or table */ if(!gotitfrompci) { index = GetLCDPtrIndexBIOS(SiS_Pr); myindex = GetLCDPtrIndex(SiS_Pr); if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { if(SiS_IsNotM650orLater(SiS_Pr)) { if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { /* Always use the second pointer on 650; some BIOSes */ /* still carry old 301 data at the first location */ /* romptr = SISGETROMW(0x120); */ /* if(SiS_Pr->SiS_VBType & VB_SIS302LV) */ romptr = SISGETROMW(0x122); if(!romptr) return; delay = ROMAddr[(romptr + index)]; } else { delay = SiS310_LCDDelayCompensation_650301LV[myindex]; } } else { delay = SiS310_LCDDelayCompensation_651301LV[myindex]; if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) delay = SiS310_LCDDelayCompensation_651302LV[myindex]; } } else if(SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew)) && (SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) && (SiS_Pr->SiS_LCDResInfo != Panel_1280x768) && (SiS_Pr->SiS_LCDResInfo != Panel_1280x960) && (SiS_Pr->SiS_LCDResInfo != Panel_1600x1200) && ((romptr = GetLCDromptr(SiS_Pr)))) { /* Data for 1280x1024 wrong in 301B BIOS */ /* Data for 1600x1200 wrong in 301C BIOS */ delay = ROMAddr[(romptr + index)]; } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { if(IS_SIS740) delay = 0x03; else delay = 0x00; } else { delay = SiS310_LCDDelayCompensation_301[myindex]; if(SiS_Pr->SiS_VBType & VB_SISLVDS) { if(IS_SIS740) delay = 0x01; else if(SiS_Pr->ChipType <= SIS_315PRO) delay = SiS310_LCDDelayCompensation_3xx301LV[myindex]; else delay = SiS310_LCDDelayCompensation_650301LV[myindex]; } else if(SiS_Pr->SiS_VBType & VB_SIS301C) { if(IS_SIS740) delay = 0x01; /* ? */ else delay = 0x03; if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) delay = 0x00; /* experience */ } else if(SiS_Pr->SiS_VBType & VB_SIS30xB) { if(IS_SIS740) delay = 0x01; else delay = SiS310_LCDDelayCompensation_3xx301B[myindex]; } } } /* got it from PCI */ if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,((delay << 4) & 0xf0)); dochiptest = FALSE; } } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* ------------ TV */ index = GetTVPtrIndex(SiS_Pr); if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { if(SiS_IsNotM650orLater(SiS_Pr)) { if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { /* Always use the second pointer on 650; some BIOSes */ /* still carry old 301 data at the first location */ /* romptr = SISGETROMW(0x114); */ /* if(SiS_Pr->SiS_VBType & VB_SIS302LV) */ romptr = SISGETROMW(0x11a); if(!romptr) return; delay = ROMAddr[romptr + index]; } else { delay = SiS310_TVDelayCompensation_301B[index]; } } else { switch(SiS_Pr->SiS_CustomT) { case CUT_COMPAQ1280: case CUT_COMPAQ12802: case CUT_CLEVO1400: case CUT_CLEVO14002: delay = 0x02; dochiptest = FALSE; break; case CUT_CLEVO1024: case CUT_CLEVO10242: delay = 0x03; dochiptest = FALSE; break; default: delay = SiS310_TVDelayCompensation_651301LV[index]; if(SiS_Pr->SiS_VBType & VB_SIS302LV) { delay = SiS310_TVDelayCompensation_651302LV[index]; } } } } else if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { romptr = GetTVromptr(SiS_Pr); if(!romptr) return; delay = ROMAddr[romptr + index]; } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { delay = SiS310_TVDelayCompensation_LVDS[index]; } else { delay = SiS310_TVDelayCompensation_301[index]; if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { if(IS_SIS740) { delay = SiS310_TVDelayCompensation_740301B[index]; /* LV: use 301 data? BIOS bug? */ } else { delay = SiS310_TVDelayCompensation_301B[index]; if(SiS_Pr->SiS_VBType & VB_SIS301C) delay = 0x02; } } } if(SiS_LCDAEnabled(SiS_Pr)) { delay &= 0x0f; dochiptest = FALSE; } } else return; /* Write delay */ if(SiS_Pr->SiS_VBType & VB_SISVB) { if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SISLVDS) && dochiptest) { temp = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0) >> 4; if(temp == 8) { /* 1400x1050 BIOS (COMPAL) */ delay &= 0x0f; delay |= 0xb0; } else if(temp == 6) { delay &= 0x0f; delay |= 0xc0; } else if(temp > 7) { /* 1280x1024 BIOS (which one?) */ delay = 0x35; } SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); } else { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); } } else { /* LVDS */ if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); } else { if(IS_SIS650 && (SiS_Pr->SiS_IF_DEF_CH70xx != 0)) { delay <<= 4; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,delay); } else { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); } } } } static void SetAntiFlicker(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short index,temp,temp1,romptr=0; if(SiS_Pr->SiS_TVMode & TVSetYPbPrProg) return; if(ModeNo<=0x13) index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVFlickerIndex; else index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVFlickerIndex; temp = GetTVPtrIndex(SiS_Pr); temp >>= 1; /* 0: NTSC/YPbPr525, 1: PAL/YPbPr625, 2: HiTV */ temp1 = temp; if(SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { if(SiS_Pr->ChipType >= SIS_661) { temp1 = GetOEMTVPtr661(SiS_Pr); if(temp1 != 0xffff) { temp1 >>= 1; romptr = SISGETROMW(0x260); if(SiS_Pr->ChipType >= SIS_760) { romptr = SISGETROMW(0x360); } } } else if(SiS_Pr->ChipType >= SIS_330) { romptr = SISGETROMW(0x192); } else { romptr = SISGETROMW(0x112); } } if(romptr) { temp1 <<= 1; temp = ROMAddr[romptr + temp1 + index]; } else { temp = SiS310_TVAntiFlick1[temp][index]; } temp <<= 4; SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8f,temp); /* index 0A D[6:4] */ } static void SetEdgeEnhance(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short index,temp,temp1,romptr=0; temp = temp1 = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr525, 1: PAL/YPbPr625, 2: HiTV */ if(ModeNo <= 0x13) index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVEdgeIndex; else index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVEdgeIndex; if(SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { if(SiS_Pr->ChipType >= SIS_661) { temp1 = GetOEMTVPtr661(SiS_Pr); if(temp1 != 0xffff) { temp1 >>= 1; romptr = SISGETROMW(0x26c); if(SiS_Pr->ChipType >= SIS_760) { romptr = SISGETROMW(0x36c); } } } else if(SiS_Pr->ChipType >= SIS_330) { romptr = SISGETROMW(0x1a4); } else { romptr = SISGETROMW(0x124); } } if(romptr) { temp1 <<= 1; temp = ROMAddr[romptr + temp1 + index]; } else { temp = SiS310_TVEdge1[temp][index]; } temp <<= 5; SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x3A,0x1F,temp); /* index 0A D[7:5] */ } static void SetYFilter(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex) { unsigned short index, temp, i, j; if(ModeNo <= 0x13) { index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVYFilterIndex; } else { index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVYFilterIndex; } temp = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp = 1; /* NTSC-J uses PAL */ else if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 3; /* PAL-M */ else if(SiS_Pr->SiS_TVMode & TVSetPALN) temp = 4; /* PAL-N */ if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp = 1; /* HiVision uses PAL */ if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { for(i=0x35, j=0; i<=0x38; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]); } for(i=0x48; i<=0x4A; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]); } } else { for(i=0x35, j=0; i<=0x38; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter1[temp][index][j]); } } } static void SetPhaseIncr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short index,temp,i,j,resinfo,romptr=0; unsigned int lindex; if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) return; /* NTSC-J data not in BIOS, and already set in SetGroup2 */ if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) return; if((SiS_Pr->ChipType >= SIS_661) || SiS_Pr->SiS_ROMNew) { lindex = GetOEMTVPtr661_2_OLD(SiS_Pr) & 0xffff; lindex <<= 2; for(j=0, i=0x31; i<=0x34; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS_TVPhase[lindex + j]); } return; } /* PAL-M, PAL-N not in BIOS, and already set in SetGroup2 */ if(SiS_Pr->SiS_TVMode & (TVSetPALM | TVSetPALN)) return; if(ModeNo<=0x13) { resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; } else { resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; } temp = GetTVPtrIndex(SiS_Pr); /* 0: NTSC Graphics, 1: NTSC Text, 2: PAL Graphics, * 3: PAL Text, 4: HiTV Graphics 5: HiTV Text */ if(SiS_Pr->SiS_UseROM) { romptr = SISGETROMW(0x116); if(SiS_Pr->ChipType >= SIS_330) { romptr = SISGETROMW(0x196); } if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { romptr = SISGETROMW(0x11c); if(SiS_Pr->ChipType >= SIS_330) { romptr = SISGETROMW(0x19c); } if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && (!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode))) { romptr = SISGETROMW(0x116); if(SiS_Pr->ChipType >= SIS_330) { romptr = SISGETROMW(0x196); } } } } if(romptr) { romptr += (temp << 2); for(j=0, i=0x31; i<=0x34; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); } } else { index = temp % 2; temp >>= 1; /* 0:NTSC, 1:PAL, 2:HiTV */ for(j=0, i=0x31; i<=0x34; i++, j++) { if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]); else if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr2[temp][index][j]); else SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]); } } if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision))) { if((!(SiS_Pr->SiS_TVMode & (TVSetPAL | TVSetYPbPrProg))) && (ModeNo > 0x13)) { if((resinfo == SIS_RI_640x480) || (resinfo == SIS_RI_800x600)) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x21); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0xf0); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xf5); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7f); } else if(resinfo == SIS_RI_1024x768) { SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x1e); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0x8b); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xfb); SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7b); } } } } static void SetDelayComp661(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RTI) { unsigned short delay = 0, romptr = 0, index, lcdpdcindex; unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA | SetCRT2ToRAMDAC))) return; /* 1. New ROM: VGA2 and LCD/LCDA-Pass1:1 */ /* (If a custom mode is used, Pass1:1 is always set; hence we do this:) */ if(SiS_Pr->SiS_ROMNew) { if((SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) || ((SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && (SiS_Pr->SiS_LCDInfo & LCDPass11))) { index = 25; if(SiS_Pr->UseCustomMode) { index = SiS_Pr->CSRClock; } else if(ModeNo > 0x13) { index = SiS_GetVCLK2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RTI); index = SiS_Pr->SiS_VCLKData[index].CLOCK; } if(index < 25) index = 25; index = ((index / 25) - 1) << 1; if((ROMAddr[0x5b] & 0x80) || (SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD))) { index++; } romptr = SISGETROMW(0x104); delay = ROMAddr[romptr + index]; if(SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD)) { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); } else { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); } return; } } /* 2. Old ROM: VGA2 and LCD/LCDA-Pass 1:1 */ if(SiS_Pr->UseCustomMode) delay = 0x04; else if(ModeNo <= 0x13) delay = 0x04; else delay = (SiS_Pr->SiS_RefIndex[RTI].Ext_PDC >> 4); delay |= (delay << 8); if(SiS_Pr->ChipType >= XGI_20) { delay = 0x0606; if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { delay = 0x0404; if(SiS_Pr->SiS_XGIROM) { index = GetTVPtrIndex(SiS_Pr); if((romptr = SISGETROMW(0x35e))) { delay = (ROMAddr[romptr + index] & 0x0f) << 1; delay |= (delay << 8); } } if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { if(SiS_Pr->ChipType == XGI_40 && SiS_Pr->ChipRevision == 0x02) { delay -= 0x0404; } } } } else if(SiS_Pr->ChipType >= SIS_340) { delay = 0x0606; if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { delay = 0x0404; } /* TODO (eventually) */ } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* 3. TV */ index = GetOEMTVPtr661(SiS_Pr); if((SiS_Pr->SiS_ROMNew) && (index != 0xffff)) { romptr = SISGETROMW(0x106); if(SiS_Pr->SiS_VBType & VB_UMC) romptr += 12; delay = ROMAddr[romptr + index]; } else { delay = 0x04; if(index > 3 || index == 0xffff) delay = 0; } } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { /* 4. LCD, LCDA (for new ROM only LV and non-Pass 1:1) */ if( (SiS_Pr->SiS_LCDResInfo != Panel_Custom) && ((romptr = GetLCDStructPtr661_2(SiS_Pr))) ) { lcdpdcindex = (SiS_Pr->SiS_VBType & VB_UMC) ? 14 : 12; /* For LVDS (and sometimes TMDS), the BIOS must know about the correct value */ delay = ROMAddr[romptr + lcdpdcindex + 1]; /* LCD */ delay |= (ROMAddr[romptr + lcdpdcindex] << 8); /* LCDA */ } else { /* TMDS: Set our own, since BIOS has no idea */ /* (This is done on >=661 only, since <661 is calling this only for LVDS) */ if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { switch(SiS_Pr->SiS_LCDResInfo) { case Panel_1024x768: delay = 0x0008; break; case Panel_1280x720: delay = 0x0004; break; case Panel_1280x768: case Panel_1280x768_2:delay = 0x0004; break; case Panel_1280x800: case Panel_1280x800_2:delay = 0x0004; break; /* Verified for 1280x800 */ case Panel_1280x854: delay = 0x0004; break; /* FIXME */ case Panel_1280x1024: delay = 0x1e04; break; case Panel_1400x1050: delay = 0x0004; break; case Panel_1600x1200: delay = 0x0400; break; case Panel_1680x1050: delay = 0x0e04; break; default: if((SiS_Pr->PanelXRes <= 1024) && (SiS_Pr->PanelYRes <= 768)) { delay = 0x0008; } else if((SiS_Pr->PanelXRes == 1280) && (SiS_Pr->PanelYRes == 1024)) { delay = 0x1e04; } else if((SiS_Pr->PanelXRes <= 1400) && (SiS_Pr->PanelYRes <= 1050)) { delay = 0x0004; } else if((SiS_Pr->PanelXRes <= 1600) && (SiS_Pr->PanelYRes <= 1200)) { delay = 0x0400; } else delay = 0x0e04; break; } } /* Override by detected or user-set values */ /* (but only if, for some reason, we can't read value from BIOS) */ if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->PDC != -1)) { delay = SiS_Pr->PDC & 0x1f; } if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) && (SiS_Pr->PDCA != -1)) { delay = (SiS_Pr->PDCA & 0x1f) << 8; } } } if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { delay >>= 8; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); } else { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); } } static void SetCRT2SyncDither661(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short RTI) { unsigned short infoflag; unsigned char temp; if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(ModeNo <= 0x13) { infoflag = SiS_GetRegByte(SiS_Pr->SiS_P3ca+2); } else if(SiS_Pr->UseCustomMode) { infoflag = SiS_Pr->CInfoFlag; } else { infoflag = SiS_Pr->SiS_RefIndex[RTI].Ext_InfoFlag; } if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { infoflag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); /* No longer check D5 */ } infoflag &= 0xc0; if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { temp = (infoflag >> 6) | 0x0c; if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { temp ^= 0x04; if(SiS_Pr->SiS_ModeType >= Mode24Bpp) temp |= 0x10; } SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xe0,temp); } else { temp = 0x30; if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) temp = 0x20; temp |= infoflag; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0f,temp); temp = 0; if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { if(SiS_Pr->SiS_ModeType >= Mode24Bpp) temp |= 0x80; } SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1a,0x7f,temp); } } } static void SetPanelParms661(struct SiS_Private *SiS_Pr) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short romptr, temp1, temp2; if(SiS_Pr->SiS_VBType & (VB_SISLVDS | VB_SIS30xC)) { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x24,0x0f); } if(SiS_Pr->SiS_VBType & VB_SISLVDS) { if(SiS_Pr->LVDSHL != -1) { SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); } } if(SiS_Pr->SiS_ROMNew) { if((romptr = GetLCDStructPtr661_2(SiS_Pr))) { if(SiS_Pr->SiS_VBType & VB_SISLVDS) { temp1 = (ROMAddr[romptr] & 0x03) | 0x0c; temp2 = 0xfc; if(SiS_Pr->LVDSHL != -1) { temp1 &= 0xfc; temp2 = 0xf3; } SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,temp2,temp1); } if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { temp1 = (ROMAddr[romptr + 1] & 0x80) >> 1; SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d,0xbf,temp1); } } } } static void SiS_OEM310Setting(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RRTI) { if((SiS_Pr->SiS_ROMNew) && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { SetDelayComp661(SiS_Pr, ModeNo, ModeIdIndex, RRTI); if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { SetCRT2SyncDither661(SiS_Pr, ModeNo, RRTI); SetPanelParms661(SiS_Pr); } } else { SetDelayComp(SiS_Pr,ModeNo); } if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { SetAntiFlicker(SiS_Pr,ModeNo,ModeIdIndex); SetPhaseIncr(SiS_Pr,ModeNo,ModeIdIndex); SetYFilter(SiS_Pr,ModeNo,ModeIdIndex); if(SiS_Pr->SiS_VBType & VB_SIS301) { SetEdgeEnhance(SiS_Pr,ModeNo,ModeIdIndex); } } } static void SiS_OEM661Setting(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RRTI) { if(SiS_Pr->SiS_VBType & VB_SISVB) { SetDelayComp661(SiS_Pr, ModeNo, ModeIdIndex, RRTI); if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { SetCRT2SyncDither661(SiS_Pr, ModeNo, RRTI); SetPanelParms661(SiS_Pr); } if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { SetPhaseIncr(SiS_Pr, ModeNo, ModeIdIndex); SetYFilter(SiS_Pr, ModeNo, ModeIdIndex); SetAntiFlicker(SiS_Pr, ModeNo, ModeIdIndex); if(SiS_Pr->SiS_VBType & VB_SIS301) { SetEdgeEnhance(SiS_Pr, ModeNo, ModeIdIndex); } } } } /* FinalizeLCD * This finalizes some CRT2 registers for the very panel used. * If we have a backup if these registers, we use it; otherwise * we set the register according to most BIOSes. However, this * function looks quite different in every BIOS, so you better * pray that we have a backup... */ static void SiS_FinalizeLCD(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned short tempcl,tempch,tempbl,tempbh,tempbx,tempax,temp; unsigned short resinfo,modeflag; if(!(SiS_Pr->SiS_VBType & VB_SISLVDS)) return; if(SiS_Pr->SiS_ROMNew) return; if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(SiS_Pr->LVDSHL != -1) { SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); } } if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) return; if(SiS_Pr->UseCustomMode) return; switch(SiS_Pr->SiS_CustomT) { case CUT_COMPAQ1280: case CUT_COMPAQ12802: case CUT_CLEVO1400: case CUT_CLEVO14002: return; } if(ModeNo <= 0x13) { resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; } else { resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; } if(IS_SIS650) { if(!(SiS_GetReg(SiS_Pr->SiS_P3d4, 0x5f) & 0xf0)) { if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x02); } else { SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); } } } if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { /* Maybe all panels? */ if(SiS_Pr->LVDSHL == -1) { SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); } return; } } if(SiS_Pr->SiS_CustomT == CUT_CLEVO10242) { if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if(SiS_Pr->LVDSHL == -1) { /* Maybe all panels? */ SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); } if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; if(tempch == 3) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); } } return; } } } if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if(SiS_Pr->SiS_VBType & VB_SISEMI) { SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); #ifdef SET_EMI SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); #endif SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); } } else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { if(SiS_Pr->LVDSHL == -1) { /* Maybe ACER only? */ SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); } } tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1f,0x76); } else if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if(tempch == 0x03) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); } if((SiS_Pr->Backup == TRUE) && (SiS_Pr->Backup_Mode == ModeNo)) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,SiS_Pr->Backup_14); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,SiS_Pr->Backup_15); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,SiS_Pr->Backup_16); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,SiS_Pr->Backup_17); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,SiS_Pr->Backup_18); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,SiS_Pr->Backup_19); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,SiS_Pr->Backup_1a); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,SiS_Pr->Backup_1b); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,SiS_Pr->Backup_1c); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,SiS_Pr->Backup_1d); } else if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { /* 1.10.8w */ SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x90); if(ModeNo <= 0x13) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x11); if((resinfo == 0) || (resinfo == 2)) return; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x18); if((resinfo == 1) || (resinfo == 3)) return; } SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); if((ModeNo > 0x13) && (resinfo == SIS_RI_1024x768)) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); /* 1.10.7u */ #if 0 tempbx = 806; /* 0x326 */ /* other older BIOSes */ tempbx--; temp = tempbx & 0xff; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); temp = (tempbx >> 8) & 0x03; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1d,0xf8,temp); #endif } } else if(ModeNo <= 0x13) { if(ModeNo <= 1) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x70); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xff); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); } if(!(modeflag & HalfDCLK)) { SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x20); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,0x1a); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,0x28); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,0x00); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x4c); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); if(ModeNo == 0x12) { switch(tempch) { case 0: SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,0x10); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x48); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); break; case 2: SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); break; case 3: SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); break; } } } } } } else { tempcl = tempbh = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); tempcl &= 0x0f; tempbh &= 0x70; tempbh >>= 4; tempbl = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x04); tempbx = (tempbh << 8) | tempbl; if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if((resinfo == SIS_RI_1024x768) || (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD))) { if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { tempbx = 770; } else { if(tempbx > 770) tempbx = 770; if(SiS_Pr->SiS_VGAVDE < 600) { tempax = 768 - SiS_Pr->SiS_VGAVDE; tempax >>= 4; /* 1.10.7w; 1.10.6s: 3; */ if(SiS_Pr->SiS_VGAVDE <= 480) tempax >>= 4; /* 1.10.7w; 1.10.6s: < 480; >>=1; */ tempbx -= tempax; } } } else return; } temp = tempbx & 0xff; SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,temp); temp = ((tempbx & 0xff00) >> 4) | tempcl; SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,temp); } } } #endif /* ================= SiS 300 O.E.M. ================== */ #ifdef SIS300 static void SetOEMLCDData2(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex, unsigned short RefTabIndex) { unsigned short crt2crtc=0, modeflag, myindex=0; unsigned char temp; int i; if(ModeNo <= 0x13) { modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; } else { modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; crt2crtc = SiS_Pr->SiS_RefIndex[RefTabIndex].Ext_CRT2CRTC; } crt2crtc &= 0x3f; if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xdf); } if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { if(modeflag & HalfDCLK) myindex = 1; if(SiS_Pr->SiS_SetFlag & LowModeTests) { for(i=0; i<7; i++) { if(barco_p1[myindex][crt2crtc][i][0]) { SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, barco_p1[myindex][crt2crtc][i][0], barco_p1[myindex][crt2crtc][i][2], barco_p1[myindex][crt2crtc][i][1]); } } } temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); if(temp & 0x80) { temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x18); temp++; SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); } } } static unsigned short GetOEMLCDPtr(struct SiS_Private *SiS_Pr, int Flag) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short tempbx=0,romptr=0; static const unsigned char customtable300[] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }; static const unsigned char customtable630[] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }; if(SiS_Pr->ChipType == SIS_300) { tempbx = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0x0f; if(SiS_Pr->SiS_VBType & VB_SIS301) tempbx &= 0x07; tempbx -= 2; if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 4; if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 3; } if(SiS_Pr->SiS_UseROM) { if(ROMAddr[0x235] & 0x80) { tempbx = SiS_Pr->SiS_LCDTypeInfo; if(Flag) { romptr = SISGETROMW(0x255); if(romptr) tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo]; else tempbx = customtable300[SiS_Pr->SiS_LCDTypeInfo]; if(tempbx == 0xFF) return 0xFFFF; } tempbx <<= 1; if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx++; } } } else { if(Flag) { if(SiS_Pr->SiS_UseROM) { romptr = SISGETROMW(0x255); if(romptr) tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo]; else tempbx = 0xff; } else { tempbx = customtable630[SiS_Pr->SiS_LCDTypeInfo]; } if(tempbx == 0xFF) return 0xFFFF; tempbx <<= 2; if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempbx += 2; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; return tempbx; } tempbx = SiS_Pr->SiS_LCDTypeInfo << 2; if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempbx += 2; if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; } return tempbx; } static void SetOEMLCDDelay(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short index,temp,romptr=0; if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) return; if(SiS_Pr->SiS_UseROM) { if(!(ROMAddr[0x237] & 0x01)) return; if(!(ROMAddr[0x237] & 0x02)) return; romptr = SISGETROMW(0x24b); } /* The Panel Compensation Delay should be set according to tables * here. Unfortunately, various BIOS versions don't care about * a uniform way using eg. ROM byte 0x220, but use different * hard coded delays (0x04, 0x20, 0x18) in SetGroup1(). * Thus we don't set this if the user selected a custom pdc or if * we otherwise detected a valid pdc. */ if(SiS_Pr->PDC != -1) return; temp = GetOEMLCDPtr(SiS_Pr, 0); if(SiS_Pr->UseCustomMode) index = 0; else index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_LCDDelayIndex; if(SiS_Pr->ChipType != SIS_300) { if(romptr) { romptr += (temp * 2); romptr = SISGETROMW(romptr); romptr += index; temp = ROMAddr[romptr]; } else { if(SiS_Pr->SiS_VBType & VB_SISVB) { temp = SiS300_OEMLCDDelay2[temp][index]; } else { temp = SiS300_OEMLCDDelay3[temp][index]; } } } else { if(SiS_Pr->SiS_UseROM && (ROMAddr[0x235] & 0x80)) { if(romptr) { romptr += (temp * 2); romptr = SISGETROMW(romptr); romptr += index; temp = ROMAddr[romptr]; } else { temp = SiS300_OEMLCDDelay5[temp][index]; } } else { if(SiS_Pr->SiS_UseROM) { romptr = ROMAddr[0x249] | (ROMAddr[0x24a] << 8); if(romptr) { romptr += (temp * 2); romptr = SISGETROMW(romptr); romptr += index; temp = ROMAddr[romptr]; } else { temp = SiS300_OEMLCDDelay4[temp][index]; } } else { temp = SiS300_OEMLCDDelay4[temp][index]; } } } temp &= 0x3c; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* index 0A D[6:4] */ } static void SetOEMLCDData(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { #if 0 /* Unfinished; Data table missing */ unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short index,temp; if((SiS_Pr->SiS_UseROM) { if(!(ROMAddr[0x237] & 0x01)) return; if(!(ROMAddr[0x237] & 0x04)) return; /* No rom pointer in BIOS header! */ } temp = GetOEMLCDPtr(SiS_Pr, 1); if(temp == 0xFFFF) return; index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex]._VB_LCDHIndex; for(i=0x14, j=0; i<=0x17; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part1Port,i,SiS300_LCDHData[temp][index][j]); } SiS_SetRegANDOR(SiS_SiS_Part1Port,0x1a, 0xf8, (SiS300_LCDHData[temp][index][j] & 0x07)); index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex]._VB_LCDVIndex; SiS_SetReg(SiS_SiS_Part1Port,0x18, SiS300_LCDVData[temp][index][0]); SiS_SetRegANDOR(SiS_SiS_Part1Port,0x19, 0xF0, SiS300_LCDVData[temp][index][1]); SiS_SetRegANDOR(SiS_SiS_Part1Port,0x1A, 0xC7, (SiS300_LCDVData[temp][index][2] & 0x38)); for(i=0x1b, j=3; i<=0x1d; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part1Port,i,SiS300_LCDVData[temp][index][j]); } #endif } static unsigned short GetOEMTVPtr(struct SiS_Private *SiS_Pr) { unsigned short index; index = 0; if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) index += 4; if(SiS_Pr->SiS_VBType & VB_SISVB) { if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) index += 2; else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) index += 3; else if(SiS_Pr->SiS_TVMode & TVSetPAL) index += 1; } else { if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) index += 2; if(SiS_Pr->SiS_TVMode & TVSetPAL) index += 1; } return index; } static void SetOEMTVDelay(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short index,temp,romptr=0; if(SiS_Pr->SiS_UseROM) { if(!(ROMAddr[0x238] & 0x01)) return; if(!(ROMAddr[0x238] & 0x02)) return; romptr = SISGETROMW(0x241); } temp = GetOEMTVPtr(SiS_Pr); index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVDelayIndex; if(romptr) { romptr += (temp * 2); romptr = SISGETROMW(romptr) + index; temp = ROMAddr[romptr]; } else { if(SiS_Pr->SiS_VBType & VB_SISVB) { temp = SiS300_OEMTVDelay301[temp][index]; } else { temp = SiS300_OEMTVDelayLVDS[temp][index]; } } temp &= 0x3c; SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); } static void SetOEMAntiFlicker(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short index,temp,romptr=0; if(SiS_Pr->SiS_UseROM) { if(!(ROMAddr[0x238] & 0x01)) return; if(!(ROMAddr[0x238] & 0x04)) return; romptr = SISGETROMW(0x243); } temp = GetOEMTVPtr(SiS_Pr); index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVFlickerIndex; if(romptr) { romptr += (temp * 2); romptr = SISGETROMW(romptr); romptr += index; temp = ROMAddr[romptr]; } else { temp = SiS300_OEMTVFlicker[temp][index]; } temp &= 0x70; SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8F,temp); } static void SetOEMPhaseIncr(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short index,i,j,temp,romptr=0; if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) return; if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetNTSCJ | TVSetPALM | TVSetPALN)) return; if(SiS_Pr->SiS_UseROM) { if(!(ROMAddr[0x238] & 0x01)) return; if(!(ROMAddr[0x238] & 0x08)) return; romptr = SISGETROMW(0x245); } temp = GetOEMTVPtr(SiS_Pr); index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVPhaseIndex; if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { for(i=0x31, j=0; i<=0x34; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Phase2[temp][index][j]); } } else { if(romptr) { romptr += (temp * 2); romptr = SISGETROMW(romptr); romptr += (index * 4); for(i=0x31, j=0; i<=0x34; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); } } else { for(i=0x31, j=0; i<=0x34; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Phase1[temp][index][j]); } } } } static void SetOEMYFilter(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short index,temp,i,j,romptr=0; if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSCART | SetCRT2ToHiVision | SetCRT2ToYPbPr525750)) return; if(SiS_Pr->SiS_UseROM) { if(!(ROMAddr[0x238] & 0x01)) return; if(!(ROMAddr[0x238] & 0x10)) return; romptr = SISGETROMW(0x247); } temp = GetOEMTVPtr(SiS_Pr); if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 8; else if(SiS_Pr->SiS_TVMode & TVSetPALN) temp = 9; /* NTSCJ uses NTSC filters */ index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVYFilterIndex; if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { for(i=0x35, j=0; i<=0x38; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]); } for(i=0x48; i<=0x4A; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]); } } else { if((romptr) && (!(SiS_Pr->SiS_TVMode & (TVSetPALM|TVSetPALN)))) { romptr += (temp * 2); romptr = SISGETROMW(romptr); romptr += (index * 4); for(i=0x35, j=0; i<=0x38; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); } } else { for(i=0x35, j=0; i<=0x38; i++, j++) { SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter1[temp][index][j]); } } } } static unsigned short SiS_SearchVBModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo) { unsigned short ModeIdIndex; unsigned char VGAINFO = SiS_Pr->SiS_VGAINFO; if(*ModeNo <= 5) *ModeNo |= 1; for(ModeIdIndex=0; ; ModeIdIndex++) { if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == *ModeNo) break; if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == 0xFF) return 0; } if(*ModeNo != 0x07) { if(*ModeNo > 0x03) return ModeIdIndex; if(VGAINFO & 0x80) return ModeIdIndex; ModeIdIndex++; } if(VGAINFO & 0x10) ModeIdIndex++; /* 400 lines */ /* else 350 lines */ return ModeIdIndex; } static void SiS_OEM300Setting(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefTableIndex) { unsigned short OEMModeIdIndex = 0; if(!SiS_Pr->UseCustomMode) { OEMModeIdIndex = SiS_SearchVBModeID(SiS_Pr,&ModeNo); if(!(OEMModeIdIndex)) return; } if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { SetOEMLCDDelay(SiS_Pr, ModeNo, OEMModeIdIndex); if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { SetOEMLCDData(SiS_Pr, ModeNo, OEMModeIdIndex); } } if(SiS_Pr->UseCustomMode) return; if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { SetOEMTVDelay(SiS_Pr, ModeNo,OEMModeIdIndex); if(SiS_Pr->SiS_VBType & VB_SISVB) { SetOEMAntiFlicker(SiS_Pr, ModeNo, OEMModeIdIndex); SetOEMPhaseIncr(SiS_Pr, ModeNo, OEMModeIdIndex); SetOEMYFilter(SiS_Pr, ModeNo, OEMModeIdIndex); } } } #endif xf86-video-sis-0.10.7/src/initextx.h0000664000076400007640000004261311763614406014057 00000000000000/* * X.org/XFree86 specific supplements to init.c/init301.c * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * */ #ifndef _INITEXTX_H_ #define _INITEXTX_H_ #include "osdef.h" #include "initdef.h" #include "sis.h" #include "sis_regs.h" #ifdef SIS315H static const struct { unsigned char Ext_ModeID; /* ModeID in new ROM */ unsigned char Ext_MyModeID; /* corresponding ModeID in my tables (0 = identical) */ unsigned short Ext_VESAID; /* corresponding VESA ID in new ROM */ } SiS_EModeIDTable661[] = { { 0x6a, 0x00, 0x0102 }, { 0x1d, 0x20, 0x0000 }, { 0x1e, 0x21, 0x0000 }, { 0x1f, 0x22, 0x0000 }, { 0x20, 0x29, 0x0000 }, { 0x21, 0x2a, 0x0000 }, { 0x22, 0x2b, 0x0000 }, { 0x23, 0x00, 0x011c }, { 0x24, 0x00, 0x011d }, { 0x25, 0x00, 0x011e }, { 0x26, 0x00, 0x011f }, { 0x27, 0x00, 0x0120 }, { 0x28, 0x00, 0x0121 }, { 0x2a, 0x14, 0x013d }, { 0x2b, 0x15, 0x013e }, { 0x2c, 0x16, 0x013f }, { 0x2e, 0x00, 0x0101 }, { 0x2f, 0x00, 0x0100 }, { 0x30, 0x00, 0x0103 }, { 0x37, 0x00, 0x0104 }, { 0x38, 0x00, 0x0105 }, { 0x3a, 0x00, 0x0107 }, { 0x3c, 0x00, 0x0125 }, { 0x3d, 0x00, 0x0126 }, { 0x40, 0x00, 0x010d }, { 0x41, 0x00, 0x010e }, { 0x43, 0x00, 0x0110 }, { 0x44, 0x00, 0x0111 }, { 0x46, 0x00, 0x0113 }, { 0x47, 0x00, 0x0114 }, { 0x49, 0x00, 0x0116 }, { 0x4a, 0x00, 0x0117 }, { 0x4c, 0x00, 0x0119 }, { 0x4d, 0x00, 0x011a }, { 0x50, 0x00, 0x0127 }, { 0x51, 0x00, 0x0128 }, { 0x52, 0x00, 0x0129 }, { 0x53, 0x1a, 0x0141 }, { 0x54, 0x1b, 0x0142 }, { 0x55, 0x1c, 0x0143 }, { 0x56, 0x00, 0x012a }, { 0x57, 0x00, 0x012b }, { 0x58, 0x00, 0x012c }, { 0x59, 0x00, 0x012d }, { 0x5a, 0x17, 0x012e }, { 0x5b, 0x18, 0x012f }, { 0x5c, 0x19, 0x0130 }, { 0x5d, 0x00, 0x0131 }, { 0x62, 0x00, 0x0112 }, { 0x63, 0x00, 0x0115 }, { 0x64, 0x00, 0x0118 }, { 0x65, 0x00, 0x011b }, { 0x66, 0x00, 0x0132 }, { 0x75, 0x00, 0x013a }, { 0x78, 0x00, 0x013b }, { 0x79, 0x00, 0x013c }, { 0x7b, 0x7c, 0x0136 }, { 0x7c, 0x7d, 0x0137 }, { 0x7d, 0x7e, 0x0138 }, { 0xff, 0xff, 0xffff } }; #endif #define SIS_PL_HSYNCP 0x01 #define SIS_PL_HSYNCN 0x02 #define SIS_PL_VSYNCP 0x04 #define SIS_PL_VSYNCN 0x08 #define SIS_PL_DVI 0x80 struct SiS_PlasmaModes { const char *name; unsigned int clock; unsigned short HDisplay, HTotal, HFrontPorch, HSyncWidth; unsigned short VDisplay, VTotal, VFrontPorch, VSyncWidth; unsigned char SyncFlags; }; struct SiS_PlasmaTables { unsigned short vendor; unsigned char productnum; unsigned short product[5]; const char *DDCnames[5]; const char *plasmaname; unsigned short maxx,maxy; unsigned short prefx, prefy; unsigned char modenum; unsigned char plasmamodes[20]; /* | 0x80 = DVI-capable, | 0x40 = analog */ }; static const struct SiS_PlasmaModes SiS_PlasmaMode[] = { { "640x400", /* 00: IBM 400@70 */ 25175, 640, 800, 17, 64, 400, 449, 13, 2, SIS_PL_HSYNCN | SIS_PL_VSYNCN }, { "640x480", /* 01: VESA 480@72 */ 31500, 640, 832, 24, 40, 480, 520, 9, 3, SIS_PL_HSYNCN | SIS_PL_VSYNCN }, { "800x600", /* 02: VESA 600@72 */ 50000, 800, 1040, 56, 120, 600, 666, 37, 6, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "864x480", /* 03: Cereb wide 1 */ 42526, 864, 1134, 22, 86, 480, 500, 1, 3, SIS_PL_HSYNCP | SIS_PL_VSYNCN }, { "848x480", /* 04: VESA wide (NEC1) */ 33750, 848, 1088, 16, 112, 480, 517, 6, 8, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1024x576", /* 05: VESA wide (NEC2) */ 47250, 1024, 1320, 16, 144, 576, 596, 2, 4, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1280x720", /* 06: VESA wide (NEC3) */ 76500, 1280, 1696, 48, 176, 720, 750, 4, 8, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1360x765", /* 07: VESA wide (NEC4) */ 85500, 1360, 1792, 64, 176, 765, 795, 4, 8, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1024x600", /* 08: CEREB wide 2 */ 51200, 1024, 1352, 51, 164, 600, 628, 1, 4, SIS_PL_HSYNCN | SIS_PL_VSYNCP }, { "1024x768", /* 09: VESA 768@75 */ 78750, 1024, 1312, 16, 96, 768, 800, 1, 3, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1152x864", /* 10: VESA 1152x864@75 */ 108000, 1152, 1600, 64, 128, 864, 900, 1, 3, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1280x1024", /* 11: VESA 1024@60 */ 108000, 1280, 1688, 48, 112, 1024, 1066, 1, 3, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1280x768", /* 12: W_XGA */ 81000, 1280, 1688, 48, 112, 768, 802, 3, 6, SIS_PL_HSYNCP | SIS_PL_VSYNCN }, { "1280x768", /* 13: I/O Data W_XGA@56Hz */ 76064, 1280, 1688, 48, 112, 768, 802, 2, 3, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1376x768", /* 14: I/O Wide XGA */ 87340, 1376, 1808, 32, 128, 768, 806, 3, 6, SIS_PL_HSYNCN | SIS_PL_VSYNCP }, { "1280x960", /* 15: VESA 960@60 */ 108000, 1280, 1800, 96, 112, 960, 1000, 1, 3, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1400x1050", /* 16: VESA 1050@60Hz */ 108000, 1400, 1688, 48, 112, 1050, 1066, 1, 3, SIS_PL_HSYNCN | SIS_PL_VSYNCN }, { "1360x768", /* 17: VESA wide (NEC4/2) */ 85500, 1360, 1792, 64, 112, 765, 795, 3, 6, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "800x600", /* 18: VESA 600@56 */ 36000, 800, 1024, 24, 2, 600, 625, 1, 2, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1072x600", /* 19: Panasonic 1072x600 (sync?) */ 54100, 1072, 1424, 48, 176, 600, 628, 16, 1, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "848x480", /* 20: Panasonic 848x480 (sync?) */ 33070, /* is 852x480, but we can't use 852 */ 848, 1068, 20, 40, /* differs from DDC data, better centered */ 480, 516, 3, 5, /* won't work assumingly, because data is % 8 */ SIS_PL_HSYNCN | SIS_PL_VSYNCN }, { "1280x720", /* 21: WIDE720(60) (aka "750p") (Panasonic) */ 74300, 1280, 1650,110, 40, 720, 750, 5, 5, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1280x768", /* 22: 1280x768@56.5 (Panasonic) */ 76200, /* (According to manual not supported for HDMI; but works) */ 1280, 1680, 16, 24, 768, 802, 2, 5, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1280x720@50", /* 23: WIDE720(50) (aka "750p") (Panasonic) */ 74300, /* Panasonic states 45.0kHz. Not possible. This one works (with some overscan) */ 1280, 1980,400, 80, 720, 750, 1, 2, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "720x480", /* 24: 720x480 (aka "525p" and "480p") (Panasonic) */ 27000, 720, 856, 40, 32, 480, 525, 1, 3, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "720x576", /* 25: 720x576 (aka "625p"and "576p") (Panasonic) */ 27500, 720, 864, 16, 64, 576, 625, 5, 6, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, { "1280x720@50", /* 26: WIDE720(50) (aka "750p") (Generic) */ 74300, 1280, 1980,400, 80, 720, 750, 5, 5, SIS_PL_HSYNCP | SIS_PL_VSYNCP }, }; /* 27.00 720 755 791 858 480 480 484 525 27.50 720 732 795 864 576 581 587 625 */ static const struct SiS_PlasmaTables SiS_PlasmaTable[] = { #if 0 /* Product IDs missing */ { 0x38a3, 4, { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "NEC PlasmaSync 42VP4/42VP4D/42VP4G/42VP4DG", 0, 0, 0, 0, 11, /* All DVI, except 0, 7, 13 */ { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0, 17|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, #endif #if 0 /* Product IDs missing */ { 0x38a3, 3, { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "NEC PlasmaSync 42PD1/50PD1/50PD2", 0, 0, 0, 0, 5, /* DVI entirely unknown */ { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x38a3, 1, { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "NEC PlasmaSync 42PD3", 0, 0, 0, 0, 10, /* DVI entirely unknown */ { 0|0x40, 1|0xc0, 2|0xc0, 3|0xc0, 4|0xc0, 5|0xc0, 6|0xc0, 7|0x40, 8|0xc0, 9|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x38a3, 2, { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "NEC PlasmaSync 42VM3/61XM1", 0, 0, 0, 0, 11, /* DVI entirely unknown */ { 0|0x40, 1|0xc0, 2|0xc0, 3|0xc0, 4|0xc0, 5|0xc0, 6|0xc0, 8|0xc0, 9|0xc0,11|0xc0, 17|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x38a3, 2, { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "NEC PlasmaSync 42MP1/42MP2", 0, 0, 0, 0, 6, /* DVI entirely unknown */ { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0,11|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x38a3, 1, { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "NEC PlasmaSync 50MP1", 0, 0, 0, 0, 10, /* DVI entirely unknown */ { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, #endif { 0x38a3, 4, { 0xa482, 0xa483, 0x0000, 0x0000, 0x0000 }, { "PX-42VM", "", "", "", "" }, "NEC PlasmaSync 42MP3/42MP4/50MP2/61MP1", 0, 0, 0, 0, 11, /* All DVI except 0, 7, 13, 17 */ { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0, 17|0x40, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, #if 0 /* Product IDs missing */ { 0x38a3, 1, { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "NEC PlasmaSync 3300W", 0, 0, 0, 0, 3, { 0|0x40, 1|0xc0,18|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x38a3, 1, { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "NEC PlasmaSync 4200W", 4, /* DVI entirely unknown */ { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x38a3, 1, { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "NEC PlasmaSync 4210W", 0, 0, 0, 0, 6, /* DVI entirely unknown */ { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0,11|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x38a3, 1, { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "NEC PlasmaSync 5000W", 0, 0, 0, 0, 7, /* DVI entirely unknown */ { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,11|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, #endif { 0x412f, 2, { 0x000c, 0x000b, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "Pioneer 503CMX/PDA-5002", 0, 0, 0, 0, 6, /* DVI unknown */ { 1|0xc0, 2|0xc0, 9|0xc0,11|0xc0,12|0xc0,15|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x34a9, 1, { 0xa00e, 0x0000, 0x0000, 0x0000, 0x0000 }, { "", "", "", "", "" }, "Panasonic TH-42", 0, 0, 0, 0, 5, /* No DVI output */ { 1|0x40, 2|0x40, 4|0x40, 9|0x40,15|0x40, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x34a9, 1, { 0xa005, 0x0000, 0x0000, 0x0000, 0x0000 }, { "TH-42PW*4", "", "", "", "" }, "Panasonic TH-42PW5", 0, 0, 0, 0, 1, /* No special modes otherwise; no DVI. */ {20|0x40,19|0x40, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x4c2e, 1, { 0x9b05, 0x0000, 0x0000, 0x0000, 0x0000 }, { "PLV-Z2", "", "", "", "" }, "Sanyo PLV-Z2 (non HDCP-mode)", /* HDCP mode would be id 9b06, but not needed */ 1280, 768, /* as it then advertises correct size */ 1280, 720, 1, /* 1280x720, no special modes otherwise */ {21|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x34a9, 1, { 0xd034, 0x0000, 0x0000, 0x0000, 0x0000 }, { "AE500U (DVI-D)", "", "", "", "" }, "Panasonic AE500U", 1280, 768, 1280, 720, 1, /* 1280x720, no special modes otherwise */ {21|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x34a9, 1, { 0xd043, 0x0000, 0x0000, 0x0000, 0x0000 }, { "AE700U (HDMI)", "", "", "", "" }, "Panasonic AE700U", 1360, 768, 1280, 720, 6, /* 1280x720/60, 1280x720/50, 1280x768@56(digital/analog), 720x480, 720x576 */ {21|0xc0,23|0xc0,22|0x80,13|0x40,24|0x80,25|0x80, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }, { 0x0000 } }; unsigned short SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags); DisplayModePtr SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN, BOOLEAN, BOOLEAN, BOOLEAN); int SiSTranslateToVESA(ScrnInfoPtr pScrn, int modenumber); int SiSTranslateToOldMode(int modenumber); BOOLEAN SiS_GetPanelID(struct SiS_Private *SiS_Pr); unsigned short SiS_SenseLCDDDC(struct SiS_Private *SiS_Pr, SISPtr pSiS); unsigned short SiS_SenseVGA2DDC(struct SiS_Private *SiS_Pr, SISPtr pSiS); void SiS_CalcXTapScaler(struct SiS_Private *SiS_Pr, int srcsize, int destsize, int taps, Bool ishoriz); void SiS_SetGroup2_C_ELV(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex); extern unsigned char SiS_GetReg(SISIOADDRESS port, unsigned short index); extern void SiS_SetReg(SISIOADDRESS port, unsigned short index, unsigned short data); extern void SiS_SetRegOR(SISIOADDRESS, unsigned short, unsigned short); extern void SiS_SetRegAND(SISIOADDRESS, unsigned short, unsigned short); extern void SiS_SetRegANDOR(SISIOADDRESS Port, unsigned short Index, unsigned short DataAND, unsigned short DataOR); extern int SiS_compute_vclk(int Clock, int *out_n, int *out_dn, int *out_div, int *out_sbit, int *out_scale); extern void SiSCalcClock(ScrnInfoPtr pScrn, int clock, int max_VLD, unsigned int *vclk); extern void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); extern BOOLEAN SiSInitPtr(struct SiS_Private *SiS_Pr); extern unsigned short SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); extern unsigned short SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); extern void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, int yres, DisplayModePtr current); extern unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, BOOLEAN checkcr32, unsigned int VBFlags2); extern unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr); extern unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, unsigned char *buffer); #endif xf86-video-sis-0.10.7/src/initextx.c0000664000076400007640000014614111763614407014054 00000000000000/* * X.org/XFree86 specific extensions to init.c/init301.c * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "initextx.h" static void SiS_MakeClockRegs(ScrnInfoPtr pScrn, int clock, unsigned char *p2b, unsigned char *p2c) { int out_n, out_dn, out_div, out_sbit, out_scale; unsigned int vclk[5]; #define Midx 0 #define Nidx 1 #define VLDidx 2 #define Pidx 3 #define PSNidx 4 if(SiS_compute_vclk(clock, &out_n, &out_dn, &out_div, &out_sbit, &out_scale)) { (*p2b) = (out_div == 2) ? 0x80 : 0x00; (*p2b) |= ((out_n - 1) & 0x7f); (*p2c) = (out_dn - 1) & 0x1f; (*p2c) |= (((out_scale - 1) & 3) << 5); (*p2c) |= ((out_sbit & 0x01) << 7); #ifdef TWDEBUG xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock %d: n %d dn %d div %d sb %d sc %d\n", clock, out_n, out_dn, out_div, out_sbit, out_scale); #endif } else { SiSCalcClock(pScrn, clock, 2, vclk); (*p2b) = (vclk[VLDidx] == 2) ? 0x80 : 0x00; (*p2b) |= (vclk[Midx] - 1) & 0x7f; (*p2c) = (vclk[Nidx] - 1) & 0x1f; if(vclk[Pidx] <= 4) { /* postscale 1,2,3,4 */ (*p2c) |= ((vclk[Pidx] - 1) & 3) << 5; } else { /* postscale 6,8 */ (*p2c) |= (((vclk[Pidx] / 2) - 1) & 3) << 5; (*p2c) |= 0x80; } #ifdef TWDEBUG xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock %d: n %d dn %d div %d sc %d\n", clock, vclk[Midx], vclk[Nidx], vclk[VLDidx], vclk[Pidx]); #endif } } unsigned short SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags) { SISPtr pSiS = SISPTR(pScrn); int depth = pSiS->CurrentLayout.bitsPerPixel; pSiS->SiS_Pr->CModeFlag = 0; pSiS->SiS_Pr->CDClock = mode->Clock; pSiS->SiS_Pr->CHDisplay = mode->HDisplay; pSiS->SiS_Pr->CHSyncStart = mode->HSyncStart; pSiS->SiS_Pr->CHSyncEnd = mode->HSyncEnd; pSiS->SiS_Pr->CHTotal = mode->HTotal; pSiS->SiS_Pr->CVDisplay = mode->VDisplay; pSiS->SiS_Pr->CVSyncStart = mode->VSyncStart; pSiS->SiS_Pr->CVSyncEnd = mode->VSyncEnd; pSiS->SiS_Pr->CVTotal = mode->VTotal; pSiS->SiS_Pr->CFlags = mode->Flags; if(pSiS->SiS_Pr->CFlags & V_INTERLACE) { pSiS->SiS_Pr->CVDisplay >>= 1; pSiS->SiS_Pr->CVSyncStart >>= 1; pSiS->SiS_Pr->CVSyncEnd >>= 1; pSiS->SiS_Pr->CVTotal >>= 1; } else if(pSiS->SiS_Pr->CFlags & V_DBLSCAN) { pSiS->SiS_Pr->CVDisplay <<= 1; pSiS->SiS_Pr->CVSyncStart <<= 1; pSiS->SiS_Pr->CVSyncEnd <<= 1; pSiS->SiS_Pr->CVTotal <<= 1; } pSiS->SiS_Pr->CHBlankStart = pSiS->SiS_Pr->CHDisplay; pSiS->SiS_Pr->CHBlankEnd = pSiS->SiS_Pr->CHTotal; pSiS->SiS_Pr->CVBlankStart = pSiS->SiS_Pr->CVSyncStart - 1; pSiS->SiS_Pr->CVBlankEnd = pSiS->SiS_Pr->CVTotal; if((!(mode->type & M_T_BUILTIN)) && (mode->HDisplay <= 512)) { pSiS->SiS_Pr->CModeFlag |= HalfDCLK; pSiS->SiS_Pr->CDClock <<= 1; } /* Note: For CRT2, HDisplay, HSync* and HTotal must be shifted left * in HalfDCLK mode. */ SiS_MakeClockRegs(pScrn, pSiS->SiS_Pr->CDClock, &pSiS->SiS_Pr->CSR2B, &pSiS->SiS_Pr->CSR2C); pSiS->SiS_Pr->CSRClock = (pSiS->SiS_Pr->CDClock / 1000) + 1; SiS_CalcCRRegisters(pSiS->SiS_Pr, depth); switch(depth) { case 8: pSiS->SiS_Pr->CModeFlag |= 0x223b; break; case 16: pSiS->SiS_Pr->CModeFlag |= 0x227d; break; case 32: pSiS->SiS_Pr->CModeFlag |= 0x22ff; break; default: return 0; } if(pSiS->SiS_Pr->CFlags & V_DBLSCAN) pSiS->SiS_Pr->CModeFlag |= DoubleScanMode; if((pSiS->SiS_Pr->CVDisplay >= 1024) || (pSiS->SiS_Pr->CVTotal >= 1024) || (pSiS->SiS_Pr->CHDisplay >= 1024)) pSiS->SiS_Pr->CModeFlag |= LineCompareOff; pSiS->SiS_Pr->CInfoFlag = 0x0007; if(pSiS->SiS_Pr->CFlags & V_NHSYNC) pSiS->SiS_Pr->CInfoFlag |= 0x4000; if(pSiS->SiS_Pr->CFlags & V_NVSYNC) pSiS->SiS_Pr->CInfoFlag |= 0x8000; if(pSiS->SiS_Pr->CFlags & V_INTERLACE) pSiS->SiS_Pr->CInfoFlag |= InterlaceMode; pSiS->SiS_Pr->UseCustomMode = TRUE; #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "Custom mode %dx%d:\n", pSiS->SiS_Pr->CHDisplay,pSiS->SiS_Pr->CVDisplay); xf86DrvMsg(0, X_INFO, "Modeflag %04x, Infoflag %04x\n", pSiS->SiS_Pr->CModeFlag, pSiS->SiS_Pr->CInfoFlag); xf86DrvMsg(0, X_INFO, " {{0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", pSiS->SiS_Pr->CCRT1CRTC[0], pSiS->SiS_Pr->CCRT1CRTC[1], pSiS->SiS_Pr->CCRT1CRTC[2], pSiS->SiS_Pr->CCRT1CRTC[3], pSiS->SiS_Pr->CCRT1CRTC[4], pSiS->SiS_Pr->CCRT1CRTC[5], pSiS->SiS_Pr->CCRT1CRTC[6], pSiS->SiS_Pr->CCRT1CRTC[7]); xf86DrvMsg(0, X_INFO, " 0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", pSiS->SiS_Pr->CCRT1CRTC[8], pSiS->SiS_Pr->CCRT1CRTC[9], pSiS->SiS_Pr->CCRT1CRTC[10], pSiS->SiS_Pr->CCRT1CRTC[11], pSiS->SiS_Pr->CCRT1CRTC[12], pSiS->SiS_Pr->CCRT1CRTC[13], pSiS->SiS_Pr->CCRT1CRTC[14], pSiS->SiS_Pr->CCRT1CRTC[15]); xf86DrvMsg(0, X_INFO, " 0x%02x}},\n", pSiS->SiS_Pr->CCRT1CRTC[16]); xf86DrvMsg(0, X_INFO, "Clock: 0x%02x, 0x%02x, %d\n", pSiS->SiS_Pr->CSR2B, pSiS->SiS_Pr->CSR2C, pSiS->SiS_Pr->CSRClock); #endif return 1; } /* Build a list of supported modes: * Built-in modes for which we have all data are M_T_DEFAULT, * modes derived from DDC or database data are M_T_BUILTIN */ DisplayModePtr SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfordvi, BOOLEAN fakecrt2modes, BOOLEAN IsForCRT2) { SISPtr pSiS = SISPTR(pScrn); unsigned char sr2b, sr2c; float num, denum, postscalar, divider; int i, j, k, l, index, vclkindex, UseWide; DisplayModePtr new = NULL, current = NULL, first = NULL; BOOLEAN done = FALSE, IsHDCLK; #if 0 DisplayModePtr backup = NULL; #endif pSiS->backupmodelist = NULL; pSiS->AddedPlasmaModes = FALSE; UseWide = pSiS->SiS_Pr->SiS_UseWide; if(IsForCRT2) UseWide = pSiS->SiS_Pr->SiS_UseWideCRT2; if(!SiSInitPtr(pSiS->SiS_Pr)) return NULL; i = 0; while(pSiS->SiS_Pr->SiS_RefIndex[i].Ext_InfoFlag != 0xFFFF) { if(pSiS->SiS_Pr->SiS_RefIndex[i].Ext_InfoFlag & HaveWideTiming) { if(UseWide == 1) { if((pSiS->SiS_Pr->SiS_RefIndex[i].Ext_CRT1CRTC_WIDE == 0xff) && (pSiS->SiS_Pr->SiS_RefIndex[i].Ext_CRTVCLK_WIDE == 0xff)) { i++; continue; } } else { if((pSiS->SiS_Pr->SiS_RefIndex[i].Ext_CRT1CRTC_NORM == 0xff) && (pSiS->SiS_Pr->SiS_RefIndex[i].Ext_CRTVCLK_NORM == 0xff)) { i++; continue; } } } index = SiS_GetRefCRT1CRTC(pSiS->SiS_Pr, i, UseWide); if(fakecrt2modes) { if(pSiS->SiS_Pr->SiS_RefIndex[i].Ext_FakeCRT2CRTC) { index = pSiS->SiS_Pr->SiS_RefIndex[i].Ext_FakeCRT2CRTC; } } /* 0x5a (320x240) for FTSN - skip, is bad for CRT1 */ if(pSiS->SiS_Pr->SiS_RefIndex[i].ModeID == 0x5a) { i++; continue; } if(!(new = malloc(sizeof(DisplayModeRec)))) return first; memset(new, 0, sizeof(DisplayModeRec)); if(!(new->name = malloc(10))) { free(new); return first; } if(!first) first = new; if(current) { current->next = new; new->prev = current; } current = new; sprintf(current->name, "%dx%d", pSiS->SiS_Pr->SiS_RefIndex[i].XRes, pSiS->SiS_Pr->SiS_RefIndex[i].YRes); current->status = MODE_OK; current->type = M_T_DEFAULT; vclkindex = SiS_GetRefCRTVCLK(pSiS->SiS_Pr, i, UseWide); if(fakecrt2modes) { if(pSiS->SiS_Pr->SiS_RefIndex[i].Ext_FakeCRT2Clk) { vclkindex = pSiS->SiS_Pr->SiS_RefIndex[i].Ext_FakeCRT2Clk; } } sr2b = pSiS->SiS_Pr->SiS_VCLKData[vclkindex].SR2B; sr2c = pSiS->SiS_Pr->SiS_VCLKData[vclkindex].SR2C; divider = (sr2b & 0x80) ? 2.0 : 1.0; postscalar = (sr2c & 0x80) ? ( (((sr2c >> 5) & 0x03) == 0x02) ? 6.0 : 8.0) : (((sr2c >> 5) & 0x03) + 1.0); num = (sr2b & 0x7f) + 1.0; denum = (sr2c & 0x1f) + 1.0; #ifdef TWDEBUG xf86DrvMsg(0, X_INFO, "------------\n"); xf86DrvMsg(0, X_INFO, "sr2b: %x sr2c %x div %f ps %f num %f denum %f\n", sr2b, sr2c, divider, postscalar, num, denum); #endif current->Clock = (int)(14318 * (divider / postscalar) * (num / denum)); SiS_Generic_ConvertCRData(pSiS->SiS_Pr, (unsigned char *)&pSiS->SiS_Pr->SiS_CRT1Table[index].CR[0], pSiS->SiS_Pr->SiS_RefIndex[i].XRes, pSiS->SiS_Pr->SiS_RefIndex[i].YRes, current); if(pSiS->SiS_Pr->SiS_RefIndex[i].Ext_InfoFlag & 0x4000) current->Flags |= V_NHSYNC; else current->Flags |= V_PHSYNC; if(pSiS->SiS_Pr->SiS_RefIndex[i].Ext_InfoFlag & 0x8000) current->Flags |= V_NVSYNC; else current->Flags |= V_PVSYNC; if(pSiS->SiS_Pr->SiS_RefIndex[i].Ext_InfoFlag & 0x0080) current->Flags |= V_INTERLACE; j = 0; IsHDCLK = FALSE; while(pSiS->SiS_Pr->SiS_EModeIDTable[j].Ext_ModeID != 0xff) { if(pSiS->SiS_Pr->SiS_EModeIDTable[j].Ext_ModeID == pSiS->SiS_Pr->SiS_RefIndex[i].ModeID) { if(pSiS->SiS_Pr->SiS_EModeIDTable[j].Ext_ModeFlag & DoubleScanMode) { current->Flags |= V_DBLSCAN; } if(pSiS->SiS_Pr->SiS_EModeIDTable[j].Ext_ModeFlag & HalfDCLK) { IsHDCLK = TRUE; } break; } j++; } if(current->Flags & V_INTERLACE) { current->VDisplay <<= 1; current->VSyncStart <<= 1; current->VSyncEnd <<= 1; current->VTotal <<= 1; current->VTotal |= 1; } if(IsHDCLK) { current->Clock >>= 1; } if(current->Flags & V_DBLSCAN) { current->VDisplay >>= 1; current->VSyncStart >>= 1; current->VSyncEnd >>= 1; current->VTotal >>= 1; } #ifdef TWDEBUG xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Built-in: %s %.2f %d %d %d %d %d %d %d %d\n", current->name, (float)current->Clock / 1000, current->HDisplay, current->HSyncStart, current->HSyncEnd, current->HTotal, current->VDisplay, current->VSyncStart, current->VSyncEnd, current->VTotal); #endif i++; } /* Add non-standard LCD modes for panel's detailed timings */ if(!includelcdmodes) return first; if(pSiS->SiS_Pr->CP_Vendor) { xf86DrvMsg(0, X_INFO, "Checking database for vendor %x, product %x\n", pSiS->SiS_Pr->CP_Vendor, pSiS->SiS_Pr->CP_Product); } i = 0; while((!done) && (SiS_PlasmaTable[i].vendor) && (pSiS->SiS_Pr->CP_Vendor)) { if(SiS_PlasmaTable[i].vendor == pSiS->SiS_Pr->CP_Vendor) { for(j=0; jSiS_Pr->CP_Product) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Identified %s panel, adding specific modes\n", SiS_PlasmaTable[i].plasmaname); for(k=0; kVBFlags2 & VB2_LCDOVER1280BRIDGE)) { if(isfordvi) { if(SiS_PlasmaMode[l].VDisplay > 1024) continue; } } if(!(new = malloc(sizeof(DisplayModeRec)))) return first; memset(new, 0, sizeof(DisplayModeRec)); if(!(new->name = malloc(12))) { free(new); return first; } if(!first) first = new; if(current) { current->next = new; new->prev = current; } current = new; pSiS->AddedPlasmaModes = TRUE; strcpy(current->name, SiS_PlasmaMode[l].name); current->status = MODE_OK; current->type = M_T_BUILTIN; current->Clock = SiS_PlasmaMode[l].clock; current->SynthClock = current->Clock; current->HDisplay = SiS_PlasmaMode[l].HDisplay; current->HSyncStart = current->HDisplay + SiS_PlasmaMode[l].HFrontPorch; current->HSyncEnd = current->HSyncStart + SiS_PlasmaMode[l].HSyncWidth; current->HTotal = SiS_PlasmaMode[l].HTotal; current->VDisplay = SiS_PlasmaMode[l].VDisplay; current->VSyncStart = current->VDisplay + SiS_PlasmaMode[l].VFrontPorch; current->VSyncEnd = current->VSyncStart + SiS_PlasmaMode[l].VSyncWidth; current->VTotal = SiS_PlasmaMode[l].VTotal; current->CrtcHDisplay = current->HDisplay; current->CrtcHBlankStart = current->HSyncStart; current->CrtcHSyncStart = current->HSyncStart; current->CrtcHSyncEnd = current->HSyncEnd; current->CrtcHBlankEnd = current->HSyncEnd; current->CrtcHTotal = current->HTotal; current->CrtcVDisplay = current->VDisplay; current->CrtcVBlankStart = current->VSyncStart; current->CrtcVSyncStart = current->VSyncStart; current->CrtcVSyncEnd = current->VSyncEnd; current->CrtcVBlankEnd = current->VSyncEnd; current->CrtcVTotal = current->VTotal; if(SiS_PlasmaMode[l].SyncFlags & SIS_PL_HSYNCP) current->Flags |= V_PHSYNC; else current->Flags |= V_NHSYNC; if(SiS_PlasmaMode[l].SyncFlags & SIS_PL_VSYNCP) current->Flags |= V_PVSYNC; else current->Flags |= V_NVSYNC; if(current->HDisplay > pSiS->LCDwidth) pSiS->LCDwidth = pSiS->SiS_Pr->CP_MaxX = current->HDisplay; if(current->VDisplay > pSiS->LCDheight) pSiS->LCDheight = pSiS->SiS_Pr->CP_MaxY = current->VDisplay; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "\tAdding \"%s\" to list of built-in modes\n", current->name); } done = TRUE; break; } } } i++; } if(pSiS->SiS_Pr->CP_HaveCustomData) { for(i=0; i<7; i++) { if(pSiS->SiS_Pr->CP_DataValid[i]) { if(!(new = malloc(sizeof(DisplayModeRec)))) return first; memset(new, 0, sizeof(DisplayModeRec)); if(!(new->name = malloc(10))) { free(new); return first; } if(!first) first = new; if(current) { current->next = new; new->prev = current; } current = new; sprintf(current->name, "%dx%d", pSiS->SiS_Pr->CP_HDisplay[i], pSiS->SiS_Pr->CP_VDisplay[i]); current->status = MODE_OK; current->type = M_T_BUILTIN; current->Clock = pSiS->SiS_Pr->CP_Clock[i]; current->SynthClock = current->Clock; current->HDisplay = pSiS->SiS_Pr->CP_HDisplay[i]; current->HSyncStart = pSiS->SiS_Pr->CP_HSyncStart[i]; current->HSyncEnd = pSiS->SiS_Pr->CP_HSyncEnd[i]; current->HTotal = pSiS->SiS_Pr->CP_HTotal[i]; current->VDisplay = pSiS->SiS_Pr->CP_VDisplay[i]; current->VSyncStart = pSiS->SiS_Pr->CP_VSyncStart[i]; current->VSyncEnd = pSiS->SiS_Pr->CP_VSyncEnd[i]; current->VTotal = pSiS->SiS_Pr->CP_VTotal[i]; current->CrtcHDisplay = current->HDisplay; current->CrtcHBlankStart = pSiS->SiS_Pr->CP_HBlankStart[i]; current->CrtcHSyncStart = current->HSyncStart; current->CrtcHSyncEnd = current->HSyncEnd; current->CrtcHBlankEnd = pSiS->SiS_Pr->CP_HBlankEnd[i]; current->CrtcHTotal = current->HTotal; current->CrtcVDisplay = current->VDisplay; current->CrtcVBlankStart = pSiS->SiS_Pr->CP_VBlankStart[i]; current->CrtcVSyncStart = current->VSyncStart; current->CrtcVSyncEnd = current->VSyncEnd; current->CrtcVBlankEnd = pSiS->SiS_Pr->CP_VBlankEnd[i]; current->CrtcVTotal = current->VTotal; if(pSiS->SiS_Pr->CP_SyncValid[i]) { if(pSiS->SiS_Pr->CP_HSync_P[i]) current->Flags |= V_PHSYNC; else current->Flags |= V_NHSYNC; if(pSiS->SiS_Pr->CP_VSync_P[i]) current->Flags |= V_PVSYNC; else current->Flags |= V_NVSYNC; } else { /* No sync data? Use positive sync... */ current->Flags |= V_PHSYNC; current->Flags |= V_PVSYNC; } } } } return first; } /* Translate a mode number into the VESA pendant */ int SiSTranslateToVESA(ScrnInfoPtr pScrn, int modenumber) { SISPtr pSiS = SISPTR(pScrn); int i = 0; if(!SiSInitPtr(pSiS->SiS_Pr)) return -1; if(modenumber <= 0x13) return modenumber; #ifdef SIS315H if(pSiS->ROM661New) { /* Not XGI! */ while(SiS_EModeIDTable661[i].Ext_ModeID != 0xff) { if(SiS_EModeIDTable661[i].Ext_ModeID == modenumber) { return (int)SiS_EModeIDTable661[i].Ext_VESAID; } i++; } } else { #endif while(pSiS->SiS_Pr->SiS_EModeIDTable[i].Ext_ModeID != 0xff) { if(pSiS->SiS_Pr->SiS_EModeIDTable[i].Ext_ModeID == modenumber) { return (int)pSiS->SiS_Pr->SiS_EModeIDTable[i].Ext_VESAID; } i++; } #ifdef SIS315H } #endif return -1; } /* Translate a new (SiS or XGI) BIOS mode number into the driver's pendant */ int SiSTranslateToOldMode(int modenumber) { #ifdef SIS315H int i = 0; while(SiS_EModeIDTable661[i].Ext_ModeID != 0xff) { if(SiS_EModeIDTable661[i].Ext_ModeID == modenumber) { if(SiS_EModeIDTable661[i].Ext_MyModeID) return (int)SiS_EModeIDTable661[i].Ext_MyModeID; else return modenumber; } i++; } #endif return modenumber; } BOOLEAN SiS_GetPanelID(struct SiS_Private *SiS_Pr) { unsigned short tempax, tempbx, temp; static const unsigned short PanelTypeTable300[16] = { 0xc101, 0xc117, 0x0121, 0xc135, 0xc142, 0xc152, 0xc162, 0xc072, 0xc181, 0xc192, 0xc1a1, 0xc1b6, 0xc1c2, 0xc0d2, 0xc1e2, 0xc1f2 }; static const unsigned short PanelTypeTable31030x[16] = { 0xc102, 0xc112, 0x0122, 0xc132, 0xc142, 0xc152, 0xc169, 0xc179, 0x0189, 0xc192, 0xc1a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; static const unsigned short PanelTypeTable310LVDS[16] = { 0xc111, 0xc122, 0xc133, 0xc144, 0xc155, 0xc166, 0xc177, 0xc188, 0xc199, 0xc0aa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; if(SiS_Pr->ChipType < SIS_315H) { tempbx = SiS_GetReg(SiS_Pr->SiS_P3c4,0x18); if(!(tempbx & 0x10)) { if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { tempbx = 0; temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x38); if(temp & 0x40) tempbx |= 0x08; if(temp & 0x20) tempbx |= 0x02; if(temp & 0x01) tempbx |= 0x01; temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x39); if(temp & 0x80) tempbx |= 0x04; } else { return FALSE; } } tempbx = PanelTypeTable300[(tempbx & 0x0f)] | LCDSync; SiS_SetReg(SiS_Pr->SiS_P3d4,0x36,tempbx); SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,~(LCDSyncBit|LCDRGB18Bit),(tempbx >> 8)); } else { if(SiS_Pr->ChipType >= SIS_661) return FALSE; tempax = (SiS_GetReg(SiS_Pr->SiS_P3c4,0x1a) & 0x1e) >> 1; if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { if(tempax == 0) return FALSE; tempbx = PanelTypeTable310LVDS[tempax - 1]; temp = tempax & 0xff; } else { tempbx = PanelTypeTable31030x[tempax]; temp = tempbx & 0xff; } SiS_SetReg(SiS_Pr->SiS_P3d4,0x36,temp); tempbx >>= 8; SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,~(LCDSyncBit|LCDRGB18Bit),(tempbx & 0xc1)); if(SiS_Pr->SiS_VBType & VB_SISVB) { SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x39,0xfb,(tempbx & 0x04)); } } return TRUE; } /* LCD and VGA2 detection */ static BOOLEAN checkedid1(unsigned char *buffer) { /* Check header */ if((buffer[0] != 0x00) || (buffer[1] != 0xff) || (buffer[2] != 0xff) || (buffer[3] != 0xff) || (buffer[4] != 0xff) || (buffer[5] != 0xff) || (buffer[6] != 0xff) || (buffer[7] != 0x00)) return FALSE; /* Check EDID version and revision */ if((buffer[0x12] != 1) || (buffer[0x13] > 4)) return FALSE; /* Check week of manufacture for sanity */ if(buffer[0x10] > 54) return FALSE; /* Check year of manufacture for sanity */ if(buffer[0x11] > 40) return FALSE; return TRUE; } static BOOLEAN checkedid2(unsigned char *buffer) { unsigned short year = buffer[6] | (buffer[7] << 8); /* Check EDID version */ if((buffer[0] & 0xf0) != 0x20) return FALSE; /* Check week of manufacture for sanity */ if(buffer[5] > 54) return FALSE; /* Check year of manufacture for sanity */ if((year != 0) && ((year < 1990) || (year > 2030))) return FALSE; return TRUE; } static int SiS_FindPanelFromDB(SISPtr pSiS, unsigned short panelvendor, unsigned short panelproduct, int *maxx, int *maxy, int *prefx, int *prefy) { int i, j; BOOLEAN done = FALSE; i = 0; while((!done) && (SiS_PlasmaTable[i].vendor) && panelvendor) { if(SiS_PlasmaTable[i].vendor == panelvendor) { for(j=0; jpScrn->scrnIndex, X_PROBED, "Identified %s, correcting max X res %d, max Y res %d\n", SiS_PlasmaTable[i].plasmaname, SiS_PlasmaTable[i].maxx, SiS_PlasmaTable[i].maxy); break; } } } } i++; } return (done) ? 1 : 0; } /* Sense the LCD parameters (CR36, CR37) via DDC */ /* SiS TMDS bridges only */ unsigned short SiS_SenseLCDDDC(struct SiS_Private *SiS_Pr, SISPtr pSiS) { unsigned short DDCdatatype, paneltype, adapternum, flag, xres=0, yres=0; unsigned short index, myindex, lumsize, numcodes, panelvendor, panelproduct; int maxx=0, maxy=0, prefx=0, prefy=0; unsigned char cr37=0, seekcode; BOOLEAN checkexpand = FALSE; BOOLEAN havesync = FALSE; BOOLEAN indb = FALSE; int retry, i; int panel1280x960 = (pSiS->VGAEngine == SIS_315_VGA) ? Panel310_1280x960 : Panel300_1280x960; unsigned char buffer[256]; for(i=0; i<7; i++) SiS_Pr->CP_DataValid[i] = FALSE; SiS_Pr->CP_HaveCustomData = FALSE; SiS_Pr->CP_MaxX = SiS_Pr->CP_MaxY = SiS_Pr->CP_MaxClock = 0; SiS_Pr->CP_PreferredX = SiS_Pr->CP_PreferredY = 0; SiS_Pr->CP_PreferredIndex = -1; SiS_Pr->CP_PrefClock = 0; SiS_Pr->PanelSelfDetected = FALSE; if(!(pSiS->VBFlags2 & VB2_SISTMDSBRIDGE)) return 0; if(pSiS->VBFlags2 & VB2_30xBDH) return 0; /* Specific for XGI_40/Rev 2/A01 (XGI V3XT A01): This card has CRT1's * and CRT2's DDC ports physically connected to each other. There * is no connection to the video bridge's DDC port, both DDC * channels are routed to the GPU. Smart. If both CRT1 (CRT) and * CRT2 (VGA or LCD) are connected, DDC will fail. Hence, no * reliable panel detection here... */ adapternum = 1; if(SiS_Pr->DDCPortMixup) adapternum = 0; if(SiS_InitDDCRegs(SiS_Pr, pSiS->VBFlags, pSiS->VGAEngine, adapternum, 0, FALSE, pSiS->VBFlags2) == 0xFFFF) return 0; SiS_Pr->SiS_DDC_SecAddr = 0x00; /* Probe supported DA's */ flag = SiS_ProbeDDC(SiS_Pr); #ifdef TWDEBUG xf86DrvMsg(pSiS->pScrn->scrnIndex, X_INFO, "CRT2 DDC capabilities 0x%x\n", flag); #endif if(flag & 0x10) { SiS_Pr->SiS_DDC_DeviceAddr = 0xa6; /* EDID V2 (FP) */ DDCdatatype = 4; } else if(flag & 0x08) { SiS_Pr->SiS_DDC_DeviceAddr = 0xa2; /* EDID V2 (P&D-D Monitor) */ DDCdatatype = 3; } else if(flag & 0x02) { SiS_Pr->SiS_DDC_DeviceAddr = 0xa0; /* EDID V1 */ DDCdatatype = 1; } else return 0; /* no DDC support (or no device attached) */ /* Read the entire EDID */ retry = 2; do { if(SiS_ReadDDC(SiS_Pr, DDCdatatype, buffer)) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, "CRT2: DDC read failed (attempt %d), %s\n", (3-retry), (retry == 1) ? "giving up" : "retrying"); retry--; if(retry == 0) return 0xFFFF; } else break; } while(1); #ifdef TWDEBUG for(i=0; i<256; i+=16) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", buffer[i], buffer[i+1], buffer[i+2], buffer[i+3], buffer[i+4], buffer[i+5], buffer[i+6], buffer[i+7], buffer[i+8], buffer[i+9], buffer[i+10], buffer[i+11], buffer[i+12], buffer[i+13], buffer[i+14], buffer[i+15]); } #endif /* Analyze EDID and retrieve LCD panel information */ paneltype = 0; switch(DDCdatatype) { case 1: /* Analyze EDID V1 */ /* Catch a few clear cases: */ if(!(checkedid1(buffer))) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, "LCD sense: EDID corrupt\n"); return 0; } if(!(buffer[0x14] & 0x80)) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, "LCD sense: Attached display expects analog input (0x%02x)\n", buffer[0x14]); return 0; } /* Save given gamma */ pSiS->CRT2LCDMonitorGamma = (buffer[0x17] + 100) * 10; /* Now analyze the first Detailed Timing Block and see * if the preferred timing mode is stored there. If so, * check if this is a standard panel for which we already * know the timing. */ paneltype = Panel_Custom; checkexpand = FALSE; panelvendor = buffer[9] | (buffer[8] << 8); panelproduct = buffer[10] | (buffer[11] << 8); /* Overrule bogus preferred modes from database */ if((indb = SiS_FindPanelFromDB(pSiS, panelvendor, panelproduct, &maxx, &maxy, &prefx, &prefy))) { if(prefx) SiS_Pr->CP_PreferredX = xres = prefx; if(prefy) SiS_Pr->CP_PreferredY = yres = prefy; } if(buffer[0x18] & 0x02) { unsigned short pclk = (buffer[0x36] | (buffer[0x37] << 8)); unsigned short phb = (buffer[0x39] | ((buffer[0x3a] & 0x0f) << 8)); unsigned short pvb = (buffer[0x3c] | ((buffer[0x3d] & 0x0f) << 8)); if(!xres) SiS_Pr->CP_PreferredX = xres = buffer[0x38] | ((buffer[0x3a] & 0xf0) << 4); if(!yres) SiS_Pr->CP_PreferredY = yres = buffer[0x3b] | ((buffer[0x3d] & 0xf0) << 4); switch(xres) { case 1024: if(yres == 768) { paneltype = Panel_1024x768; checkexpand = TRUE; } break; case 1280: if(yres == 1024) { paneltype = Panel_1280x1024; checkexpand = TRUE; } else if(yres == 960) { paneltype = panel1280x960; } else if(yres == 768) { if( (pclk == 8100) && (phb == (1688 - 1280)) && (pvb == (802 - 768)) ) { paneltype = Panel_1280x768; checkexpand = FALSE; cr37 |= 0x10; } } else if(yres == 800) { if( (pclk == 6900) && (phb == (1408 - 1280)) && (pvb == (816 - 800)) ) { paneltype = Panel_1280x800; } } break; case 1400: if(pSiS->VGAEngine == SIS_315_VGA) { if(yres == 1050) { paneltype = Panel310_1400x1050; checkexpand = TRUE; } } break; case 1600: if((pSiS->VGAEngine == SIS_315_VGA) && (pSiS->VBFlags2 & VB2_30xC)) { if(yres == 1200) { if( (pclk == 16200) && (phb == (2160 - 1600)) && (pvb == (1250 - 1200)) ) { paneltype = Panel310_1600x1200; checkexpand = TRUE; } } } break; } /* Save sync: This is used if "Pass 1:1" is off; in this case * we always use the panel's native mode = this "preferred mode" * we just have been analysing. Hence, we also need its sync. */ if((buffer[0x47] & 0x18) == 0x18) { cr37 |= ((((buffer[0x47] & 0x06) ^ 0x06) << 5) | 0x20); havesync = TRUE; } else { /* What now? There is no digital separate output timing... */ xf86DrvMsg(pSiS->pScrn->scrnIndex, X_WARNING, "LCD sense: Unable to retrieve Sync polarity information\n"); cr37 |= 0xc0; /* Default */ } } /* Check against our database; eg. Sanyo Z2 projector reports * 1024x768 as preferred mode, although it supports 1280x720 * natively in non-HDCP mode. Treat such wrongly reporting * panels as custom and fixup actual maximum resolutions. */ if(paneltype != Panel_Custom) { if(indb) { paneltype = Panel_Custom; SiS_Pr->CP_MaxX = maxx; SiS_Pr->CP_MaxY = maxy; /* Leave preferred unchanged (MUST contain a valid mode!) */ } } /* If we still don't know what panel this is, we take it * as a custom panel and derive the timing data from the * detailed timing blocks */ if(paneltype == Panel_Custom) { int i, temp, base = 0x36; unsigned long estpack; static const unsigned short estx[] = { 720, 720, 640, 640, 640, 640, 800, 800, 800, 800, 832,1024,1024,1024,1024,1280, 1152 }; static const unsigned short esty[] = { 400, 400, 480, 480, 480, 480, 600, 600, 600, 600, 624, 768, 768, 768, 768,1024, 870 }; static const int estclk[] = { 0, 0, 25100, 0, 31500, 31500, 36100, 40000, 50100, 49500, 0, 0, 65100, 75200, 78700,135200, 0 }; paneltype = 0; SiS_Pr->CP_Supports64048075 = TRUE; /* Find the maximum resolution */ /* 1. From Established timings */ estpack = (buffer[0x23] << 9) | (buffer[0x24] << 1) | ((buffer[0x25] >> 7) & 0x01); for(i=16; i>=0; i--) { if(estpack & (1 << i)) { if(estx[16 - i] > SiS_Pr->CP_MaxX) SiS_Pr->CP_MaxX = estx[16 - i]; if(esty[16 - i] > SiS_Pr->CP_MaxY) SiS_Pr->CP_MaxY = esty[16 - i]; if(estclk[16 - i] > SiS_Pr->CP_MaxClock) SiS_Pr->CP_MaxClock = estclk[16 - i]; } } /* By default we drive the LCD at 75Hz in 640x480 mode; if * the panel does not provide this mode, use 60hz */ if(!(buffer[0x23] & 0x04)) SiS_Pr->CP_Supports64048075 = FALSE; /* 2. From Standard Timings */ for(i=0x26; i < 0x36; i+=2) { if((buffer[i] != 0x01) && (buffer[i+1] != 0x01)) { temp = (buffer[i] + 31) * 8; if(temp > SiS_Pr->CP_MaxX) SiS_Pr->CP_MaxX = temp; switch((buffer[i+1] & 0xc0) >> 6) { case 0x03: temp = temp * 9 / 16; break; case 0x02: temp = temp * 4 / 5; break; case 0x01: temp = temp * 3 / 4; break; } if(temp > SiS_Pr->CP_MaxY) SiS_Pr->CP_MaxY = temp; } } /* Now extract the Detailed Timings and convert them into modes */ for(i = 0; i < 4; i++, base += 18) { /* Is this a detailed timing block or a monitor descriptor? */ if(buffer[base] || buffer[base+1] || buffer[base+2]) { xres = buffer[base+2] | ((buffer[base+4] & 0xf0) << 4); yres = buffer[base+5] | ((buffer[base+7] & 0xf0) << 4); SiS_Pr->CP_HDisplay[i] = xres; SiS_Pr->CP_HSyncStart[i] = xres + (buffer[base+8] | ((buffer[base+11] & 0xc0) << 2)); SiS_Pr->CP_HSyncEnd[i] = SiS_Pr->CP_HSyncStart[i] + (buffer[base+9] | ((buffer[base+11] & 0x30) << 4)); SiS_Pr->CP_HTotal[i] = xres + (buffer[base+3] | ((buffer[base+4] & 0x0f) << 8)); SiS_Pr->CP_HBlankStart[i] = xres + 1; SiS_Pr->CP_HBlankEnd[i] = SiS_Pr->CP_HTotal[i]; SiS_Pr->CP_VDisplay[i] = yres; SiS_Pr->CP_VSyncStart[i] = yres + (((buffer[base+10] & 0xf0) >> 4) | ((buffer[base+11] & 0x0c) << 2)); SiS_Pr->CP_VSyncEnd[i] = SiS_Pr->CP_VSyncStart[i] + ((buffer[base+10] & 0x0f) | ((buffer[base+11] & 0x03) << 4)); SiS_Pr->CP_VTotal[i] = yres + (buffer[base+6] | ((buffer[base+7] & 0x0f) << 8)); SiS_Pr->CP_VBlankStart[i] = yres + 1; SiS_Pr->CP_VBlankEnd[i] = SiS_Pr->CP_VTotal[i]; SiS_Pr->CP_Clock[i] = (buffer[base] | (buffer[base+1] << 8)) * 10; SiS_Pr->CP_DataValid[i] = TRUE; /* Sort out invalid timings, interlace and too high clocks */ if((SiS_Pr->CP_HDisplay[i] & 7) || (SiS_Pr->CP_HDisplay[i] > SiS_Pr->CP_HSyncStart[i]) || (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HSyncEnd[i]) || (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HTotal[i]) || (SiS_Pr->CP_HSyncStart[i] >= SiS_Pr->CP_HSyncEnd[i]) || (SiS_Pr->CP_HSyncStart[i] > SiS_Pr->CP_HTotal[i]) || (SiS_Pr->CP_HSyncEnd[i] > SiS_Pr->CP_HTotal[i]) || (SiS_Pr->CP_VDisplay[i] > SiS_Pr->CP_VSyncStart[i]) || (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VSyncEnd[i]) || (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VTotal[i]) || (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VSyncEnd[i]) || (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VTotal[i]) || (SiS_Pr->CP_VSyncEnd[i] > SiS_Pr->CP_VTotal[i]) || (((pSiS->VBFlags2 & VB2_30xC) && (SiS_Pr->CP_Clock[i] > 162500)) || ((!(pSiS->VBFlags2 & VB2_30xC)) && ( (SiS_Pr->CP_Clock[i] > 110500) || /* TODO for 307 */ (SiS_Pr->CP_VDisplay[i] > 1024) || (SiS_Pr->CP_HDisplay[i] > 1600) ))) || (buffer[base+17] & 0x80)) { SiS_Pr->CP_DataValid[i] = FALSE; } else { SiS_Pr->CP_HaveCustomData = TRUE; if(xres > SiS_Pr->CP_MaxX) SiS_Pr->CP_MaxX = xres; if(yres > SiS_Pr->CP_MaxY) SiS_Pr->CP_MaxY = yres; if(SiS_Pr->CP_Clock[i] > SiS_Pr->CP_MaxClock) SiS_Pr->CP_MaxClock = SiS_Pr->CP_Clock[i]; if((SiS_Pr->CP_PreferredX == xres) && (SiS_Pr->CP_PreferredY == yres)) { SiS_Pr->CP_PreferredIndex = i; SiS_MakeClockRegs(pSiS->pScrn, SiS_Pr->CP_Clock[i], &SiS_Pr->CP_PrefSR2B, &SiS_Pr->CP_PrefSR2C); SiS_Pr->CP_PrefClock = (SiS_Pr->CP_Clock[i] / 1000) + 1; } /* Extract the sync polarisation information. This only works * if the Flags indicate a digital separate output. */ if((buffer[base+17] & 0x18) == 0x18) { SiS_Pr->CP_HSync_P[i] = (buffer[base+17] & 0x02) ? TRUE : FALSE; SiS_Pr->CP_VSync_P[i] = (buffer[base+17] & 0x04) ? TRUE : FALSE; SiS_Pr->CP_SyncValid[i] = TRUE; if((i == SiS_Pr->CP_PreferredIndex) && (!havesync)) { cr37 |= ((((buffer[base+17] & 0x06) ^ 0x06) << 5) | 0x20); havesync = TRUE; } } else { SiS_Pr->CP_SyncValid[i] = FALSE; } } } else if((!buffer[base]) && (!buffer[base+1]) && (!buffer[base+2]) && (!buffer[base+4])) { /* Maximum pixclock from Monitor Range Limits */ if((buffer[base+3] == 0xfd) && (buffer[base+9] != 0xff)) { int maxclk = buffer[base+9] * 10; /* More than 170 is not supported anyway */ if(maxclk <= 170) SiS_Pr->CP_MaxClock = maxclk * 1000; } } } if(SiS_Pr->CP_MaxX && SiS_Pr->CP_MaxY) { paneltype = Panel_Custom; checkexpand = FALSE; cr37 |= 0x10; SiS_Pr->CP_Vendor = panelvendor; SiS_Pr->CP_Product = panelproduct; } } if(paneltype && checkexpand) { /* If any of the Established low-res modes is supported, the * panel can scale automatically. For 800x600 panels, we only * check the even lower ones. */ if(paneltype == Panel_800x600) { if(buffer[0x23] & 0xfc) cr37 |= 0x10; } else { if(buffer[0x23]) cr37 |= 0x10; } } break; case 3: /* Analyze EDID V2 */ case 4: index = 0; if(!(checkedid2(buffer))) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, "LCD sense: EDID corrupt\n"); return 0; } if((buffer[0x41] & 0x0f) == 0x03) { index = 0x42 + 3; xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, "LCD sense: Display supports TMDS input on primary interface\n"); } else if((buffer[0x41] & 0xf0) == 0x30) { index = 0x46 + 3; xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, "LCD sense: Display supports TMDS input on secondary interface\n"); } else { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, "LCD sense: Display does not support TMDS video interface (0x%02x)\n", buffer[0x41]); return 0; } /* Save given gamma */ pSiS->CRT2LCDMonitorGamma = (buffer[0x56] + 100) * 10; SiS_Pr->CP_Vendor = panelvendor = buffer[2] | (buffer[1] << 8); SiS_Pr->CP_Product = panelproduct = buffer[3] | (buffer[4] << 8); paneltype = Panel_Custom; SiS_Pr->CP_MaxX = SiS_Pr->CP_PreferredX = xres = buffer[0x76] | (buffer[0x77] << 8); SiS_Pr->CP_MaxY = SiS_Pr->CP_PreferredY = yres = buffer[0x78] | (buffer[0x79] << 8); switch(xres) { case 1024: if(yres == 768) { paneltype = Panel_1024x768; checkexpand = TRUE; } break; case 1280: if(yres == 960) { paneltype = panel1280x960; } else if(yres == 1024) { paneltype = Panel_1280x1024; checkexpand = TRUE; } /* 1280x768, 1280x800 treated as custom here */ break; case 1400: if(pSiS->VGAEngine == SIS_315_VGA) { if(yres == 1050) { paneltype = Panel310_1400x1050; checkexpand = TRUE; } } break; /* 1600x1200 treated as custom */ } /* Determine if RGB18 or RGB24 */ if(index) { if((buffer[index] == 0x20) || (buffer[index] == 0x34)) { cr37 |= 0x01; } } if(checkexpand) { /* TODO - for now, we let the panel scale */ cr37 |= 0x10; } /* Now seek 4-Byte Timing codes and extract sync pol info */ index = 0x80; if(buffer[0x7e] & 0x20) { /* skip Luminance Table (if provided) */ lumsize = buffer[0x80] & 0x1f; if(buffer[0x80] & 0x80) lumsize *= 3; lumsize++; /* luminance header byte */ index += lumsize; } #if 0 /* "pixel rate" = pixel clock? */ if(buffer[0x7e] & 0x1c) { for(i=0; i<((buffer[0x7e] & 0x1c) >> 2); i++) { if(buffer[index + (i*8) + 6] && (buffer[index + (i*8) + 7] & 0x0f)) { int clk = (buffer[index + (i*8) + 6] | ((buffer[index + (i*8) + 7] & 0x0f) << 4)) * 1000; if(clk > SiS_Pr->CP_MaxClock) SiS_Pr->CP_MaxClock = clk; } } } #endif index += (((buffer[0x7e] & 0x1c) >> 2) * 8); /* skip Frequency Ranges */ if(buffer[0x7e] & 0x03) { for(i=0; i<(buffer[0x7e] & 0x03); i++) { if((buffer[index + (i*27) + 9]) || (buffer[index + (i*27) + 10])) { int clk = ((buffer[index + (i*27) + 9]) | ((buffer[index + (i*27) + 9]) << 8)) * 10; if(clk > SiS_Pr->CP_MaxClock) SiS_Pr->CP_MaxClock = clk; } } } index += ((buffer[0x7e] & 0x03) * 27); /* skip Detailed Range Limits */ numcodes = (buffer[0x7f] & 0xf8) >> 3; if(numcodes) { myindex = index; seekcode = (xres - 256) / 16; for(i=0; ipScrn->scrnIndex, X_WARNING, "LCD sense: Unable to retrieve Sync polarity information\n"); } } else { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_WARNING, "LCD sense: Unable to retrieve Sync polarity information\n"); } /* Check against our database; Eg. Sanyo projector reports * 1024x768 in non-HDPC mode, although it supports 1280x720. * Treat such wrongly reporting panels as custom. */ if(paneltype != Panel_Custom) { int maxx, maxy, prefx, prefy; if((SiS_FindPanelFromDB(pSiS, panelvendor, panelproduct, &maxx, &maxy, &prefx, &prefy))) { paneltype = Panel_Custom; SiS_Pr->CP_MaxX = maxx; SiS_Pr->CP_MaxY = maxy; cr37 |= 0x10; /* Leave preferred unchanged (MUST be a valid mode!) */ } } /* Now seek the detailed timing descriptions for custom panels */ if(paneltype == Panel_Custom) { SiS_Pr->CP_Supports64048075 = TRUE; index += (numcodes * 4); numcodes = buffer[0x7f] & 0x07; for(i=0; iCP_HDisplay[i] = xres; SiS_Pr->CP_HSyncStart[i] = xres + (buffer[index+8] | ((buffer[index+11] & 0xc0) << 2)); SiS_Pr->CP_HSyncEnd[i] = SiS_Pr->CP_HSyncStart[i] + (buffer[index+9] | ((buffer[index+11] & 0x30) << 4)); SiS_Pr->CP_HTotal[i] = xres + (buffer[index+3] | ((buffer[index+4] & 0x0f) << 8)); SiS_Pr->CP_HBlankStart[i] = xres + 1; SiS_Pr->CP_HBlankEnd[i] = SiS_Pr->CP_HTotal[i]; SiS_Pr->CP_VDisplay[i] = yres; SiS_Pr->CP_VSyncStart[i] = yres + (((buffer[index+10] & 0xf0) >> 4) | ((buffer[index+11] & 0x0c) << 2)); SiS_Pr->CP_VSyncEnd[i] = SiS_Pr->CP_VSyncStart[i] + ((buffer[index+10] & 0x0f) | ((buffer[index+11] & 0x03) << 4)); SiS_Pr->CP_VTotal[i] = yres + (buffer[index+6] | ((buffer[index+7] & 0x0f) << 8)); SiS_Pr->CP_VBlankStart[i] = yres + 1; SiS_Pr->CP_VBlankEnd[i] = SiS_Pr->CP_VTotal[i]; SiS_Pr->CP_Clock[i] = (buffer[index] | (buffer[index+1] << 8)) * 10; SiS_Pr->CP_DataValid[i] = TRUE; if((SiS_Pr->CP_HDisplay[i] & 7) || (SiS_Pr->CP_HDisplay[i] > SiS_Pr->CP_HSyncStart[i]) || (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HSyncEnd[i]) || (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HTotal[i]) || (SiS_Pr->CP_HSyncStart[i] >= SiS_Pr->CP_HSyncEnd[i]) || (SiS_Pr->CP_HSyncStart[i] > SiS_Pr->CP_HTotal[i]) || (SiS_Pr->CP_HSyncEnd[i] > SiS_Pr->CP_HTotal[i]) || (SiS_Pr->CP_VDisplay[i] > SiS_Pr->CP_VSyncStart[i]) || (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VSyncEnd[i]) || (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VTotal[i]) || (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VSyncEnd[i]) || (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VTotal[i]) || (SiS_Pr->CP_VSyncEnd[i] > SiS_Pr->CP_VTotal[i]) || (((pSiS->VBFlags2 & VB2_30xC) && (SiS_Pr->CP_Clock[i] > 162500)) || ((!(pSiS->VBFlags2 & VB2_30xC)) && ( (SiS_Pr->CP_Clock[i] > 110500) || (SiS_Pr->CP_VDisplay[i] > 1024) || (SiS_Pr->CP_HDisplay[i] > 1600) ))) || (buffer[index + 17] & 0x80)) { SiS_Pr->CP_DataValid[i] = FALSE; } else { SiS_Pr->CP_HaveCustomData = TRUE; if(SiS_Pr->CP_Clock[i] > SiS_Pr->CP_MaxClock) SiS_Pr->CP_MaxClock = SiS_Pr->CP_Clock[i]; if((SiS_Pr->CP_PreferredX == xres) && (SiS_Pr->CP_PreferredY == yres)) { SiS_Pr->CP_PreferredIndex = i; SiS_MakeClockRegs(pSiS->pScrn, SiS_Pr->CP_Clock[i], &SiS_Pr->CP_PrefSR2B, &SiS_Pr->CP_PrefSR2C); SiS_Pr->CP_PrefClock = (SiS_Pr->CP_Clock[i] / 1000) + 1; if(!havesync) { cr37 |= ((((buffer[index + 17] & 0x06) ^ 0x06) << 5) | 0x20); havesync = TRUE; } } SiS_Pr->CP_HSync_P[i] = (buffer[index + 17] & 0x02) ? TRUE : FALSE; SiS_Pr->CP_VSync_P[i] = (buffer[index + 17] & 0x04) ? TRUE : FALSE; SiS_Pr->CP_SyncValid[i] = TRUE; } } cr37 |= 0x10; } break; } /* 1280x960 panels are always RGB24, unable to scale and use * high active sync polarity. (Check is save, other panel types * for other chipset series not being set up) */ if(paneltype == panel1280x960) cr37 &= 0x0e; for(i = 0; i < 7; i++) { if(SiS_Pr->CP_DataValid[i]) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, "Non-standard LCD/DVI-D timing data no. %d:\n", i); xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, " HDisplay %d HSync %d HSyncEnd %d HTotal %d\n", SiS_Pr->CP_HDisplay[i], SiS_Pr->CP_HSyncStart[i], SiS_Pr->CP_HSyncEnd[i], SiS_Pr->CP_HTotal[i]); xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, " VDisplay %d VSync %d VSyncEnd %d VTotal %d\n", SiS_Pr->CP_VDisplay[i], SiS_Pr->CP_VSyncStart[i], SiS_Pr->CP_VSyncEnd[i], SiS_Pr->CP_VTotal[i]); xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, " Pixel clock: %3.3fMhz\n", (float)SiS_Pr->CP_Clock[i] / 1000); xf86DrvMsg(pSiS->pScrn->scrnIndex, X_INFO, " To use this, add \"%dx%d\" to the Modes list in the Screen section\n", SiS_Pr->CP_HDisplay[i], SiS_Pr->CP_VDisplay[i]); } } if(paneltype) { if(!SiS_Pr->CP_PreferredX) SiS_Pr->CP_PreferredX = SiS_Pr->CP_MaxX; if(!SiS_Pr->CP_PreferredY) SiS_Pr->CP_PreferredY = SiS_Pr->CP_MaxY; SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x32,0x08); SiS_SetReg(SiS_Pr->SiS_P3d4,0x36,paneltype); cr37 &= 0xf1; SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,0x0c,cr37); SiS_Pr->PanelSelfDetected = TRUE; #ifdef TWDEBUG xf86DrvMsgVerb(pSiS->pScrn->scrnIndex, X_PROBED, 3, "LCD sense: [DDC LCD results: 0x%02x, 0x%02x]\n", paneltype, cr37); #endif } else { SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x32,~0x08); SiS_SetReg(SiS_Pr->SiS_P3d4,0x36,0x00); } return 0; } unsigned short SiS_SenseVGA2DDC(struct SiS_Private *SiS_Pr, SISPtr pSiS) { unsigned short DDCdatatype, flag; BOOLEAN foundcrt = FALSE; int retry; unsigned char buffer[256]; if(!(pSiS->VBFlags2 & VB2_SISVGA2BRIDGE)) return 0; /* Specific for XGI_40/Rev 2/A01 (XGI V3XT A01): This card has CRT1's * and CRT2's DDC ports physically connected to each other. There * is no connection to the video bridge's DDC port, both DDC * channels are routed to the GPU. Smart. If both CRT1 (CRT) and * CRT2 (VGA or LCD) are connected, DDC will fail. If a CRT is * connected to the DVI-I port, it will report "analog" as well, * so we never know if the monitor is connected to CRT1 or CRT2. * Hence, no reliable CRT detection here... we need to fall back to * the sensing stuff in sis_vb.c. */ if(SiS_Pr->DDCPortMixup) return 0; if(SiS_InitDDCRegs(SiS_Pr, pSiS->VBFlags, pSiS->VGAEngine, 2, 0, FALSE, pSiS->VBFlags2) == 0xFFFF) return 0; SiS_Pr->SiS_DDC_SecAddr = 0x00; /* Probe supported DA's */ flag = SiS_ProbeDDC(SiS_Pr); if(flag & 0x10) { SiS_Pr->SiS_DDC_DeviceAddr = 0xa6; /* EDID V2 (FP) */ DDCdatatype = 4; } else if(flag & 0x08) { SiS_Pr->SiS_DDC_DeviceAddr = 0xa2; /* EDID V2 (P&D-D Monitor) */ DDCdatatype = 3; } else if(flag & 0x02) { SiS_Pr->SiS_DDC_DeviceAddr = 0xa0; /* EDID V1 */ DDCdatatype = 1; } else { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, "VGA2 sense: Do DDC answer\n"); return 0; /* no DDC support (or no device attached) */ } /* Read the entire EDID */ retry = 2; do { if(SiS_ReadDDC(SiS_Pr, DDCdatatype, buffer)) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_PROBED, "VGA2 sense: DDC read failed (attempt %d), %s\n", (3-retry), (retry == 1) ? "giving up" : "retrying"); retry--; if(retry == 0) return 0xFFFF; } else break; } while(1); /* Analyze EDID. We don't have many chances to * distinguish a flat panel from a CRT... */ switch(DDCdatatype) { case 1: if(!(checkedid1(buffer))) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_ERROR, "VGA2 sense: EDID corrupt\n"); return 0; } if(buffer[0x14] & 0x80) { /* Display uses digital input */ xf86DrvMsg(pSiS->pScrn->scrnIndex, X_ERROR, "VGA2 sense: Attached display expects digital input\n"); return 0; } SiS_Pr->CP_Vendor = buffer[9] | (buffer[8] << 8); SiS_Pr->CP_Product = buffer[10] | (buffer[11] << 8); foundcrt = TRUE; /* Save given gamma */ pSiS->CRT2VGAMonitorGamma = (buffer[0x17] + 100) * 10; break; case 3: case 4: if(!(checkedid2(buffer))) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_ERROR, "VGA2 sense: EDID corrupt\n"); return 0; } if( ((buffer[0x41] & 0x0f) != 0x01) && /* Display does not support analog input */ ((buffer[0x41] & 0x0f) != 0x02) && ((buffer[0x41] & 0xf0) != 0x10) && ((buffer[0x41] & 0xf0) != 0x20) ) { xf86DrvMsg(pSiS->pScrn->scrnIndex, X_ERROR, "VGA2 sense: Attached display does not support analog input (0x%02x)\n", buffer[0x41]); return 0; } SiS_Pr->CP_Vendor = buffer[2] | (buffer[1] << 8); SiS_Pr->CP_Product = buffer[3] | (buffer[4] << 8); foundcrt = TRUE; /* Save given gamma */ pSiS->CRT2VGAMonitorGamma = (buffer[0x56] + 100) * 10; break; } if(foundcrt) { SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x32,0x10); } return(0); } /* 4-tap scaler for 301C and later */ static float rcos(float x) { double pi = 3.14159265358979; float r = 0.5, y; if(x == 0.0) { y = 1.0; } else if(x == -1.0 || x == 1.0) { y = 0.0; } else { y = sin(pi * x) / (pi * x) * cos(r * pi * x) / (1 - x * x); } return y; } static int roundandconv(float in) { int a = ((int)(in)) * 10; int b = (int)(in * 10.0); if (in >= 0) { if((b - a) < 5) return (a / 10); else return (a / 10) + 1; } else { if((b - a) > -5) return (a / 10); else return (a / 10) -1; } } void SiS_CalcXTapScaler(struct SiS_Private *SiS_Pr, int srcsize, int destsize, int taps, Bool ishoriz) { float scale = (float)srcsize / (float)destsize; int coe_bit_number = 6; float fixnumber = (float)(1 << (coe_bit_number - 1)); float ops, WW, W[8]; int WeightMat[16][8]; int i, j, index; /* For now: */ if(taps != 4) taps = 4; if(scale < 1.0) scale = 1.0; else if(scale > 1.0) scale *= 1.1; for(i = 0; i < 16; i++) { ops = (float)i / (16.0 * scale); switch(taps) { case 4: W[0] = rcos( 1.0 / scale + ops); W[1] = rcos( 0.0 / scale + ops); W[2] = rcos(-1.0 / scale + ops); W[3] = rcos(-2.0 / scale + ops); WW = W[0] + W[1] + W[2] + W[3]; WeightMat[i][0] = roundandconv(W[0] / WW * fixnumber); WeightMat[i][1] = roundandconv(W[1] / WW * fixnumber); WeightMat[i][2] = roundandconv(W[2] / WW * fixnumber); WeightMat[i][3] = (int)fixnumber - WeightMat[i][0] - WeightMat[i][1] - WeightMat[i][2]; break; #if 0 /* For future use */ case 8: W[0] = rcos( 3.0/scale + ops); W[1] = rcos( 2.0/scale + ops); W[2] = rcos( 1.0/scale + ops); W[3] = rcos( 0.0/scale + ops); W[4] = rcos(-1.0/scale + ops); W[5] = rcos(-2.0/scale + ops); W[6] = rcos(-3.0/scale + ops); W[7] = rcos(-4.0/scale + ops); WW = W[0] + W[1] + W[2] + W[3] + W[4] + W[5] + W[6] + W[7]; WeightMat[i][0] = roundandconv(W[0]/WW * fixnumber); WeightMat[i][1] = roundandconv(W[1]/WW * fixnumber); WeightMat[i][2] = roundandconv(W[2]/WW * fixnumber); WeightMat[i][3] = roundandconv(W[3]/WW * fixnumber); WeightMat[i][4] = roundandconv(W[4]/WW * fixnumber); WeightMat[i][5] = roundandconv(W[5]/WW * fixnumber); WeightMat[i][6] = roundandconv(W[6]/WW * fixnumber); WeightMat[i][7] = (int)fixnumber - WeightMat[i][0] - WeightMat[i][1] - WeightMat[i][2] - WeightMat[i][3] - WeightMat[i][4] - WeightMat[i][5] - WeightMat[i][6]; break; #endif } } index = ishoriz ? 0x80 : 0xc0; for(i = 0; i < 16; i++) { for(j = 0; j < 4 /* taps! */; j++) { if(WeightMat[i][j] < 0) { WeightMat[i][j] = ((~(-WeightMat[i][j])) + 1) & 0x7f; } SiS_SetReg(SiS_Pr->SiS_Part2Port, index++, WeightMat[i][j]); } } } void SiS_SetGroup2_C_ELV(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex) { unsigned char temp; if(!(SiS_Pr->SiS_VBType & VB_SISTAP4SCALER)) return; SiS_CalcXTapScaler(SiS_Pr, SiS_Pr->SiS_VGAHDE, SiS_Pr->SiS_HDE, 4, TRUE); if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { SiS_CalcXTapScaler(SiS_Pr, SiS_Pr->SiS_VGAVDE, SiS_Pr->SiS_VDE, 4, FALSE); } temp = 0x10; if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp |= 0x04; SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xeb,temp); } xf86-video-sis-0.10.7/src/vgatypes.h0000664000076400007640000000666711763614407014057 00000000000000/* * General type definitions for universal mode switching modules * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * If distributed as part of the Linux kernel, the following license terms * apply: * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the named License, * * or any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA * * Otherwise, the following license terms apply: * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted provided that the following conditions * * are met: * * 1) Redistributions of source code must retain the above copyright * * notice, this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright * * notice, this list of conditions and the following disclaimer in the * * documentation and/or other materials provided with the distribution. * * 3) The name of the author may not be used to endorse or promote products * * derived from this software without specific prior written permission. * * * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * */ #ifndef _VGATYPES_H_ #define _VGATYPES_H_ #ifdef SIS_LINUX_KERNEL #include #endif #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif #ifndef BOOLEAN typedef unsigned int BOOLEAN; #endif #define SISIOMEMTYPE typedef unsigned long SISIOADDRESS; #ifdef SIS_LINUX_KERNEL #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8) #include /* Need __iomem */ #undef SISIOMEMTYPE #define SISIOMEMTYPE __iomem #endif #endif typedef enum _SIS_CHIP_TYPE { SIS_VGALegacy = 0, SIS_530, SIS_OLD, SIS_300, SIS_630, SIS_730, SIS_540, SIS_315H, /* SiS 310 */ SIS_315, SIS_315PRO, /* SiS 325 */ SIS_550, SIS_650, SIS_740, SIS_330, SIS_661, SIS_741, SIS_670, SIS_660 = 35, SIS_760, SIS_761, SIS_762, SIS_770, SIS_340 = 55, SIS_341, SIS_342, XGI_20 = 75, XGI_40, MAX_SIS_CHIP } SIS_CHIP_TYPE; #undef OLD1280720P #undef OLD720I #endif xf86-video-sis-0.10.7/src/Makefile.am0000664000076400007640000000511111763612244014054 00000000000000# Copyright 2005 Adam Jackson. # # 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 # on the rights to use, copy, modify, merge, publish, distribute, sub # license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON 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. # this is obnoxious: # -module lets us name the module exactly how we want # -avoid-version prevents gratuitous .0.0.0 version numbers on the end # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ sis_drv_la_LTLIBRARIES = sis_drv.la sis_drv_la_LDFLAGS = -module -avoid-version sis_drv_ladir = @moduledir@/drivers sis_drv_la_SOURCES = \ 300vtbl.h \ 310vtbl.h \ compat-api.h \ init301.c \ init301.h \ init.c \ initdef.h \ initextx.c \ initextx.h \ init.h \ oem300.h \ oem310.h \ osdef.h \ sis300_accel.c \ sis300_accel.h \ sis310_accel.c \ sis310_accel.h \ sis6326_video.c \ sispcirename.h \ sis_accel.c \ sis_accel.h \ sis_common.h \ sis_cursor.c \ sis_cursor.h \ sis_dac.c \ sis_dac.h \ sis_dga.c \ sis_driver.c \ sis_driver.h \ sis.h \ sis_memcpy.c \ sis_opt.c \ sis_regs.h \ sis_setup.c \ sis_shadow.c \ sis_utility.c \ sis_vb.c \ sis_vga.c \ sis_video.c \ sis_video.h \ sis_videostr.h \ vgatypes.h \ vstruct.h if DRI sis_drv_la_SOURCES += \ sis_dri.c \ sis_dri.h endif xf86-video-sis-0.10.7/src/sis_accel.h0000664000076400007640000001474311763614407014134 00000000000000/* * 2D acceleration for 5597/5598 and 6326 * Definitions for the SIS engine communication * * Copyright (C) 1998, 1999 by Alan Hourihane, Wigan, England. * Parts Copyright (C) 2001-2005 Thomas Winischhofer, Vienna, Austria. * * Licensed under the following terms: * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appears in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * and that the name of the copyright holder not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. The copyright holder makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without expressed or implied warranty. * * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * Authors: Alan Hourihane , * Mike Chapman , * Juanjo Santamarta , * Mitani Hiroshi , * David Thomas , * Thomas Winischhofer . */ /* Definitions for the SIS engine communication. ------------------------------------ */ /* For pre-530 chipsets only!!! */ /* Engine Registers for 1st generation engines (5597/5598/6326) */ const int sisReg32MMIO[] = { 0x8280,0x8284,0x8288,0x828C,0x8290,0x8294, 0x8298,0x829C,0x82A0,0x82A4,0x82A8,0x82AC }; #define BR(x) sisReg32MMIO[x] /* These are done using Memory Mapped IO, of the registers */ /* * Modified for Sis by Xavier Ducoin (xavier@rd.lectra.fr) * */ /* Command Reg 0 (0x82aa, [15:0]) */ #define sisSRCBG 0x0000 /* source select */ #define sisSRCFG 0x0001 #define sisSRCVIDEO 0x0002 #define sisSRCSYSTEM 0x0003 #define sisPATFG 0x0004 /* pattern select */ #define sisPATREG 0x0008 #define sisPATBG 0x0000 #define sisLEFT2RIGHT 0x0010 /* Direction select */ #define sisRIGHT2LEFT 0x0000 #define sisTOP2BOTTOM 0x0020 #define sisBOTTOM2TOP 0x0000 #define sisXINCREASE sisLEFT2RIGHT #define sisYINCREASE sisTOP2BOTTOM #define sisCLIPENABL 0x0040 /* Clipping select */ #define sisCLIPINTRN 0x0080 #define sisCLIPEXTRN 0x0000 #define sisCMDBLT 0x0000 /* Command select */ #define sisCMDBLTMSK 0x0100 #define sisCMDCOLEXP 0x0200 #define sisCMDLINE 0x0300 #define sisFLGECOLEXP 0x2000 #define sisCMDECOLEXP (sisCMDCOLEXP | sisFLGECOLEXP) #define sisLASTPIX 0x0800 /* Line parameters */ #define sisXMAJOR 0x0400 /* Macros to do useful things with the SIS BitBLT engine */ #define sisBLTSync \ while(SIS_MMIO_IN16(pSiS->IOBase, BR(10) + 2) & 0x4000) {} /* According to SiS 6326 2D programming guide, 16 bits position at */ /* 0x82A8 returns queue free. But this don't work, so don't wait */ /* anything when turbo-queue is enabled. If there are frequent syncs */ /* this should work. But not for xaa_benchmark :-( */ /* TW: Bit 16 only applies to the hardware queue, not the software * (=turbo) queue. */ #define sisBLTWAIT \ if(!pSiS->TurboQueue) { \ while(SIS_MMIO_IN16(pSiS->IOBase, BR(10) + 2) & 0x4000) {} \ } else { \ sisBLTSync \ } #define sisSETPATREG() \ ((UChar *)(pSiS->IOBase + BR(11))) #define sisSETPATREGL() \ ((ULong *)(pSiS->IOBase + BR(11))) /* trigger command */ #define sisSETCMD(op) \ { \ ULong temp; \ SIS_MMIO_OUT16(pSiS->IOBase, BR(10) + 2, op); \ temp = SIS_MMIO_IN32(pSiS->IOBase, BR(10)); \ (void)temp; \ } /* set foreground color and fg ROP */ #define sisSETFGROPCOL(rop, color) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(4), ((rop << 24) | (color & 0xFFFFFF))); /* set background color and bg ROP */ #define sisSETBGROPCOL(rop, color) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(5), ((rop << 24) | (color & 0xFFFFFF))); /* background color */ #define sisSETBGCOLOR(bgColor) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(5), (bgColor)); /* foreground color */ #define sisSETFGCOLOR(fgColor) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(4), (fgcolor)); /* ROP */ #define sisSETROPFG(op) \ SIS_MMIO_OUT8(pSiS->IOBase, BR(4) + 3, op); #define sisSETROPBG(op) \ SIS_MMIO_OUT8(pSiS->IOBase, BR(5) + 3, op); #define sisSETROP(op) \ sisSETROPFG(op); sisSETROPBG(op); /* source and dest address */ #define sisSETSRCADDR(srcAddr) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(0), (srcAddr & 0x3FFFFFL)); #define sisSETDSTADDR(dstAddr) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(1), (dstAddr & 0x3FFFFFL)); /* pitch */ #define sisSETPITCH(srcPitch,dstPitch) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(2), ((((dstPitch) & 0xFFFF) << 16) | ((srcPitch) & 0xFFFF))); #define sisSETSRCPITCH(srcPitch) \ SIS_MMIO_OUT16(pSiS->IOBase, BR(2), ((srcPitch) & 0xFFFF)); #define sisSETDSTPITCH(dstPitch) \ SIS_MMIO_OUT16(pSiS->IOBase, BR(2) + 2, ((dstPitch) & 0xFFFF)); /* Height and width * According to SIS 2D Engine Programming Guide * height -1, width - 1 independant of Bpp */ #define sisSETHEIGHTWIDTH(Height, Width) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(3), ((((Height) & 0xFFFF) << 16) | ((Width) & 0xFFFF))); /* Clipping */ #define sisSETCLIPTOP(x, y) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(8), ((((y) & 0xFFFF) << 16) | ((x) & 0xFFFF))); #define sisSETCLIPBOTTOM(x, y) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(9), ((((y) & 0xFFFF) << 16) | ((x) & 0xFFFF))); /* Line drawing */ #define sisSETXStart(XStart) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(0), ((XStart) & 0xFFFF)); #define sisSETYStart(YStart) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(1), ((YStart) & 0xFFFF)); #define sisSETLineMajorCount(MajorAxisCount) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(3), ((MajorAxisCount) & 0xFFFF)); #define sisSETLineSteps(K1,K2) \ SIS_MMIO_OUT32(pSiS->IOBase, BR(6), ((((K1) & 0xFFFF) << 16) | ((K2) & 0xFFFF))); #define sisSETLineErrorTerm(ErrorTerm) \ SIS_MMIO_OUT16(pSiS->IOBase, BR(7), (ErrorTerm)); xf86-video-sis-0.10.7/src/sis_shadow.c0000664000076400007640000002535111763614407014342 00000000000000/* * Copyright (C) 1999-2004 by The XFree86 Project, Inc. * based on code written by Mark Vojkovich * Copyright (C) 2003-2005 Thomas Winischhofer * * Licensed under the following terms: * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appears in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * and that the name of the copyright holder not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. The copyright holder makes no representations * about the suitability of this software for any purpose. It is provided * "as is" without expressed or implied warranty. * * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * This module doesn't use CurrentLayout, because it is never * active when DGA is active and vice versa. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "sis.h" #include "servermd.h" void SISPointerMoved(SCRN_ARG_TYPE arg, int x, int y); void SISPointerMovedReflect(SCRN_ARG_TYPE arg, int x, int y); void SISRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void SISRefreshAreaReflect(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void SISRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void SISRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void SISRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void SISRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void SISPointerMoved(SCRN_ARG_TYPE arg, int x, int y) { SCRN_INFO_PTR(arg); SISPtr pSiS = SISPTR(pScrn); if(pSiS->Rotate == 1) { (*pSiS->PointerMoved)(arg, pScrn->pScreen->height - y - 1, x); } else { (*pSiS->PointerMoved)(arg, y, pScrn->pScreen->width - x - 1); } } void SISPointerMovedReflect(SCRN_ARG_TYPE arg, int x, int y) { SCRN_INFO_PTR(arg); SISPtr pSiS = SISPTR(pScrn); switch(pSiS->Reflect) { case 1: /* x */ (*pSiS->PointerMoved)(arg, pScrn->pScreen->width - x - 1, y); break; case 2: /* y */ (*pSiS->PointerMoved)(arg, x, pScrn->pScreen->height - y - 1); break; case 3: /* x + y */ (*pSiS->PointerMoved)(arg, pScrn->pScreen->width - x - 1, pScrn->pScreen->height - y - 1); } } /* Refresh area (unreflected, unrotated) */ void SISRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { SISPtr pSiS = SISPTR(pScrn); int width, height, Bpp, FBPitch; CARD8 *src, *dst; Bpp = pScrn->bitsPerPixel >> 3; FBPitch = BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel); while(num--) { width = (pbox->x2 - pbox->x1) * Bpp; height = pbox->y2 - pbox->y1; src = pSiS->ShadowPtr + (pbox->y1 * pSiS->ShadowPitch) + (pbox->x1 * Bpp); dst = pSiS->FbBase + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp); while(height--) { SiSMemCopyToVideoRam(pSiS, dst, src, width); dst += FBPitch; src += pSiS->ShadowPitch; } pbox++; } } /* RefreshArea for reflection */ void SISRefreshAreaReflect(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { SISPtr pSiS = SISPTR(pScrn); int width, height, Bpp, FBPitch, twidth; CARD8 *src, *dst, *tdst, *tsrc; CARD16 *tdst16, *tsrc16; CARD32 *tdst32, *tsrc32; Bpp = pScrn->bitsPerPixel >> 3; FBPitch = BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel); while(num--) { width = (pbox->x2 - pbox->x1) * Bpp; height = pbox->y2 - pbox->y1; src = pSiS->ShadowPtr + (pbox->y1 * pSiS->ShadowPitch) + (pbox->x1 * Bpp); dst = pSiS->FbBase; switch(pSiS->Reflect) { case 1: /* x */ dst += (pbox->y1 * FBPitch) + ((pScrn->displayWidth - pbox->x1 - 1) * Bpp); switch(Bpp) { case 1: while(height--) { tdst = dst; tsrc = src; twidth = width; while(twidth--) *tdst-- = *tsrc++; dst += FBPitch; src += pSiS->ShadowPitch; } break; case 2: width >>= 1; while(height--) { tdst16 = (CARD16 *)dst; tsrc16 = (CARD16 *)src; twidth = width; while(twidth--) *tdst16-- = *tsrc16++; dst += FBPitch; src += pSiS->ShadowPitch; } break; case 4: width >>= 2; while(height--) { tdst32 = (CARD32 *)dst; tsrc32 = (CARD32 *)src; twidth = width; while(twidth--) *tdst32-- = *tsrc32++; dst += FBPitch; src += pSiS->ShadowPitch; } } break; case 2: /* y */ dst += ((pScrn->virtualY - pbox->y1 - 1) * FBPitch) + (pbox->x1 * Bpp); while(height--) { SiSMemCopyToVideoRam(pSiS, dst, src, width); dst -= FBPitch; src += pSiS->ShadowPitch; } break; case 3: /* x + y */ dst += ((pScrn->virtualY - pbox->y1 - 1) * FBPitch) + ((pScrn->displayWidth - pbox->x1 - 1) * Bpp); switch(Bpp) { case 1: while(height--) { tdst = dst; tsrc = src; twidth = width; while(twidth--) *tdst-- = *tsrc++; dst -= FBPitch; src += pSiS->ShadowPitch; } break; case 2: width >>= 1; while(height--) { tdst16 = (CARD16 *)dst; tsrc16 = (CARD16 *)src; twidth = width; while(twidth--) *tdst16-- = *tsrc16++; dst -= FBPitch; src += pSiS->ShadowPitch; } break; case 4: width >>= 2; while(height--) { tdst32 = (CARD32 *)dst; tsrc32 = (CARD32 *)src; twidth = width; while(twidth--) *tdst32-- = *tsrc32++; dst -= FBPitch; src += pSiS->ShadowPitch; } break; } } pbox++; } } /* RefreshArea()s for rotation */ void SISRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { SISPtr pSiS = SISPTR(pScrn); int count, width, height, y1, y2, dstPitch, srcPitch; CARD8 *dstPtr, *srcPtr, *src; CARD32 *dst; dstPitch = pScrn->displayWidth; srcPitch = -pSiS->Rotate * pSiS->ShadowPitch; while(num--) { width = pbox->x2 - pbox->x1; y1 = pbox->y1 & ~3; y2 = (pbox->y2 + 3) & ~3; height = (y2 - y1) >> 2; /* in dwords */ if(pSiS->Rotate == 1) { dstPtr = pSiS->FbBase + (pbox->x1 * dstPitch) + pScrn->virtualX - y2; srcPtr = pSiS->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1; } else { dstPtr = pSiS->FbBase + ((pScrn->virtualY - pbox->x2) * dstPitch) + y1; srcPtr = pSiS->ShadowPtr + (y1 * srcPitch) + pbox->x2 - 1; } while(width--) { src = srcPtr; dst = (CARD32 *)dstPtr; count = height; while(count--) { *(dst++) = src[0] | (src[srcPitch] << 8) | (src[srcPitch * 2] << 16) | (src[srcPitch * 3] << 24); src += (srcPitch * 4); } srcPtr += pSiS->Rotate; dstPtr += dstPitch; } pbox++; } } void SISRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { SISPtr pSiS = SISPTR(pScrn); int count, width, height, y1, y2, dstPitch, srcPitch; CARD16 *dstPtr, *srcPtr, *src; CARD32 *dst; dstPitch = pScrn->displayWidth; srcPitch = -pSiS->Rotate * pSiS->ShadowPitch >> 1; while(num--) { width = pbox->x2 - pbox->x1; y1 = pbox->y1 & ~1; y2 = (pbox->y2 + 1) & ~1; height = (y2 - y1) >> 1; /* in dwords */ if(pSiS->Rotate == 1) { dstPtr = (CARD16 *)pSiS->FbBase + (pbox->x1 * dstPitch) + pScrn->virtualX - y2; srcPtr = (CARD16 *)pSiS->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1; } else { dstPtr = (CARD16 *)pSiS->FbBase + ((pScrn->virtualY - pbox->x2) * dstPitch) + y1; srcPtr = (CARD16 *)pSiS->ShadowPtr + (y1 * srcPitch) + pbox->x2 - 1; } while(width--) { src = srcPtr; dst = (CARD32 *)dstPtr; count = height; while(count--) { *(dst++) = src[0] | (src[srcPitch] << 16); src += (srcPitch * 2); } srcPtr += pSiS->Rotate; dstPtr += dstPitch; } pbox++; } } /* this one could be faster */ void SISRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { SISPtr pSiS = SISPTR(pScrn); int count, width, height, y1, y2, dstPitch, srcPitch; CARD8 *dstPtr, *srcPtr, *src; CARD32 *dst; dstPitch = BitmapBytePad(pScrn->displayWidth * 24); srcPitch = -pSiS->Rotate * pSiS->ShadowPitch; while(num--) { width = pbox->x2 - pbox->x1; y1 = pbox->y1 & ~3; y2 = (pbox->y2 + 3) & ~3; height = (y2 - y1) >> 2; /* blocks of 3 dwords */ if(pSiS->Rotate == 1) { dstPtr = pSiS->FbBase + (pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3); srcPtr = pSiS->ShadowPtr + ((1 - y2) * srcPitch) + (pbox->x1 * 3); } else { dstPtr = pSiS->FbBase + ((pScrn->virtualY - pbox->x2) * dstPitch) + (y1 * 3); srcPtr = pSiS->ShadowPtr + (y1 * srcPitch) + (pbox->x2 * 3) - 3; } while(width--) { src = srcPtr; dst = (CARD32 *)dstPtr; count = height; while(count--) { dst[0] = src[0] | (src[1] << 8) | (src[2] << 16) | (src[srcPitch] << 24); dst[1] = src[srcPitch + 1] | (src[srcPitch + 2] << 8) | (src[srcPitch * 2] << 16) | (src[(srcPitch * 2) + 1] << 24); dst[2] = src[(srcPitch * 2) + 2] | (src[srcPitch * 3] << 8) | (src[(srcPitch * 3) + 1] << 16) | (src[(srcPitch * 3) + 2] << 24); dst += 3; src += (srcPitch << 2); } srcPtr += pSiS->Rotate * 3; dstPtr += dstPitch; } pbox++; } } void SISRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { SISPtr pSiS = SISPTR(pScrn); int count, width, height, dstPitch, srcPitch; CARD32 *dstPtr, *srcPtr, *src, *dst; dstPitch = pScrn->displayWidth; srcPitch = -pSiS->Rotate * pSiS->ShadowPitch >> 2; while(num--) { width = pbox->x2 - pbox->x1; height = pbox->y2 - pbox->y1; if(pSiS->Rotate == 1) { dstPtr = (CARD32 *)pSiS->FbBase + (pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2; srcPtr = (CARD32 *)pSiS->ShadowPtr + ((1 - pbox->y2) * srcPitch) + pbox->x1; } else { dstPtr = (CARD32 *)pSiS->FbBase + ((pScrn->virtualY - pbox->x2) * dstPitch) + pbox->y1; srcPtr = (CARD32 *)pSiS->ShadowPtr + (pbox->y1 * srcPitch) + pbox->x2 - 1; } while(width--) { src = srcPtr; dst = dstPtr; count = height; while(count--) { *(dst++) = *src; src += srcPitch; } srcPtr += pSiS->Rotate; dstPtr += dstPitch; } pbox++; } } xf86-video-sis-0.10.7/src/sis_opt.c0000664000076400007640000024746011763614407013666 00000000000000/* * SiS driver option evaluation * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Authors: Thomas Winischhofer * ? */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "sis.h" #include "xf86str.h" #include "xf86Cursor.h" typedef enum { OPTION_SW_CURSOR, OPTION_HW_CURSOR, OPTION_ACCEL, OPTION_ACCELMETHOD, OPTION_TURBOQUEUE, OPTION_FAST_VRAM, OPTION_HOSTBUS, OPTION_RENDER, OPTION_FORCE_CRT1TYPE, OPTION_FORCE_CRT2TYPE, OPTION_YPBPRAR, OPTION_SHADOW_FB, OPTION_DRI, OPTION_AGP_SIZE, OPTION_ROTATE, OPTION_REFLECT, OPTION_XVIDEO, OPTION_VESA, OPTION_MAXXFBMEM, OPTION_FORCECRT1, OPTION_XVONCRT2, OPTION_PDC, OPTION_PDCA, OPTION_EMI, OPTION_TVSTANDARD, OPTION_USEROMDATA, OPTION_INTERNALMODES, OPTION_USEOEM, OPTION_YV12, OPTION_CHTVOVERSCAN, OPTION_CHTVSOVERSCAN, OPTION_CHTVLUMABANDWIDTHCVBS, OPTION_CHTVLUMABANDWIDTHSVIDEO, OPTION_CHTVLUMAFLICKERFILTER, OPTION_CHTVCHROMABANDWIDTH, OPTION_CHTVCHROMAFLICKERFILTER, OPTION_CHTVCVBSCOLOR, OPTION_CHTVTEXTENHANCE, OPTION_CHTVCONTRAST, OPTION_SISTVEDGEENHANCE, OPTION_SISTVANTIFLICKER, OPTION_SISTVSATURATION, OPTION_SISTVCHROMAFILTER, OPTION_SISTVLUMAFILTER, OPTION_SISTVCOLCALIBFINE, OPTION_SISTVCOLCALIBCOARSE, OPTION_TVXPOSOFFSET, OPTION_TVYPOSOFFSET, OPTION_TVXSCALE, OPTION_TVYSCALE, OPTION_SIS6326ANTIFLICKER, OPTION_SIS6326ENABLEYFILTER, OPTION_SIS6326YFILTERSTRONG, OPTION_SIS6326FORCETVPPLUG, OPTION_SIS6326FSCADJUST, OPTION_CHTVTYPE, OPTION_USERGBCURSOR, OPTION_USERGBCURSORBLEND, OPTION_USERGBCURSORBLENDTH, OPTION_RESTOREBYSET, OPTION_DDCFORCRT2, OPTION_FORCECRT2REDETECTION, OPTION_SENSEYPBPR, OPTION_CRT1GAMMA, OPTION_CRT2GAMMA, OPTION_XVGAMMA, OPTION_XVDEFCONTRAST, OPTION_XVDEFBRIGHTNESS, OPTION_XVDEFHUE, OPTION_XVDEFSATURATION, OPTION_XVDEFDISABLEGFX, OPTION_XVDEFDISABLEGFXLR, OPTION_XVMEMCPY, OPTION_XVBENCHCPY, #ifndef SISCHECKOSSSE OPTION_XVSSECOPY, #endif OPTION_XVUSECHROMAKEY, OPTION_XVCHROMAMIN, OPTION_XVCHROMAMAX, OPTION_XVDISABLECOLORKEY, OPTION_XVINSIDECHROMAKEY, OPTION_XVYUVCHROMAKEY, OPTION_XVDEFAULTADAPTOR, OPTION_SCALELCD, OPTION_CENTERLCD, OPTION_SPECIALTIMING, OPTION_LVDSHL, OPTION_PRGB, OPTION_ENABLEHOTKEY, OPTION_MERGEDFB, OPTION_MERGEDFBAUTO, OPTION_CRT2HSYNC, OPTION_CRT2VREFRESH, OPTION_CRT2POS, OPTION_METAMODES, OPTION_SISXINERAMA, OPTION_CRT2ISSCRN0, OPTION_MERGEDDPI, OPTION_MERGEDFBNONRECT, OPTION_MERGEDFBMOUSER, OPTION_ENABLESISCTRL, OPTION_STOREDBRI, OPTION_STOREDBRI2, OPTION_NEWSTOREDBRI, OPTION_NEWSTOREDBRI2, OPTION_NEWSTOREDCON, OPTION_NEWSTOREDCON2, OPTION_CRT1SATGAIN, OPTION_OVERRULERANGES, OPTION_FORCE1ASPECT, OPTION_FORCE2ASPECT, OPTION_TVBLUE, #ifdef SIS_CP SIS_CP_OPT_OPTIONS #endif OPTION_PSEUDO } SISOpts; static const OptionInfoRec SISOptions[] = { { OPTION_ACCEL, "Accel", OPTV_BOOLEAN, {0}, FALSE }, #if defined(SIS_USE_XAA) && defined(SIS_USE_EXA) { OPTION_ACCELMETHOD, "AccelMethod", OPTV_STRING, {0}, FALSE }, #endif { OPTION_TURBOQUEUE, "TurboQueue", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_FAST_VRAM, "FastVram", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HOSTBUS, "HostBus", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_RENDER, "RenderAcceleration", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_FORCE_CRT1TYPE, "ForceCRT1Type", OPTV_STRING, {0}, FALSE }, { OPTION_FORCE_CRT2TYPE, "ForceCRT2Type", OPTV_STRING, {0}, FALSE }, { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_AGP_SIZE, "AGPSize", OPTV_INTEGER, {0}, FALSE }, { OPTION_AGP_SIZE, "GARTSize", OPTV_INTEGER, {0}, FALSE }, { OPTION_VESA, "Vesa", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_MAXXFBMEM, "MaxXFBMem", OPTV_INTEGER, {0}, FALSE }, { OPTION_ENABLESISCTRL, "EnableSiSCtrl", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWCursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_USERGBCURSOR, "UseColorHWCursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE }, { OPTION_REFLECT, "Reflect", OPTV_STRING, {0}, FALSE }, { OPTION_XVIDEO, "Xvideo", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_INTERNALMODES, "InternalModes", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_OVERRULERANGES, "OverruleFrequencyRanges", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_RESTOREBYSET, "RestoreBySetMode", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_FORCECRT1, "ForceCRT1", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_XVONCRT2, "XvOnCRT2", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_PDC, "PanelDelayCompensation", OPTV_INTEGER, {0}, FALSE }, { OPTION_PDC, "PDC", OPTV_INTEGER, {0}, FALSE }, { OPTION_PDC, "PanelDelayCompensation2", OPTV_INTEGER, {0}, FALSE }, { OPTION_PDC, "PDC2", OPTV_INTEGER, {0}, FALSE }, { OPTION_PDCA, "PanelDelayCompensation1", OPTV_INTEGER, {0}, FALSE }, { OPTION_PDCA, "PDC1", OPTV_INTEGER, {0}, FALSE }, { OPTION_EMI, "EMI", OPTV_INTEGER, {0}, FALSE }, { OPTION_LVDSHL, "LVDSHL", OPTV_INTEGER, {0}, FALSE }, { OPTION_PRGB, "ForcePanelRGB", OPTV_INTEGER, {0}, FALSE }, { OPTION_SPECIALTIMING, "SpecialTiming", OPTV_STRING, {0}, FALSE }, { OPTION_TVSTANDARD, "TVStandard", OPTV_STRING, {0}, FALSE }, { OPTION_USEROMDATA, "UseROMData", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_USEOEM, "UseOEMData", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_YV12, "YV12", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CHTVTYPE, "CHTVType", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CHTVOVERSCAN, "CHTVOverscan", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CHTVSOVERSCAN, "CHTVSuperOverscan", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CHTVLUMABANDWIDTHCVBS, "CHTVLumaBandwidthCVBS", OPTV_INTEGER, {0}, FALSE }, { OPTION_CHTVLUMABANDWIDTHSVIDEO, "CHTVLumaBandwidthSVIDEO", OPTV_INTEGER, {0}, FALSE }, { OPTION_CHTVLUMAFLICKERFILTER, "CHTVLumaFlickerFilter", OPTV_INTEGER, {0}, FALSE }, { OPTION_CHTVCHROMABANDWIDTH, "CHTVChromaBandwidth", OPTV_INTEGER, {0}, FALSE }, { OPTION_CHTVCHROMAFLICKERFILTER, "CHTVChromaFlickerFilter", OPTV_INTEGER, {0}, FALSE }, { OPTION_CHTVCVBSCOLOR, "CHTVCVBSColor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CHTVTEXTENHANCE, "CHTVTextEnhance", OPTV_INTEGER, {0}, FALSE }, { OPTION_CHTVCONTRAST, "CHTVContrast", OPTV_INTEGER, {0}, FALSE }, { OPTION_SISTVEDGEENHANCE, "SISTVEdgeEnhance", OPTV_INTEGER, {0}, FALSE }, { OPTION_SISTVANTIFLICKER, "SISTVAntiFlicker", OPTV_STRING, {0}, FALSE }, { OPTION_SISTVSATURATION, "SISTVSaturation", OPTV_INTEGER, {0}, FALSE }, { OPTION_SISTVCHROMAFILTER, "SISTVCFilter", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SISTVLUMAFILTER, "SISTVYFilter", OPTV_INTEGER, {0}, FALSE }, { OPTION_SISTVCOLCALIBFINE, "SISTVColorCalibFine", OPTV_INTEGER, {0}, FALSE }, { OPTION_SISTVCOLCALIBCOARSE, "SISTVColorCalibCoarse", OPTV_INTEGER, {0}, FALSE }, { OPTION_TVXSCALE, "SISTVXScale", OPTV_INTEGER, {0}, FALSE }, { OPTION_TVYSCALE, "SISTVYScale", OPTV_INTEGER, {0}, FALSE }, { OPTION_TVXPOSOFFSET, "TVXPosOffset", OPTV_INTEGER, {0}, FALSE }, { OPTION_TVYPOSOFFSET, "TVYPosOffset", OPTV_INTEGER, {0}, FALSE }, { OPTION_SIS6326ANTIFLICKER, "SIS6326TVAntiFlicker", OPTV_STRING, {0}, FALSE }, { OPTION_SIS6326ENABLEYFILTER, "SIS6326TVEnableYFilter", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SIS6326YFILTERSTRONG, "SIS6326TVYFilterStrong", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SIS6326FORCETVPPLUG, "SIS6326TVForcePlug", OPTV_STRING, {0}, FALSE }, { OPTION_SIS6326FSCADJUST, "SIS6326FSCAdjust", OPTV_INTEGER, {0}, FALSE }, { OPTION_YPBPRAR, "YPbPrAspectRatio", OPTV_STRING, {0}, FALSE }, { OPTION_TVBLUE, "TVBlueWorkAround", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_USERGBCURSORBLEND, "ColorHWCursorBlending", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_USERGBCURSORBLENDTH, "ColorHWCursorBlendThreshold", OPTV_INTEGER, {0}, FALSE }, { OPTION_DDCFORCRT2, "CRT2Detection", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_FORCECRT2REDETECTION, "ForceCRT2ReDetection", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SENSEYPBPR, "SenseYPbPr", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CRT1GAMMA, "CRT1Gamma", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CRT2GAMMA, "CRT2Gamma", OPTV_ANYSTR, {0}, FALSE }, { OPTION_STOREDBRI, "GammaBrightness", OPTV_STRING, {0}, FALSE }, { OPTION_STOREDBRI2, "GammaBrightnessCRT2", OPTV_STRING, {0}, FALSE }, { OPTION_STOREDBRI2, "CRT2GammaBrightness", OPTV_STRING, {0}, FALSE }, { OPTION_NEWSTOREDBRI, "Brightness", OPTV_STRING, {0}, FALSE }, { OPTION_NEWSTOREDBRI, "NewGammaBrightness", OPTV_STRING, {0}, FALSE }, { OPTION_NEWSTOREDBRI2, "CRT2Brightness", OPTV_STRING, {0}, FALSE }, { OPTION_NEWSTOREDBRI2, "CRT2NewGammaBrightness", OPTV_STRING, {0}, FALSE }, { OPTION_NEWSTOREDCON, "Contrast", OPTV_STRING, {0}, FALSE }, { OPTION_NEWSTOREDCON, "NewGammaContrast", OPTV_STRING, {0}, FALSE }, { OPTION_NEWSTOREDCON2, "CRT2Contrast", OPTV_STRING, {0}, FALSE }, { OPTION_NEWSTOREDCON2, "CRT2NewGammaContrast", OPTV_STRING, {0}, FALSE }, { OPTION_CRT1SATGAIN, "CRT1Saturation", OPTV_INTEGER, {0}, FALSE }, { OPTION_XVGAMMA, "XvGamma", OPTV_ANYSTR, {0}, FALSE }, { OPTION_XVDEFCONTRAST, "XvDefaultContrast", OPTV_INTEGER, {0}, FALSE }, { OPTION_XVDEFBRIGHTNESS, "XvDefaultBrightness", OPTV_INTEGER, {0}, FALSE }, { OPTION_XVDEFHUE, "XvDefaultHue", OPTV_INTEGER, {0}, FALSE }, { OPTION_XVDEFSATURATION, "XvDefaultSaturation", OPTV_INTEGER, {0}, FALSE }, { OPTION_XVDEFDISABLEGFX, "XvDefaultDisableGfx", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_XVDEFDISABLEGFXLR, "XvDefaultDisableGfxLR", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_XVCHROMAMIN, "XvChromaMin", OPTV_INTEGER, {0}, FALSE }, { OPTION_XVCHROMAMAX, "XvChromaMax", OPTV_INTEGER, {0}, FALSE }, { OPTION_XVUSECHROMAKEY, "XvUseChromaKey", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_XVINSIDECHROMAKEY, "XvInsideChromaKey", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_XVYUVCHROMAKEY, "XvYUVChromaKey", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_XVDISABLECOLORKEY, "XvDisableColorKey", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_XVMEMCPY, "XvUseMemcpy", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_XVBENCHCPY, "BenchmarkMemcpy", OPTV_BOOLEAN, {0}, FALSE }, #ifndef SISCHECKOSSSE { OPTION_XVSSECOPY, "UseSSE", OPTV_BOOLEAN, {0}, FALSE }, #endif { OPTION_XVDEFAULTADAPTOR, "XvDefaultAdaptor", OPTV_STRING, {0}, FALSE }, { OPTION_SCALELCD, "ScaleLCD", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CENTERLCD, "CenterLCD", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_ENABLEHOTKEY, "EnableHotkey", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_FORCE1ASPECT, "ForceCRT1VGAAspect", OPTV_STRING, {0}, FALSE }, { OPTION_FORCE2ASPECT, "ForceCRT2VGAAspect", OPTV_STRING, {0}, FALSE }, #ifdef SISMERGED { OPTION_MERGEDFB, "MergedFB", OPTV_ANYSTR, {0}, FALSE }, { OPTION_MERGEDFB, "TwinView", OPTV_ANYSTR, {0}, FALSE }, /* alias */ { OPTION_MERGEDFBAUTO, "MergedFBAuto", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CRT2HSYNC, "CRT2HSync", OPTV_STRING, {0}, FALSE }, { OPTION_CRT2HSYNC, "SecondMonitorHorizSync", OPTV_STRING, {0}, FALSE }, /* alias */ { OPTION_CRT2VREFRESH, "CRT2VRefresh", OPTV_STRING, {0}, FALSE }, { OPTION_CRT2VREFRESH, "SecondMonitorVertRefresh", OPTV_STRING, {0}, FALSE }, /* alias */ { OPTION_CRT2POS, "CRT2Position", OPTV_STRING, {0}, FALSE }, { OPTION_CRT2POS, "TwinViewOrientation", OPTV_STRING, {0}, FALSE }, /* alias */ { OPTION_METAMODES, "MetaModes", OPTV_STRING, {0}, FALSE }, { OPTION_MERGEDDPI, "MergedDPI", OPTV_STRING, {0}, FALSE }, #ifdef SISXINERAMA { OPTION_SISXINERAMA, "MergedXinerama", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SISXINERAMA, "TwinviewXineramaInfo", OPTV_BOOLEAN, {0}, FALSE }, /* alias */ { OPTION_CRT2ISSCRN0, "MergedXineramaCRT2IsScreen0", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_MERGEDFBNONRECT, "MergedNonRectangular", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_MERGEDFBMOUSER, "MergedMouseRestriction", OPTV_BOOLEAN, {0}, FALSE }, #endif #endif #ifdef SIS_CP SIS_CP_OPTION_DETAIL #endif { -1, NULL, OPTV_NONE, {0}, FALSE } }; static int SiS_FIFT(const OptionInfoRec *options, int token) { /* Find index from token */ int i = 0; while(options[i].token >= 0) { if(options[i].token == token) return i; i++; } return 0; /* Should not happen */ } static void SiS_PrintBadOpt(ScrnInfoPtr pScrn, char *strptr, int token) { SISPtr pSiS = SISPTR(pScrn); xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "\"%s\" is is not a valid parameter for option \"%s\"\n", strptr, pSiS->Options[SiS_FIFT(pSiS->Options, token)].name); } static void SiS_PrintIlRange(ScrnInfoPtr pScrn, int token, int min, int max, UChar showhex) { SISPtr pSiS = SISPTR(pScrn); static const char *ilparmd = "Invalid parameter for \"%s\". Valid range is %d - %d\n"; static const char *ilparmh = "Invalid parameter for \"%s\". Valid range is 0x%x - 0x%x\n"; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, showhex ? ilparmh : ilparmd, pSiS->Options[SiS_FIFT(pSiS->Options, token)].name, min, max); } #ifdef SISDUALHEAD static void SiS_PrintOverruleDHM(ScrnInfoPtr pScrn, int token1, int token2) { SISPtr pSiS = SISPTR(pScrn); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\"%s\" overrules \"%s\" in CRT2 (Master) device section\n", pSiS->Options[SiS_FIFT(pSiS->Options, token1)].name, pSiS->Options[SiS_FIFT(pSiS->Options, token2)].name); } #endif static Bool SiS_StrIsBoolOn(char *strptr) { if( (*strptr == '\0') || (!xf86NameCmp(strptr,"on")) || (!xf86NameCmp(strptr,"true")) || (!xf86NameCmp(strptr,"yes")) || (!xf86NameCmp(strptr,"1")) ) return TRUE; return FALSE; } static Bool SiS_StrIsBoolOff(char *strptr) { if( (!xf86NameCmp(strptr,"off")) || (!xf86NameCmp(strptr,"false")) || (!xf86NameCmp(strptr,"no")) || (!xf86NameCmp(strptr,"0")) ) return TRUE; return FALSE; } static Bool SiS_EvalOneOrThreeFloats(ScrnInfoPtr pScrn, int token, const char *myerror, char *strptr, int *v1, int *v2, int *v3) { SISPtr pSiS = SISPTR(pScrn); float val1 = 0.0, val2 = 0.0, val3 = 0.0; Bool valid = FALSE; int result = sscanf(strptr, "%f %f %f", &val1, &val2, &val3); if(result == 1) { if((val1 >= 0.1) && (val1 <= 10.0)) { valid = TRUE; *v1 = *v2 = *v3 = (int)(val1 * 1000); } } else if(result == 3) { if((val1 >= 0.1) && (val1 <= 10.0) && (val2 >= 0.1) && (val2 <= 10.0) && (val3 >= 0.1) && (val3 <= 10.0)) { valid = TRUE; *v1 = (int)(val1 * 1000); *v2 = (int)(val2 * 1000); *v3 = (int)(val3 * 1000); } } if(!valid) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, myerror, pSiS->Options[SiS_FIFT(pSiS->Options, token)].name); } return (valid); } static Bool SiS_EvalOneOrThreeFloats2(ScrnInfoPtr pScrn, int token, const char *myerror, char *strptr, float *v1, float *v2, float *v3) { SISPtr pSiS = SISPTR(pScrn); float val1 = 0.0, val2 = 0.0, val3 = 0.0; Bool valid = FALSE; int result = sscanf(strptr, "%f %f %f", &val1, &val2, &val3); if(result == 1) { if((val1 >= -1.0) && (val1 <= 1.0)) { valid = TRUE; *v1 = *v2 = *v3 = val1; } } else if(result == 3) { if((val1 >= -1.0) && (val1 <= 1.0) && (val2 >= -1.0) && (val2 <= 1.0) && (val3 >= -1.0) && (val3 <= 1.0)) { valid = TRUE; *v1 = val1; *v2 = val2; *v3 = val3; } } if(!valid) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, myerror, pSiS->Options[SiS_FIFT(pSiS->Options, token)].name); } return (valid); } void SiSOptions(ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); MessageType from; char *strptr; int ival; static const char *baddhm = "Option \"%s\" ignored in Dual Head mode\n"; static const char *validparm = "Valid parameters are"; static const char *disabledstr= "disabled"; static const char *enabledstr = "enabled"; static const char *gammaopt = "%s expects either a boolean, or 1 or 3 real numbers (0.1 - 10.0)\n"; static const char *briopt = "%s expects 1 or 3 real numbers (0.1 - 10.0)\n"; static const char *newbriopt = "%s expects 1 or 3 real numbers (-1.0 - 1.0)\n"; Bool val, IsDHM = FALSE; Bool IsSecondHead = FALSE; /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ if(!(pSiS->Options = malloc(sizeof(SISOptions)))) return; memcpy(pSiS->Options, SISOptions, sizeof(SISOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pSiS->Options); /* Set defaults */ pSiS->newFastVram = -1; pSiS->HostBus = TRUE; pSiS->TurboQueue = TRUE; #ifdef SISVRAMQ /* TODO: Option (315 series VRAM command queue) */ /* But beware: sisfb does not know about this!!! */ pSiS->cmdQueueSize = 512*1024; if(pSiS->ChipType == XGI_20) { /* Hardware maximum on Z7: 128k */ pSiS->cmdQueueSize = 128*1024; } #endif pSiS->doRender = TRUE; pSiS->HWCursor = TRUE; pSiS->Rotate = 0; pSiS->Reflect = 0; pSiS->NoAccel = FALSE; #if (defined(SIS_USE_EXA) && defined(SIS_USE_XAA)) || !defined(SIS_USE_EXA) pSiS->useEXA = FALSE; #else pSiS->useEXA = TRUE; #endif pSiS->ShadowFB = FALSE; pSiS->loadDRI = FALSE; #ifdef SISDRI pSiS->agpWantedPages = AGP_PAGES; #endif pSiS->VESA = -1; pSiS->NoXvideo = FALSE; pSiS->maxxfbmem = 0; pSiS->forceCRT1 = -1; pSiS->DSTN = FALSE; pSiS->FSTN = FALSE; pSiS->XvOnCRT2 = FALSE; pSiS->NoYV12 = -1; pSiS->PDC = -1; pSiS->PDCA = -1; pSiS->EMI = -1; pSiS->PRGB = -1; pSiS->OptTVStand = -1; pSiS->OptROMUsage = -1; pSiS->noInternalModes = FALSE; pSiS->OptUseOEM = -1; pSiS->OptTVOver = -1; pSiS->OptTVSOver = -1; pSiS->chtvlumabandwidthcvbs = -1; pSiS->chtvlumabandwidthsvideo = -1; pSiS->chtvlumaflickerfilter = -1; pSiS->chtvchromabandwidth = -1; pSiS->chtvchromaflickerfilter = -1; pSiS->chtvcvbscolor = -1; pSiS->chtvtextenhance = -1; pSiS->chtvcontrast = -1; pSiS->sistvedgeenhance = -1; pSiS->sistvantiflicker = -1; pSiS->sistvsaturation = -1; pSiS->sistvcfilter = -1; pSiS->sistvyfilter = 1; /* 0 = off, 1 = default, 2-8 = filter no */ pSiS->sistvcolcalibc = 0; pSiS->sistvcolcalibf = 0; pSiS->sis6326enableyfilter = -1; pSiS->sis6326yfilterstrong = -1; pSiS->sis6326tvplug = -1; pSiS->sis6326fscadjust = 0; pSiS->tvxpos = 0; pSiS->tvypos = 0; pSiS->tvxscale = 0; pSiS->tvyscale = 0; pSiS->siscrt1satgain = 0; pSiS->crt1satgaingiven = FALSE; pSiS->NonDefaultPAL = pSiS->NonDefaultNTSC = -1; pSiS->chtvtype = -1; pSiS->restorebyset = TRUE; pSiS->nocrt2ddcdetection = FALSE; pSiS->forcecrt2redetection = TRUE; pSiS->SenseYPbPr = TRUE; pSiS->ForceCRT1Type = CRT1_VGA; pSiS->CRT1TypeForced = FALSE; pSiS->ForceCRT2Type = CRT2_DEFAULT; pSiS->ForceYPbPrAR = TV_YPBPR169; pSiS->ForceTVType = -1; pSiS->CRT1gamma = TRUE; pSiS->CRT1gammaGiven = FALSE; pSiS->CRT2gamma = TRUE; pSiS->XvGamma = FALSE; pSiS->XvGammaGiven = FALSE; pSiS->enablesisctrl = FALSE; if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { pSiS->XvDefBri = 10; pSiS->XvDefCon = 2; } else { pSiS->XvDefBri = 0; pSiS->XvDefCon = 4; } pSiS->XvDefHue = 0; pSiS->XvDefSat = 0; pSiS->XvDefDisableGfx = FALSE; pSiS->XvDefDisableGfxLR = FALSE; pSiS->XvDefAdaptorBlit = FALSE; pSiS->UsePanelScaler = -1; pSiS->CenterLCD = -1; pSiS->XvUseMemcpy = TRUE; pSiS->XvUseChromaKey = FALSE; pSiS->XvDisableColorKey = FALSE; pSiS->XvInsideChromaKey = FALSE; pSiS->XvYUVChromaKey = FALSE; pSiS->XvChromaMin = 0x000101fe; pSiS->XvChromaMax = 0x000101ff; pSiS->XvGammaRed = pSiS->XvGammaGreen = pSiS->XvGammaBlue = pSiS->XvGammaRedDef = pSiS->XvGammaGreenDef = pSiS->XvGammaBlueDef = 1000; pSiS->GammaBriR = pSiS->GammaBriG = pSiS->GammaBriB = 1000; pSiS->CRT2SepGamma = FALSE; pSiS->GammaR2 = pSiS->GammaG2 = pSiS->GammaB2 = 1.0; pSiS->GammaBriR2 = pSiS->GammaBriG2 = pSiS->GammaBriB2 = 1000; pSiS->NewGammaBriR = pSiS->NewGammaBriG = pSiS->NewGammaBriB = 0.0; pSiS->NewGammaConR = pSiS->NewGammaConG = pSiS->NewGammaConB = 0.0; pSiS->NewGammaBriR2 = pSiS->NewGammaBriG2 = pSiS->NewGammaBriB2 = 0.0; pSiS->NewGammaConR2 = pSiS->NewGammaConG2 = pSiS->NewGammaConB2 = 0.0; pSiS->HideHWCursor = FALSE; pSiS->HWCursorIsVisible = FALSE; pSiS->OverruleRanges = TRUE; pSiS->BenchMemCpy = TRUE; #ifndef SISCHECKOSSSE pSiS->XvSSEMemcpy = FALSE; #endif #ifdef SISMERGED pSiS->MergedFB = pSiS->MergedFBAuto = FALSE; pSiS->CRT2Position = sisRightOf; pSiS->CRT2HSync = NULL; pSiS->CRT2VRefresh = NULL; pSiS->MetaModes = NULL; pSiS->MergedFBXDPI = pSiS->MergedFBYDPI = 0; pSiS->CRT1XOffs = pSiS->CRT1YOffs = pSiS->CRT2XOffs = pSiS->CRT2YOffs = 0; pSiS->NonRect = pSiS->HaveNonRect = pSiS->HaveOffsRegions = FALSE; pSiS->MBXNR1XMAX = pSiS->MBXNR1YMAX = pSiS->MBXNR2XMAX = pSiS->MBXNR2YMAX = 65536; pSiS->MouseRestrictions = TRUE; #ifdef SISXINERAMA pSiS->UseSiSXinerama = TRUE; pSiS->CRT2IsScrn0 = FALSE; #endif #endif #ifdef SIS_CP SIS_CP_OPT_DEFAULT #endif /* Chipset dependent defaults */ if(pSiS->Chipset == PCI_CHIP_SIS530) { /* TQ still broken on 530/620? */ pSiS->TurboQueue = FALSE; } if(pSiS->Chipset == PCI_CHIP_SIS6326) { pSiS->newFastVram = 1; } if(pSiS->ChipType == SIS_315H || pSiS->ChipType == SIS_315) { /* Cursor engine seriously broken */ pSiS->HWCursor = FALSE; } if((pSiS->Chipset == PCI_CHIP_SIS550) || (pSiS->Chipset == PCI_CHIP_XGIXG20)) { /* Alpha blending not supported */ pSiS->doRender = FALSE; } if(pSiS->Chipset == PCI_CHIP_XGIXG20) { /* No video overlay, no video blitter */ pSiS->NoXvideo = TRUE; } /* DRI only supported on 300 series, * so don't load DRI by default on * others. */ if(pSiS->VGAEngine == SIS_300_VGA) { pSiS->loadDRI = TRUE; } #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) pSiS->OptUseColorCursor = 0; #else if(pSiS->VGAEngine == SIS_300_VGA) { pSiS->OptUseColorCursor = 0; pSiS->OptUseColorCursorBlend = 1; pSiS->OptColorCursorBlendThreshold = 0x37000000; } else if(pSiS->VGAEngine == SIS_315_VGA) { if(pSiS->Chipset == PCI_CHIP_XGIXG20) { /* No color HW cursor on Z7 */ pSiS->OptUseColorCursor = 0; } else { pSiS->OptUseColorCursor = 1; } } #endif if(pSiS->VGAEngine == SIS_300_VGA) { pSiS->AllowHotkey = 0; } else if(pSiS->VGAEngine == SIS_315_VGA) { pSiS->AllowHotkey = 1; } /* Collect the options */ /* FastVRAM (5597/5598, 6326 and 530/620 only) */ if((pSiS->VGAEngine == SIS_OLD_VGA) || (pSiS->VGAEngine == SIS_530_VGA)) { from = X_DEFAULT; if(xf86GetOptValBool(pSiS->Options, OPTION_FAST_VRAM, &pSiS->newFastVram)) { from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "Fast VRAM timing %s\n", (pSiS->newFastVram == -1) ? ((pSiS->oldChipset == OC_SIS620) ? "enabled (for read only)" : "enabled (for write only)") : (pSiS->newFastVram ? "enabled (for read and write)" : disabledstr)); } /* HostBus (5597/5598 only) */ if(pSiS->Chipset == PCI_CHIP_SIS5597) { from = X_DEFAULT; if(xf86GetOptValBool(pSiS->Options, OPTION_HOSTBUS, &pSiS->HostBus)) { from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "SiS5597/5598 VGA-to-CPU host bus %s\n", pSiS->HostBus ? enabledstr : disabledstr); } /* MaxXFBMem * This options limits the amount of video memory X uses for screen * and off-screen buffers. This option should be used if using DRI * is intended. The kernel framebuffer driver required for DRM will * start its memory heap at 12MB if it detects more than 16MB, at 8MB if * between 8 and 16MB are available, otherwise at 4MB. So, if the amount * of memory X uses, a clash between the framebuffer's memory heap * and X is avoided. The amount is to be specified in KB. */ if(xf86GetOptValInteger(pSiS->Options, OPTION_MAXXFBMEM, (int *)&pSiS->maxxfbmem)) { if(pSiS->maxxfbmem >= 2048) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MaxXFBMem: Framebuffer memory shall be limited to %d KB\n", pSiS->maxxfbmem); pSiS->maxxfbmem *= 1024; } else { pSiS->maxxfbmem = 0; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Invalid MaxXFBMem setting; minimum is 2048\n"); } } /* Accel * Turns on/off 2D acceleration */ if(!xf86ReturnOptValBool(pSiS->Options, OPTION_ACCEL, TRUE)) { pSiS->NoAccel = TRUE; #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) pSiS->NoXvideo = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "2D Acceleration and Xv disabled\n"); #else xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "2D Acceleration disabled\n"); #endif } #if defined(SIS_USE_XAA) && defined(SIS_USE_EXA) if(!pSiS->NoAccel) { from = X_DEFAULT; if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_ACCELMETHOD))) { if(!xf86NameCmp(strptr,"XAA")) { from = X_CONFIG; pSiS->useEXA = FALSE; } else if(!xf86NameCmp(strptr,"EXA")) { from = X_CONFIG; pSiS->useEXA = TRUE; } } xf86DrvMsg(pScrn->scrnIndex, from, "Using %s acceleration architecture\n", pSiS->useEXA ? "EXA" : "XAA"); } #endif /* RenderAcceleration * En/Disables RENDER acceleration (315/330/340 series only, not 550, not XGI Z7) */ #ifdef SIS_USE_XAA if((pSiS->VGAEngine == SIS_315_VGA) && (pSiS->Chipset != PCI_CHIP_SIS550) && (pSiS->Chipset != PCI_CHIP_XGIXG20) && (!pSiS->NoAccel)) { if(xf86GetOptValBool(pSiS->Options, OPTION_RENDER, &pSiS->doRender)) { if(!pSiS->doRender) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "RENDER Acceleration disabled\n"); } } } #else pSiS->doRender = FALSE; #endif /* SWCursor, HWCursor * Chooses whether to use the hardware or software cursor */ from = X_DEFAULT; if(xf86GetOptValBool(pSiS->Options, OPTION_HW_CURSOR, &pSiS->HWCursor)) { from = X_CONFIG; } if(xf86ReturnOptValBool(pSiS->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pSiS->HWCursor = FALSE; pSiS->OptUseColorCursor = 0; } xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pSiS->HWCursor ? "HW" : "SW"); /* * UseColorHWCursor * ColorHWCursorBlending * ColorHWCursorBlendThreshold * * Enable/disable color hardware cursors; * enable/disable color hw cursor emulation for 300 series * select emultation transparency threshold for 300 series * */ #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,2,99,0,0) #ifdef ARGB_CURSOR #ifdef SIS_ARGB_CURSOR if((pSiS->HWCursor) && ((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) && (pSiS->Chipset != PCI_CHIP_XGIXG20)) { from = X_DEFAULT; if(xf86GetOptValBool(pSiS->Options, OPTION_USERGBCURSOR, &pSiS->OptUseColorCursor)) { from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "Color HW cursor is %s\n", pSiS->OptUseColorCursor ? enabledstr : disabledstr); if(pSiS->VGAEngine == SIS_300_VGA) { from = X_DEFAULT; if(xf86GetOptValBool(pSiS->Options, OPTION_USERGBCURSORBLEND, &pSiS->OptUseColorCursorBlend)) { from = X_CONFIG; } if(pSiS->OptUseColorCursor) { xf86DrvMsg(pScrn->scrnIndex, from, "HW cursor color blending emulation is %s\n", (pSiS->OptUseColorCursorBlend) ? enabledstr : disabledstr); } from = X_DEFAULT; if(xf86GetOptValInteger(pSiS->Options, OPTION_USERGBCURSORBLENDTH, &ival)) { if((ival >= 0) && (ival <= 255)) { from = X_CONFIG; pSiS->OptColorCursorBlendThreshold = (ival << 24); } else { ival = pSiS->OptColorCursorBlendThreshold >> 24; SiS_PrintIlRange(pScrn, OPTION_USERGBCURSORBLENDTH, 0, 255, 0); } } else { ival = pSiS->OptColorCursorBlendThreshold >> 24; } if(pSiS->OptUseColorCursor) { if(pSiS->OptUseColorCursorBlend) { xf86DrvMsg(pScrn->scrnIndex, from, "HW cursor color blending emulation threshold is %d\n", ival); } } } } #endif #endif #endif /* OverruleFrequencyRanges * Enable/disable overruling bogus frequency ranges for TV and LCD(A) */ if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { if(xf86GetOptValBool(pSiS->Options, OPTION_OVERRULERANGES, &val)) { if(!val) { pSiS->OverruleRanges = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Overruling frequency ranges disabled\n"); } } } #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { IsDHM = TRUE; if(pSiS->SecondHead) IsSecondHead = TRUE; } #endif /* MergedFB * Enable/disable and configure merged framebuffer mode */ #ifdef SISMERGED #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { if(xf86IsOptionSet(pSiS->Options, OPTION_MERGEDFB)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, baddhm, pSiS->Options[SiS_FIFT(pSiS->Options, OPTION_MERGEDFB)].name); } if(xf86IsOptionSet(pSiS->Options, OPTION_MERGEDFBAUTO)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, baddhm, pSiS->Options[SiS_FIFT(pSiS->Options, OPTION_MERGEDFBAUTO)].name); } } else #endif if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_MERGEDFB))) { if(SiS_StrIsBoolOn(strptr)) { pSiS->MergedFB = TRUE; pSiS->MergedFBAuto = FALSE; } else if(!xf86NameCmp(strptr, "AUTO")) { pSiS->MergedFB = TRUE; pSiS->MergedFBAuto = TRUE; } } if(xf86GetOptValBool(pSiS->Options, OPTION_MERGEDFBAUTO, &val)) { if(!pSiS->MergedFB) { if(val) pSiS->MergedFB = pSiS->MergedFBAuto = TRUE; } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Option \"MergedFB\" overrules option \"MergedFBAuto\"\n"); } } if(pSiS->MergedFB) { if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_CRT2POS))) { int result; Bool valid = FALSE; char *tempstr = malloc(strlen(strptr) + 1); result = sscanf(strptr, "%s %d", tempstr, &ival); if(result >= 1) { if(!xf86NameCmp(tempstr,"LeftOf")) { pSiS->CRT2Position = sisLeftOf; valid = TRUE; if(result == 2) { if(ival < 0) pSiS->CRT1YOffs = -ival; else pSiS->CRT2YOffs = ival; } #ifdef SISXINERAMA pSiS->CRT2IsScrn0 = TRUE; #endif } else if(!xf86NameCmp(tempstr,"RightOf")) { pSiS->CRT2Position = sisRightOf; valid = TRUE; if(result == 2) { if(ival < 0) pSiS->CRT1YOffs = -ival; else pSiS->CRT2YOffs = ival; } #ifdef SISXINERAMA pSiS->CRT2IsScrn0 = FALSE; #endif } else if(!xf86NameCmp(tempstr,"Above")) { pSiS->CRT2Position = sisAbove; valid = TRUE; if(result == 2) { if(ival < 0) pSiS->CRT1XOffs = -ival; else pSiS->CRT2XOffs = ival; } #ifdef SISXINERAMA pSiS->CRT2IsScrn0 = FALSE; #endif } else if(!xf86NameCmp(tempstr,"Below")) { pSiS->CRT2Position = sisBelow; valid = TRUE; if(result == 2) { if(ival < 0) pSiS->CRT1XOffs = -ival; else pSiS->CRT2XOffs = ival; } #ifdef SISXINERAMA pSiS->CRT2IsScrn0 = TRUE; #endif } else if(!xf86NameCmp(tempstr,"Clone")) { pSiS->CRT2Position = sisClone; if(result == 1) valid = TRUE; #ifdef SISXINERAMA pSiS->CRT2IsScrn0 = TRUE; #endif } } if(!valid) { SiS_PrintBadOpt(pScrn, strptr, OPTION_CRT2POS); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s \"RightOf\", \"LeftOf\", \"Above\", \"Below\", or \"Clone\"\n", validparm); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Except for \"Clone\", the parameter may be followed by an integer.\n"); } free(tempstr); } if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_METAMODES))) { pSiS->MetaModes = malloc(strlen(strptr) + 1); if(pSiS->MetaModes) memcpy(pSiS->MetaModes, strptr, strlen(strptr) + 1); } if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_CRT2HSYNC))) { pSiS->CRT2HSync = malloc(strlen(strptr) + 1); if(pSiS->CRT2HSync) memcpy(pSiS->CRT2HSync, strptr, strlen(strptr) + 1); } if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_CRT2VREFRESH))) { pSiS->CRT2VRefresh = malloc(strlen(strptr) + 1); if(pSiS->CRT2VRefresh) memcpy(pSiS->CRT2VRefresh, strptr, strlen(strptr) + 1); } if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_MERGEDDPI))) { int val1 = 0, val2 = 0; sscanf(strptr, "%d %d", &val1, &val2); if(val1 && val2) { pSiS->MergedFBXDPI = val1; pSiS->MergedFBYDPI = val2; } else { SiS_PrintBadOpt(pScrn, strptr, OPTION_MERGEDDPI); } } #ifdef SISXINERAMA if(pSiS->MergedFB) { if(xf86GetOptValBool(pSiS->Options, OPTION_SISXINERAMA, &val)) { if(!val) pSiS->UseSiSXinerama = FALSE; } if(pSiS->UseSiSXinerama) { if(xf86GetOptValBool(pSiS->Options, OPTION_CRT2ISSCRN0, &val)) { pSiS->CRT2IsScrn0 = val ? TRUE : FALSE; } if(xf86GetOptValBool(pSiS->Options, OPTION_MERGEDFBNONRECT, &val)) { pSiS->NonRect = val ? TRUE : FALSE; } if(xf86GetOptValBool(pSiS->Options, OPTION_MERGEDFBMOUSER, &val)) { pSiS->MouseRestrictions = val ? TRUE : FALSE; } } } #endif } } #endif /* Some options can only be specified in the Master Head's Device * section. Here we give the user a hint in the log. */ #ifdef SISDUALHEAD if((pSiS->DualHeadMode) && (pSiS->SecondHead)) { static const char *mystring = "Option \"%s\" only accepted in CRT2 (Master) Device section\n"; int i; const short forbiddenopts[] = { OPTION_TURBOQUEUE, OPTION_RESTOREBYSET, OPTION_ENABLEHOTKEY, OPTION_ENABLESISCTRL, OPTION_USEROMDATA, OPTION_USEOEM, OPTION_FORCECRT1, OPTION_DDCFORCRT2, OPTION_FORCECRT2REDETECTION, OPTION_SENSEYPBPR, OPTION_FORCE_CRT1TYPE, OPTION_FORCE_CRT2TYPE, OPTION_YPBPRAR, OPTION_SCALELCD, OPTION_CENTERLCD, OPTION_PDC, OPTION_PDCA, OPTION_EMI, OPTION_SPECIALTIMING, OPTION_LVDSHL, OPTION_TVSTANDARD, OPTION_CHTVTYPE, OPTION_CHTVOVERSCAN, OPTION_CHTVSOVERSCAN, OPTION_CHTVLUMABANDWIDTHCVBS, OPTION_CHTVLUMABANDWIDTHSVIDEO, OPTION_CHTVLUMAFLICKERFILTER, OPTION_CHTVCHROMABANDWIDTH, OPTION_CHTVCHROMAFLICKERFILTER, OPTION_CHTVCVBSCOLOR, OPTION_CHTVTEXTENHANCE, OPTION_CHTVCONTRAST, OPTION_SISTVEDGEENHANCE, OPTION_SISTVANTIFLICKER, OPTION_SISTVSATURATION, OPTION_SISTVCHROMAFILTER, OPTION_SISTVLUMAFILTER, OPTION_SISTVCOLCALIBCOARSE, OPTION_SISTVCOLCALIBFINE, OPTION_TVXPOSOFFSET, OPTION_TVYPOSOFFSET, OPTION_TVXSCALE, OPTION_TVYSCALE, OPTION_TVBLUE, OPTION_CRT2GAMMA, OPTION_XVONCRT2, OPTION_XVDEFAULTADAPTOR, OPTION_XVMEMCPY, OPTION_XVBENCHCPY, OPTION_FORCE2ASPECT, #if defined(SIS_USE_XAA) && defined(SIS_USE_EXA) OPTION_ACCELMETHOD, #endif #ifndef SISCHECKOSSSE OPTION_XVSSECOPY, #endif #ifdef SIS_CP SIS_CP_OPT_DH_WARN #endif -1 }; i = 0; while(forbiddenopts[i] >= 0) { if(xf86IsOptionSet(pSiS->Options, (int)forbiddenopts[i])) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, mystring, pSiS->Options[SiS_FIFT(pSiS->Options, (int)forbiddenopts[i])].name); } i++; } } else #endif { if(pSiS->VGAEngine == SIS_315_VGA) { #ifdef SISVRAMQ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using VRAM command queue, size %dk\n", pSiS->cmdQueueSize / 1024); #else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using MMIO command queue, size 512k\n"); #endif } else { /* TurboQueue */ from = X_DEFAULT; if(xf86GetOptValBool(pSiS->Options, OPTION_TURBOQUEUE, &pSiS->TurboQueue)) { from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "TurboQueue %s\n", pSiS->TurboQueue ? enabledstr : disabledstr); } if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { /* RestoreBySetMode (300/315/330 series only) * Set this to force the driver to set the old mode instead of restoring * the register contents. This can be used to overcome problems with * LCD panels and video bridges. */ if(xf86GetOptValBool(pSiS->Options, OPTION_RESTOREBYSET, &val)) { pSiS->restorebyset = val ? TRUE : FALSE; } /* EnableHotkey (300/315/330 series and later only) * Enables or disables the BIOS hotkey switch for * switching the output device on laptops. * This key causes a total machine hang on many 300 series * machines, it is therefore by default disabled on such. * In dual head mode, using the hotkey is lethal, so we * forbid it then in any case. * However, although the driver disables the hotkey as * BIOS developers intented to do that, some buggy BIOSes * still cause the machine to freeze. Hence the warning. */ ival = 0; from = X_DEFAULT; #ifdef SISDUALHEAD if(pSiS->DualHeadMode) { pSiS->AllowHotkey = 0; ival = 1; } else #endif if(xf86GetOptValBool(pSiS->Options, OPTION_ENABLEHOTKEY, &val)) { pSiS->AllowHotkey = val ? 1 : 0; from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "Hotkey display switching is %s%s\n", pSiS->AllowHotkey ? enabledstr : disabledstr, ival ? " in dual head mode" : ""); if(pSiS->Chipset == PCI_CHIP_SIS630 || pSiS->Chipset == PCI_CHIP_SIS650 || pSiS->Chipset == PCI_CHIP_SIS660) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "WARNING: Using the Hotkey might freeze your machine, regardless\n"); xf86DrvMsg(pScrn->scrnIndex, X_INFO, " whether enabled or disabled. This is no driver bug.\n"); } /* UseROMData (300/315/330 series and later only) * This option is enabling/disabling usage of some machine * specific data from the BIOS ROM. This option can - and * should - be used in case the driver makes problems * because SiS changed the location of this data. */ if(xf86GetOptValBool(pSiS->Options, OPTION_USEROMDATA, &val)) { pSiS->OptROMUsage = val ? 1 : 0; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Video ROM data usage shall be %s\n", val ? enabledstr : disabledstr); } /* UseOEMData (300/315/330 series and later only) * The driver contains quite a lot data for OEM LCD panels * and TV connector specifics which override the defaults. * If this data is incorrect, the TV may lose color and * the LCD panel might show some strange effects. Use this * option to disable the usage of this data. */ if(xf86GetOptValBool(pSiS->Options, OPTION_USEOEM, &val)) { pSiS->OptUseOEM = val ? 1 : 0; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Internal CRT2 OEM data usage shall be %s\n", val ? enabledstr : disabledstr); } /* CRT2DDCDetection (315/330 series and later only) * If set to true, this disables CRT2 detection using DDC. This is * to avoid problems with not entirely DDC compiant LCD panels or * VGA monitors connected to the secondary VGA plug. Since LCD and * VGA share the same DDC channel, it might in some cases be impossible * to determine if the device is a CRT monitor or a flat panel. */ if(xf86GetOptValBool(pSiS->Options, OPTION_DDCFORCRT2, &val)) { pSiS->nocrt2ddcdetection = val ? FALSE : TRUE; } /* ForceCRT2ReDetection (315/330 series and later only) * If set to true, it forces re-detection of the LCD panel and * a secondary VGA connection even if the BIOS already had found * about it. This is meant for custom panels (ie such with * non-standard resolutions) which the BIOS will "detect" according * to the established timings, resulting in only a very vague idea * about the panels real resolution. As for secondary VGA, this * enables us to include a Plasma panel's proprietary modes. */ if(xf86GetOptValBool(pSiS->Options, OPTION_FORCECRT2REDETECTION, &val)) { if(val) { pSiS->forcecrt2redetection = TRUE; pSiS->nocrt2ddcdetection = FALSE; } else pSiS->forcecrt2redetection = FALSE; } /* SenseYPbPr (315/330 series and later only) * If set to true, the driver will sense for YPbPr TV. This is * inconvenient for folks connecting SVideo and CVBS at the same * time, because this condition will be detected as YPbPr (since * the TV output pins are shared). "False" will not sense for * YPbPr and detect SVideo or CVBS only. */ if(xf86GetOptValBool(pSiS->Options, OPTION_SENSEYPBPR, &val)) { if(val) pSiS->SenseYPbPr = TRUE; else pSiS->SenseYPbPr = FALSE; } /* ForceCRT1Type (315/330 series and later only) * Used for forcing the driver to initialize CRT1 as * VGA (analog) or LCDA (for simultanious LCD and TV * display) - on M650/651 and 661 or later with 301C/30xLV only! */ if(pSiS->VGAEngine == SIS_315_VGA) { if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_FORCE_CRT1TYPE))) { if((!xf86NameCmp(strptr,"VGA")) || (!xf86NameCmp(strptr,"CRT"))) { pSiS->ForceCRT1Type = CRT1_VGA; pSiS->CRT1TypeForced = TRUE; } else if( (!xf86NameCmp(strptr,"LCD")) || (!xf86NameCmp(strptr,"LCDA")) || (!xf86NameCmp(strptr,"DVI-D")) || (!xf86NameCmp(strptr,"DVID")) || (!xf86NameCmp(strptr,"DVI")) || (!xf86NameCmp(strptr,"LCD-A")) ) { pSiS->ForceCRT1Type = CRT1_LCDA; pSiS->CRT1TypeForced = TRUE; } else if((!xf86NameCmp(strptr,"NONE")) || (!xf86NameCmp(strptr,"OFF"))) { pSiS->ForceCRT1Type = CRT1_VGA; pSiS->forceCRT1 = 0; pSiS->CRT1TypeForced = TRUE; } else { SiS_PrintBadOpt(pScrn, strptr, OPTION_FORCE_CRT1TYPE); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s \"VGA\" (alias \"CRT\"), \"LCD\" (alias \"DVI-D\") or NONE\n", validparm); } } } /* ForceCRT1 (300/315/330 series and later only) * This option can be used to force CRT1 (VGA) to be switched on/off. Its * intention is mainly for old monitors that can't be detected * automatically. This is only useful on machines with a video bridge. * In normal cases, this option won't be necessary. */ if(pSiS->ForceCRT1Type == CRT1_VGA) { if(xf86GetOptValBool(pSiS->Options, OPTION_FORCECRT1, &val)) { pSiS->forceCRT1 = val ? 1 : 0; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "CRT1 shall be forced %s\n", val ? "ON" : "OFF"); } } /* ForceCRT2Type (300/315/330 series and later only) * Used for forcing the driver to use a given CRT2 device type. * (SVIDEO, COMPOSITE and SCART for overriding detection) */ strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_FORCE_CRT2TYPE); if(strptr != NULL) { if(!xf86NameCmp(strptr,"TV")) pSiS->ForceCRT2Type = CRT2_TV; else if( (!xf86NameCmp(strptr,"SVIDEO")) || (!xf86NameCmp(strptr,"SVHS")) ) { pSiS->ForceCRT2Type = CRT2_TV; pSiS->ForceTVType = TV_SVIDEO; } else if( (!xf86NameCmp(strptr,"COMPOSITE")) || (!xf86NameCmp(strptr,"CVBS")) ) { pSiS->ForceCRT2Type = CRT2_TV; pSiS->ForceTVType = TV_AVIDEO; } else if( (!xf86NameCmp(strptr,"COMPOSITE SVIDEO")) || /* Ugly, but shorter than a parsing function */ (!xf86NameCmp(strptr,"COMPOSITE+SVIDEO")) || (!xf86NameCmp(strptr,"SVIDEO+COMPOSITE")) || (!xf86NameCmp(strptr,"SVIDEO COMPOSITE")) ) { pSiS->ForceCRT2Type = CRT2_TV; pSiS->ForceTVType = (TV_SVIDEO | TV_AVIDEO); } else if(!xf86NameCmp(strptr,"SCART")) { pSiS->ForceCRT2Type = CRT2_TV; pSiS->ForceTVType = TV_SCART; } else if((!xf86NameCmp(strptr,"LCD")) || (!xf86NameCmp(strptr,"DVI-D"))) { if(pSiS->ForceCRT1Type == CRT1_VGA) { pSiS->ForceCRT2Type = CRT2_LCD; } else { pSiS->ForceCRT2Type = 0; xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Can't set both CRT1 and CRT2 type to LCD; CRT2 disabled\n"); } } else if((!xf86NameCmp(strptr,"VGA")) || (!xf86NameCmp(strptr,"DVI-A")) || (!xf86NameCmp(strptr,"CRT"))) { if(pSiS->ForceCRT1Type == CRT1_VGA) { pSiS->ForceCRT2Type = CRT2_VGA; } else { pSiS->ForceCRT2Type = 0; xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "CRT2 can only be TV or off while CRT1 is LCD; CRT2 disabled\n"); } } else if(!xf86NameCmp(strptr,"NONE")) pSiS->ForceCRT2Type = 0; else if((!xf86NameCmp(strptr,"DSTN")) && (pSiS->Chipset == PCI_CHIP_SIS550)) { if(pSiS->ForceCRT1Type == CRT1_VGA) { pSiS->ForceCRT2Type = CRT2_LCD; pSiS->DSTN = TRUE; } } else if((!xf86NameCmp(strptr,"FSTN")) && (pSiS->Chipset == PCI_CHIP_SIS550)) { if(pSiS->ForceCRT1Type == CRT1_VGA) { pSiS->ForceCRT2Type = CRT2_LCD; pSiS->FSTN = TRUE; } #ifdef ENABLE_YPBPR } else if(!xf86NameCmp(strptr,"HIVISION")) { pSiS->ForceCRT2Type = CRT2_TV; pSiS->ForceTVType = TV_HIVISION; } else if((!xf86NameCmp(strptr,"YPBPR1080I")) && (pSiS->VGAEngine == SIS_315_VGA)) { pSiS->ForceCRT2Type = CRT2_TV; pSiS->ForceTVType = TV_YPBPR; pSiS->ForceYPbPrType = TV_YPBPR1080I; } else if(((!xf86NameCmp(strptr,"YPBPR525I")) || (!xf86NameCmp(strptr,"YPBPR480I"))) && (pSiS->VGAEngine == SIS_315_VGA)) { pSiS->ForceCRT2Type = CRT2_TV; pSiS->ForceTVType = TV_YPBPR; pSiS->ForceYPbPrType = TV_YPBPR525I; } else if(((!xf86NameCmp(strptr,"YPBPR525P")) || (!xf86NameCmp(strptr,"YPBPR480P"))) && (pSiS->VGAEngine == SIS_315_VGA)) { pSiS->ForceCRT2Type = CRT2_TV; pSiS->ForceTVType = TV_YPBPR; pSiS->ForceYPbPrType = TV_YPBPR525P; } else if(((!xf86NameCmp(strptr,"YPBPR625I")) || (!xf86NameCmp(strptr,"YPBPR576I"))) && (pSiS->VGAEngine == SIS_315_VGA)) { pSiS->ForceCRT2Type = CRT2_TV; pSiS->ForceTVType = TV_YPBPR; pSiS->ForceYPbPrType = TV_YPBPR625I; } else if(((!xf86NameCmp(strptr,"YPBPR625P")) || (!xf86NameCmp(strptr,"YPBPR576P"))) && (pSiS->VGAEngine == SIS_315_VGA)) { pSiS->ForceCRT2Type = CRT2_TV; pSiS->ForceTVType = TV_YPBPR; pSiS->ForceYPbPrType = TV_YPBPR625P; } else if(((!xf86NameCmp(strptr,"YPBPR750P")) || (!xf86NameCmp(strptr,"YPBPR720P"))) && (pSiS->VGAEngine == SIS_315_VGA)) { pSiS->ForceCRT2Type = CRT2_TV; pSiS->ForceTVType = TV_YPBPR; pSiS->ForceYPbPrType = TV_YPBPR750P; #endif } else { SiS_PrintBadOpt(pScrn, strptr, OPTION_FORCE_CRT2TYPE); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s \"LCD\" (=\"DVI-D\"), \"TV\", \"SVIDEO\", \"COMPOSITE\",\n" "\t\"SVIDEO+COMPOSITE\", \"SCART\", \"VGA\" (=\"DVI-A\") or \"NONE\"; on the SiS550\n" "\talso \"DSTN\" and \"FSTN\"" #ifdef ENABLE_YPBPR "; on SiS 301/301B bridges also \"HIVISION\", and on\n" "\tSiS315/330/340 series with 301C/30xLV bridge also \"YPBPR480I\", \"YPBPR480P\",\n" "\t\"YPBPR576I\", \"YPBPR576P\", \"YPBPR720P\" and \"YPBPR1080I\"" #endif "\n", validparm); } if(pSiS->ForceCRT2Type != CRT2_DEFAULT) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "CRT2 type shall be %s\n", strptr); } if(pSiS->ForceTVType == TV_YPBPR) { strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_YPBPRAR); if(strptr != NULL) { if(!xf86NameCmp(strptr,"4:3LB")) pSiS->ForceYPbPrAR = TV_YPBPR43LB; else if(!xf86NameCmp(strptr,"4:3")) pSiS->ForceYPbPrAR = TV_YPBPR43; else if(!xf86NameCmp(strptr,"16:9")) pSiS->ForceYPbPrAR = TV_YPBPR169; else { SiS_PrintBadOpt(pScrn, strptr, OPTION_YPBPRAR); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s \"4:3LB\", \"4:3\" and \"16:9\"\n", validparm); } } } strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_SPECIALTIMING); if(strptr != NULL) { int i = 0; Bool found = FALSE; if(!xf86NameCmp(strptr,"NONE")) { pSiS->SiS_Pr->SiS_CustomT = CUT_FORCENONE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Special timing disabled\n"); } else { while(SiS_customttable[i].chipID != 0) { if(!xf86NameCmp(strptr,SiS_customttable[i].optionName)) { pSiS->SiS_Pr->SiS_CustomT = SiS_customttable[i].SpecialID; found = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Special timing for %s %s forced\n", SiS_customttable[i].vendorName, SiS_customttable[i].cardName); break; } i++; } if(!found) { SiS_PrintBadOpt(pScrn, strptr, OPTION_SPECIALTIMING); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s:\n", validparm); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\t\"NONE\" (to disable special timings)\n"); i = 0; while(SiS_customttable[i].chipID != 0) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\t\"%s\" (for %s %s)\n", SiS_customttable[i].optionName, SiS_customttable[i].vendorName, SiS_customttable[i].cardName); i++; } } } } /* EnableSiSCtrl */ /* Allow sisctrl tool to change driver settings */ from = X_DEFAULT; if(xf86GetOptValBool(pSiS->Options, OPTION_ENABLESISCTRL, &val)) { if(val) pSiS->enablesisctrl = TRUE; from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "SiSCtrl utility interface is %s\n", pSiS->enablesisctrl ? enabledstr : disabledstr); if((from == X_DEFAULT) && (!pSiS->enablesisctrl)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "For information on SiSCtrl, see\n\t\thttp://www.winischhofer.eu/linuxsispart1.shtml#sisctrl\n"); } /* ForceCRT1Aspect, ForceCRT2Aspect */ /* Make driver believe that a connected CRT/VGA device is 4:3 ("normal") * or 16:9 ("wide"). Note: This affects only for real VGA (analog) * output devices, not TV or DVI/LCD. */ if(pSiS->VGAEngine == SIS_315_VGA) { strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_FORCE2ASPECT); if(strptr != NULL) { if(!xf86NameCmp(strptr,"WIDE")) { pSiS->SiS_Pr->SiS_UseWideCRT2 = TRUE; } else if(!xf86NameCmp(strptr,"NORMAL")) { pSiS->SiS_Pr->SiS_UseWideCRT2 = FALSE; } else { SiS_PrintBadOpt(pScrn, strptr, OPTION_FORCE2ASPECT); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s:\n", validparm); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\t\"NORMAL\" or \"WIDE\"\n"); } /* Print status later */ } } /* ScaleLCD (300/315/330 series and later only) * Can be used to force the bridge/panel link to [do|not do] the * scaling of modes lower than the panel's native resolution. * Setting this to TRUE will force the bridge/panel link * to scale; FALSE will rely on the panel's capabilities. * Not supported on all machines. */ if(xf86GetOptValBool(pSiS->Options, OPTION_SCALELCD, &val)) { pSiS->UsePanelScaler = val ? 0 : 1; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "LCD scaling is %s\n", pSiS->UsePanelScaler ? disabledstr : enabledstr); } /* CenterLCD (300/315/330/later + SiS video bridge only) * If LCD shall not be scaled, this selects whether 1:1 data * will be sent to the output, or the image shall be centered * on the LCD. For LVDS panels, screen will always be centered, * since these have no built-in scaler. For TMDS, this is * selectable. Non-centered means that the driver will pass * 1:1 data to the output and that the panel will have to * scale by itself (if supported by the panel). */ if(xf86GetOptValBool(pSiS->Options, OPTION_CENTERLCD, &val)) { pSiS->CenterLCD = val ? 1 : 0; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Non-scaled LCD output will %sbe centered\n", pSiS->CenterLCD ? "not " : ""); } /* PanelDelayCompensation (300/315/330 series and later only) * This might be required if the LCD panel shows "small waves" * or wrong colors. * The parameter is an integer, (on 300 series usually either * 4, 32 or 24; on 315 series + LV bridge usually 3 or 51) * Why this option? Simply because SiS did poor BIOS design. * The PDC value depends on the very LCD panel used in a * particular machine. For most panels, the driver is able * to detect the correct value. However, some panels require * a different setting. For 300 series, the value given must * be within the mask 0x3c. For 661 and later, if must be * within the range of 0 to 31. */ ival = -1; xf86GetOptValInteger(pSiS->Options, OPTION_PDC, &ival); if(ival != -1) { pSiS->PDC = ival; if((pSiS->VGAEngine == SIS_300_VGA) && (pSiS->PDC & ~0x3c)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Invalid PanelDelayCompensation parameter\n"); pSiS->PDC = -1; } else { if(pSiS->VGAEngine == SIS_315_VGA) pSiS->PDC &= 0x1f; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Panel delay compensation shall be %d (for LCD=CRT2)\n", pSiS->PDC); } } /* PanelDelayCompensation1 (315/330 series and later only) * Same as above, but for LCD-via-CRT1 ("LCDA") */ if(pSiS->VGAEngine == SIS_315_VGA) { ival = -1; xf86GetOptValInteger(pSiS->Options, OPTION_PDCA, &ival); if(ival != -1) { pSiS->PDCA = ival; if(pSiS->PDCA > 0x1f) { SiS_PrintIlRange(pScrn, OPTION_PDCA, 0, 31, 0); pSiS->PDCA = -1; } else { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Panel delay compensation shall be %d (for LCD=CRT1)\n", pSiS->PDCA); } } } /* LVDSHL (300/315/330/later series + 30xLV bridge only) * This might be required if the LCD panel is too dark. * The parameter is an integer from 0 to 3. */ if(xf86GetOptValInteger(pSiS->Options, OPTION_LVDSHL, &pSiS->SiS_Pr->LVDSHL)) { if((pSiS->SiS_Pr->LVDSHL < 0) || (pSiS->SiS_Pr->LVDSHL > 3)) { SiS_PrintIlRange(pScrn, OPTION_LVDSHL, 0, 3, 0); pSiS->SiS_Pr->LVDSHL = -1; } else { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "LVDSHL will be %d\n", pSiS->SiS_Pr->LVDSHL); } } /* EMI (315/330/later series + 302LV/302ELV bridge only) * This might be required if the LCD panel loses sync on * mode switches. So far, this problem should not show up * due to the auto-detection (from reading the values set * by the BIOS; however, the BIOS values are wrong sometimes * such as in the case of some Compal machines with a * 1400x1050, or some Inventec(Compaq) machines with a * 1280x1024 panel. * The parameter is an integer from 0 to 0x60ffffff. */ if(xf86GetOptValInteger(pSiS->Options, OPTION_EMI, &pSiS->EMI)) { if((pSiS->EMI < 0) || (pSiS->EMI > 0x60ffffff)) { SiS_PrintIlRange(pScrn, OPTION_LVDSHL, 0, 0x60ffffff, 1); pSiS->EMI = -1; } else { pSiS->EMI &= 0x60ffffff; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "EMI will be 0x%04x\n", pSiS->EMI); } } /* TVBlueWorkAround (315/later series only) * TRUE and FALSE are two ways to work around a "blue shade" on * TV output. This work-around is disabled by not setting the * option. 315 series + 301B-DH only. */ if(pSiS->VGAEngine == SIS_315_VGA) { if(xf86GetOptValBool(pSiS->Options, OPTION_TVBLUE, &val)) { pSiS->SiS_Pr->SiS_TVBlue = val ? 1 : 0; } } /* ForcePanelRGB (300/315/330 series and later only) * Can be used to force the bridge/panel link to assume a * specified LCD color capability of 18 or 24 bit in cases * where the BIOS carries incorrect information (such as in * the case of the MSI m250). */ if(xf86GetOptValInteger(pSiS->Options, OPTION_PRGB, &pSiS->PRGB)) { if((pSiS->PRGB != 18 && pSiS->PRGB != 24)) { pSiS->PRGB = -1; SiS_PrintBadOpt(pScrn, strptr, OPTION_PRGB); } else { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "LCD panel color depth is %d\n", pSiS->PRGB); } } } /* TVStandard (300/315/330/later series and 6326 w/ TV only) * This option is for overriding the autodetection of * the BIOS/Jumper option for PAL / NTSC */ if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA) || ((pSiS->Chipset == PCI_CHIP_SIS6326) && (pSiS->SiS6326Flags & SIS6326_HASTV))) { strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_TVSTANDARD); if(strptr != NULL) { if(!xf86NameCmp(strptr,"PAL")) pSiS->OptTVStand = 1; else if((!xf86NameCmp(strptr,"PALM")) || (!xf86NameCmp(strptr,"PAL-M"))) { pSiS->OptTVStand = 1; pSiS->NonDefaultPAL = 1; } else if((!xf86NameCmp(strptr,"PALN")) || (!xf86NameCmp(strptr,"PAL-N"))) { pSiS->OptTVStand = 1; pSiS->NonDefaultPAL = 0; } else if((!xf86NameCmp(strptr,"NTSCJ")) || (!xf86NameCmp(strptr,"NTSC-J"))) { pSiS->OptTVStand = 0; pSiS->NonDefaultNTSC = 1; } else if(!xf86NameCmp(strptr,"NTSC")) pSiS->OptTVStand = 0; else { SiS_PrintBadOpt(pScrn, strptr, OPTION_TVSTANDARD); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s \"PAL\", \"PALM\", \"PALN\", \"NTSC\", \"NTSCJ\"\n", validparm); } if(pSiS->OptTVStand != -1) { static const char *tvstdstr = "TV standard shall be %s\n"; if(pSiS->Chipset == PCI_CHIP_SIS6326) { pSiS->NonDefaultPAL = -1; pSiS->NonDefaultNTSC = -1; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, tvstdstr, pSiS->OptTVStand ? "PAL" : "NTSC"); } else { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, tvstdstr, (pSiS->OptTVStand ? ( (pSiS->NonDefaultPAL == -1) ? "PAL" : ((pSiS->NonDefaultPAL) ? "PALM" : "PALN") ) : (pSiS->NonDefaultNTSC == -1) ? "NTSC" : "NTSCJ")); } } } } /* CHTVType (315/330/later series + Chrontel only) * Used for telling the driver if the TV output shall * be 525i YPbPr or SCART. */ if(pSiS->VGAEngine == SIS_315_VGA) { strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_CHTVTYPE); if(strptr != NULL) { if(!xf86NameCmp(strptr,"SCART")) pSiS->chtvtype = 1; else if(!xf86NameCmp(strptr,"YPBPR525I")) pSiS->chtvtype = 0; else { SiS_PrintBadOpt(pScrn, strptr, OPTION_CHTVTYPE); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s \"SCART\" or \"YPBPR525I\"\n", validparm); } if(pSiS->chtvtype != -1) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chrontel: TV type shall be %s\n", strptr); } } /* CHTVOverscan (300/315/330 series and later only) * CHTVSuperOverscan (300/315/330 series and later only) * These options are for overriding the BIOS option for * TV Overscan. Some BIOSes don't even have such an option. * SuperOverscan is only supported with PAL. * Both options are only effective on machines with a * CHRONTEL TV encoder. SuperOverscan is only available * on the 700x. */ if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { if(xf86GetOptValBool(pSiS->Options, OPTION_CHTVOVERSCAN, &val)) { pSiS->OptTVOver = val ? 1 : 0; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chrontel: TV overscan shall be %s\n", val ? enabledstr : disabledstr); } if(xf86GetOptValBool(pSiS->Options, OPTION_CHTVSOVERSCAN, &pSiS->OptTVSOver)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chrontel: TV super overscan shall be %s\n", pSiS->OptTVSOver ? enabledstr : disabledstr); } } /* Various parameters for TV output via SiS bridge, Chrontel or SiS6326 */ if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { int tmp = 0; xf86GetOptValInteger(pSiS->Options, OPTION_CHTVLUMABANDWIDTHCVBS, &pSiS->chtvlumabandwidthcvbs); xf86GetOptValInteger(pSiS->Options, OPTION_CHTVLUMABANDWIDTHSVIDEO, &pSiS->chtvlumabandwidthsvideo); xf86GetOptValInteger(pSiS->Options, OPTION_CHTVLUMAFLICKERFILTER, &pSiS->chtvlumaflickerfilter); xf86GetOptValInteger(pSiS->Options, OPTION_CHTVCHROMABANDWIDTH, &pSiS->chtvchromabandwidth); xf86GetOptValInteger(pSiS->Options, OPTION_CHTVCHROMAFLICKERFILTER, &pSiS->chtvchromaflickerfilter); xf86GetOptValBool(pSiS->Options, OPTION_CHTVCVBSCOLOR, &pSiS->chtvcvbscolor); xf86GetOptValInteger(pSiS->Options, OPTION_CHTVTEXTENHANCE, &pSiS->chtvtextenhance); xf86GetOptValInteger(pSiS->Options, OPTION_CHTVCONTRAST, &pSiS->chtvcontrast); xf86GetOptValInteger(pSiS->Options, OPTION_SISTVEDGEENHANCE, &pSiS->sistvedgeenhance); xf86GetOptValInteger(pSiS->Options, OPTION_SISTVSATURATION, &pSiS->sistvsaturation); xf86GetOptValInteger(pSiS->Options, OPTION_SISTVLUMAFILTER, &pSiS->sistvyfilter); if((pSiS->sistvyfilter < 0) || (pSiS->sistvyfilter > 8)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Illegal Y Filter number; valid is 0 (off), 1 (default), 2-8 (filter number 1-7)\n"); pSiS->sistvyfilter = 1; } xf86GetOptValBool(pSiS->Options, OPTION_SISTVCHROMAFILTER, &pSiS->sistvcfilter); xf86GetOptValInteger(pSiS->Options, OPTION_SISTVCOLCALIBCOARSE, &pSiS->sistvcolcalibc); xf86GetOptValInteger(pSiS->Options, OPTION_SISTVCOLCALIBFINE, &pSiS->sistvcolcalibf); if((pSiS->sistvcolcalibf > 127) || (pSiS->sistvcolcalibf < -128) || (pSiS->sistvcolcalibc > 120) || (pSiS->sistvcolcalibc < -120)) { pSiS->sistvcolcalibf = pSiS->sistvcolcalibc = 0; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Illegal Color Calibration. Range is -128 to 127 (fine), -120 to 120 (coarse)\n"); } xf86GetOptValInteger(pSiS->Options, OPTION_TVXPOSOFFSET, &pSiS->tvxpos); xf86GetOptValInteger(pSiS->Options, OPTION_TVYPOSOFFSET, &pSiS->tvypos); if(pSiS->tvxpos > 32) { pSiS->tvxpos = 32; tmp = 1; } if(pSiS->tvxpos < -32) { pSiS->tvxpos = -32; tmp = 1; } if(pSiS->tvypos > 32) { pSiS->tvypos = 32; tmp = 1; } if(pSiS->tvypos < -32) { pSiS->tvypos = -32; tmp = 1; } if(tmp) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Illegal TV x or y offset. Range is from -32 to 32\n"); tmp = 0; xf86GetOptValInteger(pSiS->Options, OPTION_TVXSCALE, &pSiS->tvxscale); xf86GetOptValInteger(pSiS->Options, OPTION_TVYSCALE, &pSiS->tvyscale); if(pSiS->tvxscale > 16) { pSiS->tvxscale = 16; tmp = 1; } if(pSiS->tvxscale < -16) { pSiS->tvxscale = -16; tmp = 1; } if(pSiS->tvyscale > 3) { pSiS->tvyscale = 3; tmp = 1; } if(pSiS->tvyscale < -4) { pSiS->tvyscale = -4; tmp = 1; } if(tmp) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Illegal TV x or y scaling parameter. Range is from -16 to 16 (X), -4 to 3 (Y)\n"); } if((pSiS->Chipset == PCI_CHIP_SIS6326) && (pSiS->SiS6326Flags & SIS6326_HASTV)) { int tmp = 0; strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_SIS6326FORCETVPPLUG); if(strptr) { if(!xf86NameCmp(strptr,"COMPOSITE")) pSiS->sis6326tvplug = 1; else if(!xf86NameCmp(strptr,"SVIDEO")) pSiS->sis6326tvplug = 0; else { SiS_PrintBadOpt(pScrn, strptr, OPTION_SIS6326FORCETVPPLUG); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s \"COMPOSITE\" or \"SVIDEO\"\n", validparm); } } xf86GetOptValBool(pSiS->Options, OPTION_SIS6326ENABLEYFILTER, &pSiS->sis6326enableyfilter); xf86GetOptValBool(pSiS->Options, OPTION_SIS6326YFILTERSTRONG, &pSiS->sis6326yfilterstrong); xf86GetOptValInteger(pSiS->Options, OPTION_TVXPOSOFFSET, &pSiS->tvxpos); xf86GetOptValInteger(pSiS->Options, OPTION_TVYPOSOFFSET, &pSiS->tvypos); if(pSiS->tvxpos > 16) { pSiS->tvxpos = 16; tmp = 1; } if(pSiS->tvxpos < -16) { pSiS->tvxpos = -16; tmp = 1; } if(pSiS->tvypos > 16) { pSiS->tvypos = 16; tmp = 1; } if(pSiS->tvypos < -16) { pSiS->tvypos = -16; tmp = 1; } if(tmp) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Illegal TV x or y offset. Range is from -16 to 16\n"); xf86GetOptValInteger(pSiS->Options, OPTION_SIS6326FSCADJUST, &pSiS->sis6326fscadjust); if(pSiS->sis6326fscadjust) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Adjusting the default FSC by %d\n", pSiS->sis6326fscadjust); } } if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA) || ((pSiS->Chipset == PCI_CHIP_SIS6326) && (pSiS->SiS6326Flags & SIS6326_HASTV))) { Bool Is6326 = FALSE; strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_SISTVANTIFLICKER); if(!strptr) { strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_SIS6326ANTIFLICKER); Is6326 = TRUE; } if(strptr) { if(!xf86NameCmp(strptr,"OFF")) pSiS->sistvantiflicker = 0; else if(!xf86NameCmp(strptr,"LOW")) pSiS->sistvantiflicker = 1; else if(!xf86NameCmp(strptr,"MED")) pSiS->sistvantiflicker = 2; else if(!xf86NameCmp(strptr,"HIGH")) pSiS->sistvantiflicker = 3; else if(!xf86NameCmp(strptr,"ADAPTIVE")) pSiS->sistvantiflicker = 4; else { pSiS->sistvantiflicker = -1; SiS_PrintBadOpt(pScrn, strptr, Is6326 ? OPTION_SIS6326FORCETVPPLUG : OPTION_SISTVANTIFLICKER); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s \"OFF\", \"LOW\", \"MED\", \"HIGH\" or \"ADAPTIVE\"\n", validparm); } } } /* CRT2Gamma - enable/disable/set gamma correction for CRT2 * Since 2004/11/26, this option is a boolean and string option * simulaniously. "TRUE" (or other valid bool values) have the * same effect as before: The driver uses the (global) Gamma * for both CRT1 and CRT2. Otherwise, this option takes one or * three floats between 0.1 and 10.0 which define a separate * gamma correction for CRT2. (SiS video bridges only.) */ if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_CRT2GAMMA))) { if(SiS_StrIsBoolOn(strptr)) { pSiS->CRT2gamma = TRUE; pSiS->CRT2SepGamma = FALSE; } else if(SiS_StrIsBoolOff(strptr)) { pSiS->CRT2gamma = pSiS->CRT2SepGamma = FALSE; } else { if(SiS_EvalOneOrThreeFloats(pScrn, OPTION_CRT2GAMMA, gammaopt, strptr, &pSiS->GammaR2i, &pSiS->GammaG2i, &pSiS->GammaB2i)) { pSiS->GammaR2 = (float)pSiS->GammaR2i / 1000.0; pSiS->GammaG2 = (float)pSiS->GammaG2i / 1000.0; pSiS->GammaB2 = (float)pSiS->GammaB2i / 1000.0; pSiS->CRT2gamma = TRUE; if(!IsDHM) pSiS->CRT2SepGamma = TRUE; else { #ifdef SISDUALHEAD pSiS->CRT2SepGamma = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CRT2Gamma values overrule default and Monitor Gamma\n"); if(pScrn->monitor) { pScrn->monitor->gamma.red = pSiS->GammaR2; pScrn->monitor->gamma.green = pSiS->GammaG2; pScrn->monitor->gamma.blue = pSiS->GammaB2; } #endif } } } } } /* Default adaptor: Overlay (default) or blitter */ if(pSiS->VGAEngine == SIS_315_VGA) { if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_XVDEFAULTADAPTOR))) { if(!xf86NameCmp(strptr, "OVERLAY")) { pSiS->XvDefAdaptorBlit = FALSE; } else if(!xf86NameCmp(strptr, "BLITTER")) { pSiS->XvDefAdaptorBlit = TRUE; } else { SiS_PrintBadOpt(pScrn, strptr, OPTION_XVDEFAULTADAPTOR); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s \"OVERLAY\" or \"BLITTER\"\n", validparm); } } } if(xf86GetOptValBool(pSiS->Options, OPTION_XVMEMCPY, &val)) { pSiS->XvUseMemcpy = val ? TRUE : FALSE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Xv will %suse memcpy()\n", val ? "" : "not "); } #if defined(__i386__) || defined(__AMD64__) || defined(__amd64__) || defined(__x86_64__) if(xf86GetOptValBool(pSiS->Options, OPTION_XVBENCHCPY, &val)) { pSiS->BenchMemCpy = val ? TRUE : FALSE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Will %sbenchmark methods for system RAM to video RAM transfers\n", val ? "" : "not "); } #ifndef SISCHECKOSSSE if(xf86GetOptValBool(pSiS->Options, OPTION_XVSSECOPY, &val)) { pSiS->XvSSEMemcpy = val ? TRUE : FALSE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Will %s use SSE CPU instructions\n", val ? "eventually" : "not"); } #endif #endif /* __i386__ || __AMD64__ || __amd64__ */ #ifdef SIS_CP SIS_CP_OPT_DOOPT #endif } /* DualHead */ /* CRT1Gamma - enable/disable gamma correction for CRT1 */ if(xf86GetOptValBool(pSiS->Options, OPTION_CRT1GAMMA, &val)) { pSiS->CRT1gamma = val; pSiS->CRT1gammaGiven = TRUE; } /* ForceCRT1Aspect, ForceCRT2Aspect */ /* Make driver believe that a connected CRT/VGA device is 4:3 ("normal") * or 16:9 ("wide"). Note: This affects only for real VGA (analog) * output devices, not TV or DVI/LCD. */ if(pSiS->VGAEngine == SIS_315_VGA) { strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_FORCE1ASPECT); if(strptr != NULL) { if(!xf86NameCmp(strptr,"WIDE")) { pSiS->SiS_Pr->SiS_UseWide = 1; } else if(!xf86NameCmp(strptr,"NORMAL")) { pSiS->SiS_Pr->SiS_UseWide = 0; } else { SiS_PrintBadOpt(pScrn, strptr, OPTION_FORCE1ASPECT); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s:\n", validparm); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\t\"NORMAL\" or \"WIDE\"\n"); } if(pSiS->SiS_Pr->SiS_UseWide != -1) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "CRT1 (VGA) aspect ratio will be assumed %s\n", pSiS->SiS_Pr->SiS_UseWide ? "wide" : "normal"); } } if(pSiS->SiS_Pr->SiS_UseWideCRT2 != -1) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "CRT2 (VGA) aspect ratio will be assumed %s\n", pSiS->SiS_Pr->SiS_UseWideCRT2 ? "wide" : "normal"); } } /* VESA - DEPRECATED * This option is for forcing the driver to use * the VESA BIOS extension for mode switching. */ if(xf86GetOptValBool(pSiS->Options, OPTION_VESA, &val)) { if(IsDHM) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, baddhm, pSiS->Options[SiS_FIFT(pSiS->Options, OPTION_VESA)].name); } else { pSiS->VESA = val ? 1 : 0; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "VESA: VESA usage shall be %s\n", val ? enabledstr : disabledstr); xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "*** Option \"VESA\" is deprecated. *** \n"); if(pSiS->VESA) pSiS->ForceCRT1Type = CRT1_VGA; } } if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { /* InternalModes (300/315/330 series only) * The default behavior is to replace X's default modes with * a mode list generated out of the known and supported modes. Use * this option to disable this. NOT RECOMMENDED. */ if(xf86GetOptValBool(pSiS->Options, OPTION_INTERNALMODES, &val)) { pSiS->noInternalModes = val ? FALSE : TRUE; if(pSiS->noInternalModes) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Usage of built-in modes is %s\n", disabledstr); } } } /* ShadowFB */ from = X_DEFAULT; if(xf86GetOptValBool(pSiS->Options, OPTION_SHADOW_FB, &pSiS->ShadowFB)) { #ifdef SISMERGED if(pSiS->MergedFB) { pSiS->ShadowFB = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Shadow Framebuffer not supported in MergedFB mode\n"); } else #endif from = X_CONFIG; } if(pSiS->ShadowFB) { pSiS->NoAccel = TRUE; #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) pSiS->NoXvideo = TRUE; xf86DrvMsg(pScrn->scrnIndex, from, "Using \"Shadow Framebuffer\" - 2D acceleration and Xv disabled\n"); #else xf86DrvMsg(pScrn->scrnIndex, from, "Using \"Shadow Framebuffer\" - 2D acceleration disabled\n"); #endif } /* Rotate */ if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_ROTATE))) { #ifdef SISMERGED if(pSiS->MergedFB) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Screen rotation not supported in MergedFB mode\n"); } else #endif if(IsDHM) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, baddhm, pSiS->Options[SiS_FIFT(pSiS->Options, OPTION_ROTATE)].name); } else if(!xf86NameCmp(strptr, "CW")) { pSiS->Rotate = 1; } else if(!xf86NameCmp(strptr, "CCW")) { pSiS->Rotate = -1; } else { SiS_PrintBadOpt(pScrn, strptr, OPTION_ROTATE); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s \"CW\" or \"CCW\"\n", validparm); } if(pSiS->Rotate) { pSiS->ShadowFB = TRUE; pSiS->NoAccel = TRUE; pSiS->HWCursor = FALSE; pSiS->NoXvideo = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen %sclockwise (2D acceleration and Xv disabled)\n", (pSiS->Rotate == -1) ? "counter " : ""); } } /* Reflect */ if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_REFLECT))) { #ifdef SISMERGED if(pSiS->MergedFB) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Screen reflection not supported in MergedFB mode\n"); } else #endif if(IsDHM) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, baddhm, pSiS->Options[SiS_FIFT(pSiS->Options, OPTION_REFLECT)].name); } else if(pSiS->Rotate) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Screen rotation and reflection are mutually exclusive\n"); } else if(!xf86NameCmp(strptr, "X")) { pSiS->Reflect = 1; } else if(!xf86NameCmp(strptr, "Y")) { pSiS->Reflect = 2; } else if((!xf86NameCmp(strptr, "XY")) || (!xf86NameCmp(strptr, "YX"))) { pSiS->Reflect = 3; } else { SiS_PrintBadOpt(pScrn, strptr, OPTION_REFLECT); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s \"X\", \"Y\" or \"XY\"\n", validparm); } if(pSiS->Reflect) { pSiS->ShadowFB = TRUE; pSiS->NoAccel = TRUE; pSiS->HWCursor = FALSE; pSiS->NoXvideo = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Reflecting screen (2D acceleration and Xv disabled)\n"); } } #ifdef SISDRI /* DRI */ from = X_DEFAULT; if(xf86GetOptValBool(pSiS->Options, OPTION_DRI, &pSiS->loadDRI)) { from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "DRI %s\n", pSiS->loadDRI ? enabledstr : disabledstr); /* AGPSize = GARTSize */ if(xf86GetOptValInteger(pSiS->Options, OPTION_AGP_SIZE, &ival)) { if((ival >= 8) && (ival <= 512)) { pSiS->agpWantedPages = (ival * 1024 * 1024) / AGP_PAGE_SIZE; } else { SiS_PrintIlRange(pScrn, OPTION_AGP_SIZE, 8, 512, 0); } } #endif /* XVideo * Set enables/disables Xv hardware video acceleration */ #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) if((!pSiS->NoAccel) && (!pSiS->NoXvideo)) { #else if(!pSiS->NoXvideo) { #endif if(!xf86ReturnOptValBool(pSiS->Options, OPTION_XVIDEO, TRUE)) { pSiS->NoXvideo = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "XVideo extension (Xv) disabled\n"); } if(!pSiS->NoXvideo) { if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { /* XvOnCRT2 * On chipsets with only one overlay (315, 650, 740, 330), the user can * choose to display the overlay on CRT1 or CRT2. By setting this * option to TRUE, the overlay will be displayed on CRT2. The * default is: CRT1 if only CRT1 available, CRT2 if only CRT2 * available, and CRT1 if both is available and detected. * Since implementation of the XV_SWITCHCRT Xv property this only * selects the default CRT. */ if(xf86GetOptValBool(pSiS->Options, OPTION_XVONCRT2, &val)) { pSiS->XvOnCRT2 = val ? TRUE : FALSE; } } if((pSiS->VGAEngine == SIS_OLD_VGA) || (pSiS->VGAEngine == SIS_530_VGA)) { /* NoYV12 (for 5597/5598, 6326 and 530/620 only) * YV12 has problems with videos larger than 384x288. So * allow the user to disable YV12 support to force the * application to use YUV2 instead. */ if(xf86GetOptValBool(pSiS->Options, OPTION_YV12, &val)) { pSiS->NoYV12 = val ? 0 : 1; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Xv YV12/I420 support is %s\n", pSiS->NoYV12 ? disabledstr : enabledstr); } } /* Some Xv properties' defaults can be set by options */ if(xf86GetOptValInteger(pSiS->Options, OPTION_XVDEFCONTRAST, &ival)) { if((ival >= 0) && (ival <= 7)) pSiS->XvDefCon = ival; else SiS_PrintIlRange(pScrn, OPTION_XVDEFCONTRAST, 0, 7, 0); } if(xf86GetOptValInteger(pSiS->Options, OPTION_XVDEFBRIGHTNESS, &ival)) { if((ival >= -128) && (ival <= 127)) pSiS->XvDefBri = ival; else SiS_PrintIlRange(pScrn, OPTION_XVDEFBRIGHTNESS, -128, 127, 0); } if(pSiS->VGAEngine == SIS_315_VGA) { if(xf86GetOptValInteger(pSiS->Options, OPTION_XVDEFHUE, &ival)) { if((ival >= -8) && (ival <= 7)) pSiS->XvDefHue = ival; else SiS_PrintIlRange(pScrn, OPTION_XVDEFHUE, -8, 7, 0); } if(xf86GetOptValInteger(pSiS->Options, OPTION_XVDEFSATURATION, &ival)) { if((ival >= -7) && (ival <= 7)) pSiS->XvDefSat = ival; else SiS_PrintIlRange(pScrn, OPTION_XVDEFSATURATION, -7, 7, 0); } } if(xf86GetOptValBool(pSiS->Options, OPTION_XVDEFDISABLEGFX, &val)) { if(val) pSiS->XvDefDisableGfx = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Graphics display will be %s during Xv usage\n", val ? disabledstr : enabledstr); } if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { if(xf86GetOptValBool(pSiS->Options, OPTION_XVDEFDISABLEGFXLR, &val)) { if(val) pSiS->XvDefDisableGfxLR = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Graphics display left/right of overlay will be %s during Xv usage\n", val ? disabledstr : enabledstr); } if(xf86GetOptValBool(pSiS->Options, OPTION_XVDISABLECOLORKEY, &val)) { if(val) pSiS->XvDisableColorKey = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Xv Color key is %s\n", val ? disabledstr : enabledstr); } if(xf86GetOptValBool(pSiS->Options, OPTION_XVUSECHROMAKEY, &val)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Xv Chroma-keying is %s\n", val ? enabledstr : disabledstr); if(val) pSiS->XvUseChromaKey = TRUE; } if(xf86GetOptValBool(pSiS->Options, OPTION_XVINSIDECHROMAKEY, &val)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Xv: Video is transparent if %s chroma key range\n", val ? "inside" : "outside"); if(val) pSiS->XvInsideChromaKey = TRUE; } if(pSiS->VGAEngine == SIS_300_VGA) { if(xf86GetOptValBool(pSiS->Options, OPTION_XVYUVCHROMAKEY, &val)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Xv: Chroma key is in %s format\n", val ? "YUV" : "RGB"); if(val) pSiS->XvYUVChromaKey = TRUE; } } else { if(xf86GetOptValBool(pSiS->Options, OPTION_XVYUVCHROMAKEY, &val)) { xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4, "Xv: Chroma key is of same format as video source\n"); } } if(xf86GetOptValInteger(pSiS->Options, OPTION_XVCHROMAMIN, &ival)) { if((ival >= 0) && (ival <= 0xffffff)) pSiS->XvChromaMin = ival; else SiS_PrintIlRange(pScrn, OPTION_XVCHROMAMIN, 0, 0xffffff, 1); } if(xf86GetOptValInteger(pSiS->Options, OPTION_XVCHROMAMAX, &ival)) { if((ival >= 0) && (ival <= 0xffffff)) pSiS->XvChromaMax = ival; else SiS_PrintIlRange(pScrn, OPTION_XVCHROMAMAX, 0, 0xffffff, 1); } } if(pSiS->VGAEngine == SIS_315_VGA) { /* XvGamma - enable/disable gamma correction for Xv * Supported for CRT1 only */ if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_XVGAMMA))) { if(SiS_StrIsBoolOn(strptr)) { pSiS->XvGamma = pSiS->XvGammaGiven = TRUE; } else if(SiS_StrIsBoolOff(strptr)) { pSiS->XvGamma = FALSE; pSiS->XvGammaGiven = TRUE; } else { if(SiS_EvalOneOrThreeFloats(pScrn, OPTION_XVGAMMA, gammaopt, strptr, &pSiS->XvGammaRed, &pSiS->XvGammaGreen, &pSiS->XvGammaBlue)) { pSiS->XvGamma = pSiS->XvGammaGiven = TRUE; pSiS->XvGammaRedDef = pSiS->XvGammaRed; pSiS->XvGammaGreenDef = pSiS->XvGammaGreen; pSiS->XvGammaBlue = pSiS->XvGammaBlue; } } } } } } if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { Bool GotNewBri = FALSE, GotOldBri = FALSE, GotCon = FALSE; if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_NEWSTOREDCON))) { SiS_EvalOneOrThreeFloats2(pScrn, OPTION_NEWSTOREDCON, newbriopt, strptr, &pSiS->NewGammaConR, &pSiS->NewGammaConG, &pSiS->NewGammaConB); GotCon = TRUE; } if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_NEWSTOREDBRI))) { SiS_EvalOneOrThreeFloats2(pScrn, OPTION_NEWSTOREDBRI, newbriopt, strptr, &pSiS->NewGammaBriR, &pSiS->NewGammaBriG, &pSiS->NewGammaBriB); GotNewBri = TRUE; } if(!GotCon && !GotNewBri) { if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_STOREDBRI))) { SiS_EvalOneOrThreeFloats(pScrn, OPTION_STOREDBRI, briopt, strptr, &pSiS->GammaBriR, &pSiS->GammaBriG, &pSiS->GammaBriB); GotOldBri = TRUE; pSiS->SiS_SD3_Flags |= SiS_SD3_OLDGAMMAINUSE; } } if((!IsDHM) || (IsDHM && !IsSecondHead)) { Bool GotCon2 = FALSE, GotNewBri2 = FALSE; if(!GotOldBri) { if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_NEWSTOREDCON2))) { SiS_EvalOneOrThreeFloats2(pScrn, OPTION_NEWSTOREDCON2, newbriopt, strptr, &pSiS->NewGammaConR2, &pSiS->NewGammaConG2, &pSiS->NewGammaConB2); GotCon2 = TRUE; } if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_NEWSTOREDBRI2))) { if(SiS_EvalOneOrThreeFloats2(pScrn, OPTION_NEWSTOREDBRI2, newbriopt, strptr, &pSiS->NewGammaBriR2, &pSiS->NewGammaBriG2, &pSiS->NewGammaBriB2)) { if(IsDHM) { #ifdef SISDUALHEAD if(GotNewBri) SiS_PrintOverruleDHM(pScrn, OPTION_NEWSTOREDBRI2, OPTION_NEWSTOREDBRI); pSiS->NewGammaBriR = pSiS->NewGammaBriR2; pSiS->NewGammaBriG = pSiS->NewGammaBriG2; pSiS->NewGammaBriB = pSiS->NewGammaBriB2; #endif } else pSiS->CRT2SepGamma = TRUE; } GotNewBri2 = TRUE; } } if(!GotCon2 && !GotNewBri2 && !GotNewBri && !GotCon) { if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_STOREDBRI2))) { pSiS->SiS_SD3_Flags |= SiS_SD3_OLDGAMMAINUSE; if(SiS_EvalOneOrThreeFloats(pScrn, OPTION_STOREDBRI2, briopt, strptr, &pSiS->GammaBriR2, &pSiS->GammaBriG2, &pSiS->GammaBriB2)) { if(IsDHM) { #ifdef SISDUALHEAD if(GotOldBri) SiS_PrintOverruleDHM(pScrn, OPTION_STOREDBRI2, OPTION_STOREDBRI); pSiS->GammaBriR = pSiS->GammaBriR2; pSiS->GammaBriG = pSiS->GammaBriG2; pSiS->GammaBriB = pSiS->GammaBriB2; #endif } else pSiS->CRT2SepGamma = TRUE; } } } } } if(pSiS->SiS_SD3_Flags & SiS_SD3_CRT1SATGAIN) { if(xf86GetOptValInteger(pSiS->Options, OPTION_CRT1SATGAIN, &ival)) { if((ival >= 0) && (ival <= 7)) { pSiS->siscrt1satgain = ival; pSiS->crt1satgaingiven = TRUE; } else SiS_PrintIlRange(pScrn, OPTION_CRT1SATGAIN, 0, 7, 0); } } } const OptionInfoRec * SISAvailableOptions(int chipid, int busid) { return SISOptions; } xf86-video-sis-0.10.7/src/sis_cursor.h0000664000076400007640000003176011763614407014400 00000000000000/* * SiS hardware cursor handling * Definitions * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3) The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * * Idea based on code by Can-Ru Yeou, SiS Inc. * */ #define CS(x) (0x8500 + (x << 2)) /* 300 series, CRT1 */ /* 80000000 = RGB(1) - MONO(0) * 40000000 = enable(1) - disable(0) * 20000000 = 32(1) / 16(1) bit RGB * 10000000 = "ghost"(1) - [other effect](0) */ #define sis300GetCursorStatus \ SIS_MMIO_IN32(pSiS->IOBase, CS(0)) & 0x40000000; #define sis300SetCursorStatus(status) \ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(0)); \ temp &= 0xbfffffff; \ temp |= status; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), temp); \ } #define sis300EnableHWCursor() \ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(0)); \ temp &= 0x0fffffff; \ temp |= 0x40000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), temp); \ } #define sis300EnableHWARGBCursor() \ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(0)); \ temp |= 0xF0000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), temp); \ } #define sis300EnableHWARGB16Cursor() \ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(0)); \ temp &= 0x0fffffff; \ temp |= 0xD0000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), temp); \ } #define sis300SwitchToMONOCursor() \ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(0)); \ temp &= 0x4fffffff; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), temp); \ } #define sis300SwitchToRGBCursor() \ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(0)); \ temp |= 0xB0000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), temp); \ } #define sis300DisableHWCursor()\ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(0)); \ temp &= 0xbFFFFFFF; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), temp); \ } #define sis300SetCursorBGColor(color)\ SIS_MMIO_OUT32(pSiS->IOBase, CS(1), (color)); #define sis300SetCursorFGColor(color)\ SIS_MMIO_OUT32(pSiS->IOBase, CS(2), (color)); #define sis300SetCursorPositionX(x,preset)\ SIS_MMIO_OUT32(pSiS->IOBase, CS(3), ((x) | ((preset) << 16))); #define sis300SetCursorPositionY(y,preset)\ SIS_MMIO_OUT32(pSiS->IOBase, CS(4), ((y) | ((preset) << 16))); #define sis300SetCursorAddress(address)\ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(0)); \ temp &= 0xF0FF0000; \ temp |= address; \ SIS_MMIO_OUT32(pSiS->IOBase,CS(0),temp); \ } /* 300 series, CRT2 */ /* 80000000 = RGB(1) - MONO(0) * 40000000 = enable(1) - disable(0) * 20000000 = 32(1) / 16(1) bit RGB * 10000000 = unused (always "ghosting") */ #define sis301GetCursorStatus \ SIS_MMIO_IN32(pSiS->IOBase, CS(8)) & 0x40000000; #define sis301SetCursorStatus(status) \ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(8)); \ temp &= 0xbfffffff; \ temp |= status; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), temp); \ } #define sis301EnableHWCursor()\ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(8)); \ temp &= 0x0fffffff; \ temp |= 0x40000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), temp); \ } #define sis301EnableHWARGBCursor()\ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(8)); \ temp |= 0xF0000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), temp); \ } #define sis301EnableHWARGB16Cursor()\ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(8)); \ temp &= 0x0FFFFFFF; \ temp |= 0xD0000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), temp); \ } #define sis301SwitchToRGBCursor() \ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(8)); \ temp |= 0xB0000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), temp); \ } #define sis301SwitchToMONOCursor() \ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(8)); \ temp &= 0x4fffffff; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), temp); \ } #define sis301DisableHWCursor()\ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(8)); \ temp &= 0xbFFFFFFF; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), temp); \ } #define sis301SetCursorBGColor(color)\ SIS_MMIO_OUT32(pSiS->IOBase, CS(9), (color)); #define sis301SetCursorFGColor(color)\ SIS_MMIO_OUT32(pSiS->IOBase, CS(10), (color)); #define sis301SetCursorPositionX(x,preset)\ SIS_MMIO_OUT32(pSiS->IOBase, CS(11), ((x) | ((preset) << 16))); #define sis301SetCursorPositionY(y,preset)\ SIS_MMIO_OUT32(pSiS->IOBase, CS(12), ((y) | ((preset) << 16))); #define sis301SetCursorAddress(address)\ { \ ULong temp; \ temp = SIS_MMIO_IN32(pSiS->IOBase, CS(8)); \ temp &= 0xF0FF0000; \ temp |= address; \ SIS_MMIO_OUT32(pSiS->IOBase,CS(8),temp); \ } /* 315/330 series CRT1 */ /* 80000000 = RGB(1) - MONO(0) * 40000000 = enable(1) - disable(0) * 20000000 = 32(1) / 16(1) bit RGB * 10000000 = "ghost"(1) - Alpha Blend(0) */ #define sis310GetCursorStatus \ SIS_MMIO_IN32(pSiS->IOBase, CS(0)) & 0x40000000; #define sis310SetCursorStatus(status) \ pSiS->HWCursorBackup[0] &= 0xbfffffff; \ pSiS->HWCursorBackup[0] |= status; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), pSiS->HWCursorBackup[0]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(3), pSiS->HWCursorBackup[3]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(4), pSiS->HWCursorBackup[4]); #define sis310EnableHWCursor()\ pSiS->HWCursorBackup[0] &= 0x0fffffff; \ pSiS->HWCursorBackup[0] |= 0x40000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), pSiS->HWCursorBackup[0]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(3), pSiS->HWCursorBackup[3]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(4), pSiS->HWCursorBackup[4]); #define sis310EnableHWARGBCursor()\ pSiS->HWCursorBackup[0] &= 0x0FFFFFFF; \ pSiS->HWCursorBackup[0] |= 0xE0000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), pSiS->HWCursorBackup[0]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(3), pSiS->HWCursorBackup[3]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(4), pSiS->HWCursorBackup[4]); #define sis310SwitchToMONOCursor() \ pSiS->HWCursorBackup[0] &= 0x4fffffff; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), pSiS->HWCursorBackup[0]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(3), pSiS->HWCursorBackup[3]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(4), pSiS->HWCursorBackup[4]); #define sis310SwitchToRGBCursor() \ pSiS->HWCursorBackup[0] &= 0xBFFFFFFF; \ pSiS->HWCursorBackup[0] |= 0xA0000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), pSiS->HWCursorBackup[0]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(3), pSiS->HWCursorBackup[3]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(4), pSiS->HWCursorBackup[4]); #define sis310DisableHWCursor()\ pSiS->HWCursorBackup[0] &= 0xBFFFFFFF; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), pSiS->HWCursorBackup[0]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(3), pSiS->HWCursorBackup[3]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(4), pSiS->HWCursorBackup[4]); #define sis310SetCursorBGColor(color) \ SIS_MMIO_OUT32(pSiS->IOBase, CS(1), (color)); \ pSiS->HWCursorBackup[1] = color; #define sis310SetCursorFGColor(color)\ SIS_MMIO_OUT32(pSiS->IOBase, CS(2), (color)); \ pSiS->HWCursorBackup[2] = color; #define sis310SetCursorPositionX(x,preset) \ pSiS->HWCursorBackup[3] = ((x) | ((preset) << 16)); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(3), pSiS->HWCursorBackup[3]); #define sis310SetCursorPositionY(y,preset) \ pSiS->HWCursorBackup[4] = ((y) | ((preset) << 16)); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(4), pSiS->HWCursorBackup[4]); #define sis310SetCursorAddress(address)\ pSiS->HWCursorBackup[0] &= 0xF0F00000; \ pSiS->HWCursorBackup[0] |= address; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(0), pSiS->HWCursorBackup[0]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(1), pSiS->HWCursorBackup[1]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(2), pSiS->HWCursorBackup[2]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(3), pSiS->HWCursorBackup[3]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(4), pSiS->HWCursorBackup[4]); /* 315 series CRT2 */ /* 80000000 = RGB(1) - MONO(0) * 40000000 = enable(1) - disable(0) * 20000000 = 32(1) / 16(1) bit RGB * 10000000 = "ghost"(1) - Alpha Blend(0) ? */ #define sis301GetCursorStatus310 \ SIS_MMIO_IN32(pSiS->IOBase, CS(8)) & 0x40000000; #define sis301SetCursorStatus310(status) \ pSiS->HWCursorBackup[8] &= 0xbfffffff; \ pSiS->HWCursorBackup[8] |= status; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), pSiS->HWCursorBackup[8]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(11), pSiS->HWCursorBackup[11]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(12), pSiS->HWCursorBackup[12]); #define sis301EnableHWCursor310()\ pSiS->HWCursorBackup[8] &= 0x0fffffff; \ pSiS->HWCursorBackup[8] |= 0x40000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), pSiS->HWCursorBackup[8]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(11), pSiS->HWCursorBackup[11]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(12), pSiS->HWCursorBackup[12]); #define sis301EnableHWARGBCursor310()\ pSiS->HWCursorBackup[8] &= 0x0FFFFFFF; \ pSiS->HWCursorBackup[8] |= 0xE0000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), pSiS->HWCursorBackup[8]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(11), pSiS->HWCursorBackup[11]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(12), pSiS->HWCursorBackup[12]); #define sis301SwitchToRGBCursor310() \ pSiS->HWCursorBackup[8] &= 0xBFFFFFFF; \ pSiS->HWCursorBackup[8] |= 0xA0000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), pSiS->HWCursorBackup[8]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(11), pSiS->HWCursorBackup[11]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(12), pSiS->HWCursorBackup[12]); #define sis301SwitchToMONOCursor310() \ pSiS->HWCursorBackup[8] &= 0x4fffffff; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), pSiS->HWCursorBackup[8]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(11), pSiS->HWCursorBackup[11]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(12), pSiS->HWCursorBackup[12]); #define sis301DisableHWCursor310()\ pSiS->HWCursorBackup[8] &= 0xBFFFFFFF; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), pSiS->HWCursorBackup[8]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(11), pSiS->HWCursorBackup[11]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(12), pSiS->HWCursorBackup[12]); #define sis301SetCursorBGColor310(color) \ SIS_MMIO_OUT32(pSiS->IOBase, CS(9), (color)); \ pSiS->HWCursorBackup[9] = color; #define sis301SetCursorFGColor310(color) \ SIS_MMIO_OUT32(pSiS->IOBase, CS(10), (color)); \ pSiS->HWCursorBackup[10] = color; #define sis301SetCursorPositionX310(x,preset) \ pSiS->HWCursorBackup[11] = ((x) | ((preset) << 16)); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(11), pSiS->HWCursorBackup[11]); #define sis301SetCursorPositionY310(y,preset) \ pSiS->HWCursorBackup[12] = ((y) | ((preset) << 16)); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(12), pSiS->HWCursorBackup[12]); #define sis301SetCursorAddress310(address) \ if(pSiS->ChipType == SIS_315H) { \ if(address & 0x10000) { \ address &= ~0x10000; \ orSISIDXREG(SISSR, 0x37, 0x80); \ } else { \ andSISIDXREG(SISSR, 0x37, 0x7f); \ } \ } \ pSiS->HWCursorBackup[8] &= 0xF0F00000; \ pSiS->HWCursorBackup[8] |= address; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), pSiS->HWCursorBackup[8]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(9), pSiS->HWCursorBackup[9]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(10), pSiS->HWCursorBackup[10]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(11), pSiS->HWCursorBackup[11]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(12), pSiS->HWCursorBackup[12]); /* 330 series CRT2 */ /* Mono cursor engine for CRT2 on SiS330 (Xabre) has bugs * and cannot be used! Will hang engine. */ /* 80000000 = RGB(1) - MONO(0) * 40000000 = enable(1) - disable(0) * 20000000 = 32(1) / 16(1) bit RGB * 10000000 = "ghost"(1) - Alpha Blend(0) ? */ #define sis301EnableHWCursor330() \ /* andSISIDXREG(SISCR,0x5b,~0x10); */ \ pSiS->HWCursorBackup[8] &= 0x0fffffff; \ pSiS->HWCursorBackup[8] |= 0xE0000000; \ SIS_MMIO_OUT32(pSiS->IOBase, CS(8), pSiS->HWCursorBackup[8]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(11), pSiS->HWCursorBackup[11]); \ SIS_MMIO_OUT32(pSiS->IOBase, CS(12), pSiS->HWCursorBackup[12]); \ /* orSISIDXREG(SISCR,0x5b,0x10); */ xf86-video-sis-0.10.7/src/init.h0000664000076400007640000016455611763614407013162 00000000000000/* * Data and prototypes for init.c * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * * If distributed as part of the Linux kernel, the following license terms * apply: * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the named License, * * or any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA * * Otherwise, the following license terms apply: * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted provided that the following conditions * * are met: * * 1) Redistributions of source code must retain the above copyright * * notice, this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright * * notice, this list of conditions and the following disclaimer in the * * documentation and/or other materials provided with the distribution. * * 3) The name of the author may not be used to endorse or promote products * * derived from this software without specific prior written permission. * * * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer * */ #ifndef _INIT_H_ #define _INIT_H_ #include "osdef.h" #include "initdef.h" #ifdef SIS_XORG_XF86 #include "sis.h" #define SIS_NEED_inSISREG #define SIS_NEED_inSISREGW #define SIS_NEED_inSISREGL #define SIS_NEED_outSISREG #define SIS_NEED_outSISREGW #define SIS_NEED_outSISREGL #include "sis_regs.h" #endif #ifdef SIS_LINUX_KERNEL #include "vgatypes.h" #include "vstruct.h" #ifdef SIS_CP #undef SIS_CP #endif #include #include #include #include #include #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #include