xf86-video-openchrome-0.6.0/0000775000175000017500000000000013057514156012563 500000000000000xf86-video-openchrome-0.6.0/install-sh0000755000175000017500000003253713057513402014510 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.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 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 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 trap '(exit $?); exit' 1 2 13 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 starting with `-'. 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 # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # 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 -z "$d" && 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-openchrome-0.6.0/COPYING0000664000175000017500000000200412760724526013536 00000000000000Permission 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 COPYRIGHT HOLDER(S) OR AUTHOR(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. xf86-video-openchrome-0.6.0/missing0000755000175000017500000002415213057513446014105 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-openchrome-0.6.0/src/0000775000175000017500000000000013057514156013352 500000000000000xf86-video-openchrome-0.6.0/src/via_kms.c0000664000175000017500000006770512760724526015112 00000000000000/* * Copyright © 2007 Red Hat, Inc. * * 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. * * Authors: * Dave Airlie * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "xf86str.h" #include "X11/Xatom.h" #include "micmap.h" #include "xf86cmap.h" #include "xf86DDC.h" #include #include "xf86Crtc.h" #include "via_driver.h" /* DPMS */ #ifdef HAVE_XEXTPROTO_71 #include #else #define DPMS_SERVER #include #endif xf86CrtcPtr window_belongs_to_crtc(ScrnInfoPtr pScrn, int x, int y, int w, int h) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int largest = 0, area = 0, i; BoxRec crtc_area, overlap; xf86CrtcPtr best = NULL; for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; if (crtc->enabled) { crtc_area.x1 = crtc->x; crtc_area.x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation); crtc_area.y1 = crtc->y; crtc_area.y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation); overlap.x1 = crtc_area.x1 > x ? crtc_area.x1 : x; overlap.x2 = crtc_area.x2 < x + w ? crtc_area.x2 : x + w; overlap.y1 = crtc_area.y1 > y ? crtc_area.y1 : y; overlap.y2 = crtc_area.y2 < y ? crtc_area.y2 : y + h; if (overlap.x1 >= overlap.x2 || overlap.y1 >= overlap.y2) overlap.x1 = overlap.x2 = overlap.y1 = overlap.y2 = 0; area = (overlap.x2 - overlap.x1) * (overlap.y2 - overlap.y1); if (area > largest) { area = largest; best = crtc; } } } return best; } static void drmmode_ConvertFromKMode(ScrnInfoPtr pScrn, drmModeModeInfo *kmode, DisplayModePtr mode) { memset(mode, 0, sizeof(DisplayModeRec)); mode->status = MODE_OK; mode->Clock = kmode->clock; mode->HDisplay = kmode->hdisplay; mode->HSyncStart = kmode->hsync_start; mode->HSyncEnd = kmode->hsync_end; mode->HTotal = kmode->htotal; mode->HSkew = kmode->hskew; mode->VDisplay = kmode->vdisplay; mode->VSyncStart = kmode->vsync_start; mode->VSyncEnd = kmode->vsync_end; mode->VTotal = kmode->vtotal; mode->VScan = kmode->vscan; mode->Flags = kmode->flags; //& FLAG_BITS; mode->name = strdup(kmode->name); if (kmode->type & DRM_MODE_TYPE_DRIVER) mode->type = M_T_DRIVER; if (kmode->type & DRM_MODE_TYPE_PREFERRED) mode->type |= M_T_PREFERRED; xf86SetModeCrtc(mode, pScrn->adjustFlags); } static void drmmode_ConvertToKMode(ScrnInfoPtr pScrn, drmModeModeInfo *kmode, DisplayModePtr mode) { memset(kmode, 0, sizeof(*kmode)); kmode->clock = mode->Clock; kmode->hdisplay = mode->HDisplay; kmode->hsync_start = mode->HSyncStart; kmode->hsync_end = mode->HSyncEnd; kmode->htotal = mode->HTotal; kmode->hskew = mode->HSkew; kmode->vdisplay = mode->VDisplay; kmode->vsync_start = mode->VSyncStart; kmode->vsync_end = mode->VSyncEnd; kmode->vtotal = mode->VTotal; kmode->vscan = mode->VScan; kmode->flags = mode->Flags; //& FLAG_BITS; if (mode->name) strncpy(kmode->name, mode->name, DRM_DISPLAY_MODE_LEN); kmode->name[DRM_DISPLAY_MODE_LEN-1] = 0; } static void drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode) { #if 0 xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; /* bonghits in the randr 1.2 - uses dpms to disable crtc - bad buzz */ if (mode == DPMSModeOff) { drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0, NULL, 0, NULL); } #endif } static Bool drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; ScrnInfoPtr pScrn = crtc->scrn; int output_count = 0, ret, i; uint32_t *output_ids = NULL; drmModeModeInfo kmode; if (!mode || !xf86CrtcRotate(crtc)) return FALSE; output_ids = calloc(sizeof(uint32_t), xf86_config->num_output); if (!output_ids) return FALSE; for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; drmmode_output_private_ptr drmmode_output; if (output->crtc != crtc) continue; drmmode_output = output->driver_private; output_ids[output_count] = drmmode_output->mode_output->connector_id; output_count++; } drmmode_ConvertToKMode(crtc->scrn, &kmode, mode); if (drmmode->fb_id == 0) { ret = drmModeAddFB(drmmode->fd, pScrn->virtualX, pScrn->virtualY, pScrn->depth, pScrn->bitsPerPixel, drmmode->front_bo->pitch, drmmode->front_bo->handle, &drmmode->fb_id); if (ret < 0) { ErrorF("failed to add fb %d\n", ret); goto done; } } ret = drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, drmmode->fb_id, x, y, output_ids, output_count, &kmode); if (ret) { xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, "failed to set mode: %s", strerror(-ret)); goto done; } if (crtc->scrn->pScreen) xf86CrtcSetScreenSubpixelOrder(crtc->scrn->pScreen); /* go through all the outputs and force DPMS them back on? */ for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; if (output->crtc != crtc) continue; output->funcs->dpms(output, DPMSModeOn); } #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,7,0,0,0) crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, crtc->gamma_blue, crtc->gamma_size); #endif if (pScrn->pScreen && drmmode->hwcursor) xf86_reload_cursors(pScrn->pScreen); done: free(output_ids); return (ret < 0 ? FALSE : TRUE); } static void drmmode_set_cursor_colors (xf86CrtcPtr crtc, int bg, int fg) { } static void drmmode_set_cursor_position (xf86CrtcPtr crtc, int x, int y) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; drmModeMoveCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, x, y); } static void drmmode_hide_cursor (xf86CrtcPtr crtc) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; drmmode_ptr drmmode = drmmode_crtc->drmmode; drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, cursor_info->MaxWidth, cursor_info->MaxHeight); } static void drmmode_show_cursor (xf86CrtcPtr crtc) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; uint32_t handle = drmmode_crtc->cursor_bo->handle; drmmode_ptr drmmode = drmmode_crtc->drmmode; drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, cursor_info->MaxWidth, cursor_info->MaxHeight); } static void drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; uint32_t handle = drmmode_crtc->cursor_bo->handle, *ptr; /* cursor should be mapped already */ ptr = drm_bo_map(crtc->scrn, drmmode_crtc->cursor_bo); memset(ptr, 0x00, drmmode_crtc->cursor_bo->size); memcpy(ptr, image, drmmode_crtc->cursor_bo->size); drm_bo_unmap(crtc->scrn, drmmode_crtc->cursor_bo); if (drmModeSetCursor(drmmode_crtc->drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, cursor_info->MaxWidth, cursor_info->MaxHeight)) { drmmode_ptr drmmode = drmmode_crtc->drmmode; cursor_info->MaxWidth = cursor_info->MaxHeight = 0; drmmode->hwcursor = FALSE; } } static void drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t *red, uint16_t *green, uint16_t *blue, int size) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; drmModeCrtcSetGamma(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, size, red, green, blue); } static const xf86CrtcFuncsRec drmmode_crtc_funcs = { .dpms = drmmode_crtc_dpms, .set_mode_major = drmmode_set_mode_major, .set_cursor_colors = drmmode_set_cursor_colors, .set_cursor_position = drmmode_set_cursor_position, .show_cursor = drmmode_show_cursor, .hide_cursor = drmmode_hide_cursor, .load_cursor_argb = drmmode_load_cursor_argb, .gamma_set = drmmode_crtc_gamma_set, .destroy = NULL, }; static void drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num) { drmmode_crtc_private_ptr drmmode_crtc; xf86CrtcPtr crtc; crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs); if (crtc == NULL) return; drmmode_crtc = xnfcalloc(sizeof(drmmode_crtc_private_rec), 1); drmmode_crtc->mode_crtc = drmModeGetCrtc(drmmode->fd, drmmode->mode_res->crtcs[num]); drmmode_crtc->drmmode = drmmode; crtc->driver_private = drmmode_crtc; } /* * Handle KMS xf86Outputs */ static Bool drmmode_property_ignore(drmModePropertyPtr prop) { if (!prop) return TRUE; /* ignore blob prop */ if (prop->flags & DRM_MODE_PROP_BLOB) return TRUE; /* ignore standard property */ if (!strcmp(prop->name, "EDID") || !strcmp(prop->name, "DPMS")) return TRUE; return FALSE; } static void drmmode_output_dpms(xf86OutputPtr output, int mode) { drmmode_output_private_ptr drmmode_output = output->driver_private; drmModeConnectorPtr koutput = drmmode_output->mode_output; drmmode_ptr drmmode = drmmode_output->drmmode; drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id, drmmode_output->dpms_enum_id, mode); return; } static void drmmode_output_create_resources(xf86OutputPtr output) { drmmode_output_private_ptr drmmode_output = output->driver_private; drmModeConnectorPtr mode_output = drmmode_output->mode_output; drmmode_ptr drmmode = drmmode_output->drmmode; drmModePropertyPtr drmmode_prop; int i, j, err; drmmode_output->props = calloc(mode_output->count_props, sizeof(drmmode_prop_rec)); if (!drmmode_output->props) return; drmmode_output->num_props = 0; for (i = 0, j = 0; i < mode_output->count_props; i++) { drmmode_prop = drmModeGetProperty(drmmode->fd, mode_output->props[i]); if (drmmode_property_ignore(drmmode_prop)) { drmModeFreeProperty(drmmode_prop); continue; } drmmode_output->props[j].mode_prop = drmmode_prop; drmmode_output->props[j].value = mode_output->prop_values[i]; drmmode_output->num_props++; j++; } for (i = 0; i < drmmode_output->num_props; i++) { drmmode_prop_ptr p = &drmmode_output->props[i]; drmmode_prop = p->mode_prop; if (drmmode_prop->flags & DRM_MODE_PROP_RANGE) { INT32 range[2]; INT32 value = p->value; p->num_atoms = 1; p->atoms = calloc(p->num_atoms, sizeof(Atom)); if (!p->atoms) continue; p->atoms[0] = MakeAtom(drmmode_prop->name, strlen(drmmode_prop->name), TRUE); range[0] = drmmode_prop->values[0]; range[1] = drmmode_prop->values[1]; err = RRConfigureOutputProperty(output->randr_output, p->atoms[0], FALSE, TRUE, drmmode_prop->flags & DRM_MODE_PROP_IMMUTABLE ? TRUE : FALSE, 2, range); if (err != 0) { xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "RRConfigureOutputProperty error, %d\n", err); } err = RRChangeOutputProperty(output->randr_output, p->atoms[0], XA_INTEGER, 32, PropModeReplace, 1, &value, FALSE, TRUE); if (err != 0) { xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "RRChangeOutputProperty error, %d\n", err); } } else if (drmmode_prop->flags & DRM_MODE_PROP_ENUM) { p->num_atoms = drmmode_prop->count_enums + 1; p->atoms = calloc(p->num_atoms, sizeof(Atom)); if (!p->atoms) continue; p->atoms[0] = MakeAtom(drmmode_prop->name, strlen(drmmode_prop->name), TRUE); for (j = 1; j <= drmmode_prop->count_enums; j++) { struct drm_mode_property_enum *e = &drmmode_prop->enums[j-1]; p->atoms[j] = MakeAtom(e->name, strlen(e->name), TRUE); } err = RRConfigureOutputProperty(output->randr_output, p->atoms[0], FALSE, FALSE, drmmode_prop->flags & DRM_MODE_PROP_IMMUTABLE ? TRUE : FALSE, p->num_atoms - 1, (INT32 *)&p->atoms[1]); if (err != 0) { xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "RRConfigureOutputProperty error, %d\n", err); } for (j = 0; j < drmmode_prop->count_enums; j++) if (drmmode_prop->enums[j].value == p->value) break; /* there's always a matching value */ err = RRChangeOutputProperty(output->randr_output, p->atoms[0], XA_ATOM, 32, PropModeReplace, 1, &p->atoms[j+1], FALSE, TRUE); if (err != 0) { xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "RRChangeOutputProperty error, %d\n", err); } } } } static Bool drmmode_output_set_property(xf86OutputPtr output, Atom property, RRPropertyValuePtr value) { drmmode_output_private_ptr drmmode_output = output->driver_private; drmmode_ptr drmmode = drmmode_output->drmmode; int i; for (i = 0; i < drmmode_output->num_props; i++) { drmmode_prop_ptr p = &drmmode_output->props[i]; if (p->atoms[0] != property) continue; if (p->mode_prop->flags & DRM_MODE_PROP_RANGE) { uint32_t val; if (value->type != XA_INTEGER || value->format != 32 || value->size != 1) return FALSE; val = *(uint32_t *)value->data; drmModeConnectorSetProperty(drmmode->fd, drmmode_output->output_id, p->mode_prop->prop_id, (uint64_t)val); return TRUE; } else if (p->mode_prop->flags & DRM_MODE_PROP_ENUM) { const char *name; Atom atom; int j; if (value->type != XA_ATOM || value->format != 32 || value->size != 1) return FALSE; memcpy(&atom, value->data, 4); name = NameForAtom(atom); /* search for matching name string, then set its value down */ for (j = 0; j < p->mode_prop->count_enums; j++) { if (!strcmp(p->mode_prop->enums[j].name, name)) { drmModeConnectorSetProperty(drmmode->fd, drmmode_output->output_id, p->mode_prop->prop_id, p->mode_prop->enums[j].value); return TRUE; } } } } return TRUE; } static Bool drmmode_output_get_property(xf86OutputPtr output, Atom property) { return TRUE; } static xf86OutputStatus drmmode_output_detect(xf86OutputPtr output) { /* go to the hw and retrieve a new output struct */ drmmode_output_private_ptr drmmode_output = output->driver_private; drmmode_ptr drmmode = drmmode_output->drmmode; xf86OutputStatus status; drmModeFreeConnector(drmmode_output->mode_output); drmmode_output->mode_output = drmModeGetConnector(drmmode->fd, drmmode_output->output_id); switch (drmmode_output->mode_output->connection) { case DRM_MODE_CONNECTED: status = XF86OutputStatusConnected; break; case DRM_MODE_DISCONNECTED: status = XF86OutputStatusDisconnected; break; default: case DRM_MODE_UNKNOWNCONNECTION: status = XF86OutputStatusUnknown; break; } return status; } static Bool drmmode_output_mode_valid(xf86OutputPtr output, DisplayModePtr pModes) { return MODE_OK; } static DisplayModePtr drmmode_output_get_modes(xf86OutputPtr output) { drmmode_output_private_ptr drmmode_output = output->driver_private; drmModeConnectorPtr koutput = drmmode_output->mode_output; drmmode_ptr drmmode = drmmode_output->drmmode; DisplayModePtr Modes = NULL, Mode; drmModePropertyPtr props; xf86MonPtr mon = NULL; int i; /* look for an EDID property */ for (i = 0; i < koutput->count_props; i++) { props = drmModeGetProperty(drmmode->fd, koutput->props[i]); if (props && (props->flags & DRM_MODE_PROP_BLOB)) { if (!strcmp(props->name, "EDID")) { if (drmmode_output->edid_blob) drmModeFreePropertyBlob(drmmode_output->edid_blob); drmmode_output->edid_blob = drmModeGetPropertyBlob(drmmode->fd, koutput->prop_values[i]); } drmModeFreeProperty(props); } } if (drmmode_output->edid_blob) { mon = xf86InterpretEDID(output->scrn->scrnIndex, drmmode_output->edid_blob->data); if (mon && drmmode_output->edid_blob->length > 128) mon->flags |= MONITOR_EDID_COMPLETE_RAWDATA; } xf86OutputSetEDID(output, mon); /* modes should already be available */ for (i = 0; i < koutput->count_modes; i++) { Mode = xnfalloc(sizeof(DisplayModeRec)); drmmode_ConvertFromKMode(output->scrn, &koutput->modes[i], Mode); Modes = xf86ModesAdd(Modes, Mode); } return Modes; } static void drmmode_output_destroy(xf86OutputPtr output) { drmmode_output_private_ptr drmmode_output = output->driver_private; int i; if (drmmode_output->edid_blob) drmModeFreePropertyBlob(drmmode_output->edid_blob); for (i = 0; i < drmmode_output->num_props; i++) { drmModeFreeProperty(drmmode_output->props[i].mode_prop); free(drmmode_output->props[i].atoms); } for (i = 0; i < drmmode_output->mode_output->count_encoders; i++) { drmModeFreeEncoder(drmmode_output->mode_encoders[i]); free(drmmode_output->mode_encoders); } free(drmmode_output->props); drmModeFreeConnector(drmmode_output->mode_output); free(drmmode_output); output->driver_private = NULL; } static const xf86OutputFuncsRec drmmode_output_funcs = { .dpms = drmmode_output_dpms, .create_resources = drmmode_output_create_resources, #ifdef RANDR_12_INTERFACE .set_property = drmmode_output_set_property, .get_property = drmmode_output_get_property, #endif .detect = drmmode_output_detect, .mode_valid = drmmode_output_mode_valid, .get_modes = drmmode_output_get_modes, .destroy = drmmode_output_destroy }; static int subpixel_conv_table[7] = { 0, SubPixelUnknown, SubPixelHorizontalRGB, SubPixelHorizontalBGR, SubPixelVerticalRGB, SubPixelVerticalBGR, SubPixelNone }; const char *output_names[] = { "None", "VGA", "DVI", "DVI", "DVI", "Composite", "S-video", "LVDS", "CTV", "DIN", "DisplayPort", "HDMI", "HDMI", "TV", "eDP" }; static void drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num) { xf86OutputPtr output; drmModeConnectorPtr koutput; drmModeEncoderPtr *kencoders = NULL; drmmode_output_private_ptr drmmode_output; drmModePropertyPtr props; char name[32]; int i; koutput = drmModeGetConnector(drmmode->fd, drmmode->mode_res->connectors[num]); if (!koutput) return; kencoders = calloc(sizeof(drmModeEncoderPtr), koutput->count_encoders); if (!kencoders) { goto out_free_encoders; } for (i = 0; i < koutput->count_encoders; i++) { kencoders[i] = drmModeGetEncoder(drmmode->fd, koutput->encoders[i]); if (!kencoders[i]) { goto out_free_encoders; } } /* need to do smart conversion here for compat with non-kms ATI driver */ snprintf(name, 32, "%s-%d", output_names[koutput->connector_type], koutput->connector_type_id - 1); output = xf86OutputCreate (pScrn, &drmmode_output_funcs, name); if (!output) { goto out_free_encoders; } drmmode_output = calloc(sizeof(drmmode_output_private_rec), 1); if (!drmmode_output) { xf86OutputDestroy(output); goto out_free_encoders; } drmmode_output->output_id = drmmode->mode_res->connectors[num]; drmmode_output->mode_output = koutput; drmmode_output->mode_encoders = kencoders; drmmode_output->drmmode = drmmode; output->mm_width = koutput->mmWidth; output->mm_height = koutput->mmHeight; output->subpixel_order = subpixel_conv_table[koutput->subpixel]; output->interlaceAllowed = TRUE; output->doubleScanAllowed = TRUE; output->driver_private = drmmode_output; output->possible_crtcs = 0x7f; for (i = 0; i < koutput->count_encoders; i++) output->possible_crtcs &= kencoders[i]->possible_crtcs; /* work out the possible clones later */ output->possible_clones = 0; for (i = 0; i < koutput->count_props; i++) { props = drmModeGetProperty(drmmode->fd, koutput->props[i]); if (props && (props->flags & DRM_MODE_PROP_ENUM)) { if (!strcmp(props->name, "DPMS")) { drmmode_output->dpms_enum_id = koutput->props[i]; drmModeFreeProperty(props); break; } drmModeFreeProperty(props); } } return; out_free_encoders: if (kencoders){ for (i = 0; i < koutput->count_encoders; i++) drmModeFreeEncoder(kencoders[i]); free(kencoders); } drmModeFreeConnector(koutput); } uint32_t find_clones(ScrnInfoPtr scrn, xf86OutputPtr output) { drmmode_output_private_ptr drmmode_output = output->driver_private, clone_drmout; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86OutputPtr clone_output; int index_mask = 0, i; if (drmmode_output->enc_clone_mask == 0) return index_mask; for (i = 0; i < xf86_config->num_output; i++) { clone_output = xf86_config->output[i]; clone_drmout = clone_output->driver_private; if (output == clone_output) continue; if (clone_drmout->enc_mask == 0) continue; if (drmmode_output->enc_clone_mask == clone_drmout->enc_mask) index_mask |= (1 << i); } return index_mask; } static void drmmode_clones_init(ScrnInfoPtr scrn, drmmode_ptr drmmode) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int i, j; for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; drmmode_output_private_ptr drmmode_output; drmmode_output = output->driver_private; drmmode_output->enc_clone_mask = 0xff; /* and all the possible encoder clones for this output together */ for (j = 0; j < drmmode_output->mode_output->count_encoders; j++) { int k; for (k = 0; k < drmmode->mode_res->count_encoders; k++) { if (drmmode->mode_res->encoders[k] == drmmode_output->mode_encoders[j]->encoder_id) drmmode_output->enc_mask |= (1 << k); } drmmode_output->enc_clone_mask &= drmmode_output->mode_encoders[j]->possible_clones; } } for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; output->possible_clones = find_clones(scrn, output); } } Bool KMSCrtcInit(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "KMSCrtcInit\n")); drmmode->scrn = pScrn; drmmode->mode_res = drmModeGetResources(drmmode->fd); if (!drmmode->mode_res) return FALSE; xf86CrtcSetSizeRange(pScrn, 320, 200, drmmode->mode_res->max_width, drmmode->mode_res->max_height); for (i = 0; i < drmmode->mode_res->count_crtcs; i++) if (!xf86IsEntityShared(pScrn->entityList[0]) || pScrn->confScreen->device->screen == i) drmmode_crtc_init(pScrn, drmmode, i); for (i = 0; i < drmmode->mode_res->count_connectors; i++) drmmode_output_init(pScrn, drmmode, i); /* workout clones */ drmmode_clones_init(pScrn, drmmode); return TRUE; } #ifdef HAVE_UDEV static void drmmode_handle_uevents(int fd, void *closure) { drmmode_ptr drmmode = closure; ScrnInfoPtr scrn = drmmode->scrn; struct udev_device *dev; dev = udev_monitor_receive_device(drmmode->uevent_monitor); if (!dev) return; RRGetInfo(xf86ScrnToScreen(scrn), TRUE); udev_device_unref(dev); } #endif void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode) { #ifdef HAVE_UDEV struct udev_monitor *mon; struct udev *u; u = udev_new(); if (!u) return; mon = udev_monitor_new_from_netlink(u, "udev"); if (!mon) { udev_unref(u); return; } if (udev_monitor_filter_add_match_subsystem_devtype(mon, "drm", "drm_minor") < 0 || udev_monitor_enable_receiving(mon) < 0) { udev_monitor_unref(mon); udev_unref(u); return; } drmmode->uevent_handler = xf86AddGeneralHandler(udev_monitor_get_fd(mon), drmmode_handle_uevents, drmmode); drmmode->uevent_monitor = mon; #endif } void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode) { #ifdef HAVE_UDEV if (drmmode->uevent_handler) { struct udev *u = udev_monitor_get_udev(drmmode->uevent_monitor); xf86RemoveGeneralHandler(drmmode->uevent_handler); udev_monitor_unref(drmmode->uevent_monitor); udev_unref(u); } #endif } xf86-video-openchrome-0.6.0/src/via_i2c.c0000664000175000017500000003273413033607754014764 00000000000000/* * Copyright 2009 Luc Verhaegen. * Copyright 2004 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ /* * Implements three I2C buses through registers SR26, SR2C, and SR31. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "via_driver.h" #define SDA_READ 0x04 #define SCL_READ 0x08 #define SDA_WRITE 0x10 #define SCL_WRITE 0x20 /* * First I2C Bus: Typically used for detecting a VGA monitor. */ static void ViaI2C1PutBits(I2CBusPtr Bus, int clock, int data) { vgaHWPtr hwp = Bus->DriverPrivate.ptr; CARD8 value = 0x01; /* Enable */ if (clock) value |= SCL_WRITE; if (data) value |= SDA_WRITE; ViaSeqMask(hwp, 0x26, value, 0x01 | SCL_WRITE | SDA_WRITE); } static void ViaI2C1GetBits(I2CBusPtr Bus, int *clock, int *data) { vgaHWPtr hwp = Bus->DriverPrivate.ptr; CARD8 value = hwp->readSeq(hwp, 0x26); *clock = (value & SCL_READ) != 0; *data = (value & SDA_READ) != 0; } static I2CBusPtr ViaI2CBus1Init(ScrnInfoPtr pScrn) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered ViaI2CBus1Init.\n")); I2CBusPtr pI2CBus = xf86CreateI2CBusRec(); vgaHWPtr hwp = VGAHWPTR(pScrn); if (!pI2CBus) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86CreateI2CBusRec failed.\n")); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Initialization of I2C Bus 1 failed.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaI2CBus1Init.\n")); return NULL; } pI2CBus->BusName = "I2C Bus 1"; pI2CBus->scrnIndex = pScrn->scrnIndex; pI2CBus->I2CPutBits = ViaI2C1PutBits; pI2CBus->I2CGetBits = ViaI2C1GetBits; pI2CBus->DriverPrivate.ptr = hwp; pI2CBus->ByteTimeout = 2200; pI2CBus->StartTimeout = 550; pI2CBus->HoldTime = 40; pI2CBus->BitTimeout = 40; if (!xf86I2CBusInit(pI2CBus)) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86I2CBusInit failed.\n")); xf86DestroyI2CBusRec(pI2CBus, TRUE, FALSE); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Initialization of I2C Bus 1 failed.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaI2CBus1Init.\n")); return NULL; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaI2CBus1Init.\n")); return pI2CBus; } /* * Second I2C Bus: Used to detect a DVI monitor, VGA monitor via * a DVI-I connector, or TV encoders. */ static void ViaI2C2PutBits(I2CBusPtr Bus, int clock, int data) { vgaHWPtr hwp = Bus->DriverPrivate.ptr; CARD8 value = 0x01; /* Enable */ if (clock) value |= SCL_WRITE; if (data) value |= SDA_WRITE; ViaSeqMask(hwp, 0x31, value, 0x01 | SCL_WRITE | SDA_WRITE); } static void ViaI2C2GetBits(I2CBusPtr Bus, int *clock, int *data) { vgaHWPtr hwp = Bus->DriverPrivate.ptr; CARD8 value = hwp->readSeq(hwp, 0x31); *clock = (value & SCL_READ) != 0; *data = (value & SDA_READ) != 0; } static I2CBusPtr ViaI2CBus2Init(ScrnInfoPtr pScrn) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered ViaI2CBus2Init.\n")); I2CBusPtr pI2CBus = xf86CreateI2CBusRec(); vgaHWPtr hwp = VGAHWPTR(pScrn); if (!pI2CBus) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86CreateI2CBusRec failed.\n")); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Initialization of I2C Bus 2 failed.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaI2CBus2Init.\n")); return NULL; } pI2CBus->BusName = "I2C Bus 2"; pI2CBus->scrnIndex = pScrn->scrnIndex; pI2CBus->I2CPutBits = ViaI2C2PutBits; pI2CBus->I2CGetBits = ViaI2C2GetBits; pI2CBus->DriverPrivate.ptr = hwp; if (!xf86I2CBusInit(pI2CBus)) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86I2CBusInit failed.\n")); xf86DestroyI2CBusRec(pI2CBus, TRUE, FALSE); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Initialization of I2C Bus 2 failed.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaI2CBus2Init.\n")); return NULL; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaI2CBus2Init.\n")); return pI2CBus; } /* * Third I2C Bus: Implemented via manipulation of GPIO (General * Purpose I/O) pins. */ static Bool ViaI2C3Start(I2CBusPtr b, int timeout) { vgaHWPtr hwp = b->DriverPrivate.ptr; ViaSeqMask(hwp, 0x2C, 0xF0, 0xF0); b->I2CUDelay(b, b->RiseFallTime); ViaSeqMask(hwp, 0x2C, 0x00, 0x10); b->I2CUDelay(b, b->HoldTime); ViaSeqMask(hwp, 0x2C, 0x00, 0x20); b->I2CUDelay(b, b->HoldTime); return TRUE; } static Bool ViaI2C3Address(I2CDevPtr d, I2CSlaveAddr addr) { I2CBusPtr b = d->pI2CBus; #ifdef X_NEED_I2CSTART if (b->I2CStart(d->pI2CBus, d->StartTimeout)) { #else if (ViaI2C3Start(d->pI2CBus, d->StartTimeout)) { #endif if (b->I2CPutByte(d, addr & 0xFF)) { if ((addr & 0xF8) != 0xF0 && (addr & 0xFE) != 0x00) return TRUE; if (b->I2CPutByte(d, (addr >> 8) & 0xFF)) return TRUE; } b->I2CStop(d); } return FALSE; } static void ViaI2C3Stop(I2CDevPtr d) { I2CBusPtr b = d->pI2CBus; vgaHWPtr hwp = b->DriverPrivate.ptr; ViaSeqMask(hwp, 0x2C, 0xC0, 0xF0); b->I2CUDelay(b, b->RiseFallTime); ViaSeqMask(hwp, 0x2C, 0x20, 0x20); b->I2CUDelay(b, b->HoldTime); ViaSeqMask(hwp, 0x2C, 0x10, 0x10); b->I2CUDelay(b, b->HoldTime); ViaSeqMask(hwp, 0x2C, 0x00, 0x20); b->I2CUDelay(b, b->HoldTime); } static void ViaI2C3PutBit(I2CBusPtr b, Bool sda, int timeout) { vgaHWPtr hwp = b->DriverPrivate.ptr; if (sda) ViaSeqMask(hwp, 0x2C, 0x50, 0x50); else ViaSeqMask(hwp, 0x2C, 0x40, 0x50); b->I2CUDelay(b, b->RiseFallTime / 5); ViaSeqMask(hwp, 0x2C, 0xA0, 0xA0); b->I2CUDelay(b, b->HoldTime); b->I2CUDelay(b, timeout); ViaSeqMask(hwp, 0x2C, 0x80, 0xA0); b->I2CUDelay(b, b->RiseFallTime / 5); } static Bool ViaI2C3PutByte(I2CDevPtr d, I2CByte data) { I2CBusPtr b = d->pI2CBus; vgaHWPtr hwp = b->DriverPrivate.ptr; Bool ret; int i; for (i = 7; i >= 0; i--) ViaI2C3PutBit(b, (data >> i) & 0x01, b->BitTimeout); /* Raise first to avoid false positives. */ ViaSeqMask(hwp, 0x2C, 0x50, 0x50); ViaSeqMask(hwp, 0x2C, 0x00, 0x40); b->I2CUDelay(b, b->RiseFallTime); ViaSeqMask(hwp, 0x2C, 0xA0, 0xA0); if (hwp->readSeq(hwp, 0x2C) & 0x04) ret = FALSE; else ret = TRUE; ViaSeqMask(hwp, 0x2C, 0x80, 0xA0); b->I2CUDelay(b, b->RiseFallTime); return ret; } static Bool ViaI2C3GetBit(I2CBusPtr b, int timeout) { vgaHWPtr hwp = b->DriverPrivate.ptr; Bool ret; ViaSeqMask(hwp, 0x2c, 0x80, 0xC0); b->I2CUDelay(b, b->RiseFallTime / 5); ViaSeqMask(hwp, 0x2c, 0xA0, 0xA0); b->I2CUDelay(b, 3 * b->HoldTime); b->I2CUDelay(b, timeout); if (hwp->readSeq(hwp, 0x2C) & 0x04) ret = TRUE; else ret = FALSE; ViaSeqMask(hwp, 0x2C, 0x80, 0xA0); b->I2CUDelay(b, b->HoldTime); b->I2CUDelay(b, b->RiseFallTime / 5); return ret; } static Bool ViaI2C3GetByte(I2CDevPtr d, I2CByte * data, Bool last) { I2CBusPtr b = d->pI2CBus; vgaHWPtr hwp = b->DriverPrivate.ptr; int i; *data = 0x00; for (i = 7; i >= 0; i--) if (ViaI2C3GetBit(b, b->BitTimeout)) *data |= 0x01 << i; if (last) /* send NACK */ ViaSeqMask(hwp, 0x2C, 0x50, 0x50); else /* send ACK */ ViaSeqMask(hwp, 0x2C, 0x40, 0x50); ViaSeqMask(hwp, 0x2C, 0xA0, 0xA0); b->I2CUDelay(b, b->HoldTime); ViaSeqMask(hwp, 0x2C, 0x80, 0xA0); return TRUE; } static void ViaI2C3SimplePutBits(I2CBusPtr Bus, int clock, int data) { vgaHWPtr hwp = Bus->DriverPrivate.ptr; CARD8 value = 0xC0; if (clock) value |= SCL_WRITE; if (data) value |= SDA_WRITE; ViaSeqMask(hwp, 0x2C, value, 0xC0 | SCL_WRITE | SDA_WRITE); } static void ViaI2C3SimpleGetBits(I2CBusPtr Bus, int *clock, int *data) { vgaHWPtr hwp = Bus->DriverPrivate.ptr; CARD8 value = hwp->readSeq(hwp, 0x2C); *clock = (value & SCL_READ) != 0; *data = (value & SDA_READ) != 0; } static I2CBusPtr ViaI2CBus3Init(ScrnInfoPtr pScrn) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered ViaI2CBus3Init.\n")); I2CBusPtr pI2CBus = xf86CreateI2CBusRec(); vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); if (!pI2CBus) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86CreateI2CBusRec failed.\n")); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Initialization of I2C Bus 3 failed.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaI2CBus3Init.\n")); return NULL; } pI2CBus->BusName = "I2C Bus 3"; pI2CBus->scrnIndex = pScrn->scrnIndex; pI2CBus->DriverPrivate.ptr = hwp; switch (pVia->Chipset) { case VIA_P4M800PRO: DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "using alternative PutBits/GetBits functions for I2C Bus 3\n")); pI2CBus->I2CPutBits = ViaI2C3SimplePutBits; pI2CBus->I2CGetBits = ViaI2C3SimpleGetBits; break; default: pI2CBus->I2CAddress = ViaI2C3Address; #ifdef X_NEED_I2CSTART pI2CBus->I2CStart = ViaI2C3Start; #endif pI2CBus->I2CStop = ViaI2C3Stop; pI2CBus->I2CPutByte = ViaI2C3PutByte; pI2CBus->I2CGetByte = ViaI2C3GetByte; pI2CBus->DriverPrivate.ptr = hwp; pI2CBus->BitTimeout = 10; pI2CBus->ByteTimeout = 10; pI2CBus->HoldTime = 10; pI2CBus->StartTimeout = 10; break; } if (!xf86I2CBusInit(pI2CBus)) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86I2CBusInit failed.\n")); xf86DestroyI2CBusRec(pI2CBus, TRUE, FALSE); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Initialization of I2C Bus 3 failed.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaI2CBus3Init.\n")); return NULL; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaI2CBus3Init.\n")); return pI2CBus; } #ifdef HAVE_DEBUG static void ViaI2CScan(I2CBusPtr Bus) { CARD8 i; DEBUG(xf86DrvMsg(Bus->scrnIndex, X_INFO, "Entered ViaI2CScan.\n")); xf86DrvMsg(Bus->scrnIndex, X_INFO, "Scanning %s.\n", Bus->BusName); for (i = 0x10; i < 0xF0; i += 2) if (xf86I2CProbeAddress(Bus, i)) xf86DrvMsg(Bus->scrnIndex, X_PROBED, "Found slave on %s " "- 0x%02X.\n", Bus->BusName, i); DEBUG(xf86DrvMsg(Bus->scrnIndex, X_INFO, "Exiting ViaI2CScan.\n")); } #endif /* HAVE_DEBUG */ void ViaI2CInit(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered ViaI2CInit.\n")); if (pVia->I2CDevices & VIA_I2C_BUS1) pVia->pI2CBus1 = ViaI2CBus1Init(pScrn); if (pVia->I2CDevices & VIA_I2C_BUS2) pVia->pI2CBus2 = ViaI2CBus2Init(pScrn); if (pVia->I2CDevices & VIA_I2C_BUS3) pVia->pI2CBus3 = ViaI2CBus3Init(pScrn); #ifdef HAVE_DEBUG if (pVia->I2CScan) { if (pVia->pI2CBus2) ViaI2CScan(pVia->pI2CBus2); if (pVia->pI2CBus3) ViaI2CScan(pVia->pI2CBus3); } #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaI2CInit.\n")); } /* * The code originated from Luc Verhaegen's xf86-video-unichrome DDX. * * Sure, it is polluting namespace, but this one is quite useful. */ Bool xf86I2CMaskByte(I2CDevPtr d, I2CByte subaddr, I2CByte value, I2CByte mask) { I2CByte tmp; Bool ret; ret = xf86I2CReadByte(d, subaddr, &tmp); if (!ret) return FALSE; tmp &= ~mask; tmp |= (value & mask); return xf86I2CWriteByte(d, subaddr, tmp); } xf86-video-openchrome-0.6.0/src/via_xvpriv.h0000664000175000017500000000455112760724526015651 00000000000000/* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifndef _VIA_XVPRIV_H_ #define _VIA_XVPRIV_H_ 1 #include "xf86xv.h" enum { XV_ADAPT_SWOV = 0, XV_ADAPT_NUM }; typedef enum { xve_none = 0, xve_bandwidth, xve_dmablit, xve_mem, xve_general, xve_adaptor, xve_numerr } XvError; #define VIA_MAX_XV_PORTS 1 typedef struct { unsigned char xv_adaptor; unsigned char xv_portnum; int adaptor; int brightness; int saturation; int contrast; int hue; RegionRec clip; CARD32 colorKey; Bool autoPaint; CARD32 FourCC; /* from old SurfaceDesc -- passed down from viaPutImageG */ /* store old video source & dst data */ short old_src_x; short old_src_y; short old_src_w; short old_src_h; short old_drw_x; short old_drw_y; short old_drw_w; short old_drw_h; void *xvmc_priv; /* * For PCI DMA image transfer to frame-buffer memory. */ unsigned char *dmaBounceBuffer; unsigned dmaBounceStride; unsigned dmaBounceLines; XvError xvErr; } viaPortPrivRec, *viaPortPrivPtr; extern viaPortPrivPtr viaPortPriv[]; extern unsigned viaNumXvPorts; #endif /* _VIA_XVPRIV_H_ */ xf86-video-openchrome-0.6.0/src/via_ums.c0000664000175000017500000007763713054665201015120 00000000000000/* * Copyright 2011-2016 The OpenChrome Project * [https://www.freedesktop.org/wiki/Openchrome] * * 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 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "globals.h" #include "via_driver.h" static void viaMMIOEnable(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaMMIOEnable.\n")); switch (pVia->Chipset) { case VIA_CX700: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: ViaSeqMask(hwp, 0x1A, 0x08, 0x08); break; default: if (pVia->IsSecondary) ViaSeqMask(hwp, 0x1A, 0x38, 0x38); else ViaSeqMask(hwp, 0x1A, 0x68, 0x68); break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaMMIOEnable.\n")); } static void viaMMIODisable(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaMMIODisable.\n")); switch (pVia->Chipset) { case VIA_CX700: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: ViaSeqMask(hwp, 0x1A, 0x00, 0x08); break; default: ViaSeqMask(hwp, 0x1A, 0x00, 0x60); break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaMMIODisable.\n")); } static Bool viaMapMMIO(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 val; #ifdef HAVE_PCIACCESS int err; #else unsigned char *tmp; #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaMapMMIO.\n")); #ifdef HAVE_PCIACCESS pVia->MmioBase = pVia->PciInfo->regions[1].base_addr; #else pVia->MmioBase = pVia->PciInfo->memBase[1]; #endif xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Mapping MMIO at address 0x%lX with " "size %u KB.\n", pVia->MmioBase, VIA_MMIO_REGSIZE / 1024); #ifdef HAVE_PCIACCESS err = pci_device_map_range(pVia->PciInfo, pVia->MmioBase, VIA_MMIO_REGSIZE, PCI_DEV_MAP_FLAG_WRITABLE, (void **)&pVia->MapBase); if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map MMIO.\n" "Error: %s (%u)\n", strerror(err), err); goto fail; } #else pVia->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag, pVia->MmioBase, VIA_MMIO_REGSIZE); if (!pVia->MapBase) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map MMIO.\n"); goto fail; } #endif xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Mapping 2D Host BitBLT space at address 0x%lX with " "size %u KB.\n", pVia->MmioBase + VIA_MMIO_BLTBASE, VIA_MMIO_BLTSIZE / 1024); #ifdef HAVE_PCIACCESS err = pci_device_map_range(pVia->PciInfo, pVia->MmioBase + VIA_MMIO_BLTBASE, VIA_MMIO_BLTSIZE, PCI_DEV_MAP_FLAG_WRITABLE, (void **)&pVia->BltBase); if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map 2D Host BitBLT space.\n" "Error: %s (%u)\n", strerror(err), err); goto fail; } #else pVia->BltBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag, pVia->MmioBase + VIA_MMIO_BLTBASE, VIA_MMIO_BLTSIZE); if (!pVia->BltBase) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map 2D Host BitBLT space.\n"); goto fail; } #endif if (!(pVia->videoRambytes)) { goto fail; } #ifdef HAVE_PCIACCESS if (pVia->Chipset == VIA_VX900) { pVia->FrameBufferBase = pVia->PciInfo->regions[2].base_addr; } else { pVia->FrameBufferBase = pVia->PciInfo->regions[0].base_addr; } #else if (pVia->Chipset == VIA_VX900) { pVia->FrameBufferBase = pVia->PciInfo->memBase[2]; } else { pVia->FrameBufferBase = pVia->PciInfo->memBase[0]; } #endif xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Mapping the frame buffer at address 0x%lX with " "size %lu KB.\n", pVia->FrameBufferBase, pVia->videoRambytes / 1024); #ifdef HAVE_PCIACCESS err = pci_device_map_range(pVia->PciInfo, pVia->FrameBufferBase, pVia->videoRambytes, (PCI_DEV_MAP_FLAG_WRITABLE | PCI_DEV_MAP_FLAG_WRITE_COMBINE), (void **)&pVia->FBBase); if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map the frame buffer.\n" "Error: %s (%u)\n", strerror(err), err); goto fail; } #else /* * FIXME: This is a hack to get rid of offending wrongly sized * MTRR regions set up by the VIA BIOS. Should be taken care of * in the OS support layer. */ tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag, pVia->FrameBufferBase, pVia->videoRambytes); xf86UnMapVidMem(pScrn->scrnIndex, (pointer) tmp, pVia->videoRambytes); /* * And, as if this wasn't enough, 2.6 series kernels don't * remove MTRR regions on the first attempt. So try again. */ tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag, pVia->FrameBufferBase, pVia->videoRambytes); xf86UnMapVidMem(pScrn->scrnIndex, (pointer) tmp, pVia->videoRambytes); /* * End of hack. */ pVia->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, pVia->PciTag, pVia->FrameBufferBase, pVia->videoRambytes); if (!pVia->FBBase) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map the frame buffer.\n"); goto fail; } #endif pVia->FBFreeStart = 0; pVia->FBFreeEnd = pVia->videoRambytes; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Frame buffer start address: %p, free start: 0x%X end: 0x%X\n", pVia->FBBase, pVia->FBFreeStart, pVia->FBFreeEnd); #ifdef HAVE_PCIACCESS if (pVia->Chipset == VIA_VX900) { pScrn->memPhysBase = pVia->PciInfo->regions[2].base_addr; } else { pScrn->memPhysBase = pVia->PciInfo->regions[0].base_addr; } #else if (pVia->Chipset == VIA_VX900) { pScrn->memPhysBase = pVia->PciInfo->memBase[2]; } else { pScrn->memPhysBase = pVia->PciInfo->memBase[0]; } #endif pScrn->fbOffset = 0; if (pVia->IsSecondary) { pScrn->fbOffset = pScrn->videoRam << 10; } /* MMIO for MPEG engine. */ pVia->MpegMapBase = pVia->MapBase + 0xc00; /* Set up MMIO vgaHW. */ vgaHWSetMmioFuncs(hwp, pVia->MapBase, 0x8000); val = hwp->readEnable(hwp); hwp->writeEnable(hwp, val | 0x01); val = hwp->readMiscOut(hwp); hwp->writeMiscOut(hwp, val | 0x01); /* Unlock extended I/O space. */ ViaSeqMask(hwp, 0x10, 0x01, 0x01); viaMMIOEnable(pScrn); vgaHWGetIOBase(hwp); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaMapMMIO.\n")); return TRUE; fail: #ifdef HAVE_PCIACCESS if (pVia->FBBase) { pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->FBBase, pVia->videoRambytes); } if (pVia->BltBase) { pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->BltBase, VIA_MMIO_BLTSIZE); } if (pVia->MapBase) { pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->MapBase, VIA_MMIO_REGSIZE); } #else if (pVia->FBBase) { xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pVia->FBBase, pVia->videoRambytes); } if (pVia->BltBase) { xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pVia->BltBase, VIA_MMIO_BLTSIZE); } if (pVia->MapBase) { xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pVia->MapBase, VIA_MMIO_REGSIZE); } #endif pVia->FBBase = NULL; pVia->BltBase = NULL; pVia->MapBase = NULL; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaMapMMIO.\n")); return FALSE; } void viaUnmapMMIO(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaUnmapMMIO.\n")); viaMMIODisable(pScrn); #ifdef HAVE_PCIACCESS if (pVia->FBBase) { pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->FBBase, pVia->videoRambytes); } if (pVia->BltBase) { pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->BltBase, VIA_MMIO_BLTSIZE); } if (pVia->MapBase) { pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->MapBase, VIA_MMIO_REGSIZE); } #else if (pVia->FBBase) { xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pVia->FBBase, pVia->videoRambytes); } if (pVia->BltBase) { xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pVia->BltBase, VIA_MMIO_BLTSIZE); } if (pVia->MapBase) { xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pVia->MapBase, VIA_MMIO_REGSIZE); } #endif pVia->FBBase = NULL; pVia->BltBase = NULL; pVia->MapBase = NULL; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaUnmapMMIO.\n")); } /* * Leftover from VIA's code. */ static void viaInitPCIe(VIAPtr pVia) { VIASETREG(0x41c, 0x00100000); VIASETREG(0x420, 0x680A0000); VIASETREG(0x420, 0x02000000); } static void viaInitAGP(VIAPtr pVia) { VIASETREG(VIA_REG_TRANSET, 0x00100000); VIASETREG(VIA_REG_TRANSPACE, 0x00000000); VIASETREG(VIA_REG_TRANSPACE, 0x00333004); VIASETREG(VIA_REG_TRANSPACE, 0x60000000); VIASETREG(VIA_REG_TRANSPACE, 0x61000000); VIASETREG(VIA_REG_TRANSPACE, 0x62000000); VIASETREG(VIA_REG_TRANSPACE, 0x63000000); VIASETREG(VIA_REG_TRANSPACE, 0x64000000); VIASETREG(VIA_REG_TRANSPACE, 0x7D000000); VIASETREG(VIA_REG_TRANSET, 0xfe020000); VIASETREG(VIA_REG_TRANSPACE, 0x00000000); } /* * Initialize the virtual command queue. Header-2 commands can be put * in this queue for buffering. AFAIK it doesn't handle Header-1 * commands, which is really a pity, since it has to be idled before * issuing a Header-1 command. */ static void viaEnableAGPVQ(VIAPtr pVia) { CARD32 vqStartAddr = pVia->VQStart, vqEndAddr = pVia->VQEnd, vqStartL = 0x50000000 | (vqStartAddr & 0xFFFFFF), vqEndL = 0x51000000 | (vqEndAddr & 0xFFFFFF), vqStartEndH = 0x52000000 | ((vqStartAddr & 0xFF000000) >> 24) | ((vqEndAddr & 0xFF000000) >> 16), vqLen = 0x53000000 | (VIA_VQ_SIZE >> 3); VIASETREG(VIA_REG_TRANSET, 0x00fe0000); VIASETREG(VIA_REG_TRANSPACE, 0x080003fe); VIASETREG(VIA_REG_TRANSPACE, 0x0a00027c); VIASETREG(VIA_REG_TRANSPACE, 0x0b000260); VIASETREG(VIA_REG_TRANSPACE, 0x0c000274); VIASETREG(VIA_REG_TRANSPACE, 0x0d000264); VIASETREG(VIA_REG_TRANSPACE, 0x0e000000); VIASETREG(VIA_REG_TRANSPACE, 0x0f000020); VIASETREG(VIA_REG_TRANSPACE, 0x1000027e); VIASETREG(VIA_REG_TRANSPACE, 0x110002fe); VIASETREG(VIA_REG_TRANSPACE, 0x200f0060); VIASETREG(VIA_REG_TRANSPACE, 0x00000006); VIASETREG(VIA_REG_TRANSPACE, 0x40008c0f); VIASETREG(VIA_REG_TRANSPACE, 0x44000000); VIASETREG(VIA_REG_TRANSPACE, 0x45080c04); VIASETREG(VIA_REG_TRANSPACE, 0x46800408); VIASETREG(VIA_REG_TRANSPACE, vqStartEndH); VIASETREG(VIA_REG_TRANSPACE, vqStartL); VIASETREG(VIA_REG_TRANSPACE, vqEndL); VIASETREG(VIA_REG_TRANSPACE, vqLen); } static void viaEnablePCIeVQ(VIAPtr pVia) { CARD32 vqStartAddr = pVia->VQStart, vqEndAddr = pVia->VQEnd, vqStartL = 0x70000000 | (vqStartAddr & 0xFFFFFF), vqEndL = 0x71000000 | (vqEndAddr & 0xFFFFFF), vqStartEndH = 0x72000000 | ((vqStartAddr & 0xFF000000) >> 24) | ((vqEndAddr & 0xFF000000) >> 16), vqLen = 0x73000000 | (VIA_VQ_SIZE >> 3); VIASETREG(0x41c, 0x00100000); VIASETREG(0x420, vqStartEndH); VIASETREG(0x420, vqStartL); VIASETREG(0x420, vqEndL); VIASETREG(0x420, vqLen); VIASETREG(0x420, 0x74301001); VIASETREG(0x420, 0x00000000); } /* * Disable the virtual command queue. */ void viaDisableVQ(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDisableVQ.\n")); switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: VIASETREG(0x41c, 0x00100000); VIASETREG(0x420, 0x74301000); break; default: VIASETREG(VIA_REG_TRANSET, 0x00fe0000); VIASETREG(VIA_REG_TRANSPACE, 0x00000004); VIASETREG(VIA_REG_TRANSPACE, 0x40008c0f); VIASETREG(VIA_REG_TRANSPACE, 0x44000000); VIASETREG(VIA_REG_TRANSPACE, 0x45080c04); VIASETREG(VIA_REG_TRANSPACE, 0x46800408); break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDisableVQ.\n")); } /* * Initialize the 2D engine and set the 2D context mode to the * current screen depth. Also enable the virtual queue. */ static void viaInitialize2DEngine(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); ViaTwodContext *tdc = &pVia->td; int i; /* Initialize the 2D engine registers to reset the 2D engine. */ for (i = 0x04; i <= 0x40; i += 4) { VIASETREG(i, 0x0); } if (pVia->Chipset == VIA_VX800 || pVia->Chipset == VIA_VX855 || pVia->Chipset == VIA_VX900) { for (i = 0x44; i <= 0x5c; i += 4) { VIASETREG(i, 0x0); } } if (pVia->Chipset == VIA_VX900) { /*410 redefine 0x30 34 38*/ VIASETREG(0x60, 0x0); /*already useable here*/ } switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: viaInitPCIe(pVia); break; default: viaInitAGP(pVia); break; } if (pVia->VQStart != 0) { switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: viaEnablePCIeVQ(pVia); break; default: viaEnableAGPVQ(pVia); break; } } else { viaDisableVQ(pScrn); } viaAccelSetMode(pScrn->bitsPerPixel, tdc); } static void viaInitialize3DEngine(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); int i; VIASETREG(VIA_REG_TRANSET, 0x00010000); for (i = 0; i <= 0x7D; i++) VIASETREG(VIA_REG_TRANSPACE, (CARD32) i << 24); VIASETREG(VIA_REG_TRANSET, 0x00020000); for (i = 0; i <= 0x94; i++) VIASETREG(VIA_REG_TRANSPACE, (CARD32) i << 24); VIASETREG(VIA_REG_TRANSPACE, 0x82400000); VIASETREG(VIA_REG_TRANSET, 0x01020000); for (i = 0; i <= 0x94; i++) VIASETREG(VIA_REG_TRANSPACE, (CARD32) i << 24); VIASETREG(VIA_REG_TRANSPACE, 0x82400000); VIASETREG(VIA_REG_TRANSET, 0xfe020000); for (i = 0; i <= 0x03; i++) VIASETREG(VIA_REG_TRANSPACE, (CARD32) i << 24); VIASETREG(VIA_REG_TRANSET, 0x00030000); for (i = 0; i <= 0xff; i++) VIASETREG(VIA_REG_TRANSPACE, 0); VIASETREG(VIA_REG_TRANSET, 0x00100000); VIASETREG(VIA_REG_TRANSPACE, 0x00333004); VIASETREG(VIA_REG_TRANSPACE, 0x10000002); VIASETREG(VIA_REG_TRANSPACE, 0x60000000); VIASETREG(VIA_REG_TRANSPACE, 0x61000000); VIASETREG(VIA_REG_TRANSPACE, 0x62000000); VIASETREG(VIA_REG_TRANSPACE, 0x63000000); VIASETREG(VIA_REG_TRANSPACE, 0x64000000); VIASETREG(VIA_REG_TRANSET, 0x00fe0000); if (pVia->Chipset == VIA_CLE266 && pVia->ChipRev >= 3) VIASETREG(VIA_REG_TRANSPACE, 0x40008c0f); else VIASETREG(VIA_REG_TRANSPACE, 0x4000800f); VIASETREG(VIA_REG_TRANSPACE, 0x44000000); VIASETREG(VIA_REG_TRANSPACE, 0x45080C04); VIASETREG(VIA_REG_TRANSPACE, 0x46800408); VIASETREG(VIA_REG_TRANSPACE, 0x50000000); VIASETREG(VIA_REG_TRANSPACE, 0x51000000); VIASETREG(VIA_REG_TRANSPACE, 0x52000000); VIASETREG(VIA_REG_TRANSPACE, 0x53000000); VIASETREG(VIA_REG_TRANSET, 0x00fe0000); VIASETREG(VIA_REG_TRANSPACE, 0x08000001); VIASETREG(VIA_REG_TRANSPACE, 0x0A000183); VIASETREG(VIA_REG_TRANSPACE, 0x0B00019F); VIASETREG(VIA_REG_TRANSPACE, 0x0C00018B); VIASETREG(VIA_REG_TRANSPACE, 0x0D00019B); VIASETREG(VIA_REG_TRANSPACE, 0x0E000000); VIASETREG(VIA_REG_TRANSPACE, 0x0F000000); VIASETREG(VIA_REG_TRANSPACE, 0x10000000); VIASETREG(VIA_REG_TRANSPACE, 0x11000000); VIASETREG(VIA_REG_TRANSPACE, 0x20000000); } /* * Acceleration initialization function. Sets up offscreen memory disposition, * and initializes engines and acceleration method. */ Bool umsAccelInit(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); Bool ret = FALSE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered umsAccelInit.\n")); pVia->VQStart = 0; pVia->vq_bo = drm_bo_alloc(pScrn, VIA_VQ_SIZE, 16, TTM_PL_FLAG_VRAM); if (!pVia->vq_bo) goto err; pVia->VQStart = pVia->vq_bo->offset; pVia->VQEnd = pVia->vq_bo->offset + pVia->vq_bo->size; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing the 2D engine.\n")); viaInitialize2DEngine(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing the 3D engine.\n")); viaInitialize3DEngine(pScrn); pVia->exa_sync_bo = drm_bo_alloc(pScrn, 32, 32, TTM_PL_FLAG_VRAM); if (!pVia->exa_sync_bo) goto err; /* Sync marker space. */ pVia->exa_sync_bo = drm_bo_alloc(pScrn, 32, 32, TTM_PL_FLAG_VRAM); if (!pVia->exa_sync_bo) goto err; pVia->markerOffset = pVia->exa_sync_bo->offset; pVia->markerBuf = drm_bo_map(pScrn, pVia->exa_sync_bo); if (!pVia->markerBuf) goto err; pVia->curMarker = 0; pVia->lastMarkerRead = 0; #ifdef HAVE_DRI pVia->dBounce = NULL; pVia->scratchAddr = NULL; #endif /* HAVE_DRI */ ret = TRUE; err: if (!ret) { if (pVia->markerBuf) { drm_bo_unmap(pScrn, pVia->exa_sync_bo); pVia->markerBuf = NULL; } if (pVia->exa_sync_bo) drm_bo_free(pScrn, pVia->exa_sync_bo); if (pVia->vq_bo) drm_bo_free(pScrn, pVia->vq_bo); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting umsAccelInit.\n")); return ret; } Bool umsCreate(ScrnInfoPtr pScrn) { ScreenPtr pScreen = pScrn->pScreen; VIAPtr pVia = VIAPTR(pScrn); unsigned long offset; BoxRec AvailFBArea; Bool ret = TRUE; long size; int maxY; #ifdef HAVE_DRI if (pVia->directRenderingType == DRI_1) { pVia->driSize = (pVia->FBFreeEnd - pVia->FBFreeStart) >> 2; if ((pVia->driSize > (pVia->maxDriSize * 1024)) && pVia->maxDriSize > 0) pVia->driSize = pVia->maxDriSize * 1024; /* In the case of DRI we handle all VRAM by the DRI ioctls */ if (pVia->useEXA) return TRUE; /* XAA has to use FBManager so we have to split the space with DRI */ maxY = pScrn->virtualY + (pVia->driSize / pVia->Bpl); } else #endif maxY = pVia->FBFreeEnd / pVia->Bpl; /* FBManager can't handle more than 32767 scan lines */ if (maxY > 32767) maxY = 32767; AvailFBArea.x1 = 0; AvailFBArea.y1 = 0; AvailFBArea.x2 = pScrn->displayWidth; AvailFBArea.y2 = maxY; pVia->FBFreeStart = (AvailFBArea.y2 + 1) * pVia->Bpl; /* * Initialization of the XFree86 framebuffer manager is done via * Bool xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox) * FullBox represents the area of the framebuffer that the manager * is allowed to manage. This is typically a box with a width * of pScrn->displayWidth and a height of as many lines as can be fit * within the total video memory */ ret = xf86InitFBManager(pScreen, &AvailFBArea); if (ret != TRUE) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86InitFBManager init failed\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Frame Buffer From (%d,%d) To (%d,%d)\n", AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2)); offset = (pVia->FBFreeStart + pVia->Bpp - 1) / pVia->Bpp; size = pVia->FBFreeEnd / pVia->Bpp - offset; if (size > 0) xf86InitFBManagerLinear(pScreen, offset, size); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using %d lines for offscreen memory.\n", AvailFBArea.y2 - pScrn->virtualY)); return TRUE; } Bool umsPreInit(ScrnInfoPtr pScrn) { MessageType from = X_PROBED; VIAPtr pVia = VIAPTR(pScrn); CARD8 videoRam; vgaHWPtr hwp; #ifdef HAVE_PCIACCESS struct pci_device *vgaDevice = pci_device_find_by_slot(0, 0, 0, 3); struct pci_device *bridge = pci_device_find_by_slot(0, 0, 0, 0); #endif int bMemSize = 0; if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE; if (!vgaHWGetHWRec(pScrn)) return FALSE; #if 0 /* Here we can alter the number of registers saved and restored by the * standard vgaHWSave and Restore routines. */ vgaHWSetRegCounts(pScrn, VGA_NUM_CRTC, VGA_NUM_SEQ, VGA_NUM_GFX, VGA_NUM_ATTR); #endif hwp = VGAHWPTR(pScrn); switch (pVia->Chipset) { case VIA_CLE266: #ifdef HAVE_PCIACCESS pci_device_cfg_read_u8(bridge, &videoRam, 0xE1); #else videoRam = pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70; #endif pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10; break; case VIA_KM400: #ifdef HAVE_PCIACCESS /* P4M800 Host Bridge PCI Device ID */ if (DEVICE_ID(bridge) == 0x0296) { pci_device_cfg_read_u8(vgaDevice, &videoRam, 0xA1); } else { pci_device_cfg_read_u8(bridge, &videoRam, 0xE1); } #else /* P4M800 Host Bridge PCI Device ID */ if (pciReadWord(pciTag(0, 0, 0), 0x02) == 0x0296) { videoRam = pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70; } else { videoRam = pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70; } #endif pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10; break; case VIA_PM800: case VIA_P4M800PRO: case VIA_K8M800: #ifdef HAVE_PCIACCESS pci_device_cfg_read_u8(vgaDevice, &videoRam, 0xA1); #else videoRam = pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70; #endif pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10; break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: #ifdef HAVE_PCIACCESS pci_device_cfg_read_u8(vgaDevice, &videoRam, 0xA1); #else videoRam = pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70; #endif pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 12; break; default: if (pScrn->videoRam < 16384 || pScrn->videoRam > 65536) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Using old memory-detection method.\n"); bMemSize = hwp->readSeq(hwp, 0x39); if (bMemSize > 16 && bMemSize <= 128) pScrn->videoRam = (bMemSize + 1) << 9; else if (bMemSize > 0 && bMemSize < 31) pScrn->videoRam = bMemSize << 12; else { from = X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Memory size detection failed: using 16 MB.\n"); pScrn->videoRam = 16 << 10; } } else { from = X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "No memory-detection done. Use VideoRAM option.\n"); } } /* * PCI BAR are limited to 256 MB. */ if (pScrn->videoRam > (256 << 10)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Cannot use more than 256 MB of VRAM.\n"); pScrn->videoRam = (256 << 10); } if (from == X_PROBED) { xf86DrvMsg(pScrn->scrnIndex, from, "Probed amount of VideoRAM = %d kB\n", pScrn->videoRam); } /* Split the FB for SAMM. */ /* FIXME: For now, split the FB into two equal sections. * This should be user-adjustable via a config option. */ if (pVia->IsSecondary) { DevUnion *pPriv; VIAEntPtr pVIAEnt; VIAPtr pVia1; pPriv = xf86GetEntityPrivate(pScrn->entityList[0], gVIAEntityIndex); pVIAEnt = pPriv->ptr; pScrn->videoRam = pScrn->videoRam >> 1; pVIAEnt->pPrimaryScrn->videoRam = pScrn->videoRam; pVia1 = VIAPTR(pVIAEnt->pPrimaryScrn); pVia1->videoRambytes = pScrn->videoRam << 10; pVia->FrameBufferBase += (pScrn->videoRam << 10); } pVia->videoRambytes = pScrn->videoRam << 10; /* maybe throw in some more sanity checks here */ #ifndef HAVE_PCIACCESS pVia->PciTag = pciTag(pVia->PciInfo->bus, pVia->PciInfo->device, pVia->PciInfo->func); #endif /* Map PCI hardware resources to the memory map. */ if (!viaMapMMIO(pScrn)) { return FALSE; } return TRUE; } Bool umsCrtcInit(ScrnInfoPtr pScrn) { drmmode_crtc_private_ptr iga1_rec = NULL, iga2_rec = NULL; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,8,0,0,0) ClockRangePtr clockRanges; #else ClockRangesPtr clockRanges; #endif int max_pitch, max_height; VIABIOSInfoPtr pBIOSInfo; xf86CrtcPtr iga1, iga2; /* 3X5.3B through 3X5.3F are scratch pad registers. */ pVia->originalCR3B = hwp->readCrtc(hwp, 0x3B); pVia->originalCR3C = hwp->readCrtc(hwp, 0x3C); pVia->originalCR3D = hwp->readCrtc(hwp, 0x3D); pVia->originalCR3E = hwp->readCrtc(hwp, 0x3E); pVia->originalCR3F = hwp->readCrtc(hwp, 0x3F); /* Read memory bandwidth from registers. */ pVia->MemClk = hwp->readCrtc(hwp, 0x3D) >> 4; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected MemClk %d\n", pVia->MemClk)); if (pVia->MemClk >= VIA_MEM_END) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unknown Memory clock: %d\n", pVia->MemClk); pVia->MemClk = VIA_MEM_END - 1; } pBIOSInfo = pVia->pBIOSInfo; pBIOSInfo->Bandwidth = ViaGetMemoryBandwidth(pScrn); if (pBIOSInfo->TVType == TVTYPE_NONE) { /* Use jumper to determine TV type. */ if (hwp->readCrtc(hwp, 0x3B) & 0x02) { pBIOSInfo->TVType = TVTYPE_PAL; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected TV standard: PAL.\n")); } else { pBIOSInfo->TVType = TVTYPE_NTSC; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected TV standard: NTSC.\n")); } } if (pVia->drmmode.hwcursor) { if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE; } if (!xf86LoadSubModule(pScrn, "i2c")) return FALSE; else ViaI2CInit(pScrn); if (!xf86LoadSubModule(pScrn, "ddc")) return FALSE; /* * Set up ClockRanges, which describe what clock ranges are * available, and what sort of modes they can be used for. */ #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,8,0,0,0) clockRanges = xnfalloc(sizeof(ClockRange)); #else clockRanges = xnfalloc(sizeof(ClockRanges)); #endif clockRanges->next = NULL; clockRanges->minClock = 20000; clockRanges->maxClock = 230000; clockRanges->clockIndex = -1; clockRanges->interlaceAllowed = TRUE; clockRanges->doubleScanAllowed = FALSE; pScrn->clockRanges = clockRanges; /* * Now handle the outputs */ iga1_rec = (drmmode_crtc_private_ptr) xnfcalloc(sizeof(drmmode_crtc_private_rec), 1); if (!iga1_rec) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "IGA1 Rec allocation failed.\n"); return FALSE; } iga1 = xf86CrtcCreate(pScrn, &iga1_crtc_funcs); if (!iga1) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86CrtcCreate failed.\n"); free(iga1_rec); return FALSE; } iga1_rec->drmmode = &pVia->drmmode; iga1_rec->index = 0; iga1->driver_private = iga1_rec; iga2_rec = (drmmode_crtc_private_ptr) xnfcalloc(sizeof(drmmode_crtc_private_rec), 1); if (!iga2_rec) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "IGA1 Rec allocation failed.\n"); xf86CrtcDestroy(iga1); return FALSE; } iga2 = xf86CrtcCreate(pScrn, &iga2_crtc_funcs); if (!iga2) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86CrtcCreate failed.\n"); xf86CrtcDestroy(iga1); free(iga2_rec); return FALSE; } iga2_rec->drmmode = &pVia->drmmode; iga2_rec->index = 1; iga2->driver_private = iga2_rec; if (!pScrn->bitsPerPixel) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Detected bitsPerPixel to be 0 bit.\n"); xf86CrtcDestroy(iga2); xf86CrtcDestroy(iga1); return FALSE; } /* * CLE266A: * Max Line Pitch: 4080, (FB corruption when higher, driver problem?) * Max Height: 4096 (and beyond) * * CLE266A: primary AdjustFrame can use only 24 bits, so we are limited * to 12x11 bits; 4080x2048 (~2:1), 3344x2508 (4:3), or 2896x2896 (1:1). * TODO Test CLE266Cx, KM400, KM400A, K8M800, CN400 please. * * We should be able to limit the memory available for a mode to 32 MB, * but miScanLineWidth fails to catch this properly (apertureSize). */ max_pitch = (8192 / ((pScrn->bitsPerPixel + 7) >> 3)) - (16 / ((pScrn->bitsPerPixel + 7) >> 3)); max_height = 8192 / ((pScrn->bitsPerPixel + 7) >> 3); xf86CrtcSetSizeRange(pScrn, 320, 200, max_pitch, max_height); viaOutputDetect(pScrn); return TRUE; } xf86-video-openchrome-0.6.0/src/via_sii164.h0000664000175000017500000000353513054665201015322 00000000000000/* * Copyright 2016 Kevin Brace * Copyright 2016 The OpenChrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 2014 SHS SERVICES GmbH * Copyright 2006-2009 Luc Verhaegen. * * 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 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. */ #ifndef _VIA_SII164_H_ #define _VIA_SII164_H_ 1 #define VIA_SII164_VEN 0x20 #define VIA_SII164_HEN 0x10 #define VIA_SII164_DSEL 0x08 #define VIA_SII164_BSEL 0x04 #define VIA_SII164_EDGE 0x02 #define VIA_SII164_PDB 0x01 typedef struct _viaSiI164 { I2CDevPtr SiI164I2CDev; int DotclockMin; int DotclockMax; CARD8 Register08; CARD8 Register09; CARD8 Register0A; CARD8 Register0C; } viaSiI164Rec, *viaSiI164RecPtr; const xf86OutputFuncsRec via_sii164_funcs; Bool viaSiI164Init(ScrnInfoPtr pScrn, I2CBusPtr pI2CBus); #endif /* _VIA_SII164_H_ */ xf86-video-openchrome-0.6.0/src/via_xv.c0000664000175000017500000014753713033607755014755 00000000000000/* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ /* * I N C L U D E S */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "xf86_OSproc.h" #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86Resources.h" #endif #include "compiler.h" #include "xf86Pci.h" #include "regionstr.h" #include "via_driver.h" #include "xf86xv.h" #include #include "dixstruct.h" #include "via_xvpriv.h" #include "fourcc.h" /* * D E F I N E */ #define OFF_DELAY 200 /* milliseconds */ #define FREE_DELAY 60000 #define PARAMSIZE 1024 #define SLICESIZE 65536 #define OFF_TIMER 0x01 #define FREE_TIMER 0x02 #define TIMER_MASK (OFF_TIMER | FREE_TIMER) #define VIA_MAX_XVIMAGE_X 1920 #define VIA_MAX_XVIMAGE_Y 1200 #define LOW_BAND 0x0CB0 #define MID_BAND 0x1f10 #define XV_IMAGE 0 #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) #ifndef XvExtension void viaInitVideo(ScreenPtr pScreen) { } void viaExitVideo(ScrnInfoPtr pScrn) { } void viaSaveVideo(ScrnInfoPtr pScrn) { } void viaRestoreVideo(ScrnInfoPtr pScrn) { } void VIAVidAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { } #else static vidCopyFunc viaFastVidCpy = NULL; /* * F U N C T I O N D E C L A R A T I O N */ static unsigned viaSetupAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr ** adaptors); static void viaStopVideo(ScrnInfoPtr, pointer, Bool); static void viaQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short, unsigned int *, unsigned int *, pointer); static int viaQueryImageAttributes(ScrnInfoPtr, int, unsigned short *, unsigned short *, int *, int *); static int viaGetPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer); static int viaSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer); static int viaPutImage(ScrnInfoPtr, short, short, short, short, short, short, short, short, int, unsigned char *, short, short, Bool, RegionPtr, pointer, DrawablePtr); static void UVBlit(unsigned char *dest, const unsigned char *uBuffer, const unsigned char *vBuffer, unsigned width, unsigned srcPitch, unsigned dstPitch, unsigned lines); static void nv12Blit(unsigned char *nv12Chroma, const unsigned char *uBuffer, const unsigned char *vBuffer, unsigned width, unsigned srcPitch, unsigned dstPitch, unsigned lines); static Atom xvBrightness, xvContrast, xvColorKey, xvHue, xvSaturation, xvAutoPaint; /* * S T R U C T S */ /* client libraries expect an encoding */ static XF86VideoEncodingRec DummyEncoding[1] = { {XV_IMAGE, "XV_IMAGE", VIA_MAX_XVIMAGE_X, VIA_MAX_XVIMAGE_Y, {1, 1}}, }; #define NUM_FORMATS_G 9 static XF86VideoFormatRec FormatsG[NUM_FORMATS_G] = { {8, TrueColor}, /* Dithered */ {8, PseudoColor}, /* Using .. */ {8, StaticColor}, {8, GrayScale}, {8, StaticGray}, /* .. TexelLUT */ {16, TrueColor}, {24, TrueColor}, {16, DirectColor}, {24, DirectColor} }; #define NUM_ATTRIBUTES_G 6 static XF86AttributeRec AttributesG[NUM_ATTRIBUTES_G] = { {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"}, {XvSettable | XvGettable, 0, 10000, "XV_BRIGHTNESS"}, {XvSettable | XvGettable, 0, 20000, "XV_CONTRAST"}, {XvSettable | XvGettable, 0, 20000, "XV_SATURATION"}, {XvSettable | XvGettable, -180, 180, "XV_HUE"}, {XvSettable | XvGettable, 0, 1, "XV_AUTOPAINT_COLORKEY"} }; #define NUM_IMAGES_G 7 static XF86ImageRec ImagesG[NUM_IMAGES_G] = { XVIMAGE_YUY2, XVIMAGE_YV12, XVIMAGE_I420, { /* * Below, a dummy picture type that is used in XvPutImage only to do * an overlay update. Introduced for the XvMC client lib. * Defined to have a zero data size. */ FOURCC_XVMC, XvYUV, LSBFirst, { 'V', 'I', 'A', 0x00, 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}, 12, XvPlanar, 1, 0, 0, 0, 0, 8, 8, 8, 1, 2, 2, 1, 2, 2, { 'Y', 'V', 'U', 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}, { /* RGB 555 */ FOURCC_RV15, 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}, { /* RGB 565 */ FOURCC_RV16, 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}, { /* RGB 888 */ FOURCC_RV32, XvRGB, LSBFirst, { 'R', 'V', '3', '2', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 32, XvPacked, 1, 24, 0xff0000, 0x00ff00, 0x0000ff, 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 char *XvAdaptorName[XV_ADAPT_NUM] = { "XV_SWOV" }; static XF86VideoAdaptorPtr viaAdaptPtr[XV_ADAPT_NUM]; static XF86VideoAdaptorPtr *allAdaptors; static unsigned numAdaptPort[XV_ADAPT_NUM] = { 1 }; /* * F U N C T I O N */ /* * Decide if the mode support video overlay. This depends on the bandwidth * of the mode and the type of RAM available. */ static Bool DecideOverlaySupport(xf86CrtcPtr crtc) { DisplayModePtr mode = &crtc->desiredMode; ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); #ifdef HAVE_DEBUG if (pVia->disableXvBWCheck) return TRUE; #endif /* Small trick here. We keep the height in 16's of lines and width in 32's * to avoid numeric overflow */ if (pVia->ChipId != PCI_CHIP_VT3205 && pVia->ChipId != PCI_CHIP_VT3204 && pVia->ChipId != PCI_CHIP_VT3259 && pVia->ChipId != PCI_CHIP_VT3314 && pVia->ChipId != PCI_CHIP_VT3327 && pVia->ChipId != PCI_CHIP_VT3336 && pVia->ChipId != PCI_CHIP_VT3409 && pVia->ChipId != PCI_CHIP_VT3410 && pVia->ChipId != PCI_CHIP_VT3364 && pVia->ChipId != PCI_CHIP_VT3324 && pVia->ChipId != PCI_CHIP_VT3353) { CARD32 bandwidth = (mode->HDisplay >> 4) * (mode->VDisplay >> 5) * pScrn->bitsPerPixel * mode->VRefresh; switch (pVia->MemClk) { case VIA_MEM_SDR100: /* No overlay without DDR */ case VIA_MEM_SDR133: return FALSE; case VIA_MEM_DDR200: /* Basic limit for DDR200 is about this */ if (bandwidth > 1800000) return FALSE; /* But we have constraints at higher than 800x600 */ if (mode->HDisplay > 800) { if (pScrn->bitsPerPixel != 8) return FALSE; if (mode->VDisplay > 768) return FALSE; if (mode->VRefresh > 60) return FALSE; } return TRUE; case 0: /* FIXME: Why does my CLE266 report 0? */ case VIA_MEM_DDR266: if (bandwidth > 7901250) return FALSE; return TRUE; } return FALSE; } else { unsigned width, height, refresh, dClock; float mClock, memEfficiency, needBandWidth, totalBandWidth; switch (pVia->MemClk) { case VIA_MEM_SDR100: mClock = 50; /*HW base on 128 bit */ memEfficiency = (float)SINGLE_3205_100; break; case VIA_MEM_SDR133: mClock = 66.5; memEfficiency = (float)SINGLE_3205_100; break; case VIA_MEM_DDR200: mClock = 100; memEfficiency = (float)SINGLE_3205_100; break; case VIA_MEM_DDR266: mClock = 133; memEfficiency = (float)SINGLE_3205_133; break; case VIA_MEM_DDR333: mClock = 166; memEfficiency = (float)SINGLE_3205_133; break; case VIA_MEM_DDR400: mClock = 200; memEfficiency = (float)SINGLE_3205_133; break; case VIA_MEM_DDR533: mClock = 266; memEfficiency = (float)SINGLE_3205_133; break; case VIA_MEM_DDR667: mClock = 333; memEfficiency = (float)SINGLE_3205_133; break; case VIA_MEM_DDR800: mClock = 400; memEfficiency = (float)SINGLE_3205_133; break; case VIA_MEM_DDR1066: mClock = 533; memEfficiency = (float)SINGLE_3205_133; break; default: ErrorF("Unknown DRAM Type!\n"); mClock = 166; memEfficiency = (float)SINGLE_3205_133; break; } width = mode->HDisplay; height = mode->VDisplay; refresh = mode->VRefresh; if (refresh==0) { refresh=60; ErrorF("Unable to fetch vertical refresh value, needed for bandwidth calculation.\n"); } /* * Approximative, VERY conservative formula in some cases. * This formula and the one below are derived analyzing the * tables present in VIA's own drivers. They may reject the over- * lay in some cases where VIA's driver don't. */ dClock = (width * height * refresh) / 680000; if (dClock) { needBandWidth = (float)(((pScrn->bitsPerPixel >> 3) + VIDEO_BPP) * dClock); totalBandWidth = (float)(mClock * 16. * memEfficiency); DBG_DD(ErrorF(" via_xv.c : cBitsPerPel= %d : \n", pScrn->bitsPerPixel)); DBG_DD(ErrorF(" via_xv.c : Video_Bpp= %d : \n", VIDEO_BPP)); DBG_DD(ErrorF(" via_xv.c : refresh = %d : \n", refresh)); DBG_DD(ErrorF(" via_xv.c : dClock= %d : \n", dClock)); DBG_DD(ErrorF(" via_xv.c : mClk= %f : \n", mClock)); DBG_DD(ErrorF(" via_xv.c : memEfficiency= %f : \n", memEfficiency)); if (needBandWidth < totalBandWidth) return TRUE; ErrorF(" via_xv.c : needBandwidth= %f : \n", needBandWidth); ErrorF(" via_xv.c : totalBandwidth= %f : \n", totalBandWidth); } return FALSE; } return FALSE; } static const char *viaXvErrMsg[xve_numerr] = { "No Error.", "Bandwidth is insufficient. Check bios memory settings.", "PCI DMA blit failed. You probably encountered a bug.", "Not enough resources to complete the request. Probably out of memory.", "General Error. I wish I could be more specific.", "Wrong adaptor used. Try another port number." }; static void viaXvError(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv, XvError error) { if (error == xve_none) { pPriv->xvErr = xve_none; return; } if (error == pPriv->xvErr) { return; } pPriv->xvErr = error; xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[Xv] Port %d: %s\n", pPriv->xv_portnum, viaXvErrMsg[error]); } static void viaResetVideo(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vmmtr viaVidEng = (vmmtr) (pVia->MapBase + 0x200); DBG_DD(ErrorF(" via_xv.c : viaResetVideo: \n")); viaVidEng->video1_ctl = 0; viaVidEng->video3_ctl = 0; viaVidEng->compose = V1_COMMAND_FIRE; viaVidEng->compose = V3_COMMAND_FIRE; viaVidEng->color_key = 0x821; viaVidEng->snd_color_key = 0x821; } void viaSaveVideo(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vmmtr viaVidEng = (vmmtr) (pVia->MapBase + 0x200); DBG_DD(ErrorF(" via_xv.c : viaSaveVideo : \n")); /* Save video registers */ memcpy(pVia->VideoRegs, (void*)viaVidEng, sizeof(video_via_regs)); pVia->dwV1 = ((vmmtr) viaVidEng)->video1_ctl; pVia->dwV3 = ((vmmtr) viaVidEng)->video3_ctl; viaVidEng->video1_ctl = 0; viaVidEng->video3_ctl = 0; viaVidEng->compose = V1_COMMAND_FIRE; viaVidEng->compose = V3_COMMAND_FIRE; } void viaRestoreVideo(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vmmtr viaVidEng = (vmmtr) (pVia->MapBase + 0x200); video_via_regs *localVidEng = pVia->VideoRegs; DBG_DD(ErrorF(" via_xv.c : viaRestoreVideo : \n")); /* Restore video registers */ /* flush restored video engines' setting to MapBase */ viaVidEng->alphawin_hvstart = localVidEng->alphawin_hvstart; viaVidEng->alphawin_size = localVidEng->alphawin_size; viaVidEng->alphawin_ctl = localVidEng->alphawin_ctl; viaVidEng->alphafb_stride = localVidEng->alphafb_stride; viaVidEng->color_key = localVidEng->color_key; viaVidEng->alphafb_addr = localVidEng->alphafb_addr; viaVidEng->chroma_low = localVidEng->chroma_low; viaVidEng->chroma_up = localVidEng->chroma_up; viaVidEng->interruptflag = localVidEng->interruptflag; if (pVia->ChipId != PCI_CHIP_VT3314) { /*VT3314 only has V3*/ viaVidEng->video1_ctl = localVidEng->video1_ctl; viaVidEng->video1_fetch = localVidEng->video1_fetch; viaVidEng->video1y_addr1 = localVidEng->video1y_addr1; viaVidEng->video1_stride = localVidEng->video1_stride; viaVidEng->video1_hvstart = localVidEng->video1_hvstart; viaVidEng->video1_size = localVidEng->video1_size; viaVidEng->video1y_addr2 = localVidEng->video1y_addr2; viaVidEng->video1_zoom = localVidEng->video1_zoom; viaVidEng->video1_mictl = localVidEng->video1_mictl; viaVidEng->video1y_addr0 = localVidEng->video1y_addr0; viaVidEng->video1_fifo = localVidEng->video1_fifo; viaVidEng->video1y_addr3 = localVidEng->video1y_addr3; viaVidEng->v1_source_w_h = localVidEng->v1_source_w_h; viaVidEng->video1_CSC1 = localVidEng->video1_CSC1; viaVidEng->video1_CSC2 = localVidEng->video1_CSC2; /* Fix cursor garbage after suspend for VX855 and VX900 (#405) */ /* 0x2E4 T Signature Data Result 1 */ viaVidEng->video1u_addr1 = localVidEng->video1u_addr1; /* 0x2E8 HI for Primary Display FIFO Control Signal */ viaVidEng->video1u_addr2 = localVidEng->video1u_addr2; /* 0x2EC HI for Primary Display FIFO Transparent color */ viaVidEng->video1u_addr3 = localVidEng->video1u_addr3; /* 0x2F0 HI for Primary Display Control Signal */ viaVidEng->video1v_addr0 = localVidEng->video1v_addr0; /* 0x2F4 HI for Primary Display Frame Buffer Starting Address */ viaVidEng->video1v_addr1 = localVidEng->video1v_addr1; /* 0x2F8 HI for Primary Display Horizontal and Vertical Start */ viaVidEng->video1v_addr2 = localVidEng->video1v_addr2; /* 0x2FC HI for Primary Display Center Offset */ viaVidEng->video1v_addr3 = localVidEng->video1v_addr3; } viaVidEng->snd_color_key = localVidEng->snd_color_key; viaVidEng->v3alpha_prefifo = localVidEng->v3alpha_prefifo; viaVidEng->v3alpha_fifo = localVidEng->v3alpha_fifo; viaVidEng->video3_CSC2 = localVidEng->video3_CSC2; viaVidEng->video3_CSC2 = localVidEng->video3_CSC2; viaVidEng->v3_source_width = localVidEng->v3_source_width; viaVidEng->video3_ctl = localVidEng->video3_ctl; viaVidEng->video3_addr0 = localVidEng->video3_addr0; viaVidEng->video3_addr1 = localVidEng->video3_addr1; viaVidEng->video3_stride = localVidEng->video3_stride; viaVidEng->video3_hvstart = localVidEng->video3_hvstart; viaVidEng->video3_size = localVidEng->video3_size; viaVidEng->v3alpha_fetch = localVidEng->v3alpha_fetch; viaVidEng->video3_zoom = localVidEng->video3_zoom; viaVidEng->video3_mictl = localVidEng->video3_mictl; viaVidEng->video3_CSC1 = localVidEng->video3_CSC1; viaVidEng->video3_CSC2 = localVidEng->video3_CSC2; viaVidEng->compose = localVidEng->compose; viaVidEng->video3_ctl = pVia->dwV3; if (pVia->ChipId != PCI_CHIP_VT3314) { viaVidEng->video1_ctl = pVia->dwV1; viaVidEng->compose = V1_COMMAND_FIRE; } viaVidEng->compose = V3_COMMAND_FIRE; } void viaExitVideo(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vmmtr viaVidEng = (vmmtr) (pVia->MapBase + 0x200); XF86VideoAdaptorPtr curAdapt; int i, j, numPorts; DBG_DD(ErrorF(" via_xv.c : viaExitVideo : \n")); #ifdef HAVE_DRI ViaCleanupXVMC(pScrn, viaAdaptPtr, XV_ADAPT_NUM); #endif viaVidEng->video1_ctl = 0; viaVidEng->video3_ctl = 0; viaVidEng->compose = V1_COMMAND_FIRE; viaVidEng->compose = V3_COMMAND_FIRE; /* * Free all adaptor info allocated in viaInitVideo. */ for (i = 0; i < XV_ADAPT_NUM; ++i) { curAdapt = viaAdaptPtr[i]; if (curAdapt) { if (curAdapt->pPortPrivates) { if (curAdapt->pPortPrivates->ptr) { numPorts = numAdaptPort[i]; for (j = 0; j < numPorts; ++j) { viaStopVideo(pScrn, (viaPortPrivPtr) curAdapt->pPortPrivates->ptr + j, TRUE); } free(curAdapt->pPortPrivates->ptr); } free(curAdapt->pPortPrivates); } free(curAdapt); } } if (allAdaptors) free(allAdaptors); } void viaInitVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); XF86VideoAdaptorPtr *adaptors, *newAdaptors; VIAPtr pVia = VIAPTR(pScrn); int num_adaptors, num_new; DBG_DD(ErrorF(" via_xv.c : viaInitVideo, Screen[%d]\n", pScrn->scrnIndex)); allAdaptors = NULL; newAdaptors = NULL; num_new = 0; pVia->useDmaBlit = FALSE; #ifdef HAVE_DRI pVia->useDmaBlit = (pVia->directRenderingType == DRI_1) && ((pVia->Chipset == VIA_CLE266) || (pVia->Chipset == VIA_KM400) || (pVia->Chipset == VIA_K8M800) || (pVia->Chipset == VIA_PM800) || (pVia->Chipset == VIA_P4M800PRO) || (pVia->Chipset == VIA_K8M890) || (pVia->Chipset == VIA_P4M900) || (pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900) || (pVia->Chipset == VIA_P4M890)); if ((pVia->drmVerMajor < 2) || ((pVia->drmVerMajor == 2) && (pVia->drmVerMinor < 9))) pVia->useDmaBlit = FALSE; #endif pVia->useDmaBlit = pVia->useDmaBlit && pVia->dmaXV; if (pVia->useDmaBlit) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[Xv] Using PCI DMA for Xv image transfer.\n"); if (!viaFastVidCpy) viaFastVidCpy = viaVidCopyInit("video", pScreen); if ((pVia->Chipset == VIA_CLE266) || (pVia->Chipset == VIA_KM400) || (pVia->Chipset == VIA_K8M800) || (pVia->Chipset == VIA_PM800) || (pVia->Chipset == VIA_P4M800PRO) || (pVia->Chipset == VIA_K8M890) || (pVia->Chipset == VIA_P4M900) || (pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_P4M890) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855 || (pVia->Chipset == VIA_VX900))) { num_new = viaSetupAdaptors(pScreen, &newAdaptors); num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[Xv] Unsupported Chipset. X video functionality disabled.\n"); num_adaptors = 0; memset(viaAdaptPtr, 0, sizeof(viaAdaptPtr)); } DBG_DD(ErrorF(" via_xv.c : num_adaptors : %d\n", num_adaptors)); if (newAdaptors) { allAdaptors = malloc((num_adaptors + num_new) * sizeof(XF86VideoAdaptorPtr *)); if (allAdaptors) { if (num_adaptors) memcpy(allAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr)); memcpy(allAdaptors + num_adaptors, newAdaptors, num_new * sizeof(XF86VideoAdaptorPtr)); num_adaptors += num_new; } } if (num_adaptors) { xf86XVScreenInit(pScreen, allAdaptors, num_adaptors); #ifdef HAVE_DRI ViaInitXVMC(pScreen); #endif viaSetColorSpace(pVia, 0, 0, 0, 0, TRUE); pVia->swov.panning_x = 0; pVia->swov.panning_y = 0; pVia->swov.oldPanningX = 0; pVia->swov.oldPanningY = 0; } } static unsigned viaSetupAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr ** adaptors) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); int i, j, usedPorts, numPorts; viaPortPrivRec *viaPortPriv; DevUnion *pdevUnion; DBG_DD(ErrorF(" via_xv.c : viaSetupAdaptors (viaSetupImageVideo): \n")); xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); xvContrast = MAKE_ATOM("XV_CONTRAST"); xvColorKey = MAKE_ATOM("XV_COLORKEY"); xvHue = MAKE_ATOM("XV_HUE"); xvSaturation = MAKE_ATOM("XV_SATURATION"); xvAutoPaint = MAKE_ATOM("XV_AUTOPAINT_COLORKEY"); *adaptors = NULL; usedPorts = 0; for (i = 0; i < XV_ADAPT_NUM; i++) { if (!(viaAdaptPtr[i] = xf86XVAllocateVideoAdaptorRec(pScrn))) return 0; numPorts = numAdaptPort[i]; viaPortPriv = (viaPortPrivPtr) xnfcalloc(numPorts, sizeof(viaPortPrivRec)); pdevUnion = (DevUnion *) xnfcalloc(numPorts, sizeof(DevUnion)); if (i == XV_ADAPT_SWOV) { /* Overlay engine */ viaAdaptPtr[i]->type = XvInputMask | XvWindowMask | XvImageMask | XvVideoMask | XvStillMask; viaAdaptPtr[i]->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; } else { viaAdaptPtr[i]->type = XvInputMask | XvWindowMask | XvVideoMask; viaAdaptPtr[i]->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; } viaAdaptPtr[i]->name = XvAdaptorName[i]; viaAdaptPtr[i]->nEncodings = 1; viaAdaptPtr[i]->pEncodings = DummyEncoding; viaAdaptPtr[i]->nFormats = sizeof(FormatsG) / sizeof(FormatsG[0]); viaAdaptPtr[i]->pFormats = FormatsG; /* The adapter can handle 1 port simultaneously */ viaAdaptPtr[i]->nPorts = numPorts; viaAdaptPtr[i]->pPortPrivates = pdevUnion; viaAdaptPtr[i]->pPortPrivates->ptr = (pointer) viaPortPriv; viaAdaptPtr[i]->nAttributes = NUM_ATTRIBUTES_G; viaAdaptPtr[i]->pAttributes = AttributesG; viaAdaptPtr[i]->nImages = NUM_IMAGES_G; viaAdaptPtr[i]->pImages = ImagesG; viaAdaptPtr[i]->PutVideo = NULL; viaAdaptPtr[i]->StopVideo = viaStopVideo; viaAdaptPtr[i]->QueryBestSize = viaQueryBestSize; viaAdaptPtr[i]->GetPortAttribute = viaGetPortAttribute; viaAdaptPtr[i]->SetPortAttribute = viaSetPortAttribute; viaAdaptPtr[i]->PutImage = viaPutImage; viaAdaptPtr[i]->ReputImage = NULL; viaAdaptPtr[i]->QueryImageAttributes = viaQueryImageAttributes; for (j = 0; j < numPorts; ++j) { viaPortPriv[j].dmaBounceBuffer = NULL; viaPortPriv[j].dmaBounceStride = 0; viaPortPriv[j].dmaBounceLines = 0; viaPortPriv[j].colorKey = 0x0821; viaPortPriv[j].autoPaint = TRUE; viaPortPriv[j].brightness = 5000.; viaPortPriv[j].saturation = 10000; viaPortPriv[j].contrast = 10000; viaPortPriv[j].hue = 0; viaPortPriv[j].FourCC = 0; viaPortPriv[j].xv_portnum = j + usedPorts; viaPortPriv[j].xvErr = xve_none; #ifdef X_USE_REGION_NULL REGION_NULL(pScreen, &viaPortPriv[j].clip); #else REGION_INIT(pScreen, &viaPortPriv[j].clip, NullBox, 1); #endif } usedPorts += j; #ifdef HAVE_DRI viaXvMCInitXv(pScrn, viaAdaptPtr[i]); #endif } /* End of for */ viaResetVideo(pScrn); *adaptors = viaAdaptPtr; return XV_ADAPT_NUM; } static void viaStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit) { VIAPtr pVia = VIAPTR(pScrn); viaPortPrivPtr pPriv = (viaPortPrivPtr) data; DBG_DD(ErrorF(" via_xv.c : viaStopVideo: exit=%d\n", exit)); REGION_EMPTY(pScrn->pScreen, &pPriv->clip); ViaOverlayHide(pScrn); if (exit) { ViaSwovSurfaceDestroy(pScrn, pPriv); if (pPriv->dmaBounceBuffer) free(pPriv->dmaBounceBuffer); pPriv->dmaBounceBuffer = 0; pPriv->dmaBounceStride = 0; pPriv->dmaBounceLines = 0; pVia->dwFrameNum = 0; pPriv->old_drw_x = 0; pPriv->old_drw_y = 0; pPriv->old_drw_w = 0; pPriv->old_drw_h = 0; } } static int viaSetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value, pointer data) { VIAPtr pVia = VIAPTR(pScrn); vmmtr viaVidEng = (vmmtr) (pVia->MapBase + 0x200); viaPortPrivPtr pPriv = (viaPortPrivPtr) data; int attr, avalue; DBG_DD(ErrorF(" via_xv.c : viaSetPortAttribute : \n")); /* Color Key */ if (attribute == xvColorKey) { DBG_DD(ErrorF(" V4L Disable xvColorKey = %08lx\n", value)); pPriv->colorKey = value; /* All assume color depth is 16 */ value &= 0x00FFFFFF; viaVidEng->color_key = value; viaVidEng->snd_color_key = value; REGION_EMPTY(pScrn->pScreen, &pPriv->clip); DBG_DD(ErrorF(" V4L Disable done xvColorKey = %08lx\n", value)); } else if (attribute == xvAutoPaint) { pPriv->autoPaint = value; DBG_DD(ErrorF(" xvAutoPaint = %08lx\n", value)); /* Color Control */ } else if (attribute == xvBrightness || attribute == xvContrast || attribute == xvSaturation || attribute == xvHue) { if (attribute == xvBrightness) { DBG_DD(ErrorF(" xvBrightness = %08ld\n", value)); pPriv->brightness = value; } if (attribute == xvContrast) { DBG_DD(ErrorF(" xvContrast = %08ld\n", value)); pPriv->contrast = value; } if (attribute == xvSaturation) { DBG_DD(ErrorF(" xvSaturation = %08ld\n", value)); pPriv->saturation = value; } if (attribute == xvHue) { DBG_DD(ErrorF(" xvHue = %08ld\n", value)); pPriv->hue = value; } viaSetColorSpace(pVia, pPriv->hue, pPriv->saturation, pPriv->brightness, pPriv->contrast, FALSE); } else { DBG_DD(ErrorF (" via_xv.c : viaSetPortAttribute : is not supported the attribute")); return BadMatch; } /* attr,avalue hardware processing goes here */ (void)attr; (void)avalue; return Success; } static int viaGetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 * value, pointer data) { viaPortPrivPtr pPriv = (viaPortPrivPtr) data; DBG_DD(ErrorF(" via_xv.c : viaGetPortAttribute : port %d %ld\n", pPriv->xv_portnum, attribute)); *value = 0; if (attribute == xvColorKey) { *value = (INT32) pPriv->colorKey; DBG_DD(ErrorF(" via_xv.c : ColorKey 0x%lx\n", pPriv->colorKey)); } else if (attribute == xvAutoPaint) { *value = (INT32) pPriv->autoPaint; DBG_DD(ErrorF(" AutoPaint = %08ld\n", *value)); /* Color Control */ } else if (attribute == xvBrightness || attribute == xvContrast || attribute == xvSaturation || attribute == xvHue) { if (attribute == xvBrightness) { *value = pPriv->brightness; DBG_DD(ErrorF(" xvBrightness = %08ld\n", *value)); } if (attribute == xvContrast) { *value = pPriv->contrast; DBG_DD(ErrorF(" xvContrast = %08ld\n", *value)); } if (attribute == xvSaturation) { *value = pPriv->saturation; DBG_DD(ErrorF(" xvSaturation = %08ld\n", *value)); } if (attribute == xvHue) { *value = pPriv->hue; DBG_DD(ErrorF(" xvHue = %08ld\n", *value)); } } else { DBG_DD(ErrorF(" via_xv.c : viaGetPortAttribute : is not supported the attribute\n")); /*return BadMatch */; } return Success; } static void viaQueryBestSize(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) { DBG_DD(ErrorF(" via_xv.c : viaQueryBestSize :\n")); *p_w = drw_w; *p_h = drw_h; if (*p_w > 2048) *p_w = 2048; } /* * To do SW Flip */ static void Flip(VIAPtr pVia, viaPortPrivPtr pPriv, int fourcc, unsigned long DisplayBufferIndex) { unsigned long proReg = 0; unsigned count = 50000; if (pVia->ChipId == PCI_CHIP_VT3259 && !(pVia->swov.gdwVideoFlagSW & VIDEO_1_INUSE)) proReg = PRO_HQV1_OFFSET; switch (fourcc) { case FOURCC_UYVY: case FOURCC_YUY2: case FOURCC_RV15: case FOURCC_RV16: case FOURCC_RV32: while ((VIAGETREG(HQV_CONTROL + proReg) & HQV_SW_FLIP) && --count); VIASETREG(HQV_SRC_STARTADDR_Y + proReg, pVia->swov.SWDevice.dwSWPhysicalAddr[DisplayBufferIndex]); VIASETREG(HQV_CONTROL + proReg, (VIAGETREG(HQV_CONTROL + proReg) & ~HQV_FLIP_ODD) | HQV_SW_FLIP | HQV_FLIP_STATUS); break; case FOURCC_YV12: case FOURCC_I420: default: while ((VIAGETREG(HQV_CONTROL + proReg) & HQV_SW_FLIP) && --count); VIASETREG(HQV_SRC_STARTADDR_Y + proReg, pVia->swov.SWDevice.dwSWPhysicalAddr[DisplayBufferIndex]); if (pVia->VideoEngine == VIDEO_ENGINE_CME) { VIASETREG(HQV_SRC_STARTADDR_U + proReg, pVia->swov.SWDevice.dwSWCrPhysicalAddr[DisplayBufferIndex]); } else { VIASETREG(HQV_SRC_STARTADDR_U, pVia->swov.SWDevice.dwSWCbPhysicalAddr[DisplayBufferIndex]); VIASETREG(HQV_SRC_STARTADDR_V, pVia->swov.SWDevice.dwSWCrPhysicalAddr[DisplayBufferIndex]); } VIASETREG(HQV_CONTROL + proReg, (VIAGETREG(HQV_CONTROL + proReg) & ~HQV_FLIP_ODD) | HQV_SW_FLIP | HQV_FLIP_STATUS); break; } } static void planar420cp(unsigned char *dst, const unsigned char *src, int dstPitch, int w, int h, int i420) { unsigned long srcUOffset, srcVOffset; /* * Blit luma component as a fake YUY2 assembler blit. */ if (i420) { srcVOffset = w * h + (w >> 1) * (h >> 1); srcUOffset = w * h; } else { srcUOffset = w * h + (w >> 1) * (h >> 1); srcVOffset = w * h; } (*viaFastVidCpy) (dst, src, dstPitch, w >> 1, h, 1); UVBlit(dst + dstPitch * h, src + srcUOffset, src + srcVOffset, w >> 1, w >> 1, dstPitch, h >> 1); } /* * Slow and dirty. NV12 blit. */ static void nv12cp(unsigned char *dst, const unsigned char *src, int dstPitch, int w, int h, int i420) { unsigned long srcUOffset, srcVOffset; /* * Blit luma component as a fake YUY2 assembler blit. */ if (i420) { srcVOffset = w * h + (w >> 1) * (h >> 1); srcUOffset = w * h; } else { srcUOffset = w * h + (w >> 1) * (h >> 1); srcVOffset = w * h; } (*viaFastVidCpy) (dst, src, dstPitch, w >> 1, h, TRUE); nv12Blit(dst + dstPitch * h, src + srcUOffset, src + srcVOffset, w >> 1, w >>1, dstPitch, h >> 1); } #ifdef HAVE_DRI static int viaDmaBlitImage(VIAPtr pVia, viaPortPrivPtr pPort, unsigned char *src, CARD32 dst, unsigned width, unsigned height, unsigned lumaStride, int id) { Bool bounceBuffer; drm_via_dmablit_t blit; drm_via_blitsync_t *chromaSync = &blit.sync; drm_via_blitsync_t lumaSync; unsigned char *base; unsigned char *bounceBase; unsigned bounceStride; unsigned bounceLines; unsigned size; int err = 0; Bool nv12Conversion; bounceBuffer = ((unsigned long)src & 15); nv12Conversion = (pVia->VideoEngine == VIDEO_ENGINE_CME && (id == FOURCC_YV12 || id == FOURCC_I420)); switch (id) { case FOURCC_YUY2: case FOURCC_RV15: case FOURCC_RV16: bounceStride = ALIGN_TO(2 * width, 16); bounceLines = height; break; case FOURCC_RV32: bounceStride = ALIGN_TO(4 * width, 16); bounceLines = height; break; case FOURCC_YV12: case FOURCC_I420: default: bounceStride = ALIGN_TO(width, 16); bounceLines = height; break; } if (bounceBuffer || nv12Conversion) { if (!pPort->dmaBounceBuffer || pPort->dmaBounceStride != bounceStride || pPort->dmaBounceLines != bounceLines) { if (pPort->dmaBounceBuffer) { free(pPort->dmaBounceBuffer); pPort->dmaBounceBuffer = 0; } size = bounceStride * bounceLines + 16; if (id == FOURCC_YV12 || id == FOURCC_I420) size += ALIGN_TO(bounceStride >> 1, 16) * bounceLines; pPort->dmaBounceBuffer = (unsigned char *)malloc(size); pPort->dmaBounceLines = bounceLines; pPort->dmaBounceStride = bounceStride; } } bounceBase = (unsigned char *)ALIGN_TO((unsigned long)(pPort->dmaBounceBuffer), 16); base = (bounceBuffer) ? bounceBase : src; if (bounceBuffer) { (*viaFastVidCpy) (base, src, bounceStride, bounceStride >> 1, height, 1); } blit.num_lines = height; blit.line_length = bounceStride; blit.fb_addr = dst; blit.fb_stride = lumaStride; blit.mem_addr = base; blit.mem_stride = bounceStride; blit.to_fb = 1; #ifdef XV_DEBUG ErrorF ("Addr: 0x%lx, Offset 0x%lx\n Fb_stride: %u, Mem_stride: %u\n width: %u num_lines: %u\n", (unsigned long)blit.mem_addr, (unsigned long)blit.fb_addr, (unsigned)blit.fb_stride, (unsigned)blit.mem_stride, (unsigned)blit.line_length, (unsigned)blit.num_lines); #endif while (-EAGAIN == (err = drmCommandWriteRead(pVia->drmmode.fd, DRM_VIA_DMA_BLIT, &blit, sizeof(blit)))) ; if (err < 0) return -1; lumaSync = blit.sync; if (id == FOURCC_YV12 || id == FOURCC_I420) { unsigned tmp = ALIGN_TO(width >> 1, 16); if (nv12Conversion) { nv12Blit(bounceBase + bounceStride * height, src + bounceStride * height + tmp * (height >> 1), src + bounceStride * height, width >> 1, tmp, bounceStride, height >> 1); } else if (bounceBuffer) { (*viaFastVidCpy) (base + bounceStride * height, src + bounceStride * height, tmp, tmp >> 1, height, 1); } if (nv12Conversion) { blit.num_lines = height >> 1; blit.line_length = bounceStride; blit.mem_addr = bounceBase + bounceStride * height; blit.fb_stride = lumaStride; blit.mem_stride = bounceStride; } else { blit.num_lines = height; blit.line_length = tmp; blit.mem_addr = base + bounceStride * height; blit.fb_stride = lumaStride >> 1; blit.mem_stride = tmp; } blit.fb_addr = dst + lumaStride * height; blit.to_fb = 1; while (-EAGAIN == (err = drmCommandWriteRead(pVia->drmmode.fd, DRM_VIA_DMA_BLIT, &blit, sizeof(blit)))); if (err < 0) return -1; } while (-EAGAIN == (err = drmCommandWrite(pVia->drmmode.fd, DRM_VIA_BLIT_SYNC, chromaSync, sizeof(*chromaSync)))) ; if (err < 0) return -1; return Success; } #endif /* * The source rectangle of the video is defined by (src_x, src_y, src_w, src_h). * The dest rectangle of the video is defined by (drw_x, drw_y, drw_w, drw_h). * id is a fourcc code for the format of the video. * buf is the pointer to the source data in system memory. * width and height are the w/h of the source data. * If "sync" is TRUE, then we must be finished with *buf at the point of return * (which we always are). * clipBoxes is the clipping region in screen space. * data is a pointer to our port private. * pDraw is a Drawable, which might not be the screen in the case of * compositing. It's a new argument to the function in the 1.1 server. */ static int viaPutImage(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) { VIAPtr pVia = VIAPTR(pScrn); viaPortPrivPtr pPriv = (viaPortPrivPtr) data; xf86CrtcPtr crtc = NULL; unsigned long retCode; # ifdef XV_DEBUG ErrorF(" via_xv.c : viaPutImage : called, Screen[%d]\n", pScrn->scrnIndex); ErrorF(" via_xv.c : FourCC=0x%x width=%d height=%d sync=%d\n", id, width, height, sync); ErrorF (" via_xv.c : src_x=%d src_y=%d src_w=%d src_h=%d colorkey=0x%lx\n", src_x, src_y, src_w, src_h, pPriv->colorKey); ErrorF(" via_xv.c : drw_x=%d drw_y=%d drw_w=%d drw_h=%d\n", drw_x, drw_y, drw_w, drw_h); # endif /* Find out which CRTC the surface will belong to */ crtc = window_belongs_to_crtc(pScrn, drw_x, drw_y, drw_w, drw_h); if (!crtc) { DBG_DD(ErrorF(" via_xv.c : No usable CRTC\n")); viaXvError(pScrn, pPriv, xve_adaptor); return BadAlloc; } switch (pPriv->xv_adaptor) { case XV_ADAPT_SWOV: { DDUPDATEOVERLAY UpdateOverlay_Video; LPDDUPDATEOVERLAY lpUpdateOverlay = &UpdateOverlay_Video; int dstPitch; unsigned long dwUseExtendedFIFO = 0; DBG_DD(ErrorF(" via_xv.c : : S/W Overlay! \n")); /* Allocate video memory(CreateSurface), * add codes to judge if need to re-create surface */ if ((pPriv->old_src_w != src_w) || (pPriv->old_src_h != src_h)) { ViaSwovSurfaceDestroy(pScrn, pPriv); } if (Success != (retCode = ViaSwovSurfaceCreate(pScrn, pPriv, id, width, height))) { DBG_DD(ErrorF (" : Fail to Create SW Video Surface\n")); viaXvError(pScrn, pPriv, xve_mem); return retCode; } /* Copy image data from system memory to video memory * TODO: use DRM's DMA feature to accelerate data copy */ if (id != FOURCC_XVMC) { dstPitch = pVia->swov.SWDevice.dwPitch; if (pVia->useDmaBlit) { #ifdef HAVE_DRI if (viaDmaBlitImage(pVia, pPriv, buf, (CARD32) pVia->swov.SWDevice.dwSWPhysicalAddr[pVia->dwFrameNum & 1], width, height, dstPitch, id)) { viaXvError(pScrn, pPriv, xve_dmablit); return BadAccess; } #endif } else { switch (id) { case FOURCC_I420: if (pVia->VideoEngine == VIDEO_ENGINE_CME) { nv12cp(pVia->swov.SWDevice. lpSWOverlaySurface[pVia->dwFrameNum & 1], buf, dstPitch, width, height, 1); } else { (*viaFastVidCpy)(pVia->swov.SWDevice. lpSWOverlaySurface[pVia->dwFrameNum & 1], buf, dstPitch, width, height, 0); } break; case FOURCC_YV12: if (pVia->VideoEngine == VIDEO_ENGINE_CME) { nv12cp(pVia->swov.SWDevice. lpSWOverlaySurface[pVia->dwFrameNum & 1], buf, dstPitch, width, height, 0); } else { (*viaFastVidCpy)(pVia->swov.SWDevice. lpSWOverlaySurface[pVia->dwFrameNum & 1], buf, dstPitch, width, height, 0); } break; case FOURCC_RV32: (*viaFastVidCpy) (pVia->swov.SWDevice. lpSWOverlaySurface[pVia->dwFrameNum & 1], buf, dstPitch, width << 1, height, 1); break; case FOURCC_UYVY: case FOURCC_YUY2: case FOURCC_RV15: case FOURCC_RV16: default: (*viaFastVidCpy) (pVia->swov.SWDevice. lpSWOverlaySurface[pVia->dwFrameNum & 1], buf, dstPitch, width, height, 1); break; } } } /* If there is bandwidth issue, block the H/W overlay */ if (!(DecideOverlaySupport(crtc))) { DBG_DD(ErrorF (" via_xv.c : Xv Overlay rejected due to insufficient " "memory bandwidth.\n")); viaXvError(pScrn, pPriv, xve_bandwidth); return BadAlloc; } /* * fill video overlay parameter */ lpUpdateOverlay->SrcLeft = src_x; lpUpdateOverlay->SrcTop = src_y; lpUpdateOverlay->SrcRight = src_x + src_w; lpUpdateOverlay->SrcBottom = src_y + src_h; lpUpdateOverlay->DstLeft = drw_x; lpUpdateOverlay->DstTop = drw_y; lpUpdateOverlay->DstRight = drw_x + drw_w; lpUpdateOverlay->DstBottom = drw_y + drw_h; lpUpdateOverlay->dwFlags = DDOVER_KEYDEST; if (pScrn->bitsPerPixel == 8) { lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey & 0xff; } else { lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey; } /* If use extend FIFO mode */ if (pScrn->currentMode->HDisplay > 1024) { dwUseExtendedFIFO = 1; } if (FOURCC_XVMC != id) { /* * XvMC flipping is done in the client lib. */ DBG_DD(ErrorF(" : Flip\n")); Flip(pVia, pPriv, id, pVia->dwFrameNum & 1); } pVia->dwFrameNum++; /* If the dest rec. & extendFIFO doesn't change, don't do UpdateOverlay * unless the surface clipping has changed */ if ((pPriv->old_drw_x == drw_x) && (pPriv->old_drw_y == drw_y) && (pPriv->old_drw_w == drw_w) && (pPriv->old_drw_h == drw_h) && (pPriv->old_src_x == src_x) && (pPriv->old_src_y == src_y) && (pPriv->old_src_w == src_w) && (pPriv->old_src_h == src_h) && (pVia->old_dwUseExtendedFIFO == dwUseExtendedFIFO) && (pVia->VideoStatus & VIDEO_SWOV_ON) && REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) { DBG_DD(ErrorF(" via_xv.c : don't do UpdateOverlay! \n")); viaXvError(pScrn, pPriv, xve_none); return Success; } pPriv->old_src_x = src_x; pPriv->old_src_y = src_y; pPriv->old_src_w = src_w; pPriv->old_src_h = src_h; pPriv->old_drw_x = drw_x; pPriv->old_drw_y = drw_y; pPriv->old_drw_w = drw_w; pPriv->old_drw_h = drw_h; pVia->old_dwUseExtendedFIFO = dwUseExtendedFIFO; pVia->VideoStatus |= VIDEO_SWOV_ON; /* BitBlt: Draw the colorkey rectangle */ if (!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) { REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); if (pPriv->autoPaint) { if (pDraw->type == DRAWABLE_WINDOW) { xf86XVFillKeyHelperDrawable(pDraw, pPriv->colorKey, clipBoxes); DamageDamageRegion(pDraw, clipBoxes); } else { xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes); } } } else { DBG_DD(ErrorF(" via_xv.c : // No need to draw Colorkey!! \n")); } /* * Update video overlay */ if (!VIAVidUpdateOverlay(crtc, lpUpdateOverlay)) { DBG_DD(ErrorF (" via_xv.c : call v4l updateoverlay fail. \n")); } else { DBG_DD(ErrorF(" via_xv.c : PutImage done OK\n")); viaXvError(pScrn, pPriv, xve_none); return Success; } break; } default: DBG_DD(ErrorF(" via_xv.c : XVPort not supported\n")); viaXvError(pScrn, pPriv, xve_adaptor); break; } DBG_DD(ErrorF(" via_xv.c : PutImage done OK\n")); viaXvError(pScrn, pPriv, xve_none); return Success; } static int viaQueryImageAttributes(ScrnInfoPtr pScrn, int id, unsigned short *w, unsigned short *h, int *pitches, int *offsets) { int size, tmp; VIAPtr pVia = VIAPTR(pScrn); DBG_DD(ErrorF(" via_xv.c : viaQueryImageAttributes : FourCC=0x%x, ", id)); DBG_DD(ErrorF(" via_xv.c : Screen[%d], w=%d, h=%d\n", pScrn->scrnIndex, *w, *h)); if ((!w) || (!h)) return 0; if (*w > VIA_MAX_XVIMAGE_X) *w = VIA_MAX_XVIMAGE_X; if (*h > VIA_MAX_XVIMAGE_Y) *h = VIA_MAX_XVIMAGE_Y; *w = (*w + 1) & ~1; if (offsets) offsets[0] = 0; switch (id) { case FOURCC_I420: case FOURCC_YV12: /*Planar format : YV12 -4:2:0 */ *h = (*h + 1) & ~1; size = *w; if (pVia->useDmaBlit) size = (size + 15) & ~15; if (pitches) pitches[0] = size; size *= *h; if (offsets) offsets[1] = size; tmp = (*w >> 1); if (pVia->useDmaBlit) tmp = (tmp + 15) & ~15; if (pitches) pitches[1] = pitches[2] = tmp; tmp *= (*h >> 1); size += tmp; if (offsets) offsets[2] = size; size += tmp; break; case FOURCC_XVMC: *h = (*h + 1) & ~1; #ifdef HAVE_DRI size = viaXvMCPutImageSize(pScrn); #else size = 0; #endif if (pitches) pitches[0] = size; break; case FOURCC_AI44: case FOURCC_IA44: size = *w * *h; if (pitches) pitches[0] = *w; if (offsets) offsets[0] = 0; break; case FOURCC_RV32: size = *w << 2; if (pVia->useDmaBlit) size = (size + 15) & ~15; if (pitches) pitches[0] = size; size *= *h; break; case FOURCC_UYVY: /*Packed format : UYVY -4:2:2 */ case FOURCC_YUY2: /*Packed format : YUY2 -4:2:2 */ case FOURCC_RV15: case FOURCC_RV16: default: size = *w << 1; if (pVia->useDmaBlit) size = (size + 15) & ~15; if (pitches) pitches[0] = size; size *= *h; break; } if (pitches) DBG_DD(ErrorF(" pitches[0]=%d, pitches[1]=%d, pitches[2]=%d, ", pitches[0], pitches[1], pitches[2])); if (offsets) DBG_DD(ErrorF(" offsets[0]=%d, offsets[1]=%d, offsets[2]=%d, ", offsets[0], offsets[1], offsets[2])); DBG_DD(ErrorF(" width=%d, height=%d \n", *w, *h)); return size; } /* * */ void VIAVidAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { VIAPtr pVia = VIAPTR(pScrn); pVia->swov.panning_x = x; pVia->swov.panning_y = y; } /* * Blit the U and V Fields. Used to Flip the U V for I420. */ static void UVBlit(unsigned char *dst, const unsigned char *uBuffer, const unsigned char *vBuffer, unsigned width, unsigned srcPitch, unsigned dstPitch, unsigned lines) { int i, j; dstPitch >>= 1; for(j = 0; j < lines; j++) { for(i = 0; i < width; i++) { dst[i] = (uBuffer[i] << 8) | (vBuffer[i] << 16); } dst += dstPitch; uBuffer += srcPitch; vBuffer += srcPitch; } } /* * Blit the chroma field from one buffer to another while at the same time converting from * YV12 to NV12. */ static void nv12Blit(unsigned char *nv12Chroma, const unsigned char *uBuffer, const unsigned char *vBuffer, unsigned width, unsigned srcPitch, unsigned dstPitch, unsigned lines) { int x; int dstAdd; int srcAdd; dstAdd = dstPitch - (width << 1); srcAdd = srcPitch - width; while (lines--) { x = width; while (x > 3) { register CARD32 dst32, src32 = *((CARD32 *) vBuffer), src32_2 = *((CARD32 *) uBuffer); dst32 = (src32_2 & 0xff) | ((src32 & 0xff) << 8) | ((src32_2 & 0x0000ff00) << 8) | ((src32 & 0x0000ff00) << 16); *((CARD32 *) nv12Chroma) = dst32; nv12Chroma += 4; dst32 = ((src32_2 & 0x00ff0000) >> 16) | ((src32 & 0x00ff0000) >> 8) | ((src32_2 & 0xff000000) >> 8) | (src32 & 0xff000000); *((CARD32 *) nv12Chroma) = dst32; nv12Chroma += 4; x -= 4; vBuffer += 4; uBuffer += 4; } while (x--) { *nv12Chroma++ = *uBuffer++; *nv12Chroma++ = *vBuffer++; } nv12Chroma += dstAdd; vBuffer += srcAdd; uBuffer += srcAdd; } } #endif /* !XvExtension */ xf86-video-openchrome-0.6.0/src/via_driver.c0000664000175000017500000017320213055135146015571 00000000000000/* * Copyright 2005-2015 The Openchrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2006 Luc Verhaegen. * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "shadow.h" #include "globals.h" #ifdef HAVE_XEXTPROTO_71 #include #else #define DPMS_SERVER #include #endif #include "version.h" #include "via_driver.h" #include "drm_fourcc.h" #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86RAC.h" #endif #include "xf86Crtc.h" #ifdef HAVE_DRI #include "dri.h" #else #include "drm_fourcc.h" #endif /* RandR support */ #include "xf86RandR12.h" typedef struct { int major; int minor; int patchlevel; } ViaDRMVersion; static const ViaDRMVersion drmExpected = { 1, 3, 0 }; static const ViaDRMVersion drmCompat = { 3, 1, 0 }; /* Prototypes. */ static void VIAIdentify(int flags); #ifdef HAVE_PCIACCESS static Bool via_pci_probe(DriverPtr drv, int entity_num, struct pci_device *dev, intptr_t match_data); #else /* !HAVE_PCIACCESS */ static Bool VIAProbe(DriverPtr drv, int flags); #endif static Bool VIASetupDefaultOptions(ScrnInfoPtr pScrn); static Bool viaPreInit(ScrnInfoPtr pScrn, int flags); static Bool VIAScreenInit(SCREEN_INIT_ARGS_DECL); static const OptionInfoRec *VIAAvailableOptions(int chipid, int busid); #ifdef HAVE_PCIACCESS #define VIA_DEVICE_MATCH(d,i) \ { 0x1106, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) } static const struct pci_id_match via_device_match[] = { VIA_DEVICE_MATCH (PCI_CHIP_VT3204, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3259, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_CLE3122, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3205, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3314, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3336, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3364, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3324, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3327, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3353, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3409, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3410, 0 ), { 0, 0, 0 }, }; #endif /* HAVE_PCIACCESS */ _X_EXPORT DriverRec VIA = { VIA_VERSION, DRIVER_NAME, VIAIdentify, #ifdef HAVE_PCIACCESS NULL, #else VIAProbe, #endif VIAAvailableOptions, NULL, 0, NULL, #ifdef HAVE_PCIACCESS via_device_match, via_pci_probe #endif }; /* Supported chipsets */ static SymTabRec VIAChipsets[] = { {VIA_CLE266, "CLE266"}, {VIA_KM400, "KM400 / KM400A / KN400 / P4M800"}, {VIA_K8M800, "K8M800 / K8N800"}, {VIA_PM800, "PM800 / PN800 / PM880 / CN333 / CN400"}, {VIA_P4M800PRO, "P4M800 Pro / VN800 / CN700"}, {VIA_CX700, "CX700 / VX700"}, {VIA_P4M890, "P4M890 / VN890 / CN800"}, {VIA_K8M890, "K8M890 / K8N890"}, {VIA_P4M900, "P4M900 / VN896 / CN896"}, {VIA_VX800, "VX800 / VX820"}, {VIA_VX855, "VX855 / VX875"}, {VIA_VX900, "VX900"}, {-1, NULL} }; /* Mapping a PCI device ID to a chipset family identifier. */ static PciChipsets VIAPciChipsets[] = { {VIA_CLE266, PCI_CHIP_CLE3122, VIA_RES_SHARED}, {VIA_KM400, PCI_CHIP_VT3205, VIA_RES_SHARED}, {VIA_K8M800, PCI_CHIP_VT3204, VIA_RES_SHARED}, {VIA_PM800, PCI_CHIP_VT3259, VIA_RES_SHARED}, {VIA_P4M800PRO, PCI_CHIP_VT3314, VIA_RES_SHARED}, {VIA_CX700, PCI_CHIP_VT3324, VIA_RES_SHARED}, {VIA_P4M890, PCI_CHIP_VT3327, VIA_RES_SHARED}, {VIA_K8M890, PCI_CHIP_VT3336, VIA_RES_SHARED}, {VIA_P4M900, PCI_CHIP_VT3364, VIA_RES_SHARED}, {VIA_VX800, PCI_CHIP_VT3353, VIA_RES_SHARED}, {VIA_VX855, PCI_CHIP_VT3409, VIA_RES_SHARED}, {VIA_VX900, PCI_CHIP_VT3410, VIA_RES_SHARED}, {-1, -1, VIA_RES_UNDEF} }; typedef enum { #ifdef HAVE_DEBUG OPTION_PRINTVGAREGS, OPTION_PRINTTVREGS, OPTION_I2CSCAN, #endif OPTION_NOACCEL, OPTION_EXA_NOCOMPOSITE, OPTION_EXA_SCRATCH_SIZE, OPTION_SWCURSOR, OPTION_SHADOW_FB, OPTION_ROTATION_TYPE, OPTION_ROTATE, OPTION_VIDEORAM, OPTION_I2CDEVICES, OPTION_CENTER, OPTION_TVDOTCRAWL, OPTION_TVTYPE, OPTION_TVOUTPUT, OPTION_DISABLEVQ, OPTION_DISABLEIRQ, OPTION_TVDEFLICKER, OPTION_AGP_DMA, OPTION_2D_DMA, OPTION_XV_DMA, OPTION_MAX_DRIMEM, OPTION_AGPMEM, OPTION_DISABLE_XV_BW_CHECK } VIAOpts; static OptionInfoRec VIAOptions[] = { #ifdef HAVE_DEBUG /* Don't document these three. */ {OPTION_PRINTVGAREGS, "PrintVGARegs", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_PRINTTVREGS, "PrintTVRegs", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_I2CSCAN, "I2CScan", OPTV_BOOLEAN, {0}, FALSE}, #endif {OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_EXA_NOCOMPOSITE, "ExaNoComposite", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_EXA_SCRATCH_SIZE, "ExaScratchSize", OPTV_INTEGER, {0}, FALSE}, {OPTION_SWCURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_ROTATION_TYPE, "RotationType", OPTV_ANYSTR, {0}, FALSE}, {OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE}, {OPTION_VIDEORAM, "VideoRAM", OPTV_INTEGER, {0}, FALSE}, {OPTION_TVDOTCRAWL, "TVDotCrawl", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_TVDEFLICKER, "TVDeflicker", OPTV_INTEGER, {0}, FALSE}, {OPTION_TVTYPE, "TVType", OPTV_ANYSTR, {0}, FALSE}, {OPTION_TVOUTPUT, "TVOutput", OPTV_ANYSTR, {0}, FALSE}, {OPTION_DISABLEVQ, "DisableVQ", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_DISABLEIRQ, "DisableIRQ", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_AGP_DMA, "EnableAGPDMA", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_2D_DMA, "NoAGPFor2D", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_XV_DMA, "NoXVDMA", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_DISABLE_XV_BW_CHECK, "DisableXvBWCheck", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_MAX_DRIMEM, "MaxDRIMem", OPTV_INTEGER, {0}, FALSE}, {OPTION_AGPMEM, "AGPMem", OPTV_INTEGER, {0}, FALSE}, {OPTION_I2CDEVICES, "I2CDevices", OPTV_ANYSTR, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; #ifdef XFree86LOADER static MODULESETUPPROTO(VIASetup); static XF86ModuleVersionInfo VIAVersRec = { "openchrome", "https://www.freedesktop.org/wiki/Openchrome/", MODINFOSTRING1, MODINFOSTRING2, #ifdef XORG_VERSION_CURRENT XORG_VERSION_CURRENT, #else XF86_VERSION_CURRENT, #endif VIA_MAJOR_VERSION, VIA_MINOR_VERSION, VIA_PATCHLEVEL, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, MOD_CLASS_VIDEODRV, {0, 0, 0, 0} }; _X_EXPORT XF86ModuleData openchromeModuleData = { &VIAVersRec, VIASetup, NULL }; static pointer VIASetup(pointer module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; /* Only be loaded once */ if (!setupDone) { setupDone = TRUE; xf86AddDriver(&VIA, module, #ifdef HAVE_PCIACCESS HaveDriverFuncs #else 0 #endif ); return (pointer) 1; } else { if (errmaj) *errmaj = LDR_ONCEONLY; return NULL; } } /* VIASetup */ #endif /* XFree86LOADER */ static const OptionInfoRec * VIAAvailableOptions(int chipid, int busid) { return VIAOptions; } static Bool VIASwitchMode(SWITCH_MODE_ARGS_DECL) { SCRN_INFO_PTR(arg); return xf86SetSingleMode(pScrn, mode, RR_Rotate_0); } static void VIAAdjustFrame(ADJUST_FRAME_ARGS_DECL) { SCRN_INFO_PTR(arg); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAAdjustFrame %dx%d\n", x, y)); for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; xf86CrtcSetOrigin(crtc, x, y); } } static Bool VIAEnterVT_internal(ScrnInfoPtr pScrn, int flags) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAEnterVT\n")); for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; if (crtc->funcs->save) crtc->funcs->save(crtc); } for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; if (output->funcs->save) output->funcs->save(output); } if (!xf86SetDesiredModes(pScrn)) return FALSE; if (!flags) { /* Restore video status. */ if (!pVia->IsSecondary) viaRestoreVideo(pScrn); #ifdef HAVE_DRI if (pVia->directRenderingType == DRI_1) { kickVblank(pScrn); VIADRIRingBufferInit(pScrn); viaDRIOffscreenRestore(pScrn); DRIUnlock(xf86ScrnToScreen(pScrn)); } #endif } return TRUE; } static Bool VIAEnterVT(VT_FUNC_ARGS_DECL) { SCRN_INFO_PTR(arg); return VIAEnterVT_internal(pScrn, 0); } static void VIALeaveVT(VT_FUNC_ARGS_DECL) { SCRN_INFO_PTR(arg); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIALeaveVT\n")); #ifdef HAVE_DRI if (pVia->directRenderingType == DRI_1) { volatile drm_via_sarea_t *saPriv = (drm_via_sarea_t *) DRIGetSAREAPrivate(pScrn->pScreen); DRILock(xf86ScrnToScreen(pScrn), 0); saPriv->ctxOwner = ~0; viaAccelSync(pScrn); VIADRIRingBufferCleanup(pScrn); viaDRIOffscreenSave(pScrn); if (pVia->VQEnable) viaDisableVQ(pScrn); } #endif /* Save video status and turn off all video activities. */ if (!pVia->IsSecondary) viaSaveVideo(pScrn); for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; if (output->funcs->restore) output->funcs->restore(output); } for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; if (crtc->funcs->restore) crtc->funcs->restore(crtc); } pScrn->vtSema = FALSE; } static void VIAFreeRec(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAFreeRec\n")); if (!pScrn->driverPrivate) return; VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; if (pBIOSInfo) { if (pBIOSInfo->TVI2CDev) xf86DestroyI2CDevRec(pBIOSInfo->TVI2CDev, TRUE); pVia->pBIOSInfo = NULL; free(pBIOSInfo); } if (pVia->VideoRegs) free(pVia->VideoRegs); free(pScrn->driverPrivate); pScrn->driverPrivate = NULL; } /* VIAFreeRec */ /* * This only gets called when a screen is being deleted. It does not * get called routinely at the end of a server generation. */ static void VIAFreeScreen(FREE_SCREEN_ARGS_DECL) { SCRN_INFO_PTR(arg); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAFreeScreen\n")); if (xf86LoaderCheckSymbol("vgaHWFreeHWRec")) { vgaHWFreeHWRec(pScrn); } VIAFreeRec(pScrn); } static void VIAIdentify(int flags) { xf86PrintChipsets("OPENCHROME", "Driver for VIA Chrome chipsets", VIAChipsets); } #ifdef HAVE_PCIACCESS static Bool via_pci_probe(DriverPtr driver, int entity_num, struct pci_device *device, intptr_t match_data) { ScrnInfoPtr scrn = NULL; EntityInfoPtr entity; scrn = xf86ConfigPciEntity(scrn, 0, entity_num, VIAPciChipsets, NULL, NULL, NULL, NULL, NULL); if (scrn != NULL) { scrn->driverVersion = VIA_VERSION; scrn->driverName = DRIVER_NAME; scrn->name = "CHROME"; scrn->Probe = NULL; entity = xf86GetEntityInfo(entity_num); scrn->PreInit = viaPreInit; scrn->ScreenInit = VIAScreenInit; scrn->SwitchMode = VIASwitchMode; scrn->AdjustFrame = VIAAdjustFrame; scrn->EnterVT = VIAEnterVT; scrn->LeaveVT = VIALeaveVT; scrn->FreeScreen = VIAFreeScreen; xf86Msg(X_NOTICE, "VIA Technologies does not support this driver in any way.\n"); xf86Msg(X_NOTICE, "For support, please refer to" " https://www.freedesktop.org/wiki/Openchrome/.\n"); #ifdef BUILDCOMMENT xf86Msg(X_NOTICE, BUILDCOMMENT"\n"); #endif } return scrn != NULL; } #else /* !HAVE_PCIACCESS */ static Bool VIAProbe(DriverPtr drv, int flags) { GDevPtr *devSections; int *usedChips; int numDevSections; int numUsed; Bool foundScreen = FALSE; int i; /* sanity checks */ if ((numDevSections = xf86MatchDevice(DRIVER_NAME, &devSections)) <= 0) return FALSE; if (xf86GetPciVideoInfo() == NULL) return FALSE; numUsed = xf86MatchPciInstances(DRIVER_NAME, PCI_VIA_VENDOR_ID, VIAChipsets, VIAPciChipsets, devSections, numDevSections, drv, &usedChips); free(devSections); if (numUsed <= 0) return FALSE; xf86Msg(X_NOTICE, "VIA Technologies does not support this driver in any way.\n"); xf86Msg(X_NOTICE, "For support, please refer to" " https://www.freedesktop.org/wiki/Openchrome/.\n"); #ifdef BUILDCOMMENT xf86Msg(X_NOTICE, BUILDCOMMENT"\n"); #endif if (flags & PROBE_DETECT) { foundScreen = TRUE; } else { for (i = 0; i < numUsed; i++) { ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0); EntityInfoPtr pEnt; if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i], VIAPciChipsets, 0, 0, 0, 0, 0))) { pScrn->driverVersion = VIA_VERSION; pScrn->driverName = DRIVER_NAME; pScrn->name = "CHROME"; pScrn->Probe = VIAProbe; pScrn->PreInit = viaPreInit; pScrn->ScreenInit = VIAScreenInit; pScrn->SwitchMode = VIASwitchMode; pScrn->AdjustFrame = VIAAdjustFrame; pScrn->EnterVT = VIAEnterVT; pScrn->LeaveVT = VIALeaveVT; pScrn->FreeScreen = VIAFreeScreen; foundScreen = TRUE; } #if 0 xf86ConfigActivePciEntity(pScrn, usedChips[i], VIAPciChipsets, NULL, NULL, NULL, NULL, NULL); #endif pEnt = xf86GetEntityInfo(usedChips[i]); /* CLE266 supports dual-head; mark the entity as sharable. */ if (pEnt->chipset == VIA_CLE266 || pEnt->chipset == VIA_KM400) { static int instance = 0; DevUnion *pPriv; xf86SetEntitySharable(usedChips[i]); xf86SetEntityInstanceForScreen(pScrn, pScrn->entityList[0], instance); if (gVIAEntityIndex < 0) { gVIAEntityIndex = xf86AllocateEntityPrivateIndex(); pPriv = xf86GetEntityPrivate(pScrn->entityList[0], gVIAEntityIndex); if (!pPriv->ptr) { VIAEntPtr pVIAEnt; pPriv->ptr = xnfcalloc(sizeof(VIAEntRec), 1); pVIAEnt = pPriv->ptr; pVIAEnt->IsDRIEnabled = FALSE; pVIAEnt->BypassSecondary = FALSE; pVIAEnt->HasSecondary = FALSE; pVIAEnt->IsSecondaryRestored = FALSE; } } instance++; } free(pEnt); } } free(usedChips); return foundScreen; } /* VIAProbe */ #endif /* !HAVE_PCIACCESS */ static int LookupChipSet(PciChipsets *pset, int chipSet) { while (pset->numChipset >= 0) { if (pset->numChipset == chipSet) return pset->PCIid; pset++; } return -1; } static int LookupChipID(PciChipsets *pset, int ChipID) { /* Is there a function to do this for me? */ while (pset->numChipset >= 0) { if (pset->PCIid == ChipID) return pset->numChipset; pset++; } return -1; } static Bool VIASetupDefaultOptions(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIASetupDefaultOptions - Setting up default chipset options.\n")); pVia->shadowFB = FALSE; pVia->NoAccel = FALSE; pVia->noComposite = FALSE; pVia->useEXA = TRUE; pVia->exaScratchSize = VIA_SCRATCH_SIZE / 1024; pVia->drmmode.hwcursor = TRUE; pVia->VQEnable = TRUE; pVia->DRIIrqEnable = TRUE; pVia->agpEnable = TRUE; pVia->dma2d = TRUE; pVia->dmaXV = TRUE; #ifdef HAVE_DEBUG pVia->disableXvBWCheck = FALSE; #endif pVia->maxDriSize = 0; pVia->agpMem = AGP_SIZE / 1024; pVia->I2CDevices = VIA_I2C_BUS1 | VIA_I2C_BUS2 | VIA_I2C_BUS3; pVia->VideoEngine = VIDEO_ENGINE_CLE; #ifdef HAVE_DEBUG pVia->PrintVGARegs = FALSE; #endif /* Disable vertical interpolation because the size of */ /* line buffer (limited to 800) is too small to do interpolation. */ pVia->swov.maxWInterp = 800; pVia->swov.maxHInterp = 600; switch (pVia->Chipset) { case VIA_CLE266: break; case VIA_KM400: /* IRQ is not broken on KM400A, but testing (pVia->ChipRev < 0x80) * is not enough to make sure we have an older, broken KM400. */ pVia->DRIIrqEnable = FALSE; break; case VIA_K8M800: pVia->DRIIrqEnable = FALSE; break; case VIA_PM800: pVia->VideoEngine = VIDEO_ENGINE_CME; break; case VIA_P4M800PRO: break; case VIA_CX700: pVia->VideoEngine = VIDEO_ENGINE_CME; pVia->swov.maxWInterp = 1920; pVia->swov.maxHInterp = 1080; break; case VIA_P4M890: pVia->VideoEngine = VIDEO_ENGINE_CME; pVia->dmaXV = FALSE; break; case VIA_K8M890: pVia->VideoEngine = VIDEO_ENGINE_CME; pVia->agpEnable = FALSE; pVia->dmaXV = FALSE; break; case VIA_P4M900: pVia->VideoEngine = VIDEO_ENGINE_CME; pVia->agpEnable = FALSE; /* FIXME: this needs to be tested */ pVia->dmaXV = FALSE; break; case VIA_VX800: case VIA_VX855: case VIA_VX900: pVia->VideoEngine = VIDEO_ENGINE_CME; pVia->agpEnable = FALSE; pVia->dmaXV = FALSE; break; } return TRUE; } Bool VIAGetRec(ScrnInfoPtr pScrn) { Bool ret = FALSE; VIAPtr pVia; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetRec\n")); if (pScrn->driverPrivate) return TRUE; /* allocate VIARec */ pVia = (VIARec *) xnfcalloc(sizeof(VIARec), 1); if (pVia) { pVia->pBIOSInfo = xnfcalloc(sizeof(VIABIOSInfoRec), 1); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; if (pBIOSInfo) { pBIOSInfo->TVI2CDev = NULL; pVia->VideoRegs = (video_via_regs *) xnfcalloc(sizeof(video_via_regs), 1); if (!pVia->VideoRegs) { free(pBIOSInfo); free(pVia); } else { pScrn->driverPrivate = pVia; ret = TRUE; } } } return ret; } /* VIAGetRec */ static int map_legacy_formats(int bpp, int depth) { int fmt = DRM_FORMAT_XRGB8888; switch (bpp) { case 8: fmt = DRM_FORMAT_C8; break; case 16: if (depth == 15) fmt = DRM_FORMAT_XRGB1555; else fmt = DRM_FORMAT_RGB565; break; case 24: fmt = DRM_FORMAT_RGB888; break; case 32: if (depth == 24) fmt = DRM_FORMAT_XRGB8888; else if (depth == 30) fmt = DRM_FORMAT_XRGB2101010; default: break; } return fmt; } static Bool via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcPtr crtc = NULL; ScreenPtr screen = scrn->pScreen; VIAPtr pVia = VIAPTR(scrn); drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[0]->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; struct buffer_object *old_front = NULL; void *new_pixels = NULL; PixmapPtr ppix; int old_width, old_height, old_displayWidth, old_fd; uint32_t old_fb_id; int format, i; Bool ret = FALSE; DEBUG(xf86DrvMsg(scrn->scrnIndex, X_INFO, "Entered via_xf86crtc_resize.\n")); xf86DrvMsg(scrn->scrnIndex, X_INFO, "Now attempting to resize the screen . . .\n"); if ((scrn->virtualX == width) && (scrn->virtualY == height)) { xf86DrvMsg(scrn->scrnIndex, X_INFO, "It was determined that there is no need to resize the " "screen.\n"); DEBUG(xf86DrvMsg(scrn->scrnIndex, X_INFO, "Exiting via_xf86crtc_resize.\n")); return TRUE; } /* Preserve the old screen information just in case they need to * be restored. */ old_width = scrn->virtualX; old_height = scrn->virtualY; old_displayWidth = scrn->displayWidth; old_fd = drmmode->fd; old_fb_id = drmmode->fb_id; old_front = drmmode->front_bo; format = map_legacy_formats(scrn->bitsPerPixel, scrn->depth); drmmode->front_bo = drm_bo_alloc_surface(scrn, width, height, format, 16, TTM_PL_FLAG_VRAM); if (!drmmode->front_bo) { goto fail; } xf86DrvMsg(scrn->scrnIndex, X_INFO, "Allocated a new frame buffer: %dx%d\n", width, height); new_pixels = drm_bo_map(scrn, drmmode->front_bo); if (!new_pixels) { goto fail; } if (pVia->shadowFB) { new_pixels = malloc(height * drmmode->front_bo->pitch); if (!new_pixels) { goto fail; } free(pVia->ShadowPtr); pVia->ShadowPtr = new_pixels; } scrn->virtualX = width; scrn->virtualY = height; scrn->displayWidth = (drmmode->front_bo->pitch) / ((scrn->bitsPerPixel + 7) >> 3); ppix = screen->GetScreenPixmap(screen); if (!screen->ModifyPixmapHeader(ppix, width, height, -1, -1, drmmode->front_bo->pitch, new_pixels)) { goto fail; } #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,9,99,1,0) scrn->pixmapPrivate.ptr = ppix->devPrivate.ptr; #endif for (i = 0; i < xf86_config->num_crtc; i++) { crtc = xf86_config->crtc[i]; if (!xf86CrtcInUse(crtc)) { continue; } ret = xf86CrtcSetMode(crtc, &crtc->desiredMode, crtc->desiredRotation, crtc->desiredX, crtc->desiredY); if (!ret) { xf86DrvMsg(scrn->scrnIndex, X_INFO, "Mode setting failed.\n"); goto fail; } } #ifdef HAVE_DRI if (pVia->KMS && old_fb_id) { drmModeRmFB(old_fd, old_fb_id); } #endif if (old_front) { drm_bo_unmap(scrn, old_front); drm_bo_free(scrn, old_front); } xf86DrvMsg(scrn->scrnIndex, X_INFO, "Screen resize successful.\n"); DEBUG(xf86DrvMsg(scrn->scrnIndex, X_INFO, "Exiting via_xf86crtc_resize.\n")); return TRUE; fail: if (drmmode->front_bo) { drm_bo_unmap(scrn, drmmode->front_bo); drm_bo_free(scrn, drmmode->front_bo); } scrn->virtualX = old_width; scrn->virtualY = old_height; scrn->displayWidth = old_displayWidth; #ifdef HAVE_DRI if (pVia->KMS && (old_fb_id != drmmode->fb_id)) { drmModeRmFB(old_fd, old_fb_id); } #endif drmmode->fd = old_fd; drmmode->fb_id = old_fb_id; drmmode->front_bo = old_front; xf86DrvMsg(scrn->scrnIndex, X_INFO, "An error occurred during screen resize.\n"); DEBUG(xf86DrvMsg(scrn->scrnIndex, X_INFO, "Exiting via_xf86crtc_resize.\n")); return FALSE; } static const xf86CrtcConfigFuncsRec via_xf86crtc_config_funcs = { via_xf86crtc_resize }; static Bool viaPreInit(ScrnInfoPtr pScrn, int flags) { XF86OptionPtr option = xf86NewOption("MigrationHeuristic", "greedy"); EntityInfoPtr pEnt; VIAPtr pVia; VIABIOSInfoPtr pBIOSInfo; MessageType from = X_DEFAULT; const char *s = NULL; #ifdef HAVE_DRI char *busId = NULL; drmVersionPtr drmVer; #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "viaPreInit\n")); if (pScrn->numEntities > 1) return FALSE; if (flags & PROBE_DETECT) return FALSE; if (!VIAGetRec(pScrn)) { return FALSE; } pVia = VIAPTR(pScrn); pVia->IsSecondary = FALSE; pEnt = xf86GetEntityInfo(pScrn->entityList[0]); #ifndef HAVE_PCIACCESS if (pEnt->resources) { free(pEnt); VIAFreeRec(pScrn); return FALSE; } #endif pVia->EntityIndex = pEnt->index; if (xf86IsEntityShared(pScrn->entityList[0])) { if (xf86IsPrimInitDone(pScrn->entityList[0])) { DevUnion *pPriv; VIAEntPtr pVIAEnt; VIAPtr pVia1; pVia->IsSecondary = TRUE; pPriv = xf86GetEntityPrivate(pScrn->entityList[0], gVIAEntityIndex); pVIAEnt = pPriv->ptr; if (pVIAEnt->BypassSecondary) { free(pEnt); VIAFreeRec(pScrn); return FALSE; } pVIAEnt->pSecondaryScrn = pScrn; pVIAEnt->HasSecondary = TRUE; pVia1 = VIAPTR(pVIAEnt->pPrimaryScrn); pVia1->HasSecondary = TRUE; pVia->sharedData = pVia1->sharedData; } else { DevUnion *pPriv; VIAEntPtr pVIAEnt; xf86SetPrimInitDone(pScrn->entityList[0]); pPriv = xf86GetEntityPrivate(pScrn->entityList[0], gVIAEntityIndex); pVia->sharedData = xnfcalloc(sizeof(ViaSharedRec), 1); pVIAEnt = pPriv->ptr; pVIAEnt->pPrimaryScrn = pScrn; pVIAEnt->IsDRIEnabled = FALSE; pVIAEnt->BypassSecondary = FALSE; pVIAEnt->HasSecondary = FALSE; pVIAEnt->RestorePrimary = FALSE; pVIAEnt->IsSecondaryRestored = FALSE; } } else { pVia->sharedData = xnfcalloc(sizeof(ViaSharedRec), 1); } pVia->PciInfo = xf86GetPciInfoForEntity(pEnt->index); #ifndef HAVE_PCIACCESS xf86RegisterResources(pEnt->index, NULL, ResNone); #endif if (pEnt->device->chipset && *pEnt->device->chipset) { from = X_CONFIG; pScrn->chipset = pEnt->device->chipset; pVia->Chipset = xf86StringToToken(VIAChipsets, pScrn->chipset); pVia->ChipId = LookupChipSet(VIAPciChipsets, pVia->Chipset); } else if (pEnt->device->chipID >= 0) { from = X_CONFIG; pVia->ChipId = pEnt->device->chipID; pVia->Chipset = LookupChipID(VIAPciChipsets, pVia->ChipId); pScrn->chipset = (char *)xf86TokenToString(VIAChipsets, pVia->Chipset); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n", pEnt->device->chipID); } else { from = X_PROBED; pVia->ChipId = DEVICE_ID(pVia->PciInfo); pVia->Chipset = LookupChipID(VIAPciChipsets, pVia->ChipId); pScrn->chipset = (char *)xf86TokenToString(VIAChipsets, pVia->Chipset); } xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: %s\n", pScrn->chipset); if (pEnt->device->chipRev >= 0) { pVia->ChipRev = pEnt->device->chipRev; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", pVia->ChipRev); } else { /* Read PCI bus 0, dev 0, function 0, index 0xF6 to get chip revision */ #ifdef HAVE_PCIACCESS struct pci_device *bridge = pci_device_get_parent_bridge(pVia->PciInfo); uint8_t rev = 0; pci_device_cfg_read_u8(bridge, &rev, 0xF6); pVia->ChipRev = rev; #else pVia->ChipRev = pciReadByte(pciTag(0, 0, 0), 0xF6); #endif } if (pEnt) free(pEnt); xf86DrvMsg(pScrn->scrnIndex, from, "Chipset revision: %d\n", pVia->ChipRev); pVia->directRenderingType = DRI_NONE; pVia->KMS = FALSE; #ifdef HAVE_DRI busId = DRICreatePCIBusID(pVia->PciInfo); pVia->drmmode.fd = drmOpen("via", busId); if (pVia->drmmode.fd != -1) { if (!drmCheckModesettingSupported(busId)) { xf86DrvMsg(-1, X_INFO, "[drm] KMS supported\n"); pVia->KMS = TRUE; } else xf86DrvMsg(-1, X_INFO, "[drm] KMS not enabled\n"); drmVer = drmGetVersion(pVia->drmmode.fd); if (drmVer) { pVia->drmVerMajor = drmVer->version_major; pVia->drmVerMinor = drmVer->version_minor; pVia->drmVerPL = drmVer->version_patchlevel; drmFreeVersion(drmVer); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] via interface version: %d.%d.%d\n", pVia->drmVerMajor, pVia->drmVerMinor, pVia->drmVerPL); /* DRI2 or DRI1 support */ if ((pVia->drmVerMajor < drmExpected.major) || (pVia->drmVerMajor > drmCompat.major) || ((pVia->drmVerMajor == drmExpected.major) && (pVia->drmVerMinor < drmExpected.minor))) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[drm] Kernel drm is not compatible with this driver.\n" "[drm] Kernel drm version is %d.%d.%d, " "and I can work with versions %d.%d.x - %d.x.x.\n" "[drm] Update either this 2D driver or your kernel DRM. " "Disabling DRI.\n", pVia->drmVerMajor, pVia->drmVerMinor, pVia->drmVerPL, drmExpected.major, drmExpected.minor, drmCompat.major); } else { /* DRI2 or DRI1 support */ if (pVia->drmVerMajor < drmCompat.major) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DRI 1 api supported\n"); pVia->directRenderingType = DRI_1; } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DRI 2 api not supported yet\n"); pVia->directRenderingType = DRI_2; pVia->NoAccel = TRUE; } } } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Could not get DRM driver version\n"); } } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] Failed to open DRM device for %s: %s\n", busId, strerror(errno)); } free(busId); #endif /* After umsPreInit function succeeds, PCI hardware resources are * memory mapped. If there is an error from this point on, they will * need to be explicitly relinquished. */ if (!umsPreInit(pScrn)) { VIAFreeRec(pScrn); return FALSE; } /* Now handle the Display */ if (flags & PROBE_DETECT) return TRUE; pScrn->monitor = pScrn->confScreen->monitor; /* * We support depths of 8, 16 and 24. * We support bpp of 8, 16, and 32. */ if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support32bppFb)) { goto fail; } else { switch (pScrn->depth) { case 8: case 16: case 24: case 32: /* OK */ break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given depth (%d) is not supported by this driver\n", pScrn->depth); goto fail; } } xf86PrintDepthBpp(pScrn); if (pScrn->depth == 32) { pScrn->depth = 24; } if (pScrn->depth > 8) { rgb zeros = { 0, 0, 0 }; if (!xf86SetWeight(pScrn, zeros, zeros)) { goto fail; } else { /* TODO check weight returned is supported */ } } if (!xf86SetDefaultVisual(pScrn, -1)) { goto fail; } else { /* We don't currently support DirectColor at > 8bpp */ if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual" " (%s) is not supported at depth %d.\n", xf86GetVisualName(pScrn->defaultVisual), pScrn->depth); goto fail; } } /* We use a programmable clock */ pScrn->progClock = TRUE; xf86CollectOptions(pScrn, option); /* Set the bits per RGB for 8bpp mode */ if (pScrn->depth == 8) pScrn->rgbBits = 6; if (!VIASetupDefaultOptions(pScrn)) { goto fail; } xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, VIAOptions); if (xf86GetOptValInteger(VIAOptions, OPTION_VIDEORAM, &pScrn->videoRam)) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Setting amount of VideoRAM to %d kB\n", pScrn->videoRam); /* When rotating, switch shadow framebuffer on and acceleration off. */ if ((s = xf86GetOptValString(VIAOptions, OPTION_ROTATION_TYPE))) { if (!xf86NameCmp(s, "SWRandR")) { pVia->shadowFB = TRUE; pVia->NoAccel = TRUE; pVia->RandRRotation = TRUE; pVia->rotate = RR_Rotate_0; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen " "RandR enabled, acceleration disabled\n"); } else if (!xf86NameCmp(s, "HWRandR")) { pVia->shadowFB = TRUE; pVia->NoAccel = TRUE; pVia->RandRRotation = TRUE; pVia->rotate = RR_Rotate_0; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Hardware accelerated " "rotating screen is not implemented. Using SW RandR.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid" "value for Option \"RotationType\".\n", s); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Valid options are \"SWRandR\" and \"HWRandR\".\n"); } } /* When rotating, switch shadow framebuffer on and acceleration off. */ if ((s = xf86GetOptValString(VIAOptions, OPTION_ROTATE))) { if (!xf86NameCmp(s, "CW")) { pVia->shadowFB = TRUE; pVia->NoAccel = TRUE; pVia->RandRRotation = TRUE; pVia->rotate = RR_Rotate_270; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen " "clockwise -- acceleration is disabled.\n"); } else if (!xf86NameCmp(s, "CCW")) { pVia->shadowFB = TRUE; pVia->NoAccel = TRUE; pVia->RandRRotation = TRUE; pVia->rotate = RR_Rotate_90; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen " "counterclockwise -- acceleration is disabled.\n"); } else if (!xf86NameCmp(s, "UD")) { pVia->shadowFB = TRUE; pVia->NoAccel = TRUE; pVia->RandRRotation = TRUE; pVia->rotate = RR_Rotate_180; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen " "upside-down -- acceleration is disabled.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid" "value for Option \"Rotate\".\n", s); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Valid options are \"CW\", \"CCW\" or \"UD\".\n"); } } from = (xf86GetOptValBool(VIAOptions, OPTION_SHADOW_FB, &pVia->shadowFB) ? X_CONFIG : X_DEFAULT); xf86DrvMsg(pScrn->scrnIndex, from, "Shadow framebuffer is %s.\n", pVia->shadowFB ? "enabled" : "disabled"); /* Use hardware acceleration, unless on shadow framebuffer. */ from = (xf86GetOptValBool(VIAOptions, OPTION_NOACCEL, &pVia->NoAccel) ? X_CONFIG : X_DEFAULT); if (!pVia->NoAccel && pVia->shadowFB) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Acceleration is " "not supported when using shadow framebuffer.\n"); pVia->NoAccel = TRUE; from = X_DEFAULT; } /* Disable EXA for KMS case */ if (pVia->KMS) pVia->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, from, "Hardware acceleration is %s.\n", !pVia->NoAccel ? "enabled" : "disabled"); if (!pVia->NoAccel) { from = X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "Using EXA acceleration architecture.\n"); //pVia->noComposite = FALSE; if (pVia->useEXA) { from = xf86GetOptValBool(VIAOptions, OPTION_EXA_NOCOMPOSITE, &pVia->noComposite) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "EXA composite acceleration %s.\n", !pVia->noComposite ? "enabled" : "disabled"); //pVia->exaScratchSize = VIA_SCRATCH_SIZE / 1024; from = xf86GetOptValInteger(VIAOptions, OPTION_EXA_SCRATCH_SIZE, &pVia->exaScratchSize) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "EXA scratch area size is %d kB.\n", pVia->exaScratchSize); } } /* Use a hardware cursor, unless on secondary or on shadow framebuffer. */ from = X_DEFAULT; if (pVia->IsSecondary || pVia->shadowFB) pVia->drmmode.hwcursor = FALSE; else if (xf86GetOptValBool(VIAOptions, OPTION_SWCURSOR, &pVia->drmmode.hwcursor)) { pVia->drmmode.hwcursor = !pVia->drmmode.hwcursor; from = X_CONFIG; } if (pVia->drmmode.hwcursor) xf86DrvMsg(pScrn->scrnIndex, from, "Using hardware two-color " "cursors and software full-color cursors.\n"); else xf86DrvMsg(pScrn->scrnIndex, from, "Using software cursors.\n"); //pVia->VQEnable = TRUE; from = xf86GetOptValBool(VIAOptions, OPTION_DISABLEVQ, &pVia->VQEnable) ? X_CONFIG : X_DEFAULT; if (from == X_CONFIG) pVia->VQEnable = !pVia->VQEnable; xf86DrvMsg(pScrn->scrnIndex, from, "GPU virtual command queue will be %s.\n", (pVia->VQEnable) ? "enabled" : "disabled"); //pVia->DRIIrqEnable = TRUE; from = xf86GetOptValBool(VIAOptions, OPTION_DISABLEIRQ, &pVia->DRIIrqEnable) ? X_CONFIG : X_DEFAULT; if (from == X_CONFIG) pVia->DRIIrqEnable = !pVia->DRIIrqEnable; xf86DrvMsg(pScrn->scrnIndex, from, "DRI IRQ will be %s if DRI is enabled.\n", (pVia->DRIIrqEnable) ? "enabled" : "disabled"); //pVia->agpEnable = FALSE; from = xf86GetOptValBool(VIAOptions, OPTION_AGP_DMA, &pVia->agpEnable) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "AGP DMA will be %s if DRI is enabled.\n", (pVia->agpEnable) ? "enabled" : "disabled"); //pVia->dma2d = TRUE; if (pVia->agpEnable) { from = xf86GetOptValBool(VIAOptions, OPTION_2D_DMA, &pVia->dma2d) ? X_CONFIG : X_DEFAULT; if (from == X_CONFIG) pVia->dma2d = !pVia->dma2d; xf86DrvMsg(pScrn->scrnIndex, from, "AGP DMA will %sbe used for " "2D acceleration.\n", (pVia->dma2d) ? "" : "not "); } //pVia->dmaXV = TRUE; from = xf86GetOptValBool(VIAOptions, OPTION_XV_DMA, &pVia->dmaXV) ? X_CONFIG : X_DEFAULT; if (from == X_CONFIG) pVia->dmaXV = !pVia->dmaXV; xf86DrvMsg(pScrn->scrnIndex, from, "PCI DMA will %sbe used for XV " "image transfer if DRI is enabled.\n", (pVia->dmaXV) ? "" : "not "); #ifdef HAVE_DEBUG //pVia->disableXvBWCheck = FALSE; from = xf86GetOptValBool(VIAOptions, OPTION_DISABLE_XV_BW_CHECK, &pVia->disableXvBWCheck) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "Xv Bandwidth check is %s.\n", pVia->disableXvBWCheck ? "disabled" : "enabled"); if (pVia->disableXvBWCheck) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "You may get a \"snowy\" screen" " when using the Xv overlay.\n"); } #endif //pVia->maxDriSize = 0; from = xf86GetOptValInteger(VIAOptions, OPTION_MAX_DRIMEM, &pVia->maxDriSize) ? X_CONFIG : X_DEFAULT; if (pVia->maxDriSize > 0) xf86DrvMsg(pScrn->scrnIndex, from, "Will impose a %d kB limit on video RAM reserved for DRI.\n", pVia->maxDriSize); else xf86DrvMsg(pScrn->scrnIndex, from, "Will not impose a limit on video RAM reserved for DRI.\n"); //pVia->agpMem = AGP_SIZE / 1024; from = xf86GetOptValInteger(VIAOptions, OPTION_AGPMEM, &pVia->agpMem) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "Will try to allocate %d kB of AGP memory.\n", pVia->agpMem); pBIOSInfo = pVia->pBIOSInfo; pBIOSInfo->TVDotCrawl = FALSE; from = xf86GetOptValBool(VIAOptions, OPTION_TVDOTCRAWL, &pBIOSInfo->TVDotCrawl) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "TV dotCrawl is %s.\n", pBIOSInfo->TVDotCrawl ? "enabled" : "disabled"); /* TV Deflicker */ pBIOSInfo->TVDeflicker = 0; from = xf86GetOptValInteger(VIAOptions, OPTION_TVDEFLICKER, &pBIOSInfo->TVDeflicker) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "TV deflicker is set to %d.\n", pBIOSInfo->TVDeflicker); pBIOSInfo->TVType = TVTYPE_NONE; if ((s = xf86GetOptValString(VIAOptions, OPTION_TVTYPE))) { if (!xf86NameCmp(s, "NTSC")) { pBIOSInfo->TVType = TVTYPE_NTSC; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is NTSC.\n"); } else if (!xf86NameCmp(s, "PAL")) { pBIOSInfo->TVType = TVTYPE_PAL; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is PAL.\n"); } else if (!xf86NameCmp(s, "480P")) { pBIOSInfo->TVType = TVTYPE_480P; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is SDTV 480P.\n"); } else if (!xf86NameCmp(s, "576P")) { pBIOSInfo->TVType = TVTYPE_576P; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is SDTV 576P.\n"); } else if (!xf86NameCmp(s, "720P")) { pBIOSInfo->TVType = TVTYPE_720P; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is HDTV 720P.\n"); } else if (!xf86NameCmp(s, "1080I")) { pBIOSInfo->TVType = TVTYPE_1080I; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is HDTV 1080i.\n"); } } else { xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "No default TV type is set.\n"); } /* TV output signal Option */ pBIOSInfo->TVOutput = TVOUTPUT_NONE; if ((s = xf86GetOptValString(VIAOptions, OPTION_TVOUTPUT))) { if (!xf86NameCmp(s, "S-Video")) { pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is S-Video.\n"); } else if (!xf86NameCmp(s, "Composite")) { pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is Composite.\n"); } else if (!xf86NameCmp(s, "SC")) { pBIOSInfo->TVOutput = TVOUTPUT_SC; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is SC.\n"); } else if (!xf86NameCmp(s, "RGB")) { pBIOSInfo->TVOutput = TVOUTPUT_RGB; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is RGB.\n"); } else if (!xf86NameCmp(s, "YCbCr")) { pBIOSInfo->TVOutput = TVOUTPUT_YCBCR; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is YCbCr.\n"); } } else { xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "No default TV output signal type is set.\n"); } VIAVidHWDiffInit(pScrn); #ifdef HAVE_DEBUG //pVia->PrintVGARegs = FALSE; from = xf86GetOptValBool(VIAOptions, OPTION_PRINTVGAREGS, &pVia->PrintVGARegs) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "Will %sprint VGA registers.\n", pVia->PrintVGARegs ? "" : "not "); if (pVia->PrintVGARegs) ViaVgahwPrint(VGAHWPTR(pScrn)); /* Do this as early as possible */ pVia->I2CScan = FALSE; from = xf86GetOptValBool(VIAOptions, OPTION_I2CSCAN, &pVia->I2CScan) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "Will %sscan I2C buses.\n", pVia->I2CScan ? "" : "not "); #endif /* HAVE_DEBUG */ /* Checking for VIA Technologies NanoBook reference design. Examples include Everex CloudBook and Sylvania g netbook. It is also called FIC CE260 and CE261 by its ODM (Original Design Manufacturer) name. This device has its strapping resistors set to a wrong setting to handle DVI. As a result, we need to make special accommodations to handle DVI properly. */ if ((pVia->Chipset == VIA_CX700) && (SUBVENDOR_ID(pVia->PciInfo) == 0x1509) && (SUBSYS_ID(pVia->PciInfo) == 0x2D30)) { pVia->isVIANanoBook = TRUE; } else { pVia->isVIANanoBook = FALSE; } /* Checking for OLPC XO-1.5. */ if ((pVia->Chipset == VIA_VX855) && (SUBVENDOR_ID(pVia->PciInfo) == 0x152D) && (SUBSYS_ID(pVia->PciInfo) == 0x0833)) { pVia->IsOLPCXO15 = TRUE; } else { pVia->IsOLPCXO15 = FALSE; } /* I2CDevices Option for I2C Initialization */ if ((s = xf86GetOptValString(VIAOptions, OPTION_I2CDEVICES))) { pVia->I2CDevices = 0; if (strstr(s, "Bus1")) pVia->I2CDevices |= VIA_I2C_BUS1; if (strstr(s, "Bus2")) pVia->I2CDevices |= VIA_I2C_BUS2; if (strstr(s, "Bus3")) pVia->I2CDevices |= VIA_I2C_BUS3; } if (pVia->IsOLPCXO15) { pVia->I2CDevices &= ~VIA_I2C_BUS2; } /* CRTC handling */ xf86CrtcConfigInit(pScrn, &via_xf86crtc_config_funcs); if (pVia->KMS) { if (!KMSCrtcInit(pScrn, &pVia->drmmode)) { goto fail; } } else { if (!umsCrtcInit(pScrn)) { goto fail; } } if (!xf86InitialConfiguration(pScrn, TRUE)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Initial configuration failed\n"); goto fail; } if (!pScrn->modes) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); goto fail; } /* Initialize the colormap */ Gamma zeros = { 0.0, 0.0, 0.0 }; if (!xf86SetGamma(pScrn, zeros)) { goto fail; } /* Set up screen parameters. */ pVia->Bpp = pScrn->bitsPerPixel >> 3; pVia->Bpl = pScrn->virtualX * pVia->Bpp; /* Set the current mode to the first in the list */ pScrn->currentMode = pScrn->modes; /* Set display resolution */ xf86SetDpi(pScrn, 0, 0); if (xf86LoadSubModule(pScrn, "fb") == NULL) { goto fail; } if (!pVia->NoAccel) { 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 fail; } } if (pVia->shadowFB) { if (!xf86LoadSubModule(pScrn, "shadow")) { goto fail; } } return TRUE; fail: viaUnmapMMIO(pScrn); VIAFreeRec(pScrn); return FALSE; } static void LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); CARD16 lut_r[256], lut_g[256], lut_b[256]; int i, j, k, index; for (k = 0; k < xf86_config->num_crtc; k++) { xf86CrtcPtr crtc = xf86_config->crtc[k]; switch (pScrn->depth) { case 15: for (i = 0; i < numColors; i++) { index = indices[i]; for (j = 0; j < 8; j++) { lut_r[index * 8 + j] = colors[index].red << 8; lut_g[index * 8 + j] = colors[index].green << 8; lut_b[index * 8 + j] = colors[index].blue << 8; } } break; case 16: for (i = 0; i < numColors; i++) { index = indices[i]; if (index <= 31) { for (j = 0; j < 8; j++) { lut_r[index * 8 + j] = colors[index].red << 8; lut_b[index * 8 + j] = colors[index].blue << 8; } } for (j = 0; j < 4; j++) lut_g[index * 4 + j] = colors[index].green << 8; } break; default: for (i = 0; i < numColors; i++) { index = indices[i]; lut_r[index] = colors[index].red << 8; lut_g[index] = colors[index].green << 8; lut_b[index] = colors[index].blue << 8; } break; } /* Make the change through RandR */ #ifdef RANDR_12_INTERFACE RRCrtcGammaSet(crtc->randr_crtc, lut_r, lut_g, lut_b); #else /*RANDR_12_INTERFACE*/ crtc->funcs->gamma_set(crtc, lut_r, lut_g, lut_b, 256); #endif } } static void * viaShadowWindow(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); int stride; stride = (pScrn->displayWidth * pScrn->bitsPerPixel) / 8; *size = stride; return ((uint8_t *) drm_bo_map(pScrn, pVia->drmmode.front_bo) + row * stride + offset); } static Bool VIACreateScreenResources(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); PixmapPtr rootPixmap; void *surface; pScreen->CreateScreenResources = pVia->CreateScreenResources; if (!(*pScreen->CreateScreenResources)(pScreen)) return FALSE; pScreen->CreateScreenResources = VIACreateScreenResources; rootPixmap = pScreen->GetScreenPixmap(pScreen); #ifdef HAVE_DRI drmmode_uevent_init(pScrn, &pVia->drmmode); #endif surface = drm_bo_map(pScrn, pVia->drmmode.front_bo); if (!surface) return FALSE; if (pVia->shadowFB) surface = pVia->ShadowPtr; if (!pScreen->ModifyPixmapHeader(rootPixmap, pScrn->virtualX, pScrn->virtualY, -1, -1, pVia->drmmode.front_bo->pitch, surface)) return FALSE; if (pVia->shadowFB) { if (!shadowAdd(pScreen, rootPixmap, shadowUpdatePackedWeak(), viaShadowWindow, 0, NULL)) return FALSE; } return TRUE; } static Bool VIACloseScreen(CLOSE_SCREEN_ARGS_DECL) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIACloseScreen\n")); if (pVia->directRenderingType != DRI_2) viaExitVideo(pScrn); viaExitAccel(pScreen); if (pVia->ShadowPtr) { shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen)); free(pVia->ShadowPtr); pVia->ShadowPtr = NULL; } /* Is the display currently visible? */ if (pScrn->vtSema) VIALeaveVT(VT_FUNC_ARGS(0)); #ifdef HAVE_DRI drmmode_uevent_fini(pScrn, &pVia->drmmode); #endif xf86_cursors_fini(pScreen); for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; drmmode_crtc_private_ptr iga = crtc->driver_private; if (iga->cursor_bo) drm_bo_free(pScrn, iga->cursor_bo); } if (pVia->drmmode.front_bo) { #ifdef HAVE_DRI if (pVia->KMS && pVia->drmmode.fb_id) drmModeRmFB(pVia->drmmode.fd, pVia->drmmode.fb_id); #endif pVia->drmmode.fb_id = 0; drm_bo_free(pScrn, pVia->drmmode.front_bo); } #ifdef HAVE_DRI if (pVia->directRenderingType == DRI_1) VIADRICloseScreen(pScreen); if (pVia->KMS) { drmmode_uevent_fini(pScrn, &pVia->drmmode); if (drmDropMaster(pVia->drmmode.fd)) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "drmDropMaster failed: %s\n", strerror(errno)); } #endif pScrn->vtSema = FALSE; pScreen->CloseScreen = pVia->CloseScreen; return (*pScreen->CloseScreen) (CLOSE_SCREEN_ARGS); } static Bool VIAScreenInit(SCREEN_INIT_ARGS_DECL) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); int format; pScrn->pScreen = pScreen; pScrn->displayWidth = pScrn->virtualX; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAScreenInit\n")); #ifdef HAVE_DRI if (pVia->KMS) { if (drmSetMaster(pVia->drmmode.fd)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "drmSetMaster failed: %s\n", strerror(errno)); } } if (pVia->drmmode.fd != -1) { if (pVia->directRenderingType == DRI_1) { /* DRI2 or DRI1 support */ if (VIADRI1ScreenInit(pScreen)) DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DRI1 ScreenInit commplete\n")); else pVia->directRenderingType = DRI_NONE; } } #endif if (!drm_bo_manager_init(pScrn)) return FALSE; format = map_legacy_formats(pScrn->bitsPerPixel, pScrn->depth); pVia->drmmode.front_bo = drm_bo_alloc_surface(pScrn, pScrn->virtualX, pScrn->virtualY, format, 16, TTM_PL_FLAG_VRAM); if (!pVia->drmmode.front_bo) return FALSE; if (!drm_bo_map(pScrn, pVia->drmmode.front_bo)) return FALSE; if (!pVia->NoAccel && !umsAccelInit(pScrn->pScreen)) return FALSE; miClearVisualTypes(); if (pScrn->bitsPerPixel > 8 && !pVia->IsSecondary) { if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; if (!miSetPixmapDepths()) return FALSE; } else { if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; if (!miSetPixmapDepths()) return FALSE; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Visuals set up\n")); if (pVia->shadowFB) { int pitch = BitmapBytePad(pScrn->bitsPerPixel * pScrn->virtualX); pVia->shadowFB = FALSE; pVia->ShadowPtr = malloc(pitch * pScrn->virtualY); if (pVia->ShadowPtr) { if (shadowSetup(pScreen)) pVia->shadowFB = TRUE; } } if (!fbScreenInit(pScreen, NULL, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth, pScrn->bitsPerPixel)) return FALSE; xf86SetBlackWhitePixels(pScreen); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- B & W\n")); if (pScrn->bitsPerPixel > 8) { VisualPtr visual; visual = pScreen->visuals + pScreen->numVisuals; while (--visual >= pScreen->visuals) { if ((visual->class | DynamicClass) == DirectColor) { visual->offsetRed = pScrn->offset.red; visual->offsetGreen = pScrn->offset.green; visual->offsetBlue = pScrn->offset.blue; visual->redMask = pScrn->mask.red; visual->greenMask = pScrn->mask.green; visual->blueMask = pScrn->mask.blue; } } } /* Must be after RGB ordering is fixed. */ fbPictureInit(pScreen, NULL, 0); if (!pVia->NoAccel && !viaInitExa(pScreen)) return FALSE; xf86SetBackingStore(pScreen); #if 0 xf86SetSilkenMouse(pScreen); #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Backing store set up\n")); miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- SW cursor set up\n")); if (pVia->drmmode.hwcursor) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int flags = (HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | HARDWARE_CURSOR_TRUECOLOR_AT_8BPP); int cursorSize, size, i = 0; switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: flags |= HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1; size = 32; cursorSize = ((size * size) >> 3) * 2; break; default: DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "HWCursor ARGB enabled\n")); flags |= (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 | HARDWARE_CURSOR_ARGB); size = 64; cursorSize = (size * size) << 2; break; } for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; drmmode_crtc_private_ptr iga = crtc->driver_private; /* Set cursor location in frame buffer. */ iga->cursor_bo = drm_bo_alloc(pScrn, cursorSize, 16, TTM_PL_FLAG_VRAM); } if (!xf86_cursors_init(pScreen, size, size, flags)) { pVia->drmmode.hwcursor = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware cursor initialization failed\n"); } } pScrn->vtSema = TRUE; pScreen->SaveScreen = xf86SaveScreen; pVia->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = VIACloseScreen; pVia->CreateScreenResources = pScreen->CreateScreenResources; pScreen->CreateScreenResources = VIACreateScreenResources; if (!xf86CrtcScreenInit(pScreen)) return FALSE; if (!miCreateDefColormap(pScreen)) return FALSE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Def Color map set up\n")); if (!xf86HandleColormaps(pScreen, 256, 8, LoadPalette, NULL, CMAP_RELOAD_ON_MODE_SWITCH | CMAP_PALETTED_TRUECOLOR)) return FALSE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Palette loaded\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Color maps etc. set up\n")); xf86DPMSInit(pScreen, xf86DPMSSet, 0); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- DPMS set up\n")); if (!VIAEnterVT_internal(pScrn, 1)) return FALSE; if (pVia->directRenderingType != DRI_2) { #ifdef HAVE_DRI if (pVia->directRenderingType == DRI_1) { if (!VIADRIFinishScreenInit(pScreen)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "direct rendering disabled\n"); pVia->directRenderingType = DRI_NONE; } else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "direct rendering enabled\n"); } #endif if (!pVia->NoAccel) viaFinishInitAccel(pScreen); viaInitVideo(pScrn->pScreen); } if (serverGeneration == 1) xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); #ifdef HAVE_DEBUG if (pVia->PrintVGARegs) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAScreenInit: Printing VGA registers.\n"); ViaVgahwPrint(VGAHWPTR(pScrn)); } if (pVia->PrintTVRegs) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAScreenInit: Printing TV registers.\n"); ViaTVPrintRegs(pScrn); } #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Done\n")); return TRUE; } xf86-video-openchrome-0.6.0/src/via_exa.c0000664000175000017500000007404012760724526015063 00000000000000/* * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. * Copyright 2006 Thomas Hellström. 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 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. */ /* * 2D acceleration functions for the VIA/S3G UniChrome IGPs. * * Mostly rewritten, and modified for EXA support, by Thomas Hellström. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "miline.h" #include #include #include "via_driver.h" #include "via_regs.h" #include "via_dmabuffer.h" #include "via_rop.h" /* * Use PCI MMIO to flush the command buffer when AGP DMA is not available. */ static void viaDumpDMA(ViaCommandBuffer *cb) { register CARD32 *bp = cb->buf; CARD32 *endp = bp + cb->pos; while (bp != endp) { if (((bp - cb->buf) & 3) == 0) { ErrorF("\n %04lx: ", (unsigned long)(bp - cb->buf)); } ErrorF("0x%08x ", (unsigned)*bp++); } ErrorF("\n"); } void viaFlushPCI(ViaCommandBuffer *cb) { register CARD32 *bp = cb->buf; CARD32 transSetting; CARD32 *endp = bp + cb->pos; unsigned loop = 0; register CARD32 offset = 0; register CARD32 value; VIAPtr pVia = VIAPTR(cb->pScrn); while (bp < endp) { if (*bp == HALCYON_HEADER2) { if (++bp == endp) return; VIASETREG(VIA_REG_TRANSET, transSetting = *bp++); while (bp < endp) { if ((transSetting != HC_ParaType_CmdVdata) && ((*bp == HALCYON_HEADER2) || (*bp & HALCYON_HEADER1MASK) == HALCYON_HEADER1)) break; VIASETREG(VIA_REG_TRANSPACE, *bp++); } } else if ((*bp & HALCYON_HEADER1MASK) == HALCYON_HEADER1) { while (bp < endp) { if (*bp == HALCYON_HEADER2) break; if (offset == 0) { /* * Not doing this wait will probably stall the processor * for an unacceptable amount of time in VIASETREG while * other high priority interrupts may be pending. */ switch (pVia->Chipset) { case VIA_VX800: case VIA_VX855: case VIA_VX900: while ((VIAGETREG(VIA_REG_STATUS) & (VIA_CMD_RGTR_BUSY_H5 | VIA_2D_ENG_BUSY_H5)) && (loop++ < MAXLOOP)) ; break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: while ((VIAGETREG(VIA_REG_STATUS) & (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY)) && (loop++ < MAXLOOP)) ; break; default: while (!(VIAGETREG(VIA_REG_STATUS) & VIA_VR_QUEUE_EMPTY) && (loop++ < MAXLOOP)) ; while ((VIAGETREG(VIA_REG_STATUS) & (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY)) && (loop++ < MAXLOOP)) ; } } offset = (*bp++ & 0x0FFFFFFF) << 2; value = *bp++; VIASETREG(offset, value); } } else { ErrorF("Command stream parser error.\n"); } } cb->pos = 0; cb->mode = 0; cb->has3dState = FALSE; } #ifdef HAVE_DRI /* * Flush the command buffer using DRM. If in PCI mode, we can bypass DRM, * but not for command buffers that contain 3D engine state, since then * the DRM command verifier will lose track of the 3D engine state. */ static void viaFlushDRIEnabled(ViaCommandBuffer *cb) { ScrnInfoPtr pScrn = cb->pScrn; VIAPtr pVia = VIAPTR(pScrn); char *tmp = (char *)cb->buf; int tmpSize; drm_via_cmdbuffer_t b; /* Align end of command buffer for AGP DMA. */ OUT_RING_H1(0x2f8, 0x67676767); if (pVia->agpDMA && cb->mode == 2 && cb->rindex != HC_ParaType_CmdVdata && (cb->pos & 1)) { OUT_RING(HC_DUMMY); } tmpSize = cb->pos * sizeof(CARD32); if (pVia->agpDMA || (pVia->directRenderingType && cb->has3dState)) { cb->mode = 0; cb->has3dState = FALSE; while (tmpSize > 0) { b.size = (tmpSize > VIA_DMASIZE) ? VIA_DMASIZE : tmpSize; tmpSize -= b.size; b.buf = tmp; tmp += b.size; if (drmCommandWrite(pVia->drmmode.fd, ((pVia->agpDMA) ? DRM_VIA_CMDBUFFER : DRM_VIA_PCICMD), &b, sizeof(b))) { ErrorF("DRM command buffer submission failed.\n"); viaDumpDMA(cb); return; } } cb->pos = 0; } else { viaFlushPCI(cb); } } #endif /* * Initialize a command buffer. Some fields are currently not used since they * are intended for Unichrome Pro group A video commands. */ static int viaSetupCBuffer(ScrnInfoPtr pScrn, ViaCommandBuffer *cb, unsigned size) { #ifdef HAVE_DRI VIAPtr pVia = VIAPTR(pScrn); #endif cb->pScrn = pScrn; cb->bufSize = ((size == 0) ? VIA_DMASIZE : size) >> 2; cb->buf = (CARD32 *) calloc(cb->bufSize, sizeof(CARD32)); if (!cb->buf) return BadAlloc; cb->waitFlags = 0; cb->pos = 0; cb->mode = 0; cb->header_start = 0; cb->rindex = 0; cb->has3dState = FALSE; cb->flushFunc = viaFlushPCI; #ifdef HAVE_DRI if (pVia->directRenderingType == DRI_1) { cb->flushFunc = viaFlushDRIEnabled; } #endif return Success; } /* * Free resources associated with a command buffer. */ static void viaTearDownCBuffer(ViaCommandBuffer *cb) { if (cb && cb->buf) { free(cb->buf); cb->buf = NULL; } } /* * Update our 2D state (TwoDContext) with a new mode. */ Bool viaAccelSetMode(int bpp, ViaTwodContext * tdc) { switch (bpp) { case 16: tdc->mode = VIA_GEM_16bpp; tdc->bytesPPShift = 1; return TRUE; case 32: tdc->mode = VIA_GEM_32bpp; tdc->bytesPPShift = 2; return TRUE; case 8: tdc->mode = VIA_GEM_8bpp; tdc->bytesPPShift = 0; return TRUE; default: tdc->bytesPPShift = 0; return FALSE; } } /* * Switch 2D state clipping on. */ void viaSetClippingRectangle(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2) { VIAPtr pVia = VIAPTR(pScrn); ViaTwodContext *tdc = &pVia->td; tdc->clipping = TRUE; tdc->clipX1 = (x1 & 0xFFFF); tdc->clipY1 = y1; tdc->clipX2 = (x2 & 0xFFFF); tdc->clipY2 = y2; } /* * Check if we need to force upload of the whole 3D state (when other * clients or subsystems have touched the 3D engine). Also tell DRI * clients and subsystems that we have touched the 3D engine. */ Bool viaCheckUpload(ScrnInfoPtr pScrn, Via3DState * v3d) { VIAPtr pVia = VIAPTR(pScrn); Bool forceUpload; forceUpload = (pVia->lastToUpload != v3d); pVia->lastToUpload = v3d; #ifdef HAVE_DRI if (pVia->directRenderingType == DRI_1) { volatile drm_via_sarea_t *saPriv = (drm_via_sarea_t *) DRIGetSAREAPrivate(pScrn->pScreen); int myContext = DRIGetContext(pScrn->pScreen); forceUpload = forceUpload || (saPriv->ctxOwner != myContext); saPriv->ctxOwner = myContext; } #endif return forceUpload; } Bool viaOrder(CARD32 val, CARD32 * shift) { *shift = 0; while (val > (1 << *shift)) (*shift)++; return (val == (1 << *shift)); } /* * Helper for bitdepth expansion. */ CARD32 viaBitExpandHelper(CARD32 pixel, CARD32 bits) { CARD32 component, mask, tmp; component = pixel & ((1 << bits) - 1); mask = (1 << (8 - bits)) - 1; tmp = component << (8 - bits); return ((component & 1) ? (tmp | mask) : tmp); } /* * Extract the components from a pixel of the given format to an argb8888 pixel. * This is used to extract data from one-pixel repeat pixmaps. * Assumes little endian. */ void viaPixelARGB8888(unsigned format, void *pixelP, CARD32 * argb8888) { CARD32 bits, shift, pixel, bpp; bpp = PICT_FORMAT_BPP(format); if (bpp <= 8) { pixel = *((CARD8 *) pixelP); } else if (bpp <= 16) { pixel = *((CARD16 *) pixelP); } else { pixel = *((CARD32 *) pixelP); } switch (PICT_FORMAT_TYPE(format)) { case PICT_TYPE_A: bits = PICT_FORMAT_A(format); *argb8888 = viaBitExpandHelper(pixel, bits) << 24; return; case PICT_TYPE_ARGB: shift = 0; bits = PICT_FORMAT_B(format); *argb8888 = viaBitExpandHelper(pixel, bits); shift += bits; bits = PICT_FORMAT_G(format); *argb8888 |= viaBitExpandHelper(pixel >> shift, bits) << 8; shift += bits; bits = PICT_FORMAT_R(format); *argb8888 |= viaBitExpandHelper(pixel >> shift, bits) << 16; shift += bits; bits = PICT_FORMAT_A(format); *argb8888 |= ((bits) ? viaBitExpandHelper(pixel >> shift, bits) : 0xFF) << 24; return; case PICT_TYPE_ABGR: shift = 0; bits = PICT_FORMAT_B(format); *argb8888 = viaBitExpandHelper(pixel, bits) << 16; shift += bits; bits = PICT_FORMAT_G(format); *argb8888 |= viaBitExpandHelper(pixel >> shift, bits) << 8; shift += bits; bits = PICT_FORMAT_R(format); *argb8888 |= viaBitExpandHelper(pixel >> shift, bits); shift += bits; bits = PICT_FORMAT_A(format); *argb8888 |= ((bits) ? viaBitExpandHelper(pixel >> shift, bits) : 0xFF) << 24; return; default: break; } return; } Bool viaExpandablePixel(int format) { int formatType = PICT_FORMAT_TYPE(format); return (formatType == PICT_TYPE_A || formatType == PICT_TYPE_ABGR || formatType == PICT_TYPE_ARGB); } #ifdef VIA_DEBUG_COMPOSITE void viaExaCompositePictDesc(PicturePtr pict, char *string, int n) { char format[20]; char size[20]; if (!pict) { snprintf(string, n, "None"); return; } switch (pict->format) { case PICT_x8r8g8b8: snprintf(format, 20, "RGB8888"); break; case PICT_a8r8g8b8: snprintf(format, 20, "ARGB8888"); break; case PICT_r5g6b5: snprintf(format, 20, "RGB565 "); break; case PICT_x1r5g5b5: snprintf(format, 20, "RGB555 "); break; case PICT_a8: snprintf(format, 20, "A8 "); break; case PICT_a1: snprintf(format, 20, "A1 "); break; default: snprintf(format, 20, "0x%x", (int)pict->format); break; } if (pict->pDrawable) { snprintf(size, 20, "%dx%d%s", pict->pDrawable->width, pict->pDrawable->height, pict->repeat ? " R" : ""); snprintf(string, n, "0x%lx: fmt %s (%s)", (long)pict->pDrawable, format, size); } } void viaExaPrintCompositeInfo(char *info, CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst) { char sop[20]; char srcdesc[40], maskdesc[40], dstdesc[40]; switch (op) { case PictOpClear: sprintf(sop, "PictOpClear "); break; case PictOpSrc: sprintf(sop, "PictOpSrc "); break; case PictOpDst: sprintf(sop, "PictOpDst "); break; case PictOpOver: sprintf(sop, "PictOpOver "); break; case PictOpOutReverse: sprintf(sop, "PictOpOutReverse "); break; case PictOpAdd: sprintf(sop, "PictOpAdd "); break; default: sprintf(sop, "PictOp%d ", op); } viaExaCompositePictDesc(pSrc, srcdesc, 40); viaExaCompositePictDesc(pMask, maskdesc, 40); viaExaCompositePictDesc(pDst, dstdesc, 40); ErrorF("Composite fallback: %s, \n" " op %s, \n" " src %s, \n" " mask %s, \n" " dst %s, \n", info, sop, srcdesc, maskdesc, dstdesc); } #endif /* VIA_DEBUG_COMPOSITE */ /* * Wait for acceleration engines idle. An expensive way to sync. */ void viaAccelSync(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); int loop = 0; mem_barrier(); switch (pVia->Chipset) { case VIA_VX800: case VIA_VX855: case VIA_VX900: while ((VIAGETREG(VIA_REG_STATUS) & (VIA_CMD_RGTR_BUSY_H5 | VIA_2D_ENG_BUSY_H5 | VIA_3D_ENG_BUSY_H5)) && (loop++ < MAXLOOP)) ; break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: while ((VIAGETREG(VIA_REG_STATUS) & (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY | VIA_3D_ENG_BUSY)) && (loop++ < MAXLOOP)) ; break; default: while (!(VIAGETREG(VIA_REG_STATUS) & VIA_VR_QUEUE_EMPTY) && (loop++ < MAXLOOP)) ; while ((VIAGETREG(VIA_REG_STATUS) & (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY | VIA_3D_ENG_BUSY)) && (loop++ < MAXLOOP)) ; break; } } /* * Wait for the value to get blitted, or in the PCI case for engine idle. */ static void viaAccelWaitMarker(ScreenPtr pScreen, int marker) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); CARD32 uMarker = marker; if (pVia->agpDMA) { while ((pVia->lastMarkerRead - uMarker) > (1 << 24)) pVia->lastMarkerRead = *(CARD32 *) pVia->markerBuf; } else { viaAccelSync(pScrn); } } #ifdef HAVE_DRI static int viaAccelDMADownload(ScrnInfoPtr pScrn, unsigned long fbOffset, unsigned srcPitch, unsigned char *dst, unsigned dstPitch, unsigned w, unsigned h) { VIAPtr pVia = VIAPTR(pScrn); drm_via_dmablit_t blit[2], *curBlit; unsigned char *sysAligned = NULL; Bool doSync[2], useBounceBuffer; unsigned pitch, numLines[2]; int curBuf, err, i, ret, blitHeight; ret = 0; useBounceBuffer = (((unsigned long)dst & 15) || (dstPitch & 15)); doSync[0] = FALSE; doSync[1] = FALSE; curBuf = 1; blitHeight = h; pitch = dstPitch; if (useBounceBuffer) { pitch = ALIGN_TO(dstPitch, 16); blitHeight = VIA_DMA_DL_SIZE / pitch; } while (doSync[0] || doSync[1] || h != 0) { curBuf = 1 - curBuf; curBlit = &blit[curBuf]; if (doSync[curBuf]) { do { err = drmCommandWrite(pVia->drmmode.fd, DRM_VIA_BLIT_SYNC, &curBlit->sync, sizeof(curBlit->sync)); } while (err == -EAGAIN); if (err) return err; doSync[curBuf] = FALSE; if (useBounceBuffer) { for (i = 0; i < numLines[curBuf]; ++i) { memcpy(dst, curBlit->mem_addr, w); dst += dstPitch; curBlit->mem_addr += pitch; } } } if (h == 0) continue; curBlit->num_lines = (h > blitHeight) ? blitHeight : h; h -= curBlit->num_lines; numLines[curBuf] = curBlit->num_lines; sysAligned = (unsigned char *)pVia->dBounce + (curBuf * VIA_DMA_DL_SIZE); sysAligned = (unsigned char *) ALIGN_TO((unsigned long)sysAligned, 16); curBlit->mem_addr = (useBounceBuffer) ? sysAligned : dst; curBlit->line_length = w; curBlit->mem_stride = pitch; curBlit->fb_addr = fbOffset; curBlit->fb_stride = srcPitch; curBlit->to_fb = 0; fbOffset += curBlit->num_lines * srcPitch; do { err = drmCommandWriteRead(pVia->drmmode.fd, DRM_VIA_DMA_BLIT, curBlit, sizeof(*curBlit)); } while (err == -EAGAIN); if (err) { ret = err; h = 0; continue; } doSync[curBuf] = TRUE; } return ret; } /* * Use PCI DMA if we can. If the system alignments don't match, we're using * an aligned bounce buffer for pipelined PCI DMA and memcpy. * Throughput for large transfers is around 65 MB/s. */ static Bool viaExaDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pSrc->drawable.pScreen); unsigned wBytes = (pSrc->drawable.bitsPerPixel * w + 7) >> 3; unsigned srcPitch = exaGetPixmapPitch(pSrc), srcOffset; char *bounceAligned = NULL; VIAPtr pVia = VIAPTR(pScrn); unsigned totSize; if (!w || !h) return TRUE; srcOffset = x * pSrc->drawable.bitsPerPixel; if (srcOffset & 3) return FALSE; srcOffset = exaGetPixmapOffset(pSrc) + y * srcPitch + (srcOffset >> 3); totSize = wBytes * h; exaWaitSync(pScrn->pScreen); if (totSize < VIA_MIN_DOWNLOAD) { bounceAligned = (char *) drm_bo_map(pScrn, pVia->drmmode.front_bo) + srcOffset; while (h--) { memcpy(dst, bounceAligned, wBytes); dst += dst_pitch; bounceAligned += srcPitch; } return TRUE; } if (!pVia->directRenderingType) return FALSE; if ((srcPitch & 3) || (srcOffset & 3)) { ErrorF("VIA EXA download src_pitch misaligned\n"); return FALSE; } if (viaAccelDMADownload(pScrn, srcOffset, srcPitch, (unsigned char *)dst, dst_pitch, wBytes, h)) return FALSE; return TRUE; } /* * Upload to framebuffer memory using memcpy to AGP pipelined with a * 3D engine texture operation from AGP to framebuffer. The AGP buffers (2) * should be kept rather small for optimal pipelining. */ static Bool viaExaTexUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int src_pitch) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen); unsigned dstPitch = exaGetPixmapPitch(pDst), dstOffset; unsigned wBytes = (w * pDst->drawable.bitsPerPixel + 7) >> 3; int i, sync[2], yOffs, bufH, bufOffs, height, format; CARD32 texWidth, texHeight, texPitch; VIAPtr pVia = VIAPTR(pScrn); Via3DState *v3d = &pVia->v3d; char *dst, *texAddr; Bool buf; if (!w || !h) return TRUE; if (wBytes * h < VIA_MIN_TEX_UPLOAD) { dstOffset = x * pDst->drawable.bitsPerPixel; if (dstOffset & 3) return FALSE; dst = (char *) drm_bo_map(pScrn, pVia->drmmode.front_bo) + (exaGetPixmapOffset(pDst) + y * dstPitch + (dstOffset >> 3)); exaWaitSync(pScrn->pScreen); while (h--) { memcpy(dst, src, wBytes); dst += dstPitch; src += src_pitch; } return TRUE; } if (!pVia->texAGPBuffer->ptr) return FALSE; switch (pDst->drawable.bitsPerPixel) { case 32: format = PICT_a8r8g8b8; break; case 16: format = PICT_r5g6b5; break; default: return FALSE; } dstOffset = exaGetPixmapOffset(pDst); if (pVia->nPOT[0]) { texPitch = ALIGN_TO(wBytes, 32); height = VIA_AGP_UPL_SIZE / texPitch; } else { viaOrder(wBytes, &texPitch); if (texPitch < 3) texPitch = 3; height = VIA_AGP_UPL_SIZE >> texPitch; texPitch = 1 << texPitch; } if (height > 1024) height = 1024; viaOrder(w, &texWidth); texWidth = 1 << texWidth; texHeight = height << 1; bufOffs = texPitch * height; texAddr = (char *) drm_bo_map(pScrn, pVia->texAGPBuffer); v3d->setDestination(v3d, dstOffset, dstPitch, format); v3d->setDrawing(v3d, 0x0c, 0xFFFFFFFF, 0x000000FF, 0x00); v3d->setFlags(v3d, 1, TRUE, TRUE, FALSE); if (!v3d->setTexture(v3d, 0, (unsigned long) texAddr, texPitch, pVia->nPOT[0], texWidth, texHeight, format, via_single, via_single, via_src, TRUE)) return FALSE; v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d)); v3d->emitClipRect(v3d, &pVia->cb, 0, 0, pDst->drawable.width, pDst->drawable.height); buf = 1; yOffs = 0; sync[0] = -1; sync[1] = -1; while (h) { buf = (buf) ? 0 : 1; bufH = (h > height) ? height : h; dst = texAddr + ((buf) ? bufOffs : 0); if (sync[buf] >= 0) pVia->exaDriverPtr->WaitMarker(pScrn->pScreen, sync[buf]); for (i = 0; i < bufH; ++i) { memcpy(dst, src, wBytes); dst += texPitch; src += src_pitch; } v3d->emitQuad(v3d, &pVia->cb, x, y + yOffs, 0, (buf) ? height : 0, 0, 0, w, bufH); sync[buf] = pVia->exaDriverPtr->MarkSync(pScrn->pScreen); h -= bufH; yOffs += bufH; } if (sync[buf] >= 0) pVia->exaDriverPtr->WaitMarker(pScrn->pScreen, sync[buf]); return TRUE; } #endif /* HAVE_DRI */ #define EXAOPT_MIGRATION_HEURISTIC 0 Bool viaInitExa(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ExaDriverPtr pExa = exaDriverAlloc(); Bool nPOTSupported = TRUE; VIAPtr pVia = VIAPTR(pScrn); /* * nPOT textures. DRM versions below 2.11.0 don't allow them. * Also some CLE266 hardware may not allow nPOT textures for * texture engine 1. We need to figure that out. */ #ifdef HAVE_DRI nPOTSupported = ((!pVia->directRenderingType) || (pVia->drmVerMajor > 2) || ((pVia->drmVerMajor == 2) && (pVia->drmVerMinor >= 11))); #endif pVia->nPOT[0] = nPOTSupported; pVia->nPOT[1] = nPOTSupported; if (Success != viaSetupCBuffer(pScrn, &pVia->cb, 0)) { pVia->NoAccel = TRUE; return FALSE; } if (!pExa) return FALSE; memset(pExa, 0, sizeof(*pExa)); pExa->exa_major = EXA_VERSION_MAJOR; pExa->exa_minor = EXA_VERSION_MINOR; pExa->memoryBase = pVia->FBBase; pExa->memorySize = pVia->FBFreeEnd; pExa->offScreenBase = pScrn->virtualY * pVia->Bpl; pExa->pixmapOffsetAlign = 32; pExa->pixmapPitchAlign = 16; pExa->flags = EXA_OFFSCREEN_PIXMAPS | (pVia->nPOT[1] ? 0 : EXA_OFFSCREEN_ALIGN_POT); /* HW Limitation are described here: * * 1. H2/H5/H6 2D source and destination: * Pitch: (1 << 14) - 1 = 16383 * Dimension: (1 << 12) = 4096 * X, Y position: (1 << 12) - 1 = 4095. * * 2. H2 3D engine Render target: * Pitch: (1 << 14) - 1 = 16383 * Clip Rectangle: 0 - 2047 * * 3. H5/H6 3D engine Render target: * Pitch: ((1 << 10) - 1)*32 = 32736 * Clip Rectangle: Color Window, 12bits. As Spec saied: 0 - 2048 * Scissor is the same as color window. */ pExa->maxX = 2047; pExa->maxY = 2047; pExa->WaitMarker = viaAccelWaitMarker; switch (pVia->Chipset) { case VIA_VX800: case VIA_VX855: case VIA_VX900: pExa->MarkSync = viaAccelMarkSync_H6; pExa->PrepareSolid = viaExaPrepareSolid_H6; pExa->Solid = viaExaSolid_H6; pExa->DoneSolid = viaExaDoneSolidCopy_H6; pExa->PrepareCopy = viaExaPrepareCopy_H6; pExa->Copy = viaExaCopy_H6; pExa->DoneCopy = viaExaDoneSolidCopy_H6; break; default: pExa->MarkSync = viaAccelMarkSync_H2; pExa->PrepareSolid = viaExaPrepareSolid_H2; pExa->Solid = viaExaSolid_H2; pExa->DoneSolid = viaExaDoneSolidCopy_H2; pExa->PrepareCopy = viaExaPrepareCopy_H2; pExa->Copy = viaExaCopy_H2; pExa->DoneCopy = viaExaDoneSolidCopy_H2; break; } #ifdef HAVE_DRI if (pVia->directRenderingType == DRI_1) { #ifdef linux pExa->DownloadFromScreen = viaExaDownloadFromScreen; #endif /* linux */ switch (pVia->Chipset) { case VIA_K8M800: case VIA_KM400: pExa->UploadToScreen = NULL; //viaExaTexUploadToScreen; break; default: pExa->UploadToScreen = NULL; //viaExaUploadToScreen; break; } } #endif /* HAVE_DRI */ if (!pVia->noComposite) { switch (pVia->Chipset) { case VIA_VX800: case VIA_VX855: case VIA_VX900: pExa->CheckComposite = viaExaCheckComposite_H6; pExa->PrepareComposite = viaExaPrepareComposite_H6; pExa->Composite = viaExaComposite_H6; pExa->DoneComposite = viaExaDoneSolidCopy_H6; break; default: pExa->CheckComposite = viaExaCheckComposite_H2; pExa->PrepareComposite = viaExaPrepareComposite_H2; pExa->Composite = viaExaComposite_H2; pExa->DoneComposite = viaExaDoneSolidCopy_H2; break; } } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[EXA] Disabling EXA accelerated composite.\n"); } if (!exaDriverInit(pScreen, pExa)) { free(pExa); return FALSE; } pVia->exaDriverPtr = pExa; viaInit3DState(&pVia->v3d); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[EXA] Enabled EXA acceleration.\n"); return TRUE; } /* * Allocate a command buffer and buffers for accelerated upload, download, * and EXA scratch area. The scratch area resides primarily in AGP memory, * but reverts to FB if AGP is not available. */ void viaFinishInitAccel(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); int size; #ifdef HAVE_DRI if (pVia->directRenderingType && pVia->useEXA) { pVia->dBounce = calloc(VIA_DMA_DL_SIZE * 2, 1); if (!pVia->IsPCI) { /* Allocate upload and scratch space. */ if (pVia->exaDriverPtr->UploadToScreen == viaExaTexUploadToScreen) { size = VIA_AGP_UPL_SIZE * 2; pVia->texAGPBuffer = drm_bo_alloc(pScrn, size, 32, TTM_PL_FLAG_TT); if (pVia->texAGPBuffer) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Allocated %u kiB of AGP memory for " "system-to-framebuffer transfer.\n", size / 1024); pVia->texAGPBuffer->offset = (pVia->texAGPBuffer->offset + 31) & ~31; } } size = pVia->exaScratchSize * 1024; pVia->scratchBuffer = drm_bo_alloc(pScrn, size, 32, TTM_PL_FLAG_TT); if (pVia->scratchBuffer) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Allocated %u kiB of AGP memory for " "EXA scratch area.\n", size / 1024); pVia->scratchOffset = (pVia->scratchBuffer->offset + 31) & ~31; pVia->scratchAddr = drm_bo_map(pScrn, pVia->scratchBuffer); } } } #endif /* HAVE_DRI */ if (!pVia->scratchAddr && pVia->useEXA) { size = pVia->exaScratchSize * 1024 + 32; pVia->scratchBuffer = drm_bo_alloc(pScrn, size, 32, TTM_PL_FLAG_SYSTEM); if (pVia->scratchBuffer) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Allocated %u kiB of framebuffer memory for " "EXA scratch area.\n", pVia->exaScratchSize); pVia->scratchOffset = pVia->scratchBuffer->offset; pVia->scratchAddr = drm_bo_map(pScrn, pVia->scratchBuffer); } } memset(pVia->markerBuf, 0, pVia->exa_sync_bo->size); } /* * Free the used acceleration resources. */ void viaExitAccel(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); viaAccelSync(pScrn); viaTearDownCBuffer(&pVia->cb); if (pVia->useEXA) { #ifdef HAVE_DRI if (pVia->directRenderingType == DRI_1) { if (pVia->texAGPBuffer) { drm_bo_free(pScrn, pVia->texAGPBuffer); pVia->texAGPBuffer = NULL; } if (pVia->scratchBuffer) { drm_bo_free(pScrn, pVia->scratchBuffer); pVia->scratchBuffer = NULL; } } if (pVia->dBounce) free(pVia->dBounce); #endif /* HAVE_DRI */ if (pVia->scratchBuffer) { drm_bo_free(pScrn, pVia->scratchBuffer); pVia->scratchBuffer = NULL; } if (pVia->vq_bo) { drm_bo_unmap(pScrn, pVia->vq_bo); drm_bo_free(pScrn, pVia->vq_bo); } if (pVia->exa_sync_bo) { drm_bo_unmap(pScrn, pVia->exa_sync_bo); drm_bo_free(pScrn, pVia->exa_sync_bo); } if (pVia->exaDriverPtr) { exaDriverFini(pScreen); } free(pVia->exaDriverPtr); pVia->exaDriverPtr = NULL; return; } } xf86-video-openchrome-0.6.0/src/via_dri.h0000664000175000017500000000454212760724526015071 00000000000000/* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ /* * Keep this file in perfect sync between the ddx and dri drivers. * At least bump the VIA_DRIDDX_VERSION defines appropriately. * */ #ifndef _VIA_DRI_H_ #define _VIA_DRI_H_ 1 #define VIA_MAX_DRAWABLES 256 #define VIA_DRIDDX_VERSION_MAJOR 5 #define VIA_DRIDDX_VERSION_MINOR 0 #define VIA_DRIDDX_VERSION_PATCH 0 #if !defined(XFree86Server) && !defined(_XDEFS_H) typedef int Bool; #endif typedef struct { drm_handle_t handle; drmSize size; } viaRegion, *viaRegionPtr; typedef struct { viaRegion regs; int deviceID; int width; int height; int mem; int bytesPerPixel; int priv1; int priv2; Bool drixinerama; int backOffset; int depthOffset; int textureOffset; int textureSize; int irqEnabled; unsigned int scrnX, scrnY; int sarea_priv_offset; int ringBufActive; unsigned int reg_pause_addr; } VIADRIRec, *VIADRIPtr; typedef struct { int dummy; } VIAConfigPrivRec, *VIAConfigPrivPtr; typedef struct { int dummy; } VIADRIContextRec, *VIADRIContextPtr; Bool VIADRIKernelInit(ScrnInfoPtr pScrn); void kickVblank(ScrnInfoPtr pScrn); #endif /* _VIA_DRI_H_ */ xf86-video-openchrome-0.6.0/src/via_3d_reg.h0000664000175000017500000020472512760724526015463 00000000000000/* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS 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. */ #ifndef VIA_3D_REG_H #define VIA_3D_REG_H #define HC_REG_BASE 0x0400 #define HC_REG_TRANS_SPACE 0x0040 #define HC_ParaN_MASK 0xffffffff #define HC_Para_MASK 0x00ffffff #define HC_SubA_MASK 0xff000000 #define HC_SubA_SHIFT 24 /* Transmission Setting */ #define HC_REG_TRANS_SET 0x003c #define HC_ParaSubType_MASK 0xff000000 #define HC_ParaType_MASK 0x00ff0000 #define HC_ParaOS_MASK 0x0000ff00 #define HC_ParaAdr_MASK 0x000000ff #define HC_ParaSubType_SHIFT 24 #define HC_ParaType_SHIFT 16 #define HC_ParaOS_SHIFT 8 #define HC_ParaAdr_SHIFT 0 #define HC_ParaType_CmdVdata 0x0000 #define HC_ParaType_NotTex 0x0001 #define HC_ParaType_Tex 0x0002 #define HC_ParaType_Palette 0x0003 #define HC_ParaType_PreCR 0x0010 #define HC_ParaType_Auto 0x00fe /* Transmission Space */ #define HC_REG_Hpara0 0x0040 #define HC_REG_HpataAF 0x02fc /* Read */ #define HC_REG_HREngSt 0x0000 #define HC_REG_HRFIFOempty 0x0004 #define HC_REG_HRFIFOfull 0x0008 #define HC_REG_HRErr 0x000c #define HC_REG_FIFOstatus 0x0010 /* HC_REG_HREngSt 0x0000 */ #define HC_HDASZC_MASK 0x00010000 #define HC_HSGEMI_MASK 0x0000f000 #define HC_HLGEMISt_MASK 0x00000f00 #define HC_HCRSt_MASK 0x00000080 #define HC_HSE0St_MASK 0x00000040 #define HC_HSE1St_MASK 0x00000020 #define HC_HPESt_MASK 0x00000010 #define HC_HXESt_MASK 0x00000008 #define HC_HBESt_MASK 0x00000004 #define HC_HE2St_MASK 0x00000002 #define HC_HE3St_MASK 0x00000001 /* HC_REG_HRFIFOempty 0x0004 */ #define HC_HRZDempty_MASK 0x00000010 #define HC_HRTXAempty_MASK 0x00000008 #define HC_HRTXDempty_MASK 0x00000004 #define HC_HWZDempty_MASK 0x00000002 #define HC_HWCDempty_MASK 0x00000001 /* HC_REG_HRFIFOfull 0x0008 */ #define HC_HRZDfull_MASK 0x00000010 #define HC_HRTXAfull_MASK 0x00000008 #define HC_HRTXDfull_MASK 0x00000004 #define HC_HWZDfull_MASK 0x00000002 #define HC_HWCDfull_MASK 0x00000001 /* HC_REG_HRErr 0x000c */ #define HC_HAGPCMErr_MASK 0x80000000 #define HC_HAGPCMErrC_MASK 0x70000000 /* HC_REG_FIFOstatus 0x0010 */ #define HC_HRFIFOATall_MASK 0x80000000 #define HC_HRFIFOATbusy_MASK 0x40000000 #define HC_HRATFGMDo_MASK 0x00000100 #define HC_HRATFGMDi_MASK 0x00000080 #define HC_HRATFRZD_MASK 0x00000040 #define HC_HRATFRTXA_MASK 0x00000020 #define HC_HRATFRTXD_MASK 0x00000010 #define HC_HRATFWZD_MASK 0x00000008 #define HC_HRATFWCD_MASK 0x00000004 #define HC_HRATTXTAG_MASK 0x00000002 #define HC_HRATTXCH_MASK 0x00000001 /* AGP Command Setting */ #define HC_SubA_HAGPBstL 0x0060 #define HC_SubA_HAGPBendL 0x0061 #define HC_SubA_HAGPCMNT 0x0062 #define HC_SubA_HAGPBpL 0x0063 #define HC_SubA_HAGPBpH 0x0064 /* HC_SubA_HAGPCMNT 0x0062 */ #define HC_HAGPCMNT_MASK 0x00800000 #define HC_HCmdErrClr_MASK 0x00400000 #define HC_HAGPBendH_MASK 0x0000ff00 #define HC_HAGPBstH_MASK 0x000000ff #define HC_HAGPBendH_SHIFT 8 #define HC_HAGPBstH_SHIFT 0 /* HC_SubA_HAGPBpL 0x0063 */ #define HC_HAGPBpL_MASK 0x00fffffc #define HC_HAGPBpID_MASK 0x00000003 #define HC_HAGPBpID_PAUSE 0x00000000 #define HC_HAGPBpID_JUMP 0x00000001 #define HC_HAGPBpID_STOP 0x00000002 /* HC_SubA_HAGPBpH 0x0064 */ #define HC_HAGPBpH_MASK 0x00ffffff /* Miscellaneous Settings */ #define HC_SubA_HClipTB 0x0070 #define HC_SubA_HClipLR 0x0071 #define HC_SubA_HFPClipTL 0x0072 #define HC_SubA_HFPClipBL 0x0073 #define HC_SubA_HFPClipLL 0x0074 #define HC_SubA_HFPClipRL 0x0075 #define HC_SubA_HFPClipTBH 0x0076 #define HC_SubA_HFPClipLRH 0x0077 #define HC_SubA_HLP 0x0078 #define HC_SubA_HLPRF 0x0079 #define HC_SubA_HSolidCL 0x007a #define HC_SubA_HPixGC 0x007b #define HC_SubA_HSPXYOS 0x007c #define HC_SubA_HVertexCNT 0x007d #define HC_HClipT_MASK 0x00fff000 #define HC_HClipT_SHIFT 12 #define HC_HClipB_MASK 0x00000fff #define HC_HClipB_SHIFT 0 #define HC_HClipL_MASK 0x00fff000 #define HC_HClipL_SHIFT 12 #define HC_HClipR_MASK 0x00000fff #define HC_HClipR_SHIFT 0 #define HC_HFPClipBH_MASK 0x0000ff00 #define HC_HFPClipBH_SHIFT 8 #define HC_HFPClipTH_MASK 0x000000ff #define HC_HFPClipTH_SHIFT 0 #define HC_HFPClipRH_MASK 0x0000ff00 #define HC_HFPClipRH_SHIFT 8 #define HC_HFPClipLH_MASK 0x000000ff #define HC_HFPClipLH_SHIFT 0 #define HC_HSolidCH_MASK 0x000000ff #define HC_HPixGC_MASK 0x00800000 #define HC_HSPXOS_MASK 0x00fff000 #define HC_HSPXOS_SHIFT 12 #define HC_HSPYOS_MASK 0x00000fff /* Command * Command A */ #define HC_HCmdHeader_MASK 0xfe000000 /*0xffe00000 */ #define HC_HE3Fire_MASK 0x00100000 #define HC_HPMType_MASK 0x000f0000 #define HC_HEFlag_MASK 0x0000e000 #define HC_HShading_MASK 0x00001c00 #define HC_HPMValidN_MASK 0x00000200 #define HC_HPLEND_MASK 0x00000100 #define HC_HVCycle_MASK 0x000000ff #define HC_HVCycle_Style_MASK 0x000000c0 #define HC_HVCycle_ChgA_MASK 0x00000030 #define HC_HVCycle_ChgB_MASK 0x0000000c #define HC_HVCycle_ChgC_MASK 0x00000003 #define HC_HPMType_Point 0x00000000 #define HC_HPMType_Line 0x00010000 #define HC_HPMType_Tri 0x00020000 #define HC_HPMType_TriWF 0x00040000 #define HC_HEFlag_NoAA 0x00000000 #define HC_HEFlag_ab 0x00008000 #define HC_HEFlag_bc 0x00004000 #define HC_HEFlag_ca 0x00002000 #define HC_HShading_Solid 0x00000000 #define HC_HShading_FlatA 0x00000400 #define HC_HShading_FlatB 0x00000800 #define HC_HShading_FlatC 0x00000c00 #define HC_HShading_Gouraud 0x00001000 #define HC_HVCycle_Full 0x00000000 #define HC_HVCycle_AFP 0x00000040 #define HC_HVCycle_One 0x000000c0 #define HC_HVCycle_NewA 0x00000000 #define HC_HVCycle_AA 0x00000010 #define HC_HVCycle_AB 0x00000020 #define HC_HVCycle_AC 0x00000030 #define HC_HVCycle_NewB 0x00000000 #define HC_HVCycle_BA 0x00000004 #define HC_HVCycle_BB 0x00000008 #define HC_HVCycle_BC 0x0000000c #define HC_HVCycle_NewC 0x00000000 #define HC_HVCycle_CA 0x00000001 #define HC_HVCycle_CB 0x00000002 #define HC_HVCycle_CC 0x00000003 /* Command B */ #define HC_HLPrst_MASK 0x00010000 #define HC_HLLastP_MASK 0x00008000 #define HC_HVPMSK_MASK 0x00007f80 #define HC_HBFace_MASK 0x00000040 #define HC_H2nd1VT_MASK 0x0000003f #define HC_HVPMSK_X 0x00004000 #define HC_HVPMSK_Y 0x00002000 #define HC_HVPMSK_Z 0x00001000 #define HC_HVPMSK_W 0x00000800 #define HC_HVPMSK_Cd 0x00000400 #define HC_HVPMSK_Cs 0x00000200 #define HC_HVPMSK_S 0x00000100 #define HC_HVPMSK_T 0x00000080 /* Enable Setting */ #define HC_SubA_HEnable 0x0000 #define HC_HenTXEnvMap_MASK 0x00200000 #define HC_HenVertexCNT_MASK 0x00100000 #define HC_HenCPUDAZ_MASK 0x00080000 #define HC_HenDASZWC_MASK 0x00040000 #define HC_HenFBCull_MASK 0x00020000 #define HC_HenCW_MASK 0x00010000 #define HC_HenAA_MASK 0x00008000 #define HC_HenST_MASK 0x00004000 #define HC_HenZT_MASK 0x00002000 #define HC_HenZW_MASK 0x00001000 #define HC_HenAT_MASK 0x00000800 #define HC_HenAW_MASK 0x00000400 #define HC_HenSP_MASK 0x00000200 #define HC_HenLP_MASK 0x00000100 #define HC_HenTXCH_MASK 0x00000080 #define HC_HenTXMP_MASK 0x00000040 #define HC_HenTXPP_MASK 0x00000020 #define HC_HenTXTR_MASK 0x00000010 #define HC_HenCS_MASK 0x00000008 #define HC_HenFOG_MASK 0x00000004 #define HC_HenABL_MASK 0x00000002 #define HC_HenDT_MASK 0x00000001 /* Z Setting */ #define HC_SubA_HZWBBasL 0x0010 #define HC_SubA_HZWBBasH 0x0011 #define HC_SubA_HZWBType 0x0012 #define HC_SubA_HZBiasL 0x0013 #define HC_SubA_HZWBend 0x0014 #define HC_SubA_HZWTMD 0x0015 #define HC_SubA_HZWCDL 0x0016 #define HC_SubA_HZWCTAGnum 0x0017 #define HC_SubA_HZCYNum 0x0018 #define HC_SubA_HZWCFire 0x0019 /* HC_SubA_HZWBType */ #define HC_HZWBType_MASK 0x00800000 #define HC_HZBiasedWB_MASK 0x00400000 #define HC_HZONEasFF_MASK 0x00200000 #define HC_HZOONEasFF_MASK 0x00100000 #define HC_HZWBFM_MASK 0x00030000 #define HC_HZWBLoc_MASK 0x0000c000 #define HC_HZWBPit_MASK 0x00003fff #define HC_HZWBFM_16 0x00000000 #define HC_HZWBFM_32 0x00020000 #define HC_HZWBFM_24 0x00030000 #define HC_HZWBLoc_Local 0x00000000 #define HC_HZWBLoc_SyS 0x00004000 /* HC_SubA_HZWBend */ #define HC_HZWBend_MASK 0x00ffe000 #define HC_HZBiasH_MASK 0x000000ff #define HC_HZWBend_SHIFT 10 /* HC_SubA_HZWTMD */ #define HC_HZWTMD_MASK 0x00070000 #define HC_HEBEBias_MASK 0x00007f00 #define HC_HZNF_MASK 0x000000ff #define HC_HZWTMD_NeverPass 0x00000000 #define HC_HZWTMD_LT 0x00010000 #define HC_HZWTMD_EQ 0x00020000 #define HC_HZWTMD_LE 0x00030000 #define HC_HZWTMD_GT 0x00040000 #define HC_HZWTMD_NE 0x00050000 #define HC_HZWTMD_GE 0x00060000 #define HC_HZWTMD_AllPass 0x00070000 #define HC_HEBEBias_SHIFT 8 /* HC_SubA_HZWCDL 0x0016 */ #define HC_HZWCDL_MASK 0x00ffffff /* HC_SubA_HZWCTAGnum 0x0017 */ #define HC_HZWCTAGnum_MASK 0x00ff0000 #define HC_HZWCTAGnum_SHIFT 16 #define HC_HZWCDH_MASK 0x000000ff #define HC_HZWCDH_SHIFT 0 /* HC_SubA_HZCYNum 0x0018 */ #define HC_HZCYNum_MASK 0x00030000 #define HC_HZCYNum_SHIFT 16 #define HC_HZWCQWnum_MASK 0x00003fff #define HC_HZWCQWnum_SHIFT 0 /* HC_SubA_HZWCFire 0x0019 */ #define HC_ZWCFire_MASK 0x00010000 #define HC_HZWCQWnumLast_MASK 0x00003fff #define HC_HZWCQWnumLast_SHIFT 0 /* Stencil Setting */ #define HC_SubA_HSTREF 0x0023 #define HC_SubA_HSTMD 0x0024 /* HC_SubA_HSBFM */ #define HC_HSBFM_MASK 0x00030000 #define HC_HSBLoc_MASK 0x0000c000 #define HC_HSBPit_MASK 0x00003fff /* HC_SubA_HSTREF */ #define HC_HSTREF_MASK 0x00ff0000 #define HC_HSTOPMSK_MASK 0x0000ff00 #define HC_HSTBMSK_MASK 0x000000ff #define HC_HSTREF_SHIFT 16 #define HC_HSTOPMSK_SHIFT 8 /* HC_SubA_HSTMD */ #define HC_HSTMD_MASK 0x00070000 #define HC_HSTOPSF_MASK 0x000001c0 #define HC_HSTOPSPZF_MASK 0x00000038 #define HC_HSTOPSPZP_MASK 0x00000007 #define HC_HSTMD_NeverPass 0x00000000 #define HC_HSTMD_LT 0x00010000 #define HC_HSTMD_EQ 0x00020000 #define HC_HSTMD_LE 0x00030000 #define HC_HSTMD_GT 0x00040000 #define HC_HSTMD_NE 0x00050000 #define HC_HSTMD_GE 0x00060000 #define HC_HSTMD_AllPass 0x00070000 #define HC_HSTOPSF_KEEP 0x00000000 #define HC_HSTOPSF_ZERO 0x00000040 #define HC_HSTOPSF_REPLACE 0x00000080 #define HC_HSTOPSF_INCRSAT 0x000000c0 #define HC_HSTOPSF_DECRSAT 0x00000100 #define HC_HSTOPSF_INVERT 0x00000140 #define HC_HSTOPSF_INCR 0x00000180 #define HC_HSTOPSF_DECR 0x000001c0 #define HC_HSTOPSPZF_KEEP 0x00000000 #define HC_HSTOPSPZF_ZERO 0x00000008 #define HC_HSTOPSPZF_REPLACE 0x00000010 #define HC_HSTOPSPZF_INCRSAT 0x00000018 #define HC_HSTOPSPZF_DECRSAT 0x00000020 #define HC_HSTOPSPZF_INVERT 0x00000028 #define HC_HSTOPSPZF_INCR 0x00000030 #define HC_HSTOPSPZF_DECR 0x00000038 #define HC_HSTOPSPZP_KEEP 0x00000000 #define HC_HSTOPSPZP_ZERO 0x00000001 #define HC_HSTOPSPZP_REPLACE 0x00000002 #define HC_HSTOPSPZP_INCRSAT 0x00000003 #define HC_HSTOPSPZP_DECRSAT 0x00000004 #define HC_HSTOPSPZP_INVERT 0x00000005 #define HC_HSTOPSPZP_INCR 0x00000006 #define HC_HSTOPSPZP_DECR 0x00000007 /* Alpha Setting */ #define HC_SubA_HABBasL 0x0030 #define HC_SubA_HABBasH 0x0031 #define HC_SubA_HABFM 0x0032 #define HC_SubA_HATMD 0x0033 #define HC_SubA_HABLCsat 0x0034 #define HC_SubA_HABLCop 0x0035 #define HC_SubA_HABLAsat 0x0036 #define HC_SubA_HABLAop 0x0037 #define HC_SubA_HABLRCa 0x0038 #define HC_SubA_HABLRFCa 0x0039 #define HC_SubA_HABLRCbias 0x003a #define HC_SubA_HABLRCb 0x003b #define HC_SubA_HABLRFCb 0x003c #define HC_SubA_HABLRAa 0x003d #define HC_SubA_HABLRAb 0x003e /* HC_SubA_HABFM */ #define HC_HABFM_MASK 0x00030000 #define HC_HABLoc_MASK 0x0000c000 #define HC_HABPit_MASK 0x000007ff /* HC_SubA_HATMD */ #define HC_HATMD_MASK 0x00000700 #define HC_HATREF_MASK 0x000000ff #define HC_HATMD_NeverPass 0x00000000 #define HC_HATMD_LT 0x00000100 #define HC_HATMD_EQ 0x00000200 #define HC_HATMD_LE 0x00000300 #define HC_HATMD_GT 0x00000400 #define HC_HATMD_NE 0x00000500 #define HC_HATMD_GE 0x00000600 #define HC_HATMD_AllPass 0x00000700 /* HC_SubA_HABLCsat */ #define HC_HABLCsat_MASK 0x00010000 #define HC_HABLCa_MASK 0x0000fc00 #define HC_HABLCa_C_MASK 0x0000c000 #define HC_HABLCa_OPC_MASK 0x00003c00 #define HC_HABLFCa_MASK 0x000003f0 #define HC_HABLFCa_C_MASK 0x00000300 #define HC_HABLFCa_OPC_MASK 0x000000f0 #define HC_HABLCbias_MASK 0x0000000f #define HC_HABLCbias_C_MASK 0x00000008 #define HC_HABLCbias_OPC_MASK 0x00000007 /*-- Define the input color. */ #define HC_XC_Csrc 0x00000000 #define HC_XC_Cdst 0x00000001 #define HC_XC_Asrc 0x00000002 #define HC_XC_Adst 0x00000003 #define HC_XC_Fog 0x00000004 #define HC_XC_HABLRC 0x00000005 #define HC_XC_minSrcDst 0x00000006 #define HC_XC_maxSrcDst 0x00000007 #define HC_XC_mimAsrcInvAdst 0x00000008 #define HC_XC_OPC 0x00000000 #define HC_XC_InvOPC 0x00000010 #define HC_XC_OPCp5 0x00000020 /*-- Define the input Alpha */ #define HC_XA_OPA 0x00000000 #define HC_XA_InvOPA 0x00000010 #define HC_XA_OPAp5 0x00000020 #define HC_XA_0 0x00000000 #define HC_XA_Asrc 0x00000001 #define HC_XA_Adst 0x00000002 #define HC_XA_Fog 0x00000003 #define HC_XA_minAsrcFog 0x00000004 #define HC_XA_minAsrcAdst 0x00000005 #define HC_XA_maxAsrcFog 0x00000006 #define HC_XA_maxAsrcAdst 0x00000007 #define HC_XA_HABLRA 0x00000008 #define HC_XA_minAsrcInvAdst 0x00000008 #define HC_XA_HABLFRA 0x00000009 /*-- */ #define HC_HABLCa_OPC (HC_XC_OPC << 10) #define HC_HABLCa_InvOPC (HC_XC_InvOPC << 10) #define HC_HABLCa_OPCp5 (HC_XC_OPCp5 << 10) #define HC_HABLCa_Csrc (HC_XC_Csrc << 10) #define HC_HABLCa_Cdst (HC_XC_Cdst << 10) #define HC_HABLCa_Asrc (HC_XC_Asrc << 10) #define HC_HABLCa_Adst (HC_XC_Adst << 10) #define HC_HABLCa_Fog (HC_XC_Fog << 10) #define HC_HABLCa_HABLRCa (HC_XC_HABLRC << 10) #define HC_HABLCa_minSrcDst (HC_XC_minSrcDst << 10) #define HC_HABLCa_maxSrcDst (HC_XC_maxSrcDst << 10) #define HC_HABLFCa_OPC (HC_XC_OPC << 4) #define HC_HABLFCa_InvOPC (HC_XC_InvOPC << 4) #define HC_HABLFCa_OPCp5 (HC_XC_OPCp5 << 4) #define HC_HABLFCa_Csrc (HC_XC_Csrc << 4) #define HC_HABLFCa_Cdst (HC_XC_Cdst << 4) #define HC_HABLFCa_Asrc (HC_XC_Asrc << 4) #define HC_HABLFCa_Adst (HC_XC_Adst << 4) #define HC_HABLFCa_Fog (HC_XC_Fog << 4) #define HC_HABLFCa_HABLRCa (HC_XC_HABLRC << 4) #define HC_HABLFCa_minSrcDst (HC_XC_minSrcDst << 4) #define HC_HABLFCa_maxSrcDst (HC_XC_maxSrcDst << 4) #define HC_HABLFCa_mimAsrcInvAdst (HC_XC_mimAsrcInvAdst << 4) #define HC_HABLCbias_HABLRCbias 0x00000000 #define HC_HABLCbias_Asrc 0x00000001 #define HC_HABLCbias_Adst 0x00000002 #define HC_HABLCbias_Fog 0x00000003 #define HC_HABLCbias_Cin 0x00000004 /* HC_SubA_HABLCop 0x0035 */ #define HC_HABLdot_MASK 0x00010000 #define HC_HABLCop_MASK 0x00004000 #define HC_HABLCb_MASK 0x00003f00 #define HC_HABLCb_C_MASK 0x00003000 #define HC_HABLCb_OPC_MASK 0x00000f00 #define HC_HABLFCb_MASK 0x000000fc #define HC_HABLFCb_C_MASK 0x000000c0 #define HC_HABLFCb_OPC_MASK 0x0000003c #define HC_HABLCshift_MASK 0x00000003 #define HC_HABLCb_OPC (HC_XC_OPC << 8) #define HC_HABLCb_InvOPC (HC_XC_InvOPC << 8) #define HC_HABLCb_OPCp5 (HC_XC_OPCp5 << 8) #define HC_HABLCb_Csrc (HC_XC_Csrc << 8) #define HC_HABLCb_Cdst (HC_XC_Cdst << 8) #define HC_HABLCb_Asrc (HC_XC_Asrc << 8) #define HC_HABLCb_Adst (HC_XC_Adst << 8) #define HC_HABLCb_Fog (HC_XC_Fog << 8) #define HC_HABLCb_HABLRCa (HC_XC_HABLRC << 8) #define HC_HABLCb_minSrcDst (HC_XC_minSrcDst << 8) #define HC_HABLCb_maxSrcDst (HC_XC_maxSrcDst << 8) #define HC_HABLFCb_OPC (HC_XC_OPC << 2) #define HC_HABLFCb_InvOPC (HC_XC_InvOPC << 2) #define HC_HABLFCb_OPCp5 (HC_XC_OPCp5 << 2) #define HC_HABLFCb_Csrc (HC_XC_Csrc << 2) #define HC_HABLFCb_Cdst (HC_XC_Cdst << 2) #define HC_HABLFCb_Asrc (HC_XC_Asrc << 2) #define HC_HABLFCb_Adst (HC_XC_Adst << 2) #define HC_HABLFCb_Fog (HC_XC_Fog << 2) #define HC_HABLFCb_HABLRCb (HC_XC_HABLRC << 2) #define HC_HABLFCb_minSrcDst (HC_XC_minSrcDst << 2) #define HC_HABLFCb_maxSrcDst (HC_XC_maxSrcDst << 2) #define HC_HABLFCb_mimAsrcInvAdst (HC_XC_mimAsrcInvAdst << 2) /* HC_SubA_HABLAsat 0x0036 */ #define HC_HABLAsat_MASK 0x00010000 #define HC_HABLAa_MASK 0x0000fc00 #define HC_HABLAa_A_MASK 0x0000c000 #define HC_HABLAa_OPA_MASK 0x00003c00 #define HC_HABLFAa_MASK 0x000003f0 #define HC_HABLFAa_A_MASK 0x00000300 #define HC_HABLFAa_OPA_MASK 0x000000f0 #define HC_HABLAbias_MASK 0x0000000f #define HC_HABLAbias_A_MASK 0x00000008 #define HC_HABLAbias_OPA_MASK 0x00000007 #define HC_HABLAa_OPA (HC_XA_OPA << 10) #define HC_HABLAa_InvOPA (HC_XA_InvOPA << 10) #define HC_HABLAa_OPAp5 (HC_XA_OPAp5 << 10) #define HC_HABLAa_0 (HC_XA_0 << 10) #define HC_HABLAa_Asrc (HC_XA_Asrc << 10) #define HC_HABLAa_Adst (HC_XA_Adst << 10) #define HC_HABLAa_Fog (HC_XA_Fog << 10) #define HC_HABLAa_minAsrcFog (HC_XA_minAsrcFog << 10) #define HC_HABLAa_minAsrcAdst (HC_XA_minAsrcAdst << 10) #define HC_HABLAa_maxAsrcFog (HC_XA_maxAsrcFog << 10) #define HC_HABLAa_maxAsrcAdst (HC_XA_maxAsrcAdst << 10) #define HC_HABLAa_HABLRA (HC_XA_HABLRA << 10) #define HC_HABLFAa_OPA (HC_XA_OPA << 4) #define HC_HABLFAa_InvOPA (HC_XA_InvOPA << 4) #define HC_HABLFAa_OPAp5 (HC_XA_OPAp5 << 4) #define HC_HABLFAa_0 (HC_XA_0 << 4) #define HC_HABLFAa_Asrc (HC_XA_Asrc << 4) #define HC_HABLFAa_Adst (HC_XA_Adst << 4) #define HC_HABLFAa_Fog (HC_XA_Fog << 4) #define HC_HABLFAa_minAsrcFog (HC_XA_minAsrcFog << 4) #define HC_HABLFAa_minAsrcAdst (HC_XA_minAsrcAdst << 4) #define HC_HABLFAa_maxAsrcFog (HC_XA_maxAsrcFog << 4) #define HC_HABLFAa_maxAsrcAdst (HC_XA_maxAsrcAdst << 4) #define HC_HABLFAa_minAsrcInvAdst (HC_XA_minAsrcInvAdst << 4) #define HC_HABLFAa_HABLFRA (HC_XA_HABLFRA << 4) #define HC_HABLAbias_HABLRAbias 0x00000000 #define HC_HABLAbias_Asrc 0x00000001 #define HC_HABLAbias_Adst 0x00000002 #define HC_HABLAbias_Fog 0x00000003 #define HC_HABLAbias_Aaa 0x00000004 /* HC_SubA_HABLAop 0x0037 */ #define HC_HABLAop_MASK 0x00004000 #define HC_HABLAb_MASK 0x00003f00 #define HC_HABLAb_OPA_MASK 0x00000f00 #define HC_HABLFAb_MASK 0x000000fc #define HC_HABLFAb_OPA_MASK 0x0000003c #define HC_HABLAshift_MASK 0x00000003 #define HC_HABLAb_OPA (HC_XA_OPA << 8) #define HC_HABLAb_InvOPA (HC_XA_InvOPA << 8) #define HC_HABLAb_OPAp5 (HC_XA_OPAp5 << 8) #define HC_HABLAb_0 (HC_XA_0 << 8) #define HC_HABLAb_Asrc (HC_XA_Asrc << 8) #define HC_HABLAb_Adst (HC_XA_Adst << 8) #define HC_HABLAb_Fog (HC_XA_Fog << 8) #define HC_HABLAb_minAsrcFog (HC_XA_minAsrcFog << 8) #define HC_HABLAb_minAsrcAdst (HC_XA_minAsrcAdst << 8) #define HC_HABLAb_maxAsrcFog (HC_XA_maxAsrcFog << 8) #define HC_HABLAb_maxAsrcAdst (HC_XA_maxAsrcAdst << 8) #define HC_HABLAb_HABLRA (HC_XA_HABLRA << 8) #define HC_HABLFAb_OPA (HC_XA_OPA << 2) #define HC_HABLFAb_InvOPA (HC_XA_InvOPA << 2) #define HC_HABLFAb_OPAp5 (HC_XA_OPAp5 << 2) #define HC_HABLFAb_0 (HC_XA_0 << 2) #define HC_HABLFAb_Asrc (HC_XA_Asrc << 2) #define HC_HABLFAb_Adst (HC_XA_Adst << 2) #define HC_HABLFAb_Fog (HC_XA_Fog << 2) #define HC_HABLFAb_minAsrcFog (HC_XA_minAsrcFog << 2) #define HC_HABLFAb_minAsrcAdst (HC_XA_minAsrcAdst << 2) #define HC_HABLFAb_maxAsrcFog (HC_XA_maxAsrcFog << 2) #define HC_HABLFAb_maxAsrcAdst (HC_XA_maxAsrcAdst << 2) #define HC_HABLFAb_minAsrcInvAdst (HC_XA_minAsrcInvAdst << 2) #define HC_HABLFAb_HABLFRA (HC_XA_HABLFRA << 2) /* HC_SubA_HABLRAa 0x003d */ #define HC_HABLRAa_MASK 0x00ff0000 #define HC_HABLRFAa_MASK 0x0000ff00 #define HC_HABLRAbias_MASK 0x000000ff #define HC_HABLRAa_SHIFT 16 #define HC_HABLRFAa_SHIFT 8 /* HC_SubA_HABLRAb 0x003e */ #define HC_HABLRAb_MASK 0x0000ff00 #define HC_HABLRFAb_MASK 0x000000ff #define HC_HABLRAb_SHIFT 8 /* Destination Setting */ #define HC_SubA_HDBBasL 0x0040 #define HC_SubA_HDBBasH 0x0041 #define HC_SubA_HDBFM 0x0042 #define HC_SubA_HFBBMSKL 0x0043 #define HC_SubA_HROP 0x0044 /* HC_SubA_HDBFM 0x0042 */ #define HC_HDBFM_MASK 0x001f0000 #define HC_HDBLoc_MASK 0x0000c000 #define HC_HDBPit_MASK 0x00003fff #define HC_HDBFM_RGB555 0x00000000 #define HC_HDBFM_RGB565 0x00010000 #define HC_HDBFM_ARGB4444 0x00020000 #define HC_HDBFM_ARGB1555 0x00030000 #define HC_HDBFM_BGR555 0x00040000 #define HC_HDBFM_BGR565 0x00050000 #define HC_HDBFM_ABGR4444 0x00060000 #define HC_HDBFM_ABGR1555 0x00070000 #define HC_HDBFM_ARGB0888 0x00080000 #define HC_HDBFM_ARGB8888 0x00090000 #define HC_HDBFM_ABGR0888 0x000a0000 #define HC_HDBFM_ABGR8888 0x000b0000 #define HC_HDBLoc_Local 0x00000000 #define HC_HDBLoc_Sys 0x00004000 /* HC_SubA_HROP 0x0044 */ #define HC_HROP_MASK 0x00000f00 #define HC_HFBBMSKH_MASK 0x000000ff #define HC_HROP_BLACK 0x00000000 #define HC_HROP_DPon 0x00000100 #define HC_HROP_DPna 0x00000200 #define HC_HROP_Pn 0x00000300 #define HC_HROP_PDna 0x00000400 #define HC_HROP_Dn 0x00000500 #define HC_HROP_DPx 0x00000600 #define HC_HROP_DPan 0x00000700 #define HC_HROP_DPa 0x00000800 #define HC_HROP_DPxn 0x00000900 #define HC_HROP_D 0x00000a00 #define HC_HROP_DPno 0x00000b00 #define HC_HROP_P 0x00000c00 #define HC_HROP_PDno 0x00000d00 #define HC_HROP_DPo 0x00000e00 #define HC_HROP_WHITE 0x00000f00 /* Fog Setting */ #define HC_SubA_HFogLF 0x0050 #define HC_SubA_HFogCL 0x0051 #define HC_SubA_HFogCH 0x0052 #define HC_SubA_HFogStL 0x0053 #define HC_SubA_HFogStH 0x0054 #define HC_SubA_HFogOOdMF 0x0055 #define HC_SubA_HFogOOdEF 0x0056 #define HC_SubA_HFogEndL 0x0057 #define HC_SubA_HFogDenst 0x0058 /* HC_SubA_FogLF 0x0050 */ #define HC_FogLF_MASK 0x00000010 #define HC_FogEq_MASK 0x00000008 #define HC_FogMD_MASK 0x00000007 #define HC_FogMD_LocalFog 0x00000000 #define HC_FogMD_LinearFog 0x00000002 #define HC_FogMD_ExponentialFog 0x00000004 #define HC_FogMD_Exponential2Fog 0x00000005 /* #define HC_FogMD_FogTable 0x00000003 */ /* HC_SubA_HFogDenst 0x0058 */ #define HC_FogDenst_MASK 0x001fff00 #define HC_FogEndL_MASK 0x000000ff /* Texture subtype definitions */ #define HC_SubType_Tex0 0x00000000 #define HC_SubType_Tex1 0x00000001 #define HC_SubType_TexGeneral 0x000000fe /* Attribute of texture n */ #define HC_SubA_HTXnL0BasL 0x0000 #define HC_SubA_HTXnL1BasL 0x0001 #define HC_SubA_HTXnL2BasL 0x0002 #define HC_SubA_HTXnL3BasL 0x0003 #define HC_SubA_HTXnL4BasL 0x0004 #define HC_SubA_HTXnL5BasL 0x0005 #define HC_SubA_HTXnL6BasL 0x0006 #define HC_SubA_HTXnL7BasL 0x0007 #define HC_SubA_HTXnL8BasL 0x0008 #define HC_SubA_HTXnL9BasL 0x0009 #define HC_SubA_HTXnLaBasL 0x000a #define HC_SubA_HTXnLbBasL 0x000b #define HC_SubA_HTXnLcBasL 0x000c #define HC_SubA_HTXnLdBasL 0x000d #define HC_SubA_HTXnLeBasL 0x000e #define HC_SubA_HTXnLfBasL 0x000f #define HC_SubA_HTXnL10BasL 0x0010 #define HC_SubA_HTXnL11BasL 0x0011 #define HC_SubA_HTXnL012BasH 0x0020 #define HC_SubA_HTXnL345BasH 0x0021 #define HC_SubA_HTXnL678BasH 0x0022 #define HC_SubA_HTXnL9abBasH 0x0023 #define HC_SubA_HTXnLcdeBasH 0x0024 #define HC_SubA_HTXnLf1011BasH 0x0025 #define HC_SubA_HTXnL0Pit 0x002b #define HC_SubA_HTXnL1Pit 0x002c #define HC_SubA_HTXnL2Pit 0x002d #define HC_SubA_HTXnL3Pit 0x002e #define HC_SubA_HTXnL4Pit 0x002f #define HC_SubA_HTXnL5Pit 0x0030 #define HC_SubA_HTXnL6Pit 0x0031 #define HC_SubA_HTXnL7Pit 0x0032 #define HC_SubA_HTXnL8Pit 0x0033 #define HC_SubA_HTXnL9Pit 0x0034 #define HC_SubA_HTXnLaPit 0x0035 #define HC_SubA_HTXnLbPit 0x0036 #define HC_SubA_HTXnLcPit 0x0037 #define HC_SubA_HTXnLdPit 0x0038 #define HC_SubA_HTXnLePit 0x0039 #define HC_SubA_HTXnLfPit 0x003a #define HC_SubA_HTXnL10Pit 0x003b #define HC_SubA_HTXnL11Pit 0x003c #define HC_SubA_HTXnL0_5WE 0x004b #define HC_SubA_HTXnL6_bWE 0x004c #define HC_SubA_HTXnLc_11WE 0x004d #define HC_SubA_HTXnL0_5HE 0x0051 #define HC_SubA_HTXnL6_bHE 0x0052 #define HC_SubA_HTXnLc_11HE 0x0053 #define HC_SubA_HTXnL0OS 0x0077 #define HC_SubA_HTXnTB 0x0078 #define HC_SubA_HTXnMPMD 0x0079 #define HC_SubA_HTXnCLODu 0x007a #define HC_SubA_HTXnFM 0x007b #define HC_SubA_HTXnTRCH 0x007c #define HC_SubA_HTXnTRCL 0x007d #define HC_SubA_HTXnTBC 0x007e #define HC_SubA_HTXnTRAH 0x007f #define HC_SubA_HTXnTBLCsat 0x0080 #define HC_SubA_HTXnTBLCop 0x0081 #define HC_SubA_HTXnTBLMPfog 0x0082 #define HC_SubA_HTXnTBLAsat 0x0083 #define HC_SubA_HTXnTBLRCa 0x0085 #define HC_SubA_HTXnTBLRCb 0x0086 #define HC_SubA_HTXnTBLRCc 0x0087 #define HC_SubA_HTXnTBLRCbias 0x0088 #define HC_SubA_HTXnTBLRAa 0x0089 #define HC_SubA_HTXnTBLRFog 0x008a #define HC_SubA_HTXnBumpM00 0x0090 #define HC_SubA_HTXnBumpM01 0x0091 #define HC_SubA_HTXnBumpM10 0x0092 #define HC_SubA_HTXnBumpM11 0x0093 #define HC_SubA_HTXnLScale 0x0094 #define HC_SubA_HTXSMD 0x0000 /* HC_SubA_HTXnL012BasH 0x0020 */ #define HC_HTXnL0BasH_MASK 0x000000ff #define HC_HTXnL1BasH_MASK 0x0000ff00 #define HC_HTXnL2BasH_MASK 0x00ff0000 #define HC_HTXnL1BasH_SHIFT 8 #define HC_HTXnL2BasH_SHIFT 16 /* HC_SubA_HTXnL345BasH 0x0021 */ #define HC_HTXnL3BasH_MASK 0x000000ff #define HC_HTXnL4BasH_MASK 0x0000ff00 #define HC_HTXnL5BasH_MASK 0x00ff0000 #define HC_HTXnL4BasH_SHIFT 8 #define HC_HTXnL5BasH_SHIFT 16 /* HC_SubA_HTXnL678BasH 0x0022 */ #define HC_HTXnL6BasH_MASK 0x000000ff #define HC_HTXnL7BasH_MASK 0x0000ff00 #define HC_HTXnL8BasH_MASK 0x00ff0000 #define HC_HTXnL7BasH_SHIFT 8 #define HC_HTXnL8BasH_SHIFT 16 /* HC_SubA_HTXnL9abBasH 0x0023 */ #define HC_HTXnL9BasH_MASK 0x000000ff #define HC_HTXnLaBasH_MASK 0x0000ff00 #define HC_HTXnLbBasH_MASK 0x00ff0000 #define HC_HTXnLaBasH_SHIFT 8 #define HC_HTXnLbBasH_SHIFT 16 /* HC_SubA_HTXnLcdeBasH 0x0024 */ #define HC_HTXnLcBasH_MASK 0x000000ff #define HC_HTXnLdBasH_MASK 0x0000ff00 #define HC_HTXnLeBasH_MASK 0x00ff0000 #define HC_HTXnLdBasH_SHIFT 8 #define HC_HTXnLeBasH_SHIFT 16 /* HC_SubA_HTXnLcdeBasH 0x0025 */ #define HC_HTXnLfBasH_MASK 0x000000ff #define HC_HTXnL10BasH_MASK 0x0000ff00 #define HC_HTXnL11BasH_MASK 0x00ff0000 #define HC_HTXnL10BasH_SHIFT 8 #define HC_HTXnL11BasH_SHIFT 16 /* HC_SubA_HTXnL0Pit 0x002b */ #define HC_HTXnLnPit_MASK 0x00003fff #define HC_HTXnEnPit_MASK 0x00080000 #define HC_HTXnLnPitE_MASK 0x00f00000 #define HC_HTXnLnPitE_SHIFT 20 /* HC_SubA_HTXnL0_5WE 0x004b */ #define HC_HTXnL0WE_MASK 0x0000000f #define HC_HTXnL1WE_MASK 0x000000f0 #define HC_HTXnL2WE_MASK 0x00000f00 #define HC_HTXnL3WE_MASK 0x0000f000 #define HC_HTXnL4WE_MASK 0x000f0000 #define HC_HTXnL5WE_MASK 0x00f00000 #define HC_HTXnL1WE_SHIFT 4 #define HC_HTXnL2WE_SHIFT 8 #define HC_HTXnL3WE_SHIFT 12 #define HC_HTXnL4WE_SHIFT 16 #define HC_HTXnL5WE_SHIFT 20 /* HC_SubA_HTXnL6_bWE 0x004c */ #define HC_HTXnL6WE_MASK 0x0000000f #define HC_HTXnL7WE_MASK 0x000000f0 #define HC_HTXnL8WE_MASK 0x00000f00 #define HC_HTXnL9WE_MASK 0x0000f000 #define HC_HTXnLaWE_MASK 0x000f0000 #define HC_HTXnLbWE_MASK 0x00f00000 #define HC_HTXnL7WE_SHIFT 4 #define HC_HTXnL8WE_SHIFT 8 #define HC_HTXnL9WE_SHIFT 12 #define HC_HTXnLaWE_SHIFT 16 #define HC_HTXnLbWE_SHIFT 20 /* HC_SubA_HTXnLc_11WE 0x004d */ #define HC_HTXnLcWE_MASK 0x0000000f #define HC_HTXnLdWE_MASK 0x000000f0 #define HC_HTXnLeWE_MASK 0x00000f00 #define HC_HTXnLfWE_MASK 0x0000f000 #define HC_HTXnL10WE_MASK 0x000f0000 #define HC_HTXnL11WE_MASK 0x00f00000 #define HC_HTXnLdWE_SHIFT 4 #define HC_HTXnLeWE_SHIFT 8 #define HC_HTXnLfWE_SHIFT 12 #define HC_HTXnL10WE_SHIFT 16 #define HC_HTXnL11WE_SHIFT 20 /* HC_SubA_HTXnL0_5HE 0x0051 */ #define HC_HTXnL0HE_MASK 0x0000000f #define HC_HTXnL1HE_MASK 0x000000f0 #define HC_HTXnL2HE_MASK 0x00000f00 #define HC_HTXnL3HE_MASK 0x0000f000 #define HC_HTXnL4HE_MASK 0x000f0000 #define HC_HTXnL5HE_MASK 0x00f00000 #define HC_HTXnL1HE_SHIFT 4 #define HC_HTXnL2HE_SHIFT 8 #define HC_HTXnL3HE_SHIFT 12 #define HC_HTXnL4HE_SHIFT 16 #define HC_HTXnL5HE_SHIFT 20 /* HC_SubA_HTXnL6_bHE 0x0052 */ #define HC_HTXnL6HE_MASK 0x0000000f #define HC_HTXnL7HE_MASK 0x000000f0 #define HC_HTXnL8HE_MASK 0x00000f00 #define HC_HTXnL9HE_MASK 0x0000f000 #define HC_HTXnLaHE_MASK 0x000f0000 #define HC_HTXnLbHE_MASK 0x00f00000 #define HC_HTXnL7HE_SHIFT 4 #define HC_HTXnL8HE_SHIFT 8 #define HC_HTXnL9HE_SHIFT 12 #define HC_HTXnLaHE_SHIFT 16 #define HC_HTXnLbHE_SHIFT 20 /* HC_SubA_HTXnLc_11HE 0x0053 */ #define HC_HTXnLcHE_MASK 0x0000000f #define HC_HTXnLdHE_MASK 0x000000f0 #define HC_HTXnLeHE_MASK 0x00000f00 #define HC_HTXnLfHE_MASK 0x0000f000 #define HC_HTXnL10HE_MASK 0x000f0000 #define HC_HTXnL11HE_MASK 0x00f00000 #define HC_HTXnLdHE_SHIFT 4 #define HC_HTXnLeHE_SHIFT 8 #define HC_HTXnLfHE_SHIFT 12 #define HC_HTXnL10HE_SHIFT 16 #define HC_HTXnL11HE_SHIFT 20 /* HC_SubA_HTXnL0OS 0x0077 */ #define HC_HTXnL0OS_MASK 0x003ff000 #define HC_HTXnLVmax_MASK 0x00000fc0 #define HC_HTXnLVmin_MASK 0x0000003f #define HC_HTXnL0OS_SHIFT 12 #define HC_HTXnLVmax_SHIFT 6 /* HC_SubA_HTXnTB 0x0078 */ #define HC_HTXnTB_MASK 0x00f00000 #define HC_HTXnFLSe_MASK 0x0000e000 #define HC_HTXnFLSs_MASK 0x00001c00 #define HC_HTXnFLTe_MASK 0x00000380 #define HC_HTXnFLTs_MASK 0x00000070 #define HC_HTXnFLDs_MASK 0x0000000f #define HC_HTXnTB_NoTB 0x00000000 #define HC_HTXnTB_TBC_S 0x00100000 #define HC_HTXnTB_TBC_T 0x00200000 #define HC_HTXnTB_TB_S 0x00400000 #define HC_HTXnTB_TB_T 0x00800000 #define HC_HTXnFLSe_Nearest 0x00000000 #define HC_HTXnFLSe_Linear 0x00002000 #define HC_HTXnFLSe_NonLinear 0x00004000 #define HC_HTXnFLSe_Sharp 0x00008000 #define HC_HTXnFLSe_Flat_Gaussian_Cubic 0x0000c000 #define HC_HTXnFLSs_Nearest 0x00000000 #define HC_HTXnFLSs_Linear 0x00000400 #define HC_HTXnFLSs_NonLinear 0x00000800 #define HC_HTXnFLSs_Flat_Gaussian_Cubic 0x00001800 #define HC_HTXnFLTe_Nearest 0x00000000 #define HC_HTXnFLTe_Linear 0x00000080 #define HC_HTXnFLTe_NonLinear 0x00000100 #define HC_HTXnFLTe_Sharp 0x00000180 #define HC_HTXnFLTe_Flat_Gaussian_Cubic 0x00000300 #define HC_HTXnFLTs_Nearest 0x00000000 #define HC_HTXnFLTs_Linear 0x00000010 #define HC_HTXnFLTs_NonLinear 0x00000020 #define HC_HTXnFLTs_Flat_Gaussian_Cubic 0x00000060 #define HC_HTXnFLDs_Tex0 0x00000000 #define HC_HTXnFLDs_Nearest 0x00000001 #define HC_HTXnFLDs_Linear 0x00000002 #define HC_HTXnFLDs_NonLinear 0x00000003 #define HC_HTXnFLDs_Dither 0x00000004 #define HC_HTXnFLDs_ConstLOD 0x00000005 #define HC_HTXnFLDs_Ani 0x00000006 #define HC_HTXnFLDs_AniDither 0x00000007 /* HC_SubA_HTXnMPMD 0x0079 */ #define HC_HTXnMPMD_SMASK 0x00070000 #define HC_HTXnMPMD_TMASK 0x00380000 #define HC_HTXnLODDTf_MASK 0x00000007 #define HC_HTXnXY2ST_MASK 0x00000008 #define HC_HTXnMPMD_Tsingle 0x00000000 #define HC_HTXnMPMD_Tclamp 0x00080000 #define HC_HTXnMPMD_Trepeat 0x00100000 #define HC_HTXnMPMD_Tmirror 0x00180000 #define HC_HTXnMPMD_Twrap 0x00200000 #define HC_HTXnMPMD_Ssingle 0x00000000 #define HC_HTXnMPMD_Sclamp 0x00010000 #define HC_HTXnMPMD_Srepeat 0x00020000 #define HC_HTXnMPMD_Smirror 0x00030000 #define HC_HTXnMPMD_Swrap 0x00040000 /* HC_SubA_HTXnCLODu 0x007a */ #define HC_HTXnCLODu_MASK 0x000ffc00 #define HC_HTXnCLODd_MASK 0x000003ff #define HC_HTXnCLODu_SHIFT 10 /* HC_SubA_HTXnFM 0x007b */ #define HC_HTXnFM_MASK 0x00ff0000 #define HC_HTXnLoc_MASK 0x00000003 #define HC_HTXnFM_INDEX 0x00000000 #define HC_HTXnFM_Intensity 0x00080000 #define HC_HTXnFM_Lum 0x00100000 #define HC_HTXnFM_Alpha 0x00180000 #define HC_HTXnFM_DX 0x00280000 #define HC_HTXnFM_ARGB16 0x00880000 #define HC_HTXnFM_ARGB32 0x00980000 #define HC_HTXnFM_ABGR16 0x00a80000 #define HC_HTXnFM_ABGR32 0x00b80000 #define HC_HTXnFM_RGBA16 0x00c80000 #define HC_HTXnFM_RGBA32 0x00d80000 #define HC_HTXnFM_BGRA16 0x00e80000 #define HC_HTXnFM_BGRA32 0x00f80000 #define HC_HTXnFM_BUMPMAP 0x00380000 #define HC_HTXnFM_Index1 (HC_HTXnFM_INDEX | 0x00000000) #define HC_HTXnFM_Index2 (HC_HTXnFM_INDEX | 0x00010000) #define HC_HTXnFM_Index4 (HC_HTXnFM_INDEX | 0x00020000) #define HC_HTXnFM_Index8 (HC_HTXnFM_INDEX | 0x00030000) #define HC_HTXnFM_T1 (HC_HTXnFM_Intensity | 0x00000000) #define HC_HTXnFM_T2 (HC_HTXnFM_Intensity | 0x00010000) #define HC_HTXnFM_T4 (HC_HTXnFM_Intensity | 0x00020000) #define HC_HTXnFM_T8 (HC_HTXnFM_Intensity | 0x00030000) #define HC_HTXnFM_L1 (HC_HTXnFM_Lum | 0x00000000) #define HC_HTXnFM_L2 (HC_HTXnFM_Lum | 0x00010000) #define HC_HTXnFM_L4 (HC_HTXnFM_Lum | 0x00020000) #define HC_HTXnFM_L8 (HC_HTXnFM_Lum | 0x00030000) #define HC_HTXnFM_AL44 (HC_HTXnFM_Lum | 0x00040000) #define HC_HTXnFM_AL88 (HC_HTXnFM_Lum | 0x00050000) #define HC_HTXnFM_A1 (HC_HTXnFM_Alpha | 0x00000000) #define HC_HTXnFM_A2 (HC_HTXnFM_Alpha | 0x00010000) #define HC_HTXnFM_A4 (HC_HTXnFM_Alpha | 0x00020000) #define HC_HTXnFM_A8 (HC_HTXnFM_Alpha | 0x00030000) #define HC_HTXnFM_DX1 (HC_HTXnFM_DX | 0x00010000) #define HC_HTXnFM_DX23 (HC_HTXnFM_DX | 0x00020000) #define HC_HTXnFM_DX45 (HC_HTXnFM_DX | 0x00030000) #define HC_HTXnFM_RGB555 (HC_HTXnFM_ARGB16 | 0x00000000) #define HC_HTXnFM_RGB565 (HC_HTXnFM_ARGB16 | 0x00010000) #define HC_HTXnFM_ARGB1555 (HC_HTXnFM_ARGB16 | 0x00020000) #define HC_HTXnFM_ARGB4444 (HC_HTXnFM_ARGB16 | 0x00030000) #define HC_HTXnFM_ARGB0888 (HC_HTXnFM_ARGB32 | 0x00000000) #define HC_HTXnFM_ARGB8888 (HC_HTXnFM_ARGB32 | 0x00010000) #define HC_HTXnFM_BGR555 (HC_HTXnFM_ABGR16 | 0x00000000) #define HC_HTXnFM_BGR565 (HC_HTXnFM_ABGR16 | 0x00010000) #define HC_HTXnFM_ABGR1555 (HC_HTXnFM_ABGR16 | 0x00020000) #define HC_HTXnFM_ABGR4444 (HC_HTXnFM_ABGR16 | 0x00030000) #define HC_HTXnFM_ABGR0888 (HC_HTXnFM_ABGR32 | 0x00000000) #define HC_HTXnFM_ABGR8888 (HC_HTXnFM_ABGR32 | 0x00010000) #define HC_HTXnFM_RGBA5550 (HC_HTXnFM_RGBA16 | 0x00000000) #define HC_HTXnFM_RGBA5551 (HC_HTXnFM_RGBA16 | 0x00020000) #define HC_HTXnFM_RGBA4444 (HC_HTXnFM_RGBA16 | 0x00030000) #define HC_HTXnFM_RGBA8880 (HC_HTXnFM_RGBA32 | 0x00000000) #define HC_HTXnFM_RGBA8888 (HC_HTXnFM_RGBA32 | 0x00010000) #define HC_HTXnFM_BGRA5550 (HC_HTXnFM_BGRA16 | 0x00000000) #define HC_HTXnFM_BGRA5551 (HC_HTXnFM_BGRA16 | 0x00020000) #define HC_HTXnFM_BGRA4444 (HC_HTXnFM_BGRA16 | 0x00030000) #define HC_HTXnFM_BGRA8880 (HC_HTXnFM_BGRA32 | 0x00000000) #define HC_HTXnFM_BGRA8888 (HC_HTXnFM_BGRA32 | 0x00010000) #define HC_HTXnFM_VU88 (HC_HTXnFM_BUMPMAP | 0x00000000) #define HC_HTXnFM_LVU655 (HC_HTXnFM_BUMPMAP | 0x00010000) #define HC_HTXnFM_LVU888 (HC_HTXnFM_BUMPMAP | 0x00020000) #define HC_HTXnLoc_Local 0x00000000 #define HC_HTXnLoc_Sys 0x00000002 #define HC_HTXnLoc_AGP 0x00000003 /* HC_SubA_HTXnTRAH 0x007f */ #define HC_HTXnTRAH_MASK 0x00ff0000 #define HC_HTXnTRAL_MASK 0x0000ff00 #define HC_HTXnTBA_MASK 0x000000ff #define HC_HTXnTRAH_SHIFT 16 #define HC_HTXnTRAL_SHIFT 8 /* HC_SubA_HTXnTBLCsat 0x0080 *-- Define the input texture. */ #define HC_XTC_TOPC 0x00000000 #define HC_XTC_InvTOPC 0x00000010 #define HC_XTC_TOPCp5 0x00000020 #define HC_XTC_Cbias 0x00000000 #define HC_XTC_InvCbias 0x00000010 #define HC_XTC_0 0x00000000 #define HC_XTC_Dif 0x00000001 #define HC_XTC_Spec 0x00000002 #define HC_XTC_Tex 0x00000003 #define HC_XTC_Cur 0x00000004 #define HC_XTC_Adif 0x00000005 #define HC_XTC_Fog 0x00000006 #define HC_XTC_Atex 0x00000007 #define HC_XTC_Acur 0x00000008 #define HC_XTC_HTXnTBLRC 0x00000009 #define HC_XTC_Ctexnext 0x0000000a /*-- */ #define HC_HTXnTBLCsat_MASK 0x00800000 #define HC_HTXnTBLCa_MASK 0x000fc000 #define HC_HTXnTBLCb_MASK 0x00001f80 #define HC_HTXnTBLCc_MASK 0x0000003f #define HC_HTXnTBLCa_TOPC (HC_XTC_TOPC << 14) #define HC_HTXnTBLCa_InvTOPC (HC_XTC_InvTOPC << 14) #define HC_HTXnTBLCa_TOPCp5 (HC_XTC_TOPCp5 << 14) #define HC_HTXnTBLCa_0 (HC_XTC_0 << 14) #define HC_HTXnTBLCa_Dif (HC_XTC_Dif << 14) #define HC_HTXnTBLCa_Spec (HC_XTC_Spec << 14) #define HC_HTXnTBLCa_Tex (HC_XTC_Tex << 14) #define HC_HTXnTBLCa_Cur (HC_XTC_Cur << 14) #define HC_HTXnTBLCa_Adif (HC_XTC_Adif << 14) #define HC_HTXnTBLCa_Fog (HC_XTC_Fog << 14) #define HC_HTXnTBLCa_Atex (HC_XTC_Atex << 14) #define HC_HTXnTBLCa_Acur (HC_XTC_Acur << 14) #define HC_HTXnTBLCa_HTXnTBLRC (HC_XTC_HTXnTBLRC << 14) #define HC_HTXnTBLCa_Ctexnext (HC_XTC_Ctexnext << 14) #define HC_HTXnTBLCb_TOPC (HC_XTC_TOPC << 7) #define HC_HTXnTBLCb_InvTOPC (HC_XTC_InvTOPC << 7) #define HC_HTXnTBLCb_TOPCp5 (HC_XTC_TOPCp5 << 7) #define HC_HTXnTBLCb_0 (HC_XTC_0 << 7) #define HC_HTXnTBLCb_Dif (HC_XTC_Dif << 7) #define HC_HTXnTBLCb_Spec (HC_XTC_Spec << 7) #define HC_HTXnTBLCb_Tex (HC_XTC_Tex << 7) #define HC_HTXnTBLCb_Cur (HC_XTC_Cur << 7) #define HC_HTXnTBLCb_Adif (HC_XTC_Adif << 7) #define HC_HTXnTBLCb_Fog (HC_XTC_Fog << 7) #define HC_HTXnTBLCb_Atex (HC_XTC_Atex << 7) #define HC_HTXnTBLCb_Acur (HC_XTC_Acur << 7) #define HC_HTXnTBLCb_HTXnTBLRC (HC_XTC_HTXnTBLRC << 7) #define HC_HTXnTBLCb_Ctexnext (HC_XTC_Ctexnext << 7) #define HC_HTXnTBLCc_TOPC (HC_XTC_TOPC << 0) #define HC_HTXnTBLCc_InvTOPC (HC_XTC_InvTOPC << 0) #define HC_HTXnTBLCc_TOPCp5 (HC_XTC_TOPCp5 << 0) #define HC_HTXnTBLCc_0 (HC_XTC_0 << 0) #define HC_HTXnTBLCc_Dif (HC_XTC_Dif << 0) #define HC_HTXnTBLCc_Spec (HC_XTC_Spec << 0) #define HC_HTXnTBLCc_Tex (HC_XTC_Tex << 0) #define HC_HTXnTBLCc_Cur (HC_XTC_Cur << 0) #define HC_HTXnTBLCc_Adif (HC_XTC_Adif << 0) #define HC_HTXnTBLCc_Fog (HC_XTC_Fog << 0) #define HC_HTXnTBLCc_Atex (HC_XTC_Atex << 0) #define HC_HTXnTBLCc_Acur (HC_XTC_Acur << 0) #define HC_HTXnTBLCc_HTXnTBLRC (HC_XTC_HTXnTBLRC << 0) #define HC_HTXnTBLCc_Ctexnext (HC_XTC_Ctexnext << 0) /* HC_SubA_HTXnTBLCop 0x0081 */ #define HC_HTXnTBLdot_MASK 0x00c00000 #define HC_HTXnTBLCop_MASK 0x00380000 #define HC_HTXnTBLCbias_MASK 0x0007c000 #define HC_HTXnTBLCshift_MASK 0x00001800 #define HC_HTXnTBLAop_MASK 0x00000380 #define HC_HTXnTBLAbias_MASK 0x00000078 #define HC_HTXnTBLAshift_MASK 0x00000003 #define HC_HTXnTBLCop_Add 0x00000000 #define HC_HTXnTBLCop_Sub 0x00080000 #define HC_HTXnTBLCop_Min 0x00100000 #define HC_HTXnTBLCop_Max 0x00180000 #define HC_HTXnTBLCop_Mask 0x00200000 #define HC_HTXnTBLCbias_Cbias (HC_XTC_Cbias << 14) #define HC_HTXnTBLCbias_InvCbias (HC_XTC_InvCbias << 14) #define HC_HTXnTBLCbias_0 (HC_XTC_0 << 14) #define HC_HTXnTBLCbias_Dif (HC_XTC_Dif << 14) #define HC_HTXnTBLCbias_Spec (HC_XTC_Spec << 14) #define HC_HTXnTBLCbias_Tex (HC_XTC_Tex << 14) #define HC_HTXnTBLCbias_Cur (HC_XTC_Cur << 14) #define HC_HTXnTBLCbias_Adif (HC_XTC_Adif << 14) #define HC_HTXnTBLCbias_Fog (HC_XTC_Fog << 14) #define HC_HTXnTBLCbias_Atex (HC_XTC_Atex << 14) #define HC_HTXnTBLCbias_Acur (HC_XTC_Acur << 14) #define HC_HTXnTBLCbias_HTXnTBLRC (HC_XTC_HTXnTBLRC << 14) #define HC_HTXnTBLCshift_1 0x00000000 #define HC_HTXnTBLCshift_2 0x00000800 #define HC_HTXnTBLCshift_No 0x00001000 #define HC_HTXnTBLCshift_DotP 0x00001800 /*=* John Sheng [2003.7.18] texture combine *=*/ #define HC_HTXnTBLDOT3 0x00080000 #define HC_HTXnTBLDOT4 0x000C0000 #define HC_HTXnTBLAop_Add 0x00000000 #define HC_HTXnTBLAop_Sub 0x00000080 #define HC_HTXnTBLAop_Min 0x00000100 #define HC_HTXnTBLAop_Max 0x00000180 #define HC_HTXnTBLAop_Mask 0x00000200 #define HC_HTXnTBLAbias_Inv 0x00000040 #define HC_HTXnTBLAbias_Adif 0x00000000 #define HC_HTXnTBLAbias_Fog 0x00000008 #define HC_HTXnTBLAbias_Acur 0x00000010 #define HC_HTXnTBLAbias_HTXnTBLRAbias 0x00000018 #define HC_HTXnTBLAbias_Atex 0x00000020 #define HC_HTXnTBLAshift_1 0x00000000 #define HC_HTXnTBLAshift_2 0x00000001 #define HC_HTXnTBLAshift_No 0x00000002 /* #define HC_HTXnTBLAshift_DotP 0x00000003 */ /* HC_SubA_HTXnTBLMPFog 0x0082 */ #define HC_HTXnTBLMPfog_MASK 0x00e00000 #define HC_HTXnTBLMPfog_0 0x00000000 #define HC_HTXnTBLMPfog_Adif 0x00200000 #define HC_HTXnTBLMPfog_Fog 0x00400000 #define HC_HTXnTBLMPfog_Atex 0x00600000 #define HC_HTXnTBLMPfog_Acur 0x00800000 #define HC_HTXnTBLMPfog_GHTXnTBLRFog 0x00a00000 /* HC_SubA_HTXnTBLAsat 0x0083 *-- Define the texture alpha input. */ #define HC_XTA_TOPA 0x00000000 #define HC_XTA_InvTOPA 0x00000008 #define HC_XTA_TOPAp5 0x00000010 #define HC_XTA_Adif 0x00000000 #define HC_XTA_Fog 0x00000001 #define HC_XTA_Acur 0x00000002 #define HC_XTA_HTXnTBLRA 0x00000003 #define HC_XTA_Atex 0x00000004 #define HC_XTA_Atexnext 0x00000005 /*-- */ #define HC_HTXnTBLAsat_MASK 0x00800000 #define HC_HTXnTBLAMB_MASK 0x00700000 #define HC_HTXnTBLAa_MASK 0x0007c000 #define HC_HTXnTBLAb_MASK 0x00000f80 #define HC_HTXnTBLAc_MASK 0x0000001f #define HC_HTXnTBLAMB_SHIFT 20 #define HC_HTXnTBLAa_TOPA (HC_XTA_TOPA << 14) #define HC_HTXnTBLAa_InvTOPA (HC_XTA_InvTOPA << 14) #define HC_HTXnTBLAa_TOPAp5 (HC_XTA_TOPAp5 << 14) #define HC_HTXnTBLAa_Adif (HC_XTA_Adif << 14) #define HC_HTXnTBLAa_Fog (HC_XTA_Fog << 14) #define HC_HTXnTBLAa_Acur (HC_XTA_Acur << 14) #define HC_HTXnTBLAa_HTXnTBLRA (HC_XTA_HTXnTBLRA << 14) #define HC_HTXnTBLAa_Atex (HC_XTA_Atex << 14) #define HC_HTXnTBLAa_Atexnext (HC_XTA_Atexnext << 14) #define HC_HTXnTBLAb_TOPA (HC_XTA_TOPA << 7) #define HC_HTXnTBLAb_InvTOPA (HC_XTA_InvTOPA << 7) #define HC_HTXnTBLAb_TOPAp5 (HC_XTA_TOPAp5 << 7) #define HC_HTXnTBLAb_Adif (HC_XTA_Adif << 7) #define HC_HTXnTBLAb_Fog (HC_XTA_Fog << 7) #define HC_HTXnTBLAb_Acur (HC_XTA_Acur << 7) #define HC_HTXnTBLAb_HTXnTBLRA (HC_XTA_HTXnTBLRA << 7) #define HC_HTXnTBLAb_Atex (HC_XTA_Atex << 7) #define HC_HTXnTBLAb_Atexnext (HC_XTA_Atexnext << 7) #define HC_HTXnTBLAc_TOPA (HC_XTA_TOPA << 0) #define HC_HTXnTBLAc_InvTOPA (HC_XTA_InvTOPA << 0) #define HC_HTXnTBLAc_TOPAp5 (HC_XTA_TOPAp5 << 0) #define HC_HTXnTBLAc_Adif (HC_XTA_Adif << 0) #define HC_HTXnTBLAc_Fog (HC_XTA_Fog << 0) #define HC_HTXnTBLAc_Acur (HC_XTA_Acur << 0) #define HC_HTXnTBLAc_HTXnTBLRA (HC_XTA_HTXnTBLRA << 0) #define HC_HTXnTBLAc_Atex (HC_XTA_Atex << 0) #define HC_HTXnTBLAc_Atexnext (HC_XTA_Atexnext << 0) /* HC_SubA_HTXnTBLRAa 0x0089 */ #define HC_HTXnTBLRAa_MASK 0x00ff0000 #define HC_HTXnTBLRAb_MASK 0x0000ff00 #define HC_HTXnTBLRAc_MASK 0x000000ff #define HC_HTXnTBLRAa_SHIFT 16 #define HC_HTXnTBLRAb_SHIFT 8 #define HC_HTXnTBLRAc_SHIFT 0 /* HC_SubA_HTXnTBLRFog 0x008a */ #define HC_HTXnTBLRFog_MASK 0x0000ff00 #define HC_HTXnTBLRAbias_MASK 0x000000ff #define HC_HTXnTBLRFog_SHIFT 8 #define HC_HTXnTBLRAbias_SHIFT 0 /* HC_SubA_HTXnLScale 0x0094 */ #define HC_HTXnLScale_MASK 0x0007fc00 #define HC_HTXnLOff_MASK 0x000001ff #define HC_HTXnLScale_SHIFT 10 /* HC_SubA_HTXSMD 0x0000 */ #define HC_HTXSMD_MASK 0x00000080 #define HC_HTXTMD_MASK 0x00000040 #define HC_HTXNum_MASK 0x00000038 #define HC_HTXTRMD_MASK 0x00000006 #define HC_HTXCHCLR_MASK 0x00000001 #define HC_HTXNum_SHIFT 3 /* Texture Palette n */ #define HC_SubType_TexPalette0 0x00000000 #define HC_SubType_TexPalette1 0x00000001 #define HC_SubType_FogTable 0x00000010 #define HC_SubType_Stipple 0x00000014 /* HC_SubA_TexPalette0 0x0000 */ #define HC_HTPnA_MASK 0xff000000 #define HC_HTPnR_MASK 0x00ff0000 #define HC_HTPnG_MASK 0x0000ff00 #define HC_HTPnB_MASK 0x000000ff /* HC_SubA_FogTable 0x0010 */ #define HC_HFPn3_MASK 0xff000000 #define HC_HFPn2_MASK 0x00ff0000 #define HC_HFPn1_MASK 0x0000ff00 #define HC_HFPn_MASK 0x000000ff #define HC_HFPn3_SHIFT 24 #define HC_HFPn2_SHIFT 16 #define HC_HFPn1_SHIFT 8 /* Auto Testing & Security */ #define HC_SubA_HenFIFOAT 0x0000 #define HC_SubA_HFBDrawFirst 0x0004 #define HC_SubA_HFBBasL 0x0005 #define HC_SubA_HFBDst 0x0006 /* HC_SubA_HenFIFOAT 0x0000 */ #define HC_HenFIFOAT_MASK 0x00000020 #define HC_HenGEMILock_MASK 0x00000010 #define HC_HenFBASwap_MASK 0x00000008 #define HC_HenOT_MASK 0x00000004 #define HC_HenCMDQ_MASK 0x00000002 #define HC_HenTXCTSU_MASK 0x00000001 /* HC_SubA_HFBDrawFirst 0x0004 */ #define HC_HFBDrawFirst_MASK 0x00000800 #define HC_HFBQueue_MASK 0x00000400 #define HC_HFBLock_MASK 0x00000200 #define HC_HEOF_MASK 0x00000100 #define HC_HFBBasH_MASK 0x000000ff /* GEMI Setting */ #define HC_SubA_HTArbRCM 0x0008 #define HC_SubA_HTArbRZ 0x000a #define HC_SubA_HTArbWZ 0x000b #define HC_SubA_HTArbRTX 0x000c #define HC_SubA_HTArbRCW 0x000d #define HC_SubA_HTArbE2 0x000e #define HC_SubA_HArbRQCM 0x0010 #define HC_SubA_HArbWQCM 0x0011 #define HC_SubA_HGEMITout 0x0020 #define HC_SubA_HFthRTXD 0x0040 #define HC_SubA_HFthRTXA 0x0044 #define HC_SubA_HCMDQstL 0x0050 #define HC_SubA_HCMDQendL 0x0051 #define HC_SubA_HCMDQLen 0x0052 /* HC_SubA_HTArbRCM 0x0008 */ #define HC_HTArbRCM_MASK 0x0000ffff /* HC_SubA_HTArbRZ 0x000a */ #define HC_HTArbRZ_MASK 0x0000ffff /* HC_SubA_HTArbWZ 0x000b */ #define HC_HTArbWZ_MASK 0x0000ffff /* HC_SubA_HTArbRTX 0x000c */ #define HC_HTArbRTX_MASK 0x0000ffff /* HC_SubA_HTArbRCW 0x000d */ #define HC_HTArbRCW_MASK 0x0000ffff /* HC_SubA_HTArbE2 0x000e */ #define HC_HTArbE2_MASK 0x0000ffff /* HC_SubA_HArbRQCM 0x0010 */ #define HC_HTArbRQCM_MASK 0x0000ffff /* HC_SubA_HArbWQCM 0x0011 */ #define HC_HArbWQCM_MASK 0x0000ffff /* HC_SubA_HGEMITout 0x0020 */ #define HC_HGEMITout_MASK 0x000f0000 #define HC_HNPArbZC_MASK 0x0000ffff #define HC_HGEMITout_SHIFT 16 /* HC_SubA_HFthRTXD 0x0040 */ #define HC_HFthRTXD_MASK 0x00ff0000 #define HC_HFthRZD_MASK 0x0000ff00 #define HC_HFthWZD_MASK 0x000000ff #define HC_HFthRTXD_SHIFT 16 #define HC_HFthRZD_SHIFT 8 /* HC_SubA_HFthRTXA 0x0044 */ #define HC_HFthRTXA_MASK 0x000000ff /****************************************************************************** ** Define the Halcyon Internal register access constants. For simulator only. ******************************************************************************/ #define HC_SIMA_HAGPBstL 0x0000 #define HC_SIMA_HAGPBendL 0x0001 #define HC_SIMA_HAGPCMNT 0x0002 #define HC_SIMA_HAGPBpL 0x0003 #define HC_SIMA_HAGPBpH 0x0004 #define HC_SIMA_HClipTB 0x0005 #define HC_SIMA_HClipLR 0x0006 #define HC_SIMA_HFPClipTL 0x0007 #define HC_SIMA_HFPClipBL 0x0008 #define HC_SIMA_HFPClipLL 0x0009 #define HC_SIMA_HFPClipRL 0x000a #define HC_SIMA_HFPClipTBH 0x000b #define HC_SIMA_HFPClipLRH 0x000c #define HC_SIMA_HLP 0x000d #define HC_SIMA_HLPRF 0x000e #define HC_SIMA_HSolidCL 0x000f #define HC_SIMA_HPixGC 0x0010 #define HC_SIMA_HSPXYOS 0x0011 #define HC_SIMA_HCmdA 0x0012 #define HC_SIMA_HCmdB 0x0013 #define HC_SIMA_HEnable 0x0014 #define HC_SIMA_HZWBBasL 0x0015 #define HC_SIMA_HZWBBasH 0x0016 #define HC_SIMA_HZWBType 0x0017 #define HC_SIMA_HZBiasL 0x0018 #define HC_SIMA_HZWBend 0x0019 #define HC_SIMA_HZWTMD 0x001a #define HC_SIMA_HZWCDL 0x001b #define HC_SIMA_HZWCTAGnum 0x001c #define HC_SIMA_HZCYNum 0x001d #define HC_SIMA_HZWCFire 0x001e /* #define HC_SIMA_HSBBasL 0x001d */ /* #define HC_SIMA_HSBBasH 0x001e */ /* #define HC_SIMA_HSBFM 0x001f */ #define HC_SIMA_HSTREF 0x0020 #define HC_SIMA_HSTMD 0x0021 #define HC_SIMA_HABBasL 0x0022 #define HC_SIMA_HABBasH 0x0023 #define HC_SIMA_HABFM 0x0024 #define HC_SIMA_HATMD 0x0025 #define HC_SIMA_HABLCsat 0x0026 #define HC_SIMA_HABLCop 0x0027 #define HC_SIMA_HABLAsat 0x0028 #define HC_SIMA_HABLAop 0x0029 #define HC_SIMA_HABLRCa 0x002a #define HC_SIMA_HABLRFCa 0x002b #define HC_SIMA_HABLRCbias 0x002c #define HC_SIMA_HABLRCb 0x002d #define HC_SIMA_HABLRFCb 0x002e #define HC_SIMA_HABLRAa 0x002f #define HC_SIMA_HABLRAb 0x0030 #define HC_SIMA_HDBBasL 0x0031 #define HC_SIMA_HDBBasH 0x0032 #define HC_SIMA_HDBFM 0x0033 #define HC_SIMA_HFBBMSKL 0x0034 #define HC_SIMA_HROP 0x0035 #define HC_SIMA_HFogLF 0x0036 #define HC_SIMA_HFogCL 0x0037 #define HC_SIMA_HFogCH 0x0038 #define HC_SIMA_HFogStL 0x0039 #define HC_SIMA_HFogStH 0x003a #define HC_SIMA_HFogOOdMF 0x003b #define HC_SIMA_HFogOOdEF 0x003c #define HC_SIMA_HFogEndL 0x003d #define HC_SIMA_HFogDenst 0x003e /*---- start of texture 0 setting ---- */ #define HC_SIMA_HTX0L0BasL 0x0040 #define HC_SIMA_HTX0L1BasL 0x0041 #define HC_SIMA_HTX0L2BasL 0x0042 #define HC_SIMA_HTX0L3BasL 0x0043 #define HC_SIMA_HTX0L4BasL 0x0044 #define HC_SIMA_HTX0L5BasL 0x0045 #define HC_SIMA_HTX0L6BasL 0x0046 #define HC_SIMA_HTX0L7BasL 0x0047 #define HC_SIMA_HTX0L8BasL 0x0048 #define HC_SIMA_HTX0L9BasL 0x0049 #define HC_SIMA_HTX0LaBasL 0x004a #define HC_SIMA_HTX0LbBasL 0x004b #define HC_SIMA_HTX0LcBasL 0x004c #define HC_SIMA_HTX0LdBasL 0x004d #define HC_SIMA_HTX0LeBasL 0x004e #define HC_SIMA_HTX0LfBasL 0x004f #define HC_SIMA_HTX0L10BasL 0x0050 #define HC_SIMA_HTX0L11BasL 0x0051 #define HC_SIMA_HTX0L012BasH 0x0052 #define HC_SIMA_HTX0L345BasH 0x0053 #define HC_SIMA_HTX0L678BasH 0x0054 #define HC_SIMA_HTX0L9abBasH 0x0055 #define HC_SIMA_HTX0LcdeBasH 0x0056 #define HC_SIMA_HTX0Lf1011BasH 0x0057 #define HC_SIMA_HTX0L0Pit 0x0058 #define HC_SIMA_HTX0L1Pit 0x0059 #define HC_SIMA_HTX0L2Pit 0x005a #define HC_SIMA_HTX0L3Pit 0x005b #define HC_SIMA_HTX0L4Pit 0x005c #define HC_SIMA_HTX0L5Pit 0x005d #define HC_SIMA_HTX0L6Pit 0x005e #define HC_SIMA_HTX0L7Pit 0x005f #define HC_SIMA_HTX0L8Pit 0x0060 #define HC_SIMA_HTX0L9Pit 0x0061 #define HC_SIMA_HTX0LaPit 0x0062 #define HC_SIMA_HTX0LbPit 0x0063 #define HC_SIMA_HTX0LcPit 0x0064 #define HC_SIMA_HTX0LdPit 0x0065 #define HC_SIMA_HTX0LePit 0x0066 #define HC_SIMA_HTX0LfPit 0x0067 #define HC_SIMA_HTX0L10Pit 0x0068 #define HC_SIMA_HTX0L11Pit 0x0069 #define HC_SIMA_HTX0L0_5WE 0x006a #define HC_SIMA_HTX0L6_bWE 0x006b #define HC_SIMA_HTX0Lc_11WE 0x006c #define HC_SIMA_HTX0L0_5HE 0x006d #define HC_SIMA_HTX0L6_bHE 0x006e #define HC_SIMA_HTX0Lc_11HE 0x006f #define HC_SIMA_HTX0L0OS 0x0070 #define HC_SIMA_HTX0TB 0x0071 #define HC_SIMA_HTX0MPMD 0x0072 #define HC_SIMA_HTX0CLODu 0x0073 #define HC_SIMA_HTX0FM 0x0074 #define HC_SIMA_HTX0TRCH 0x0075 #define HC_SIMA_HTX0TRCL 0x0076 #define HC_SIMA_HTX0TBC 0x0077 #define HC_SIMA_HTX0TRAH 0x0078 #define HC_SIMA_HTX0TBLCsat 0x0079 #define HC_SIMA_HTX0TBLCop 0x007a #define HC_SIMA_HTX0TBLMPfog 0x007b #define HC_SIMA_HTX0TBLAsat 0x007c #define HC_SIMA_HTX0TBLRCa 0x007d #define HC_SIMA_HTX0TBLRCb 0x007e #define HC_SIMA_HTX0TBLRCc 0x007f #define HC_SIMA_HTX0TBLRCbias 0x0080 #define HC_SIMA_HTX0TBLRAa 0x0081 #define HC_SIMA_HTX0TBLRFog 0x0082 #define HC_SIMA_HTX0BumpM00 0x0083 #define HC_SIMA_HTX0BumpM01 0x0084 #define HC_SIMA_HTX0BumpM10 0x0085 #define HC_SIMA_HTX0BumpM11 0x0086 #define HC_SIMA_HTX0LScale 0x0087 /*---- end of texture 0 setting ---- 0x008f */ #define HC_SIMA_TX0TX1_OFF 0x0050 /*---- start of texture 1 setting ---- */ #define HC_SIMA_HTX1L0BasL (HC_SIMA_HTX0L0BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L1BasL (HC_SIMA_HTX0L1BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L2BasL (HC_SIMA_HTX0L2BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L3BasL (HC_SIMA_HTX0L3BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L4BasL (HC_SIMA_HTX0L4BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L5BasL (HC_SIMA_HTX0L5BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6BasL (HC_SIMA_HTX0L6BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L7BasL (HC_SIMA_HTX0L7BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L8BasL (HC_SIMA_HTX0L8BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L9BasL (HC_SIMA_HTX0L9BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LaBasL (HC_SIMA_HTX0LaBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LbBasL (HC_SIMA_HTX0LbBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LcBasL (HC_SIMA_HTX0LcBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LdBasL (HC_SIMA_HTX0LdBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LeBasL (HC_SIMA_HTX0LeBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LfBasL (HC_SIMA_HTX0LfBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L10BasL (HC_SIMA_HTX0L10BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L11BasL (HC_SIMA_HTX0L11BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L012BasH (HC_SIMA_HTX0L012BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L345BasH (HC_SIMA_HTX0L345BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L678BasH (HC_SIMA_HTX0L678BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L9abBasH (HC_SIMA_HTX0L9abBasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LcdeBasH (HC_SIMA_HTX0LcdeBasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1Lf1011BasH (HC_SIMA_HTX0Lf1011BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0Pit (HC_SIMA_HTX0L0Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L1Pit (HC_SIMA_HTX0L1Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L2Pit (HC_SIMA_HTX0L2Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L3Pit (HC_SIMA_HTX0L3Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L4Pit (HC_SIMA_HTX0L4Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L5Pit (HC_SIMA_HTX0L5Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6Pit (HC_SIMA_HTX0L6Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L7Pit (HC_SIMA_HTX0L7Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L8Pit (HC_SIMA_HTX0L8Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L9Pit (HC_SIMA_HTX0L9Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LaPit (HC_SIMA_HTX0LaPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LbPit (HC_SIMA_HTX0LbPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LcPit (HC_SIMA_HTX0LcPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LdPit (HC_SIMA_HTX0LdPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LePit (HC_SIMA_HTX0LePit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LfPit (HC_SIMA_HTX0LfPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L10Pit (HC_SIMA_HTX0L10Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L11Pit (HC_SIMA_HTX0L11Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0_5WE (HC_SIMA_HTX0L0_5WE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6_bWE (HC_SIMA_HTX0L6_bWE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1Lc_11WE (HC_SIMA_HTX0Lc_11WE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0_5HE (HC_SIMA_HTX0L0_5HE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6_bHE (HC_SIMA_HTX0L6_bHE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1Lc_11HE (HC_SIMA_HTX0Lc_11HE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0OS (HC_SIMA_HTX0L0OS + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TB (HC_SIMA_HTX0TB + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1MPMD (HC_SIMA_HTX0MPMD + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1CLODu (HC_SIMA_HTX0CLODu + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1FM (HC_SIMA_HTX0FM + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TRCH (HC_SIMA_HTX0TRCH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TRCL (HC_SIMA_HTX0TRCL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBC (HC_SIMA_HTX0TBC + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TRAH (HC_SIMA_HTX0TRAH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LTC (HC_SIMA_HTX0LTC + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LTA (HC_SIMA_HTX0LTA + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLCsat (HC_SIMA_HTX0TBLCsat + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLCop (HC_SIMA_HTX0TBLCop + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLMPfog (HC_SIMA_HTX0TBLMPfog + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLAsat (HC_SIMA_HTX0TBLAsat + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCa (HC_SIMA_HTX0TBLRCa + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCb (HC_SIMA_HTX0TBLRCb + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCc (HC_SIMA_HTX0TBLRCc + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCbias (HC_SIMA_HTX0TBLRCbias + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRAa (HC_SIMA_HTX0TBLRAa + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRFog (HC_SIMA_HTX0TBLRFog + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM00 (HC_SIMA_HTX0BumpM00 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM01 (HC_SIMA_HTX0BumpM01 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM10 (HC_SIMA_HTX0BumpM10 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM11 (HC_SIMA_HTX0BumpM11 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LScale (HC_SIMA_HTX0LScale + HC_SIMA_TX0TX1_OFF) /*---- end of texture 1 setting ---- 0xaf */ #define HC_SIMA_HTXSMD 0x00b0 #define HC_SIMA_HenFIFOAT 0x00b1 #define HC_SIMA_HFBDrawFirst 0x00b2 #define HC_SIMA_HFBBasL 0x00b3 #define HC_SIMA_HTArbRCM 0x00b4 #define HC_SIMA_HTArbRZ 0x00b5 #define HC_SIMA_HTArbWZ 0x00b6 #define HC_SIMA_HTArbRTX 0x00b7 #define HC_SIMA_HTArbRCW 0x00b8 #define HC_SIMA_HTArbE2 0x00b9 #define HC_SIMA_HGEMITout 0x00ba #define HC_SIMA_HFthRTXD 0x00bb #define HC_SIMA_HFthRTXA 0x00bc /* Define the texture palette 0 */ #define HC_SIMA_HTP0 0x0100 #define HC_SIMA_HTP1 0x0200 #define HC_SIMA_FOGTABLE 0x0300 #define HC_SIMA_STIPPLE 0x0400 #define HC_SIMA_HE3Fire 0x0440 #define HC_SIMA_TRANS_SET 0x0441 #define HC_SIMA_HREngSt 0x0442 #define HC_SIMA_HRFIFOempty 0x0443 #define HC_SIMA_HRFIFOfull 0x0444 #define HC_SIMA_HRErr 0x0445 #define HC_SIMA_FIFOstatus 0x0446 /****************************************************************************** ** Define the AGP command header. ******************************************************************************/ #define HC_ACMD_MASK 0xfe000000 #define HC_ACMD_SUB_MASK 0x0c000000 #define HC_ACMD_HCmdA 0xee000000 #define HC_ACMD_HCmdB 0xec000000 #define HC_ACMD_HCmdC 0xea000000 #define HC_ACMD_H1 0xf0000000 #define HC_ACMD_H2 0xf2000000 #define HC_ACMD_H3 0xf4000000 #define HC_ACMD_H4 0xf6000000 #define HC_ACMD_H1IO_MASK 0x000001ff #define HC_ACMD_H2IO1_MASK 0x001ff000 #define HC_ACMD_H2IO2_MASK 0x000001ff #define HC_ACMD_H2IO1_SHIFT 12 #define HC_ACMD_H2IO2_SHIFT 0 #define HC_ACMD_H3IO_MASK 0x000001ff #define HC_ACMD_H3COUNT_MASK 0x01fff000 #define HC_ACMD_H3COUNT_SHIFT 12 #define HC_ACMD_H4ID_MASK 0x000001ff #define HC_ACMD_H4COUNT_MASK 0x01fffe00 #define HC_ACMD_H4COUNT_SHIFT 9 /******************************************************************************** ** Define Header ********************************************************************************/ #define HC_HEADER2 0xF210F110 /******************************************************************************** ** Define Dummy Value ********************************************************************************/ #define HC_DUMMY 0xCCCCCCCC /******************************************************************************** ** Define for DMA use ********************************************************************************/ #define HALCYON_HEADER2 0XF210F110 #define HALCYON_FIRECMD 0XEE100000 #define HALCYON_FIREMASK 0XFFF00000 #define HALCYON_CMDB 0XEC000000 #define HALCYON_CMDBMASK 0XFFFE0000 #define HALCYON_SUB_ADDR0 0X00000000 #define HALCYON_HEADER1MASK 0XFFFFFC00 #define HALCYON_HEADER1 0XF0000000 #define HC_SubA_HAGPBstL 0x0060 #define HC_SubA_HAGPBendL 0x0061 #define HC_SubA_HAGPCMNT 0x0062 #define HC_SubA_HAGPBpL 0x0063 #define HC_SubA_HAGPBpH 0x0064 #define HC_HAGPCMNT_MASK 0x00800000 #define HC_HCmdErrClr_MASK 0x00400000 #define HC_HAGPBendH_MASK 0x0000ff00 #define HC_HAGPBstH_MASK 0x000000ff #define HC_HAGPBendH_SHIFT 8 #define HC_HAGPBstH_SHIFT 0 #define HC_HAGPBpL_MASK 0x00fffffc #define HC_HAGPBpID_MASK 0x00000003 #define HC_HAGPBpID_PAUSE 0x00000000 #define HC_HAGPBpID_JUMP 0x00000001 #define HC_HAGPBpID_STOP 0x00000002 #define HC_HAGPBpH_MASK 0x00ffffff #define VIA_VIDEO_HEADER5 0xFE040000 #define VIA_VIDEO_HEADER6 0xFE050000 #define VIA_VIDEO_HEADER7 0xFE060000 #define VIA_VIDEOMASK 0xFFFF0000 #endif xf86-video-openchrome-0.6.0/src/via_xv_overlay.c0000664000175000017500000025003512760724526016504 00000000000000/* * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "xf86_OSproc.h" #ifdef HAVE_DRI #include "xf86drm.h" #include "via_drmclient.h" #include "via_drm.h" #endif #include "via_driver.h" #include #include /* * Warning: this file contains revision checks which are CLE266-specific. * There seems to be no checking present for KM400 or more recent devices. * * TODO: * - pVia->Chipset checking, of course * - move content of pVia->HWDiff into pVia->swov * - merge with CLEXF40040 */ /* * Old via_regrec code. */ #define VIDREG_BUFFER_SIZE 100 /* Number of entries in the VidRegBuffer. */ #define IN_VIDEO_DISPLAY (*((unsigned long volatile *)(pVia->MapBase + V_FLAGS)) & VBI_STATUS) #define VIA_FIRETIMEOUT 40000 enum HQV_CME_Regs { HQV_SDO_CTRL1, HQV_SDO_CTRL2, HQV_SDO_CTRL3, HQV_SDO_CTRL4 }; /* register offsets for VT3553/VX800 */ static const unsigned hqv_cme_regs[] = { [HQV_SDO_CTRL1] = HQV_SRC_DATA_OFFSET_CONTROL1, [HQV_SDO_CTRL2] = HQV_SRC_DATA_OFFSET_CONTROL2, [HQV_SDO_CTRL3] = HQV_SRC_DATA_OFFSET_CONTROL3, [HQV_SDO_CTRL4] = HQV_SRC_DATA_OFFSET_CONTROL4 }; /* register hqv offsets for new VT3409/VX855 */ static const unsigned hqv_cme_regs_409[] = { [HQV_SDO_CTRL1] = HQV_SRC_DATA_OFFSET_CTRL1_409, [HQV_SDO_CTRL2] = HQV_SRC_DATA_OFFSET_CTRL2_409, [HQV_SDO_CTRL3] = HQV_SRC_DATA_OFFSET_CTRL3_409, [HQV_SDO_CTRL4] = HQV_SRC_DATA_OFFSET_CTRL4_409 }; #define HQV_CME_REG(HWDiff, name) (HWDiff)->HQVCmeRegs[name] static void viaWaitVideoCommandFire(VIAPtr pVia) { /* * Uncached PCI reading throughput is about 9 MB/s; so 8 bytes/loop means about * 1M loops/second. We want to time out after 50 ms, which means 50000 loops. */ unsigned count = 50000; CARD32 volatile *pdwState = (CARD32 volatile *)(pVia->MapBase + V_COMPOSE_MODE); while (--count && ((*pdwState & V1_COMMAND_FIRE) || (*pdwState & V3_COMMAND_FIRE))) ; if (!count) { ErrorF("viaWaitVideoCommandFire: Timeout.\n"); } } static void viaWaitHQVFlip(VIAPtr pVia) { unsigned long proReg = 0; CARD32 volatile *pdwState; unsigned count = 50000; if (pVia->ChipId == PCI_CHIP_VT3259 && !(pVia->swov.gdwVideoFlagSW & VIDEO_1_INUSE)) proReg = PRO_HQV1_OFFSET; pdwState = (CARD32 volatile *)(pVia->MapBase + (HQV_CONTROL + proReg)); if (pVia->VideoEngine == VIDEO_ENGINE_CME) { while (--count && (*pdwState & HQV_SUBPIC_FLIP)); } else { while (--count && !(*pdwState & HQV_FLIP_STATUS)) ; } } static void viaWaitHQVFlipClear(VIAPtr pVia, unsigned long dwData) { CARD32 volatile *pdwState = (CARD32 volatile *)(pVia->MapBase + HQV_CONTROL); *pdwState = dwData; unsigned count = 50000; while (--count && (*pdwState & HQV_FLIP_STATUS)) { VIASETREG(HQV_CONTROL, *pdwState | HQV_FLIP_STATUS); } } static void viaWaitVBI(VIAPtr pVia) { while (IN_VIDEO_DISPLAY) ; } static void viaWaitHQVDone(VIAPtr pVia) { CARD32 volatile *pdwState; unsigned long proReg = 0; unsigned count = 50000; if (pVia->ChipId == PCI_CHIP_VT3259 && !(pVia->swov.gdwVideoFlagSW & VIDEO_1_INUSE)) proReg = PRO_HQV1_OFFSET; pdwState = (CARD32 volatile *)(pVia->MapBase + (HQV_CONTROL + proReg)); if (pVia->swov.MPEG_ON) { while (--count && (*pdwState & HQV_SW_FLIP)) ; } } /* * Send all data in VidRegBuffer to the hardware. */ static void FlushVidRegBuffer(VIAPtr pVia) { unsigned int i; viaWaitVideoCommandFire(pVia); for (i = 0; i < pVia->VidRegCursor; i += 2) { VIASETREG(pVia->VidRegBuffer[i], pVia->VidRegBuffer[i + 1]); DBG_DD(ErrorF("FlushVideoRegs: [%i] %08lx %08lx\n", i >> 1, pVia->VidRegBuffer[i] + 0x200, pVia->VidRegBuffer[i + 1])); } /* BUG: (?) VIA never resets the cursor. * My fix is commented out for now, in case they had a reason for that. /A */ /* pVia->VidRegCursor = 0; */ } /* * Initialize and clear VidRegBuffer. */ static void ResetVidRegBuffer(VIAPtr pVia) { /* BUG: (Memory leak) This allocation may need have a corresponding free somewhere... /A */ if (!pVia->VidRegBuffer) pVia->VidRegBuffer = xnfcalloc(VIDREG_BUFFER_SIZE, sizeof(CARD32) * 2); pVia->VidRegCursor = 0; } /* * Save a video register and data in VidRegBuffer. */ static void SaveVideoRegister(VIAPtr pVia, CARD32 index, CARD32 data) { if (pVia->VidRegCursor >= VIDREG_BUFFER_SIZE) { DBG_DD(ErrorF("SaveVideoRegister: Out of video register space flushing")); FlushVidRegBuffer(pVia); ResetVidRegBuffer(pVia); } pVia->VidRegBuffer[pVia->VidRegCursor++] = index; pVia->VidRegBuffer[pVia->VidRegCursor++] = data; } /* * HW Difference Flag (moved here from via_hwdiff.c) * * These are the entries of HWDiff used in our code (currently): * CLE266Ax CLE266Cx KM400 K8M800 PM800 * ThreeHQVBuffer FALSE TRUE TRUE TRUE TRUE * HQVFetchByteUnit FALSE TRUE TRUE TRUE TRUE * SupportTwoColorKey FALSE TRUE FALSE FALSE TRUE * HQVInitPatch TRUE FALSE FALSE FALSE FALSE * HQVDisablePatch FALSE TRUE TRUE TRUE FALSE * * This is now up to date with CLEXF40040. All unused entries were removed. * The functions depending on this struct are untouched. */ void VIAVidHWDiffInit(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); VIAHWDiff *HWDiff = &pVia->HWDiff; switch (pVia->Chipset) { case VIA_CLE266: if (CLE266_REV_IS_AX(pVia->ChipRev)) { HWDiff->dwThreeHQVBuffer = VID_HWDIFF_FALSE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_FALSE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_FALSE; HWDiff->dwHQVInitPatch = VID_HWDIFF_TRUE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; } else { HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_TRUE; HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; } HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; break; case VIA_KM400: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_FALSE; HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; break; case VIA_K8M800: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_FALSE; HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; break; case VIA_PM800: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_TRUE; HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; HWDiff->HQVCmeRegs = hqv_cme_regs; break; case VIA_P4M800PRO: case VIA_P4M900: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_FALSE; HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; HWDiff->HQVCmeRegs = hqv_cme_regs; break; case VIA_K8M890: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_FALSE; HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_TRUE; HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; HWDiff->HQVCmeRegs = hqv_cme_regs; break; case VIA_P4M890: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_FALSE; HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; HWDiff->HQVCmeRegs = hqv_cme_regs; break; case VIA_CX700: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_TRUE; HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; HWDiff->HQVCmeRegs = hqv_cme_regs; break; case VIA_VX800: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_TRUE; HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; HWDiff->dwNewScaleCtl = VID_HWDIFF_TRUE; HWDiff->HQVCmeRegs = hqv_cme_regs; break; case VIA_VX855: case VIA_VX900: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_TRUE; HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; HWDiff->dwNewScaleCtl = VID_HWDIFF_TRUE; HWDiff->HQVCmeRegs = hqv_cme_regs_409; break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "VIAVidHWDiffInit: Unhandled ChipSet.\n"); } } /* * Old via_overlay code. */ typedef struct _YCBCRREC { CARD32 dwY; CARD32 dwCB; CARD32 dwCR; } YCBCRREC; /* * Verify that using V1 bit definitions on V3 * is not broken in OverlayGetV1V3Format(). */ #if V1_COLORSPACE_SIGN != V3_COLORSPACE_SIGN #error "V1_COLORSPACE_SIGN != V3_COLORSPACE_SIGN" #endif #if V1_YUV422 != V3_YUV422 #error "V1_YUV422 != V3_YUV422" #endif #if V1_SWAP_HW_HQV != V3_SWAP_HW_HQV #error "V1_SWAP_HW_HQV != V3_SWAP_HW_HQV" #endif #if V1_RGB15 != V3_RGB15 #error "V1_RGB15 != V3_RGB15" #endif #if V1_RGB16 != V3_RGB16 #error "V1_RGB16 != V3_RGB16" #endif #if V1_RGB32 != V3_RGB32 #error "V1_RGB32 != V3_RGB32" #endif static BOOL viaOverlayGetV1V3Format(VIAPtr pVia, int vport, /* 1 or 3, as in V1 or V3 */ unsigned long videoFlag, unsigned long *pVidCtl, unsigned long *pHQVCtl) { if (videoFlag & VIDEO_HQV_INUSE) { switch (pVia->swov.SrcFourCC) { case FOURCC_YV12: case FOURCC_I420: case FOURCC_XVMC: *pHQVCtl |= HQV_YUV420; break; case FOURCC_YUY2: *pHQVCtl |= HQV_YUV422; break; case FOURCC_RV32: *pVidCtl |= V1_RGB32; *pHQVCtl |= HQV_RGB32; break; case FOURCC_RV15: *pVidCtl |= V1_RGB15; *pHQVCtl |= HQV_RGB15; break; case FOURCC_RV16: *pVidCtl |= V1_RGB16; *pHQVCtl |= HQV_RGB16; break; default: DBG_DD(ErrorF("viaOverlayGetV1V3Format: " "Invalid FOURCC format (0x%lx).\n", pVia->swov.SrcFourCC)); return FALSE; } *pVidCtl |= V1_SWAP_HW_HQV; *pHQVCtl |= HQV_SRC_SW | HQV_ENABLE | HQV_SW_FLIP; } else { switch (pVia->swov.SrcFourCC) { case FOURCC_YV12: case FOURCC_I420: case FOURCC_XVMC: if (vport == 1) { *pVidCtl |= V1_YCbCr420; } else { DBG_DD(ErrorF("viaOverlayGetV1V3Format: " "V3 does not support planar YUV.\n")); return FALSE; } break; case FOURCC_YUY2: *pVidCtl |= V1_YUV422; break; case FOURCC_RV32: case FOURCC_RV15: case FOURCC_RV16: ErrorF("viaOverlayGetV1V3Format: " "Can't display RGB video in this configuration.\n"); return FALSE; default: DBG_DD(ErrorF("viaOverlayGetV1V3Format: " "Invalid FOURCC format (0x%lx).\n", pVia->swov.SrcFourCC)); return FALSE; } } *pVidCtl |= V1_COLORSPACE_SIGN; return TRUE; } static unsigned long viaOverlayGetSrcStartAddress(VIAPtr pVia, unsigned long videoFlag, LPDDUPDATEOVERLAY pUpdate, unsigned long srcPitch, unsigned long *pHQVoffset) { unsigned long srcWidth = (unsigned long)(pUpdate->SrcRight - pUpdate->SrcLeft); unsigned long dstWidth = (unsigned long)(pUpdate->DstRight - pUpdate->DstLeft); unsigned long srcHeight = (unsigned long)(pUpdate->SrcBottom - pUpdate->SrcTop); unsigned long dstHeight = (unsigned long)(pUpdate->DstBottom - pUpdate->DstTop); unsigned long offset = 0; unsigned long srcTopOffset = 0; unsigned long srcLeftOffset = 0; int n = 1; if ((pUpdate->SrcLeft != 0) || (pUpdate->SrcTop != 0)) { switch (pVia->swov.SrcFourCC) { case FOURCC_RV32: n = 2; case FOURCC_YUY2: case FOURCC_UYVY: case FOURCC_RV15: case FOURCC_RV16: if (videoFlag & VIDEO_HQV_INUSE) { offset = (((pUpdate->SrcTop & ~3) * srcPitch) + ((pUpdate->SrcLeft << n) & ~31)); if (srcHeight > dstHeight) srcTopOffset = ((pUpdate->SrcTop & ~3) * dstHeight / srcHeight) * srcPitch; else srcTopOffset = (pUpdate->SrcTop & ~3) * srcPitch; if (srcWidth > dstWidth) srcLeftOffset = (((pUpdate->SrcLeft << n) & ~31) * dstWidth / srcWidth); else srcLeftOffset = (pUpdate->SrcLeft << n) & ~31; *pHQVoffset = srcTopOffset + srcLeftOffset; } else offset = ((pUpdate->SrcTop * srcPitch) + ((pUpdate->SrcLeft << n) & ~15)); break; case FOURCC_YV12: case FOURCC_I420: case FOURCC_XVMC: if (videoFlag & VIDEO_HQV_INUSE) offset = (((pUpdate->SrcTop & ~3) * (srcPitch << 1)) + ((pUpdate->SrcLeft << 1) & ~31)); else { offset = ((((pUpdate->SrcTop & ~3) * srcPitch) + pUpdate->SrcLeft) & ~31); if (pUpdate->SrcTop > 0) pVia->swov.overlayRecordV1.dwUVoffset = (((((pUpdate->SrcTop & ~3) >> 1) * srcPitch) + pUpdate->SrcLeft) & ~31) >> 1; else pVia->swov.overlayRecordV1.dwUVoffset = offset >> 1; } break; default: DBG_DD(ErrorF("viaGetSrcStartAddress: " "Invalid FOURCC format (0x%lx).\n", pVia->swov.SrcFourCC)); break; } } else { pVia->swov.overlayRecordV1.dwUVoffset = offset = 0; } return offset; } static YCBCRREC viaOverlayGetYCbCrStartAddress(unsigned long videoFlag, unsigned long startAddr, unsigned long offset, unsigned long UVoffset, unsigned long srcPitch, unsigned long srcHeight) { YCBCRREC YCbCr; if (videoFlag & VIDEO_HQV_INUSE) { YCbCr.dwY = startAddr; YCbCr.dwCB = startAddr + srcPitch * srcHeight; YCbCr.dwCR = (startAddr + srcPitch * srcHeight + srcPitch * (srcHeight >> 2)); } else { YCbCr.dwY = startAddr + offset; YCbCr.dwCB = startAddr + srcPitch * srcHeight + UVoffset; YCbCr.dwCR = (startAddr + srcPitch * srcHeight + UVoffset + srcPitch * (srcHeight >> 2)); } return YCbCr; } static unsigned long viaOverlayHQVCalcZoomWidth(VIAPtr pVia, unsigned long videoFlag, unsigned long srcWidth, unsigned long dstWidth, unsigned long *pZoomCtl, unsigned long *pMiniCtl, unsigned long *pHQVfilterCtl, unsigned long *pHQVminiCtl, unsigned long *pHQVscaleCtlH, unsigned long *pHQVzoomflag) { unsigned long tmp, sw1, d, falign, mdiv; Bool zoom_ok = TRUE; VIAHWDiff *hwDiff = &pVia->HWDiff; CARD32 HQVfilter[5] = { HQV_H_FILTER_DEFAULT, HQV_H_TAP4_121, HQV_H_TAP4_121, HQV_H_TAP8_12221, HQV_H_TAP8_12221 }; /* CARD HQVmini[5] = { 0, 0xc00, 0xa00, 0x900, 0x8800 }; */ falign = 0; mdiv = 1; if (srcWidth == dstWidth) { /* No zoom */ *pHQVfilterCtl |= HQV_H_FILTER_DEFAULT; } else if (srcWidth < dstWidth) { /* Zoom in */ *pZoomCtl &= 0x0000FFFF; tmp = srcWidth * 0x800 / dstWidth; *pZoomCtl |= ((tmp & 0x7ff) << 16) | V1_X_ZOOM_ENABLE; *pMiniCtl |= V1_X_INTERPOLY; zoom_ok = !(tmp > 0x7ff); *pHQVzoomflag = 1; *pHQVfilterCtl |= HQV_H_FILTER_DEFAULT; } else { /* srcWidth > dstWidth - Zoom out */ if (hwDiff->dwNewScaleCtl) { if (srcWidth > (dstWidth << 3)) { /*<1/8*/ /*FIXME!*/ if (dstWidth <= 32) { dstWidth = 33; } if (srcWidth > (dstWidth << 5)) { tmp = 1 * 0x1000 / 31; } else { tmp = (dstWidth * 0x1000) / srcWidth; } *pHQVscaleCtlH = HQV_H_SCALE_DOWN_UNDER_EIGHTH; } else if (srcWidth == (dstWidth << 3)) { /*1/8*/ tmp = ((dstWidth - 1) * 0x1000) / srcWidth; *pHQVscaleCtlH = HQV_H_SCALE_DOWN_UNDER_EIGHTH; } else if (srcWidth > (dstWidth << 2)) { /*1/4 -1/8 zoom-out*/ tmp = (srcWidth * 0x1000) / dstWidth; *pHQVscaleCtlH = HQV_H_SCALE_DOWN_FOURTH_TO_EIGHTH; } else { /*1-1/4 zoom-out*/ /*setting :src/(destination+0.5)*/ tmp = (srcWidth * 0x2000) / ((dstWidth << 1) + 1); *pHQVscaleCtlH = HQV_H_SCALE_DOWN_FOURTH_TO_1; } /*rounding to nearest interger*/ tmp += (((tmp * 0x1000) & 0xfff) > 1) ? 1 : 0; *pHQVscaleCtlH |= (tmp & 0x7fff) | HQV_H_SCALE_ENABLE; } else { /* HQV rounding patch, instead of: * //tmp = dstWidth*0x0800 / srcWidth; */ tmp = dstWidth * 0x800 * 0x400 / srcWidth; tmp = tmp / 0x400 + ((tmp & 0x3ff) ? 1 : 0); *pHQVminiCtl = (tmp & 0x7ff) | HQV_H_MINIFY_ENABLE | HQV_H_MINIFY_DOWN; *pHQVminiCtl |= HQV_HDEBLOCK_FILTER; } /* Scale down the picture by a factor mdiv = (1 << d) = {2, 4, 8 or 16} */ sw1 = srcWidth; for (d = 1; d < 5; d++) { sw1 >>= 1; if (sw1 <= dstWidth) break; } if (d == 5) { /* Too small. */ d = 4; zoom_ok = FALSE; } mdiv = 1 << d; /* <= {2,4,8,16} */ falign = ((mdiv << 1) - 1) & 0xf; /* <= {3,7,15,15} */ *pMiniCtl |= V1_X_INTERPOLY; *pMiniCtl |= ((d << 1) - 1) << 24; /* <= {1,3,5,7} << 24 */ *pHQVfilterCtl |= HQVfilter[d]; /* Scale to arbitrary size, on top of previous scaling by (1 << d). */ if (sw1 < dstWidth) { /* CLE bug *pZoomCtl = sw1 * 0x0800 / dstWidth;*/ *pZoomCtl = (sw1 - 2) * 0x0800 / dstWidth; *pZoomCtl = ((*pZoomCtl & 0x7ff) << 16) | V1_X_ZOOM_ENABLE; } if (videoFlag & VIDEO_1_INUSE) { pVia->swov.overlayRecordV1.dwFetchAlignment = falign; pVia->swov.overlayRecordV1.dwminifyH = mdiv; } else { pVia->swov.overlayRecordV3.dwFetchAlignment = falign; pVia->swov.overlayRecordV3.dwminifyH = mdiv; } } return zoom_ok; } static unsigned long viaOverlayHQVCalcZoomHeight(VIAPtr pVia, unsigned long srcHeight, unsigned long dstHeight, unsigned long *pZoomCtl, unsigned long *pMiniCtl, unsigned long *pHQVfilterCtl, unsigned long *pHQVminiCtl, unsigned long *pHQVscaleCtlV, unsigned long *pHQVzoomflag) { unsigned long tmp, sh1, d; Bool zoom_ok = TRUE; VIAHWDiff *hwDiff = &pVia->HWDiff; CARD32 HQVfilter[5] = { HQV_V_TAP4_121, HQV_V_TAP4_121, HQV_V_TAP4_121, HQV_V_TAP8_12221, HQV_V_TAP8_12221 }; /* CARD32 HQVmini[5] = { 0, 0x0c000000, 0x0a000000, 0x09000000, 0x08800000 }; */ /*if (pVia->pBIOSInfo->scaleY) * { * dstHeight = dstHeight + 1; * } */ if (srcHeight == dstHeight) { /* No zoom */ *pHQVfilterCtl |= HQV_V_TAP4_121; } else if (srcHeight < dstHeight) { /* Zoom in */ *pZoomCtl &= 0xFFFF0000; tmp = srcHeight * 0x400 / dstHeight - 1; *pZoomCtl |= ((tmp & 0x3ff) | V1_Y_ZOOM_ENABLE); *pMiniCtl |= (V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY); *pHQVzoomflag = 1; *pHQVfilterCtl |= HQV_V_TAP4_121; } else { /* srcHeight > dstHeight - Zoom out */ if (hwDiff->dwNewScaleCtl) { /*setting :src/(destination+0.5)*/ tmp = srcHeight * 0x2000 / ((dstHeight << 1) + 1); tmp += (((tmp * 0x1000) & 0xfff) > 1) ? 1 : 0; if ((tmp & 0x1ffff) == 0) { tmp = 0x1ffff; } *pHQVscaleCtlV = (tmp & 0x1ffff) | HQV_V_SCALE_ENABLE| HQV_V_SCALE_DOWN; } else { /* HQV rounding patch, instead of: * //tmp = dstHeight*0x0800 / srcHeight; */ tmp = dstHeight * 0x0800 * 0x400 / srcHeight; tmp = tmp / 0x400 + ((tmp & 0x3ff) ? 1 : 0); *pHQVminiCtl |= (((tmp & 0x7ff) << 16) | HQV_V_MINIFY_ENABLE | HQV_V_MINIFY_DOWN); /* Scale down the picture by a factor (1 << d) = {2, 4, 8 or 16} */ sh1 = srcHeight; for (d = 1; d < 5; d++) { sh1 >>= 1; if (sh1 <= dstHeight) break; } if (d == 5) { /* Too small. */ d = 4; zoom_ok = FALSE; } *pMiniCtl |= ((d << 1) - 1) << 16; /* <= {1,3,5,7} << 16 */ *pHQVfilterCtl |= HQVfilter[d]; /* *pHQVminiCtl |= HQVmini[d]; */ *pHQVminiCtl |= HQV_VDEBLOCK_FILTER; /* Scale to arbitrary size, on top of previous scaling by (1 << d). */ if (sh1 < dstHeight) { tmp = sh1 * 0x0400 / dstHeight; *pZoomCtl |= ((tmp & 0x3ff) | V1_Y_ZOOM_ENABLE); *pMiniCtl |= V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY; } } } return zoom_ok; } static unsigned long viaOverlayGetFetch(VIAPtr pVia, unsigned long videoFlag, unsigned long srcWidth, unsigned long dstWidth, unsigned long oriSrcWidth, unsigned long *pHQVsrcFetch) { unsigned long fetch = 0; int n = 2; /* 2^n bytes per pixel. */ switch (pVia->swov.SrcFourCC) { case FOURCC_YV12: case FOURCC_I420: case FOURCC_XVMC: n = 0; /* 2^n = 1 byte per pixel (Y channel in planar YUV) */ break; case FOURCC_UYVY: case FOURCC_YUY2: case FOURCC_RV15: case FOURCC_RV16: n = 1; /* 2^n = 2 bytes per pixel (packed YUV) */ break; case FOURCC_RV32: n = 2; break; default: DBG_DD(ErrorF("viaOverlayGetFetch: " "Invalid FOURCC format (0x%lx).\n", pVia->swov.SrcFourCC)); break; } if (videoFlag & VIDEO_HQV_INUSE) { *pHQVsrcFetch = oriSrcWidth << n; if (n == 0) { /* Assume n == 0 <=> Planar YUV. * The V1/V3 pixelformat is always packed YUV when we use HQV, * so we switch from 8-bit to 16-bit pixels here. */ n = 1; } if (dstWidth >= srcWidth) fetch = (ALIGN_TO(srcWidth << n, 16) >> 4) + 1; else fetch = (ALIGN_TO(dstWidth << n, 16) >> 4) + 1; } else { if (n == 0) fetch = (ALIGN_TO(srcWidth, 32) >> 4); else fetch = (ALIGN_TO(srcWidth << n, 16) >> 4) + 1; } /* Fix planar mode problem. */ if (fetch < 4) fetch = 4; return fetch; } /* * This function uses quadratic mapping to adjust the midpoint of the scaling. */ static float rangeEqualize(float inLow, float inHigh, float outLow, float outHigh, float outMid, float inValue) { float inRange = inHigh - inLow, outRange = outHigh - outLow, normIn = ((inValue - inLow) / inRange) * 2. - 1., delta = outMid - outRange * 0.5 - outLow; return ((inValue - inLow) * outRange / inRange + outLow + (1. - normIn * normIn) * delta); } static unsigned vPackFloat(float val, float hiLimit, float loLimit, float mult, int shift, Bool doSign) { unsigned packed, mask, sign; val = (val > hiLimit) ? hiLimit : val; val = (val < loLimit) ? loLimit : val; sign = (val < 0) ? 1 : 0; val = (sign) ? -val : val; packed = ((unsigned)(val * mult + 1.)) >> 1; mask = (1 << shift) - 1; return (((packed >= mask) ? mask : packed) | ((doSign) ? (sign << shift) : 0)); } typedef float colorCoeff[5]; static colorCoeff colorCTable[] = { {1.1875, 1.625, 0.875, 0.375, 2.0}, {1.164, 1.596, 0.54, 0.45, 2.2} }; /* * This function is a partial rewrite of the overlay.c file of the original VIA * drivers, which was extremely nasty and difficult to follow. Coefficients for * new chipset models should be added in the table above and, if needed, * implemented in the model switch below. */ static void viaCalculateVideoColor(VIAPtr pVia, int hue, int saturation, int brightness, int contrast, Bool reset, CARD32 * col1, CARD32 * col2) { float fA, fB1, fC1, fD, fB2, fC2, fB3, fC3; float fPI, fContrast, fSaturation, fHue, fBrightness; const float *mCoeff; unsigned long dwA, dwB1, dwC1, dwD, dwB2, dwC2, dwB3, dwC3, dwS; unsigned long dwD_Int, dwD_Dec; int intD; int model; fPI = (float)(M_PI / 180.); if (reset) { saturation = 10000; brightness = 5000; contrast = 10000; } switch (pVia->ChipId) { case PCI_CHIP_VT3205: case PCI_CHIP_VT3204: case PCI_CHIP_VT3259: case PCI_CHIP_VT3314: case PCI_CHIP_VT3336: case PCI_CHIP_VT3364: case PCI_CHIP_VT3324: case PCI_CHIP_VT3327: case PCI_CHIP_VT3353: case PCI_CHIP_VT3409: case PCI_CHIP_VT3410: model = 0; break; case PCI_CHIP_CLE3122: model = (CLE266_REV_IS_CX(pVia->ChipRev) ? 0 : 1); break; default: ErrorF("Unknown Chip ID\n"); model = 0; } switch (model) { case 0: fBrightness = rangeEqualize(0., 10000., -128., 128., -16., (float)brightness); fContrast = rangeEqualize(0., 20000., 0., 1.6645, 1.0, (float)contrast); fSaturation = rangeEqualize(0., 20000, 0., 2., 1., (float)saturation); break; default: fBrightness = rangeEqualize(0., 10000., -128., 128., -12., (float)brightness); fContrast = rangeEqualize(0., 20000., 0., 1.6645, 1.1, (float)contrast); fSaturation = rangeEqualize(0., 20000, 0., 2., 1.15, (float)saturation); break; } fHue = (float)hue; mCoeff = colorCTable[model]; fA = (float)(mCoeff[0] * fContrast); fB1 = (float)(-mCoeff[1] * fContrast * fSaturation * sin(fHue * fPI)); fC1 = (float)(mCoeff[1] * fContrast * fSaturation * cos(fHue * fPI)); fD = (float)(mCoeff[0] * (fBrightness)); fB2 = (float)((mCoeff[2] * sin(fHue * fPI) - mCoeff[3] * cos(fHue * fPI)) * fContrast * fSaturation); fC2 = (float)(-(mCoeff[2] * cos(fHue * fPI) + mCoeff[3] * sin(fHue * fPI)) * fContrast * fSaturation); fB3 = (float)(mCoeff[4] * fContrast * fSaturation * cos(fHue * fPI)); fC3 = (float)(mCoeff[4] * fContrast * fSaturation * sin(fHue * fPI)); switch (model) { case 0: dwA = vPackFloat(fA, 1.9375, 0., 32., 5, 0); dwB1 = vPackFloat(fB1, 2.125, -2.125, 16., 5, 1); dwC1 = vPackFloat(fC1, 2.125, -2.125, 16., 5, 1); if (fD >= 0) { intD = (int)fD; if (intD > 127) intD = 127; dwD_Int = ((unsigned long)intD) & 0xff; dwD = ((unsigned long)(fD * 16 + 1)) >> 1; dwD_Dec = dwD & 0x7; } else { intD = (int)fD; if (intD < -128) intD = -128; intD = intD + 256; dwD_Int = ((unsigned long)intD) & 0xff; fD = -fD; dwD = ((unsigned long)(fD * 16 + 1)) >> 1; dwD_Dec = dwD & 0x7; } dwB2 = vPackFloat(fB2, 1.875, -1.875, 16, 4, 1); dwC2 = vPackFloat(fC2, 1.875, -1.875, 16, 4, 1); dwB3 = vPackFloat(fB3, 3.875, -3.875, 16, 5, 1); dwC3 = vPackFloat(fC3, 3.875, -3.875, 16, 5, 1); *col1 = (dwA << 24) | (dwB1 << 16) | (dwC1 << 8) | dwD_Int; *col2 = (dwD_Dec << 29 | dwB2 << 24) | (dwC2 << 16) | (dwB3 << 8) | (dwC3); break; default: dwA = vPackFloat(fA, 1.9375, -0., 32, 5, 0); dwB1 = vPackFloat(fB1, 0.75, -0.75, 8., 2, 1); dwC1 = vPackFloat(fC1, 2.875, 1., 16., 5, 0); if (fD >= 127) fD = 127; if (fD <= -128) fD = -128; if (fD >= 0) { dwS = 0; } else { dwS = 1; fD = fD + 128; } dwD = ((unsigned long)(fD * 2 + 1)) >> 1; if (dwD >= 0x7f) { dwD = 0x7f | (dwS << 7); } else { dwD = (dwD & 0x7f) | (dwS << 7); } dwB2 = vPackFloat(fB2, 0., -0.875, 16., 3, 0); dwC2 = vPackFloat(fC2, 0., -1.875, 16., 4, 0); dwB3 = vPackFloat(fB3, 3.75, 0., 8., 4, 0); dwC3 = vPackFloat(fC3, 1.25, -1.25, 8., 3, 1); *col1 = (dwA << 24) | (dwB1 << 18) | (dwC1 << 9) | dwD; *col2 = (dwB2 << 25) | (dwC2 << 17) | (dwB3 << 10) | (dwC3 << 2); break; } } /* * * */ void viaSetColorSpace(VIAPtr pVia, int hue, int saturation, int brightness, int contrast, Bool reset) { CARD32 col1, col2; viaCalculateVideoColor(pVia, hue, saturation, brightness, contrast, reset, &col1, &col2); switch (pVia->ChipId) { case PCI_CHIP_VT3205: case PCI_CHIP_VT3204: case PCI_CHIP_VT3314: VIASETREG(V3_ColorSpaceReg_1, col1); VIASETREG(V3_ColorSpaceReg_2, col2); DBG_DD(ErrorF("000002C4 %08lx\n", col1)); DBG_DD(ErrorF("000002C8 %08lx\n", col2)); case PCI_CHIP_VT3259: case PCI_CHIP_VT3327: case PCI_CHIP_VT3336: case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: case PCI_CHIP_VT3353: case PCI_CHIP_VT3409: case PCI_CHIP_VT3410: case PCI_CHIP_CLE3122: VIASETREG(V1_ColorSpaceReg_1, col1); VIASETREG(V1_ColorSpaceReg_2, col2); DBG_DD(ErrorF("00000288 %08lx\n", col2)); DBG_DD(ErrorF("00000284 %08lx\n", col1)); break; default: DBG_DD(ErrorF("Unknown DeviceID\n")); break; } } static unsigned long ViaInitVideoStatusFlag(VIAPtr pVia) { switch (pVia->ChipId) { case PCI_CHIP_VT3205: case PCI_CHIP_VT3204: case PCI_CHIP_VT3314: return VIDEO_HQV_INUSE | SW_USE_HQV | VIDEO_3_INUSE; case PCI_CHIP_VT3259: case PCI_CHIP_VT3327: case PCI_CHIP_VT3336: case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: case PCI_CHIP_VT3353: case PCI_CHIP_VT3409: case PCI_CHIP_VT3410: return (VIDEO_HQV_INUSE | SW_USE_HQV | VIDEO_1_INUSE | VIDEO_ACTIVE | VIDEO_SHOW); case PCI_CHIP_CLE3122: return VIDEO_HQV_INUSE | SW_USE_HQV | VIDEO_1_INUSE; default: DBG_DD(ErrorF("Unknown DeviceID\n")); break; } return 0; } static unsigned long ViaSetVidCtl(VIAPtr pVia, unsigned int videoFlag) { if (videoFlag & VIDEO_1_INUSE) { /*=* Modify for C1 FIFO *=*/ /* WARNING: not checking Chipset! */ if (CLE266_REV_IS_CX(pVia->ChipRev)) return V1_ENABLE | V1_EXPIRE_NUM_F; else { /* Overlay source format for V1 */ if (pVia->swov.gdwUseExtendedFIFO) return V1_ENABLE | V1_EXPIRE_NUM_A | V1_FIFO_EXTENDED; else return V1_ENABLE | V1_EXPIRE_NUM; } } else { switch (pVia->ChipId) { case PCI_CHIP_VT3205: case PCI_CHIP_VT3204: case PCI_CHIP_VT3259: case PCI_CHIP_VT3314: return V3_ENABLE | V3_EXPIRE_NUM_3205; case PCI_CHIP_VT3327: case PCI_CHIP_VT3336: case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: case PCI_CHIP_VT3353: return V3_ENABLE | VIDEO_EXPIRE_NUM_VT3336; case PCI_CHIP_VT3409: case PCI_CHIP_VT3410: return V3_ENABLE | VIDEO_EXPIRE_NUM_VT3409; case PCI_CHIP_CLE3122: if (CLE266_REV_IS_CX(pVia->ChipRev)) return V3_ENABLE | V3_EXPIRE_NUM_F; else return V3_ENABLE | V3_EXPIRE_NUM; default: DBG_DD(ErrorF("Unknown DeviceID\n")); break; } } return 0; } /* * Fill the buffer with 0x8000 (YUV2 black). */ static void ViaYUVFillBlack(VIAPtr pVia, void *buf, int num) { CARD16 *ptr = (CARD16 *) buf; while (num-- > 0) #if X_BYTE_ORDER == X_LITTLE_ENDIAN *ptr++ = 0x0080; #else *ptr++ = 0x8000; #endif } /* * Add an HQV surface to an existing FOURCC surface. * numbuf: number of buffers, 1, 2 or 3 * fourcc: FOURCC code of the current (already existing) surface */ static long AddHQVSurface(ScrnInfoPtr pScrn, unsigned int numbuf, CARD32 fourcc) { unsigned int i, width, height, pitch, fbsize, addr; BOOL isplanar; void *buf; VIAPtr pVia = VIAPTR(pScrn); CARD32 AddrReg[3] = { HQV_DST_STARTADDR0, HQV_DST_STARTADDR1, HQV_DST_STARTADDR2 }; unsigned long proReg = 0; if (pVia->ChipId == PCI_CHIP_VT3259 && !(pVia->swov.gdwVideoFlagSW & VIDEO_1_INUSE)) proReg = PRO_HQV1_OFFSET; isplanar = ((fourcc == FOURCC_YV12) || (fourcc == FOURCC_I420) || (fourcc == FOURCC_XVMC)); width = pVia->swov.SWDevice.gdwSWSrcWidth; height = pVia->swov.SWDevice.gdwSWSrcHeight; pitch = pVia->swov.SWDevice.dwPitch; fbsize = pitch * height * (isplanar ? 2 : 1); pVia->swov.HQVMem = drm_bo_alloc(pScrn, fbsize * numbuf, 1, TTM_PL_FLAG_VRAM); if (!pVia->swov.HQVMem) return BadAlloc; addr = pVia->swov.HQVMem->offset; buf = drm_bo_map(pScrn, pVia->swov.HQVMem); ViaYUVFillBlack(pVia, buf, fbsize); for (i = 0; i < numbuf; i++) { pVia->swov.overlayRecordV1.dwHQVAddr[i] = addr; VIASETREG(AddrReg[i] + proReg, addr); addr += fbsize; } drm_bo_unmap(pScrn, pVia->swov.HQVMem); return Success; } /* * Create a FOURCC surface. * doalloc: set true to actually allocate memory for the framebuffers */ static long CreateSurface(ScrnInfoPtr pScrn, CARD32 FourCC, CARD16 Width, CARD16 Height, BOOL doalloc) { VIAPtr pVia = VIAPTR(pScrn); unsigned long pitch, fbsize, addr; BOOL isplanar; void *buf; pVia->swov.SrcFourCC = FourCC; pVia->swov.gdwVideoFlagSW = ViaInitVideoStatusFlag(pVia); isplanar = FALSE; switch (FourCC) { case FOURCC_YV12: case FOURCC_I420: case FOURCC_XVMC: isplanar = TRUE; pitch = ALIGN_TO(Width, 32); fbsize = pitch * Height * 1.5; break; case FOURCC_RV32: pitch = ALIGN_TO(Width << 2, 32); fbsize = pitch * Height; break; default: pitch = ALIGN_TO(Width << 1, 32); fbsize = pitch * Height; break; } if (doalloc) { pVia->swov.SWfbMem = drm_bo_alloc(pScrn, fbsize * 2, 1, TTM_PL_FLAG_VRAM); if (!pVia->swov.SWfbMem) return BadAlloc; addr = pVia->swov.SWfbMem->offset; buf = drm_bo_map(pScrn, pVia->swov.SWfbMem); ViaYUVFillBlack(pVia, buf, fbsize); pVia->swov.SWDevice.dwSWPhysicalAddr[0] = addr; pVia->swov.SWDevice.dwSWPhysicalAddr[1] = addr + fbsize; pVia->swov.SWDevice.lpSWOverlaySurface[0] = buf; pVia->swov.SWDevice.lpSWOverlaySurface[1] = buf + fbsize; if (isplanar) { pVia->swov.SWDevice.dwSWCrPhysicalAddr[0] = pVia->swov.SWDevice.dwSWPhysicalAddr[0] + (pitch * Height); pVia->swov.SWDevice.dwSWCrPhysicalAddr[1] = pVia->swov.SWDevice.dwSWPhysicalAddr[1] + (pitch * Height); pVia->swov.SWDevice.dwSWCbPhysicalAddr[0] = pVia->swov.SWDevice.dwSWCrPhysicalAddr[0] + ((pitch >> 1) * (Height >> 1)); pVia->swov.SWDevice.dwSWCbPhysicalAddr[1] = pVia->swov.SWDevice.dwSWCrPhysicalAddr[1] + ((pitch >> 1) * (Height >> 1)); } } pVia->swov.SWDevice.gdwSWSrcWidth = Width; pVia->swov.SWDevice.gdwSWSrcHeight = Height; pVia->swov.SWDevice.dwPitch = pitch; pVia->swov.overlayRecordV1.dwV1OriWidth = Width; pVia->swov.overlayRecordV1.dwV1OriHeight = Height; pVia->swov.overlayRecordV1.dwV1OriPitch = pitch; return Success; } /* * */ int ViaSwovSurfaceCreate(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv, CARD32 FourCC, CARD16 Width, CARD16 Height) { VIAPtr pVia = VIAPTR(pScrn); unsigned long retCode = Success; int numbuf = pVia->HWDiff.dwThreeHQVBuffer ? 3 : 2; DBG_DD(ErrorF("ViaSwovSurfaceCreate: FourCC =0x%08lx\n", FourCC)); if ((pVia->VideoStatus & VIDEO_SWOV_SURFACE_CREATED) && (FourCC == pPriv->FourCC)) return Success; pPriv->FourCC = FourCC; switch (FourCC) { case FOURCC_YUY2: case FOURCC_RV15: case FOURCC_RV16: case FOURCC_RV32: retCode = CreateSurface(pScrn, FourCC, Width, Height, TRUE); if (retCode != Success) break; if ((pVia->swov.gdwVideoFlagSW & SW_USE_HQV)) retCode = AddHQVSurface(pScrn, numbuf, FourCC); break; case FOURCC_HQVSW: retCode = AddHQVSurface(pScrn, numbuf, FOURCC_YUY2); break; case FOURCC_YV12: case FOURCC_I420: retCode = CreateSurface(pScrn, FourCC, Width, Height, TRUE); if (retCode == Success) retCode = AddHQVSurface(pScrn, numbuf, FourCC); break; case FOURCC_XVMC: retCode = CreateSurface(pScrn, FourCC, Width, Height, FALSE); if (retCode == Success) retCode = AddHQVSurface(pScrn, numbuf, FOURCC_XVMC); break; default: break; } if (retCode == Success) { DBG_DD(ErrorF(" lpSWOverlaySurface[0]: %p\n", pVia->swov.SWDevice.lpSWOverlaySurface[0])); DBG_DD(ErrorF(" lpSWOverlaySurface[1]: %p\n", pVia->swov.SWDevice.lpSWOverlaySurface[1])); pVia->VideoStatus |= VIDEO_SWOV_SURFACE_CREATED | VIDEO_SWOV_ON; } return retCode; } /* * Destroy Surface */ void ViaSwovSurfaceDestroy(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv) { VIAPtr pVia = VIAPTR(pScrn); DBG_DD(ErrorF("ViaSwovSurfaceDestroy: FourCC =0x%08lx\n", pPriv->FourCC)); if (pVia->VideoStatus & VIDEO_SWOV_SURFACE_CREATED) { DBG_DD(ErrorF("ViaSwovSurfaceDestroy: VideoStatus =0x%08lx\n", pVia->VideoStatus)); switch (pPriv->FourCC) { case FOURCC_YUY2: case FOURCC_RV16: case FOURCC_RV32: case FOURCC_RV15: pVia->swov.SrcFourCC = 0; drm_bo_unmap(pScrn, pVia->swov.SWfbMem); drm_bo_free(pScrn, pVia->swov.SWfbMem); if ((pVia->swov.gdwVideoFlagSW & SW_USE_HQV)) { drm_bo_unmap(pScrn, pVia->swov.HQVMem); drm_bo_free(pScrn, pVia->swov.HQVMem); } pVia->swov.gdwVideoFlagSW = 0; break; case FOURCC_HQVSW: drm_bo_free(pScrn, pVia->swov.HQVMem); pVia->swov.gdwVideoFlagSW = 0; break; case FOURCC_YV12: case FOURCC_I420: drm_bo_unmap(pScrn, pVia->swov.SWfbMem); drm_bo_free(pScrn, pVia->swov.SWfbMem); case FOURCC_XVMC: pVia->swov.SrcFourCC = 0; drm_bo_free(pScrn, pVia->swov.HQVMem); pVia->swov.gdwVideoFlagSW = 0; break; } pPriv->FourCC = 0; pVia->VideoStatus &= ~VIDEO_SWOV_SURFACE_CREATED; } else DBG_DD(ErrorF("ViaSwovSurfaceDestroy: No SW Surface Destroyed, " "VideoStatus =0x%08lx\n", pVia->VideoStatus)); } static void SetFIFO_V1(VIAPtr pVia, CARD8 depth, CARD8 prethreshold, CARD8 threshold) { SaveVideoRegister(pVia, V_FIFO_CONTROL, ((depth - 1) & 0x7f) | ((prethreshold & 0x7f) << 24) | ((threshold & 0x7f) << 8)); } static void SetFIFO_V3(VIAPtr pVia, CARD8 depth, CARD8 prethreshold, CARD8 threshold) { switch (pVia->ChipId) { case PCI_CHIP_VT3314: case PCI_CHIP_VT3324: case PCI_CHIP_VT3327: case PCI_CHIP_VT3353: case PCI_CHIP_VT3409: case PCI_CHIP_VT3410: SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL, (VIAGETREG(ALPHA_V3_FIFO_CONTROL) & ALPHA_FIFO_MASK) | ((depth - 1) & 0xff) | ((threshold & 0xff) << 8)); SaveVideoRegister(pVia, ALPHA_V3_PREFIFO_CONTROL, (VIAGETREG(ALPHA_V3_PREFIFO_CONTROL) & ~V3_FIFO_MASK_3314) | (prethreshold & 0xff)); break; default : SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL, (VIAGETREG(ALPHA_V3_FIFO_CONTROL) & ALPHA_FIFO_MASK) | ((depth - 1) & 0xff) | ((threshold & 0xff) << 8)); SaveVideoRegister(pVia, ALPHA_V3_PREFIFO_CONTROL, (VIAGETREG(ALPHA_V3_PREFIFO_CONTROL) & ~V3_FIFO_MASK) | (prethreshold & 0x7f)); break; } } static void SetFIFO_64or32(VIAPtr pVia) { /*=* Modify for C1 FIFO *=*/ /* WARNING: not checking Chipset! */ if (CLE266_REV_IS_CX(pVia->ChipRev)) SetFIFO_V1(pVia, 64, 56, 56); else SetFIFO_V1(pVia, 32, 29, 16); } static void SetFIFO_64or16(VIAPtr pVia) { /*=* Modify for C1 FIFO *=*/ /* WARNING: not checking Chipset! */ if (CLE266_REV_IS_CX(pVia->ChipRev)) SetFIFO_V1(pVia, 64, 56, 56); else SetFIFO_V1(pVia, 16, 12, 8); } static void SetFIFO_64or48or32(VIAPtr pVia) { /*=* Modify for C1 FIFO *=*/ /* WARNING: not checking Chipset! */ if (CLE266_REV_IS_CX(pVia->ChipRev)) SetFIFO_V1(pVia, 64, 56, 56); else { if (pVia->swov.gdwUseExtendedFIFO) SetFIFO_V1(pVia, 48, 40, 40); else SetFIFO_V1(pVia, 32, 29, 16); } } static void SetFIFO_V3_64or32or32(VIAPtr pVia) { switch (pVia->ChipId) { case PCI_CHIP_VT3327: case PCI_CHIP_VT3336: case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: case PCI_CHIP_VT3353: case PCI_CHIP_VT3409: case PCI_CHIP_VT3410: SetFIFO_V3(pVia, 225, 200, 250); break; case PCI_CHIP_VT3204: SetFIFO_V3(pVia, 100, 89, 89); break; case PCI_CHIP_VT3314: SetFIFO_V3(pVia, 64, 61, 61); break; case PCI_CHIP_VT3205: case PCI_CHIP_VT3259: SetFIFO_V3(pVia, 32, 29, 29); break; case PCI_CHIP_CLE3122: if (CLE266_REV_IS_CX(pVia->ChipRev)) SetFIFO_V3(pVia, 64, 56, 56); else SetFIFO_V3(pVia, 32, 16, 16); break; default: break; } } static void SetFIFO_V3_64or32or16(VIAPtr pVia) { switch (pVia->ChipId) { case PCI_CHIP_VT3327: case PCI_CHIP_VT3336: case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: case PCI_CHIP_VT3353: case PCI_CHIP_VT3409: case PCI_CHIP_VT3410: SetFIFO_V3(pVia, 225, 200, 250); break; case PCI_CHIP_VT3204: SetFIFO_V3(pVia, 100, 89, 89); break; case PCI_CHIP_VT3314: SetFIFO_V3(pVia, 64, 61, 61); break; case PCI_CHIP_VT3205: case PCI_CHIP_VT3259: SetFIFO_V3(pVia, 32, 29, 29); break; case PCI_CHIP_CLE3122: if (CLE266_REV_IS_CX(pVia->ChipRev)) SetFIFO_V3(pVia, 64, 56, 56); else SetFIFO_V3(pVia, 16, 16, 8); break; default: break; } } static void SetupFIFOs(VIAPtr pVia, unsigned long videoFlag, unsigned long miniCtl, unsigned long srcWidth) { if (miniCtl & V1_Y_INTERPOLY) { if (pVia->swov.SrcFourCC == FOURCC_YV12 || pVia->swov.SrcFourCC == FOURCC_I420 || pVia->swov.SrcFourCC == FOURCC_XVMC) { if (videoFlag & VIDEO_HQV_INUSE) { if (videoFlag & VIDEO_1_INUSE) SetFIFO_64or32(pVia); else SetFIFO_V3_64or32or16(pVia); } else { /* Minified video will be skewed without this workaround. */ if (srcWidth <= 80) { /* Fetch count <= 5 */ if (videoFlag & VIDEO_1_INUSE) SetFIFO_V1(pVia, 16, 0, 0); else SetFIFO_V3(pVia, 16, 16, 0); } else { if (videoFlag & VIDEO_1_INUSE) SetFIFO_64or16(pVia); else SetFIFO_V3_64or32or16(pVia); } } } else { if (videoFlag & VIDEO_1_INUSE) SetFIFO_64or48or32(pVia); else { /* Fix V3 bug. */ if (srcWidth <= 8) SetFIFO_V3(pVia, 1, 0, 0); else SetFIFO_V3_64or32or32(pVia); } } } else { if (pVia->swov.SrcFourCC == FOURCC_YV12 || pVia->swov.SrcFourCC == FOURCC_I420 || pVia->swov.SrcFourCC == FOURCC_XVMC) { if (videoFlag & VIDEO_HQV_INUSE) { if (videoFlag & VIDEO_1_INUSE) SetFIFO_64or32(pVia); else SetFIFO_V3_64or32or16(pVia); } else { /* Minified video will be skewed without this workaround. */ if (srcWidth <= 80) { /* Fetch count <= 5 */ if (videoFlag & VIDEO_1_INUSE) SetFIFO_V1(pVia, 16, 0, 0); else SetFIFO_V3(pVia, 16, 16, 0); } else { if (videoFlag & VIDEO_1_INUSE) SetFIFO_64or16(pVia); else SetFIFO_V3_64or32or16(pVia); } } } else { if (videoFlag & VIDEO_1_INUSE) SetFIFO_64or48or32(pVia); else { /* Fix V3 bug. */ if (srcWidth <= 8) SetFIFO_V3(pVia, 1, 0, 0); else SetFIFO_V3_64or32or32(pVia); } } } } static CARD32 SetColorKey(VIAPtr pVia, unsigned long videoFlag, CARD32 keyLow, CARD32 keyHigh, CARD32 compose) { keyLow &= 0x00FFFFFF; if (pVia->VideoEngine == VIDEO_ENGINE_CME) keyLow |= 0x40000000; if (videoFlag & VIDEO_1_INUSE) { SaveVideoRegister(pVia, V_COLOR_KEY, keyLow); SaveVideoRegister(pVia, SND_COLOR_KEY, keyLow); } else { if (pVia->HWDiff.dwSupportTwoColorKey) /*CLE_C0 */ SaveVideoRegister(pVia, V3_COLOR_KEY, keyLow); } /*CLE_C0 */ compose = ((compose & ~0x0f) | SELECT_VIDEO_IF_COLOR_KEY | SELECT_VIDEO3_IF_COLOR_KEY); return compose; } static CARD32 SetChromaKey(VIAPtr pVia, unsigned long videoFlag, CARD32 chromaLow, CARD32 chromaHigh, CARD32 miniCtl, CARD32 compose) { chromaLow &= CHROMA_KEY_LOW; chromaHigh &= CHROMA_KEY_HIGH; chromaLow |= (VIAGETREG(V_CHROMAKEY_LOW) & ~CHROMA_KEY_LOW); chromaHigh |= (VIAGETREG(V_CHROMAKEY_HIGH) & ~CHROMA_KEY_HIGH); if (pVia->VideoEngine == VIDEO_ENGINE_CME) chromaLow |= 0x40000000; SaveVideoRegister(pVia, V_CHROMAKEY_HIGH, chromaHigh); if (videoFlag & VIDEO_1_INUSE) { SaveVideoRegister(pVia, V_CHROMAKEY_LOW, chromaLow & ~V_CHROMAKEY_V3); /* Temporarily solve the HW interpolation error when using Chroma key */ SaveVideoRegister(pVia, V1_MINI_CONTROL, miniCtl & 0xFFFFFFF8); } else { SaveVideoRegister(pVia, V_CHROMAKEY_LOW, chromaLow | V_CHROMAKEY_V3); SaveVideoRegister(pVia, V3_MINI_CONTROL, miniCtl & 0xFFFFFFF8); } /* Modified by Scottie[2001.12.5] for select video if (Color key & Chroma key) */ if (compose == SELECT_VIDEO_IF_COLOR_KEY) compose = SELECT_VIDEO_IF_COLOR_KEY | SELECT_VIDEO_IF_CHROMA_KEY; else compose = (compose & ~0x0f) | SELECT_VIDEO_IF_CHROMA_KEY; return compose; } static void SetVideoStart(VIAPtr pVia, unsigned long videoFlag, unsigned int numbufs, CARD32 a1, CARD32 a2, CARD32 a3) { CARD32 V1Addr[3] = { V1_STARTADDR_0, V1_STARTADDR_1, V1_STARTADDR_2 }; CARD32 V3Addr[3] = { V3_STARTADDR_0, V3_STARTADDR_1, V3_STARTADDR_2 }; CARD32 *VideoAddr = (videoFlag & VIDEO_1_INUSE) ? V1Addr : V3Addr; SaveVideoRegister(pVia, VideoAddr[0], a1); if (numbufs > 1) SaveVideoRegister(pVia, VideoAddr[1], a2); if (numbufs > 2) SaveVideoRegister(pVia, VideoAddr[2], a3); } static void SetHQVFetch(VIAPtr pVia, CARD32 srcFetch, unsigned long srcHeight) { unsigned long proReg = 0; if (pVia->ChipId == PCI_CHIP_VT3259 && !(pVia->swov.gdwVideoFlagSW & VIDEO_1_INUSE)) proReg = PRO_HQV1_OFFSET; if (!pVia->HWDiff.dwHQVFetchByteUnit) { /* CLE_C0 */ srcFetch >>= 3; /* fetch unit is 8 bytes */ } if ((pVia->ChipId != PCI_CHIP_VT3409) && (pVia->ChipId != PCI_CHIP_VT3410)) SaveVideoRegister(pVia, HQV_SRC_FETCH_LINE + proReg, ((srcFetch - 1) << 16) | (srcHeight - 1)); } static void SetFetch(VIAPtr pVia, unsigned long videoFlag, CARD32 fetch) { fetch <<= 20; if (videoFlag & VIDEO_1_INUSE) { SaveVideoRegister(pVia, V12_QWORD_PER_LINE, fetch); } else { fetch |= VIAGETREG(V3_ALPHA_QWORD_PER_LINE) & ~V3_FETCH_COUNT; SaveVideoRegister(pVia, V3_ALPHA_QWORD_PER_LINE, fetch); } } static void SetDisplayCount(VIAPtr pVia, unsigned long videoFlag, unsigned long srcWidth, unsigned long srcHeight) { unsigned long DisplayCount; /* Removed VIA's large pixelformat switch/case. * All formats (YV12, UYVY, YUY2, VIA, RGB16 and RGB32) * seem to use the same count. /A */ if (videoFlag & VIDEO_HQV_INUSE) DisplayCount = srcWidth - 1; else DisplayCount = srcWidth - pVia->swov.overlayRecordV1.dwminifyH; if (videoFlag & VIDEO_1_INUSE) SaveVideoRegister(pVia, V1_SOURCE_HEIGHT, (srcHeight << 16) | DisplayCount); else SaveVideoRegister(pVia, V3_SOURCE_WIDTH, DisplayCount); } static void SetMiniAndZoom(VIAPtr pVia, unsigned long videoFlag, CARD32 miniCtl, CARD32 zoomCtl) { if (videoFlag & VIDEO_1_INUSE) { SaveVideoRegister(pVia, V1_MINI_CONTROL, miniCtl); SaveVideoRegister(pVia, V1_ZOOM_CONTROL, zoomCtl); } else { SaveVideoRegister(pVia, V3_MINI_CONTROL, miniCtl); SaveVideoRegister(pVia, V3_ZOOM_CONTROL, zoomCtl); } } static void SetVideoControl(VIAPtr pVia, unsigned long videoFlag, CARD32 vidCtl) { if (videoFlag & VIDEO_1_INUSE) SaveVideoRegister(pVia, V1_CONTROL, vidCtl); else SaveVideoRegister(pVia, V3_CONTROL, vidCtl); } static void FireVideoCommand(VIAPtr pVia, unsigned long videoFlag, CARD32 compose) { if (videoFlag & VIDEO_1_INUSE) SaveVideoRegister(pVia, V_COMPOSE_MODE, compose | V1_COMMAND_FIRE); else SaveVideoRegister(pVia, V_COMPOSE_MODE, compose | V3_COMMAND_FIRE); } static void SetVideoWindow(ScrnInfoPtr pScrn, unsigned long videoFlag, LPDDUPDATEOVERLAY pUpdate) { VIAPtr pVia = VIAPTR(pScrn); CARD32 left = pUpdate->DstLeft; CARD32 top = pUpdate->DstTop; CARD32 right = pUpdate->DstRight - 1; CARD32 bottom = pUpdate->DstBottom - 1; DBG_DD(ErrorF("SetVideoWindow: X (%ld,%ld) Y (%ld,%ld)\n", left, right, top, bottom)); /* Modify for HW DVI limitation. * When we enable both the CRT and DVI, then change resolution. * If the resolution is smaller than the panel's physical size, * the video display in Y direction will be cut. * So, we need to adjust the Y top and bottom position. * if (videoFlag & VIDEO_1_INUSE) { if (pBIOSInfo->SetDVI && pBIOSInfo->scaleY) { top = (pUpdate->DstTop * pBIOSInfo->Panel->NativeMode->Height / pScrn->currentMode->VDisplay); bottom = (pUpdate->DstBottom * pBIOSInfo->Panel->NativeMode->Height / pScrn->currentMode->VDisplay); } }*/ if (top > 2047) top = 2047; if (bottom > 2047) bottom = 2047; if (left > 2047) left = 2047; if (right > 2047) right = 2047; if (videoFlag & VIDEO_1_INUSE) { SaveVideoRegister(pVia, V1_WIN_END_Y, (right << 16) | bottom); SaveVideoRegister(pVia, V1_WIN_START_Y, (left << 16) | top); } else { SaveVideoRegister(pVia, V3_WIN_END_Y, (right << 16) | bottom); SaveVideoRegister(pVia, V3_WIN_START_Y, (left << 16) | top); } } /* * Upd_Video() */ static Bool Upd_Video(xf86CrtcPtr crtc, unsigned long videoFlag, unsigned long startAddr, LPDDUPDATEOVERLAY pUpdate, unsigned long srcPitch, unsigned long oriSrcWidth, unsigned long oriSrcHeight, unsigned long deinterlaceMode, unsigned long haveColorKey, unsigned long haveChromaKey, unsigned long colorKeyLow, unsigned long colorKeyHigh, unsigned long chromaKeyLow, unsigned long chromaKeyHigh) { drmmode_crtc_private_ptr iga = crtc->driver_private; ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); VIAHWDiff *hwDiff = &pVia->HWDiff; unsigned long vidCtl = 0, compose; unsigned long srcWidth, srcHeight, dstWidth, dstHeight; unsigned long zoomCtl = 0, miniCtl = 0; unsigned long hqvCtl = 0; unsigned long hqvFilterCtl = 0, hqvMiniCtl = 0; unsigned long hqvScaleCtlH = 0, hqvScaleCtlV = 0; unsigned long haveHQVzoomH = 0, haveHQVzoomV = 0; unsigned long hqvSrcWidth = 0, hqvDstWidth = 0; unsigned long hqvSrcFetch = 0, hqvOffset = 0; unsigned long dwOffset = 0, fetch = 0, tmp = 0; unsigned long proReg = 0; int i; DBG_DD(ErrorF("videoflag=%ld\n", videoFlag)); if (pVia->ChipId == PCI_CHIP_VT3259 && !(videoFlag & VIDEO_1_INUSE)) proReg = PRO_HQV1_OFFSET; compose = ((VIAGETREG(V_COMPOSE_MODE) & ~(SELECT_VIDEO_IF_COLOR_KEY | V1_COMMAND_FIRE | V3_COMMAND_FIRE)) | V_COMMAND_LOAD_VBI); DBG_DD(ErrorF("// Upd_Video:\n")); DBG_DD(ErrorF("Modified rSrc X (%ld,%ld) Y (%ld,%ld)\n", pUpdate->SrcLeft, pUpdate->SrcRight, pUpdate->SrcTop, pUpdate->SrcBottom)); DBG_DD(ErrorF("Modified rDest X (%ld,%ld) Y (%ld,%ld)\n", pUpdate->DstLeft, pUpdate->DstRight, pUpdate->DstTop, pUpdate->DstBottom)); dstWidth = pUpdate->DstRight - pUpdate->DstLeft; /*if (pBIOSInfo->lvds && pBIOSInfo->lvds->status == XF86OutputStatusConnected && pBIOSInfo->Panel->Scale) { * FIXME: We need to determine if the panel is using V1 or V3 * float hfactor = (float)pBIOSInfo->Panel->NativeMode->Width / pScrn->currentMode->HDisplay; dstWidth *= hfactor; }*/ pVia->swov.overlayRecordV1.dwWidth = dstWidth; pVia->swov.overlayRecordV1.dwHeight = dstHeight = pUpdate->DstBottom - pUpdate->DstTop; srcWidth = (unsigned long)pUpdate->SrcRight - pUpdate->SrcLeft; srcHeight = (unsigned long)pUpdate->SrcBottom - pUpdate->SrcTop; DBG_DD(ErrorF("===srcWidth= %ld \n", srcWidth)); DBG_DD(ErrorF("===srcHeight= %ld \n", srcHeight)); vidCtl = ViaSetVidCtl(pVia, videoFlag); if (hwDiff->dwNeedV1Prefetch) { DBG_DD(ErrorF("NEEDV1PREFETCH\n")); vidCtl |= V1_PREFETCH_ON_3336; } /* * Enable video on secondary */ if ((pVia->VideoEngine == VIDEO_ENGINE_CME || pVia->Chipset == VIA_P4M800PRO) && iga->index) { /* V1_ON_SND_DISPLAY */ vidCtl |= V1_ON_SND_DISPLAY; /* SECOND_DISPLAY_COLOR_KEY_ENABLE */ compose |= SECOND_DISPLAY_COLOR_KEY_ENABLE | 0x1; } viaOverlayGetV1V3Format(pVia, (videoFlag & VIDEO_1_INUSE) ? 1 : 3, videoFlag, &vidCtl, &hqvCtl); if (hwDiff->dwThreeHQVBuffer) { /* CLE_C0: HQV supports triple-buffering */ hqvCtl &= ~HQV_SW_FLIP; hqvCtl |= HQV_TRIPLE_BUFF | HQV_FLIP_STATUS; } /* Starting address of source and Source offset */ dwOffset = viaOverlayGetSrcStartAddress(pVia, videoFlag, pUpdate, srcPitch, &hqvOffset); DBG_DD(ErrorF("===dwOffset= 0x%lx \n", dwOffset)); pVia->swov.overlayRecordV1.dwOffset = dwOffset; if (pVia->swov.SrcFourCC == FOURCC_YV12 || pVia->swov.SrcFourCC == FOURCC_I420 || pVia->swov.SrcFourCC == FOURCC_XVMC) { YCBCRREC YCbCr; if (videoFlag & VIDEO_HQV_INUSE) { SetVideoStart(pVia, videoFlag, hwDiff->dwThreeHQVBuffer ? 3 : 2, pVia->swov.overlayRecordV1.dwHQVAddr[0] + dwOffset, pVia->swov.overlayRecordV1.dwHQVAddr[1] + dwOffset, pVia->swov.overlayRecordV1.dwHQVAddr[2] + dwOffset); if (pVia->swov.SrcFourCC != FOURCC_XVMC) { YCbCr = viaOverlayGetYCbCrStartAddress(videoFlag, startAddr, pVia->swov.overlayRecordV1.dwOffset, pVia->swov.overlayRecordV1.dwUVoffset, srcPitch, oriSrcHeight); if (pVia->VideoEngine == VIDEO_ENGINE_CME) { SaveVideoRegister(pVia, HQV_SRC_STARTADDR_Y + proReg, YCbCr.dwY); SaveVideoRegister(pVia, HQV_SRC_STARTADDR_U + proReg, YCbCr.dwCB); } else { SaveVideoRegister(pVia, HQV_SRC_STARTADDR_Y, YCbCr.dwY); SaveVideoRegister(pVia, HQV_SRC_STARTADDR_U, YCbCr.dwCR); SaveVideoRegister(pVia, HQV_SRC_STARTADDR_V, YCbCr.dwCB); } } } else { YCbCr = viaOverlayGetYCbCrStartAddress(videoFlag, startAddr, pVia->swov.overlayRecordV1.dwOffset, pVia->swov.overlayRecordV1.dwUVoffset, srcPitch, oriSrcHeight); if (videoFlag & VIDEO_1_INUSE) { SaveVideoRegister(pVia, V1_STARTADDR_0, YCbCr.dwY); SaveVideoRegister(pVia, V1_STARTADDR_CB0, YCbCr.dwCR); SaveVideoRegister(pVia, V1_STARTADDR_CR0, YCbCr.dwCB); } else DBG_DD(ErrorF("Upd_Video(): " "We do not support YV12 with V3!\n")); } } else { if (videoFlag & VIDEO_HQV_INUSE) { hqvSrcWidth = (unsigned long)pUpdate->SrcRight - pUpdate->SrcLeft; hqvDstWidth = (unsigned long)pUpdate->DstRight - pUpdate->DstLeft; if (hqvSrcWidth > hqvDstWidth) dwOffset = dwOffset * hqvDstWidth / hqvSrcWidth; SetVideoStart(pVia, videoFlag, hwDiff->dwThreeHQVBuffer ? 3 : 2, pVia->swov.overlayRecordV1.dwHQVAddr[0] + hqvOffset, pVia->swov.overlayRecordV1.dwHQVAddr[1] + hqvOffset, pVia->swov.overlayRecordV1.dwHQVAddr[2] + hqvOffset); if (pVia->VideoEngine == VIDEO_ENGINE_CME) SaveVideoRegister(pVia, 0x1cc + proReg, dwOffset); SaveVideoRegister(pVia, HQV_SRC_STARTADDR_Y + proReg, startAddr); } else { startAddr += dwOffset; SetVideoStart(pVia, videoFlag, 1, startAddr, 0, 0); } } fetch = viaOverlayGetFetch(pVia, videoFlag, srcWidth, dstWidth, oriSrcWidth, &hqvSrcFetch); DBG_DD(ErrorF("===fetch= 0x%lx\n", fetch)); #if 0 /* For DCT450 test-BOB INTERLEAVE */ if ((deinterlaceMode & DDOVER_INTERLEAVED) && (deinterlaceMode & DDOVER_BOB)) { if (videoFlag & VIDEO_HQV_INUSE) hqvCtl |= HQV_FIELD_2_FRAME | HQV_FRAME_2_FIELD | HQV_DEINTERLACE; else vidCtl |= V1_BOB_ENABLE | V1_FRAME_BASE; } else if (deinterlaceMode & DDOVER_BOB) { if (videoFlag & VIDEO_HQV_INUSE) /* The HQV source data line count should be two times of the original line count */ hqvCtl |= HQV_FIELD_2_FRAME | HQV_DEINTERLACE; else vidCtl |= V1_BOB_ENABLE; } #endif if (videoFlag & VIDEO_HQV_INUSE) { if (!(deinterlaceMode & DDOVER_INTERLEAVED) && (deinterlaceMode & DDOVER_BOB)) SetHQVFetch(pVia, hqvSrcFetch, oriSrcHeight << 1); else SetHQVFetch(pVia, hqvSrcFetch, oriSrcHeight); if (pVia->swov.SrcFourCC == FOURCC_YV12 || pVia->swov.SrcFourCC == FOURCC_I420 || pVia->swov.SrcFourCC == FOURCC_XVMC) { if (videoFlag & VIDEO_1_INUSE) SaveVideoRegister(pVia, V1_STRIDE, srcPitch << 1); else SaveVideoRegister(pVia, V3_STRIDE, srcPitch << 1); if (pVia->HWDiff.dwHQVFetchByteUnit) SaveVideoRegister(pVia, HQV_SRC_STRIDE + proReg, ((srcPitch >> 1) << 16) | srcPitch | HQV_FIFO_DEPTH_1); else SaveVideoRegister(pVia, HQV_SRC_STRIDE + proReg, ((srcPitch >> 1) << 16) | srcPitch); SaveVideoRegister(pVia, HQV_DST_STRIDE + proReg, (srcPitch << 1)); } else { if (videoFlag & VIDEO_1_INUSE) SaveVideoRegister(pVia, V1_STRIDE, srcPitch); else SaveVideoRegister(pVia, V3_STRIDE, srcPitch); SaveVideoRegister(pVia, HQV_SRC_STRIDE + proReg, srcPitch); SaveVideoRegister(pVia, HQV_DST_STRIDE + proReg, srcPitch); } } else { if (videoFlag & VIDEO_1_INUSE) SaveVideoRegister(pVia, V1_STRIDE, srcPitch | (srcPitch << 15)); else SaveVideoRegister(pVia, V3_STRIDE, srcPitch | (srcPitch << 15)); } /* Set destination window */ SetVideoWindow(pScrn, videoFlag, pUpdate); compose |= ALWAYS_SELECT_VIDEO; /* Set up X zoom factor */ pVia->swov.overlayRecordV1.dwFetchAlignment = 0; if (!viaOverlayHQVCalcZoomWidth(pVia, videoFlag, srcWidth, dstWidth, &zoomCtl, &miniCtl, &hqvFilterCtl, &hqvMiniCtl, &hqvScaleCtlH, &haveHQVzoomH)) { /* Need to scale (minify) too much - can't handle it. */ SetFetch(pVia, videoFlag, fetch); FireVideoCommand(pVia, videoFlag, compose); FlushVidRegBuffer(pVia); return FALSE; } SetFetch(pVia, videoFlag, fetch); /* Set up Y zoom factor */ /* For DCT450 test-BOB INTERLEAVE */ if ((deinterlaceMode & DDOVER_INTERLEAVED) && (deinterlaceMode & DDOVER_BOB)) { if (!(videoFlag & VIDEO_HQV_INUSE)) { srcHeight /= 2; if (videoFlag & VIDEO_1_INUSE) vidCtl |= V1_BOB_ENABLE | V1_FRAME_BASE; else vidCtl |= V3_BOB_ENABLE | V3_FRAME_BASE; } else hqvCtl |= HQV_FIELD_2_FRAME | HQV_FRAME_2_FIELD | HQV_DEINTERLACE; } else if (deinterlaceMode & DDOVER_BOB) { if (videoFlag & VIDEO_HQV_INUSE) { srcHeight <<= 1; hqvCtl |= HQV_FIELD_2_FRAME | HQV_DEINTERLACE; } else { if (videoFlag & VIDEO_1_INUSE) vidCtl |= V1_BOB_ENABLE; else vidCtl |= V3_BOB_ENABLE; } } SetDisplayCount(pVia, videoFlag, srcWidth, srcHeight); if (!viaOverlayHQVCalcZoomHeight(pVia, srcHeight, dstHeight, &zoomCtl, &miniCtl, &hqvFilterCtl, &hqvMiniCtl, &hqvScaleCtlV, &haveHQVzoomV)) { /* Need to scale (minify) too much - can't handle it. */ FireVideoCommand(pVia, videoFlag, compose); FlushVidRegBuffer(pVia); return FALSE; } SetupFIFOs(pVia, videoFlag, miniCtl, srcWidth); if (videoFlag & VIDEO_HQV_INUSE) { miniCtl = 0; if (haveHQVzoomH || haveHQVzoomV) { tmp = 0; if (haveHQVzoomH) { miniCtl = V1_X_INTERPOLY; /* Disable X interpolation if the height exceeds * the maximum supported by the hardware */ if (srcHeight >= pVia->swov.maxHInterp) miniCtl &= ~V1_X_INTERPOLY; tmp = zoomCtl & 0xffff0000; } if (haveHQVzoomV) { miniCtl |= V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY; /* Disable Y interpolation if the width exceeds * the maximum supported by the hardware */ if (srcWidth >= pVia->swov.maxWInterp) miniCtl &= ~V1_Y_INTERPOLY; tmp |= zoomCtl & 0x0000ffff; hqvFilterCtl &= 0xfffdffff; } /* Temporary fix for 2D bandwidth problem. 2002/08/01 */ if (pVia->swov.gdwUseExtendedFIFO) miniCtl &= ~V1_Y_INTERPOLY; SetMiniAndZoom(pVia, videoFlag, miniCtl, tmp); } else { if (srcHeight == dstHeight) hqvFilterCtl &= 0xfffdffff; SetMiniAndZoom(pVia, videoFlag, 0, 0); } if (hwDiff->dwNewScaleCtl) { SaveVideoRegister(pVia, HQV_H_SCALE_CONTROL + proReg, hqvScaleCtlH); SaveVideoRegister(pVia, HQV_V_SCALE_CONTROL + proReg, hqvScaleCtlV); } else { SaveVideoRegister(pVia, HQV_MINIFY_CONTROL + proReg, hqvMiniCtl); } SaveVideoRegister(pVia, HQV_FILTER_CONTROL + proReg, hqvFilterCtl); } else SetMiniAndZoom(pVia, videoFlag, miniCtl, zoomCtl); if (haveColorKey) compose = SetColorKey(pVia, videoFlag, colorKeyLow, colorKeyHigh, compose); if (haveChromaKey) compose = SetChromaKey(pVia, videoFlag, chromaKeyLow, chromaKeyHigh, miniCtl, compose); if (pVia->VideoEngine == VIDEO_ENGINE_CME) { SaveVideoRegister(pVia, HQV_CME_REG(hwDiff, HQV_SDO_CTRL1),0); SaveVideoRegister(pVia, HQV_CME_REG(hwDiff, HQV_SDO_CTRL3),((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); if ((pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { SaveVideoRegister(pVia, HQV_CME_REG(hwDiff, HQV_SDO_CTRL2),0); SaveVideoRegister(pVia, HQV_CME_REG(hwDiff, HQV_SDO_CTRL4),((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); if ((pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { SaveVideoRegister(pVia, HQV_DST_DATA_OFFSET_CTRL1,0); SaveVideoRegister(pVia, HQV_DST_DATA_OFFSET_CTRL3,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); SaveVideoRegister(pVia, HQV_DST_DATA_OFFSET_CTRL2,0); SaveVideoRegister(pVia, HQV_DST_DATA_OFFSET_CTRL4,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); SaveVideoRegister(pVia, HQV_BACKGROUND_DATA_OFFSET,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); SaveVideoRegister(pVia, HQV_EXTENDED_CONTROL,0); /*0x3e0*/ SaveVideoRegister(pVia, HQV_SUBP_HSCALE_CTRL,0); /*0x3e8*/ SaveVideoRegister(pVia, HQV_SUBP_VSCALE_CTRL,0); } if (pVia->Chipset == VIA_VX900) { SaveVideoRegister(pVia, HQV_SHARPNESS_DECODER_HANDSHAKE_CTRL_410, 0); } // TODO Need to be tested on VX800 /* 0x3B8 */ SaveVideoRegister(pVia, HQV_DEFAULT_VIDEO_COLOR, HQV_FIX_COLOR); } } /* Set up video control */ if (videoFlag & VIDEO_HQV_INUSE) { if (!pVia->swov.SWVideo_ON) { DBG_DD(ErrorF(" First HQV\n")); FlushVidRegBuffer(pVia); DBG_DD(ErrorF(" Wait flips")); if (hwDiff->dwHQVInitPatch) { DBG_DD(ErrorF(" Initializing HQV twice ...")); for (i = 0; i < 2; i++) { viaWaitHQVFlipClear(pVia, ((hqvCtl & ~HQV_SW_FLIP) | HQV_FLIP_STATUS) & ~HQV_ENABLE); VIASETREG(HQV_CONTROL + proReg, hqvCtl); viaWaitHQVFlip(pVia); } DBG_DD(ErrorF(" done.\n")); } else { /* CLE_C0 */ CARD32 volatile *HQVCtrl = (CARD32 volatile *)(pVia->MapBase + HQV_CONTROL + proReg); /* Check that HQV is idle */ DBG_DD(ErrorF("HQV control wf - %08lx\n", *HQVCtrl)); while (!(*HQVCtrl & HQV_IDLE)) { DBG_DD(ErrorF("HQV control busy - %08lx\n", *HQVCtrl)); usleep(1); } VIASETREG(HQV_CONTROL + proReg, hqvCtl & ~HQV_SW_FLIP); VIASETREG(HQV_CONTROL + proReg, hqvCtl | HQV_SW_FLIP); DBG_DD(ErrorF("HQV control wf5 - %08lx\n", *HQVCtrl)); DBG_DD(ErrorF(" Wait flips5")); if (pVia->VideoEngine != VIDEO_ENGINE_CME) { for (i = 0; (i < 50) && !(*HQVCtrl & HQV_FLIP_STATUS); i++) { DBG_DD(ErrorF(" HQV wait %d %08lx\n", i, *HQVCtrl)); *HQVCtrl |= HQV_SW_FLIP | HQV_FLIP_STATUS; usleep(1); } } else { viaWaitHQVFlip(pVia); } DBG_DD(ErrorF(" Wait flips6")); } if (videoFlag & VIDEO_1_INUSE) { VIASETREG(V1_CONTROL, vidCtl); VIASETREG(V_COMPOSE_MODE, compose | V1_COMMAND_FIRE); if (pVia->swov.gdwUseExtendedFIFO) { /* Set Display FIFO */ DBG_DD(ErrorF(" Wait flips7")); viaWaitVBI(pVia); DBG_DD(ErrorF(" Wait flips 8")); hwp->writeSeq(hwp, 0x17, 0x2F); ViaSeqMask(hwp, 0x16, 0x14, 0x1F); hwp->writeSeq(hwp, 0x18, 0x56); DBG_DD(ErrorF(" Wait flips 9")); } } else { DBG_DD(ErrorF(" Wait flips 10")); VIASETREG(V3_CONTROL, vidCtl); VIASETREG(V_COMPOSE_MODE, compose | V3_COMMAND_FIRE); } DBG_DD(ErrorF(" Done flips")); } else { DBG_DD(ErrorF(" Normal called\n")); SaveVideoRegister(pVia, HQV_CONTROL + proReg, hqvCtl | HQV_FLIP_STATUS); SetVideoControl(pVia, videoFlag, vidCtl); FireVideoCommand(pVia, videoFlag, compose); viaWaitHQVDone(pVia); FlushVidRegBuffer(pVia); } } else { SetVideoControl(pVia, videoFlag, vidCtl); FireVideoCommand(pVia, videoFlag, compose); viaWaitHQVDone(pVia); FlushVidRegBuffer(pVia); } pVia->swov.SWVideo_ON = TRUE; DBG_DD(ErrorF(" Done Upd_Video")); return TRUE; } /* Upd_Video */ /* * VIAVidUpdateOverlay() * Parameters: src rectangle, dst rectangle, colorkey... * Return value: unsigned long of state * Note: updates the overlay image parameter. */ Bool VIAVidUpdateOverlay(xf86CrtcPtr crtc, LPDDUPDATEOVERLAY pUpdate) { ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); OVERLAYRECORD *ovlV1 = &pVia->swov.overlayRecordV1; unsigned long flags = pUpdate->dwFlags; unsigned long videoFlag = 0; unsigned long startAddr = 0; unsigned long deinterlaceMode = 0; unsigned long haveColorKey = 0, haveChromaKey = 0; unsigned long colorKeyLow = 0, colorKeyHigh = 0; unsigned long chromaKeyLow = 0, chromaKeyHigh = 0; unsigned long scrnWidth, scrnHeight; int dstTop, dstBottom, dstLeft, dstRight; int panDX, panDY; /* Panning delta */ unsigned long proReg = 0; panDX = pVia->swov.panning_x; panDY = pVia->swov.panning_y; pVia->swov.oldPanningX = pVia->swov.panning_x; pVia->swov.oldPanningY = pVia->swov.panning_y; pUpdate->DstLeft -= panDX; pUpdate->DstTop -= panDY; pUpdate->DstRight -= panDX; pUpdate->DstBottom -= panDY; DBG_DD(ErrorF("Raw rSrc X (%ld,%ld) Y (%ld,%ld)\n", pUpdate->SrcLeft, pUpdate->SrcRight, pUpdate->SrcTop, pUpdate->SrcBottom)); DBG_DD(ErrorF("Raw rDest X (%ld,%ld) Y (%ld,%ld)\n", pUpdate->DstLeft, pUpdate->DstRight, pUpdate->DstTop, pUpdate->DstBottom)); if ((pVia->swov.SrcFourCC == FOURCC_YUY2) || (pVia->swov.SrcFourCC == FOURCC_RV15) || (pVia->swov.SrcFourCC == FOURCC_RV16) || (pVia->swov.SrcFourCC == FOURCC_RV32) || (pVia->swov.SrcFourCC == FOURCC_YV12) || (pVia->swov.SrcFourCC == FOURCC_I420) || (pVia->swov.SrcFourCC == FOURCC_XVMC)) { videoFlag = pVia->swov.gdwVideoFlagSW; } if (pVia->ChipId == PCI_CHIP_VT3259 && !(videoFlag & VIDEO_1_INUSE)) proReg = PRO_HQV1_OFFSET; flags |= DDOVER_INTERLEAVED; /* Disable destination color keying if the alpha window is in use. */ if (pVia->swov.gdwAlphaEnabled) flags &= ~DDOVER_KEYDEST; ResetVidRegBuffer(pVia); /* For SW decode HW overlay use */ startAddr = VIAGETREG(HQV_SRC_STARTADDR_Y + proReg); if (flags & DDOVER_KEYDEST) { haveColorKey = 1; colorKeyLow = pUpdate->dwColorSpaceLowValue; } if (flags & DDOVER_INTERLEAVED) deinterlaceMode |= DDOVER_INTERLEAVED; if (flags & DDOVER_BOB) deinterlaceMode |= DDOVER_BOB; if ((pVia->ChipId == PCI_CHIP_CLE3122) && (pScrn->currentMode->HDisplay > 1024)) { DBG_DD(ErrorF("UseExtendedFIFO\n")); pVia->swov.gdwUseExtendedFIFO = 1; } else pVia->swov.gdwUseExtendedFIFO = 0; /* Figure out actual rSrc rectangle */ dstLeft = pUpdate->DstLeft; dstTop = pUpdate->DstTop; dstRight = pUpdate->DstRight; dstBottom = pUpdate->DstBottom; scrnWidth = pScrn->currentMode->HDisplay; scrnHeight = pScrn->currentMode->VDisplay; if (dstLeft < 0) { pUpdate->SrcLeft = ((((-dstLeft) * ovlV1->dwV1OriWidth) + ((dstRight - dstLeft) >> 1)) / (dstRight - dstLeft)); } if (dstRight > scrnWidth) { pUpdate->SrcRight = ((((scrnWidth - dstLeft) * ovlV1->dwV1OriWidth) + ((dstRight - dstLeft) >> 1)) / (dstRight - dstLeft)); } if (dstTop < 0) { pUpdate->SrcTop = ((((-dstTop) * ovlV1->dwV1OriHeight) + ((dstBottom - dstTop) >> 1)) / (dstBottom - dstTop)); } if (dstBottom > scrnHeight) { pUpdate->SrcBottom = ((((scrnHeight - dstTop) * ovlV1->dwV1OriHeight) + ((dstBottom - dstTop) >> 1)) / (dstBottom - dstTop)); } /* Save modified src & original dest rectangle parameters */ if ((pVia->swov.SrcFourCC == FOURCC_YUY2) || (pVia->swov.SrcFourCC == FOURCC_RV15) || (pVia->swov.SrcFourCC == FOURCC_RV16) || (pVia->swov.SrcFourCC == FOURCC_RV32) || (pVia->swov.SrcFourCC == FOURCC_YV12) || (pVia->swov.SrcFourCC == FOURCC_I420) || (pVia->swov.SrcFourCC == FOURCC_XVMC)) { pVia->swov.SWDevice.gdwSWDstLeft = pUpdate->DstLeft + panDX; pVia->swov.SWDevice.gdwSWDstTop = pUpdate->DstTop + panDY; pVia->swov.SWDevice.gdwSWDstWidth = pUpdate->DstRight - pUpdate->DstLeft; pVia->swov.SWDevice.gdwSWDstHeight = pUpdate->DstBottom - pUpdate->DstTop; pVia->swov.SWDevice.gdwSWSrcWidth = ovlV1->dwV1SrcWidth = pUpdate->SrcRight - pUpdate->SrcLeft; pVia->swov.SWDevice.gdwSWSrcHeight = ovlV1->dwV1SrcHeight = pUpdate->SrcBottom - pUpdate->SrcTop; } ovlV1->dwV1SrcLeft = pUpdate->SrcLeft; ovlV1->dwV1SrcRight = pUpdate->SrcRight; ovlV1->dwV1SrcTop = pUpdate->SrcTop; ovlV1->dwV1SrcBot = pUpdate->SrcBottom; /* Figure out actual rDest rectangle */ pUpdate->DstLeft = (dstLeft < 0) ? 0 : dstLeft; pUpdate->DstTop = (dstTop < 0) ? 0 : dstTop; if (pUpdate->DstTop >= scrnHeight) pUpdate->DstTop = scrnHeight - 1; pUpdate->DstRight = (dstRight > scrnWidth) ? scrnWidth : dstRight; pUpdate->DstBottom = (dstBottom > scrnHeight) ? scrnHeight : dstBottom; /* Update the overlay */ if (!Upd_Video(crtc, videoFlag, startAddr, pUpdate, pVia->swov.SWDevice.dwPitch, ovlV1->dwV1OriWidth, ovlV1->dwV1OriHeight, deinterlaceMode, haveColorKey, haveChromaKey, colorKeyLow, colorKeyHigh, chromaKeyLow, chromaKeyHigh)) return FALSE; pVia->swov.SWVideo_ON = FALSE; return TRUE; } /* VIAVidUpdateOverlay */ /* * */ void ViaOverlayHide(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); CARD32 videoFlag = 0; unsigned long proReg = 0; if ((pVia->swov.SrcFourCC == FOURCC_YUY2) || (pVia->swov.SrcFourCC == FOURCC_RV15) || (pVia->swov.SrcFourCC == FOURCC_RV16) || (pVia->swov.SrcFourCC == FOURCC_RV32) || (pVia->swov.SrcFourCC == FOURCC_YV12) || (pVia->swov.SrcFourCC == FOURCC_I420) || (pVia->swov.SrcFourCC == FOURCC_XVMC)) videoFlag = pVia->swov.gdwVideoFlagSW; if (pVia->ChipId == PCI_CHIP_VT3259 && !(videoFlag & VIDEO_1_INUSE)) proReg = PRO_HQV1_OFFSET; ResetVidRegBuffer(pVia); if (pVia->HWDiff.dwHQVDisablePatch) ViaSeqMask(hwp, 0x2E, 0x00, 0x10); SaveVideoRegister(pVia, V_FIFO_CONTROL, V1_FIFO_PRETHRESHOLD12 | V1_FIFO_THRESHOLD8 | V1_FIFO_DEPTH16); SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL, ALPHA_FIFO_THRESHOLD4 | ALPHA_FIFO_DEPTH8 | V3_FIFO_THRESHOLD24 | V3_FIFO_DEPTH32); if (videoFlag & VIDEO_HQV_INUSE) SaveVideoRegister(pVia, HQV_CONTROL + proReg, VIAGETREG(HQV_CONTROL + proReg) & ~HQV_ENABLE); if (videoFlag & VIDEO_1_INUSE) SaveVideoRegister(pVia, V1_CONTROL, VIAGETREG(V1_CONTROL) & ~V1_ENABLE); else SaveVideoRegister(pVia, V3_CONTROL, VIAGETREG(V3_CONTROL) & ~V3_ENABLE); FireVideoCommand(pVia, videoFlag, VIAGETREG(V_COMPOSE_MODE)); FlushVidRegBuffer(pVia); if (pVia->HWDiff.dwHQVDisablePatch) ViaSeqMask(hwp, 0x2E, 0x10, 0x10); pVia->swov.SWVideo_ON = FALSE; pVia->VideoStatus &= ~VIDEO_SWOV_ON; } xf86-video-openchrome-0.6.0/src/via_display.c0000664000175000017500000043416013054665201015745 00000000000000/* * Copyright 2015-2016 Kevin Brace * Copyright 2005-2016 The OpenChrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "via_driver.h" static ViaExpireNumberTable CLE266AExpireNumber[] = { {1280, 768,32,0x03,0x3}, {1280,1024,32,0x03,0x4}, {1280,1024,32,0x04,0x3}, {1600,1200,16,0x03,0x4}, {1600,1200,32,0x04,0x4}, {1024, 768,32,0x03,0xA}, {1400,1050,16,0x03,0x3}, {1400,1050,32,0x03,0x4}, {1400,1050,32,0x04,0x4}, { 800, 600,32,0x03,0xA}, { 0, 0, 0, 0, 0} }; static ViaExpireNumberTable CLE266CExpireNumber[] = { {1280, 768,32,0x03,0x3}, {1280,1024,32,0x03,0x4}, {1280,1024,32,0x04,0x4}, {1600,1200,32,0x03,0x3}, {1600,1200,32,0x04,0x4}, {1024, 768,32,0x03,0xA}, {1400,1050,32,0x03,0x4}, {1400,1050,32,0x04,0x4}, { 800, 600,32,0x03,0xA}, { 0, 0, 0, 0, 0} }; static ViaExpireNumberTable KM400ExpireNumber[]={ {1280,1024,32,0x03,0x3}, {1280,1024,32,0x04,0x9}, {1280, 768,32,0x03,0x3}, {1280, 768,32,0x04,0x9}, {1400,1050,32,0x03,0x3}, {1400,1050,32,0x04,0x9}, {1600,1200,32,0x03,0x4}, {1600,1200,32,0x04,0xA}, { 0, 0, 0, 0, 0} }; static void ViaPrintMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { xf86PrintModeline(pScrn->scrnIndex, mode); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHDisplay: 0x%x\n", mode->CrtcHDisplay); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHBlankStart: 0x%x\n", mode->CrtcHBlankStart); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSyncStart: 0x%x\n", mode->CrtcHSyncStart); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSyncEnd: 0x%x\n", mode->CrtcHSyncEnd); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHBlankEnd: 0x%x\n", mode->CrtcHBlankEnd); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHTotal: 0x%x\n", mode->CrtcHTotal); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSkew: 0x%x\n", mode->CrtcHSkew); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVDisplay: 0x%x\n", mode->CrtcVDisplay); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVBlankStart: 0x%x\n", mode->CrtcVBlankStart); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVSyncStart: 0x%x\n", mode->CrtcVSyncStart); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVSyncEnd: 0x%x\n", mode->CrtcVSyncEnd); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVBlankEnd: 0x%x\n", mode->CrtcVBlankEnd); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVTotal: 0x%x\n", mode->CrtcVTotal); } /* * Sets IGA1 or IGA2 for palette LUT access. * This function should be called before changing the * contents of the palette. */ static void viaSetPaletteLUTAccess(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaSetPaletteLUTAccess.\n")); ViaSeqMask(hwp, 0x1A, displaySource, 0x01); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Palette LUT Access: IGA%d\n", (displaySource & 0x01) + 1); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaSetPaletteLUTAccess.\n")); } /* * Resets IGA1 hardware. */ static void viaIGA1HWReset(ScrnInfoPtr pScrn, CARD8 resetState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA1HWReset.\n")); /* 3X5.17[7] - IGA1 HW Reset * 0: Reset * 1: Normal Operation */ ViaCrtcMask(hwp, 0x17, resetState << 7, 0x80); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 HW Reset: %s\n", (resetState & 0x01) ? "Off" : "On"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA1HWReset.\n")); } /* * Controls IGA1 DPMS State. */ static void viaIGA1DPMSControl(ScrnInfoPtr pScrn, CARD8 dpmsControl) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA1DPMSControl.\n")); /* 3X5.36[5:4] - DPMS Control * 00: On * 01: Stand-by * 10: Suspend * 11: Off */ ViaCrtcMask(hwp, 0x36, dpmsControl << 4, 0x30); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA1DPMSControl.\n")); } /* * Sets IGA1 color depth. */ static void viaIGA1SetColorDepth(ScrnInfoPtr pScrn, CARD8 bitsPerPixel) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA1SetColorDepth.\n")); /* Set the color depth for IGA1. */ switch (bitsPerPixel) { case 8: /* 3C5.15[4] - Hi Color Mode Select * 0: 555 * 1: 565 * 3C5.15[3:2] - Display Color Depth Select * 00: 8bpp * 01: 16bpp * 10: 30bpp * 11: 32bpp */ ViaSeqMask(hwp, 0x15, 0x00, 0x1C); break; case 16: ViaSeqMask(hwp, 0x15, 0x14, 0x1C); break; case 24: case 32: ViaSeqMask(hwp, 0x15, 0x1C, 0x1C); break; default: break; } if ((bitsPerPixel == 8) || (bitsPerPixel == 16) || (bitsPerPixel == 24) || (bitsPerPixel == 32)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 Color Depth: %d bit\n", bitsPerPixel); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unsupported IGA1 Color Depth: %d bit\n", bitsPerPixel); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA1SetColorDepth.\n")); } /* * Sets IGA1 palette LUT resolution. (6-bit or 8-bit) */ static void viaIGA1SetPaletteLUTResolution(ScrnInfoPtr pScrn, CARD8 paletteLUT) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA1SetPaletteLUTResolution.\n")); /* Set the palette LUT resolution for IGA1. */ /* 3C5.15[7] - IGA1 6 / 8 Bit LUT * 0: 6-bit * 1: 8-bit */ ViaSeqMask(hwp, 0x15, paletteLUT << 7, 0x80); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 Palette LUT Resolution: %s bit\n", (paletteLUT & 0x01) ? "8" : "6"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA1SetPaletteLUTResolution.\n")); } /* * Controls IGA1 gamma correction state. */ static void viaIGA1SetGamma(ScrnInfoPtr pScrn, CARD8 gammaCorrection) { VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA1SetGamma.\n")); switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: /* 3C5.16[7] - IGA1 Gamma Correction * 0: Disable * 1: Enable */ ViaSeqMask(hwp, 0x16, gammaCorrection << 7, 0x80); break; default: /* 3X5.33[7] - IGA1 Gamma Correction * 0: Disable * 1: Enable */ ViaCrtcMask(hwp, 0x33, gammaCorrection << 7, 0x80); break; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 Gamma Correction: %s\n", (gammaCorrection & 0x01) ? "On" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA1SetGamma.\n")); } static void viaIGA1InitHI(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); switch(pVia->Chipset) { case VIA_PM800: case VIA_CX700: case VIA_P4M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: VIASETREG(PRIM_HI_TRANSCOLOR, 0x00000000); VIASETREG(PRIM_HI_INVTCOLOR, 0x00FFFFFF); /* Not setting up V327_HI_INVTCOLOR register contributes to * an X Server boot time crash. */ VIASETREG(V327_HI_INVTCOLOR, 0x00FFFFFF); VIASETREG(PRIM_HI_FIFO, 0x0D000D0F); VIASETREG(PRIM_HI_CTRL, 0x36000004); break; default: VIASETREG(HI_TRANSPARENT_COLOR, 0x00000000); VIASETREG(HI_INVTCOLOR, 0x00FFFFFF); VIASETREG(ALPHA_V3_PREFIFO_CONTROL, 0x000E0000); VIASETREG(ALPHA_V3_FIFO_CONTROL, 0xE0F0000); VIASETREG(HI_CONTROL, 0x76000004); break; } } static void viaIGA1SetHIStartingAddress(xf86CrtcPtr crtc) { drmmode_crtc_private_ptr iga = crtc->driver_private; ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); switch(pVia->Chipset) { case VIA_PM800: case VIA_CX700: case VIA_P4M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: VIASETREG(PRIM_HI_FBOFFSET, iga->cursor_bo->offset); break; default: /* Mono Cursor Display Path [bit31]: Primary */ VIASETREG(HI_FBOFFSET, iga->cursor_bo->offset); break; } } /* * This function displays or hides IGA1 hardware icon (HI). */ static void viaIGA1DisplayHI(ScrnInfoPtr pScrn, Bool HI_Status) { VIAPtr pVia = VIAPTR(pScrn); CARD32 temp; switch(pVia->Chipset) { case VIA_PM800: case VIA_CX700: case VIA_P4M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: temp = VIAGETREG(PRIM_HI_CTRL); temp &= 0xFFFFFFFE; temp |= HI_Status ? 0x00000001 : 0x00000000; /* PRIM_HI_CTRL[0] - Hardware Icon (HI) Enable */ VIASETREG(PRIM_HI_CTRL, temp); break; default: temp = VIAGETREG(HI_CONTROL); temp &= 0xFFFFFFFE; temp |= HI_Status ? 0x00000001 : 0x00000000; /* HI_CONTROL[0] - Hardware Icon (HI) Enable */ VIASETREG(HI_CONTROL, temp); break; } } static void viaIGA1SetHIDisplayLocation(ScrnInfoPtr pScrn, int x, unsigned int xoff, int y, unsigned int yoff) { VIAPtr pVia = VIAPTR(pScrn); switch(pVia->Chipset) { case VIA_PM800: case VIA_CX700: case VIA_P4M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: VIASETREG(PRIM_HI_POSSTART, ((x << 16) | (y & 0x07ff))); VIASETREG(PRIM_HI_CENTEROFFSET, ((xoff << 16) | (yoff & 0x07ff))); break; default: VIASETREG(HI_POSSTART, ((x << 16) | (y & 0x07ff))); VIASETREG(HI_CENTEROFFSET, ((xoff << 16) | (yoff & 0x07ff))); break; } } /* * Resets IGA2 hardware. */ static void viaIGA2HWReset(ScrnInfoPtr pScrn, CARD8 resetState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2HWReset.\n")); /* 3X5.6A[6] - Second Display Channel Reset * 0: Reset * 1: Normal Operation */ ViaCrtcMask(hwp, 0x6A, resetState << 6, 0x40); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 HW Reset: %s\n", (resetState & 0x01) ? "Off" : "On"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2HWReset.\n")); } /* * Controls IGA2 display output on or off state. */ static void viaIGA2DisplayOutput(ScrnInfoPtr pScrn, Bool outputState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2DisplayOutput.\n")); /* 3X5.6B[2] - IGA2 Screen Off * 0: Screen on * 1: Screen off */ ViaCrtcMask(hwp, 0x6B, outputState ? 0x00 : 0x04, 0x04); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 Display Output: %s\n", outputState ? "On" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2DisplayOutput.\n")); } /* * Controls IGA2 display channel state. */ void viaIGA2DisplayChannel(ScrnInfoPtr pScrn, Bool channelState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2DisplayChannel.\n")); /* 3X5.6A[7] - Second Display Channel Enable */ ViaCrtcMask(hwp, 0x6A, channelState << 7, 0x80); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 Display Channel: %s\n", channelState ? "On" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2DisplayChannel.\n")); } /* * Sets IGA2 color depth. */ static void viaIGA2SetColorDepth(ScrnInfoPtr pScrn, CARD8 bitsPerPixel) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2SetColorDepth.\n")); /* Set the color depth for IGA2. */ switch (pScrn->bitsPerPixel) { case 8: /* 3X5.67[7:6] - Display Color Depth Select * 00: 8bpp * 01: 16bpp * 10: 30bpp * 11: 32bpp */ ViaCrtcMask(hwp, 0x67, 0x00, 0xC0); break; case 16: ViaCrtcMask(hwp, 0x67, 0x40, 0xC0); break; case 24: case 32: ViaCrtcMask(hwp, 0x67, 0xC0, 0xC0); break; default: break; } if ((bitsPerPixel == 8) || (bitsPerPixel == 16) || (bitsPerPixel == 24) || (bitsPerPixel == 32)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 Color Depth: %d bit\n", bitsPerPixel); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unsupported IGA2 Color Depth: %d bit\n", bitsPerPixel); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2SetColorDepth.\n")); } /* * Sets IGA2 palette LUT resolution. (6-bit or 8-bit) */ static void viaIGA2SetPaletteLUTResolution(ScrnInfoPtr pScrn, CARD8 paletteLUT) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2SetPaletteLUTResolution.\n")); /* Set the palette LUT resolution for IGA2. */ /* 3X5.6A[5] - IGA2 6 / 8 Bit LUT * 0: 6-bit * 1: 8-bit */ ViaCrtcMask(hwp, 0x6A, paletteLUT << 5, 0x20); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 Palette LUT Resolution: %s bit\n", (paletteLUT & 0x01) ? "8" : "6"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2SetPaletteLUTResolution.\n")); } /* * Controls IGA2 gamma correction state. */ static void viaIGA2SetGamma(ScrnInfoPtr pScrn, CARD8 gammaCorrection) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2SetGamma.\n")); /* 3X5.6A[1] - IGA2 Gamma Correction * 0: Disable * 1: Enable */ ViaCrtcMask(hwp, 0x6A, gammaCorrection << 1, 0x02); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 Gamma Correction: %s\n", (gammaCorrection & 0x01) ? "On" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2SetGamma.\n")); } static void viaIGA2InitHI(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); switch(pVia->Chipset) { case VIA_PM800: case VIA_CX700: case VIA_P4M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: VIASETREG(HI_TRANSPARENT_COLOR, 0x00000000); VIASETREG(HI_INVTCOLOR, 0x00FFFFFF); VIASETREG(ALPHA_V3_PREFIFO_CONTROL, 0x000E0000); VIASETREG(ALPHA_V3_FIFO_CONTROL, 0x0E0F0000); VIASETREG(HI_CONTROL, 0xB6000004); break; default: VIASETREG(HI_TRANSPARENT_COLOR, 0x00000000); VIASETREG(HI_INVTCOLOR, 0X00FFFFFF); VIASETREG(ALPHA_V3_PREFIFO_CONTROL, 0x000E0000); VIASETREG(ALPHA_V3_FIFO_CONTROL, 0xE0F0000); VIASETREG(HI_CONTROL, 0xF6000004); break; } } static void viaIGA2SetHIStartingAddress(xf86CrtcPtr crtc) { drmmode_crtc_private_ptr iga = crtc->driver_private; ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); VIASETREG(HI_FBOFFSET, iga->cursor_bo->offset); } /* * This function displays or hides IGA2 hardware icon (HI). */ static void viaIGA2DisplayHI(ScrnInfoPtr pScrn, Bool HI_Status) { VIAPtr pVia = VIAPTR(pScrn); CARD32 temp; switch(pVia->Chipset) { case VIA_PM800: case VIA_CX700: case VIA_P4M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: temp = VIAGETREG(HI_CONTROL); temp &= 0xFFFFFFFE; temp |= HI_Status ? 0x00000001 : 0x00000000; /* HI_CONTROL[0] - Hardware Icon (HI) Enable */ VIASETREG(HI_CONTROL, temp); break; default: temp = VIAGETREG(HI_CONTROL); temp &= 0xFFFFFFFE; temp |= HI_Status ? 0x00000001 : 0x00000000; /* HI_CONTROL[0] - Hardware Icon (HI) Enable */ VIASETREG(HI_CONTROL, temp); break; } } static void viaIGA2SetHIDisplayLocation(ScrnInfoPtr pScrn, int x, unsigned int xoff, int y, unsigned int yoff) { VIAPtr pVia = VIAPTR(pScrn); switch(pVia->Chipset) { case VIA_PM800: case VIA_CX700: case VIA_P4M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: VIASETREG(HI_POSSTART, ((x << 16) | (y & 0x07FF))); VIASETREG(HI_CENTEROFFSET, ((xoff << 16) | (yoff & 0x07FF))); break; default: VIASETREG(HI_POSSTART, ((x << 16) | (y & 0x07FF))); VIASETREG(HI_CENTEROFFSET, ((xoff << 16) | (yoff & 0x07FF))); break; } } /* * Initial settings for displays. */ void viaDisplayInit(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDisplayInit.\n")); ViaCrtcMask(hwp, 0x6A, 0x00, 0x3D); hwp->writeCrtc(hwp, 0x6B, 0x00); hwp->writeCrtc(hwp, 0x6C, 0x00); hwp->writeCrtc(hwp, 0x79, 0x00); /* (IGA1 Timing Plus 2, added in VT3259 A3 or later) */ if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) ViaCrtcMask(hwp, 0x47, 0x00, 0xC8); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDisplayInit.\n")); } /* * Sets the primary or secondary display stream on internal TMDS. */ void ViaDisplaySetStreamOnDFP(ScrnInfoPtr pScrn, Bool primary) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDisplaySetStreamOnDFP\n")); if (primary) ViaCrtcMask(hwp, 0x99, 0x00, 0x10); else ViaCrtcMask(hwp, 0x99, 0x10, 0x10); } void VIALoadRgbLut(ScrnInfoPtr pScrn, int start, int numColors, LOCO *colors) { vgaHWPtr hwp = VGAHWPTR(pScrn); int i, j; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIALoadRgbLut\n")); hwp->enablePalette(hwp); hwp->writeDacMask(hwp, 0xFF); /* We need the same palette contents for both 16 and 24 bits, but X doesn't * play: X's colormap handling is hopelessly intertwined with almost every * X subsystem. So we just space out RGB values over the 256*3. */ switch (pScrn->bitsPerPixel) { case 15: for (i = start; i < numColors; i++) { hwp->writeDacWriteAddr(hwp, i * 4); for (j = 0; j < 4; j++) { hwp->writeDacData(hwp, colors[i / 2].red); hwp->writeDacData(hwp, colors[i].green); hwp->writeDacData(hwp, colors[i / 2].blue); } } break; case 8: case 16: case 24: case 32: for (i = start; i < numColors; i++) { hwp->writeDacWriteAddr(hwp, i); hwp->writeDacData(hwp, colors[i].red); hwp->writeDacData(hwp, colors[i].green); hwp->writeDacData(hwp, colors[i].blue); } break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unsupported bitdepth: %d\n", pScrn->bitsPerPixel); break; } hwp->disablePalette(hwp); } void ViaGammaDisable(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: ViaSeqMask(hwp, 0x16, 0x00, 0x80); break; default: ViaCrtcMask(hwp, 0x33, 0x00, 0x80); break; } /* Disable gamma on secondary */ /* This is needed or the hardware will lockup */ ViaSeqMask(hwp, 0x1A, 0x00, 0x01); ViaCrtcMask(hwp, 0x6A, 0x00, 0x02); switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: case VIA_K8M800: case VIA_PM800: break; default: ViaCrtcMask(hwp, 0x6A, 0x00, 0x20); break; } } /* * Initialize common IGA (Integrated Graphics Accelerator) registers. */ void viaIGAInitCommon(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 i; #ifdef HAVE_DEBUG CARD8 temp; #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGAInitCommon.\n")); temp = hwp->readEnable(hwp); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Enable Register: 0x%02X\n", temp)); hwp->writeEnable(hwp, temp | 0x01); temp = hwp->readMiscOut(hwp); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Misc. Register: 0x%02X\n", temp)); hwp->writeMiscOut(hwp, temp | 0x22); temp = hwp->readEnable(hwp); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Enable Register: 0x%02X\n", temp)); temp = hwp->readMiscOut(hwp); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Misc. Register: 0x%02X\n", temp)); /* Sequencer Registers */ ViaSeqMask(hwp, 0x00, 0x03, 0x03); ViaSeqMask(hwp, 0x01, 0x01, 0x35); ViaSeqMask(hwp, 0x02, 0x0F, 0x0F); ViaSeqMask(hwp, 0x03, 0x00, 0x3F); ViaSeqMask(hwp, 0x04, 0x0E, 0x0E); /* Graphics Registers */ hwp->writeGr(hwp, 0x00, 0x00); hwp->writeGr(hwp, 0x01, 0x00); hwp->writeGr(hwp, 0x02, 0x00); hwp->writeGr(hwp, 0x03, 0x00); hwp->writeGr(hwp, 0x04, 0x00); hwp->writeGr(hwp, 0x05, 0x40); hwp->writeGr(hwp, 0x06, 0x05); hwp->writeGr(hwp, 0x07, 0x0F); hwp->writeGr(hwp, 0x08, 0xFF); /* Attribute Registers */ for (i = 0; i <= 15; i++) { hwp->writeAttr(hwp, i, i); } hwp->writeAttr(hwp, 0x10, 0x41); hwp->writeAttr(hwp, 0x11, 0xFF); hwp->writeAttr(hwp, 0x12, 0x0F); hwp->writeAttr(hwp, 0x13, 0x00); hwp->writeAttr(hwp, 0x14, 0x00); /* Unlock VIA Technologies extended VGA registers. */ /* 3C5.10[0] - Unlock Accessing of I/O Space * 0: Disable * 1: Enable */ ViaSeqMask(hwp, 0x10, 0x01, 0x01); switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: /* 3X5.47[7] - IGA1 Timing Plus 2 VCK * 3X5.47[6] - IGA1 Timing Plus 4 VCK * 3X5.47[5] - Peep at the PCI-bus * 0: Disable * 1: Enable * 3X5.47[4] - Reserved * 3X5.47[3] - IGA1 Timing Plus 6 VCK * 3X5.47[2] - DACOFF Backdoor Register * 3X5.47[1] - LCD Simultaneous Mode Backdoor Register for * 8/9 Dot Clocks * 3X5.47[0] - LCD Simultaneous Mode Backdoor Register for * Clock Select and CRTC Register Protect */ ViaCrtcMask(hwp, 0x47, 0x00, 0x01); break; case VIA_VX855: case VIA_VX900: /* 3X5.47[7] - IGA1 Timing Plus 2 VCK * 3X5.47[6] - IGA1 Timing Plus 4 VCK * 3X5.47[5] - Peep at the PCI-bus * 0: Disable * 1: Enable * 3X5.47[4] - CRT Timing Register Protect * 3X5.47[3] - IGA1 Timing Plus 6 VCK * 3X5.47[2] - DACOFF Backdoor Register * 3X5.47[1] - LCD Simultaneous Mode Backdoor Register for * 8/9 Dot Clocks * 3X5.47[0] - LCD Simultaneous Mode Backdoor Register for * Clock Select */ ViaCrtcMask(hwp, 0x47, 0x00, 0x10); break; default: break; } #ifdef HAVE_DEBUG temp = hwp->readSeq(hwp, 0x15); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR15: 0x%02X\n", temp)); temp = hwp->readSeq(hwp, 0x19); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR19: 0x%02X\n", temp)); temp = hwp->readSeq(hwp, 0x1A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR1A: 0x%02X\n", temp)); temp = hwp->readSeq(hwp, 0x1E); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR1E: 0x%02X\n", temp)); temp = hwp->readSeq(hwp, 0x2D); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR2D: 0x%02X\n", temp)); temp = hwp->readSeq(hwp, 0x2E); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR2E: 0x%02X\n", temp)); temp = hwp->readSeq(hwp, 0x3F); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR3F: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x36); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR36: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x3B); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR3B: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x3C); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR3C: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x3D); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR3D: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x3E); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR3E: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x3F); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR3F: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x47); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR47: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x6B); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR6B: 0x%02X\n", temp)); if (pVia->Chipset == VIA_CLE266) { temp = hwp->readCrtc(hwp, 0x6C); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR6C: 0x%02X\n", temp)); } #endif /* VIA Technologies Chrome Extended Graphics Registers */ ViaGrMask(hwp, 0x20, 0, 0xFF); ViaGrMask(hwp, 0x21, 0, 0xFF); ViaGrMask(hwp, 0x22, 0, 0xFF); /* Be careful with 3C5.15[5] - Wrap Around Disable. * It must be set to 1 for correct operation. */ /* 3C5.15[7] - 8/6 Bits LUT * 0: 6-bit * 1: 8-bit * 3C5.15[6] - Text Column Control * 0: 80 column * 1: 132 column * 3C5.15[5] - Wrap Around Disable * 0: Disable (For Mode 0-13) * 1: Enable * 3C5.15[4] - Hi Color Mode Select * 0: 555 * 1: 565 * 3C5.15[3:2] - Display Color Depth Select * 00: 8bpp * 01: 16bpp * 10: 30bpp * 11: 32bpp * 3C5.15[1] - Extended Display Mode Enable * 0: Disable * 1: Enable * 3C5.15[0] - Reserved */ ViaSeqMask(hwp, 0x15, 0x22, 0x62); /* 3C5.19[7] - Reserved * 3C5.19[6] - MIU/AGP Interface Clock Control * 0: Clocks always on * 1: Enable clock gating * 3C5.19[5] - P-Arbiter Interface Clock Control * 0: Clocks always on * 1: Enable clock gating * 3C5.19[4] - AGP Interface Clock Control * 0: Clocks always on * 1: Enable clock gating * 3C5.19[3] - Typical Arbiter Interface Clock Control * 0: Clocks always on * 1: Enable clock gating * 3C5.19[2] - MC Interface Clock Control * 0: Clocks always on * 1: Enable clock gating * 3C5.19[1] - Display Interface Clock Control * 0: Clocks always on * 1: Enable clock gating * 3C5.19[0] - CPU Interface Clock Control * 0: Clocks always on * 1: Enable clock gating */ ViaSeqMask(hwp, 0x19, 0x7F, 0x7F); /* 3C5.1A[7] - Read Cache Enable * 0: Disable * 1: Enable * 3C5.1A[6] - Software Reset * 0: Default value * 1: Reset * 3C5.1A[5] - DVI Sense * 0: No connect * 1: Connected * 3C5.1A[4] - Second DVI Sense * 0: No connect * 1: Connected * 3C5.1A[3] - Extended Mode Memory Access Enable * 0: Disable * 1: Enable * 3C5.1A[2] - PCI Burst Write Wait State Select * 0: 0 Wait state * 1: 1 Wait state * 3C5.1A[1] - Reserved * 3C5.1A[0] - LUT Shadow Access * 0: 3C6/3C7/3C8/3C9 addresses map to * Primary Display’s LUT * 1: 3C6/3C7/3C8/3C9 addresses map to * Secondary Display’s LUT */ ViaSeqMask(hwp, 0x1A, 0x88, 0xC8); /* 3C5.1E[3] - Spread Spectrum On/Off * 0: Off * 1: On * 3C5.1E[1] - Replace ECK by MCK * For BIST purpose. * 3C5.1E[0] - On/Off ROC ECK * 0: Off * 1: On */ ViaSeqMask(hwp, 0x1E, 0x01, 0x09); /* 3C5.2D[7:6] - E3_ECK_N Selection * 00: E3_ECK_N * 01: E3_ECK * 10: delayed E3_ECK_N * 11: delayed E3_ECK * 3C5.2D[5:4] - VCK (Primary Display Clock) PLL Power Control * 0x: PLL power-off * 10: PLL always on * 11: PLL on/off according to the PMS * 3C5.2D[3:2] - LCK (Secondary Display Clock) PLL Power Control * 0x: PLL power-off * 10: PLL always on * 11: PLL on/off according to the PMS * 3C5.2D[1:0] - ECK (Engine Clock) PLL Power Control * 0x: PLL power-off * 10: PLL always on * 11: PLL on/off according to the PMS */ ViaSeqMask(hwp, 0x2D, 0x03, 0xC3); /* In Wyse X class mobile thin client, it was observed that setting * SR2E[3:2] (3C5.2E[3:2]; PCI Master / DMA) to 0b11 (clock on / off * according to the engine IDLE status) causes an X.Org Server boot * failure. Setting this register to 0b10 (clock always on) corrects * the problem. */ /* 3C5.2E[7:6] - Capturer (Gated Clock ) * 0x: Clock off * 10: Clock always on * 11: Clock on/off according to the engine IDLE status * 3C5.2E[5:4] - Video Processor (Gated Clock ) * 0x: Clock off * 10: Clock always on * 11: Clock on/off according to the engine IDLE status * 3C5.2E[3:2] - PCI Master/DMA (Gated Clock ) * 0x: Clock off * 10: Clock always on * 11: Clock on/off according to the engine IDLE status * 3C5.2E[1:0] - Video Playback Engine (V3/V4 Gated Clock ) * 0x: Clock off * 10: Clock always on * 11: Clock on/off according to the engine IDLE status */ ViaSeqMask(hwp, 0x2E, 0xFB, 0xFF); /* 3C5.3F[7:6] - CR Clock Control (Gated Clock ) * 0x: Clock off * 10: Clock always on * 11: Clock on/off according to the engine IDLE status * 3C5.3F[5:4] - 3D Clock Control (Gated Clock ) * 0x: Clock off * 10: Clock always on * 11: Clock on/off according to the engine IDLE status * 3C5.3F[3:2] - 2D Clock Control (Gated Clock ) * 0x: Clock off * 10: Clock always on * 11: Clock on/off according to the engine IDLE status * 3C5.3F[1:0] - Video Clock Control (Gated Clock ) * 0x: Clock off * 10: Clock always on * 11: Clock on/off according to each engine IDLE status */ ViaSeqMask(hwp, 0x3F, 0xFF, 0xFF); /* 3X5.36[7] - DPMS VSYNC Output * 3X5.36[6] - DPMS HSYNC Output * 3X5.36[5:4] - DPMS Control * 00: On * 01: Stand-by * 10: Suspend * 11: Off * When the DPMS state is off, both HSYNC and VSYNC * are grounded, saving monitor power consumption. * 3X5.36[3] - Horizontal Total Bit [8] * 3X5.36[2:1] - Reserved * 3X5.36[0] - PCI Power Management Control * 0: Disable * 1: Enable */ ViaCrtcMask(hwp, 0x36, 0x01, 0x01); /* 3X5.3B through 3X5.3F are scratch pad registers. */ ViaCrtcMask(hwp, 0x3B, pVia->originalCR3B, 0xFF); ViaCrtcMask(hwp, 0x3C, pVia->originalCR3C, 0xFF); ViaCrtcMask(hwp, 0x3D, pVia->originalCR3D, 0xFF); ViaCrtcMask(hwp, 0x3E, pVia->originalCR3E, 0xFF); ViaCrtcMask(hwp, 0x3F, pVia->originalCR3F, 0xFF); /* 3X5.47[5] - Peep at the PCI-bus * 0: Disable * 1: Enable * 3X5.47[1] - LCD Simultaneous Mode Backdoor Register for * 8/9 Dot Clocks * 3X5.47[0] - LCD Simultaneous Mode Backdoor Register for * Clock Select and CRTC Register Protect */ ViaCrtcMask(hwp, 0x47, 0x00, 0x23); /* 3X5.6B[3] - Simultaneous Display Enable * 0: Disable * 1: Enable */ ViaCrtcMask(hwp, 0x6B, 0x00, 0x08); /* CLE266 only. */ if (pVia->Chipset == VIA_CLE266) { /* The following register fields are for CLE266 only. */ /* 3X5.6C - Digital Interface Port 0 (DIP0) Control * 3X5.6C[7] - DIP0 Source * 0: IGA1 * 1: IGA2 * 3X5.6C[4:2] - Appears to be related to DIP0 signal polarity * control. Used by CLE266A2 to workaround a bug when * it is utilizing an external TV encoder. * 3X5.6C[1] - Appears to be utilized when CLE266 is utilizing an * external TV encoder. * 3X5.6C[0] - Appears to be a bit to control internal / external * clock source or whether or not the VCK (IGA1 clock * source) comes from VCK PLL or from an external * source. This bit should be set to 1 when TV encoder * is in use. */ ViaCrtcMask(hwp, 0x6C, 0x00, 0x01); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGAInitCommon.\n")); } /* * Initialize IGA1 (Integrated Graphics Accelerator) registers. */ void viaIGA1Init(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); #ifdef HAVE_DEBUG CARD8 temp; #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA1Init.\n")); #ifdef HAVE_DEBUG temp = hwp->readSeq(hwp, 0x1B); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR1B: 0x%02X\n", temp)); temp = hwp->readSeq(hwp, 0x2D); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR2D: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x32); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR32: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x33); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR33: 0x%02X\n", temp)); /* For UniChrome Pro and Chrome9. */ if ((pVia->Chipset != VIA_CLE266) && (pVia->Chipset != VIA_KM400)) { temp = hwp->readCrtc(hwp, 0x47); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR47: 0x%02X\n", temp)); } temp = hwp->readCrtc(hwp, 0x6B); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR6B: 0x%02X\n", temp)); /* For UniChrome Pro and Chrome9. */ if ((pVia->Chipset != VIA_CLE266) && (pVia->Chipset != VIA_KM400)) { temp = hwp->readCrtc(hwp, 0x6C); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR6C: 0x%02X\n", temp)); } #endif /* 3C5.1B[7:6] - Secondary Display Engine (Gated Clock ) * 0x: Clock always off * 10: Clock always on * 11: Clock on/off according to the * Power Management Status (PMS) * 3C5.1B[5:4] - Primary Display Engine (Gated Clock ) * 0x: Clock always off * 10: Clock always on * 11: Clock on/off according to the PMS * 3C5.1B[3:1] - Reserved * 3C5.1B[0] - Primary Display’s LUT On/Off * 0: On * 1: Off */ ViaSeqMask(hwp, 0x1B, 0x30, 0x31); /* 3C5.2D[7:6] - E3_ECK_N Selection * 00: E3_ECK_N * 01: E3_ECK * 10: delayed E3_ECK_N * 11: delayed E3_ECK * 3C5.2D[5:4] - VCK (Primary Display Clock) PLL Power Control * 0x: PLL power-off * 10: PLL always on * 11: PLL on/off according to the PMS * 3C5.2D[3:2] - LCK (Secondary Display Clock) PLL Power Control * 0x: PLL power-off * 10: PLL always on * 11: PLL on/off according to the PMS * 3C5.2D[1:0] - ECK (Engine Clock) PLL Power Control * 0x: PLL power-off * 10: PLL always on * 11: PLL on/off according to the PMS */ ViaSeqMask(hwp, 0x2D, 0x30, 0x30); /* 3X5.32[7:5] - HSYNC Delay Number by VCLK * 000: No delay * 001: Delay + 4 VCKs * 010: Delay + 8 VCKs * 011: Delay + 12 VCKs * 100: Delay + 16 VCKs * 101: Delay + 20 VCKs * Others: Undefined * 3X5.32[4] - Reserved * 3X5.32[3] - CRT SYNC Driving Selection * 0: Low * 1: High * 3X5.32[2] - Display End Blanking Enable * 0: Disable * 1: Enable * 3X5.32[1] - Digital Video Port (DVP) Gamma Correction * If the gamma correction of primary display is * turned on, the gamma correction in DVP can be * enabled / disabled by this bit. * 0: Disable * 1: Enable * 3X5.32[0] - Real-Time Flipping * 0: Flip by the frame * 1: Flip by each scan line */ ViaCrtcMask(hwp, 0x32, 0x04, 0xEF); /* Keep interlace mode off. * No shift for HSYNC.*/ /* 3X5.33[7] - Primary Display Gamma Correction * 0: Disable * 1: Enable * 3X5.33[6] - Primary Display Interlace Mode * 0: Disable * 1: Enable * 3X5.33[5] - Horizontal Blanking End Bit [6] * 3X5.33[4] - Horizontal Synchronization Start Bit [8] * 3X5.33[3] - Prefetch Mode * 0: Disable * 1: Enable * 3X5.33[2:0] - The Value will Shift the HSYNC to be Early than Planned * 000: Shift to early time by 3 characters * (VGA mode suggested value; default value) * 001: Shift to early time by 4 characters * 010: Shift to early time by 5 characters * 011: Shift to early time by 6 characters * 100: Shift to early time by 7 characters * 101: Shift to early time by 0 character * (Non-VGA mode suggested value) * 110: Shift to early time by 1 character * 111: Shift to early time by 2 characters */ ViaCrtcMask(hwp, 0x33, 0x05, 0xCF); /* For UniChrome Pro and Chrome9. */ if ((pVia->Chipset != VIA_CLE266) && (pVia->Chipset != VIA_KM400)) { /* 3X5.47[7] - IGA1 Timing Plus 2 VCK * 3X5.47[6] - IGA1 Timing Plus 4 VCK * 3X5.47[5] - Peep at the PCI-bus * 0: Disable * 1: Enable * 3X5.47[4] - Reserved * 3X5.47[3] - IGA1 Timing Plus 6 VCK * 3X5.47[2] - DACOFF Backdoor Register * 3X5.47[1] - LCD Simultaneous Mode Backdoor Register for * 8/9 Dot Clocks * 3X5.47[0] - LCD Simultaneous Mode Backdoor Register for * Clock Select and CRTC Register Protect */ ViaCrtcMask(hwp, 0x47, 0x00, 0xCC); } /* TV out uses division by 2 mode. * Other devices like analog (VGA), DVI, flat panel, etc., * use normal mode. */ /* 3X5.6B[7:6] - First Display Channel Clock Mode Selection * 0x: Normal * 1x: Division by 2 */ ViaCrtcMask(hwp, 0x6B, 0x00, 0xC0); /* For UniChrome Pro and Chrome9. */ if ((pVia->Chipset != VIA_CLE266) && (pVia->Chipset != VIA_KM400)) { /* The following register fields are for UniChrome Pro and Chrome9. */ /* 3X5.6C[7:5] - VCK PLL Reference Clock Source Selection * 000: From XI pin * 001: From TVXI * 01x: From TVPLL * 100: DVP0TVCLKR * 101: DVP1TVCLKR * 110: CAP0 Clock * 111: CAP1 Clock * 3X5.6C[4] - VCK Source Selection * 0: VCK PLL output clock * 1: VCK PLL reference clock */ ViaCrtcMask(hwp, 0x6C, 0x00, 0xF0); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA1Init.\n")); } void viaIGA1SetFBStartingAddress(xf86CrtcPtr crtc, int x, int y) { ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; CARD32 Base; CARD8 cr0c, cr0d, cr34, cr48; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA1SetFBStartingAddress.\n")); Base = (y * pScrn->displayWidth + x) * (pScrn->bitsPerPixel / 8); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Base Address: 0x%lx\n", Base)); Base = (Base + drmmode->front_bo->offset) >> 1; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DRI Base Address: 0x%lx\n", Base); hwp->writeCrtc(hwp, 0x0D, Base & 0xFF); hwp->writeCrtc(hwp, 0x0C, (Base & 0xFF00) >> 8); if (!(pVia->Chipset == VIA_CLE266 && CLE266_REV_IS_AX(pVia->ChipRev))) { ViaCrtcMask(hwp, 0x48, Base >> 24, 0x1F); } /* CR34 are fire bits. Must be written after CR0C, CR0D, and CR48. */ hwp->writeCrtc(hwp, 0x34, (Base & 0xFF0000) >> 16); #ifdef HAVE_DEBUG cr0d = hwp->readCrtc(hwp, 0x0D); cr0c = hwp->readCrtc(hwp, 0x0C); cr34 = hwp->readCrtc(hwp, 0x34); if (!(pVia->Chipset == VIA_CLE266 && CLE266_REV_IS_AX(pVia->ChipRev))) { cr48 = hwp->readCrtc(hwp, 0x48); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR0D: 0x%02X\n", cr0d)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR0C: 0x%02X\n", cr0c)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR34: 0x%02X\n", cr34)); if (!(pVia->Chipset == VIA_CLE266 && CLE266_REV_IS_AX(pVia->ChipRev))) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR48: 0x%02X\n", cr48)); } #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA1SetFBStartingAddress.\n")); } void viaIGA1SetDisplayRegister(ScrnInfoPtr pScrn, DisplayModePtr mode) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD16 temp; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA1SetDisplayRegister.\n")); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 Requested Screen Mode: %s\n", mode->name); if (mode->Flags & V_CLKDIV2) { ViaSeqMask(hwp, 0x01, 0x08, 0x08); } else { ViaSeqMask(hwp, 0x01, 0x00, 0x08); } ViaCrtcMask(hwp, 0x03, 0x80, 0x80); /* enable vertical retrace access */ /* Setting maximum scan line to 0. */ /* 3X5.09[4:0] - Maximum Scan Line */ ViaCrtcMask(hwp, 0x09, 0x00, 0x1F); ViaCrtcMask(hwp, 0x11, 0x00, 0x80); /* modify starting address */ /* 3X5.14[6] - Double Word Mode * Allows normal addressing or double-word addressing. * 0: Normal word addressing * 1: Double word addressing * 3X5.14[4:0] - Underline Location */ ViaCrtcMask(hwp, 0x14, 0x00, 0x5F); /* We are not using the split screen feature so line compare register * should be set to 0x7FF. */ temp = 0x7FF; /* 3X5.18[7:0] - Line Compare Bits [7:0] */ hwp->writeCrtc(hwp, 0x18, temp & 0xFF); /* 3X5.07[4] - Line Compare Bit [8] */ ViaCrtcMask(hwp, 0x07, temp >> 4, 0x10); /* 3X5.09[6] - Line Compare Bit [9] */ ViaCrtcMask(hwp, 0x09, temp >> 3, 0x40); /* 3X5.35[4] - Line Compare Bit [10] */ ViaCrtcMask(hwp, 0x35, temp >> 6, 0x10); /* 3X5.32[7:5] - HSYNC Delay Number by VCLK * 000: No delay * 001: Delay + 4 VCKs * 010: Delay + 8 VCKs * 011: Delay + 12 VCKs * 100: Delay + 16 VCKs * 101: Delay + 20 VCKs * Others: Undefined * 3X5.32[4] - Reserved * 3X5.32[3] - CRT SYNC Driving Selection * 0: Low * 1: High * 3X5.32[2] - Display End Blanking Enable * 0: Disable * 1: Enable * 3X5.32[1] - Digital Video Port (DVP) Gamma Correction * If the gamma correction of primary display is * turned on, the gamma correction in DVP can be * enabled / disabled by this bit. * 0: Disable * 1: Enable * 3X5.32[0] - Real-Time Flipping * 0: Flip by the frame * 1: Flip by each scan line */ ViaCrtcMask(hwp, 0x32, 0x04, 0xEC); /* Keep interlace mode off. * No shift for HSYNC.*/ /* 3X5.33[7] - Primary Display Gamma Correction * 0: Disable * 1: Enable * 3X5.33[6] - Primary Display Interlace Mode * 0: Disable * 1: Enable * 3X5.33[5] - Horizontal Blanking End Bit [6] * 3X5.33[4] - Horizontal Synchronization Start Bit [8] * 3X5.33[3] - Prefetch Mode * 0: Disable * 1: Enable * 3X5.33[2:0] - The Value will Shift the HSYNC to be Early than Planned * 000: Shift to early time by 3 characters * (VGA mode suggested value; default value) * 001: Shift to early time by 4 characters * 010: Shift to early time by 5 characters * 011: Shift to early time by 6 characters * 100: Shift to early time by 7 characters * 101: Shift to early time by 0 character * (Non-VGA mode suggested value) * 110: Shift to early time by 1 character * 111: Shift to early time by 2 characters */ ViaCrtcMask(hwp, 0x33, 0x05, 0x4F); /* UniChrome Pro or later */ if ((pVia->Chipset != VIA_CLE266) && (pVia->Chipset != VIA_KM400)) { /* Set IGA1 to linear mode. */ /* 3X5.43[2] - IGA1 Address Mode Selection * 0: Linear * 1: Tile */ ViaCrtcMask(hwp, 0x43, 0x00, 0x04); } /* Set IGA1 horizontal total.*/ /* Due to IGA1 horizontal total being only 9 bits wide, * the adjusted horizontal total needs to be shifted by * 3 bit positions to the right. * In addition to that, this particular register requires the * value to be 5 less than the actual value being written. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcHTotal: %d\n", mode->CrtcHTotal)); temp = (mode->CrtcHTotal >> 3) - 5; /* 3X5.00[7:0] - Horizontal Total Bits [7:0] */ hwp->writeCrtc(hwp, 0x00, temp & 0xFF); /* 3X5.36[3] - Horizontal Total Bit [8] */ ViaCrtcMask(hwp, 0x36, temp >> 5, 0x08); /* Set IGA1 horizontal display end. */ /* Due to IGA1 horizontal display end being only 8 bits * or 9 bits (for VX900 chipset) wide, the adjusted horizontal * display end needs to be shifted by 3 bit positions to the right. * In addition to that, this particular register requires the * value to be 1 less than the actual value being written. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcHDisplay: %d\n", mode->CrtcHDisplay)); temp = (mode->CrtcHDisplay >> 3) - 1; /* 3X5.01[7:0] - Horizontal Display End Bits [7:0] */ hwp->writeCrtc(hwp, 0x01, temp & 0xFF); if (pVia->Chipset == VIA_VX900) { /* 3X5.45[1] - Horizontal Display End Bit [8] */ ViaCrtcMask(hwp, 0x45, temp >> 7, 0x02); } /* Set IGA1 horizontal blank start. */ /* Due to IGA1 horizontal blank start being only 8 bits or * 9 bits (for VX900 chipset) wide, the adjusted horizontal * blank start needs to be shifted by 3 bit positions to the * right. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcHBlankStart: %d\n", mode->CrtcHBlankStart)); temp = mode->CrtcHBlankStart >> 3; /* 3X5.02[7:0] - Horizontal Blanking Start Bits [7:0] */ hwp->writeCrtc(hwp, 0x02, temp & 0xFF); if (pVia->Chipset == VIA_VX900) { /* 3X5.45[2] - Horizontal Blanking Start Bit [8] */ ViaCrtcMask(hwp, 0x45, temp >> 6, 0x04); } /* Set IGA1 horizontal blank end. */ /* After shifting horizontal blank end by 3 bit positions to the * right, the 7 least significant bits are actually used. * In addition to that, this particular register requires the * value to be 1 less than the actual value being written. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcHBlankEnd: %d\n", mode->CrtcHBlankEnd)); temp = (mode->CrtcHBlankEnd >> 3) - 1; /* 3X5.03[4:0] - Horizontal Blanking End Bits [4:0] */ ViaCrtcMask(hwp, 0x03, temp, 0x1F); /* 3X5.05[7] - Horizontal Blanking End Bit [5] */ ViaCrtcMask(hwp, 0x05, temp << 2, 0x80); /* 3X5.33[5] - Horizontal Blanking End Bit [6] */ ViaCrtcMask(hwp, 0x33, temp >> 1, 0x20); /* Set IGA1 horizontal synchronization start. */ /* Due to IGA1 horizontal synchronization start being only 9 bits wide, * the adjusted horizontal synchronization start needs to be shifted by * 3 bit positions to the right. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcHSyncStart: %d\n", mode->CrtcHSyncStart)); temp = mode->CrtcHSyncStart >> 3; /* 3X5.04[7:0] - Horizontal Retrace Start Bits [7:0] */ hwp->writeCrtc(hwp, 0x04, temp & 0xFF); /* 3X5.33[4] - Horizontal Retrace Start Bit [8] */ ViaCrtcMask(hwp, 0x33, temp >> 4, 0x10); /* Set IGA1 horizontal synchronization end. */ /* After shifting horizontal synchronization end by 3 bit positions * to the right, the 5 least significant bits are actually used. * In addition to that, this particular register requires the * value to be 1 less than the actual value being written. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcHSyncEnd: %d\n", mode->CrtcHSyncEnd)); temp = (mode->CrtcHSyncEnd >> 3) - 1; /* 3X5.05[4:0] - Horizontal Retrace End Bits [4:0] */ ViaCrtcMask(hwp, 0x05, temp, 0x1F); /* Set IGA1 vertical total. */ /* Vertical total requires the value to be 2 less * than the actual value being written. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcVTotal: %d\n", mode->CrtcVTotal)); temp = mode->CrtcVTotal - 2; /* 3X5.06[7:0] - Vertical Total Period Bits [7:0] */ hwp->writeCrtc(hwp, 0x06, temp & 0xFF); /* 3X5.07[0] - Vertical Total Period Bit [8] */ ViaCrtcMask(hwp, 0x07, temp >> 8, 0x01); /* 3X5.07[5] - Vertical Total Period Bit [9] */ ViaCrtcMask(hwp, 0x07, temp >> 4, 0x20); /* 3X5.35[0] - Vertical Total Period Bit [10] */ ViaCrtcMask(hwp, 0x35, temp >> 10, 0x01); /* Set IGA1 vertical display end. */ /* Vertical display end requires the value to be 1 less * than the actual value being written. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcVDisplay: %d\n", mode->CrtcVDisplay)); temp = mode->CrtcVDisplay - 1; /* 3X5.12[7:0] - Vertical Active Data Period Bits [7:0] */ hwp->writeCrtc(hwp, 0x12, temp & 0xFF); /* 3X5.07[1] - Vertical Active Data Period Bit [8] */ ViaCrtcMask(hwp, 0x07, temp >> 7, 0x02); /* 3X5.07[6] - Vertical Active Data Period Bit [9] */ ViaCrtcMask(hwp, 0x07, temp >> 3, 0x40); /* 3X5.35[2] - Vertical Active Data Period Bit [10] */ ViaCrtcMask(hwp, 0x35, temp >> 8, 0x04); /* Set IGA1 vertical blank start. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcVBlankStart: %d\n", mode->CrtcVBlankStart)); temp = mode->CrtcVBlankStart; /* 3X5.15[7:0] - Vertical Blanking Start Bits [7:0] */ hwp->writeCrtc(hwp, 0x15, temp & 0xFF); /* 3X5.07[3] - Vertical Blanking Start Bit [8] */ ViaCrtcMask(hwp, 0x07, temp >> 5, 0x08); /* 3X5.09[5] - Vertical Blanking Start Bit [9] */ ViaCrtcMask(hwp, 0x09, temp >> 4, 0x20); /* 3X5.35[3] - Vertical Blanking Start Bit [10] */ ViaCrtcMask(hwp, 0x35, temp >> 7, 0x08); /* Set IGA1 vertical blank end. */ /* Vertical blank end requires the value to be 1 less * than the actual value being written, and 8 LSB * (Least Significant Bits) are written straight into the * relevant register. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcVBlankEnd: %d\n", mode->CrtcVBlankEnd)); temp = mode->CrtcVBlankEnd - 1; /* 3X5.16[7:0] - Vertical Blanking End Bits [7:0] */ hwp->writeCrtc(hwp, 0x16, temp & 0xFF); /* Set IGA1 vertical synchronization start. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcVSyncStart: %d\n", mode->CrtcVSyncStart)); temp = mode->CrtcVSyncStart; /* 3X5.10[7:0] - Vertical Retrace Start Bits [7:0] */ hwp->writeCrtc(hwp, 0x10, temp & 0xFF); /* 3X5.07[2] - Vertical Retrace Start Bit [8] */ ViaCrtcMask(hwp, 0x07, temp >> 6, 0x04); /* 3X5.07[7] - Vertical Retrace Start Bit [9] */ ViaCrtcMask(hwp, 0x07, temp >> 2, 0x80); /* 3X5.35[1] - Vertical Retrace Start Bit [10] */ ViaCrtcMask(hwp, 0x35, temp >> 9, 0x02); /* Set IGA1 vertical synchronization end. */ /* Vertical synchronization end requires the value to be 1 less * than the actual value being written, and 4 LSB * (Least Significant Bits) are written straight into the * relevant register. */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA1 CrtcVSyncEnd: %d\n", mode->CrtcVSyncEnd)); temp = mode->CrtcVSyncEnd - 1; /*3X5.11[3:0] - Vertical Retrace End Bits [3:0] */ ViaCrtcMask(hwp, 0x11, temp & 0x0F, 0x0F); /* Set IGA1 horizontal offset adjustment. */ temp = (pScrn->displayWidth * (pScrn->bitsPerPixel >> 3)) >> 3; /* 3X5.13[7:0] - Primary Display Horizontal Offset Bits [7:0] */ hwp->writeCrtc(hwp, 0x13, temp & 0xFF); /* 3X5.35[7:5] - Primary Display Horizontal Offset Bits [10:8] */ ViaCrtcMask(hwp, 0x35, temp >> 3, 0xE0); /* Set IGA1 horizontal display fetch (read) count. */ temp = (mode->CrtcHDisplay * (pScrn->bitsPerPixel >> 3)) >> 4; /* 3C5.1C[7:0] - Primary Display Horizontal Display * Fetch Count Data Bits [7:0] */ hwp->writeSeq(hwp, 0x1C, temp & 0xFF); /* 3C5.1D[1:0] - Primary Display Horizontal Display * Fetch Count Data Bits [9:8] */ ViaSeqMask(hwp, 0x1D, temp >> 8, 0x03); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA1SetDisplayRegister.\n")); } /* * Checks for limitations imposed by the available VGA timing registers. */ static ModeStatus viaIGA1ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA1ModeValid.\n")); /* Note that horizontal total being written to VGA registers is * shifted to the right by 3 bit positions since only 9 bits are * available, and then 5 is subtracted from it. Hence, to check if * the screen can even be valid, opposite of that needs to happen. * That being said, to check if the number is within an acceptable range, * 1 is subtracted from 5, hence, 4 (5 - 1) is multiplied with 8 (i.e., * 1 is shifted 3 bit positions to the left), and the resulting 32 is * added to 4096 (9 + 3 bits) to calculate the maximum horizontal total * IGA1 can handle. Ultimately, 4128 is the largest number VIA IGP's * IGA1 can handle. */ if (mode->CrtcHTotal > (4096 + ((1 << 3) * (5 - 1)))) return MODE_BAD_HVALUE; if (((pVia->Chipset != VIA_VX900) && (mode->CrtcHDisplay > 2048)) || ((pVia->Chipset == VIA_VX900) && (mode->CrtcHDisplay > 4096))) return MODE_BAD_HVALUE; if (((pVia->Chipset != VIA_VX900) && (mode->CrtcHBlankStart > 2048)) || ((pVia->Chipset == VIA_VX900) && (mode->CrtcHBlankStart > 4096))) return MODE_BAD_HVALUE; if ((mode->CrtcHBlankEnd - mode->CrtcHBlankStart) > 1025) return MODE_HBLANK_WIDE; if (mode->CrtcHSyncStart > 4095) return MODE_BAD_HVALUE; if ((mode->CrtcHSyncEnd - mode->CrtcHSyncStart) > 256) return MODE_HSYNC_WIDE; if (mode->CrtcVTotal > 2049) return MODE_BAD_VVALUE; if (mode->CrtcVDisplay > 2048) return MODE_BAD_VVALUE; if (mode->CrtcVSyncStart > 2047) return MODE_BAD_VVALUE; if ((mode->CrtcVSyncEnd - mode->CrtcVSyncStart) > 16) return MODE_VSYNC_WIDE; if (mode->CrtcVBlankStart > 2048) return MODE_BAD_VVALUE; if ((mode->CrtcVBlankEnd - mode->CrtcVBlankStart) > 257) return MODE_VBLANK_WIDE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA1ModeValid.\n")); return MODE_OK; } static void ViaSetCLE266APrimaryFIFO(ScrnInfoPtr pScrn, Bool Enable) { VIAPtr pVia = VIAPTR(pScrn); CARD32 dwGE230, dwGE298; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaSetCLE266APrimaryFIFO: %d\n", Enable)); dwGE298 = VIAGETREG(0x298); VIASETREG(0x298, dwGE298 | 0x20000000); dwGE230 = VIAGETREG(0x230); if (Enable) dwGE230 |= 0x00200000; else dwGE230 &= ~0x00200000; VIASETREG(0x230, dwGE230); dwGE298 = VIAGETREG(0x298); VIASETREG(0x298, dwGE298 & ~0x20000000); } static void ViaSetPrimaryExpireNumber(ScrnInfoPtr pScrn, DisplayModePtr mode, ViaExpireNumberTable *Expire) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaSetPrimaryExpireNumber\n")); for (; Expire->X; Expire++) if ((Expire->X == mode->CrtcHDisplay) && (Expire->Y == mode->CrtcVDisplay) && (Expire->Bpp == pScrn->bitsPerPixel) && (Expire->bRamClock == pVia->MemClk)) { ViaSeqMask(hwp, 0x22, Expire->bTuningValue, 0x1F); return; } } static void ViaSetPrimaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaSetPrimaryFIFO\n")); /* Standard values. */ ViaSeqMask(hwp, 0x17, 0x1F, 0xFF); if (mode->CrtcHDisplay >= 1600) { ViaSeqMask(hwp, 0x16, 0x0F, 0xBF); ViaSeqMask(hwp, 0x18, 0x4F, 0xFF); } else if (mode->CrtcHDisplay >= 1024) { ViaSeqMask(hwp, 0x16, 0x0C, 0xBF); ViaSeqMask(hwp, 0x18, 0x4C, 0xFF); } else { ViaSeqMask(hwp, 0x16, 0x08, 0xBF); ViaSeqMask(hwp, 0x18, 0x4E, 0xFF); } switch (pVia->Chipset) { case VIA_CLE266: if (CLE266_REV_IS_CX(pVia->ChipRev)) { if (pVia->HasSecondary) { /* SAMM or DuoView case */ if (mode->HDisplay >= 1024) { ViaSeqMask(hwp, 0x16, 0x1C, 0x3F); /* 28 */ hwp->writeSeq(hwp, 0x17, 0x3F); /* 63 */ hwp->writeSeq(hwp, 0x18, 0x57); /* 23 */ } } else { /* Single view or Simultaneous case */ #if 0 if (mode->HDisplay > 1024) { ViaSeqMask(hwp, 0x16, 0x17, 0x3F); /* 23 */ hwp->writeSeq(hwp, 0x17, 0x2F); /* 47 */ hwp->writeSeq(hwp, 0x18, 0x57); /* 23 */ } #endif } ViaSetPrimaryExpireNumber(pScrn, mode, CLE266CExpireNumber); } else { if ((mode->HDisplay > 1024) && pVia->HasSecondary) { ViaSetCLE266APrimaryFIFO(pScrn, TRUE); ViaSeqMask(hwp, 0x16, 0x17, 0x3F); /* 23 */ hwp->writeSeq(hwp, 0x17, 0x2F); /* 47 */ hwp->writeSeq(hwp, 0x18, 0x57); /* 23 */ } ViaSetPrimaryExpireNumber(pScrn, mode, CLE266AExpireNumber); } break; case VIA_KM400: if (pVia->HasSecondary) { /* SAMM or DuoView case */ if ((mode->HDisplay >= 1600) && (pVia->MemClk <= VIA_MEM_DDR200)) { ViaSeqMask(hwp, 0x16, 0x09, 0x3F); /* 9 */ hwp->writeSeq(hwp, 0x17, 0x1C); /* 28 */ } else { ViaSeqMask(hwp, 0x16, 0x1C, 0x3F); /* 28 */ hwp->writeSeq(hwp, 0x17, 0x3F); /* 63 */ } } else { if ((mode->HDisplay > 1280)) ViaSeqMask(hwp, 0x16, 0x1C, 0x3F); /* 28 */ else if (mode->HDisplay > 1024) ViaSeqMask(hwp, 0x16, 0x17, 0x3F); /* 23 */ else ViaSeqMask(hwp, 0x16, 0x10, 0x3F); /* 16 */ hwp->writeSeq(hwp, 0x17, 0x3F); /* 63 */ } hwp->writeSeq(hwp, 0x18, 0x57); /* 23 */ ViaSetPrimaryExpireNumber(pScrn, mode, KM400ExpireNumber); break; case VIA_K8M800: hwp->writeSeq(hwp, 0x17, 0xBF); /* 384/2 - 1 = 191 */ ViaSeqMask(hwp, 0x16, 0x92, 0xBF); /* 328/4 = 82 = 0x52 */ ViaSeqMask(hwp, 0x18, 0x8a, 0xBF); /* 74 */ if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) ViaSeqMask(hwp, 0x22, 0x10, 0x1F); /* 64/4 = 16 */ else ViaSeqMask(hwp, 0x22, 0x00, 0x1F); /* 128/4 = overflow = 0 */ break; /* PM800/PM880/CN400 */ case VIA_PM800: hwp->writeSeq(hwp, 0x17, 0x5F); /* 95 */ ViaSeqMask(hwp, 0x16, 0x20, 0xBF); /* 32 */ ViaSeqMask(hwp, 0x18, 0x10, 0xBF); /* 16 */ if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) ViaSeqMask(hwp, 0x22, 0x10, 0x1F); /* 64/4 = 16 */ else ViaSeqMask(hwp, 0x22, 0x1F, 0x1F); /* 31 */ break; /* P4M800 Pro/VN800/CN700 */ case VIA_P4M800PRO: hwp->writeSeq(hwp, 0x17, 0x2F); ViaSeqMask(hwp, 0x16, 0x14, 0xBF); /* 80/4 = 20 = 0x14 */ ViaSeqMask(hwp, 0x18, 0x08, 0xBF); if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) ViaSeqMask(hwp, 0x22, 0x10, 0x1F); else ViaSeqMask(hwp, 0x22, 0x00, 0x1F); break; case VIA_K8M890: /* depth location: {SR17,0,7} */ hwp->writeSeq(hwp, 0x17, 0xB3); /* 360/2-1 = 179 = 0xB3 */ /* Formula (x & 0x3F) | ((x & 0x40) << 1) */ /* threshold location: {SR16,0,5},{SR16,7,7} */ ViaSeqMask(hwp, 0x16, 0x92, 0xBF); /* 328/4 = 82 = 0x52 */ /* high threshold location: {SR18,0,5},{SR18,7,7} */ ViaSeqMask(hwp, 0x18, 0x8A, 0xBF); /* 296/4 = 74 = 0x4A */ /* display queue expire num location: {SR22,0,4}. */ ViaSeqMask(hwp, 0x22, 0x1F, 0x1F); /* 124/4 = 31 = 0x1F */ break; case VIA_P4M900: /* location: {SR17,0,7} */ hwp->writeSeq(hwp, 0x17, 0x2F); /* 96/2-1 = 47 = 0x2F */ /* location: {SR16,0,5},{SR16,7,7} */ ViaSeqMask(hwp, 0x16, 0x13, 0xBF); /* 76/4 = 19 = 0x13 */ /* location: {SR18,0,5},{SR18,7,7} */ ViaSeqMask(hwp, 0x18, 0x13, 0xBF); /* 76/4 = 19 = 0x13 */ /* location: {SR22,0,4}. */ ViaSeqMask(hwp, 0x22, 0x08, 0x1F); /* 32/4 = 8 = 0x08 */ break; case VIA_P4M890: hwp->writeSeq(hwp, 0x17, 0x2F); /* 96/2-1 = 47 = 0x2F */ ViaSeqMask(hwp, 0x16, 0x13, 0xBF); /* 76/4 = 19 = 0x13 */ ViaSeqMask(hwp, 0x18, 0x10, 0xBF); /* 64/4 = 16 = 0x10 */ ViaSeqMask(hwp, 0x22, 0x08, 0x1F); /* 32/4 = 8 = 0x08 */ break; case VIA_CX700: hwp->writeSeq(hwp, 0x17, 0x5F); ViaSeqMask(hwp, 0x16, 0x20, 0xBF); /* 128/4 = 32 = 0x20 */ ViaSeqMask(hwp, 0x18, 0x20, 0xBF); /* 128/4 = 32 = 0x20 */ ViaSeqMask(hwp, 0x22, 0x1F, 0x1F); /* 124/4 = 31 = 0x1F */ break; case VIA_VX800: hwp->writeSeq(hwp, 0x17, 0x5F); /* 192/2-1 = 95 = 0x5F */ hwp->writeSeq(hwp, 0x16, 0x26); /* 152/4 = 38 = 0x26 */ hwp->writeSeq(hwp, 0x18, 0x26); /* 152/4 = 38 */ hwp->writeSeq(hwp, 0x22, 0x10); /* 64/4 = 16 */ break; case VIA_VX855: hwp->writeSeq(hwp, 0x17, 0xC7); /* 400/2-1 = 199 = 0xC7 */ /* Formula for {SR16,0,5},{SR16,7,7} is: (0x50 & 0x3F) | ((0x50 & 0x40) << 1) = 0x90 */ hwp->writeSeq(hwp, 0x16, 0x90); /* 320/4 = 80 = 0x50 */ /* Formula for {SR18,0,5},{SR18,7,7} is: (0x50 & 0x3F) | ((0x50 & 0x40) << 1) = 0x90 */ hwp->writeSeq(hwp, 0x18, 0x90); /* 320/4 = 80 = 0x50 */ hwp->writeSeq(hwp, 0x22, 0x28); /* 160/4 = 40 = 0x28 */ break; case VIA_VX900: hwp->writeSeq(hwp, 0x17, 0xC7); /* 400/2-1 = 199 = 0xC7 */ /* Formula for {SR16,0,5},{SR16,7,7} is: (0x50 & 0x3F) | ((0x50 & 0x40) << 1) = 0x90 */ hwp->writeSeq(hwp, 0x16, 0x90); /* 320/4 = 80 = 0x50 */ /* Formula for {SR18,0,5},{SR18,7,7} is: (0x50 & 0x3F) | ((0x50 & 0x40) << 1) = 0x90 */ hwp->writeSeq(hwp, 0x18, 0x90); /* 320/4 = 80 = 0x50 */ hwp->writeSeq(hwp, 0x22, 0x28); /* 160/4 = 40 = 0x28 */ break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaSetPrimaryFIFO: " "Chipset %d not implemented\n", pVia->Chipset); break; } } /* * Turn off the primary FIFO only for CLE266A. */ static void ViaDisablePrimaryFIFO(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDisablePrimaryFIFO\n")); /* Needed because exiting from X-Window will dump back register values. * Other chipsets have no need to set extended FIFO values. */ if ((pVia->Chipset == VIA_CLE266) && CLE266_REV_IS_AX(pVia->ChipRev) && ((pScrn->currentMode->HDisplay > 1024) || pVia->HasSecondary)) ViaSetCLE266APrimaryFIFO(pScrn, FALSE); } void viaIGA1Save(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIARegPtr Regs = &pVia->SavedReg; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA1Save.\n")); vgaHWProtect(pScrn, TRUE); vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_ALL); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Saving sequencer registers.\n")); /* Unlock extended registers. */ hwp->writeSeq(hwp, 0x10, 0x01); Regs->SR[0x14] = hwp->readSeq(hwp, 0x14); Regs->SR[0x15] = hwp->readSeq(hwp, 0x15); Regs->SR[0x16] = hwp->readSeq(hwp, 0x16); Regs->SR[0x17] = hwp->readSeq(hwp, 0x17); Regs->SR[0x18] = hwp->readSeq(hwp, 0x18); Regs->SR[0x19] = hwp->readSeq(hwp, 0x19); /* PCI Bus Control */ Regs->SR[0x1A] = hwp->readSeq(hwp, 0x1A); Regs->SR[0x1B] = hwp->readSeq(hwp, 0x1B); Regs->SR[0x1C] = hwp->readSeq(hwp, 0x1C); Regs->SR[0x1D] = hwp->readSeq(hwp, 0x1D); Regs->SR[0x1E] = hwp->readSeq(hwp, 0x1E); Regs->SR[0x1F] = hwp->readSeq(hwp, 0x1F); Regs->SR[0x20] = hwp->readSeq(hwp, 0x20); Regs->SR[0x21] = hwp->readSeq(hwp, 0x21); Regs->SR[0x22] = hwp->readSeq(hwp, 0x22); /* Registers 3C5.23 through 3C5.25 are not used by Chrome9. * Registers 3C5.27 through 3C5.29 are not used by Chrome9. */ switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: Regs->SR[0x23] = hwp->readSeq(hwp, 0x23); Regs->SR[0x24] = hwp->readSeq(hwp, 0x24); Regs->SR[0x25] = hwp->readSeq(hwp, 0x25); Regs->SR[0x27] = hwp->readSeq(hwp, 0x27); Regs->SR[0x28] = hwp->readSeq(hwp, 0x28); Regs->SR[0x29] = hwp->readSeq(hwp, 0x29); break; default: break; } Regs->SR[0x26] = hwp->readSeq(hwp, 0x26); Regs->SR[0x2A] = hwp->readSeq(hwp, 0x2A); Regs->SR[0x2B] = hwp->readSeq(hwp, 0x2B); Regs->SR[0x2D] = hwp->readSeq(hwp, 0x2D); Regs->SR[0x2E] = hwp->readSeq(hwp, 0x2E); /* Save PCI Configuration Memory Base Shadow 0 and 1. * These registers are available only in UniChrome, UniChrome Pro, * and UniChrome Pro II. */ switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: Regs->SR[0x2F] = hwp->readSeq(hwp, 0x2F); Regs->SR[0x30] = hwp->readSeq(hwp, 0x30); break; default: break; } /* Save PLL settings and several miscellaneous registers. * For UniChrome, register 3C5.44 through 3C5.4B are saved. * For UniChrome Pro and Chrome9, register 3C5.44 through 3C5.4C * are saved. */ Regs->SR[0x44] = hwp->readSeq(hwp, 0x44); Regs->SR[0x45] = hwp->readSeq(hwp, 0x45); Regs->SR[0x46] = hwp->readSeq(hwp, 0x46); Regs->SR[0x47] = hwp->readSeq(hwp, 0x47); Regs->SR[0x48] = hwp->readSeq(hwp, 0x48); Regs->SR[0x49] = hwp->readSeq(hwp, 0x49); Regs->SR[0x4A] = hwp->readSeq(hwp, 0x4A); Regs->SR[0x4B] = hwp->readSeq(hwp, 0x4B); switch (pVia->Chipset) { case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: Regs->SR[0x4C] = hwp->readSeq(hwp, 0x4C); /* Save register 3C5.4D. * According to CX700 / VX700 (UniChrome Pro II) Open Graphics * Programming Manual Part I: Graphics Core / 2D, * this register is called Dual Channel Memory Control. * According to VX800 / VX855 / VX900 (Chrome9 HC3 / HCM / HD) * Open Graphics Programming Manual Part I: Graphics Core / 2D, * this register is called Preemptive Arbiter Control. * It is likely that this register is also supported in UniChrome Pro. */ Regs->SR[0x4D] = hwp->readSeq(hwp, 0x4D); Regs->SR[0x4E] = hwp->readSeq(hwp, 0x4E); Regs->SR[0x4F] = hwp->readSeq(hwp, 0x4F); break; default: break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Finished saving sequencer registers.\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Saving IGA1 registers.\n")); /* UniChrome Pro or later */ switch (pVia->Chipset) { case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* Display Fetch Blocking Control */ Regs->CR[0x30] = hwp->readCrtc(hwp, 0x30); /* Half Line Position */ Regs->CR[0x31] = hwp->readCrtc(hwp, 0x31); break; default: break; } Regs->CR[0x32] = hwp->readCrtc(hwp, 0x32); Regs->CR[0x33] = hwp->readCrtc(hwp, 0x33); Regs->CR[0x35] = hwp->readCrtc(hwp, 0x35); Regs->CR[0x36] = hwp->readCrtc(hwp, 0x36); /* UniChrome Pro or later */ switch (pVia->Chipset) { case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* DAC Control Register */ Regs->CR[0x37] = hwp->readCrtc(hwp, 0x37); break; default: break; } Regs->CR[0x38] = hwp->readCrtc(hwp, 0x38); Regs->CR[0x39] = hwp->readCrtc(hwp, 0x39); Regs->CR[0x3A] = hwp->readCrtc(hwp, 0x3A); Regs->CR[0x3B] = hwp->readCrtc(hwp, 0x3B); Regs->CR[0x3C] = hwp->readCrtc(hwp, 0x3C); Regs->CR[0x3D] = hwp->readCrtc(hwp, 0x3D); Regs->CR[0x3E] = hwp->readCrtc(hwp, 0x3E); Regs->CR[0x3F] = hwp->readCrtc(hwp, 0x3F); Regs->CR[0x40] = hwp->readCrtc(hwp, 0x40); /* UniChrome Pro or later */ switch (pVia->Chipset) { case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: Regs->CR[0x43] = hwp->readCrtc(hwp, 0x43); Regs->CR[0x45] = hwp->readCrtc(hwp, 0x45); break; default: break; } Regs->CR[0x46] = hwp->readCrtc(hwp, 0x46); Regs->CR[0x47] = hwp->readCrtc(hwp, 0x47); /* Starting Address */ /* Start Address High */ Regs->CR[0x0C] = hwp->readCrtc(hwp, 0x0C); /* Start Address Low */ Regs->CR[0x0D] = hwp->readCrtc(hwp, 0x0D); /* UniChrome Pro or later */ switch (pVia->Chipset) { case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* Starting Address Overflow[28:24] */ Regs->CR[0x48] = hwp->readCrtc(hwp, 0x48); break; default: break; } /* Starting Address Overflow[23:16] */ Regs->CR[0x34] = hwp->readCrtc(hwp, 0x34); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Finished saving IGA1 registers.\n")); vgaHWProtect(pScrn, FALSE); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA1Save.\n")); } void viaIGA1Restore(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIARegPtr Regs = &pVia->SavedReg; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA1Restore.\n")); vgaHWProtect(pScrn, TRUE); vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_ALL); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring sequencer registers.\n")); /* Unlock extended registers. */ hwp->writeSeq(hwp, 0x10, 0x01); hwp->writeSeq(hwp, 0x15, Regs->SR[0x15]); hwp->writeSeq(hwp, 0x16, Regs->SR[0x16]); hwp->writeSeq(hwp, 0x17, Regs->SR[0x17]); hwp->writeSeq(hwp, 0x18, Regs->SR[0x18]); hwp->writeSeq(hwp, 0x19, Regs->SR[0x19]); hwp->writeSeq(hwp, 0x1A, Regs->SR[0x1A]); hwp->writeSeq(hwp, 0x1B, Regs->SR[0x1B]); hwp->writeSeq(hwp, 0x1C, Regs->SR[0x1C]); hwp->writeSeq(hwp, 0x1D, Regs->SR[0x1D]); hwp->writeSeq(hwp, 0x1E, Regs->SR[0x1E]); hwp->writeSeq(hwp, 0x1F, Regs->SR[0x1F]); hwp->writeSeq(hwp, 0x20, Regs->SR[0x20]); hwp->writeSeq(hwp, 0x21, Regs->SR[0x21]); hwp->writeSeq(hwp, 0x22, Regs->SR[0x22]); /* Registers 3C5.23 through 3C5.25 are not used by Chrome9. * Registers 3C5.27 through 3C5.29 are not used by Chrome9. */ switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: hwp->writeSeq(hwp, 0x23, Regs->SR[0x23]); hwp->writeSeq(hwp, 0x24, Regs->SR[0x24]); hwp->writeSeq(hwp, 0x25, Regs->SR[0x25]); hwp->writeSeq(hwp, 0x27, Regs->SR[0x27]); hwp->writeSeq(hwp, 0x28, Regs->SR[0x28]); hwp->writeSeq(hwp, 0x29, Regs->SR[0x29]); break; default: break; } hwp->writeSeq(hwp, 0x26, Regs->SR[0x26]); hwp->writeSeq(hwp, 0x2A, Regs->SR[0x2A]); hwp->writeSeq(hwp, 0x2B, Regs->SR[0x2B]); hwp->writeSeq(hwp, 0x2D, Regs->SR[0x2D]); hwp->writeSeq(hwp, 0x2E, Regs->SR[0x2E]); /* Restore PCI Configuration Memory Base Shadow 0 and 1. * These registers are available only in UniChrome, UniChrome Pro, * and UniChrome Pro II. */ switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: hwp->writeSeq(hwp, 0x2F, Regs->SR[0x2F]); hwp->writeSeq(hwp, 0x30, Regs->SR[0x30]); break; default: break; } /* Restore PLL settings and several miscellaneous registers. * For UniChrome, register 3C5.44 through 3C5.4B are restored. * For UniChrome Pro and Chrome 9, register 3C5.44 through 3C5.4C * are restored. */ switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: /* Engine Clock (ECK) PLL settings */ hwp->writeSeq(hwp, 0x48, Regs->SR[0x48]); hwp->writeSeq(hwp, 0x49, Regs->SR[0x49]); /* Memory Clock (MCK) PLL settings */ hwp->writeSeq(hwp, 0x4a, Regs->SR[0x4A]); hwp->writeSeq(hwp, 0x4b, Regs->SR[0x4B]); /* Primary Display Clock (VCK) PLL settings */ hwp->writeSeq(hwp, 0x46, Regs->SR[0x46]); hwp->writeSeq(hwp, 0x47, Regs->SR[0x47]); /* Secondary Display Clock (LCDCK) PLL settings */ hwp->writeSeq(hwp, 0x44, Regs->SR[0x44]); hwp->writeSeq(hwp, 0x45, Regs->SR[0x45]); break; default: /* Engine Clock (ECK) PLL settings */ hwp->writeSeq(hwp, 0x47, Regs->SR[0x47]); hwp->writeSeq(hwp, 0x48, Regs->SR[0x48]); hwp->writeSeq(hwp, 0x49, Regs->SR[0x49]); /* Reset ECK PLL. */ hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) | 0x01); /* Set SR40[0] to 1 */ hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) & (~0x01)); /* Set SR40[0] to 0 */ /* Primary Display Clock (VCK) PLL settings */ hwp->writeSeq(hwp, 0x44, Regs->SR[0x44]); hwp->writeSeq(hwp, 0x45, Regs->SR[0x45]); hwp->writeSeq(hwp, 0x46, Regs->SR[0x46]); /* Reset VCK PLL. */ hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) | 0x02); /* Set SR40[1] to 1 */ hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) & (~0x02)); /* Set SR40[1] to 0 */ /* Secondary Display Clock (LCDCK) PLL settings */ hwp->writeSeq(hwp, 0x4A, Regs->SR[0x4A]); hwp->writeSeq(hwp, 0x4B, Regs->SR[0x4B]); hwp->writeSeq(hwp, 0x4C, Regs->SR[0x4C]); /* Reset LCDCK PLL. */ hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) | 0x04); /* Set SR40[2] to 1 */ hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) & (~0x04)); /* Set SR40[2] to 0 */ break; } switch (pVia->Chipset) { case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* Restore register 3C5.4D. * According to CX700 / VX700 (UniChrome Pro II) Open Graphics * Programming Manual Part I: Graphics Core / 2D, * this register is called Dual Channel Memory Control. * According to VX800 / VX855 / VX900 (Chrome9 HC3 / HCM / HD) * Open Graphics Programming Manual Part I: Graphics Core / 2D, * this register is called Preemptive Arbiter Control. * It is likely that this register is also supported in UniChrome Pro. */ hwp->writeSeq(hwp, 0x4D, Regs->SR[0x4D]); hwp->writeSeq(hwp, 0x4E, Regs->SR[0x4E]); hwp->writeSeq(hwp, 0x4F, Regs->SR[0x4F]); break; default: break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Finished restoring sequencer registers.\n")); /* Reset dot clocks. */ ViaSeqMask(hwp, 0x40, 0x06, 0x06); ViaSeqMask(hwp, 0x40, 0x00, 0x06); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring IGA1 registers.\n")); /* later */ switch (pVia->Chipset) { case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* Display Fetch Blocking Control */ hwp->writeCrtc(hwp, 0x30, Regs->CR[0x30]); /* Half Line Position */ hwp->writeCrtc(hwp, 0x31, Regs->CR[0x31]); break; default: break; } /* Restore CRTC controller extended registers. */ /* Mode Control */ hwp->writeCrtc(hwp, 0x32, Regs->CR[0x32]); /* HSYNCH Adjuster */ hwp->writeCrtc(hwp, 0x33, Regs->CR[0x33]); /* Extended Overflow */ hwp->writeCrtc(hwp, 0x35, Regs->CR[0x35]); /* Power Management 3 (Monitor Control) */ hwp->writeCrtc(hwp, 0x36, Regs->CR[0x36]); /* UniChrome Pro or later */ switch (pVia->Chipset) { case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* DAC control Register */ hwp->writeCrtc(hwp, 0x37, Regs->CR[0x37]); break; default: break; } hwp->writeCrtc(hwp, 0x38, Regs->CR[0x38]); hwp->writeCrtc(hwp, 0x39, Regs->CR[0x39]); hwp->writeCrtc(hwp, 0x3A, Regs->CR[0x3A]); hwp->writeCrtc(hwp, 0x3B, Regs->CR[0x3B]); hwp->writeCrtc(hwp, 0x3C, Regs->CR[0x3C]); hwp->writeCrtc(hwp, 0x3D, Regs->CR[0x3D]); hwp->writeCrtc(hwp, 0x3E, Regs->CR[0x3E]); hwp->writeCrtc(hwp, 0x3F, Regs->CR[0x3F]); hwp->writeCrtc(hwp, 0x40, Regs->CR[0x40]); /* UniChrome Pro or later */ switch (pVia->Chipset) { case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: hwp->writeCrtc(hwp, 0x43, Regs->CR[0x43]); hwp->writeCrtc(hwp, 0x45, Regs->CR[0x45]); break; default: break; } hwp->writeCrtc(hwp, 0x46, Regs->CR[0x46]); hwp->writeCrtc(hwp, 0x47, Regs->CR[0x47]); /* Starting Address */ /* Start Address High */ hwp->writeCrtc(hwp, 0x0C, Regs->CR[0x0C]); /* Start Address Low */ hwp->writeCrtc(hwp, 0x0D, Regs->CR[0x0D]); /* UniChrome Pro or later */ switch (pVia->Chipset) { case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* Starting Address Overflow[28:24] */ hwp->writeCrtc(hwp, 0x48, Regs->CR[0x48]); break; default: break; } /* CR34 is fire bits. Must be written after CR0C, CR0D, and CR48. * Starting Address Overflow[23:16] */ hwp->writeCrtc(hwp, 0x34, Regs->CR[0x34]); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Finished restoring IGA1 registers.\n")); ViaDisablePrimaryFIFO(pScrn); vgaHWProtect(pScrn, FALSE); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA1Restore.\n")); } /* * Initialize IGA2 (Integrated Graphics Accelerator) registers. */ void viaIGA2Init(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); #ifdef HAVE_DEBUG CARD8 temp; #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2Init.\n")); #ifdef HAVE_DEBUG temp = hwp->readSeq(hwp, 0x1B); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR1B: 0x%02X\n", temp)); temp = hwp->readSeq(hwp, 0x2D); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR2D: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x6A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR6A: 0x%02X\n", temp)); temp = hwp->readCrtc(hwp, 0x6B); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR6B: 0x%02X\n", temp)); /* For UniChrome Pro and Chrome9. */ if ((pVia->Chipset != VIA_CLE266) && (pVia->Chipset != VIA_KM400)) { temp = hwp->readCrtc(hwp, 0x6C); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR6C: 0x%02X\n", temp)); } temp = hwp->readCrtc(hwp, 0x79); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR79: 0x%02X\n", temp)); #endif /* 3C5.1B[7:6] - Secondary Display Engine (Gated Clock ) * 0x: Clock always off * 10: Clock always on * 11: Clock on/off according to the * Power Management Status (PMS) * 3C5.1B[5:4] - Primary Display Engine (Gated Clock ) * 0x: Clock always off * 10: Clock always on * 11: Clock on/off according to the PMS * 3C5.1B[3:1] - Reserved * 3C5.1B[0] - Primary Display’s LUT On/Off * 0: On * 1: Off */ ViaSeqMask(hwp, 0x1B, 0xC0, 0xC0); /* 3C5.2D[7:6] - E3_ECK_N Selection * 00: E3_ECK_N * 01: E3_ECK * 10: delayed E3_ECK_N * 11: delayed E3_ECK * 3C5.2D[5:4] - VCK (Primary Display Clock) PLL Power Control * 0x: PLL power-off * 10: PLL always on * 11: PLL on/off according to the PMS * 3C5.2D[3:2] - LCK (Secondary Display Clock) PLL Power Control * 0x: PLL power-off * 10: PLL always on * 11: PLL on/off according to the PMS * 3C5.2D[1:0] - ECK (Engine Clock) PLL Power Control * 0x: PLL power-off * 10: PLL always on * 11: PLL on/off according to the PMS */ ViaSeqMask(hwp, 0x2D, 0x0C, 0x0C); /* 3X5.6A[7] - Second Display Channel Enable * 0: Disable * 1: Enable * 3X5.6A[6] - Second Display Channel Reset * 0: Reset * 3X5.6A[5] - Second Display 8/6 Bits LUT * 0: 6-bit * 1: 8-bit * 3X5.6A[4] - Horizontal Count by 2 * 0: Disable * 1: Enable * 3X5.6A[1] - LCD Gamma Enable * 0: Disable * 1: Enable * 3X5.6A[0] - LCD Pre-fetch Mode Enable * 0: Disable * 1: Enable */ ViaCrtcMask(hwp, 0x6A, 0x80, 0xC1); /* TV out uses division by 2 mode. * Other devices like analog (VGA), DVI, flat panel, etc., * use normal mode. */ /* 3X5.6B[5:4] - Second Display Channel Clock Mode Selection * 0x: Normal * 1x: Division by 2 * 3X5.6B[2] - IGA2 Screen Off * 0: Normal * 1: Screen off * 3X5.6B[1] - IGA2 Screen Off Selection Method * 0: IGA2 Screen off * 1: IGA1 Screen off */ ViaCrtcMask(hwp, 0x6B, 0x00, 0x36); /* For UniChrome Pro and Chrome9. */ if ((pVia->Chipset != VIA_CLE266) && (pVia->Chipset != VIA_KM400)) { /* The following register fields are for UniChrome Pro and Chrome9. */ /* 3X5.6C[3:1] - LCDCK PLL Reference Clock Source Selection * 000: From XI pin * 001: From TVXI * 01x: From TVPLL * 100: DVP0TVCLKR * 101: DVP1TVCLKR * 110: CAP0 Clock * 111: CAP1 Clock * 3X5.6C[0] - LCDCK Source Selection * 0: LCDCK PLL output clock * 1: LCDCK PLL reference clock */ ViaCrtcMask(hwp, 0x6C, 0x00, 0x0F); } /* Disable LCD scaling */ /* 3X5.79[0] - LCD Scaling Enable * 0: Disable * 1: Enable */ ViaCrtcMask(hwp, 0x79, 0x00, 0x01); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2Init.\n")); } void viaIGA2SetFBStartingAddress(xf86CrtcPtr crtc, int x, int y) { ScrnInfoPtr pScrn = crtc->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; CARD32 Base, tmp; CARD8 cr62, cr63, cr64, cra3; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2SetFBStartingAddress.\n")); Base = (y * pScrn->displayWidth + x) * (pScrn->bitsPerPixel / 8); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Base Address: 0x%lx\n", Base)); Base = (Base + drmmode->front_bo->offset) >> 3; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DRI Base Address: 0x%lx\n", Base); tmp = hwp->readCrtc(hwp, 0x62) & 0x01; tmp |= (Base & 0x7F) << 1; hwp->writeCrtc(hwp, 0x62, tmp); hwp->writeCrtc(hwp, 0x63, (Base & 0x7F80) >> 7); hwp->writeCrtc(hwp, 0x64, (Base & 0x7F8000) >> 15); hwp->writeCrtc(hwp, 0xA3, (Base & 0x03800000) >> 23); #ifdef HAVE_DEBUG cr62 = hwp->readCrtc(hwp, 0x62); cr63 = hwp->readCrtc(hwp, 0x63); cr64 = hwp->readCrtc(hwp, 0x64); cra3 = hwp->readCrtc(hwp, 0xA3); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR62: 0x%02X\n", cr62)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR63: 0x%02X\n", cr63)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CR64: 0x%02X\n", cr64)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CRA3: 0x%02X\n", cra3)); #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2SetFBStartingAddress.\n")); } void viaIGA2SetDisplayRegister(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); CARD16 temp; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2SetDisplayRegister.\n")); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Requested Screen Mode: %s\n", mode->name); /* UniChrome Pro or later */ if ((pVia->Chipset != VIA_CLE266) && (pVia->Chipset != VIA_KM400)) { /* Set IGA2 to linear mode. */ /* 3X5.62[0] - IGA2 Address Mode Selection * 0: Linear * 1: Tile */ ViaCrtcMask(hwp, 0x62, 0x00, 0x01); } /* Keep interlace mode off. */ /* 3X5.67[5] - Second Display Interlace Mode * 0: Off * 1: On */ ViaCrtcMask(hwp, 0x67, 0x00, 0x20); /* Set IGA2 horizontal total pixels.*/ /* Horizontal Total Period: 4096 - 1 (max) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcHTotal: %d\n", mode->CrtcHTotal)); temp = mode->CrtcHTotal - 1; /* 3X5.50[7:0] - Horizontal Total Period Bits [7:0] */ hwp->writeCrtc(hwp, 0x50, temp & 0xFF); /* 3X5.55[3:0] - Horizontal Total Period Bits [11:8] */ ViaCrtcMask(hwp, 0x55, temp >> 8, 0x0F); /* Set IGA2 horizontal display end position. */ /* Horizontal Active Data Period: 2048 - 1 (max) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcHDisplay: %d\n", mode->CrtcHDisplay)); temp = mode->CrtcHDisplay - 1; /* 3X5.51[7:0] - Horizontal Active Data Period Bits [7:0] */ hwp->writeCrtc(hwp, 0x51, temp & 0xFF); /* 3X5.55[6:4] - Horizontal Active Data Period Bits [10:8] */ ViaCrtcMask(hwp, 0x55, temp >> 4, 0x70); if (pVia->Chipset == VIA_VX900) { /* 3X5.55[7] - Horizontal Active Data Period Bits [11] */ ViaCrtcMask(hwp, 0x55, temp >> 4, 0x80); } /* Set IGA2 horizontal blank start. */ /* Subtracting 1 from CrtcHBlankStart appears to suppress some * monitors from reporting horizontal resolution that is 1 more * than the desired horizontal * resolution. (i.e., 1601 rather than 1600) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcHBlankStart: %d\n", mode->CrtcHBlankStart)); temp = mode->CrtcHBlankStart - 1; /* 3X5.52[7:0] - Horizontal Blanking Start Bits [7:0] */ hwp->writeCrtc(hwp, 0x52, temp & 0xFF); /* 3X5.54[2:0] - Horizontal Blanking Start Bits [10:8] */ ViaCrtcMask(hwp, 0x54, temp >> 8, 0x07); if (pVia->Chipset == VIA_VX900) { /* 3X5.6B[0] - Horizontal Blanking Start Bit [11] */ ViaCrtcMask(hwp, 0x6B, temp >> 11, 0x01); } /* Set IGA2 horizontal blank end. */ /* Horizontal Blanking End: 4096 - 1 (max) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcHBlankEnd: %d\n", mode->CrtcHBlankEnd)); temp = mode->CrtcHBlankEnd - 1; /* 3X5.53[7:0] - Horizontal Blanking End Bits [7:0] */ hwp->writeCrtc(hwp, 0x53, temp & 0xFF); /* 3X5.54[5:3] - Horizontal Blanking End Bits [10:8] */ ViaCrtcMask(hwp, 0x54, temp >> 5, 0x38); /* 3X5.5D[6] - Horizontal Blanking End Bit [11] */ ViaCrtcMask(hwp, 0x5D, temp >> 5, 0x40); /* Set IGA2 horizontal synchronization start. */ /* Horizontal Retrace Start: 2047 (max, UniChrome), * 4095 (max, UniChrome Pro and Chrome9) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcHSyncStart: %d\n", mode->CrtcHSyncStart)); temp = mode->CrtcHSyncStart; /* 3X5.56[7:0] - Horizontal Retrace Start Bits [7:0] */ hwp->writeCrtc(hwp, 0x56, temp & 0xFF); /* 3X5.54[7:6] - Horizontal Retrace Start Bits [9:8] */ ViaCrtcMask(hwp, 0x54, temp >> 2, 0xC0); /* 3X5.5C[7] - Horizontal Retrace Start Bit [10] */ ViaCrtcMask(hwp, 0x5C, temp >> 3, 0x80); /* For UniChrome Pro and Chrome9. */ if ((pVia->Chipset != VIA_CLE266) && (pVia->Chipset != VIA_KM400)) { /* 3X5.5D[7] - Horizontal Retrace Start Bit [11] */ ViaCrtcMask(hwp, 0x5D, temp >> 4, 0x80); } /* Set IGA2 horizontal synchronization end. */ /* Horizontal Retrace End: 511 (max) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcHSyncEnd: %d\n", mode->CrtcHSyncEnd)); temp = mode->CrtcHSyncEnd - 1; /* 3X5.57[7:0] - Horizontal Retrace End Bits [7:0] */ hwp->writeCrtc(hwp, 0x57, temp & 0xFF); /* 3X5.5C[6] - Horizontal Retrace End Bit [8] */ ViaCrtcMask(hwp, 0x5C, temp >> 2, 0x40); /* Set IGA2 vertical total pixels. */ /* Vertical Total Period: 2048 - 1 (max) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcVTotal: %d\n", mode->CrtcVTotal)); temp = mode->CrtcVTotal - 1; /* 3X5.58[7:0] - Vertical Total Period Bits [7:0] */ hwp->writeCrtc(hwp, 0x58, temp & 0xFF); /* 3X5.5D[2:0] - Vertical Total Period Bits [10:8] */ ViaCrtcMask(hwp, 0x5D, temp >> 8, 0x07); /* Set IGA2 vertical display end position. */ /* Vertical Active Data Period: 2048 - 1 (max) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcVDisplay: %d\n", mode->CrtcVDisplay)); temp = mode->CrtcVDisplay - 1; /* 3X5.59[7:0] - Vertical Active Data Period Bits [7:0] */ hwp->writeCrtc(hwp, 0x59, temp & 0xFF); /* 3X5.5D[5:3] - Vertical Active Data Period Bits [10:8] */ ViaCrtcMask(hwp, 0x5D, temp >> 5, 0x38); /* Set IGA2 vertical blank start. */ /* Subtracting 1 from CrtcVBlankStart appears to suppress some * monitors from reporting vertical resolution that is 1 more * than the desired vertical resolution. (i.e., 1201 rather * than 1200) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcVBlankStart: %d\n", mode->CrtcVBlankStart)); temp = mode->CrtcVBlankStart - 1; /* 3X5.5A[7:0] - Vertical Blanking Start Bits [7:0] */ hwp->writeCrtc(hwp, 0x5A, temp & 0xFF); /* 3X5.5C[2:0] - Vertical Blanking Start Bits [10:8] */ ViaCrtcMask(hwp, 0x5C, temp >> 8, 0x07); /* Set IGA2 vertical blank end. */ /* Vertical Blanking End: 4096 - 1 (max) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcVBlankEnd: %d\n", mode->CrtcVBlankEnd)); temp = mode->CrtcVBlankEnd - 1; /* 3X5.5B[7:0] - Vertical Blanking End Bits [7:0] */ hwp->writeCrtc(hwp, 0x5B, temp & 0xFF); /* 3X5.5C[5:3] - Vertical Blanking End Bits [10:8] */ ViaCrtcMask(hwp, 0x5C, temp >> 5, 0x38); /* Set IGA2 vertical synchronization start. */ /* Horizontal Retrace Start: 2047 (max) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcVSyncStart: %d\n", mode->CrtcVSyncStart)); temp = mode->CrtcVSyncStart; /* 3X5.5E[7:0] - Vertical Retrace Start Bits [7:0] */ hwp->writeCrtc(hwp, 0x5E, temp & 0xFF); /* 3X5.5F[7:5] - Vertical Retrace Start Bits [10:8] */ ViaCrtcMask(hwp, 0x5F, temp >> 3, 0xE0); /* Set IGA2 vertical synchronization end. */ /* Vertical Retrace End: 32 (max) */ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IGA2 CrtcVSyncEnd: %d\n", mode->CrtcVSyncEnd)); temp = mode->CrtcVSyncEnd - 1; /*3X5.5F[4:0] - Vertical Retrace End Bits [4:0] */ ViaCrtcMask(hwp, 0x5F, temp & 0x1F, 0x1F); /* Set IGA2 horizontal offset adjustment. */ temp = (pScrn->displayWidth * (pScrn->bitsPerPixel >> 3)) >> 3; /* 3X5.66[7:0] - Second Display Horizontal Offset Bits [7:0] */ hwp->writeCrtc(hwp, 0x66, temp & 0xFF); /* 3X5.67[1:0] - Second Display Horizontal Offset Bits [9:8] */ ViaCrtcMask(hwp, 0x67, temp >> 8, 0x03); /* Set IGA2 fetch count. */ temp = (mode->CrtcHDisplay * (pScrn->bitsPerPixel >> 3)) >> 4; /* 3X5.65[7:0] - Second Display Horizontal * 2-Quadword Count Data Bits [7:0] */ hwp->writeCrtc(hwp, 0x65, temp & 0xFF); /* 3X5.67[3:2] - Second Display Horizontal * 2-Quadword Count Data Bits [9:8] */ ViaCrtcMask(hwp, 0x67, temp >> 6, 0x0C); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2SetDisplayRegister.\n")); } static ModeStatus viaIGA2ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2ModeValid.\n")); if (mode->CrtcHTotal > 4096) return MODE_BAD_HVALUE; if (((pVia->Chipset != VIA_VX900) && (mode->CrtcHDisplay > 2048)) || ((pVia->Chipset == VIA_VX900) && (mode->CrtcHDisplay > 4096))) return MODE_BAD_HVALUE; if (((pVia->Chipset != VIA_VX900) && (mode->CrtcHBlankStart > 2048)) || ((pVia->Chipset == VIA_VX900) && (mode->CrtcHBlankStart > 4096))) return MODE_BAD_HVALUE; if (mode->CrtcHBlankEnd > 4096) return MODE_HBLANK_WIDE; if ((((pVia->Chipset == VIA_CLE266) || (pVia->Chipset == VIA_KM400)) && (mode->CrtcHSyncStart > 2048)) || (((pVia->Chipset != VIA_CLE266) && (pVia->Chipset != VIA_KM400)) && (mode->CrtcHSyncStart > 4096))) return MODE_BAD_HVALUE; if ((mode->CrtcHSyncEnd - mode->CrtcHSyncStart) > 512) return MODE_HSYNC_WIDE; if (mode->CrtcVTotal > 2048) return MODE_BAD_VVALUE; if (mode->CrtcVDisplay > 2048) return MODE_BAD_VVALUE; if (mode->CrtcVBlankStart > 2048) return MODE_BAD_VVALUE; if (mode->CrtcVBlankEnd > 2048) return MODE_VBLANK_WIDE; if (mode->CrtcVSyncStart > 2048) return MODE_BAD_VVALUE; if ((mode->CrtcVSyncEnd - mode->CrtcVSyncStart) > 32) return MODE_VSYNC_WIDE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2ModeValid.\n")); return MODE_OK; } /* * I've thrown out the LCD requirement. Size > 1024 is not supported * by any currently known TV encoder anyway. -- Luc. * */ static void ViaSetSecondaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaSetSecondaryFIFO\n")); switch (pVia->Chipset) { case VIA_CLE266: if (CLE266_REV_IS_CX(pVia->ChipRev)) { if (mode->HDisplay >= 1024) { ViaCrtcMask(hwp, 0x6A, 0x20, 0x20); hwp->writeCrtc(hwp, 0x68, 0xAB);/* depth 10, threshold 11 */ } else { ViaCrtcMask(hwp, 0x6A, 0x00, 0x20); hwp->writeCrtc(hwp, 0x68, 0x67);/* depth 6, threshold 7 */ } } else { if ((pScrn->bitsPerPixel >= 24) && (((mode->VDisplay > 768) && (pVia->MemClk <= VIA_MEM_DDR200)) || ((mode->HDisplay > 1280) && (pVia->MemClk <= VIA_MEM_DDR266)))) { ViaCrtcMask(hwp, 0x6A, 0x20, 0x20); hwp->writeCrtc(hwp, 0x68, 0xAB);/* depth 10, threshold 11 */ } else { ViaCrtcMask(hwp, 0x6A, 0x00, 0x20); hwp->writeCrtc(hwp, 0x68, 0x67);/* depth 6, threshold 7 */ } } break; case VIA_KM400: if ((mode->HDisplay >= 1600) && (pVia->MemClk <= VIA_MEM_DDR200)) { ViaCrtcMask(hwp, 0x6A, 0x20, 0x20); hwp->writeCrtc(hwp, 0x68, 0xEB); /* depth 14, threshold 11 */ } else if ((pScrn->bitsPerPixel == 32) && (((mode->HDisplay > 1024) && (pVia->MemClk <= VIA_MEM_DDR333)) || ((mode->HDisplay >= 1024) && (pVia->MemClk <= VIA_MEM_DDR200)))) { ViaCrtcMask(hwp, 0x6A, 0x20, 0x20); hwp->writeCrtc(hwp, 0x68, 0xCA); /* depth 12, threshold 10 */ } else if ((pScrn->bitsPerPixel == 16) && (((mode->HDisplay > 1280) && (pVia->MemClk <= VIA_MEM_DDR333)) || ((mode->HDisplay >= 1280) && (pVia->MemClk <= VIA_MEM_DDR200)))) { ViaCrtcMask(hwp, 0x6A, 0x20, 0x20); hwp->writeCrtc(hwp, 0x68, 0xAB); /* depth 10, threshold 11 */ } else { ViaCrtcMask(hwp, 0x6A, 0x00, 0x20); hwp->writeCrtc(hwp, 0x68, 0x67); /* depth 6, threshold 7 */ } break; case VIA_K8M800: /* depth: (384 /8 -1 -1) = 46 = 0x2E */ ViaCrtcMask(hwp, 0x68, 0xE0, 0xF0); ViaCrtcMask(hwp, 0x94, 0x00, 0x80); ViaCrtcMask(hwp, 0x95, 0x80, 0x80); /* threshold: (328/4) = 82 = 0x52 */ ViaCrtcMask(hwp, 0x68, 0x02, 0x0F); ViaCrtcMask(hwp, 0x95, 0x50, 0x70); /* preq: 74 = 0x4A */ ViaCrtcMask(hwp, 0x92, 0x0A, 0x0F); ViaCrtcMask(hwp, 0x95, 0x04, 0x07); if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) ViaCrtcMask(hwp, 0x94, 0x10, 0x7F); /* 64/4 */ else ViaCrtcMask(hwp, 0x94, 0x20, 0x7F); /* 128/4 */ break; case VIA_PM800: /* depth: 12 - 1 = 0x0B */ ViaCrtcMask(hwp, 0x68, 0xB0, 0xF0); ViaCrtcMask(hwp, 0x94, 0x00, 0x80); ViaCrtcMask(hwp, 0x95, 0x00, 0x80); /* threshold: 16 = 0x10 */ ViaCrtcMask(hwp, 0x68, 0x00, 0x0F); ViaCrtcMask(hwp, 0x95, 0x10, 0x70); /* preq: 8 = 0x08 */ ViaCrtcMask(hwp, 0x92, 0x08, 0x0F); ViaCrtcMask(hwp, 0x95, 0x00, 0x07); if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) ViaCrtcMask(hwp, 0x94, 0x10, 0x7F); /* 64/4 */ else ViaCrtcMask(hwp, 0x94, 0x20, 0x7F); /* 128/4 */ break; case VIA_P4M800PRO: ViaCrtcMask(hwp, 0x68, 0xA0, 0xF0); ViaCrtcMask(hwp, 0x94, 0x00, 0x80); ViaCrtcMask(hwp, 0x95, 0x00, 0x80); ViaCrtcMask(hwp, 0x68, 0x04, 0x0F); ViaCrtcMask(hwp, 0x95, 0x10, 0x70); ViaCrtcMask(hwp, 0x92, 0x08, 0x0F); ViaCrtcMask(hwp, 0x95, 0x00, 0x07); if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) ViaCrtcMask(hwp, 0x94, 0x10, 0x7F); else ViaCrtcMask(hwp, 0x94, 0x20, 0x7F); break; case VIA_P4M890: /* depth location: {CR68,4,7},{CR94,7,7},{CR95,7,7} */ ViaCrtcMask(hwp, 0x68, 0xB0, 0xF0); /* 96/8-1 = 11 = 0x0B */ ViaCrtcMask(hwp, 0x94, 0x00, 0x80); ViaCrtcMask(hwp, 0x95, 0x00, 0x80); /* location: {CR68,0,3},{CR95,4,6} */ ViaCrtcMask(hwp, 0x68, 0x03, 0x0F); /* 76/4 = 19 = 0x13 */ ViaCrtcMask(hwp, 0x95, 0x10, 0x70); /* location: {CR92,0,3},{CR95,0,2} */ ViaCrtcMask(hwp, 0x92, 0x00, 0x0F); /* 64/4 = 16 = 0x10 */ ViaCrtcMask(hwp, 0x95, 0x01, 0x07); /* location: {CR94,0,6} */ ViaCrtcMask(hwp, 0x94, 0x08, 0x7F); /* 32/4 = 8 = 0x08 */ break; case VIA_K8M890: /* Display Queue Depth, location: {CR68,4,7},{CR94,7,7},{CR95,7,7} */ ViaCrtcMask(hwp, 0x68, 0xC0, 0xF0); /* 360/8-1 = 44 = 0x2C; 0x2C << 4 = 0xC0 */ ViaCrtcMask(hwp, 0x94, 0x00, 0x80); /* 0x2C << 3 = 0x00 */ ViaCrtcMask(hwp, 0x95, 0x80, 0x80); /* 0x2C << 2 = 0x80 */ /* Display Queue Read Threshold 1, location: {CR68,0,3},{CR95,4,6} */ ViaCrtcMask(hwp, 0x68, 0x02, 0x0F); /* 328/4 = 82 = 0x52 */ ViaCrtcMask(hwp, 0x95, 0x50, 0x70); /* location: {CR92,0,3},{CR95,0,2} */ ViaCrtcMask(hwp, 0x92, 0x0A, 0x0F); /* 296/4 = 74 = 0x4A */ ViaCrtcMask(hwp, 0x95, 0x04, 0x07); /* 0x4A >> 4 = 0x04 */ /* Display Expire Number Bits, location: {CR94,0,6} */ ViaCrtcMask(hwp, 0x94, 0x1F, 0x7F); /* 124/4 = 31 = 0x1F */ break; case VIA_P4M900: ViaCrtcMask(hwp, 0x68, 0xB0, 0xF0); ViaCrtcMask(hwp, 0x94, 0x00, 0x80); ViaCrtcMask(hwp, 0x95, 0x00, 0x80); ViaCrtcMask(hwp, 0x68, 0x03, 0x0F); ViaCrtcMask(hwp, 0x95, 0x10, 0x70); ViaCrtcMask(hwp, 0x92, 0x03, 0x0F); ViaCrtcMask(hwp, 0x95, 0x01, 0x07); ViaCrtcMask(hwp, 0x94, 0x08, 0x7F); break; case VIA_CX700: ViaCrtcMask(hwp, 0x68, 0xA0, 0xF0); ViaCrtcMask(hwp, 0x94, 0x00, 0x80); ViaCrtcMask(hwp, 0x95, 0x00, 0x80); ViaCrtcMask(hwp, 0x68, 0x04, 0x0F); ViaCrtcMask(hwp, 0x95, 0x10, 0x70); ViaCrtcMask(hwp, 0x92, 0x08, 0x0F); ViaCrtcMask(hwp, 0x95, 0x00, 0x07); if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) ViaCrtcMask(hwp, 0x94, 0x10, 0x7F); else ViaCrtcMask(hwp, 0x94, 0x20, 0x7F); break; case VIA_VX800: /* {CR68,4,7},{CR94,7,7},{CR95,7,7} : 96/8-1 = 0x0B */ ViaCrtcMask(hwp, 0x68, 0xB0, 0xF0); /* ((0x0B & 0x0F) << 4)) = 0xB0 */ ViaCrtcMask(hwp, 0x94, 0x00, 0x80); /* ((0x0B & 0x10) << 3)) = 0x00 */ ViaCrtcMask(hwp, 0x95, 0x00, 0x80); /* {CR68,0,3},{CR95,4,6} : 64/4 = 0x10 */ ViaCrtcMask(hwp, 0x68, 0x04, 0x0F); ViaCrtcMask(hwp, 0x95, 0x10, 0x70); /* {CR92,0,3},{CR95,0,2} : 32/4 = 0x08 */ ViaCrtcMask(hwp, 0x92, 0x08, 0x0F); ViaCrtcMask(hwp, 0x95, 0x00, 0x07); /* {CR94,0,6} : 128/4 = 0x20 */ if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) ViaCrtcMask(hwp, 0x94, 0x10, 0x7F); else ViaCrtcMask(hwp, 0x94, 0x20, 0x7F); break; case VIA_VX855: /* {CR68,4,7},{CR94,7,7},{CR95,7,7} : 200/8-1 = 24 = 0x18 */ ViaCrtcMask(hwp, 0x68, 0x80, 0xF0); /* ((0x18 & 0x0F) << 4)) = 0x80 */ ViaCrtcMask(hwp, 0x94, 0x80, 0x80); /* ((0x18 & 0x10) << 3)) = 0x80 */ ViaCrtcMask(hwp, 0x95, 0x00, 0x80); /* ((0x18 & 0x20) << 2)) = 0x00 */ /* {CR68,0,3},{CR95,4,6} : 160/4 = 0x28 */ ViaCrtcMask(hwp, 0x68, 0x08, 0x0F); /* (0x28 & 0x0F) = 0x08 */ ViaCrtcMask(hwp, 0x95, 0x20, 0x70); /* (0x28 & 0x70) = 0x20 */ /* {CR92,0,3},{CR95,0,2} : 160/4 = 0x28 */ ViaCrtcMask(hwp, 0x92, 0x08, 0x08); /* (0x28 & 0x0F) = 0x08 */ ViaCrtcMask(hwp, 0x95, 0x02, 0x07); /* ((0x28 & 0x70) >> 4)) = 0x02 */ /* {CR94,0,6} : 320/4 = 0x50 */ if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) ViaCrtcMask(hwp, 0x94, 0x08, 0x7F); else ViaCrtcMask(hwp, 0x94, 0x08, 0x7F); break; case VIA_VX900: /* {CR68,4,7},{CR94,7,7},{CR95,7,7} : 192/8-1 = 23 = 0x17 */ ViaCrtcMask(hwp, 0x68, 0x70, 0xF0); /* ((0x17 & 0x0F) << 4)) = 0x70 */ ViaCrtcMask(hwp, 0x94, 0x80, 0x80); /* ((0x17 & 0x10) << 3)) = 0x80 */ ViaCrtcMask(hwp, 0x95, 0x00, 0x80); /* ((0x17 & 0x20) << 2)) = 0x00 */ /* {CR68,0,3},{CR95,4,6} : 160/4 = 0x28 */ ViaCrtcMask(hwp, 0x68, 0x08, 0x0F); /* (0x28 & 0x0F) = 0x08 */ ViaCrtcMask(hwp, 0x95, 0x20, 0x70); /* (0x28 & 0x70) = 0x20 */ /* {CR92,0,3},{CR95,0,2} : 160/4 = 0x28 */ ViaCrtcMask(hwp, 0x92, 0x08, 0x08); /* (0x28 & 0x0F) = 0x08 */ ViaCrtcMask(hwp, 0x95, 0x02, 0x07); /* ((0x28 & 0x70) >> 4)) = 0x2 */ /* {CR94,0,6} : 320/4 = 0x50 */ if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) ViaCrtcMask(hwp, 0x94, 0x08, 0x7F); else ViaCrtcMask(hwp, 0x94, 0x08, 0x7F); break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaSetSecondaryFIFO: " "Chipset %d not implemented\n", pVia->Chipset); break; } } void viaIGA2Save(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIARegPtr Regs = &pVia->SavedReg; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2Save.\n")); vgaHWProtect(pScrn, TRUE); vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_ALL); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Saving IGA2 registers.\n")); /* Unlock extended registers. */ hwp->writeSeq(hwp, 0x10, 0x01); for (i = 0; i < (0x88 - 0x50 + 1); i++) { Regs->CR[i + 0x50] = hwp->readCrtc(hwp, i + 0x50); } for (i = 0; i < (0x92 - 0x8A + 1); i++) { Regs->CR[i + 0x8A] = hwp->readCrtc(hwp, i + 0x8A); } for (i = 0; i < (0xA3 - 0x94 + 1); i++) { Regs->CR[i + 0x94] = hwp->readCrtc(hwp, i + 0x94); } Regs->CR[0xA4] = hwp->readCrtc(hwp, 0xA4); for (i = 0; i < (0xAC - 0xA5 + 1); i++) { Regs->CR[i + 0xA5] = hwp->readCrtc(hwp, i + 0xA5); } /* Chrome 9 */ switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: Regs->CR[0xAF] = hwp->readCrtc(hwp, 0xAF); break; default: break; } /* Chrome 9, Chrome 9 HC, and Chrome 9 HC3 */ switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: case VIA_VX800: for (i = 0; i < (0xCD - 0xB0 + 1); i++) { Regs->CR[i + 0xB0] = hwp->readCrtc(hwp, i + 0xB0); } break; default: break; } switch (pVia->Chipset) { /* UniChrome Pro and UniChrome Pro II */ case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: for (i = 0; i < (0xD7 - 0xD0 + 1); i++) { Regs->CR[i + 0xD0] = hwp->readCrtc(hwp, i + 0xD0); } break; /* Chrome 9 */ case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: for (i = 0; i < (0xEC - 0xD0 + 1); i++) { Regs->CR[i + 0xD0] = hwp->readCrtc(hwp, i + 0xD0); } break; default: break; } /* Chrome 9 */ switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: for (i = 0; i < (0xF5 - 0xF0 + 1); i++) { Regs->CR[i + 0xF0] = hwp->readCrtc(hwp, i + 0xF0); } break; default: break; } /* Chrome 9 HCM and Chrome 9 HD */ if ((pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { for (i = 0; i < (0xFC - 0xF6 + 1); i++) { Regs->CR[i + 0xF6] = hwp->readCrtc(hwp, i + 0xF6); } } /* Chrome 9 HD */ if (pVia->Chipset == VIA_VX900) { Regs->CR[0xFD] = hwp->readCrtc(hwp, 0xFD); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Finished saving IGA2 registers.\n")); vgaHWProtect(pScrn, FALSE); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2Save.\n")); } void viaIGA2Restore(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIARegPtr Regs = &pVia->SavedReg; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaIGA2Restore.\n")); vgaHWProtect(pScrn, TRUE); vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_ALL); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring IGA2 registers.\n")); /* Unlock extended registers. */ hwp->writeSeq(hwp, 0x10, 0x01); for (i = 0; i < (0x5F - 0x50 + 1); i++) { hwp->writeCrtc(hwp, i + 0x50, Regs->CR[i + 0x50]); } for (i = 0; i < (0x69 - 0x62 + 1); i++) { hwp->writeCrtc(hwp, i + 0x62, Regs->CR[i + 0x62]); } hwp->writeCrtc(hwp, 0x6A, Regs->CR[0x6A]); hwp->writeCrtc(hwp, 0x6B, Regs->CR[0x6B]); hwp->writeCrtc(hwp, 0x6C, Regs->CR[0x6C]); for (i = 0; i < (0x88 - 0x6D + 1); i++) { hwp->writeCrtc(hwp, i + 0x6D, Regs->CR[i + 0x6D]); } for (i = 0; i < (0x92 - 0x8A + 1); i++) { hwp->writeCrtc(hwp, i + 0x8A, Regs->CR[i + 0x8A]); } for (i = 0; i < (0xA3 - 0x94 + 1); i++) { hwp->writeCrtc(hwp, i + 0x94, Regs->CR[i + 0x94]); } /* UniChrome Pro and UniChrome Pro II */ switch (pVia->Chipset) { case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: hwp->writeCrtc(hwp, 0xA4, Regs->CR[0xA4]); break; default: break; } for (i = 0; i < (0xAC - 0xA5 + 1); i++) { hwp->writeCrtc(hwp, i + 0xA5, Regs->CR[i + 0xA5]); } /* Chrome 9 */ switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: hwp->writeCrtc(hwp, 0xAF, Regs->CR[0xAF]); break; default: break; } /* Chrome 9, Chrome 9 HC, and Chrome 9 HC3 */ switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: case VIA_VX800: for (i = 0; i < (0xCD - 0xB0 + 1); i++) { hwp->writeCrtc(hwp, i + 0xB0, Regs->CR[i + 0xB0]); } break; default: break; } switch (pVia->Chipset) { /* UniChrome Pro and UniChrome Pro II */ case VIA_PM800: case VIA_K8M800: case VIA_P4M800PRO: case VIA_CX700: case VIA_P4M890: for (i = 0; i < (0xD7 - 0xD0 + 1); i++) { hwp->writeCrtc(hwp, i + 0xD0, Regs->CR[i + 0xD0]); } break; /* Chrome 9 */ case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: for (i = 0; i < (0xEC - 0xD0 + 1); i++) { hwp->writeCrtc(hwp, i + 0xD0, Regs->CR[i + 0xD0]); } break; default: break; } /* Chrome 9 */ switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: for (i = 0; i < (0xF5 - 0xF0 + 1); i++) { hwp->writeCrtc(hwp, i + 0xF0, Regs->CR[i + 0xF0]); } break; default: break; } /* Chrome 9 HCM and Chrome 9 HD */ if ((pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { for (i = 0; i < (0xFC - 0xF6 + 1); i++) { hwp->writeCrtc(hwp, i + 0xF6, Regs->CR[i + 0xF6]); } } /* Chrome 9 HD */ if (pVia->Chipset == VIA_VX900) { hwp->writeCrtc(hwp, 0xFD, Regs->CR[0xFD]); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Finished restoring IGA2 registers.\n")); vgaHWProtect(pScrn, FALSE); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaIGA2Restore.\n")); } /* * Not tested yet */ void ViaShadowCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaShadowCRTCSetMode\n")); vgaHWPtr hwp = VGAHWPTR(pScrn); CARD16 temp; temp = (mode->CrtcHTotal >> 3) - 5; hwp->writeCrtc(hwp, 0x6D, temp & 0xFF); ViaCrtcMask(hwp, 0x71, temp >> 5, 0x08); temp = (mode->CrtcHBlankEnd >> 3) - 1; hwp->writeCrtc(hwp, 0x6E, temp & 0xFF); temp = mode->CrtcVTotal - 2; hwp->writeCrtc(hwp, 0x6F, temp & 0xFF); ViaCrtcMask(hwp, 0x71, temp >> 8, 0x07); temp = mode->CrtcVDisplay - 1; hwp->writeCrtc(hwp, 0x70, temp & 0xFF); ViaCrtcMask(hwp, 0x71, temp >> 4, 0x70); temp = mode->CrtcVBlankStart - 1; hwp->writeCrtc(hwp, 0x72, temp & 0xFF); ViaCrtcMask(hwp, 0x74, temp >> 4, 0x70); temp = mode->CrtcVTotal - 1; hwp->writeCrtc(hwp, 0x73, temp & 0xFF); ViaCrtcMask(hwp, 0x74, temp >> 8, 0x07); ViaCrtcMask(hwp, 0x76, mode->CrtcVSyncEnd, 0x0F); temp = mode->CrtcVSyncStart; hwp->writeCrtc(hwp, 0x75, temp & 0xFF); ViaCrtcMask(hwp, 0x76, temp >> 4, 0x70); } static void iga1_crtc_dpms(xf86CrtcPtr crtc, int mode) { ScrnInfoPtr pScrn = crtc->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga1_crtc_dpms.\n")); switch (mode) { case DPMSModeOn: viaIGA1DPMSControl(pScrn, 0x00); break; case DPMSModeStandby: viaIGA1DPMSControl(pScrn, 0x01); break; case DPMSModeSuspend: viaIGA1DPMSControl(pScrn, 0x02); break; case DPMSModeOff: viaIGA1DPMSControl(pScrn, 0x03); break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid DPMS Mode: %d\n", mode); break; } //vgaHWSaveScreen(pScrn->pScreen, mode); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga1_crtc_dpms.\n")); } static void iga1_crtc_save(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; viaIGA1Save(pScrn); } static void iga1_crtc_restore(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; viaIGA1Restore(pScrn); } static Bool iga1_crtc_lock(xf86CrtcPtr crtc) { return FALSE; } static void iga1_crtc_unlock(xf86CrtcPtr crtc) { } static Bool iga1_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjusted_mode) { ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); CARD32 temp; ModeStatus modestatus; if ((mode->Clock < pScrn->clockRanges->minClock) || (mode->Clock > pScrn->clockRanges->maxClock)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock for mode \"%s\" outside of allowed range (%u (%u - %u))\n", mode->name, mode->Clock, pScrn->clockRanges->minClock, pScrn->clockRanges->maxClock); return FALSE; } modestatus = viaIGA1ModeValid(pScrn, mode); if (modestatus != MODE_OK) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Not using mode \"%s\" : %s.\n", mode->name, xf86ModeStatusToString(modestatus)); return FALSE; } temp = mode->CrtcHDisplay * mode->CrtcVDisplay * mode->VRefresh * (pScrn->bitsPerPixel >> 3); if (pVia->pBIOSInfo->Bandwidth < temp) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Required bandwidth is not available. (%u > %u)\n", (unsigned)temp, (unsigned)pVia->pBIOSInfo->Bandwidth); return FALSE; } if (!pScrn->bitsPerPixel) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Invalid bpp information.\n"); return FALSE; } /* 16 is the Chrome IGP display controller memory alignment. */ if (crtc->x % (16 / ((pScrn->bitsPerPixel + 7) >> 3))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "The X location specified is not properly aligned " "to Chrome IGP's memory alignment.\n"); return FALSE; } return TRUE; } static void iga1_crtc_prepare(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga1_crtc_prepare.\n")); /* Turn off IGA1. */ viaIGA1DPMSControl(pScrn, 0x03); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga1_crtc_prepare.\n")); } static void iga1_crtc_set_origin(xf86CrtcPtr crtc, int x, int y) { ScrnInfoPtr pScrn = crtc->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga1_crtc_set_origin.\n")); viaIGA1SetFBStartingAddress(crtc, x, y); VIAVidAdjustFrame(pScrn, x, y); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga1_crtc_set_origin.\n")); } static void iga1_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjusted_mode, int x, int y) { ScrnInfoPtr pScrn = crtc->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga1_crtc_mode_set.\n")); /* Put IGA1 into a reset state. */ viaIGA1HWReset(pScrn, 0x00); if (!vgaHWInit(pScrn, adjusted_mode)) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "vgaHWInit failed.\n")); goto exit; } viaIGAInitCommon(pScrn); viaIGA1Init(pScrn); /* Disable IGA1 */ ViaSeqMask(hwp, 0x59, 0x00, 0x80); ViaPrintMode(pScrn, adjusted_mode); /* Set color depth. */ viaIGA1SetColorDepth(pScrn, pScrn->bitsPerPixel); /* Set display controller screen parameters. */ viaIGA1SetDisplayRegister(pScrn, adjusted_mode); ViaSetPrimaryFIFO(pScrn, adjusted_mode); pBIOSInfo->Clock = ViaModeDotClockTranslate(pScrn, adjusted_mode); pBIOSInfo->ClockExternal = FALSE; ViaSetPrimaryDotclock(pScrn, pBIOSInfo->Clock); ViaSetUseExternalClock(hwp); ViaCrtcMask(hwp, 0x6B, 0x00, 0x01); /* Enable IGA1 */ ViaSeqMask(hwp, 0x59, 0x80, 0x80); viaIGA1SetFBStartingAddress(crtc, x, y); VIAVidAdjustFrame(pScrn, x, y); exit: /* Put IGA1 back into a normal operating state. */ viaIGA1HWReset(pScrn, 0x01); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga1_crtc_mode_set.\n")); } static void iga1_crtc_commit(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entering iga1_crtc_commit.\n")); if (crtc->scrn->pScreen != NULL && pVia->drmmode.hwcursor) xf86_reload_cursors(crtc->scrn->pScreen); /* Turn on IGA1. */ viaIGA1DPMSControl(pScrn, 0x00); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga1_crtc_commit.\n")); } static void iga1_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue, int size) { ScrnInfoPtr pScrn = crtc->scrn; LOCO colors[size]; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entering iga1_crtc_gamma_set.\n")); for (i = 0; i < size; i++) { colors[i].red = red[i] >> 8; colors[i].green = green[i] >> 8; colors[i].blue = blue[i] >> 8; } /* Set palette LUT to 8-bit mode. */ viaIGA1SetPaletteLUTResolution(pScrn, 0x01); switch (pScrn->bitsPerPixel) { case 8: /* IGA1 will access the palette LUT. */ viaSetPaletteLUTAccess(pScrn, 0x00); VIALoadRgbLut(pScrn, 0, size, colors); /* Turn gamma correction off. */ viaIGA1SetGamma(pScrn, FALSE); break; case 16: /* IGA1 will access the palette LUT. */ viaSetPaletteLUTAccess(pScrn, 0x00); VIALoadRgbLut(pScrn, 0, size, colors); /* Turn gamma correction off. */ viaIGA1SetGamma(pScrn, FALSE); break; case 24: case 32: /* IGA1 will access the palette LUT. */ viaSetPaletteLUTAccess(pScrn, 0x00); VIALoadRgbLut(pScrn, 0, size, colors); /* Turn gamma correction off. */ viaIGA1SetGamma(pScrn, FALSE); break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unsupported color depth: %d\n", pScrn->bitsPerPixel); break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga1_crtc_gamma_set.\n")); } static void * iga1_crtc_shadow_allocate (xf86CrtcPtr crtc, int width, int height) { return NULL; } static PixmapPtr iga1_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height) { return NULL; } static void iga1_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data) { } /* Set the cursor foreground and background colors. In 8bpp, fg and bg are indices into the current colormap unless the HARDWARE_CURSOR_TRUECOLOR_AT_8BPP flag is set. In that case and in all other bpps the fg and bg are in 8-8-8 RGB format. */ static void iga1_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg) { ScrnInfoPtr pScrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); if (xf86_config->cursor_fg) return; /* Don't recolour the image if we don't have to. */ if (fg == xf86_config->cursor_fg && bg == xf86_config->cursor_bg) return; viaIGA1DisplayHI(pScrn, FALSE); xf86_config->cursor_fg = fg; xf86_config->cursor_bg = bg; } static void iga1_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) { ScrnInfoPtr pScrn = crtc->scrn; unsigned xoff, yoff; if (x < 0) { xoff = ((-x) & 0xFE); x = 0; } else { xoff = 0; } if (y < 0) { yoff = ((-y) & 0xFE); y = 0; } else { yoff = 0; } viaIGA1SetHIDisplayLocation(pScrn, x, xoff, y, yoff); } static void iga1_crtc_show_cursor(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; viaIGA1DisplayHI(pScrn, TRUE); } static void iga1_crtc_hide_cursor(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; viaIGA1DisplayHI(pScrn, FALSE); } static void iga1_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) { drmmode_crtc_private_ptr iga = crtc->driver_private; ScrnInfoPtr pScrn = crtc->scrn; void *dst; dst = drm_bo_map(pScrn, iga->cursor_bo); memset(dst, 0x00, iga->cursor_bo->size); memcpy(dst, image, iga->cursor_bo->size); drm_bo_unmap(pScrn, iga->cursor_bo); viaIGA1InitHI(pScrn); viaIGA1SetHIStartingAddress(crtc); } static void iga_crtc_destroy(xf86CrtcPtr crtc) { if (crtc->driver_private) free(crtc->driver_private); } const xf86CrtcFuncsRec iga1_crtc_funcs = { .dpms = iga1_crtc_dpms, .save = iga1_crtc_save, .restore = iga1_crtc_restore, .lock = iga1_crtc_lock, .unlock = iga1_crtc_unlock, .mode_fixup = iga1_crtc_mode_fixup, .prepare = iga1_crtc_prepare, .mode_set = iga1_crtc_mode_set, .commit = iga1_crtc_commit, .gamma_set = iga1_crtc_gamma_set, .shadow_create = iga1_crtc_shadow_create, .shadow_allocate = iga1_crtc_shadow_allocate, .shadow_destroy = iga1_crtc_shadow_destroy, .set_cursor_colors = iga1_crtc_set_cursor_colors, .set_cursor_position = iga1_crtc_set_cursor_position, .show_cursor = iga1_crtc_show_cursor, .hide_cursor = iga1_crtc_hide_cursor, .load_cursor_argb = iga1_crtc_load_cursor_argb, #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) > 2 .set_origin = iga1_crtc_set_origin, #endif .destroy = iga_crtc_destroy, }; static void iga2_crtc_dpms(xf86CrtcPtr crtc, int mode) { ScrnInfoPtr pScrn = crtc->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga2_crtc_dpms.\n")); switch (mode) { case DPMSModeOn: viaIGA2DisplayOutput(pScrn, TRUE); break; case DPMSModeStandby: case DPMSModeSuspend: case DPMSModeOff: viaIGA2DisplayOutput(pScrn, FALSE); break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid DPMS mode: %d\n", mode); break; } //vgaHWSaveScreen(pScrn->pScreen, mode); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga2_crtc_dpms.\n")); } static void iga2_crtc_save(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga2_crtc_save.\n")); viaIGA2Save(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga2_crtc_save.\n")); } static void iga2_crtc_restore(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga2_crtc_restore.\n")); viaIGA2Restore(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga2_crtc_restore.\n")); } static Bool iga2_crtc_lock(xf86CrtcPtr crtc) { return FALSE; } static void iga2_crtc_unlock(xf86CrtcPtr crtc) { } static Bool iga2_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjusted_mode) { ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); CARD32 temp; ModeStatus modestatus; if ((mode->Clock < pScrn->clockRanges->minClock) || (mode->Clock > pScrn->clockRanges->maxClock)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock for mode \"%s\" outside of allowed range (%u (%u - %u))\n", mode->name, mode->Clock, pScrn->clockRanges->minClock, pScrn->clockRanges->maxClock); return FALSE; } modestatus = viaIGA2ModeValid(pScrn, mode); if (modestatus != MODE_OK) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Not using mode \"%s\" : %s.\n", mode->name, xf86ModeStatusToString(modestatus)); return FALSE; } temp = mode->CrtcHDisplay * mode->CrtcVDisplay * mode->VRefresh * (pScrn->bitsPerPixel >> 3); if (pVia->pBIOSInfo->Bandwidth < temp) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Required bandwidth is not available. (%u > %u)\n", (unsigned)temp, (unsigned)pVia->pBIOSInfo->Bandwidth); return FALSE; } if (!pScrn->bitsPerPixel) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Invalid bpp information.\n"); return FALSE; } /* 16 is the Chrome IGP display controller memory alignment. */ if (crtc->x % (16 / ((pScrn->bitsPerPixel + 7) >> 3))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "The X location specified is not properly aligned " "to Chrome IGP's memory alignment.\n"); return FALSE; } return TRUE; } static void iga2_crtc_prepare(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga2_crtc_prepare.\n")); /* Turn off IGA2. */ viaIGA2DisplayOutput(pScrn, FALSE); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga2_crtc_prepare.\n")); } static void iga2_crtc_set_origin(xf86CrtcPtr crtc, int x, int y) { ScrnInfoPtr pScrn = crtc->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga2_crtc_set_origin.\n")); viaIGA2SetFBStartingAddress(crtc, x, y); VIAVidAdjustFrame(pScrn, x, y); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga2_crtc_set_origin.\n")); } static void iga2_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjusted_mode, int x, int y) { ScrnInfoPtr pScrn = crtc->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga2_crtc_mode_set.\n")); /* Put IGA2 into a reset state. */ viaIGA2HWReset(pScrn, 0x00); /* Disable IGA2 display channel. */ viaIGA2DisplayChannel(pScrn, FALSE); viaIGAInitCommon(pScrn); viaIGA2Init(pScrn); ViaPrintMode(pScrn, adjusted_mode); /* Set color depth. */ viaIGA2SetColorDepth(pScrn, pScrn->bitsPerPixel); /* Set display controller screen parameters. */ viaIGA2SetDisplayRegister(pScrn, adjusted_mode); ViaSetSecondaryFIFO(pScrn, adjusted_mode); pBIOSInfo->Clock = ViaModeDotClockTranslate(pScrn, adjusted_mode); pBIOSInfo->ClockExternal = FALSE; ViaSetSecondaryDotclock(pScrn, pBIOSInfo->Clock); ViaSetUseExternalClock(hwp); viaIGA2SetFBStartingAddress(crtc, x, y); VIAVidAdjustFrame(pScrn, x, y); /* Enable IGA2 display channel. */ viaIGA2DisplayChannel(pScrn, TRUE); /* Put IGA2 back into a normal operating state. */ viaIGA2HWReset(pScrn, 0x01); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga2_crtc_mode_set.\n")); } static void iga2_crtc_commit(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entering iga2_crtc_commit.\n")); if (crtc->scrn->pScreen != NULL && pVia->drmmode.hwcursor) xf86_reload_cursors(crtc->scrn->pScreen); /* Turn on IGA2. */ viaIGA2DisplayOutput(pScrn, TRUE); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga2_crtc_commit.\n")); } static void iga2_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue, int size) { ScrnInfoPtr pScrn = crtc->scrn; LOCO colors[size]; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entering iga2_crtc_gamma_set.\n")); for (i = 0; i < size; i++) { colors[i].red = red[i] >> 8; colors[i].green = green[i] >> 8; colors[i].blue = blue[i] >> 8; } /* Set palette LUT to 8-bit mode. */ viaIGA2SetPaletteLUTResolution(pScrn, 0x01); switch (pScrn->bitsPerPixel) { case 8: /* IGA2 will access the palette LUT. */ viaSetPaletteLUTAccess(pScrn, 0x01); VIALoadRgbLut(pScrn, 0, size, colors); /* Turn gamma correction off. */ viaIGA2SetGamma(pScrn, FALSE); break; case 16: /* IGA2 will access the palette LUT. */ viaSetPaletteLUTAccess(pScrn, 0x01); VIALoadRgbLut(pScrn, 0, size, colors); /* Turn gamma correction off. */ viaIGA2SetGamma(pScrn, FALSE); break; case 24: case 32: /* IGA2 will access the palette LUT. */ viaSetPaletteLUTAccess(pScrn, 0x01); VIALoadRgbLut(pScrn, 0, size, colors); /* Turn gamma correction off. */ viaIGA2SetGamma(pScrn, FALSE); break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unsupported color depth: %d\n", pScrn->bitsPerPixel); break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting iga2_crtc_gamma_set.\n")); } static void * iga2_crtc_shadow_allocate (xf86CrtcPtr crtc, int width, int height) { return NULL; } static PixmapPtr iga2_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height) { return NULL; } static void iga2_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data) { } /* Set the cursor foreground and background colors. In 8bpp, fg and bg are indices into the current colormap unless the HARDWARE_CURSOR_TRUECOLOR_AT_8BPP flag is set. In that case and in all other bpps the fg and bg are in 8-8-8 RGB format. */ static void iga2_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg) { drmmode_crtc_private_ptr iga = crtc->driver_private; ScrnInfoPtr pScrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int height = 64, width = 64, i; CARD32 pixel, *dst; if (xf86_config->cursor_fg) return; fg |= 0xff000000; bg |= 0xff000000; /* Don't recolour the image if we don't have to. */ if (fg == xf86_config->cursor_fg && bg == xf86_config->cursor_bg) return; viaIGA2DisplayHI(pScrn, FALSE); dst = drm_bo_map(pScrn, iga->cursor_bo); for (i = 0; i < width * height; i++, dst++) if ((pixel = *dst)) *dst = (pixel == xf86_config->cursor_fg) ? fg : bg; drm_bo_unmap(pScrn, iga->cursor_bo); xf86_config->cursor_fg = fg; xf86_config->cursor_bg = bg; } static void iga2_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) { ScrnInfoPtr pScrn = crtc->scrn; unsigned xoff, yoff; if (x < 0) { xoff = ((-x) & 0xFE); x = 0; } else { xoff = 0; } if (y < 0) { yoff = ((-y) & 0xFE); y = 0; } else { yoff = 0; } viaIGA2SetHIDisplayLocation(pScrn, x, xoff, y, yoff); } static void iga2_crtc_show_cursor(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; viaIGA2DisplayHI(pScrn, TRUE); } static void iga2_crtc_hide_cursor(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; viaIGA2DisplayHI(pScrn, FALSE); } static void iga2_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) { drmmode_crtc_private_ptr iga = crtc->driver_private; ScrnInfoPtr pScrn = crtc->scrn; void *dst; dst = drm_bo_map(pScrn, iga->cursor_bo); memset(dst, 0x00, iga->cursor_bo->size); memcpy(dst, image, iga->cursor_bo->size); drm_bo_unmap(pScrn, iga->cursor_bo); viaIGA2InitHI(pScrn); viaIGA2SetHIStartingAddress(crtc); } const xf86CrtcFuncsRec iga2_crtc_funcs = { .dpms = iga2_crtc_dpms, .save = iga2_crtc_save, .restore = iga2_crtc_restore, .lock = iga2_crtc_lock, .unlock = iga2_crtc_unlock, .mode_fixup = iga2_crtc_mode_fixup, .prepare = iga2_crtc_prepare, .mode_set = iga2_crtc_mode_set, .commit = iga2_crtc_commit, .gamma_set = iga2_crtc_gamma_set, .shadow_create = iga2_crtc_shadow_create, .shadow_allocate = iga2_crtc_shadow_allocate, .shadow_destroy = iga2_crtc_shadow_destroy, .set_cursor_colors = iga2_crtc_set_cursor_colors, .set_cursor_position = iga2_crtc_set_cursor_position, .show_cursor = iga2_crtc_show_cursor, .hide_cursor = iga2_crtc_hide_cursor, .load_cursor_argb = iga2_crtc_load_cursor_argb, #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) > 2 .set_origin = iga2_crtc_set_origin, #endif .destroy = iga_crtc_destroy, }; xf86-video-openchrome-0.6.0/src/via_vt162x.c0000664000175000017500000007660313033607755015365 00000000000000/* * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "via_driver.h" #include "via_vt162x.h" static void ViaSetTVClockSource(xf86CrtcPtr crtc) { drmmode_crtc_private_ptr iga = crtc->driver_private; ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaSetTVClockSource\n")); switch(pBIOSInfo->TVEncoder) { case VIA_VT1625: /* External TV: */ switch(pVia->Chipset) { case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* IGA1 */ if (!iga->index) { /* Fixing it to DVP1 for IGA1. */ ViaCrtcMask(hwp, 0x6C, 0xB0, 0xF0); /* IGA2 */ } else { /* Fixing it to DVP1 for IGA2. */ ViaCrtcMask(hwp, 0x6C, 0x0B, 0x0F); } break; default: if (!iga->index) ViaCrtcMask(hwp, 0x6C, 0x21, 0x21); else ViaCrtcMask(hwp, 0x6C, 0xA1, 0xA1); break; } break; default: if (!iga->index) ViaCrtcMask(hwp, 0x6C, 0x50, 0xF0); else ViaCrtcMask(hwp, 0x6C, 0x05, 0x0F); break; } } static void VT162xPrintRegs(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; CARD8 i, buf; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Printing registers for %s\n", pBIOSInfo->TVI2CDev->DevName); for (i = 0; i < pBIOSInfo->TVNumRegs; i++) { xf86I2CReadByte(pBIOSInfo->TVI2CDev, i, &buf); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV%02X: 0x%02X\n", i, buf); } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "End of TV registers.\n"); } I2CDevPtr ViaVT162xDetect(ScrnInfoPtr pScrn, I2CBusPtr pBus, CARD8 Address) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; I2CDevPtr pDev = xf86CreateI2CDevRec(); CARD8 buf; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaVT162xDetect\n")); pDev->DevName = "VT162x"; pDev->SlaveAddr = Address; pDev->pI2CBus = pBus; if (!xf86I2CDevInit(pDev)) { xf86DestroyI2CDevRec(pDev, TRUE); return NULL; } if (!xf86I2CReadByte(pDev, 0x1B, &buf)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to read from %s Slave %d.\n", pBus->BusName, Address); xf86DestroyI2CDevRec(pDev, TRUE); return NULL; } switch (buf) { case 0x02: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected VIA Technologies VT1621 TV Encoder\n"); pBIOSInfo->TVEncoder = VIA_VT1621; pDev->DevName = "VT1621"; break; case 0x03: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected VIA Technologies VT1622 TV Encoder\n"); pBIOSInfo->TVEncoder = VIA_VT1622; pDev->DevName = "VT1622"; break; case 0x10: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected VIA Technologies VT1622A/VT1623 TV Encoder\n"); pBIOSInfo->TVEncoder = VIA_VT1623; pDev->DevName = "VT1623"; break; case 0x50: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected VIA Technologies VT1625 TV Encoder\n"); pBIOSInfo->TVEncoder = VIA_VT1625; pDev->DevName = "VT1625"; break; default: pBIOSInfo->TVEncoder = VIA_NONETV; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unknown TV Encoder found at %s %X.\n", pBus->BusName, Address); xf86DestroyI2CDevRec(pDev, TRUE); pDev = NULL; break; } return pDev; } static void VT162xSave(ScrnInfoPtr pScrn) { int i; VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT162xSave\n")); for (i = 0; i < pBIOSInfo->TVNumRegs; i++) xf86I2CReadByte(pBIOSInfo->TVI2CDev, i, &(pBIOSInfo->TVRegs[i])); } static void VT162xRestore(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT162xRestore\n")); for (i = 0; i < pBIOSInfo->TVNumRegs; i++) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, pBIOSInfo->TVRegs[i]); } /* * For VT1621 the same as for VT1622/VT1622A/VT1623, but result is different. * Still needs testing on VT1621, of course. */ static CARD8 VT162xDACSenseI2C(I2CDevPtr pDev) { CARD8 save, sense; xf86I2CReadByte(pDev, 0x0E, &save); xf86I2CWriteByte(pDev, 0x0E, 0x00); xf86I2CWriteByte(pDev, 0x0E, 0x80); xf86I2CWriteByte(pDev, 0x0E, 0x00); xf86I2CReadByte(pDev, 0x0F, &sense); xf86I2CWriteByte(pDev, 0x0E, save); return (sense & 0x0F); } /* * VT1625/VT1625S sense connected TV outputs. * * The lower six bits of the return byte stand for each of the six DACs: * - bit 0: DACf (Cb) * - bit 1: DACe (Cr) * - bit 2: DACd (Y) * - bit 3: DACc (Composite) * - bit 4: DACb (S-Video C) * - bit 5: DACa (S-Video Y) * * If a bit is 0 it means a cable is connected. Note the VT1625S only has * four DACs, corresponding to bit 0-3 above. */ static CARD8 VT1625DACSenseI2C(I2CDevPtr pDev) { CARD8 power, status, overflow, dacPresent; xf86I2CReadByte(pDev, 0x0E, &power); // save power state // VT1625S will always report 0 for bits 4 and 5 of the status register as // it only has four DACs instead of six. This will result in a false // positive for the S-Video cable. It will also do this on the power // register, which is abused to check which DACs are actually present. xf86I2CWriteByte(pDev, 0x0E, 0xFF); xf86I2CReadByte(pDev, 0x0E, &dacPresent); xf86I2CWriteByte(pDev, 0x0E, 0x00); // power on DACs/circuits xf86I2CReadByte(pDev, 0x1C, &overflow); // save overflow reg // (DAC sense bit should be off) xf86I2CWriteByte(pDev, 0x1C, 0x80); // enable DAC sense bit xf86I2CWriteByte(pDev, 0x1C, overflow); // disable DAC sense bit xf86I2CReadByte(pDev, 0x0F, &status); // read connection status xf86I2CWriteByte(pDev, 0x0E, power); // restore power state status |= ~dacPresent; return (status & 0x3F); } /* * VT1621 only knows composite and s-video. */ static Bool VT1621DACSense(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; CARD8 sense; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621DACSense\n")); sense = VT162xDACSenseI2C(pBIOSInfo->TVI2CDev); switch (sense) { case 0x00: pBIOSInfo->TVOutput = TVOUTPUT_SC; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1621: S-Video & Composite connected.\n"); return TRUE; case 0x01: pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1621: Composite connected.\n"); return TRUE; case 0x02: pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1621: S-Video connected.\n"); return TRUE; case 0x03: pBIOSInfo->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1621: Nothing connected.\n"); return FALSE; default: pBIOSInfo->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "VT1621: Unknown cable combination: 0x0%2X.\n", sense); return FALSE; } } /* * VT1622, VT1622A and VT1623 know composite, s-video, RGB and YCBCR. */ static Bool VT1622DACSense(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; CARD8 sense; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622DACSense\n")); sense = VT162xDACSenseI2C(pBIOSInfo->TVI2CDev); switch (sense) { case 0x00: /* DAC A,B,C,D */ pBIOSInfo->TVOutput = TVOUTPUT_RGB; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: RGB connected.\n"); return TRUE; case 0x01: /* DAC A,B,C */ pBIOSInfo->TVOutput = TVOUTPUT_SC; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: S-Video & Composite connected.\n"); return TRUE; case 0x07: /* DAC A */ pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: Composite connected.\n"); return TRUE; case 0x08: /* DAC B,C,D */ pBIOSInfo->TVOutput = TVOUTPUT_YCBCR; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: YcBcR connected.\n"); return TRUE; case 0x09: /* DAC B,C */ pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: S-Video connected.\n"); return TRUE; case 0x0F: pBIOSInfo->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: Nothing connected.\n"); return FALSE; default: pBIOSInfo->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "VT162x: Unknown cable combination: 0x0%2X.\n", sense); return FALSE; } } /* * VT1625 knows composite, s-video, RGB and YCBCR. */ static Bool VT1625DACSense(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; CARD8 sense; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1625DACSense\n")); sense = VT1625DACSenseI2C(pBIOSInfo->TVI2CDev); switch (sense) { case 0x00: /* DAC A,B,C,D,E,F */ pBIOSInfo->TVOutput = TVOUTPUT_RGB; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: RGB connected.\n"); return TRUE; case 0x07: /* DAC A,B,C */ pBIOSInfo->TVOutput = TVOUTPUT_SC; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: S-Video & Composite connected.\n"); return TRUE; case 0x37: /* DAC C */ pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: Composite connected.\n"); return TRUE; case 0x38: /* DAC D,E,F */ pBIOSInfo->TVOutput = TVOUTPUT_YCBCR; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: YCbCr connected.\n"); return TRUE; case 0x0F: /* DAC A,B */ pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: S-Video connected.\n"); return TRUE; case 0x3F: pBIOSInfo->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: Nothing connected.\n"); return FALSE; default: pBIOSInfo->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "VT1625: Unknown cable combination: 0x0%2X.\n", sense); return FALSE; } } static CARD8 VT1621ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621ModeIndex\n")); for (i = 0; VT1621Table[i].Width; i++) { if ((VT1621Table[i].Width == mode->CrtcHDisplay) && (VT1621Table[i].Height == mode->CrtcVDisplay) && (VT1621Table[i].Standard == pBIOSInfo->TVType) && !(strcmp(VT1621Table[i].name, mode->name))) return i; } xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "VT1621ModeIndex:" " Mode \"%s\" not found in Table\n", mode->name); return 0xFF; } static ModeStatus VT1621ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621ModeValid\n")); if ((mode->PrivSize != sizeof(struct VT162xModePrivate)) || ((mode->Private != (void *)&VT162xModePrivateNTSC) && (mode->Private != (void *)&VT162xModePrivatePAL))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Not a mode defined by the TV Encoder.\n"); return MODE_BAD; } if ((pBIOSInfo->TVType == TVTYPE_NTSC) && (mode->Private != (void *)&VT162xModePrivateNTSC)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is NTSC. This is a PAL mode.\n"); return MODE_BAD; } else if ((pBIOSInfo->TVType == TVTYPE_PAL) && (mode->Private != (void *)&VT162xModePrivatePAL)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is PAL. This is a NTSC mode.\n"); return MODE_BAD; } if (VT1621ModeIndex(pScrn, mode) != 0xFF) return MODE_OK; return MODE_BAD; } static CARD8 VT1622ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; struct VT162XTableRec *Table; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622ModeIndex\n")); if (pBIOSInfo->TVEncoder == VIA_VT1622) Table = VT1622Table; else if (pBIOSInfo->TVEncoder == VIA_VT1625) Table = VT1625Table; else Table = VT1623Table; for (i = 0; Table[i].Width; i++) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "width=%d:%d, height=%d:%d, std=%d:%d, name=%s:%s.\n", Table[i].Width, mode->CrtcHDisplay, Table[i].Height, mode->CrtcVDisplay, Table[i].Standard, pBIOSInfo->TVType, Table[i].name, mode->name); if ((Table[i].Width == mode->CrtcHDisplay) && (Table[i].Height == mode->CrtcVDisplay) && (Table[i].Standard == pBIOSInfo->TVType) && !strcmp(Table[i].name, mode->name)) return i; } xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "VT1622ModeIndex:" " Mode \"%s\" not found in Table\n", mode->name); return 0xFF; } static ModeStatus VT1622ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622ModeValid\n")); if ((mode->PrivSize != sizeof(struct VT162xModePrivate)) || ((mode->Private != (void *)&VT162xModePrivateNTSC) && (mode->Private != (void *)&VT162xModePrivatePAL))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Not a mode defined by the TV Encoder.\n"); return MODE_BAD; } if ((pBIOSInfo->TVType == TVTYPE_NTSC) && (mode->Private != (void *)&VT162xModePrivateNTSC)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is NTSC. This is a PAL mode.\n"); return MODE_BAD; } else if ((pBIOSInfo->TVType == TVTYPE_PAL) && (mode->Private != (void *)&VT162xModePrivatePAL)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is PAL. This is a NTSC mode.\n"); return MODE_BAD; } if (VT1622ModeIndex(pScrn, mode) != 0xFF) return MODE_OK; return MODE_BAD; } static ModeStatus VT1625ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1625ModeValid\n")); if ((mode->PrivSize != sizeof(struct VT162xModePrivate)) || ((mode->Private != (void *)&VT162xModePrivateNTSC) && (mode->Private != (void *)&VT162xModePrivatePAL) && (mode->Private != (void *)&VT162xModePrivate480P) && (mode->Private != (void *)&VT162xModePrivate576P) && (mode->Private != (void *)&VT162xModePrivate720P) && (mode->Private != (void *)&VT162xModePrivate1080I))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Not a mode defined by the TV Encoder.\n"); return MODE_BAD; } if ((pBIOSInfo->TVType == TVTYPE_NTSC) && (mode->Private != (void *)&VT162xModePrivateNTSC)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is NTSC. This is an incompatible mode.\n"); return MODE_BAD; } else if ((pBIOSInfo->TVType == TVTYPE_PAL) && (mode->Private != (void *)&VT162xModePrivatePAL)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is PAL. This is an incompatible mode.\n"); return MODE_BAD; } else if ((pBIOSInfo->TVType == TVTYPE_480P) && (mode->Private != (void *)&VT162xModePrivate480P)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is 480P. This is an incompatible mode.\n"); return MODE_BAD; } else if ((pBIOSInfo->TVType == TVTYPE_576P) && (mode->Private != (void *)&VT162xModePrivate576P)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is 576P. This is an incompatible mode.\n"); return MODE_BAD; } else if ((pBIOSInfo->TVType == TVTYPE_720P) && (mode->Private != (void *)&VT162xModePrivate720P)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is 720P. This is an incompatible mode.\n"); return MODE_BAD; } else if ((pBIOSInfo->TVType == TVTYPE_1080I) && (mode->Private != (void *)&VT162xModePrivate1080I)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is 1080I. This is an incompatible mode.\n"); return MODE_BAD; } if (VT1622ModeIndex(pScrn, mode) != 0xFF) return MODE_OK; return MODE_BAD; } static void VT162xSetSubCarrier(I2CDevPtr pDev, CARD32 SubCarrier) { xf86I2CWriteByte(pDev, 0x16, SubCarrier & 0xFF); xf86I2CWriteByte(pDev, 0x17, (SubCarrier >> 8) & 0xFF); xf86I2CWriteByte(pDev, 0x18, (SubCarrier >> 16) & 0xFF); xf86I2CWriteByte(pDev, 0x19, (SubCarrier >> 24) & 0xFF); } static void VT1621ModeI2C(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; struct VT1621TableRec Table = VT1621Table[VT1621ModeIndex(pScrn, mode)]; CARD8 i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621ModeI2C\n")); for (i = 0; i < 0x16; i++) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, Table.TV[i]); VT162xSetSubCarrier(pBIOSInfo->TVI2CDev, Table.SubCarrier); /* Skip reserved (1A) and version ID (1B). */ xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1C, Table.TV[0x1C]); /* Skip software reset (1D). */ for (i = 0x1E; i < 0x24; i++) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, Table.TV[i]); /* Write some zeroes? */ xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x24, 0x00); for (i = 0; i < 0x08; i++) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4A + i, 0x00); if (pBIOSInfo->TVOutput == TVOUTPUT_COMPOSITE) for (i = 0; i < 0x10; i++) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x52 + i, Table.TVC[i]); else for (i = 0; i < 0x10; i++) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x52 + i, Table.TVS[i]); /* Turn on all Composite and S-Video output. */ xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x00); if (pBIOSInfo->TVDotCrawl) { if (Table.DotCrawlSubCarrier) { xf86I2CReadByte(pBIOSInfo->TVI2CDev, 0x11, &i); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x11, i | 0x08); VT162xSetSubCarrier(pBIOSInfo->TVI2CDev, Table.DotCrawlSubCarrier); } else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "This mode does not currently " "support DotCrawl suppression.\n"); } } static void VT1621ModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) { ScrnInfoPtr pScrn = crtc->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; struct VT1621TableRec Table = VT1621Table[VT1621ModeIndex(pScrn, mode)]; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621ModeCrtc\n")); if (pVia->IsSecondary) { hwp->writeCrtc(hwp, 0x6A, 0x80); hwp->writeCrtc(hwp, 0x6B, 0x20); hwp->writeCrtc(hwp, 0x6C, 0x80); /* Disable LCD Scaling */ if (!pVia->SAMM || pVia->FirstInit) hwp->writeCrtc(hwp, 0x79, 0x00); } else { hwp->writeCrtc(hwp, 0x6A, 0x00); hwp->writeCrtc(hwp, 0x6B, 0x80); hwp->writeCrtc(hwp, 0x6C, Table.PrimaryCR6C); } pBIOSInfo->ClockExternal = TRUE; ViaCrtcMask(hwp, 0x6A, 0x40, 0x40); ViaCrtcMask(hwp, 0x6C, 0x01, 0x01); } /* * Also suited for VT1622A, VT1623, VT1625. */ static void VT1622ModeI2C(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; struct VT162XTableRec Table; CARD8 save, i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622ModeI2C\n")); if (pBIOSInfo->TVEncoder == VIA_VT1622) Table = VT1622Table[VT1622ModeIndex(pScrn, mode)]; else if (pBIOSInfo->TVEncoder == VIA_VT1625) Table = VT1625Table[VT1622ModeIndex(pScrn, mode)]; else /* VT1622A/VT1623 */ Table = VT1623Table[VT1622ModeIndex(pScrn, mode)]; /* TV reset. */ xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x00); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x80); for (i = 0; i < 0x16; i++) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, Table.TV1[i]); VT162xSetSubCarrier(pBIOSInfo->TVI2CDev, Table.SubCarrier); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1A, Table.TV1[0x1A]); /* Skip version ID. */ xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1C, Table.TV1[0x1C]); /* Skip software reset. */ for (i = 0x1E; i < 0x30; i++) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, Table.TV1[i]); for (i = 0; i < 0x1B; i++) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4A + i, Table.TV2[i]); /* Turn on all Composite and S-Video output. */ xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x00); if (pBIOSInfo->TVDotCrawl) { if (Table.DotCrawlSubCarrier) { xf86I2CReadByte(pBIOSInfo->TVI2CDev, 0x11, &save); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x11, save | 0x08); VT162xSetSubCarrier(pBIOSInfo->TVI2CDev, Table.DotCrawlSubCarrier); } else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "This mode does not currently " "support DotCrawl suppression.\n"); } if (pBIOSInfo->TVOutput == TVOUTPUT_RGB) { xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x2A); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x65, Table.RGB[0]); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x66, Table.RGB[1]); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x67, Table.RGB[2]); if (Table.RGB[3]) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x27, Table.RGB[3]); if (Table.RGB[4]) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x2B, Table.RGB[4]); if (Table.RGB[5]) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x2C, Table.RGB[5]); if (pBIOSInfo->TVEncoder == VIA_VT1625) { if (pBIOSInfo->TVType < TVTYPE_480P) { xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x12); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x23, 0x7E); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4A, 0x85); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4B, 0x0A); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4E, 0x00); } else { xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x12); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4A, 0x85); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4B, 0x0A); } } } else if (pBIOSInfo->TVOutput == TVOUTPUT_YCBCR) { xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x03); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x65, Table.YCbCr[0]); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x66, Table.YCbCr[1]); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x67, Table.YCbCr[2]); if (pBIOSInfo->TVEncoder == VIA_VT1625) { if (pBIOSInfo->TVType < TVTYPE_480P) { xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x23, 0x7E); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4E, 0x00); } } } /* Configure flicker filter. */ xf86I2CReadByte(pBIOSInfo->TVI2CDev, 0x03, &save); save &= 0xFC; if (pBIOSInfo->TVDeflicker == 1) save |= 0x01; else if (pBIOSInfo->TVDeflicker == 2) save |= 0x02; xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x03, save); } /* * Also suited for VT1622A, VT1623, VT1625. */ static void VT1622ModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) { ScrnInfoPtr pScrn = crtc->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; struct VT162XTableRec Table; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622ModeCrtc\n")); if (pBIOSInfo->TVEncoder == VIA_VT1622) Table = VT1622Table[VT1622ModeIndex(pScrn, mode)]; else if (pBIOSInfo->TVEncoder == VIA_VT1625) Table = VT1625Table[VT1622ModeIndex(pScrn, mode)]; else /* VT1622A/VT1623 */ Table = VT1623Table[VT1622ModeIndex(pScrn, mode)]; hwp->writeCrtc(hwp, 0x6A, 0x00); hwp->writeCrtc(hwp, 0x6B, 0x00); hwp->writeCrtc(hwp, 0x6C, 0x00); if (pVia->IsSecondary) { hwp->writeCrtc(hwp, 0x6C, Table.SecondaryCR6C); ViaCrtcMask(hwp, 0x6A, 0x80, 0x80); ViaCrtcMask(hwp, 0x6C, 0x80, 0x80); /* CLE266Ax use 2x XCLK. */ if ((pVia->Chipset == VIA_CLE266) && CLE266_REV_IS_AX(pVia->ChipRev)) { ViaCrtcMask(hwp, 0x6B, 0x20, 0x20); /* Fix TV clock polarity for CLE266A2. */ if (pVia->ChipRev == 0x02) ViaCrtcMask(hwp, 0x6C, 0x1C, 0x1C); } /* Disable LCD scaling. */ if (!pVia->SAMM || pVia->FirstInit) hwp->writeCrtc(hwp, 0x79, 0x00); } else { if ((pVia->Chipset == VIA_CLE266) && CLE266_REV_IS_AX(pVia->ChipRev)) { ViaCrtcMask(hwp, 0x6B, 0x80, 0x80); /* Fix TV clock polarity for CLE266A2. */ if (pVia->ChipRev == 0x02) hwp->writeCrtc(hwp, 0x6C, Table.PrimaryCR6C); } } pBIOSInfo->ClockExternal = TRUE; ViaCrtcMask(hwp, 0x6A, 0x40, 0x40); ViaSetTVClockSource(crtc); } static void VT1621Power(ScrnInfoPtr pScrn, Bool On) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621Power\n")); if (On) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x00); else xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x03); } static void VT1622Power(ScrnInfoPtr pScrn, Bool On) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622Power\n")); if (On) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x00); else xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x0F); } static void VT1625Power(ScrnInfoPtr pScrn, Bool On) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1625Power\n")); if (On) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x00); else xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x3F); } void ViaVT162xInit(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaVT162xInit\n")); switch (pBIOSInfo->TVEncoder) { case VIA_VT1621: pBIOSInfo->TVSave = VT162xSave; pBIOSInfo->TVRestore = VT162xRestore; pBIOSInfo->TVDACSense = VT1621DACSense; pBIOSInfo->TVModeValid = VT1621ModeValid; pBIOSInfo->TVModeI2C = VT1621ModeI2C; pBIOSInfo->TVModeCrtc = VT1621ModeCrtc; pBIOSInfo->TVPower = VT1621Power; pBIOSInfo->TVModes = VT1621Modes; pBIOSInfo->TVNumModes = sizeof(VT1621Modes) / sizeof(DisplayModeRec); pBIOSInfo->TVPrintRegs = VT162xPrintRegs; pBIOSInfo->TVNumRegs = 0x68; break; case VIA_VT1622: pBIOSInfo->TVSave = VT162xSave; pBIOSInfo->TVRestore = VT162xRestore; pBIOSInfo->TVDACSense = VT1622DACSense; pBIOSInfo->TVModeValid = VT1622ModeValid; pBIOSInfo->TVModeI2C = VT1622ModeI2C; pBIOSInfo->TVModeCrtc = VT1622ModeCrtc; pBIOSInfo->TVPower = VT1622Power; pBIOSInfo->TVModes = VT1622Modes; pBIOSInfo->TVNumModes = sizeof(VT1622Modes) / sizeof(DisplayModeRec); pBIOSInfo->TVPrintRegs = VT162xPrintRegs; pBIOSInfo->TVNumRegs = 0x68; break; case VIA_VT1623: pBIOSInfo->TVSave = VT162xSave; pBIOSInfo->TVRestore = VT162xRestore; pBIOSInfo->TVDACSense = VT1622DACSense; pBIOSInfo->TVModeValid = VT1622ModeValid; pBIOSInfo->TVModeI2C = VT1622ModeI2C; pBIOSInfo->TVModeCrtc = VT1622ModeCrtc; pBIOSInfo->TVPower = VT1622Power; pBIOSInfo->TVModes = VT1623Modes; pBIOSInfo->TVNumModes = sizeof(VT1623Modes) / sizeof(DisplayModeRec); pBIOSInfo->TVPrintRegs = VT162xPrintRegs; pBIOSInfo->TVNumRegs = 0x6C; break; case VIA_VT1625: pBIOSInfo->TVSave = VT162xSave; pBIOSInfo->TVRestore = VT162xRestore; pBIOSInfo->TVDACSense = VT1625DACSense; pBIOSInfo->TVModeValid = VT1625ModeValid; pBIOSInfo->TVModeI2C = VT1622ModeI2C; pBIOSInfo->TVModeCrtc = VT1622ModeCrtc; pBIOSInfo->TVPower = VT1625Power; pBIOSInfo->TVModes = VT1625Modes; pBIOSInfo->TVNumModes = sizeof(VT1625Modes) / sizeof(DisplayModeRec); pBIOSInfo->TVPrintRegs = VT162xPrintRegs; pBIOSInfo->TVNumRegs = 0x82; break; default: break; } } xf86-video-openchrome-0.6.0/src/via_3d.h0000664000175000017500000000731512760724526014622 00000000000000/* * Copyright 2006 Thomas Hellstrom. 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 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. */ #ifndef VIA_3D_H #define VIA_3D_H #include "xorg-server.h" #include "xf86.h" #include "via_dmabuffer.h" #define VIA_NUM_TEXUNITS 2 typedef enum { via_single, via_clamp, via_repeat, via_mirror, via_warp } ViaTextureModes; typedef enum { via_src, via_src_onepix_mask, via_src_onepix_comp_mask, via_mask, via_comp_mask } ViaTexBlendingModes; typedef struct _ViaTextureUnit { CARD32 textureLevel0Offset; CARD32 textureLevel0Pitch; CARD32 textureLevel0Exp; CARD32 textureLevel0WExp; CARD32 textureLevel0HExp; CARD32 textureFormat; CARD32 textureModesT; CARD32 textureModesS; CARD32 texCsat; CARD32 texRCa; CARD32 texAsat; CARD32 texRAa; Bool agpTexture; Bool textureDirty; Bool texBColDirty; Bool npot; } ViaTextureUnit; typedef struct _Via3DState { Bool destDirty; Bool blendDirty; Bool enableDirty; Bool drawingDirty; CARD32 rop; CARD32 planeMask; CARD32 solidColor; CARD32 solidAlpha; CARD32 destOffset; CARD32 destPitch; CARD32 destFormat; int destDepth; int numTextures; Bool blend; CARD32 blendCol0; CARD32 blendCol1; CARD32 blendAl0; CARD32 blendAl1; Bool writeAlpha; Bool writeColor; Bool useDestAlpha; ViaTextureUnit tex[VIA_NUM_TEXUNITS]; void (*setDestination) (struct _Via3DState * v3d, CARD32 offset, CARD32 pitch, int format); void (*setDrawing) (struct _Via3DState * v3d, int rop, CARD32 planeMask, CARD32 solidColor, CARD32 solidAlpha); void (*setFlags) (struct _Via3DState * v3d, int numTextures, Bool writeAlpha, Bool writeColor, Bool blend); Bool(*setTexture) (struct _Via3DState * v3d, int tex, CARD32 offset, CARD32 pitch, Bool nPot, CARD32 width, CARD32 height, int format, ViaTextureModes sMode, ViaTextureModes tMode, ViaTexBlendingModes blendingMode, Bool agpTexture); void (*setTexBlendCol) (struct _Via3DState * v3d, int tex, Bool component, CARD32 color); void (*setCompositeOperator) (struct _Via3DState * v3d, CARD8 op); Bool(*opSupported) (CARD8 op); void (*emitQuad) (struct _Via3DState * v3d, ViaCommandBuffer * cb, int dstX, int dstY, int src0X, int src0Y, int src1X, int src1Y, int w, int h); void (*emitState) (struct _Via3DState * v3d, ViaCommandBuffer * cb, Bool forceUpload); void (*emitClipRect) (struct _Via3DState * v3d, ViaCommandBuffer * cb, int x, int y, int w, int h); Bool(*dstSupported) (int format); Bool(*texSupported) (int format); } Via3DState; void viaInit3DState(Via3DState * v3d); #endif xf86-video-openchrome-0.6.0/src/via_vt1632.c0000664000175000017500000003726713054665201015254 00000000000000/* * Copyright 2016 Kevin Brace * Copyright 2016 The OpenChrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 2014 SHS SERVICES GmbH * Copyright 2006-2009 Luc Verhaegen. * * 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 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "via_driver.h" #include "via_vt1632.h" static void viaVT1632DumpRegisters(ScrnInfoPtr pScrn, I2CDevPtr pDev) { int i; CARD8 tmp; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaVT1632DumpRegisters.\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Dumping VT1632(A) registers.\n")); for (i = 0; i <= 0x0f; i++) { xf86I2CReadByte(pDev, i, &tmp); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "0x%02x: 0x%02x\n", i, tmp)); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaVT1632DumpRegisters.\n")); } static void viaVT1632InitRegisters(ScrnInfoPtr pScrn, I2CDevPtr pDev) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaVT1632InitRegisters.\n")); /* For Wyse C00X VX855 chipset DVP1 (Digital Video Port 1), use * 12-bit mode with dual edge transfer, along with rising edge * data capture first mode. This is likely true for CX700, VX700, * VX800, and VX900 chipsets as well. */ xf86I2CWriteByte(pDev, 0x08, VIA_VT1632_VEN | VIA_VT1632_HEN | VIA_VT1632_DSEL | VIA_VT1632_EDGE | VIA_VT1632_PDB); /* Route receiver detect bit (Offset 0x09[2]) as the output of * MSEN pin. */ xf86I2CWriteByte(pDev, 0x09, 0x20); /* Turning on deskew feature caused screen display issues. * This was observed with Wyse C00X. */ xf86I2CWriteByte(pDev, 0x0A, 0x00); /* While VIA Technologies VT1632A datasheet insists on setting this * register to 0x89 as the recommended setting, in practice, this * leads to a blank screen on the display with Wyse C00X. According to * Silicon Image SiI 164 datasheet (VT1632A is a pin and mostly * register compatible chip), offset 0x0C is for PLL filter enable, * PLL filter setting, and continuous SYNC enable bits. All of these are * turned off for proper operation. */ xf86I2CWriteByte(pDev, 0x0C, 0x00); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaVT1632InitRegisters.\n")); } /* * Returns TMDS receiver detection state for VIA Technologies VT1632 * external TMDS transmitter. */ static Bool viaVT1632Sense(ScrnInfoPtr pScrn, I2CDevPtr pDev) { CARD8 tmp; Bool receiverDetected = FALSE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaVT1632Sense.\n")); xf86I2CReadByte(pDev, 0x09, &tmp); if (tmp & 0x04) { receiverDetected = TRUE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1632 %s a TMDS receiver.\n", receiverDetected ? "detected" : "did not detect"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaVT1632Sense.\n")); return receiverDetected; } static void viaVT1632Power(ScrnInfoPtr pScrn, I2CDevPtr pDev, Bool powerState) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaVT1632Power.\n")); xf86I2CMaskByte(pDev, 0x08, powerState ? 0x01 : 0x00, 0x01); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1632 (DVI) Power: %s\n", powerState ? "On" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaVT1632Power.\n")); } static void viaVT1632SaveRegisters(ScrnInfoPtr pScrn, I2CDevPtr pDev, viaVT1632RecPtr pVIAVT1632Rec) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaVT1632SaveRegisters.\n")); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Saving VT1632 registers.\n"); xf86I2CReadByte(pDev, 0x08, &pVIAVT1632Rec->Register08); xf86I2CReadByte(pDev, 0x09, &pVIAVT1632Rec->Register09); xf86I2CReadByte(pDev, 0x0A, &pVIAVT1632Rec->Register0A); xf86I2CReadByte(pDev, 0x0C, &pVIAVT1632Rec->Register0C); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaVT1632SaveRegisters.\n")); } static void viaVT1632RestoreRegisters(ScrnInfoPtr pScrn, I2CDevPtr pDev, viaVT1632RecPtr pVIAVT1632Rec) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaVT1632RestoreRegisters.\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring VT1632 registers.\n")); xf86I2CWriteByte(pDev, 0x08, pVIAVT1632Rec->Register08); xf86I2CWriteByte(pDev, 0x09, pVIAVT1632Rec->Register09); xf86I2CWriteByte(pDev, 0x0A, pVIAVT1632Rec->Register0A); xf86I2CWriteByte(pDev, 0x0C, pVIAVT1632Rec->Register0C); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaVT1632RestoreRegisters.\n")); } static int viaVT1632CheckModeValidity(xf86OutputPtr output, DisplayModePtr pMode) { ScrnInfoPtr pScrn = output->scrn; viaVT1632RecPtr pVIAVT1632Rec = output->driver_private; int status = MODE_OK; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaVT1632CheckModeValidity.\n")); if (pMode->Clock < pVIAVT1632Rec->DotclockMin) { status = MODE_CLOCK_LOW; goto exit; } if (pMode->Clock > pVIAVT1632Rec->DotclockMax) { status = MODE_CLOCK_HIGH; } exit: DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaVT1632CheckModeValidity.\n")); return status; } static void via_vt1632_create_resources(xf86OutputPtr output) { } static void via_vt1632_dpms(xf86OutputPtr output, int mode) { ScrnInfoPtr pScrn = output->scrn; viaVT1632RecPtr pVIAVT1632Rec = output->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_vt1632_dpms.\n")); switch (mode) { case DPMSModeOn: viaVT1632Power(pScrn, pVIAVT1632Rec->VT1632I2CDev, TRUE); break; case DPMSModeStandby: case DPMSModeSuspend: case DPMSModeOff: viaVT1632Power(pScrn, pVIAVT1632Rec->VT1632I2CDev, FALSE); break; default: break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_vt1632_dpms.\n")); } static void via_vt1632_save(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; viaVT1632RecPtr pVIAVT1632Rec = output->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_vt1632_save.\n")); viaVT1632SaveRegisters(pScrn, pVIAVT1632Rec->VT1632I2CDev, pVIAVT1632Rec); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_vt1632_save.\n")); } static void via_vt1632_restore(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; viaVT1632RecPtr pVIAVT1632Rec = output->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_vt1632_restore.\n")); viaVT1632RestoreRegisters(pScrn, pVIAVT1632Rec->VT1632I2CDev, pVIAVT1632Rec); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_vt1632_restore.\n")); } static int via_vt1632_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { return viaVT1632CheckModeValidity(output, pMode); } static Bool via_vt1632_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { return TRUE; } static void via_vt1632_prepare(xf86OutputPtr output) { } static void via_vt1632_commit(xf86OutputPtr output) { } static void via_vt1632_mode_set(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { ScrnInfoPtr pScrn = output->scrn; drmmode_crtc_private_ptr iga = output->crtc->driver_private; viaVT1632RecPtr pVIAVT1632Rec = output->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_vt1632_mode_set.\n")); if (output->crtc) { viaExtTMDSSetClockDriveStrength(pScrn, 0x03); viaExtTMDSSetDataDriveStrength(pScrn, 0x03); viaExtTMDSEnableIOPads(pScrn, 0x03); viaVT1632DumpRegisters(pScrn, pVIAVT1632Rec->VT1632I2CDev); viaVT1632InitRegisters(pScrn, pVIAVT1632Rec->VT1632I2CDev); viaVT1632DumpRegisters(pScrn, pVIAVT1632Rec->VT1632I2CDev); viaExtTMDSSetDisplaySource(pScrn, iga->index ? 0x01 : 0x00); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_vt1632_mode_set.\n")); } static xf86OutputStatus via_vt1632_detect(xf86OutputPtr output) { xf86MonPtr mon; xf86OutputStatus status = XF86OutputStatusDisconnected; ScrnInfoPtr pScrn = output->scrn; viaVT1632RecPtr pVIAVT1632Rec = output->driver_private; /* Check for the DVI presence via VT1632 first before accessing * I2C bus. */ if (viaVT1632Sense(pScrn, pVIAVT1632Rec->VT1632I2CDev)) { /* Since DVI presence was established, access the I2C bus * assigned to DVI. */ mon = xf86OutputGetEDID(output, pVIAVT1632Rec->VT1632I2CDev->pI2CBus); /* Is the interface type digital? */ if (mon && DIGITAL(mon->features.input_type)) { status = XF86OutputStatusConnected; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected a monitor connected to DVI.\n"); xf86OutputSetEDID(output, mon); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Could not obtain EDID from a monitor " "connected to DVI.\n"); } } return status; } #ifdef RANDR_12_INTERFACE static Bool via_vt1632_set_property(xf86OutputPtr output, Atom property, RRPropertyValuePtr value) { return TRUE; } static Bool via_vt1632_get_property(xf86OutputPtr output, Atom property) { return FALSE; } #endif static void via_vt1632_destroy(xf86OutputPtr output) { } const xf86OutputFuncsRec via_vt1632_funcs = { .create_resources = via_vt1632_create_resources, .dpms = via_vt1632_dpms, .save = via_vt1632_save, .restore = via_vt1632_restore, .mode_valid = via_vt1632_mode_valid, .mode_fixup = via_vt1632_mode_fixup, .prepare = via_vt1632_prepare, .commit = via_vt1632_commit, .mode_set = via_vt1632_mode_set, .detect = via_vt1632_detect, .get_modes = xf86OutputGetEDIDModes, #ifdef RANDR_12_INTERFACE .set_property = via_vt1632_set_property, #endif #ifdef RANDR_13_INTERFACE .get_property = via_vt1632_get_property, #endif .destroy = via_vt1632_destroy, }; Bool viaVT1632Init(ScrnInfoPtr pScrn, I2CBusPtr pI2CBus) { xf86OutputPtr output; VIAPtr pVia = VIAPTR(pScrn); viaVT1632RecPtr pVIAVT1632Rec = NULL; I2CDevPtr pI2CDevice = NULL; I2CSlaveAddr i2cAddr = 0x10; CARD8 buf; CARD16 vendorID, deviceID; Bool status = FALSE; char outputNameBuffer[32]; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaVT1632Init.\n")); if (!xf86I2CProbeAddress(pI2CBus, i2cAddr)) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "I2C device not found.\n"); goto exit; } pI2CDevice = xf86CreateI2CDevRec(); if (!pI2CDevice) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to create an I2C bus device record.\n"); goto exit; } pI2CDevice->DevName = "VT1632"; pI2CDevice->SlaveAddr = i2cAddr; pI2CDevice->pI2CBus = pI2CBus; if (!xf86I2CDevInit(pI2CDevice)) { xf86DestroyI2CDevRec(pI2CDevice, TRUE); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize a device on I2C bus.\n"); goto exit; } xf86I2CReadByte(pI2CDevice, 0, &buf); vendorID = buf; xf86I2CReadByte(pI2CDevice, 1, &buf); vendorID |= buf << 8; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Vendor ID: 0x%04x\n", vendorID)); xf86I2CReadByte(pI2CDevice, 2, &buf); deviceID = buf; xf86I2CReadByte(pI2CDevice, 3, &buf); deviceID |= buf << 8; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Device ID: 0x%04x\n", deviceID)); if ((vendorID != 0x1106) || (deviceID != 0x3192)) { xf86DestroyI2CDevRec(pI2CDevice, TRUE); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1632 external TMDS transmitter not detected.\n"); goto exit; } xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1632 external TMDS transmitter detected.\n"); pVIAVT1632Rec = xnfcalloc(1, sizeof(viaVT1632Rec)); if (!pVIAVT1632Rec) { xf86DestroyI2CDevRec(pI2CDevice, TRUE); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate working storage for VT1632.\n"); goto exit; } // Remembering which I2C bus is used for VT1632. pVIAVT1632Rec->VT1632I2CDev = pI2CDevice; xf86I2CReadByte(pI2CDevice, 0x06, &buf); pVIAVT1632Rec->DotclockMin = buf * 1000; xf86I2CReadByte(pI2CDevice, 0x07, &buf); pVIAVT1632Rec->DotclockMax = (buf + 65) * 1000; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Supported VT1632 Dot Clock Range: " "%d to %d MHz\n", pVIAVT1632Rec->DotclockMin / 1000, pVIAVT1632Rec->DotclockMax / 1000); /* The code to dynamically designate the particular DVI (i.e., DVI-1, * DVI-2, etc.) for xrandr was borrowed from xf86-video-r128 DDX. */ sprintf(outputNameBuffer, "DVI-%d", (pVia->numberDVI + 1)); output = xf86OutputCreate(pScrn, &via_vt1632_funcs, outputNameBuffer); if (!output) { free(pVIAVT1632Rec); xf86DestroyI2CDevRec(pI2CDevice, TRUE); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate X Server display output record for " "VT1632.\n"); goto exit; } output->driver_private = pVIAVT1632Rec; /* Since there are two (2) display controllers registered with the * X.Org Server and both IGA1 and IGA2 can handle DVI without any * limitations, possible_crtcs should be set to 0x3 (0b11) so that * either display controller can get assigned to handle DVI. */ output->possible_crtcs = (1 << 1) | (1 << 0); output->possible_clones = 0; output->interlaceAllowed = FALSE; output->doubleScanAllowed = FALSE; viaVT1632DumpRegisters(pScrn, pI2CDevice); pVia->numberDVI++; status = TRUE; exit: DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaVT1632Init.\n")); return status; } xf86-video-openchrome-0.6.0/src/drm_fourcc.h0000664000175000017500000001721212760724526015575 00000000000000/* * Copyright 2011 Intel Corporation * * 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 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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. */ #ifndef DRM_FOURCC_H #define DRM_FOURCC_H #include #define fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \ ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24)) #define DRM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */ /* color index */ #define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ /* 8 bpp RGB */ #define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ #define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ /* 16 bpp RGB */ #define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ #define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ #define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ #define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ #define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ #define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ #define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ #define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ #define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ #define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ #define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ #define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ #define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ #define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ #define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ #define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ #define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ #define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ /* 24 bpp RGB */ #define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ #define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ /* 32 bpp RGB */ #define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ #define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ #define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ #define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ #define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ #define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ #define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ #define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ #define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ #define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ #define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ #define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ #define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ #define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ /* packed YCbCr */ #define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ #define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ #define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ /* * 2 plane YCbCr * index 0 = Y plane, [7:0] Y * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian * or * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian */ #define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ #define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ #define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ #define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ /* * 3 plane YCbCr * index 0: Y plane, [7:0] Y * index 1: Cb plane, [7:0] Cb * index 2: Cr plane, [7:0] Cr * or * index 1: Cr plane, [7:0] Cr * index 2: Cb plane, [7:0] Cb */ #define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ #define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ #define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ #define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ #define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ #define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ #define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ #define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ #define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ #define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ #endif /* DRM_FOURCC_H */ xf86-video-openchrome-0.6.0/src/via_exa_h2.c0000664000175000017500000004271313033607754015453 00000000000000/* * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. * Copyright 2006 Thomas Hellström. 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 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. */ /* * 2D acceleration functions for the VIA/S3G UniChrome IGPs. * * Mostly rewritten, and modified for EXA support, by Thomas Hellström. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "miline.h" #include "via_driver.h" #include "via_regs.h" #include "via_dmabuffer.h" #include "via_rop.h" /* * Emit clipping borders to the command buffer and update the 2D context * current command with clipping info. */ static int viaAccelClippingHelper_H2(VIAPtr pVia, int refY) { ViaTwodContext *tdc = &pVia->td; RING_VARS; if (tdc->clipping) { refY = (refY < tdc->clipY1) ? refY : tdc->clipY1; tdc->cmd |= VIA_GEC_CLIP_ENABLE; BEGIN_RING(4); OUT_RING_H1(VIA_REG_CLIPTL, ((tdc->clipY1 - refY) << 16) | tdc->clipX1); OUT_RING_H1(VIA_REG_CLIPBR, ((tdc->clipY2 - refY) << 16) | tdc->clipX2); } else { tdc->cmd &= ~VIA_GEC_CLIP_ENABLE; } return refY; } /* * Check if we can use a planeMask and update the 2D context accordingly. */ static Bool viaAccelPlaneMaskHelper_H2(ViaTwodContext * tdc, CARD32 planeMask) { CARD32 modeMask = (1 << ((1 << tdc->bytesPPShift) << 3)) - 1; CARD32 curMask = 0x00000000; CARD32 curByteMask; int i; if ((planeMask & modeMask) != modeMask) { /* Masking doesn't work in 8bpp. */ if (modeMask == 0xFF) { tdc->keyControl &= 0x0FFFFFFF; return FALSE; } /* Translate the bit planemask to a byte planemask. */ for (i = 0; i < (1 << tdc->bytesPPShift); ++i) { curByteMask = (0xFF << (i << 3)); if ((planeMask & curByteMask) == 0) { curMask |= (1 << i); } else if ((planeMask & curByteMask) != curByteMask) { tdc->keyControl &= 0x0FFFFFFF; return FALSE; } } ErrorF("DEBUG: planeMask 0x%08x, curMask 0%02x\n", (unsigned)planeMask, (unsigned)curMask); tdc->keyControl = (tdc->keyControl & 0x0FFFFFFF) | (curMask << 28); } return TRUE; } /* * Emit transparency state and color to the command buffer. */ static void viaAccelTransparentHelper_H2(VIAPtr pVia, CARD32 keyControl, CARD32 transColor, Bool usePlaneMask) { ViaTwodContext *tdc = &pVia->td; RING_VARS; tdc->keyControl &= ((usePlaneMask) ? 0xF0000000 : 0x00000000); tdc->keyControl |= (keyControl & 0x0FFFFFFF); BEGIN_RING(4); OUT_RING_H1(VIA_REG_KEYCONTROL, tdc->keyControl); if (keyControl) { OUT_RING_H1(VIA_REG_SRCCOLORKEY, transColor); } } /* * Mark Sync using the 2D blitter for AGP. NoOp for PCI. * In the future one could even launch a NULL PCI DMA command * to have an interrupt generated, provided it is possible to * write to the PCI DMA engines from the AGP command stream. */ int viaAccelMarkSync_H2(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); RING_VARS; ++pVia->curMarker; /* Wrap around without affecting the sign bit. */ pVia->curMarker &= 0x7FFFFFFF; if (pVia->agpDMA) { BEGIN_RING(16); OUT_RING_H1(VIA_REG_KEYCONTROL, 0x00); OUT_RING_H1(VIA_REG_GEMODE, VIA_GEM_32bpp); OUT_RING_H1(VIA_REG_DSTBASE, pVia->markerOffset >> 3); OUT_RING_H1(VIA_REG_PITCH, VIA_PITCH_ENABLE); OUT_RING_H1(VIA_REG_DSTPOS, 0); OUT_RING_H1(VIA_REG_DIMENSION, 0); OUT_RING_H1(VIA_REG_FGCOLOR, pVia->curMarker); OUT_RING_H1(VIA_REG_GECMD, (0xF0 << 24) | VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT); ADVANCE_RING; } return pVia->curMarker; } /* * Exa functions. It is assumed that EXA does not exceed the blitter limits. */ Bool viaExaPrepareSolid_H2(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen); VIAPtr pVia = VIAPTR(pScrn); ViaTwodContext *tdc = &pVia->td; if (exaGetPixmapPitch(pPixmap) & 7) return FALSE; if (!viaAccelSetMode(pPixmap->drawable.depth, tdc)) return FALSE; if (!viaAccelPlaneMaskHelper_H2(tdc, planeMask)) return FALSE; viaAccelTransparentHelper_H2(pVia, 0x0, 0x0, TRUE); tdc->cmd = VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT | VIAACCELPATTERNROP(alu); tdc->fgColor = fg; return TRUE; } void viaExaSolid_H2(PixmapPtr pPixmap, int x1, int y1, int x2, int y2) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen); CARD32 dstOffset = exaGetPixmapOffset(pPixmap); CARD32 dstPitch = exaGetPixmapPitch(pPixmap); int w = x2 - x1, h = y2 - y1; VIAPtr pVia = VIAPTR(pScrn); ViaTwodContext *tdc = &pVia->td; RING_VARS; BEGIN_RING(14); OUT_RING_H1(VIA_REG_GEMODE, tdc->mode); OUT_RING_H1(VIA_REG_DSTBASE, dstOffset >> 3); OUT_RING_H1(VIA_REG_PITCH, VIA_PITCH_ENABLE | (dstPitch >> 3) << 16); OUT_RING_H1(VIA_REG_DSTPOS, (y1 << 16) | (x1 & 0xFFFF)); OUT_RING_H1(VIA_REG_DIMENSION, ((h - 1) << 16) | (w - 1)); OUT_RING_H1(VIA_REG_FGCOLOR, tdc->fgColor); OUT_RING_H1(VIA_REG_GECMD, tdc->cmd); ADVANCE_RING; } void viaExaDoneSolidCopy_H2(PixmapPtr pPixmap) { } Bool viaExaPrepareCopy_H2(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir, int alu, Pixel planeMask) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pDstPixmap->drawable.pScreen); VIAPtr pVia = VIAPTR(pScrn); ViaTwodContext *tdc = &pVia->td; if (pSrcPixmap->drawable.bitsPerPixel != pDstPixmap->drawable.bitsPerPixel) return FALSE; if ((tdc->srcPitch = exaGetPixmapPitch(pSrcPixmap)) & 3) return FALSE; if (exaGetPixmapPitch(pDstPixmap) & 7) return FALSE; tdc->srcOffset = exaGetPixmapOffset(pSrcPixmap); tdc->cmd = VIA_GEC_BLT | VIAACCELCOPYROP(alu); if (xdir < 0) tdc->cmd |= VIA_GEC_DECX; if (ydir < 0) tdc->cmd |= VIA_GEC_DECY; if (!viaAccelSetMode(pDstPixmap->drawable.bitsPerPixel, tdc)) return FALSE; if (!viaAccelPlaneMaskHelper_H2(tdc, planeMask)) return FALSE; viaAccelTransparentHelper_H2(pVia, 0x0, 0x0, TRUE); return TRUE; } void viaExaCopy_H2(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, int width, int height) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pDstPixmap->drawable.pScreen); CARD32 dstOffset = exaGetPixmapOffset(pDstPixmap), val; CARD32 dstPitch = exaGetPixmapPitch(pDstPixmap); VIAPtr pVia = VIAPTR(pScrn); ViaTwodContext *tdc = &pVia->td; if (!width || !height) return; if (tdc->cmd & VIA_GEC_DECY) { srcY += height - 1; dstY += height - 1; } if (tdc->cmd & VIA_GEC_DECX) { srcX += width - 1; dstX += width - 1; } val = VIA_PITCH_ENABLE | (dstPitch >> 3) << 16 | (tdc->srcPitch >> 3); RING_VARS; BEGIN_RING(16); OUT_RING_H1(VIA_REG_GEMODE, tdc->mode); OUT_RING_H1(VIA_REG_SRCBASE, tdc->srcOffset >> 3); OUT_RING_H1(VIA_REG_DSTBASE, dstOffset >> 3); OUT_RING_H1(VIA_REG_PITCH, val); OUT_RING_H1(VIA_REG_SRCPOS, (srcY << 16) | (srcX & 0xFFFF)); OUT_RING_H1(VIA_REG_DSTPOS, (dstY << 16) | (dstX & 0xFFFF)); OUT_RING_H1(VIA_REG_DIMENSION, ((height - 1) << 16) | (width - 1)); OUT_RING_H1(VIA_REG_GECMD, tdc->cmd); ADVANCE_RING; } Bool viaExaCheckComposite_H2(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pDstPicture->pDrawable->pScreen); VIAPtr pVia = VIAPTR(pScrn); Via3DState *v3d = &pVia->v3d; if (!pSrcPicture->pDrawable) return FALSE; /* Reject small composites early. They are done much faster in software. */ if (!pSrcPicture->repeat && pSrcPicture->pDrawable->width * pSrcPicture->pDrawable->height < VIA_MIN_COMPOSITE) return FALSE; if (pMaskPicture && pMaskPicture->pDrawable && !pMaskPicture->repeat && pMaskPicture->pDrawable->width * pMaskPicture->pDrawable->height < VIA_MIN_COMPOSITE) return FALSE; if (pMaskPicture && pMaskPicture->repeat && pMaskPicture->repeatType != RepeatNormal) return FALSE; if (pMaskPicture && pMaskPicture->componentAlpha) { #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Component Alpha operation", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } if (!v3d->opSupported(op)) { #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Operator not supported", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } /* * FIXME: A8 destination formats are currently not supported and do not * seem supported by the hardware, although there are some leftover * register settings apparent in the via_3d_reg.h file. We need to fix this * (if important), by using component ARGB8888 operations with bitmask. */ if (!v3d->dstSupported(pDstPicture->format)) { #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo(" Destination format not supported", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } if (v3d->texSupported(pSrcPicture->format)) { if (pMaskPicture && (PICT_FORMAT_A(pMaskPicture->format) == 0 || !v3d->texSupported(pMaskPicture->format))) { #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Mask format not supported", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } return TRUE; } #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Src format not supported", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } static Bool viaIsAGP(VIAPtr pVia, PixmapPtr pPix, unsigned long *offset) { #ifdef HAVE_DRI unsigned long offs; if (pVia->directRenderingType && !pVia->IsPCI) { offs = ((unsigned long)pPix->devPrivate.ptr - (unsigned long)pVia->agpMappedAddr); if ((offs - pVia->scratchOffset) < pVia->agpSize) { *offset = offs + pVia->agpAddr; return TRUE; } } #endif return FALSE; } static Bool viaExaIsOffscreen(PixmapPtr pPix) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen); VIAPtr pVia = VIAPTR(pScrn); return ((unsigned long)pPix->devPrivate.ptr - (unsigned long) drm_bo_map(pScrn, pVia->drmmode.front_bo)) < pVia->drmmode.front_bo->size; } Bool viaExaPrepareComposite_H2(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst) { CARD32 height, width; ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen); VIAPtr pVia = VIAPTR(pScrn); Via3DState *v3d = &pVia->v3d; int curTex = 0; ViaTexBlendingModes srcMode; Bool isAGP; unsigned long offset; /* Workaround: EXA crash with new libcairo2 on a VIA VX800 (#298) */ /* TODO Add real source only pictures */ if (!pSrc) { ErrorF("pSrc is NULL\n"); return FALSE; } v3d->setDestination(v3d, exaGetPixmapOffset(pDst), exaGetPixmapPitch(pDst), pDstPicture->format); v3d->setCompositeOperator(v3d, op); v3d->setDrawing(v3d, 0x0c, 0xFFFFFFFF, 0x000000FF, 0xFF); viaOrder(pSrc->drawable.width, &width); viaOrder(pSrc->drawable.height, &height); /* * For one-pixel repeat mask pictures we avoid using multitexturing by * modifying the src's texture blending equation and feed the pixel * value as a constant alpha for the src's texture. Multitexturing on the * Unichromes seems somewhat slow, so this speeds up translucent windows. */ srcMode = via_src; pVia->maskP = NULL; if (pMaskPicture && (pMaskPicture->pDrawable->height == 1) && (pMaskPicture->pDrawable->width == 1) && pMaskPicture->repeat && viaExpandablePixel(pMaskPicture->format)) { pVia->maskP = pMask->devPrivate.ptr; pVia->maskFormat = pMaskPicture->format; pVia->componentAlpha = pMaskPicture->componentAlpha; srcMode = ((pMaskPicture->componentAlpha) ? via_src_onepix_comp_mask : via_src_onepix_mask); } /* * One-Pixel repeat src pictures go as solid color instead of textures. * Speeds up window shadows. */ pVia->srcP = NULL; if (pSrcPicture && pSrcPicture->repeat && (pSrcPicture->pDrawable->height == 1) && (pSrcPicture->pDrawable->width == 1) && viaExpandablePixel(pSrcPicture->format)) { pVia->srcP = pSrc->devPrivate.ptr; pVia->srcFormat = pSrcPicture->format; } /* Exa should be smart enough to eliminate this IN operation. */ if (pVia->srcP && pVia->maskP) { ErrorF("Bad one-pixel IN composite operation. " "EXA needs to be smarter.\n"); return FALSE; } if (!pVia->srcP) { offset = exaGetPixmapOffset(pSrc); isAGP = viaIsAGP(pVia, pSrc, &offset); if (!isAGP && !viaExaIsOffscreen(pSrc)) return FALSE; if (!v3d->setTexture(v3d, curTex, offset, exaGetPixmapPitch(pSrc), pVia->nPOT[curTex], 1 << width, 1 << height, pSrcPicture->format, via_repeat, via_repeat, srcMode, isAGP)) { return FALSE; } curTex++; } if (pMaskPicture && !pVia->maskP) { offset = exaGetPixmapOffset(pMask); isAGP = viaIsAGP(pVia, pMask, &offset); if (!isAGP && !viaExaIsOffscreen(pMask)) return FALSE; viaOrder(pMask->drawable.width, &width); viaOrder(pMask->drawable.height, &height); if (!v3d->setTexture(v3d, curTex, offset, exaGetPixmapPitch(pMask), pVia->nPOT[curTex], 1 << width, 1 << height, pMaskPicture->format, via_repeat, via_repeat, ((pMaskPicture->componentAlpha) ? via_comp_mask : via_mask), isAGP)) { return FALSE; } curTex++; } v3d->setFlags(v3d, curTex, FALSE, TRUE, TRUE); v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d)); v3d->emitClipRect(v3d, &pVia->cb, 0, 0, pDst->drawable.width, pDst->drawable.height); return TRUE; } void viaExaComposite_H2(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int width, int height) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen); VIAPtr pVia = VIAPTR(pScrn); Via3DState *v3d = &pVia->v3d; CARD32 col; if (pVia->maskP) { viaPixelARGB8888(pVia->maskFormat, pVia->maskP, &col); v3d->setTexBlendCol(v3d, 0, pVia->componentAlpha, col); } if (pVia->srcP) { viaPixelARGB8888(pVia->srcFormat, pVia->srcP, &col); v3d->setDrawing(v3d, 0x0c, 0xFFFFFFFF, col & 0x00FFFFFF, col >> 24); srcX = maskX; srcY = maskY; } if (pVia->maskP || pVia->srcP) v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d)); v3d->emitQuad(v3d, &pVia->cb, dstX, dstY, srcX, srcY, maskX, maskY, width, height); } void viaAccelTextureBlit(ScrnInfoPtr pScrn, unsigned long srcOffset, unsigned srcPitch, unsigned w, unsigned h, unsigned srcX, unsigned srcY, unsigned srcFormat, unsigned long dstOffset, unsigned dstPitch, unsigned dstX, unsigned dstY, unsigned dstFormat, int rotate) { VIAPtr pVia = VIAPTR(pScrn); CARD32 wOrder, hOrder; Via3DState *v3d = &pVia->v3d; viaOrder(w, &wOrder); viaOrder(h, &hOrder); v3d->setDestination(v3d, dstOffset, dstPitch, dstFormat); v3d->setDrawing(v3d, 0x0c, 0xFFFFFFFF, 0x000000FF, 0x00); v3d->setFlags(v3d, 1, TRUE, TRUE, FALSE); v3d->setTexture(v3d, 0, srcOffset, srcPitch, TRUE, 1 << wOrder, 1 << hOrder, srcFormat, via_single, via_single, via_src, FALSE); v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d)); v3d->emitClipRect(v3d, &pVia->cb, dstX, dstY, w, h); v3d->emitQuad(v3d, &pVia->cb, dstX, dstY, srcX, srcY, 0, 0, w, h); } xf86-video-openchrome-0.6.0/src/version.h0000664000175000017500000000006213057513537015130 00000000000000#define BUILDCOMMENT "(openchrome 0.6.0 release)" xf86-video-openchrome-0.6.0/src/via_exa_h6.c0000664000175000017500000004164113033607754015456 00000000000000/* * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. * Copyright 2006 Thomas Hellström. 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 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. */ /* * 2D acceleration functions for the VIA/S3G UniChrome IGPs. * * Mostly rewritten, and modified for EXA support, by Thomas Hellström. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "miline.h" #include "via_driver.h" #include "via_regs.h" #include "via_dmabuffer.h" #include "via_rop.h" /* * Emit clipping borders to the command buffer and update the 2D context * current command with clipping info. */ static int viaAccelClippingHelper_H6(VIAPtr pVia, int refY) { ViaTwodContext *tdc = &pVia->td; RING_VARS; if (tdc->clipping) { refY = (refY < tdc->clipY1) ? refY : tdc->clipY1; tdc->cmd |= VIA_GEC_CLIP_ENABLE; BEGIN_RING(4); OUT_RING_H1(VIA_REG_CLIPTL_M1, ((tdc->clipY1 - refY) << 16) | tdc->clipX1); OUT_RING_H1(VIA_REG_CLIPBR_M1, ((tdc->clipY2 - refY) << 16) | tdc->clipX2); } else { tdc->cmd &= ~VIA_GEC_CLIP_ENABLE; } return refY; } /* * Check if we can use a planeMask and update the 2D context accordingly. */ static Bool viaAccelPlaneMaskHelper_H6(ViaTwodContext * tdc, CARD32 planeMask) { CARD32 modeMask = (1 << ((1 << tdc->bytesPPShift) << 3)) - 1; CARD32 curMask = 0x00000000; CARD32 curByteMask; int i; if ((planeMask & modeMask) != modeMask) { /* Masking doesn't work in 8bpp. */ if (modeMask == 0xFF) { tdc->keyControl &= 0x0FFFFFFF; return FALSE; } /* Translate the bit planemask to a byte planemask. */ for (i = 0; i < (1 << tdc->bytesPPShift); ++i) { curByteMask = (0xFF << (i << 3)); if ((planeMask & curByteMask) == 0) { curMask |= (1 << i); } else if ((planeMask & curByteMask) != curByteMask) { tdc->keyControl &= 0x0FFFFFFF; return FALSE; } } ErrorF("DEBUG: planeMask 0x%08x, curMask 0%02x\n", (unsigned)planeMask, (unsigned)curMask); tdc->keyControl = (tdc->keyControl & 0x0FFFFFFF) | (curMask << 28); } return TRUE; } /* * Emit transparency state and color to the command buffer. */ static void viaAccelTransparentHelper_H6(VIAPtr pVia, CARD32 keyControl, CARD32 transColor, Bool usePlaneMask) { ViaTwodContext *tdc = &pVia->td; RING_VARS; tdc->keyControl &= ((usePlaneMask) ? 0xF0000000 : 0x00000000); tdc->keyControl |= (keyControl & 0x0FFFFFFF); BEGIN_RING(4); OUT_RING_H1(VIA_REG_KEYCONTROL_M1, tdc->keyControl); if (keyControl) { OUT_RING_H1(VIA_REG_SRCCOLORKEY_M1, transColor); } } /* * Mark Sync using the 2D blitter for AGP. NoOp for PCI. * In the future one could even launch a NULL PCI DMA command * to have an interrupt generated, provided it is possible to * write to the PCI DMA engines from the AGP command stream. */ int viaAccelMarkSync_H6(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); RING_VARS; ++pVia->curMarker; /* Wrap around without affecting the sign bit. */ pVia->curMarker &= 0x7FFFFFFF; if (pVia->agpDMA) { BEGIN_RING(16); OUT_RING_H1(VIA_REG_KEYCONTROL_M1, 0x00); OUT_RING_H1(VIA_REG_GEMODE_M1, VIA_GEM_32bpp); OUT_RING_H1(VIA_REG_DSTBASE_M1, pVia->curMarker >> 3); OUT_RING_H1(VIA_REG_PITCH_M1, 0); OUT_RING_H1(VIA_REG_DSTPOS_M1, 0); OUT_RING_H1(VIA_REG_DIMENSION_M1, 0); OUT_RING_H1(VIA_REG_MONOPATFGC_M1, pVia->curMarker); OUT_RING_H1(VIA_REG_GECMD_M1, (0xF0 << 24) | VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT); ADVANCE_RING; } return pVia->curMarker; } /* * Exa functions. It is assumed that EXA does not exceed the blitter limits. */ Bool viaExaPrepareSolid_H6(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen); VIAPtr pVia = VIAPTR(pScrn); ViaTwodContext *tdc = &pVia->td; if (exaGetPixmapPitch(pPixmap) & 7) return FALSE; if (!viaAccelSetMode(pPixmap->drawable.depth, tdc)) return FALSE; if (!viaAccelPlaneMaskHelper_H6(tdc, planeMask)) return FALSE; viaAccelTransparentHelper_H6(pVia, 0x0, 0x0, TRUE); tdc->cmd = VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT | VIAACCELPATTERNROP(alu); tdc->fgColor = fg; return TRUE; } void viaExaSolid_H6(PixmapPtr pPixmap, int x1, int y1, int x2, int y2) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen); CARD32 dstOffset = exaGetPixmapOffset(pPixmap); CARD32 dstPitch = exaGetPixmapPitch(pPixmap); int w = x2 - x1, h = y2 - y1; VIAPtr pVia = VIAPTR(pScrn); ViaTwodContext *tdc = &pVia->td; RING_VARS; BEGIN_RING(14); OUT_RING_H1(VIA_REG_GEMODE_M1, tdc->mode); OUT_RING_H1(VIA_REG_DSTBASE_M1, dstOffset >> 3); OUT_RING_H1(VIA_REG_PITCH_M1, (dstPitch >> 3) << 16); OUT_RING_H1(VIA_REG_DSTPOS_M1, (y1 << 16) | (x1 & 0xFFFF)); OUT_RING_H1(VIA_REG_DIMENSION_M1, ((h - 1) << 16) | (w - 1)); OUT_RING_H1(VIA_REG_MONOPATFGC_M1, tdc->fgColor); OUT_RING_H1(VIA_REG_GECMD_M1, tdc->cmd); ADVANCE_RING; } void viaExaDoneSolidCopy_H6(PixmapPtr pPixmap) { } Bool viaExaPrepareCopy_H6(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir, int alu, Pixel planeMask) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pDstPixmap->drawable.pScreen); VIAPtr pVia = VIAPTR(pScrn); ViaTwodContext *tdc = &pVia->td; if (pSrcPixmap->drawable.bitsPerPixel != pDstPixmap->drawable.bitsPerPixel) return FALSE; if ((tdc->srcPitch = exaGetPixmapPitch(pSrcPixmap)) & 3) return FALSE; if (exaGetPixmapPitch(pDstPixmap) & 7) return FALSE; tdc->srcOffset = exaGetPixmapOffset(pSrcPixmap); tdc->cmd = VIA_GEC_BLT | VIAACCELCOPYROP(alu); if (xdir < 0) tdc->cmd |= VIA_GEC_DECX; if (ydir < 0) tdc->cmd |= VIA_GEC_DECY; if (!viaAccelSetMode(pDstPixmap->drawable.bitsPerPixel, tdc)) return FALSE; if (!viaAccelPlaneMaskHelper_H6(tdc, planeMask)) return FALSE; viaAccelTransparentHelper_H6(pVia, 0x0, 0x0, TRUE); return TRUE; } void viaExaCopy_H6(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, int width, int height) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pDstPixmap->drawable.pScreen); CARD32 dstOffset = exaGetPixmapOffset(pDstPixmap), val; CARD32 dstPitch = exaGetPixmapPitch(pDstPixmap); VIAPtr pVia = VIAPTR(pScrn); ViaTwodContext *tdc = &pVia->td; if (!width || !height) return; RING_VARS; if (tdc->cmd & VIA_GEC_DECY) { srcY += height - 1; dstY += height - 1; } if (tdc->cmd & VIA_GEC_DECX) { srcX += width - 1; dstX += width - 1; } val = (dstPitch >> 3) << 16 | (tdc->srcPitch >> 3); BEGIN_RING(16); OUT_RING_H1(VIA_REG_GEMODE_M1, tdc->mode); OUT_RING_H1(VIA_REG_SRCBASE_M1, tdc->srcOffset >> 3); OUT_RING_H1(VIA_REG_DSTBASE_M1, dstOffset >> 3); OUT_RING_H1(VIA_REG_PITCH_M1, val); OUT_RING_H1(VIA_REG_SRCPOS_M1, (srcY << 16) | (srcX & 0xFFFF)); OUT_RING_H1(VIA_REG_DSTPOS_M1, (dstY << 16) | (dstX & 0xFFFF)); OUT_RING_H1(VIA_REG_DIMENSION_M1, ((height - 1) << 16) | (width - 1)); OUT_RING_H1(VIA_REG_GECMD_M1, tdc->cmd); ADVANCE_RING; } Bool viaExaCheckComposite_H6(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pDstPicture->pDrawable->pScreen); VIAPtr pVia = VIAPTR(pScrn); Via3DState *v3d = &pVia->v3d; if (!pSrcPicture->pDrawable) { return FALSE; } /* Reject small composites early. They are done much faster in software. */ if (!pSrcPicture->repeat && pSrcPicture->pDrawable->width * pSrcPicture->pDrawable->height < VIA_MIN_COMPOSITE) { #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Source picture too small", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } if (pMaskPicture && pMaskPicture->pDrawable && !pMaskPicture->repeat && pMaskPicture->pDrawable->width * pMaskPicture->pDrawable->height < VIA_MIN_COMPOSITE) { #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Mask picture too small", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } if (pMaskPicture && pMaskPicture->repeat && pMaskPicture->repeatType != RepeatNormal) { #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Repeat is different than normal", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } if (pMaskPicture && pMaskPicture->componentAlpha) { #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Component Alpha operation", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } if (!v3d->opSupported(op)) { #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Operator not supported", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } /* * FIXME: A8 destination formats are currently not supported and do not * seem supported by the hardware, although there are some leftover * register settings apparent in the via_3d_reg.h file. We need to fix this * (if important), by using component ARGB8888 operations with bitmask. */ if (!v3d->dstSupported(pDstPicture->format)) { #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Destination format not supported", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } if (v3d->texSupported(pSrcPicture->format)) { if (pMaskPicture && (PICT_FORMAT_A(pMaskPicture->format) == 0 || !v3d->texSupported(pMaskPicture->format))) { #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Mask format not supported", op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } return TRUE; } #ifdef VIA_DEBUG_COMPOSITE viaExaPrintCompositeInfo("Src format not supported",op, pSrcPicture, pMaskPicture, pDstPicture); #endif return FALSE; } static Bool viaIsAGP(VIAPtr pVia, PixmapPtr pPix, unsigned long *offset) { #ifdef HAVE_DRI unsigned long offs; if (pVia->directRenderingType && !pVia->IsPCI) { offs = ((unsigned long)pPix->devPrivate.ptr - (unsigned long)pVia->agpMappedAddr); if ((offs - pVia->scratchOffset) < pVia->agpSize) { *offset = offs + pVia->agpAddr; return TRUE; } } #endif return FALSE; } static Bool viaExaIsOffscreen(PixmapPtr pPix) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen); VIAPtr pVia = VIAPTR(pScrn); return ((unsigned long)pPix->devPrivate.ptr - (unsigned long) drm_bo_map(pScrn, pVia->drmmode.front_bo)) < pVia->drmmode.front_bo->size; } Bool viaExaPrepareComposite_H6(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst) { CARD32 height, width; ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen); VIAPtr pVia = VIAPTR(pScrn); Via3DState *v3d = &pVia->v3d; int curTex = 0; ViaTexBlendingModes srcMode; Bool isAGP; unsigned long offset; /* Workaround: EXA crash with new libcairo2 on a VIA VX800 (#298) */ /* TODO Add real source only pictures */ if (!pSrc) { ErrorF("pSrc is NULL\n"); return FALSE; } v3d->setDestination(v3d, exaGetPixmapOffset(pDst), exaGetPixmapPitch(pDst), pDstPicture->format); v3d->setCompositeOperator(v3d, op); v3d->setDrawing(v3d, 0x0c, 0xFFFFFFFF, 0x000000FF, 0xFF); viaOrder(pSrc->drawable.width, &width); viaOrder(pSrc->drawable.height, &height); /* * For one-pixel repeat mask pictures we avoid using multitexturing by * modifying the src's texture blending equation and feed the pixel * value as a constant alpha for the src's texture. Multitexturing on the * Unichromes seems somewhat slow, so this speeds up translucent windows. */ srcMode = via_src; pVia->maskP = NULL; if (pMaskPicture && (pMaskPicture->pDrawable->height == 1) && (pMaskPicture->pDrawable->width == 1) && pMaskPicture->repeat && viaExpandablePixel(pMaskPicture->format)) { pVia->maskP = pMask->devPrivate.ptr; pVia->maskFormat = pMaskPicture->format; pVia->componentAlpha = pMaskPicture->componentAlpha; srcMode = ((pMaskPicture->componentAlpha) ? via_src_onepix_comp_mask : via_src_onepix_mask); } /* * One-Pixel repeat src pictures go as solid color instead of textures. * Speeds up window shadows. */ pVia->srcP = NULL; if (pSrcPicture && pSrcPicture->repeat && (pSrcPicture->pDrawable->height == 1) && (pSrcPicture->pDrawable->width == 1) && viaExpandablePixel(pSrcPicture->format)) { pVia->srcP = pSrc->devPrivate.ptr; pVia->srcFormat = pSrcPicture->format; } /* Exa should be smart enough to eliminate this IN operation. */ if (pVia->srcP && pVia->maskP) { ErrorF("Bad one-pixel IN composite operation. " "EXA needs to be smarter.\n"); return FALSE; } if (!pVia->srcP) { offset = exaGetPixmapOffset(pSrc); isAGP = viaIsAGP(pVia, pSrc, &offset); if (!isAGP && !viaExaIsOffscreen(pSrc)) return FALSE; if (!v3d->setTexture(v3d, curTex, offset, exaGetPixmapPitch(pSrc), pVia->nPOT[curTex], 1 << width, 1 << height, pSrcPicture->format, via_repeat, via_repeat, srcMode, isAGP)) { return FALSE; } curTex++; } if (pMaskPicture && !pVia->maskP) { offset = exaGetPixmapOffset(pMask); isAGP = viaIsAGP(pVia, pMask, &offset); if (!isAGP && !viaExaIsOffscreen(pMask)) return FALSE; viaOrder(pMask->drawable.width, &width); viaOrder(pMask->drawable.height, &height); if (!v3d->setTexture(v3d, curTex, offset, exaGetPixmapPitch(pMask), pVia->nPOT[curTex], 1 << width, 1 << height, pMaskPicture->format, via_repeat, via_repeat, ((pMaskPicture->componentAlpha) ? via_comp_mask : via_mask), isAGP)) { return FALSE; } curTex++; } v3d->setFlags(v3d, curTex, FALSE, TRUE, TRUE); v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d)); v3d->emitClipRect(v3d, &pVia->cb, 0, 0, pDst->drawable.width, pDst->drawable.height); return TRUE; } void viaExaComposite_H6(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int width, int height) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen); VIAPtr pVia = VIAPTR(pScrn); Via3DState *v3d = &pVia->v3d; CARD32 col; if (pVia->maskP) { viaPixelARGB8888(pVia->maskFormat, pVia->maskP, &col); v3d->setTexBlendCol(v3d, 0, pVia->componentAlpha, col); } if (pVia->srcP) { viaPixelARGB8888(pVia->srcFormat, pVia->srcP, &col); v3d->setDrawing(v3d, 0x0c, 0xFFFFFFFF, col & 0x00FFFFFF, col >> 24); srcX = maskX; srcY = maskY; } if (pVia->maskP || pVia->srcP) v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d)); v3d->emitQuad(v3d, &pVia->cb, dstX, dstY, srcX, srcY, maskX, maskY, width, height); } xf86-video-openchrome-0.6.0/src/via_tv.c0000664000175000017500000007127713054665201014737 00000000000000/* * Copyright 2005-2016 The OpenChrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ /* * via_tv.c * * Handles the initialization and management of TV output related * resources. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "via_driver.h" #include static void viaTVSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 sr12, sr13, sr5a; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaTVSetDisplaySource.\n")); if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { sr5a = hwp->readSeq(hwp, 0x5A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR5A: 0x%02X\n", sr5a)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 0.\n")); ViaSeqMask(hwp, 0x5A, sr5a & 0xFE, 0x01); } sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); switch (pVia->Chipset) { case VIA_CLE266: /* 3C5.12[5] - FPD18 pin strapping * 0: DIP0 (Digital Interface Port 0) is used by * a TMDS transmitter (DVI) * 1: DIP0 (Digital Interface Port 0) is used by * a TV encoder */ if (sr12 & 0x20) { viaDIP0SetDisplaySource(pScrn, displaySource); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DIP0 was not set up for " "an external TV encoder use.\n"); } break; case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: /* 3C5.13[3] - DVP0D8 pin strapping * 0: AGP pins are used for AGP * 1: AGP pins are used by FPDP * (Flat Panel Display Port) * 3C5.12[6] - DVP0D6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - DVP0D5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder * 3C5.12[4] - DVP0D4 pin strapping * 0: Dual 12-bit FPDP (Flat Panel Display Port) * 1: 24-bit FPDP (Flat Panel Display Port) */ if ((sr12 & 0x40) && (sr12 & 0x20)) { viaDVP0SetDisplaySource(pScrn, displaySource); } else if ((sr13 & 0x08) && (!(sr12 & 0x10))) { viaDFPLowSetDisplaySource(pScrn, displaySource); } else if (sr13 & 0x08) { viaDVP1SetDisplaySource(pScrn, displaySource); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "None of the external ports were set up for " "external TV encoder use.\n"); } break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: /* 3C5.12[6] - FPD6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - FPD5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder * 3C5.12[4] - FPD4 pin strapping * 0: Dual 12-bit FPDP (Flat Panel Display Port) * 1: 24-bit FPDP (Flat Panel Display Port) */ if ((sr12 & 0x40) && (sr12 & 0x20) && (!(sr12 & 0x10))) { viaDVP0SetDisplaySource(pScrn, displaySource); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unrecognized external TV encoder use.\n" "Contact the developer for assistance.\n"); } break; case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* 3C5.13[6] - DVP1 DVP / capture port selection * 0: DVP1 is used as a DVP (Digital Video Port) * 1: DVP1 is used as a capture port */ if (!(sr13 & 0x40)) { viaDVP1SetDisplaySource(pScrn, displaySource); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DVP1 is not set up for external TV " "encoder use.\n"); } break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unrecognized IGP for " "an external TV encoder use.\n"); break; } if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { hwp->writeSeq(hwp, 0x5A, sr5a); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring 3C5.5A[0].\n")); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaTVSetDisplaySource.\n")); } static void viaTVEnableIOPads(ScrnInfoPtr pScrn, CARD8 ioPadState) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 sr12, sr13, sr5a; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaTVEnableIOPads.\n")); if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { sr5a = hwp->readSeq(hwp, 0x5A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR5A: 0x%02X\n", sr5a)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 0.\n")); ViaSeqMask(hwp, 0x5A, sr5a & 0xFE, 0x01); } sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); switch (pVia->Chipset) { case VIA_CLE266: /* 3C5.12[5] - FPD18 pin strapping * 0: DIP0 (Digital Interface Port 0) is used by * a TMDS transmitter (DVI) * 1: DIP0 (Digital Interface Port 0) is used by * a TV encoder */ if (sr12 & 0x20) { viaDIP0EnableIOPads(pScrn, ioPadState); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DIP0 is not set up for " "an external TV encoder use.\n"); } break; case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: /* 3C5.13[3] - DVP0D8 pin strapping * 0: AGP pins are used for AGP * 1: AGP pins are used by FPDP * (Flat Panel Display Port) * 3C5.12[6] - DVP0D6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - DVP0D5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder * 3C5.12[4] - DVP0D4 pin strapping * 0: Dual 12-bit FPDP (Flat Panel Display Port) * 1: 24-bit FPDP (Flat Panel Display Port) */ if ((sr12 & 0x40) && (sr12 & 0x20)) { viaDVP0EnableIOPads(pScrn, ioPadState); } else if ((sr13 & 0x08) && (!(sr12 & 0x10))) { viaDFPLowEnableIOPads(pScrn, ioPadState); } else if (sr13 & 0x08) { viaDVP1EnableIOPads(pScrn, ioPadState); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "None of the external ports were set up for " "external TV encoder use.\n"); } break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: /* 3C5.12[6] - FPD6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - FPD5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder * 3C5.12[4] - FPD4 pin strapping * 0: Dual 12-bit FPDP (Flat Panel Display Port) * 1: 24-bit FPDP (Flat Panel Display Port) */ if ((sr12 & 0x40) && (sr12 & 0x20) && (!(sr12 & 0x10))) { viaDVP0EnableIOPads(pScrn, ioPadState); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unrecognized external TV encoder use.\n" "Contact the developer for assistance.\n"); } break; case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* 3C5.13[6] - DVP1 DVP / capture port selection * 0: DVP1 is used as a DVP (Digital Video Port) * 1: DVP1 is used as a capture port */ if (!(sr13 & 0x40)) { viaDVP1EnableIOPads(pScrn, ioPadState); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DVP1 is not set up for external TV " "encoder use.\n"); } break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unrecognized IGP for " "an external TV encoder use.\n"); break; } if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { hwp->writeSeq(hwp, 0x5A, sr5a); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring 3C5.5A[0].\n")); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaTVEnableIOPads.\n")); } static void viaTVSetClockDriveStrength(ScrnInfoPtr pScrn, CARD8 clockDriveStrength) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 sr12, sr13, sr5a; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaTVSetClockDriveStrength.\n")); if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { sr5a = hwp->readSeq(hwp, 0x5A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR5A: 0x%02X\n", sr5a)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 0.\n")); ViaSeqMask(hwp, 0x5A, sr5a & 0xFE, 0x01); } sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); switch (pVia->Chipset) { case VIA_CLE266: /* 3C5.12[5] - FPD18 pin strapping * 0: DIP0 (Digital Interface Port 0) is used by * a TMDS transmitter (DVI) * 1: DIP0 (Digital Interface Port 0) is used by * a TV encoder */ if (sr12 & 0x20) { viaDIP0SetClockDriveStrength(pScrn, clockDriveStrength); } break; case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: /* 3C5.13[3] - DVP0D8 pin strapping * 0: AGP pins are used for AGP * 1: AGP pins are used by FPDP * (Flat Panel Display Port) * 3C5.12[6] - DVP0D6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - DVP0D5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder * 3C5.12[4] - DVP0D4 pin strapping * 0: Dual 12-bit FPDP (Flat Panel Display Port) * 1: 24-bit FPDP (Flat Panel Display Port) */ if ((sr12 & 0x40) && (sr12 & 0x20)) { viaDVP0SetClockDriveStrength(pScrn, clockDriveStrength); } else if ((sr13 & 0x08) && (!(sr12 & 0x10))) { } else if (sr13 & 0x08) { viaDVP1SetClockDriveStrength(pScrn, clockDriveStrength); } break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: /* 3C5.12[6] - FPD6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - FPD5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder * 3C5.12[4] - FPD4 pin strapping * 0: Dual 12-bit FPDP (Flat Panel Display Port) * 1: 24-bit FPDP (Flat Panel Display Port) */ if ((sr12 & 0x40) && (sr12 & 0x20) && (!(sr12 & 0x10))) { viaDVP0SetClockDriveStrength(pScrn, clockDriveStrength); } break; case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* 3C5.13[6] - DVP1 DVP / capture port selection * 0: DVP1 is used as a DVP (Digital Video Port) * 1: DVP1 is used as a capture port */ if (!(sr13 & 0x40)) { viaDVP1SetClockDriveStrength(pScrn, clockDriveStrength); } break; default: break; } if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { hwp->writeSeq(hwp, 0x5A, sr5a); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring 3C5.5A[0].\n")); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaTVSetClockDriveStrength.\n")); } static void viaTVSetDataDriveStrength(ScrnInfoPtr pScrn, CARD8 dataDriveStrength) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 sr12, sr13, sr5a; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaTVSetDataDriveStrength.\n")); if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { sr5a = hwp->readSeq(hwp, 0x5A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR5A: 0x%02X\n", sr5a)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 0.\n")); ViaSeqMask(hwp, 0x5A, sr5a & 0xFE, 0x01); } sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); switch (pVia->Chipset) { case VIA_CLE266: /* 3C5.12[5] - FPD18 pin strapping * 0: DIP0 (Digital Interface Port 0) is used by * a TMDS transmitter (DVI) * 1: DIP0 (Digital Interface Port 0) is used by * a TV encoder */ if (sr12 & 0x20) { viaDIP0SetDataDriveStrength(pScrn, dataDriveStrength); } break; case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: /* 3C5.13[3] - DVP0D8 pin strapping * 0: AGP pins are used for AGP * 1: AGP pins are used by FPDP * (Flat Panel Display Port) * 3C5.12[6] - DVP0D6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - DVP0D5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder * 3C5.12[4] - DVP0D4 pin strapping * 0: Dual 12-bit FPDP (Flat Panel Display Port) * 1: 24-bit FPDP (Flat Panel Display Port) */ if ((sr12 & 0x40) && (sr12 & 0x20)) { viaDVP0SetDataDriveStrength(pScrn, dataDriveStrength); } else if ((sr13 & 0x08) && (!(sr12 & 0x10))) { } else if (sr13 & 0x08) { viaDVP1SetDataDriveStrength(pScrn, dataDriveStrength); } break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: /* 3C5.12[6] - FPD6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - FPD5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder * 3C5.12[4] - FPD4 pin strapping * 0: Dual 12-bit FPDP (Flat Panel Display Port) * 1: 24-bit FPDP (Flat Panel Display Port) */ if ((sr12 & 0x40) && (sr12 & 0x20) && (!(sr12 & 0x10))) { viaDVP0SetDataDriveStrength(pScrn, dataDriveStrength); } break; case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* 3C5.13[6] - DVP1 DVP / capture port selection * 0: DVP1 is used as a DVP (Digital Video Port) * 1: DVP1 is used as a capture port */ if (!(sr13 & 0x40)) { viaDVP1SetDataDriveStrength(pScrn, dataDriveStrength); } break; default: break; } if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { hwp->writeSeq(hwp, 0x5A, sr5a); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring 3C5.5A[0].\n")); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaTVSetDataDriveStrength.\n")); } static void ViaTVSave(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; if (pBIOSInfo->TVSave) pBIOSInfo->TVSave(pScrn); } static void ViaTVRestore(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; if (pBIOSInfo->TVRestore) pBIOSInfo->TVRestore(pScrn); } static Bool ViaTVDACSense(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; if (pBIOSInfo->TVDACSense) return pBIOSInfo->TVDACSense(pScrn); return FALSE; } static void ViaTVSetMode(xf86CrtcPtr crtc, DisplayModePtr mode) { ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; if (pBIOSInfo->TVModeI2C) pBIOSInfo->TVModeI2C(pScrn, mode); if (pBIOSInfo->TVModeCrtc) pBIOSInfo->TVModeCrtc(crtc, mode); /* TV reset. */ xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x00); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x80); } static void ViaTVPower(ScrnInfoPtr pScrn, Bool On) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; #ifdef HAVE_DEBUG if (On) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaTVPower: On.\n"); else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaTVPower: Off.\n"); #endif if (pBIOSInfo->TVPower) pBIOSInfo->TVPower(pScrn, On); } #ifdef HAVE_DEBUG void ViaTVPrintRegs(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; if (pBIOSInfo->TVPrintRegs) pBIOSInfo->TVPrintRegs(pScrn); } #endif /* HAVE_DEBUG */ static void via_tv_create_resources(xf86OutputPtr output) { } #ifdef RANDR_12_INTERFACE static Bool via_tv_set_property(xf86OutputPtr output, Atom property, RRPropertyValuePtr value) { return TRUE; } static Bool via_tv_get_property(xf86OutputPtr output, Atom property) { return FALSE; } #endif static void via_tv_dpms(xf86OutputPtr output, int mode) { ScrnInfoPtr pScrn = output->scrn; switch (mode) { case DPMSModeOn: ViaTVPower(pScrn, TRUE); break; case DPMSModeStandby: case DPMSModeSuspend: case DPMSModeOff: ViaTVPower(pScrn, FALSE); break; } } static void via_tv_save(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; ViaTVSave(pScrn); } static void via_tv_restore(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; ViaTVRestore(pScrn); } static int via_tv_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { ScrnInfoPtr pScrn = output->scrn; int ret = MODE_OK; if (!ViaModeDotClockTranslate(pScrn, pMode)) return MODE_NOCLOCK; return ret; } static Bool via_tv_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { return TRUE; } static void via_tv_prepare(xf86OutputPtr output) { via_tv_dpms(output, DPMSModeOff); } static void via_tv_commit(xf86OutputPtr output) { via_tv_dpms(output, DPMSModeOn); } static void via_tv_mode_set(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { ScrnInfoPtr pScrn = output->scrn; drmmode_crtc_private_ptr iga = output->crtc->driver_private; VIAPtr pVia = VIAPTR(pScrn); /* TV on FirstCrtc */ if (output->crtc) { viaTVSetDisplaySource(pScrn, iga->index ? 0x01 : 0x00); /* Set I/O pads to automatic on / off mode. */ viaTVEnableIOPads(pScrn, 0x03); viaTVSetClockDriveStrength(pScrn, 0x03); viaTVSetDataDriveStrength(pScrn, 0x03); ViaTVSetMode(output->crtc, adjusted_mode); } pVia->FirstInit = FALSE; } static xf86OutputStatus via_tv_detect(xf86OutputPtr output) { xf86OutputStatus status = XF86OutputStatusDisconnected; ScrnInfoPtr pScrn = output->scrn; if (ViaTVDACSense(pScrn)) status = XF86OutputStatusConnected; return status; } static DisplayModePtr via_tv_get_modes(xf86OutputPtr output) { DisplayModePtr modes = NULL, mode = NULL; ScrnInfoPtr pScrn = output->scrn; VIAPtr pVia = VIAPTR(pScrn); int i; for (i = 0; i < pVia->pBIOSInfo->TVNumModes; i++) { mode = xf86DuplicateMode(&pVia->pBIOSInfo->TVModes[i]); modes = xf86ModesAdd(modes, mode); } return modes; } static void via_tv_destroy(xf86OutputPtr output) { } static const xf86OutputFuncsRec via_tv_funcs = { .create_resources = via_tv_create_resources, #ifdef RANDR_12_INTERFACE .set_property = via_tv_set_property, #endif #ifdef RANDR_13_INTERFACE .get_property = via_tv_get_property, #endif .dpms = via_tv_dpms, .save = via_tv_save, .restore = via_tv_restore, .mode_valid = via_tv_mode_valid, .mode_fixup = via_tv_mode_fixup, .prepare = via_tv_prepare, .commit = via_tv_commit, .mode_set = via_tv_mode_set, .detect = via_tv_detect, .get_modes = via_tv_get_modes, .destroy = via_tv_destroy, }; /* * */ Bool via_tv_init(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; xf86OutputPtr output = NULL; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tv_init.\n")); /* preset some pBIOSInfo TV related values -- move up */ pBIOSInfo->TVEncoder = VIA_NONETV; pBIOSInfo->TVI2CDev = NULL; pBIOSInfo->TVSave = NULL; pBIOSInfo->TVRestore = NULL; pBIOSInfo->TVDACSense = NULL; pBIOSInfo->TVModeValid = NULL; pBIOSInfo->TVModeI2C = NULL; pBIOSInfo->TVModeCrtc = NULL; pBIOSInfo->TVPower = NULL; pBIOSInfo->TVModes = NULL; pBIOSInfo->TVPrintRegs = NULL; pBIOSInfo->LCDPower = NULL; pBIOSInfo->TVNumRegs = 0; /* * On an SK43G (KM400/Ch7011), false positive detections at a VT162x * chip were observed, so try to detect the Ch7011 first. */ if (pVia->pI2CBus2 && xf86I2CProbeAddress(pVia->pI2CBus2, 0xEC)) pBIOSInfo->TVI2CDev = ViaCH7xxxDetect(pScrn, pVia->pI2CBus2, 0xEC); else if (pVia->pI2CBus2 && xf86I2CProbeAddress(pVia->pI2CBus2, 0x40)) pBIOSInfo->TVI2CDev = ViaVT162xDetect(pScrn, pVia->pI2CBus2, 0x40); else if (pVia->pI2CBus3 && xf86I2CProbeAddress(pVia->pI2CBus3, 0x40)) pBIOSInfo->TVI2CDev = ViaVT162xDetect(pScrn, pVia->pI2CBus3, 0x40); else if (pVia->pI2CBus2 && xf86I2CProbeAddress(pVia->pI2CBus2, 0xEA)) pBIOSInfo->TVI2CDev = ViaCH7xxxDetect(pScrn, pVia->pI2CBus2, 0xEA); else if (pVia->pI2CBus3 && xf86I2CProbeAddress(pVia->pI2CBus3, 0xEA)) pBIOSInfo->TVI2CDev = ViaCH7xxxDetect(pScrn, pVia->pI2CBus3, 0xEA); if (!pBIOSInfo->TVI2CDev) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Did not detect a TV encoder.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tv_init.\n")); return FALSE; } switch (pBIOSInfo->TVEncoder) { case VIA_VT1621: case VIA_VT1622: case VIA_VT1623: case VIA_VT1625: ViaVT162xInit(pScrn); break; case VIA_CH7011: case VIA_CH7019A: case VIA_CH7019B: ViaCH7xxxInit(pScrn); break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Was not able to initialize a known TV encoder.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tv_init.\n")); return FALSE; break; } if (!pBIOSInfo->TVSave || !pBIOSInfo->TVRestore || !pBIOSInfo->TVDACSense || !pBIOSInfo->TVModeValid || !pBIOSInfo->TVModeI2C || !pBIOSInfo->TVModeCrtc || !pBIOSInfo->TVPower || !pBIOSInfo->TVModes || !pBIOSInfo->TVPrintRegs) { xf86DestroyI2CDevRec(pBIOSInfo->TVI2CDev, TRUE); pBIOSInfo->TVI2CDev = NULL; pBIOSInfo->TVOutput = TVOUTPUT_NONE; pBIOSInfo->TVEncoder = VIA_NONETV; pBIOSInfo->TVI2CDev = NULL; pBIOSInfo->TVSave = NULL; pBIOSInfo->TVRestore = NULL; pBIOSInfo->TVDACSense = NULL; pBIOSInfo->TVModeValid = NULL; pBIOSInfo->TVModeI2C = NULL; pBIOSInfo->TVModeCrtc = NULL; pBIOSInfo->TVPower = NULL; pBIOSInfo->TVModes = NULL; pBIOSInfo->TVPrintRegs = NULL; pBIOSInfo->TVNumRegs = 0; xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "TV encoder was not properly initialized.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tv_init.\n")); return FALSE; } output = xf86OutputCreate(pScrn, &via_tv_funcs, "TV-1"); pVia->FirstInit = TRUE; if (output) { /* Allow tv output on both crtcs, set bit 0 and 1. */ output->possible_crtcs = 0x3; } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to register TV-1.\n"); } pBIOSInfo->tv = output; /* Save now */ pBIOSInfo->TVSave(pScrn); #ifdef HAVE_DEBUG if (VIAPTR(pScrn)->PrintTVRegs) pBIOSInfo->TVPrintRegs(pScrn); #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tv_init.\n")); return TRUE; } xf86-video-openchrome-0.6.0/src/via_driver.h0000664000175000017500000003761713054472652015614 00000000000000/* * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifndef _VIA_DRIVER_H_ #define _VIA_DRIVER_H_ 1 //#define VIA_DEBUG_COMPOSITE 1 #define HAVE_DEBUG 1 #ifdef HAVE_DEBUG #define DEBUG(x) x #else #define DEBUG(x) #endif #include "vgaHW.h" #include "xf86.h" #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86Resources.h" #endif #include "xf86Pci.h" #include "xf86_OSproc.h" #include "compiler.h" #include "xf86Cursor.h" #include "mipointer.h" #include "micmap.h" #include "fourcc.h" #include "fb.h" #include "xf86Crtc.h" #include "xf86fbman.h" #include "xf86RandR12.h" #include "xf86cmap.h" #ifdef HAVE_DRI #define _XF86DRI_SERVER_ #include "xf86dri.h" #include "sarea.h" #include "dri.h" #include "drm_fourcc.h" #include "GL/glxint.h" #include "via_dri.h" #include "via_drmclient.h" #include "via_drm.h" #endif #include "exa.h" #include "via_memmgr.h" #include "via_regs.h" #include "via_kms.h" #include "via_ums.h" #include "via_dmabuffer.h" #include "via_3d.h" #include "via_xv.h" #include "via_xv_overlay.h" #include "via_eng_regs.h" #ifdef HAVE_PCIACCESS #include #else #include "xf86PciInfo.h" #endif #include #include "via_vt1632.h" #include "compat-api.h" #define VIA_AGP_UPL_SIZE (1024*128) #define VIA_DMA_DL_SIZE (1024*128) #define VIA_SCRATCH_SIZE (4*1024*1024) /* * Pixmap sizes below which we don't try to do hw accel. */ #define VIA_MIN_COMPOSITE 400 #define VIA_MIN_UPLOAD 4000 #define VIA_MIN_TEX_UPLOAD 200 #define VIA_MIN_DOWNLOAD 200 #define AGP_PAGE_SIZE 4096 #define AGP_PAGES 8192 #define AGP_SIZE (AGP_PAGE_SIZE * AGP_PAGES) #define DRIVER_NAME "openchrome" #define VIA_VERSION ((VIA_MAJOR_VERSION << 24) | (VIA_MINOR_VERSION << 16) | VIA_PATCHLEVEL) #define VIA_VQ_SIZE (256 * 1024) #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #define VIA_RES_SHARED RES_SHARED_VGA #define VIA_RES_UNDEF RES_UNDEFINED #else #define VIA_RES_SHARED NULL #define VIA_RES_UNDEF NULL #endif /* Video Engines */ #define VIDEO_ENGINE_UNK 0 /* Unknown video engine */ #define VIDEO_ENGINE_CLE 1 /* CLE First generation video engine */ #define VIDEO_ENGINE_CME 2 /* CME Second generation video engine */ static int gVIAEntityIndex = -1; typedef struct { CARD8 SR[256]; CARD8 CR[256]; } VIARegRec, *VIARegPtr; /* * variables that need to be shared among different screens. */ typedef struct { Bool b3DRegsInitialized; } ViaSharedRec, *ViaSharedPtr; enum dri_type { DRI_NONE, DRI_1, DRI_2 }; #ifdef HAVE_DRI #define VIA_XVMC_MAX_BUFFERS 2 #define VIA_XVMC_MAX_CONTEXTS 4 #define VIA_XVMC_MAX_SURFACES 20 typedef struct { struct buffer_object *memory_ref; unsigned long offsets[VIA_XVMC_MAX_BUFFERS]; } ViaXvMCSurfacePriv; typedef struct { drm_context_t drmCtx; } ViaXvMCContextPriv; typedef struct { XID contexts[VIA_XVMC_MAX_CONTEXTS]; XID surfaces[VIA_XVMC_MAX_SURFACES]; ViaXvMCSurfacePriv *sPrivs[VIA_XVMC_MAX_SURFACES]; ViaXvMCContextPriv *cPrivs[VIA_XVMC_MAX_CONTEXTS]; int nContexts,nSurfaces; drm_handle_t mmioBase,fbBase,sAreaBase; unsigned sAreaSize; drmAddress sAreaAddr; unsigned activePorts; }ViaXvMC, *ViaXvMCPtr; #endif typedef struct _twodContext { CARD32 mode; CARD32 cmd; CARD32 fgColor; CARD32 bgColor; CARD32 pattern0; CARD32 pattern1; CARD32 patternAddr; CARD32 keyControl; unsigned srcOffset; unsigned srcPitch; unsigned Bpp; unsigned bytesPPShift; Bool clipping; Bool dashed; int clipX1; int clipX2; int clipY1; int clipY2; } ViaTwodContext; typedef struct _VIA { VIARegRec SavedReg; int Bpp, Bpl; Bool KMS; Bool FirstInit; unsigned long videoRambytes; int FBFreeStart; int FBFreeEnd; int driSize; int maxDriSize; struct buffer_object *vq_bo; int VQStart; int VQEnd; /* These are physical addresses. */ unsigned long FrameBufferBase; unsigned long MmioBase; /* These are linear addresses. */ unsigned char* MapBase; unsigned char* MpegMapBase; unsigned char* BltBase; unsigned char* MapBaseDense; unsigned char* FBBase; CARD8 MemClk; /* Here are all the Options */ Bool VQEnable; Bool NoAccel; Bool shadowFB; Rotation rotate; int agpMem; CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; #ifdef HAVE_PCIACCESS struct pci_device *PciInfo; #else pciVideoPtr PciInfo; PCITAG PciTag; #endif int Chipset; int ChipId; int ChipRev; int EntityIndex; /* Support for shadowFB and rotation */ unsigned char* ShadowPtr; /* Support for EXA acceleration */ ViaTwodContext td; Via3DState v3d; Via3DState *lastToUpload; ViaCommandBuffer cb; int accelMarker; struct buffer_object *exa_sync_bo; struct buffer_object *exaMem; CARD32 markerOffset; void *markerBuf; CARD32 curMarker; CARD32 lastMarkerRead; Bool agpDMA; Bool nPOT[VIA_NUM_TEXUNITS]; const unsigned *HqvCmeRegs; ExaDriverPtr exaDriverPtr; ExaOffscreenArea *exa_scratch; unsigned int exa_scratch_next; Bool useEXA; void *maskP; CARD32 maskFormat; Bool componentAlpha; void *srcP; CARD32 srcFormat; unsigned scratchOffset; int exaScratchSize; char * scratchAddr; Bool noComposite; struct buffer_object *scratchBuffer; #ifdef HAVE_DRI struct buffer_object *texAGPBuffer; char * dBounce; #endif /* Rotation */ Bool RandRRotation; /* BIOS Info Ptr */ VIABIOSInfoPtr pBIOSInfo; /* VIA Technologies NanoBook reference design. Examples include Everex CloudBook and Sylvania g netbook. It is also called FIC CE260 and CE261 by its ODM (Original Design Manufacturer) name. */ Bool isVIANanoBook; /* OLPC XO-1.5 */ Bool IsOLPCXO15; /* I2C & DDC */ I2CBusPtr pI2CBus1; I2CBusPtr pI2CBus2; I2CBusPtr pI2CBus3; /* MHS */ Bool IsSecondary; Bool HasSecondary; Bool SAMM; drmmode_rec drmmode; enum dri_type directRenderingType; #ifdef HAVE_DRI Bool XvMCEnabled; DRIInfoPtr pDRIInfo; int numVisualConfigs; __GLXvisualConfig* pVisualConfigs; VIAConfigPrivPtr pVisualConfigsPriv; drm_handle_t agpHandle; drm_handle_t registerHandle; drm_handle_t frameBufferHandle; unsigned long agpAddr; drmAddress agpMappedAddr; unsigned int agpSize; Bool IsPCI; ViaXvMC xvmc; int drmVerMajor; int drmVerMinor; int drmVerPL; struct buffer_object *driOffScreenMem; void * driOffScreenSave; #endif Bool DRIIrqEnable; Bool agpEnable; Bool dma2d; Bool dmaXV; /* Video */ int VideoEngine; swovRec swov; CARD32 VideoStatus; VIAHWDiff HWDiff; unsigned long dwV1, dwV3; unsigned long dwFrameNum; CARD32* VidRegBuffer; /* Temporary buffer for video overlay registers. */ unsigned long VidRegCursor; /* Write cursor for VidRegBuffer. */ unsigned long old_dwUseExtendedFIFO; ViaSharedPtr sharedData; Bool useDmaBlit; void *displayMap; CARD32 displayOffset; CARD8 I2CDevices; /* Option */ #ifdef HAVE_DEBUG Bool disableXvBWCheck; Bool DumpVGAROM; Bool PrintVGARegs; Bool PrintTVRegs; Bool I2CScan; #endif /* HAVE_DEBUG */ video_via_regs* VideoRegs; /* Keeping track of the number of analog VGA connectors. */ unsigned int numberVGA; /* Keeping track of the number of DVI connectors. */ unsigned int numberDVI; /* Keeping track of the number of FP (Flat Panel) connectors. */ unsigned int numberFP; /* Shadow copy of CR3B through CR3F. */ CARD8 originalCR3B, originalCR3C, originalCR3D, originalCR3E, originalCR3F; } VIARec, *VIAPtr; #define VIAPTR(p) ((VIAPtr)((p)->driverPrivate)) typedef struct { Bool IsDRIEnabled; Bool HasSecondary; Bool BypassSecondary; /*These two registers are used to make sure the CRTC2 is restored before CRTC_EXT, otherwise it could lead to blank screen.*/ Bool IsSecondaryRestored; Bool RestorePrimary; ScrnInfoPtr pSecondaryScrn; ScrnInfoPtr pPrimaryScrn; } VIAEntRec, *VIAEntPtr; /* In via_display.c. */ const xf86CrtcFuncsRec iga1_crtc_funcs; const xf86CrtcFuncsRec iga2_crtc_funcs; /* In via_exa.c. */ Bool viaInitExa(ScreenPtr pScreen); Bool viaAccelSetMode(int bpp, ViaTwodContext * tdc); void viaAccelSync(ScrnInfoPtr); void viaExitAccel(ScreenPtr); void viaFinishInitAccel(ScreenPtr); Bool viaOrder(CARD32 val, CARD32 * shift); CARD32 viaBitExpandHelper(CARD32 pixel, CARD32 bits); Bool viaCheckUpload(ScrnInfoPtr pScrn, Via3DState * v3d); void viaPixelARGB8888(unsigned format, void *pixelP, CARD32 * argb8888); Bool viaExpandablePixel(int format); void viaAccelFillPixmap(ScrnInfoPtr, unsigned long, unsigned long, int, int, int, int, int, unsigned long); void viaAccelTextureBlit(ScrnInfoPtr, unsigned long, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned long, unsigned, unsigned, unsigned, unsigned, int); #ifdef VIA_DEBUG_COMPOSITE void viaExaCompositePictDesc(PicturePtr pict, char *string, int n); void viaExaPrintCompositeInfo(char *info, CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst); #endif /* In via_exa_h2.c */ Bool viaExaPrepareSolid_H2(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg); void viaExaSolid_H2(PixmapPtr pPixmap, int x1, int y1, int x2, int y2); void viaExaDoneSolidCopy_H2(PixmapPtr pPixmap); Bool viaExaPrepareCopy_H2(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir, int alu, Pixel planeMask); void viaExaCopy_H2(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, int width, int height); Bool viaExaCheckComposite_H2(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture); Bool viaExaPrepareComposite_H2(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst); void viaExaComposite_H2(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int width, int height); int viaAccelMarkSync_H2(ScreenPtr); /* In via_exa_h6.c */ Bool viaExaPrepareSolid_H6(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg); void viaExaSolid_H6(PixmapPtr pPixmap, int x1, int y1, int x2, int y2); void viaExaDoneSolidCopy_H6(PixmapPtr pPixmap); Bool viaExaPrepareCopy_H6(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir, int alu, Pixel planeMask); void viaExaCopy_H6(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, int width, int height); Bool viaExaCheckComposite_H6(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture); Bool viaExaPrepareComposite_H6(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst); void viaExaComposite_H6(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int width, int height); int viaAccelMarkSync_H6(ScreenPtr); /* In via_xv.c */ void viaInitVideo(ScreenPtr pScreen); void viaExitVideo(ScrnInfoPtr pScrn); void viaSaveVideo(ScrnInfoPtr pScrn); void viaRestoreVideo(ScrnInfoPtr pScrn); void viaSetColorSpace(VIAPtr pVia, int hue, int saturation, int brightness, int contrast, Bool reset); /* In via_xv.c */ void viaInitVideo(ScreenPtr pScreen); void viaExitVideo(ScrnInfoPtr pScrn); void viaSaveVideo(ScrnInfoPtr pScrn); void viaRestoreVideo(ScrnInfoPtr pScrn); void viaSetColorSpace(VIAPtr pVia, int hue, int saturation, int brightness, int contrast, Bool reset); void VIAVidAdjustFrame(ScrnInfoPtr pScrn, int x, int y); /* In via_memcpy.c */ typedef void (*vidCopyFunc)(unsigned char *, const unsigned char *, int, int, int, int); extern vidCopyFunc viaVidCopyInit( char *copyType, ScreenPtr pScreen ); /* In via_xwmc.c */ #ifdef HAVE_DRI /* Basic init and exit functions */ void ViaInitXVMC(ScreenPtr pScreen); void ViaCleanupXVMC(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr *XvAdaptors, int XvAdaptorCount); int viaXvMCInitXv(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr XvAdapt); /* Returns the size of the fake Xv Image used as XvMC command buffer to the X server*/ unsigned long viaXvMCPutImageSize(ScrnInfoPtr pScrn); #endif /* via_i2c.c */ void ViaI2CInit(ScrnInfoPtr pScrn); Bool xf86I2CMaskByte(I2CDevPtr d, I2CByte subaddr, I2CByte value, I2CByte mask); #ifdef HAVE_DRI Bool VIADRI1ScreenInit(ScreenPtr pScreen); void VIADRICloseScreen(ScreenPtr pScreen); Bool VIADRIFinishScreenInit(ScreenPtr pScreen); void VIADRIRingBufferCleanup(ScrnInfoPtr pScrn); Bool VIADRIRingBufferInit(ScrnInfoPtr pScrn); void viaDRIOffscreenRestore(ScrnInfoPtr pScrn); void viaDRIOffscreenSave(ScrnInfoPtr pScrn); Bool VIADRIBufferInit(ScrnInfoPtr pScrn); #endif /* HAVE_DRI */ int viaOffScreenLinear(struct buffer_object *obj, ScrnInfoPtr pScrn, unsigned long size); void viaShowCursor(ScrnInfoPtr pScrn); void viaHideCursor(ScrnInfoPtr pScrn); Bool viaHWCursorInit(ScreenPtr pScreen); void ViaDisplaySetStreamOnCRT(ScrnInfoPtr pScrn, Bool primary); void ViaDisplaySetStreamOnDFP(ScrnInfoPtr pScrn, Bool primary); #endif /* _VIA_DRIVER_H_ */ xf86-video-openchrome-0.6.0/src/via_xvmc.h0000664000175000017500000000562112760724526015267 00000000000000/***************************************************************************** * VIA Unichrome XvMC extension X server driver. * * Copyright (c) 2004 The Unichrome project. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHOR(S) OR COPYRIGHT HOLDER(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. * */ #ifndef _VIA_XVMC_H #define _VIA_XVMC_H 1 #include "via_drmclient.h" #include "via_drm.h" /* * This file contains the common definitions between the XvMC lib and the * X server side. It is referenced also by the XvMC lib. Make sure any * structure change is reflected also in a change in minor version number!! */ #define VIAXVMC_MAJOR 0 #define VIAXVMC_MINOR 10 #define VIAXVMC_PL 0 #define VIA_NUM_XVMC_ATTRIBUTES 6 #define VIA_XVMC_VALID 0x80000000 /* * Commands that client submits through XvPutImage: */ #define VIA_XVMC_COMMAND_FDISPLAY 0 #define VIA_XVMC_COMMAND_DISPLAY 1 #define VIA_XVMC_COMMAND_UNDISPLAY 2 #define VIA_XVMC_COMMAND_ATTRIBUTES 3 typedef drm_via_sarea_t ViaXvMCSAreaPriv; typedef struct { INT32 attribute; INT32 value; } ViaAttrPair; typedef struct { unsigned numAttr; ViaAttrPair attributes[VIA_NUM_XVMC_ATTRIBUTES]; } ViaXvMCAttrHolder; /* * Passed from client to X server during overlay updates. */ typedef struct { unsigned command; unsigned ctxNo; unsigned srfNo; unsigned subPicNo; ViaXvMCAttrHolder attrib; unsigned pad; } ViaXvMCCommandBuffer; /* * Passed from X server to client at context creation. */ typedef struct { unsigned int ctxNo; unsigned int major, minor, pl; unsigned xvmc_port; unsigned int fbOffset; unsigned int fbSize; unsigned int mmioOffset; unsigned int mmioSize; unsigned int sAreaSize; unsigned int sAreaPrivOffset; ViaXvMCAttrHolder initAttrs; int useAGP; unsigned int chipId; unsigned int screen; unsigned int depth; unsigned int stride; unsigned int pad; } ViaXvMCCreateContextRec; #endif xf86-video-openchrome-0.6.0/src/via_vgahw.c0000664000175000017500000001121713033607755015415 00000000000000/* * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * * 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 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. */ /* * Wrappers around xf86 vgaHW functions. * And some generic IO calls lacking in the current vgaHW implementation. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "compiler.h" #include "xf86.h" #include "via_driver.h" /* for HAVE_DEBUG */ #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12 #define PIOOFFSET hwp->PIOOffset #else #define PIOOFFSET 0 #endif CARD8 ViaVgahwIn(vgaHWPtr hwp, int address) { if (hwp->MMIOBase) return MMIO_IN8(hwp->MMIOBase, hwp->MMIOOffset + address); else return inb(PIOOFFSET + address); } static void ViaVgahwOut(vgaHWPtr hwp, int address, CARD8 value) { if (hwp->MMIOBase) MMIO_OUT8(hwp->MMIOBase, hwp->MMIOOffset + address, value); else outb(PIOOFFSET + address, value); } /* * An indexed read. */ static CARD8 ViaVgahwRead(vgaHWPtr hwp, int indexaddress, CARD8 index, int valueaddress) { ViaVgahwOut(hwp, indexaddress, index); return ViaVgahwIn(hwp, valueaddress); } /* * An indexed write. */ void ViaVgahwWrite(vgaHWPtr hwp, int indexaddress, CARD8 index, int valueaddress, CARD8 value) { ViaVgahwOut(hwp, indexaddress, index); ViaVgahwOut(hwp, valueaddress, value); } void ViaVgahwMask(vgaHWPtr hwp, int indexaddress, CARD8 index, int valueaddress, CARD8 value, CARD8 mask) { CARD8 tmp; tmp = ViaVgahwRead(hwp, indexaddress, index, valueaddress); tmp &= ~mask; tmp |= (value & mask); ViaVgahwWrite(hwp, indexaddress, index, valueaddress, tmp); } void ViaCrtcMask(vgaHWPtr hwp, CARD8 index, CARD8 value, CARD8 mask) { CARD8 tmp; tmp = hwp->readCrtc(hwp, index); tmp &= ~mask; tmp |= (value & mask); hwp->writeCrtc(hwp, index, tmp); } void ViaSeqMask(vgaHWPtr hwp, CARD8 index, CARD8 value, CARD8 mask) { CARD8 tmp; tmp = hwp->readSeq(hwp, index); tmp &= ~mask; tmp |= (value & mask); hwp->writeSeq(hwp, index, tmp); } void ViaGrMask(vgaHWPtr hwp, CARD8 index, CARD8 value, CARD8 mask) { CARD8 tmp; tmp = hwp->readGr(hwp, index); tmp &= ~mask; tmp |= (value & mask); hwp->writeGr(hwp, index, tmp); } #ifdef HAVE_DEBUG void ViaVgahwPrint(vgaHWPtr hwp) { int i; if (!hwp) return; xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "VGA Sequence registers:\n"); for (i = 0x00; i < 0x80; i++) xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "SR%02X: 0x%02X\n", i, hwp->readSeq(hwp, i)); xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "VGA CRTM/C registers:\n"); for (i = 0x00; i < 0x19; i++) xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "CR%02X: 0x%02X\n", i, hwp->readCrtc(hwp, i)); for (i = 0x33; i < 0xA3; i++) xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "CR%02X: 0x%02X\n", i, hwp->readCrtc(hwp, i)); xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "VGA Graphics registers:\n"); for (i = 0x00; i < 0x08; i++) xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "GR%02X: 0x%02X\n", i, hwp->readGr(hwp, i)); xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "VGA Attribute registers:\n"); for (i = 0x00; i < 0x14; i++) xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "AR%02X: 0x%02X\n", i, hwp->readAttr(hwp, i)); xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "VGA Miscellaneous register:\n"); xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "Misc: 0x%02X\n", hwp->readMiscOut(hwp)); xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "End of VGA registers.\n"); } #endif /* HAVE_DEBUG */ xf86-video-openchrome-0.6.0/src/via_fp.c0000664000175000017500000013710613055134752014710 00000000000000/* * Copyright 2007-2015 The Openchrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 1998-2007 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2007 S3 Graphics, 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, 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 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. */ /* * Integrated LVDS power management functions. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "via_driver.h" #include "via_mode.h" #include /* * Option handling. */ enum ViaPanelOpts { OPTION_CENTER }; static OptionInfoRec ViaPanelOptions[] = { {OPTION_CENTER, "Center", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; /* These table values were copied from lcd.c of VIA Frame * Buffer device driver. */ /* {int Width, int Height, bool useDualEdge, bool useDithering}; */ static ViaPanelModeRec ViaPanelNativeModes[] = { { 640, 480, FALSE, TRUE}, { 800, 600, FALSE, TRUE}, {1024, 768, FALSE, TRUE}, {1280, 768, FALSE, TRUE}, {1280, 1024, TRUE, TRUE}, {1400, 1050, TRUE, TRUE}, {1600, 1200, TRUE, TRUE}, {1280, 800, FALSE, TRUE}, { 800, 480, FALSE, TRUE}, {1024, 768, TRUE, TRUE}, {1024, 768, FALSE, FALSE}, {1024, 768, TRUE, FALSE}, {1280, 768, FALSE, FALSE}, {1280, 1024, TRUE, FALSE}, {1400, 1050, TRUE, FALSE}, {1600, 1200, TRUE, FALSE}, {1366, 768, FALSE, FALSE}, {1024, 600, FALSE, TRUE}, {1280, 768, TRUE, TRUE}, {1280, 800, FALSE, TRUE}, {1360, 768, FALSE, FALSE}, {1280, 768, TRUE, FALSE}, { 480, 640, FALSE, TRUE}, {1200, 900, FALSE, FALSE}}; #define MODEPREFIX(name) NULL, NULL, name, 0, M_T_DRIVER | M_T_DEFAULT #define MODESUFFIX 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0 static DisplayModeRec OLPCMode = { MODEPREFIX("1200x900"), 57275, 1200, 1208, 1216, 1240, 0, 900, 905, 908, 912, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }; /* 1. Formula: 2^13 X 0.0698uSec [1/14.318MHz] = 8192 X 0.0698uSec =572.1uSec Timer = Counter x 572 uSec 2. Note: 0.0698 uSec is too small to compute for hardware. So we multiply a reference value(2^13) to make it big enough to compute for hardware. 3. Note: The meaning of the TD0~TD3 are count of the clock. TD(sec) = (sec)/(per clock) x (count of clocks) */ #define TD0 200 #define TD1 25 #define TD2 0 #define TD3 25 /* * Sets CX700 or later single chipset's LVDS1 I/O pad state. */ void viaLVDS1SetIOPadSetting(ScrnInfoPtr pScrn, CARD8 ioPadState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaLVDS1SetIOPadSetting.\n")); /* Set LVDS1 I/O pad state. */ /* 3C5.2A[1:0] - LVDS1 I/O Pad Control */ ViaSeqMask(hwp, 0x2A, ioPadState, 0x03); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS1 I/O Pad State: %d\n", (ioPadState & 0x03)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaLVDS1SetIOPadSetting.\n")); } /* * Sets IGA1 or IGA2 as the display output source for VIA Technologies * Chrome IGP LVDS1 integrated LVDS transmitter. */ static void viaLVDS1SetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 temp = displaySource; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaLVDS1SetDisplaySource.\n")); /* Set LVDS1 integrated LVDS transmitter display output source. */ /* 3X5.99[4] - LVDS Channel 1 Data Source Selection * 0: Primary Display * 1: Secondary Display */ ViaCrtcMask(hwp, 0x99, temp << 4, 0x10); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS1 Integrated LVDS Transmitter Display Output " "Source: IGA%d\n", (temp & 0x01) + 1); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaLVDS1SetDisplaySource.\n")); } /* * Sets LVDS1 (LVDS Channel 1) integrated LVDS transmitter format. */ static void viaLVDS1SetFormat(ScrnInfoPtr pScrn, CARD8 format) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaLVDS1SetFormat.\n")); /* Set LVDS1 format. */ /* 3X5.D2[1] - LVDS Channel 1 Format Selection * 0: SPWG Mode * 1: OPENLDI Mode */ ViaCrtcMask(hwp, 0xD2, format << 1, 0x02); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS1 Format: %s\n", (format & 0x01) ? "OPENLDI" : "SPWG"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaLVDS1SetFormat.\n")); } /* * Sets CX700 or later single chipset's LVDS2 I/O pad state. */ static void viaLVDS2SetIOPadSetting(ScrnInfoPtr pScrn, CARD8 ioPadState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaLVDS2SetIOPadSetting.\n")); /* Set LVDS2 I/O pad state. */ /* 3C5.2A[3:2] - LVDS2 I/O Pad Control */ ViaSeqMask(hwp, 0x2A, ioPadState << 2, 0x0C); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS2 I/O Pad State: %d\n", (ioPadState & 0x03)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaLVDS2SetIOPadSetting.\n")); } /* * Sets IGA1 or IGA2 as the display output source for VIA Technologies * Chrome IGP LVDS2 integrated LVDS transmitter. */ static void viaLVDS2SetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 temp = displaySource; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaLVDS2SetDisplaySource.\n")); /* Set LVDS2 integrated LVDS transmitter display output source. */ /* 3X5.97[4] - LVDS Channel 2 Data Source Selection * 0: Primary Display * 1: Secondary Display */ ViaCrtcMask(hwp, 0x97, temp << 4, 0x10); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS2 Integrated LVDS Transmitter Display Output " "Source: IGA%d\n", (temp & 0x01) + 1); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaLVDS2SetDisplaySource.\n")); } /* * Sets LVDS2 (LVDS Channel 2) integrated LVDS transmitter delay tap. */ static void viaLVDS2SetDelayTap(ScrnInfoPtr pScrn, CARD8 delayTap) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaLVDS2SetDelayTap.\n")); /* Set LVDS2 delay tap. */ /* 3X5.97[3:0] - LVDS2 Delay Tap */ ViaCrtcMask(hwp, 0x97, delayTap, 0x0F); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS2 Delay Tap: %d\n", (delayTap & 0x0F)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaLVDS2SetDelayTap.\n")); } /* * Sets LVDS2 (LVDS Channel 2) integrated LVDS transmitter format. */ static void viaLVDS2SetFormat(ScrnInfoPtr pScrn, CARD8 format) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaLVDS2SetFormat.\n")); /* Set LVDS2 format. */ /* 3X5.D2[0] - LVDS Channel 2 Format Selection * 0: SPWG Mode * 1: OPENLDI Mode */ ViaCrtcMask(hwp, 0xD2, format, 0x01); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS2 Format: %s\n", (format & 0x01) ? "OPENLDI" : "SPWG"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaLVDS2SetFormat.\n")); } /* * Sets IGA1 or IGA2 as the display output source for VIA Technologies * Chrome IGP DFP (Digital Flat Panel) High interface. */ static void viaDFPHighSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 temp = displaySource; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDFPHighSetDisplaySource.\n")); /* Set DFP High display output source. */ /* 3X5.97[4] - DFP High Data Source Selection * 0: Primary Display * 1: Secondary Display */ ViaCrtcMask(hwp, 0x97, temp << 4, 0x10); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DFP High Display Output Source: IGA%d\n", (temp & 0x01) + 1); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDFPHighSetDisplaySource.\n")); } /* * Sets DFP (Digital Flat Panel) Low interface delay tap. */ static void viaDFPLowSetDelayTap(ScrnInfoPtr pScrn, CARD8 delayTap) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDFPLowSetDelayTap.\n")); /* Set DFP Low interface delay tap. */ /* 3X5.99[3:0] - DFP Low Delay Tap */ ViaCrtcMask(hwp, 0x99, delayTap, 0x0F); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DFP Low Delay Tap: %d\n", (delayTap & 0x0F)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDFPLowSetDelayTap.\n")); } /* * Sets DFP (Digital Flat Panel) High interface delay tap. */ static void viaDFPHighSetDelayTap(ScrnInfoPtr pScrn, CARD8 delayTap) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDFPHighSetDelayTap.\n")); /* Set DFP High interface delay tap. */ /* 3X5.97[3:0] - DFP High Delay Tap */ ViaCrtcMask(hwp, 0x97, delayTap, 0x0F); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DFP High Delay Tap: %d\n", (delayTap & 0x0F)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDFPHighSetDelayTap.\n")); } /* * Turns LVDS2 output color dithering on or off. (18-bit color display vs. * 24-bit color display) */ static void viaLVDS2SetDithering(ScrnInfoPtr pScrn, CARD8 ditheringStatus) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaLVDS2SetDithering.\n")); /* Set LVDS2 output color dithering bit. */ /* 3X5.D4[6] - LVDS Channel 2 Output Bits * 0: 24 bits (dithering off) * 1: 18 bits (dithering on) */ ViaCrtcMask(hwp, 0xD4, ditheringStatus ? 0x40 : 0x00, 0x40); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS2 Output Color Dithering: %s\n", ditheringStatus ? "On (18 bit)" : "Off (24 bit)"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaLVDS2SetDithering.\n")); } /* * Sets output format of LVDS2 to rotation or sequential mode. */ static void viaLVDS2SetOutputFormat(ScrnInfoPtr pScrn, CARD8 outputFormat) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaLVDS2SetOutputFormat.\n")); /* Set LVDS2 output format. */ /* 3X5.D4[7] - LVDS Channel 2 Output Format * 0: Rotation * 1: Sequential */ ViaCrtcMask(hwp, 0xD4, outputFormat ? 0x80 : 0x00, 0x80); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS2 Output Format: %s\n", outputFormat ? "Sequential" : "Rotation"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaLVDS2SetOutputFormat.\n")); } /* * Sets PCIe based 2 chip chipset's pin multiplexed DVP0 I/O pad state. */ static void viaDVP0PCIeSetIOPadSetting(ScrnInfoPtr pScrn, CARD8 ioPadState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDVP0PCIeSetIOPadSetting.\n")); /* Set pin multiplexed DVP1 I/O pad state. */ /* 3C5.2A[3:2] - DVP0 I/O Pad Control */ ViaSeqMask(hwp, 0x2A, ioPadState << 2, 0x0C); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DVP0 I/O Pad State: %d\n", (ioPadState & 0x03)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDVP0PCIeSetIOPadSetting.\n")); } /* * Sets PCIe based 2 chip chipset's pin multiplexed DVP1 I/O pad state. */ static void viaDVP1PCIeSetIOPadSetting(ScrnInfoPtr pScrn, CARD8 ioPadState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDVP1PCIeSetIOPadSetting.\n")); /* Set pin multiplexed DVP0 I/O pad state. */ /* 3C5.2A[1:0] - DVP1 I/O Pad Control */ ViaSeqMask(hwp, 0x2A, ioPadState, 0x03); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DVP1 I/O Pad State: %d\n", (ioPadState & 0x03)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDVP1PCIeSetIOPadSetting.\n")); } static void viaFPIOPadSetting(ScrnInfoPtr pScrn, Bool ioPadOn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 sr12, sr13, sr5a; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaFPIOPadSetting.\n")); if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { sr5a = hwp->readSeq(hwp, 0x5A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR5A: 0x%02X\n", sr5a)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 0.\n")); ViaSeqMask(hwp, 0x5A, sr5a & 0xFE, 0x01); } sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); switch (pVia->Chipset) { case VIA_CLE266: break; case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: /* The tricky thing about VIA Technologies PCI Express based * north bridge / south bridge 2 chip chipset is that * it pin multiplexes DVP0 / DVP1 with north bridge's PCI * Express x16 link. In particular, HP 2133 Mini-Note's WLAN * is connected to north bridge's PCI Express Lane 0, but the * Lane 0 is also pin multiplexed with DVP0. What this means is * turning on DVP0 without probing the relevant strapping pin * to determine the connected panel interface type will lead to * the PCIe based WLAN to getting disabled by OpenChrome DDX * when X.Org Server starts. * The current remedy for this will be to turn on DVP0 * only when an 18-bit / 24-bit interface flat panel is * connected. */ /* 3C5.12[4] - DVP0D4 pin strapping * 0: Use DVP1 only for a flat panel. * 1: Use DVP0 and DVP1 for a flat panel */ if (sr12 & 0x10) { /* Since an 18-bit / 24-bit flat panel is being used, actively * control DVP0. */ viaDVP0PCIeSetIOPadSetting(pScrn, ioPadOn ? 0x03 : 0x00); } else { /* Keep DVP0 powered down. Otherwise, it will interfere with * PCIe Lane 0 through 7. */ viaDVP0PCIeSetIOPadSetting(pScrn, 0x00); } /* Control DVP1 for a flat panel. */ viaDVP1PCIeSetIOPadSetting(pScrn, ioPadOn ? 0x03 : 0x00); break; case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* 3C5.13[7:6] - DVP1D15 and DVP1D14 pin strappings * 00: LVDS1 + LVDS2 * 01: DVI + LVDS2 * 10: Dual LVDS (LVDS1 + LVDS2 used * simultaneously) * 11: DVI only */ if ((((~(sr13 & 0x80)) && (~(sr13 & 0x40))) || ((sr13 & 0x80) && (~(sr13 & 0x40)))) && (!pVia->isVIANanoBook)) { viaLVDS1SetIOPadSetting(pScrn, ioPadOn ? 0x03 : 0x00); } if (((~(sr13 & 0x80)) || (~(sr13 & 0x40))) || (pVia->isVIANanoBook)) { viaLVDS2SetIOPadSetting(pScrn, ioPadOn ? 0x03 : 0x00); } break; default: break; } if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { hwp->writeSeq(hwp, 0x5A, sr5a); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring 3C5.5A[0].\n")); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaFPIOPadSetting.\n")); } static void ViaLVDSSoftwarePowerFirstSequence(ScrnInfoPtr pScrn, Bool on) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaLVDSSoftwarePowerFirstSequence: %d\n", on)); if (on) { /* Software control power sequence ON*/ hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0x7F); hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) | 0x01); usleep(TD0); /* VDD ON*/ hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) | 0x10); usleep(TD1); /* DATA ON */ hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) | 0x08); usleep(TD2); /* VEE ON (unused on vt3353)*/ hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) | 0x04); usleep(TD3); /* Back-Light ON */ hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) | 0x02); } else { /* Back-Light OFF */ hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0xFD); usleep(TD3); /* VEE OFF (unused on vt3353)*/ hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0xFB); usleep(TD2); /* DATA OFF */ hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0xF7); usleep(TD1); /* VDD OFF */ hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0xEF); } } static void ViaLVDSSoftwarePowerSecondSequence(ScrnInfoPtr pScrn, Bool on) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaLVDSSoftwarePowerSecondSequence: %d\n", on)); if (on) { /* Secondary power hardware power sequence enable 0:off 1: on */ hwp->writeCrtc(hwp, 0xD4, hwp->readCrtc(hwp, 0xD4) & 0xFD); /* Software control power sequence ON */ hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) | 0x01); usleep(TD0); /* VDD ON*/ hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) | 0x10); usleep(TD1); /* DATA ON */ hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) | 0x08); usleep(TD2); /* VEE ON (unused on vt3353)*/ hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) | 0x04); usleep(TD3); /* Back-Light ON */ hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) | 0x02); } else { /* Back-Light OFF */ hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) & 0xFD); usleep(TD3); /* VEE OFF */ hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) & 0xFB); /* Delay TD2 msec. */ usleep(TD2); /* DATA OFF */ hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) & 0xF7); /* Delay TD1 msec. */ usleep(TD1); /* VDD OFF */ hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) & 0xEF); } } static void ViaLVDSHardwarePowerFirstSequence(ScrnInfoPtr pScrn, Bool on) { vgaHWPtr hwp = VGAHWPTR(pScrn); if (on) { /* Use hardware control power sequence. */ hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0xFE); /* Turn on back light. */ hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0x3F); /* Turn on hardware power sequence. */ hwp->writeCrtc(hwp, 0x6A, hwp->readCrtc(hwp, 0x6A) | 0x08); } else { /* Turn off power sequence. */ hwp->writeCrtc(hwp, 0x6A, hwp->readCrtc(hwp, 0x6A) & 0xF7); usleep(1); /* Turn off back light. */ hwp->writeCrtc(hwp, 0x91, 0xC0); } } static void ViaLVDSHardwarePowerSecondSequence(ScrnInfoPtr pScrn, Bool on) { vgaHWPtr hwp = VGAHWPTR(pScrn); if (on) { /* Use hardware control power sequence. */ hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) & 0xFE); /* Turn on back light. */ hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) & 0x3F); /* Turn on hardware power sequence. */ hwp->writeCrtc(hwp, 0xD4, hwp->readCrtc(hwp, 0xD4) | 0x02); } else { /* Turn off power sequence. */ hwp->writeCrtc(hwp, 0xD4, hwp->readCrtc(hwp, 0xD4) & 0xFD); usleep(1); /* Turn off back light. */ hwp->writeCrtc(hwp, 0xD3, 0xC0); } } static void ViaLVDSPowerChannel(ScrnInfoPtr pScrn, Bool on) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 lvdsMask; if (on) { /* LVDS0: 0x7F, LVDS1: 0xBF */ lvdsMask = 0x7F & 0xBF; hwp->writeCrtc(hwp, 0xD2, hwp->readCrtc(hwp, 0xD2) & lvdsMask); } else { /* LVDS0: 0x80, LVDS1: 0x40 */ lvdsMask = 0x80 | 0x40; hwp->writeCrtc(hwp, 0xD2, hwp->readCrtc(hwp, 0xD2) | lvdsMask); } } static void ViaLVDSPower(ScrnInfoPtr pScrn, Bool Power_On) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 crd2; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered ViaLVDSPower.\n")); /* * VX800, CX700 have HW issue, so we'd better use SW power sequence * Fix Ticket #308 */ switch (pVia->Chipset) { case VIA_CX700: case VIA_VX800: /* Is the integrated TMDS transmitter (DVI) not in use? */ crd2 = hwp->readCrtc(hwp, 0xD2); if (((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) && (!(crd2 & 0x10))) { ViaLVDSSoftwarePowerFirstSequence(pScrn, Power_On); } ViaLVDSSoftwarePowerSecondSequence(pScrn, Power_On); break; case VIA_VX855: case VIA_VX900: /* Is the integrated TMDS transmitter (DVI) not in use? */ crd2 = hwp->readCrtc(hwp, 0xD2); if (((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) && (!(crd2 & 0x10))) { ViaLVDSHardwarePowerFirstSequence(pScrn, Power_On); } ViaLVDSHardwarePowerSecondSequence(pScrn, Power_On); break; default: ViaLVDSHardwarePowerFirstSequence(pScrn, Power_On); ViaLVDSHardwarePowerSecondSequence(pScrn, Power_On); break; } ViaLVDSPowerChannel(pScrn, Power_On); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Integrated LVDS Flat Panel Power: %s\n", Power_On ? "On" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaLVDSPower.\n")); } static void ViaLCDPowerSequence(vgaHWPtr hwp, VIALCDPowerSeqRec Sequence) { int i; for (i = 0; i < Sequence.numEntry; i++) { ViaVgahwMask(hwp, 0x300 + Sequence.port[i], Sequence.offset[i], 0x301 + Sequence.port[i], Sequence.data[i], Sequence.mask[i]); usleep(Sequence.delay[i]); } } static void ViaLCDPower(xf86OutputPtr output, Bool Power_On) { ViaPanelInfoPtr Panel = output->driver_private; ScrnInfoPtr pScrn = output->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered ViaLCDPower.\n")); /* Enable LCD */ if (Power_On) ViaCrtcMask(hwp, 0x6A, 0x08, 0x08); else ViaCrtcMask(hwp, 0x6A, 0x00, 0x08); if (pBIOSInfo->LCDPower) pBIOSInfo->LCDPower(pScrn, Power_On); /* Find Panel Size Index for PowerSeq Table */ if (pVia->Chipset == VIA_CLE266) { if (Panel->NativeModeIndex != VIA_PANEL_INVALID) { for (i = 0; i < NumPowerOn; i++) { if (lcdTable[Panel->PanelIndex].powerSeq == powerOn[i].powerSeq) break; } } else i = 0; } else /* KM and K8M use PowerSeq Table index 2. */ i = 2; usleep(1); if (Power_On) ViaLCDPowerSequence(hwp, powerOn[i]); else ViaLCDPowerSequence(hwp, powerOff[i]); usleep(1); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Integrated LVDS Flat Panel Power: %s\n", Power_On ? "On" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaLCDPower.\n")); } /* * Try to interpret EDID ourselves. */ static Bool ViaPanelGetSizeFromEDID(ScrnInfoPtr pScrn, xf86MonPtr pMon, int *width, int *height) { int i, max_hsize = 0, vsize = 0; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetPanelSizeFromEDID\n")); /* !!! Why are we not checking VESA modes? */ /* checking standard timings */ for (i = 0; i < STD_TIMINGS; i++) if ((pMon->timings2[i].hsize > 256) && (pMon->timings2[i].hsize > max_hsize)) { max_hsize = pMon->timings2[i].hsize; vsize = pMon->timings2[i].vsize; } if (max_hsize != 0) { *width = max_hsize; *height = vsize; return TRUE; } /* checking detailed monitor section */ /* !!! skip Ranges and standard timings */ /* check detailed timings */ for (i = 0; i < DET_TIMINGS; i++) if (pMon->det_mon[i].type == DT) { struct detailed_timings timing = pMon->det_mon[i].section.d_timings; /* ignore v_active for now */ if ((timing.clock > 15000000) && (timing.h_active > max_hsize)) { max_hsize = timing.h_active; vsize = timing.v_active; } } if (max_hsize != 0) { *width = max_hsize; *height = vsize; return TRUE; } return FALSE; } static Bool ViaPanelGetSizeFromDDCv1(xf86OutputPtr output, int *width, int *height) { ScrnInfoPtr pScrn = output->scrn; VIAPtr pVia = VIAPTR(pScrn); xf86MonPtr pMon; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered VIAGetPanelSizeFromDDCv1.\n")); if (!pVia->pI2CBus2) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I2C Bus 2 does not exist.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting VIAGetPanelSizeFromDDCv1.\n")); return FALSE; } if (!xf86I2CProbeAddress(pVia->pI2CBus2, 0xA0)) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "I2C device on I2C Bus 2 does not support EDID.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting VIAGetPanelSizeFromDDCv1.\n")); return FALSE; } /* Probe I2C Bus 2 to see if a flat panel is connected. */ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Probing for a flat panel on I2C Bus 2.\n"); pMon = xf86OutputGetEDID(output, pVia->pI2CBus2); if (pMon && DIGITAL(pMon->features.input_type)) { xf86OutputSetEDID(output, pMon); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected a flat panel on I2C Bus 2.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Did not detect a flat panel on I2C Bus 2.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting VIAGetPanelSizeFromDDCv1.\n")); return FALSE; } if (!ViaPanelGetSizeFromEDID(pScrn, pMon, width, height)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to obtain panel size from EDID information.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting VIAGetPanelSizeFromDDCv1.\n")); return FALSE; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetPanelSizeFromDDCv1: (%d X %d)\n", *width, *height)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting VIAGetPanelSizeFromDDCv1.\n")); return TRUE; } /* * Gets the native panel resolution from scratch pad registers. */ static void viaLVDSGetFPInfoFromScratchPad(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); ViaPanelInfoPtr panel = output->driver_private; CARD8 index; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaLVDSGetFPInfoFromScratchPad.\n")); index = hwp->readCrtc(hwp, 0x3F) & 0x0F; panel->NativeModeIndex = index; panel->NativeWidth = ViaPanelNativeModes[index].Width; panel->NativeHeight = ViaPanelNativeModes[index].Height; panel->useDualEdge = ViaPanelNativeModes[index].useDualEdge; panel->useDithering = ViaPanelNativeModes[index].useDithering; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIA Technologies VGA BIOS Scratch Pad Register " "Flat Panel Index: %d\n", panel->NativeModeIndex); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Flat Panel Native Resolution: %dx%d\n", panel->NativeWidth, panel->NativeHeight); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Flat Panel Dual Edge Transfer: %s\n", panel->useDualEdge ? "On" : "Off"); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Flat Panel Output Color Dithering: %s\n", panel->useDithering ? "On (18 bit)" : "Off (24 bit)"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaLVDSGetFPInfoFromScratchPad.\n")); } static void ViaPanelCenterMode(DisplayModePtr mode, DisplayModePtr adjusted_mode) { int panelHSyncTime = adjusted_mode->HSyncEnd - adjusted_mode->HSyncStart; int panelVSyncTime = adjusted_mode->VSyncEnd - adjusted_mode->VSyncStart; int panelHBlankStart = adjusted_mode->HDisplay; int panelVBlankStart = adjusted_mode->VDisplay; int hBorder = (adjusted_mode->HDisplay - mode->HDisplay)/2; int vBorder = (adjusted_mode->VDisplay - mode->VDisplay)/2; int newHBlankStart = hBorder + mode->HDisplay; int newVBlankStart = vBorder + mode->VDisplay; adjusted_mode->HDisplay = mode->HDisplay; adjusted_mode->HSyncStart = (adjusted_mode->HSyncStart - panelHBlankStart) + newHBlankStart; adjusted_mode->HSyncEnd = adjusted_mode->HSyncStart + panelHSyncTime; adjusted_mode->VDisplay = mode->VDisplay; adjusted_mode->VSyncStart = (adjusted_mode->VSyncStart - panelVBlankStart) + newVBlankStart; adjusted_mode->VSyncEnd = adjusted_mode->VSyncStart + panelVSyncTime; /* Adjust Crtc H and V */ adjusted_mode->CrtcHDisplay = adjusted_mode->HDisplay; adjusted_mode->CrtcHBlankStart = newHBlankStart; adjusted_mode->CrtcHBlankEnd = adjusted_mode->CrtcHTotal - hBorder; adjusted_mode->CrtcHSyncStart = adjusted_mode->HSyncStart; adjusted_mode->CrtcHSyncEnd = adjusted_mode->HSyncEnd; adjusted_mode->CrtcVDisplay = adjusted_mode->VDisplay; adjusted_mode->CrtcVBlankStart = newVBlankStart; adjusted_mode->CrtcVBlankEnd = adjusted_mode->CrtcVTotal - vBorder; adjusted_mode->CrtcVSyncStart = adjusted_mode->VSyncStart; adjusted_mode->CrtcVSyncEnd = adjusted_mode->VSyncEnd; } static void ViaPanelScale(ScrnInfoPtr pScrn, int resWidth, int resHeight, int panelWidth, int panelHeight) { VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); int horScalingFactor = 0; int verScalingFactor = 0; CARD8 cra2 = 0; CARD8 cr77 = 0; CARD8 cr78 = 0; CARD8 cr79 = 0; CARD8 cr9f = 0; Bool scaling = FALSE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaPanelScale: %d,%d -> %d,%d\n", resWidth, resHeight, panelWidth, panelHeight)); if (resWidth < panelWidth) { /* Load Horizontal Scaling Factor */ if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) { horScalingFactor = ((resWidth - 1) * 4096) / (panelWidth - 1); /* Horizontal scaling enabled */ cra2 = 0xC0; cr9f = horScalingFactor & 0x0003; /* HSCaleFactor[1:0] at CR9F[1:0] */ } else { /* TODO: Need testing */ horScalingFactor = ((resWidth - 1) * 1024) / (panelWidth - 1); } cr77 = (horScalingFactor & 0x03FC) >> 2; /* HSCaleFactor[9:2] at CR77[7:0] */ cr79 = (horScalingFactor & 0x0C00) >> 10; /* HSCaleFactor[11:10] at CR79[5:4] */ cr79 <<= 4; scaling = TRUE; } if (resHeight < panelHeight) { /* Load Vertical Scaling Factor */ if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) { verScalingFactor = ((resHeight - 1) * 2048) / (panelHeight - 1); /* Vertical scaling enabled */ cra2 |= 0x08; cr79 |= ((verScalingFactor & 0x0001) << 3); /* VSCaleFactor[0] at CR79[3] */ } else { /* TODO: Need testing */ verScalingFactor = ((resHeight - 1) * 1024) / (panelHeight - 1); } cr78 |= (verScalingFactor & 0x01FE) >> 1; /* VSCaleFactor[8:1] at CR78[7:0] */ cr79 |= ((verScalingFactor & 0x0600) >> 9) << 6; /* VSCaleFactor[10:9] at CR79[7:6] */ scaling = TRUE; } if (scaling) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Scaling factor: horizontal %d (0x%x), vertical %d (0x%x)\n", horScalingFactor, horScalingFactor, verScalingFactor, verScalingFactor)); ViaCrtcMask(hwp, 0x77, cr77, 0xFF); ViaCrtcMask(hwp, 0x78, cr78, 0xFF); ViaCrtcMask(hwp, 0x79, cr79, 0xF8); if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) { ViaCrtcMask(hwp, 0x9F, cr9f, 0x03); } ViaCrtcMask(hwp, 0x79, 0x03, 0x03); } else { /* Disable panel scale */ ViaCrtcMask(hwp, 0x79, 0x00, 0x01); } if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) { ViaCrtcMask(hwp, 0xA2, cra2, 0xC8); } /* Horizontal scaling selection: interpolation */ // ViaCrtcMask(hwp, 0x79, 0x02, 0x02); // else // ViaCrtcMask(hwp, 0x79, 0x00, 0x02); /* Horizontal scaling factor selection original / linear */ //ViaCrtcMask(hwp, 0xA2, 0x40, 0x40); } static void ViaPanelScaleDisable(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); ViaCrtcMask(hwp, 0x79, 0x00, 0x01); /* Disable VX900 down scaling */ if (pVia->Chipset == VIA_VX900) ViaCrtcMask(hwp, 0x89, 0x00, 0x01); if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) ViaCrtcMask(hwp, 0xA2, 0x00, 0xC8); } static void via_lvds_create_resources(xf86OutputPtr output) { } static void via_lvds_dpms(xf86OutputPtr output, int mode) { ScrnInfoPtr pScrn = output->scrn; VIAPtr pVia = VIAPTR(pScrn); switch (mode) { case DPMSModeOn: switch (pVia->Chipset) { case VIA_PM800: case VIA_P4M800PRO: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: ViaLVDSPower(pScrn, TRUE); break; default: ViaLCDPower(output, TRUE); break; } viaFPIOPadSetting(pScrn, TRUE); break; case DPMSModeStandby: case DPMSModeSuspend: case DPMSModeOff: switch (pVia->Chipset) { case VIA_PM800: case VIA_P4M800PRO: case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: ViaLVDSPower(pScrn, FALSE); break; default: ViaLCDPower(output, FALSE); break; } viaFPIOPadSetting(pScrn, FALSE); break; } } static void via_lvds_save(xf86OutputPtr output) { } static void via_lvds_restore(xf86OutputPtr output) { ViaLCDPower(output, TRUE); } static int via_lvds_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { ScrnInfoPtr pScrn = output->scrn; ViaPanelInfoPtr Panel = output->driver_private; if (Panel->NativeWidth < pMode->HDisplay || Panel->NativeHeight < pMode->VDisplay) return MODE_PANEL; if (!Panel->Scale && Panel->NativeHeight != pMode->VDisplay && Panel->NativeWidth != pMode->HDisplay) return MODE_PANEL; if (!ViaModeDotClockTranslate(pScrn, pMode)) return MODE_NOCLOCK; return MODE_OK; } static Bool via_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { ViaPanelInfoPtr Panel = output->driver_private; xf86SetModeCrtc(adjusted_mode, 0); if (!Panel->Center && (mode->HDisplay < Panel->NativeWidth || mode->VDisplay < Panel->NativeHeight)) { Panel->Scale = TRUE; } else { Panel->Scale = FALSE; ViaPanelCenterMode(mode, adjusted_mode); } return TRUE; } static void via_lvds_prepare(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; via_lvds_dpms(output, DPMSModeOff); viaFPIOPadSetting(pScrn, FALSE); } static void via_lvds_commit(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; via_lvds_dpms(output, DPMSModeOn); viaFPIOPadSetting(pScrn, TRUE); } static void via_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { ViaPanelInfoPtr Panel = output->driver_private; ScrnInfoPtr pScrn = output->scrn; drmmode_crtc_private_ptr iga = output->crtc->driver_private; VIAPtr pVia = VIAPTR(pScrn); if (output->crtc) { if (Panel->Scale) { ViaPanelScale(pScrn, mode->HDisplay, mode->VDisplay, Panel->NativeWidth, Panel->NativeHeight); } else { ViaPanelScaleDisable(pScrn); } switch (pVia->Chipset) { case VIA_P4M900: viaDFPLowSetDelayTap(pScrn, 0x08); break; case VIA_CX700: viaLVDS2SetDelayTap(pScrn, 0x01); break; default: break; } switch (pVia->Chipset) { case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: viaDFPLowSetDisplaySource(pScrn, iga->index ? 0x01 : 0x00); viaDFPHighSetDisplaySource(pScrn, iga->index ? 0x01 : 0x00); break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: viaDFPLowSetDisplaySource(pScrn, iga->index ? 0x01 : 0x00); viaDVP1SetDisplaySource(pScrn, iga->index ? 0x01 : 0x00); break; case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: viaLVDS2SetDisplaySource(pScrn, iga->index ? 0x01 : 0x00); /* Set LVDS2 output color dithering. */ viaLVDS2SetDithering(pScrn, Panel->useDithering ? TRUE : FALSE); /* Set LVDS2 output format to sequential mode. */ viaLVDS2SetOutputFormat(pScrn, 0x01); /* Set LVDS2 output to OPENLDI mode. */ viaLVDS2SetFormat(pScrn, 0x01); break; default: break; } } } static xf86OutputStatus via_lvds_detect(xf86OutputPtr output) { xf86OutputStatus status = XF86OutputStatusDisconnected; ScrnInfoPtr pScrn = output->scrn; VIAPtr pVia = VIAPTR(pScrn); ViaPanelInfoPtr panel = output->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_lvds_detect.\n")); /* Hardcode panel size for the OLPC XO-1.5. */ if (pVia->IsOLPCXO15) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Setting up OLPC XO-1.5 flat panel.\n"); panel->NativeWidth = 1200; panel->NativeHeight = 900; status = XF86OutputStatusConnected; goto exit; } /* For now, FP detection code will not scan the I2C bus * in order to obtain EDID since it is often used by DVI * as well. Hence, reading off the CRTC scratch pad register * supplied by the VGA BIOS is the only method available * to figure out the FP native screen resolution. */ viaLVDSGetFPInfoFromScratchPad(output); status = XF86OutputStatusConnected; exit: DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_lvds_detect.\n")); return status; } static DisplayModePtr via_lvds_get_modes(xf86OutputPtr output) { ViaPanelInfoPtr pPanel = output->driver_private; ScrnInfoPtr pScrn = output->scrn; DisplayModePtr pDisplay_Mode = NULL; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_lvds_get_modes.\n")); if (output->status == XF86OutputStatusConnected) { if (!output->MonInfo) { /* * Generates a display mode for the native panel resolution, * using CVT. */ if (pPanel->NativeWidth && pPanel->NativeHeight) { VIAPtr pVia = VIAPTR(pScrn); if (pVia->IsOLPCXO15) { pDisplay_Mode = xf86DuplicateMode(&OLPCMode); } else { pDisplay_Mode = xf86CVTMode(pPanel->NativeWidth, pPanel->NativeHeight, 60.0f, FALSE, FALSE); } if (pDisplay_Mode) { pDisplay_Mode->CrtcHDisplay = pDisplay_Mode->HDisplay; pDisplay_Mode->CrtcHSyncStart = pDisplay_Mode->HSyncStart; pDisplay_Mode->CrtcHSyncEnd = pDisplay_Mode->HSyncEnd; pDisplay_Mode->CrtcHTotal = pDisplay_Mode->HTotal; pDisplay_Mode->CrtcHSkew = pDisplay_Mode->HSkew; pDisplay_Mode->CrtcVDisplay = pDisplay_Mode->VDisplay; pDisplay_Mode->CrtcVSyncStart = pDisplay_Mode->VSyncStart; pDisplay_Mode->CrtcVSyncEnd = pDisplay_Mode->VSyncEnd; pDisplay_Mode->CrtcVTotal = pDisplay_Mode->VTotal; pDisplay_Mode->CrtcVBlankStart = min(pDisplay_Mode->CrtcVSyncStart, pDisplay_Mode->CrtcVDisplay); pDisplay_Mode->CrtcVBlankEnd = max(pDisplay_Mode->CrtcVSyncEnd, pDisplay_Mode->CrtcVTotal); pDisplay_Mode->CrtcHBlankStart = min(pDisplay_Mode->CrtcHSyncStart, pDisplay_Mode->CrtcHDisplay); pDisplay_Mode->CrtcHBlankEnd = max(pDisplay_Mode->CrtcHSyncEnd, pDisplay_Mode->CrtcHTotal); pDisplay_Mode->type = M_T_DRIVER | M_T_PREFERRED; } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Out of memory. Size: %zu bytes\n", sizeof(DisplayModeRec)); } } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Invalid Flat Panel Screen Resolution: " "%dx%d\n", pPanel->NativeWidth, pPanel->NativeHeight); } } else { pDisplay_Mode = xf86OutputGetEDIDModes(output); } } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_lvds_get_modes.\n")); return pDisplay_Mode; } #ifdef RANDR_12_INTERFACE static Bool via_lvds_set_property(xf86OutputPtr output, Atom property, RRPropertyValuePtr value) { return FALSE; } static Bool via_lvds_get_property(xf86OutputPtr output, Atom property) { return FALSE; } #endif static void via_lvds_destroy(xf86OutputPtr output) { if (output->driver_private) free(output->driver_private); output->driver_private = NULL; } static const xf86OutputFuncsRec via_lvds_funcs = { .create_resources = via_lvds_create_resources, .dpms = via_lvds_dpms, .save = via_lvds_save, .restore = via_lvds_restore, .mode_valid = via_lvds_mode_valid, .mode_fixup = via_lvds_mode_fixup, .prepare = via_lvds_prepare, .commit = via_lvds_commit, .mode_set = via_lvds_mode_set, .detect = via_lvds_detect, .get_modes = via_lvds_get_modes, #ifdef RANDR_12_INTERFACE .set_property = via_lvds_set_property, #endif #ifdef RANDR_13_INTERFACE .get_property = via_lvds_get_property, #endif .destroy = via_lvds_destroy }; void via_lvds_init(ScrnInfoPtr pScrn) { ViaPanelInfoPtr Panel = (ViaPanelInfoPtr) xnfcalloc(sizeof(ViaPanelInfoRec), 1); OptionInfoPtr Options = xnfalloc(sizeof(ViaPanelOptions)); MessageType from = X_DEFAULT; VIAPtr pVia = VIAPTR(pScrn); xf86OutputPtr output = NULL; vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 cr3b = 0x00; CARD8 cr3b_mask = 0x00; char outputNameBuffer[32]; if (!Panel) return; /* Apparently this is the way VIA Technologies passes */ /* the presence of a flat panel to the device driver */ /* via BIOS setup. */ if (pVia->Chipset == VIA_CLE266) { cr3b_mask = 0x08; } else { cr3b_mask = 0x02; } cr3b = hwp->readCrtc(hwp, 0x3B) & cr3b_mask; if (!cr3b) { return; } memcpy(Options, ViaPanelOptions, sizeof(ViaPanelOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, Options); Panel->NativeModeIndex = VIA_PANEL_INVALID; /* LCD Center/Expend Option */ Panel->Center = FALSE; from = xf86GetOptValBool(Options, OPTION_CENTER, &Panel->Center) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "LVDS-0 : DVI Center is %s.\n", Panel->Center ? "enabled" : "disabled"); /* The code to dynamically designate a particular FP (i.e., FP-1, * FP-2, etc.) for xrandr was borrowed from xf86-video-r128 DDX. */ sprintf(outputNameBuffer, "FP-%d", (pVia->numberFP + 1)); output = xf86OutputCreate(pScrn, &via_lvds_funcs, outputNameBuffer); if (output) { output->driver_private = Panel; /* While there are two (2) display controllers registered with the * X.Org Server, it is often desirable to fix FP (Flat Panel) to * IGA2 since only IGA2 contains panel resolution scaling * functionality. IGA1 does not have this. */ output->possible_crtcs = 1 << 1; output->possible_clones = 0; output->interlaceAllowed = FALSE; output->doubleScanAllowed = FALSE; /* Increment the number of FP connectors. */ pVia->numberFP++; if (pVia->IsOLPCXO15) { output->mm_height = 152; output->mm_width = 114; } } else { free(Panel); } } xf86-video-openchrome-0.6.0/src/via_kms.h0000664000175000017500000000545113033607754015102 00000000000000/* * Copyright © 2007 Red Hat, Inc. * * 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. * * Authors: * Dave Airlie * */ #ifndef DRMMODE_DISPLAY_H #define DRMMODE_DISPLAY_H #ifdef HAVE_DRI #include "xf86drmMode.h" #endif #ifdef HAVE_UDEV #include "libudev.h" #endif typedef struct { int fd; uint32_t fb_id; #ifdef HAVE_DRI drmModeResPtr mode_res; drmModeFBPtr mode_fb; drmEventContext event_context; #endif ScrnInfoPtr scrn; #ifdef HAVE_UDEV struct udev_monitor *uevent_monitor; InputHandlerProc uevent_handler; #endif struct buffer_object *front_bo; Bool hwcursor; } drmmode_rec, *drmmode_ptr; typedef struct { drmmode_ptr drmmode; #ifdef HAVE_DRI drmModeCrtcPtr mode_crtc; #endif struct buffer_object *cursor_bo; unsigned rotate_fb_id; int index; } drmmode_crtc_private_rec, *drmmode_crtc_private_ptr; #ifdef HAVE_DRI typedef struct { drmModePropertyPtr mode_prop; uint64_t value; int num_atoms; /* if range prop, num_atoms == 1; if enum prop, num_atoms == num_enums + 1 */ Atom *atoms; } drmmode_prop_rec, *drmmode_prop_ptr; typedef struct { drmmode_ptr drmmode; int output_id; drmModeConnectorPtr mode_output; drmModeEncoderPtr *mode_encoders; drmModePropertyBlobPtr edid_blob; int dpms_enum_id; int num_props; drmmode_prop_ptr props; int enc_mask; int enc_clone_mask; } drmmode_output_private_rec, *drmmode_output_private_ptr; #endif extern xf86CrtcPtr window_belongs_to_crtc(ScrnInfoPtr pScrn, int x, int y, int w, int h); extern Bool KMSCrtcInit(ScrnInfoPtr pScrn, drmmode_ptr drmmode); extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode); extern void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode); #endif xf86-video-openchrome-0.6.0/src/via_dmabuffer.h0000664000175000017500000000543612760724526016251 00000000000000/* * Copyright (C) Thomas Hellstrom (2005) * * 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 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. */ #ifndef VIA_DMABUFFER_H #define VIA_DMABUFFER_H #include "via_3d_reg.h" typedef struct _ViaCommandBuffer { ScrnInfoPtr pScrn; CARD32 *buf; CARD32 waitFlags; unsigned pos; unsigned bufSize; int mode; int header_start; int rindex; Bool has3dState; void (*flushFunc) (struct _ViaCommandBuffer * cb); } ViaCommandBuffer; #define VIA_DMASIZE 16384 #define H1_ADDR(val) (((val) >> 2) | 0xF0000000) #define WAITFLAGS(flags) \ (cb)->waitFlags |= (flags) #define BEGIN_RING(size) \ do { \ if (cb->flushFunc && (cb->pos > (cb->bufSize-(size)))) { \ cb->flushFunc(cb); \ } \ } while(0) #define BEGIN_H2(paraType, h2size) \ do{ \ BEGIN_RING((h2size)+6); \ if (cb->mode == 2 && (paraType) == cb->rindex) \ break; \ if (cb->pos & 1) \ OUT_RING(HC_DUMMY); \ cb->header_start = cb->pos; \ cb->rindex = paraType; \ cb->mode = 2; \ OUT_RING(HALCYON_HEADER2); \ OUT_RING((paraType) << 16); \ if (!cb->has3dState && ((paraType) != HC_ParaType_CmdVdata)) { \ cb->has3dState = TRUE; \ } \ } while(0); #define OUT_RING(val) do{ \ (cb)->buf[(cb)->pos++] = (val); \ } while(0); #define OUT_RING_QW(val1, val2) \ do { \ (cb)->buf[(cb)->pos++] = (val1); \ (cb)->buf[(cb)->pos++] = (val2); \ } while (0) #define ADVANCE_RING \ cb->flushFunc(cb) #define RING_VARS \ ViaCommandBuffer *cb = &pVia->cb #define OUT_RING_H1(val1, val2) \ OUT_RING_QW(H1_ADDR(val1), val2) #define OUT_RING_SubA(val1, val2) \ OUT_RING(((val1) << HC_SubA_SHIFT) | ((val2) & HC_Para_MASK)) #endif xf86-video-openchrome-0.6.0/src/via_drmclient.h0000664000175000017500000000656212760724526016300 00000000000000/* * Copyright (C) 2005 The Unichrome Project, 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 AUTHOR(S) OR COPYRIGHT HOLDER(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. */ #ifndef _VIA_DRMCLIENT_H #define _VIA_DRMCLIENT_H #include "stdint.h" #include "drm.h" #include "xf86drm.h" #ifdef X_NEED_DRMLOCK #define drm_hw_lock_t drmLock #endif #define UNICHROME_LOCK(fd, lockNo, saPriv, context, lastcontext, ret) \ do { \ volatile drm_hw_lock_t *lockPtr = XVMCLOCKPTR((saPriv), (lockNo)); \ unsigned lockVal; \ DRM_CAS_RESULT(__ret); \ \ ret = 0; \ lockVal = lockPtr->lock & ~(DRM_LOCK_HELD | DRM_LOCK_CONT); \ DRM_CAS(lockPtr, lockVal, (context) | DRM_LOCK_HELD, __ret); \ if (__ret) { \ drm_via_futex_t fx; \ \ lockVal = lockPtr->lock; \ if (! (lockVal & DRM_LOCK_HELD)) continue; \ if ((lockVal & ~(DRM_LOCK_HELD | DRM_LOCK_CONT) ) \ == (context)) { \ lastcontext = lockVal & ~(DRM_LOCK_HELD | DRM_LOCK_CONT); \ break; \ } \ fx.val = lockVal | DRM_LOCK_CONT; \ DRM_CAS( lockPtr, lockVal, fx.val, __ret); \ lockVal = lockPtr->lock; \ if (__ret) continue; \ fx.func = VIA_FUTEX_WAIT; \ fx.lock = (lockNo); \ fx.ms = 10; \ ret = drmCommandWrite((fd), DRM_VIA_DEC_FUTEX, \ &fx,sizeof(fx)); \ lastcontext = lockVal; \ if (ret) break; \ continue; \ } else { \ lastcontext = lockVal; \ break; \ } \ } while (1) \ #define UNICHROME_UNLOCK(fd, lockNo, saPriv, context) \ do { \ volatile drm_hw_lock_t *lockPtr = XVMCLOCKPTR((saPriv), (lockNo)); \ \ if ((lockPtr->lock & ~DRM_LOCK_CONT) == \ ((context) | DRM_LOCK_HELD)) { \ DRM_CAS_RESULT(__ret); \ DRM_CAS(lockPtr,(context) | DRM_LOCK_HELD, context, __ret); \ if (__ret) { \ drm_via_futex_t fx; \ fx.func = VIA_FUTEX_WAKE; \ fx.lock = lockNo; \ DRM_CAS(lockPtr, (context) | DRM_LOCK_HELD | \ DRM_LOCK_CONT, \ context, __ret); \ drmCommandWrite((fd), DRM_VIA_DEC_FUTEX, &fx, \ sizeof(fx)); \ } \ } \ } while (0) \ #define UNICHROME_LOCK_DECODER1 0 #define UNICHROME_LOCK_DECODER2 1 #define UNICHROME_LOCK_HQV 4 #define __user #endif xf86-video-openchrome-0.6.0/src/via_ch7xxx.h0000664000175000017500000012564112760724526015550 00000000000000/* * Copyright 2005 Terry Lewis. All Rights Reserved. * Copyright 2005 Philip Langdale. All Rights Reserved. (CH7011 additions) * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS 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. */ #ifndef _VIA_CH7xxx_H_ #define _VIA_CH7xxx_H_ 1 /*+#define VIA_BIOS_MAX_NUM_TV_REG 0x80 +#define VIA_BIOS_MAX_NUM_TV_CRTC 32 +#define VIA_BIOS_NUM_TV_SPECIAL_REG 8 +#define VIA_BIOS_MAX_NUM_TV_PATCH 8 +#define VIA_BIOS_NUM_TV_OTHER 16 */ #define VIA_BIOS_TABLE_NUM_TV_REG 0x23 /* 0x00 - 0x22 */ #define CH_7011_MAX_NUM_REG 0x4C /* 0x00 - 0x4B */ #define CH_7019_MAX_NUM_REG 0x80 /* 0x00 - 0x7F */ #define VIA_BIOS_MAX_NUM_TV_CRTC 32 #define VIA_BIOS_NUM_TV_SPECIAL_REG 8 #define VIA_BIOS_MAX_NUM_TV_PATCH 8 #define VIA_BIOS_NUM_TV_OTHER 16 struct CH7xxxModePrivate { char id[12]; /* "CH7xxx" */ CARD8 Standard; }; static struct CH7xxxModePrivate CH7xxxModePrivateNTSC = { { 'C', 'H', '7', 'x', 'x', 'x', 0, 0, 0, 0, 0, 0 }, TVTYPE_NTSC, }; static struct CH7xxxModePrivate CH7xxxModePrivatePAL = { { 'C', 'H', '7', 'x', 'x', 'x', 0, 0, 0, 0, 0, 0 }, TVTYPE_PAL, }; #define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DEFAULT #define MODESUFFIXNTSC 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,\ sizeof(struct CH7xxxModePrivate),(void *)&CH7xxxModePrivateNTSC,0,0.0,0.0 #define MODESUFFIXPAL 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,\ sizeof(struct CH7xxxModePrivate),(void *)&CH7xxxModePrivatePAL,0,0.0,0.0 /* dotclock is just for modeline validation */ static DisplayModeRec CH7011Modes[]={ { MODEPREFIX("640x480"), 23520, 640, 656, 744, 784, 0, 480, 487, 491, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("640x480"), 30000, 640, 680, 808, 1000, 0, 480, 520, 523, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600"), 39900, 800, 840, 976, 1064, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("800x600"), 34500, 800, 816, 880, 920, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("1024x768"), 54810, 1024, 1032, 1088, 1160, 0, 768, 780, 792, 945, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("1024x768"), 57000, 1024, 1040, 1112, 1200, 0, 768, 829, 840, 950, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("640x480Over"), 20160, 640, 648, 704, 720, 0, 480, 487, 491, 560, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("640x480Over"), 21000, 640, 664, 792, 840, 0, 480, 485, 491, 500, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600Over"), 35910, 800, 840, 984, 1080, 0, 600, 601, 604, 665, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("800x600Over"), 32500, 800, 832, 928, 1000, 0, 600, 600, 604, 650, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("1024x768Over"), 50400, 1024, 1040, 1112, 1200, 0, 768, 772, 776, 840, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("1024x768Over"), 49500, 1024, 1032, 1112, 1200, 0, 768, 771, 776, 825, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x480"), 25200, 720, 728, 776, 840, 0, 480, 511, 515, 600, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x576"), 28500, 720, 728, 744, 760, 0, 576, 635, 643, 750, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x480Noscale"), 27972, 720, 736, 768, 888, 0, 480, 480, 483, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x576Noscale"), 28000, 720, 728, 864, 896, 0, 576, 576, 579, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, }; static DisplayModeRec CH7019Modes[]={ { MODEPREFIX("640x480"), 23520, 640, 656, 744, 784, 0, 480, 487, 491, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("640x480"), 30000, 640, 680, 808, 1000, 0, 480, 520, 523, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600"), 39900, 800, 840, 976, 1064, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("800x600"), 34500, 800, 816, 880, 920, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("1024x768"), 54810, 1024, 1032, 1088, 1160, 0, 768, 780, 792, 945, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("1024x768"), 57000, 1024, 1040, 1112, 1200, 0, 768, 829, 840, 950, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("640x480Over"), 20160, 640, 648, 704, 720, 0, 480, 487, 491, 560, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("640x480Over"), 21000, 640, 664, 792, 840, 0, 480, 485, 491, 500, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600Over"), 35910, 800, 840, 984, 1080, 0, 600, 601, 604, 665, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("800x600Over"), 32500, 800, 832, 928, 1000, 0, 600, 600, 604, 650, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("1024x768Over"), 50400, 1024, 1040, 1112, 1200, 0, 768, 772, 776, 840, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("1024x768Over"), 49500, 1024, 1032, 1112, 1200, 0, 768, 771, 776, 825, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, }; typedef struct _VIATVMASKTABLE { CARD8 TV[VIA_BIOS_TABLE_NUM_TV_REG]; CARD8 CRTC1[VIA_BIOS_MAX_NUM_TV_CRTC]; CARD8 CRTC2[VIA_BIOS_MAX_NUM_TV_CRTC]; CARD8 misc1; CARD8 misc2; int numTV; int numCRTC1; int numCRTC2; } VIABIOSTVMASKTableRec, *VIABIOSTVMASKTablePtr; struct CH7xxxTableRec { char* name; CARD16 Width; CARD16 Height; int Standard; CARD8 TV[VIA_BIOS_TABLE_NUM_TV_REG]; /*35*/ CARD8 CRTC1[VIA_BIOS_MAX_NUM_TV_CRTC]; CARD8 Misc1[VIA_BIOS_NUM_TV_SPECIAL_REG]; CARD8 Misc2[VIA_BIOS_NUM_TV_SPECIAL_REG]; /*merge these three*/ CARD8 CRTC2_8BPP[VIA_BIOS_MAX_NUM_TV_CRTC]; CARD8 CRTC2_16BPP[VIA_BIOS_MAX_NUM_TV_CRTC]; CARD8 CRTC2_32BPP[VIA_BIOS_MAX_NUM_TV_CRTC]; CARD16 Patch2[VIA_BIOS_MAX_NUM_TV_PATCH]; CARD16 DotCrawlNTSC[VIA_BIOS_NUM_TV_OTHER]; }; static struct CH7xxxTableRec CH7011Table[] = { { "640x480", 640, 480, TVTYPE_NTSC, { 0X6A, /* 0x00 Mode 17 */ 0X3F, /* 0x01 FF Default 0x27 (was 7F) */ 0X7E, /* 0x02 VBW Default 0xBE (was 0x7E) */ 0X8B, /* 0x03 TE Decent Text 0x8B (was 8D) */ 0X28, /* 0x04 SAV Default 0x50 (was 0x21) */ 0X2C, /* 0x05 HP Default 0x50 (was 0x2E) */ 0X05, /* 0x06 VP Default 0x00 (was 0x04) */ 0X83, /* 0x07 BL Default 0x83 */ 0X03, /* 0x08 CE Default 0x03 */ 0X80, /* 0x09 TPC Default 0x80 */ 0X3F, /* 0x0A PLLM Default 0x3F */ 0X7E, /* 0x0B PLLN Default 0x7E */ 0X20, /* 0x0C FSCI Default 0x20 */ 0X80, /* 0x0D FSCI Default 0x80 */ 0X00, /* 0x0E FSCI Default 0x08 (was 00) */ 0X00, /* 0x0F FSCI Default 0xEB (was 00) */ 0, /* 0x10 CIVC */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* We don't touch these */ 0X48, /* 0x1C */ 0X40, /* 0x1D */ 0XD2, /* 0x1E */ 0X80, /* 0x1F */ 0X40, /* 0x20 */ 0, /* 0x21 */ 0, /* 0x22 */ }, { 0X5D, 0X4F, 0X4F, 0X81, 0X52, 0X9E, 0X56, 0XBA, 0, 0X60, 0, 0, 0, 0, 0, 0, 0X8, 0, 0XDF, 0, 0, 0XDF, 0X57, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X20, 0X40, 0X80, 0, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0XF, 0X7F, 0X7F, 0XF, 0X9A, 0X23, 0X8F, 0XEF, 0X57, 0XDF, 0XDF, 0X57, 0X11, 0XA, 0X8, 0X50, 0, 0, 0, 0, 0, 0X28, 0X50, 0, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XF, 0X7F, 0X7F, 0XF, 0X9A, 0X23, 0X8F, 0XEF, 0X57, 0XDF, 0XDF, 0X57, 0X11, 0XA, 0X8, 0X50, 0, 0, 0, 0, 0, 0X50, 0XA0, 0X40, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XF, 0X7F, 0X7F, 0XF, 0X9A, 0X23, 0X8F, 0XEF, 0X57, 0XDF, 0XDF, 0X57, 0X11, 0XA, 0X8, 0X50, 0, 0, 0, 0, 0, 0XA0, 0X40, 0X81, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X2284, 0, 0, 0, 0, 0, 0, 0 }, { 0X2, 0X811, 0X9217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }, { "640x480", 640, 480, TVTYPE_PAL, { 0X61, /* 0x00 PAL Mode 14 non-OS 640x480 1:1 */ 0X27, /* 0x01 FF Default 0x27 (was 7F) */ 0XBE, /* 0x02 VBW Default 0xBE (was 0x7E) */ 0X8B, /* 0x03 TE Decent Text 0x8B (was 8D) */ 0X28, /* 0x04 SAV Default 0x50 (was 0x21) */ 0X2C, /* 0x05 HP Default 0x50 (was 0x2E) */ 0X05, /* 0x06 VP Default 0x00 (was 0x04) */ 0X83, /* 0x07 BL Default 0x83 */ 0X01, /* 0x08 CE Default 0x03 */ 0X81, /* 0x09 TPC Default 0x80 */ 0X04, /* 0x0A PLLM Default 0x3F */ 0X09, /* 0x0B PLLN Default 0x7E */ 0X26, /* 0x0C FSCI Default 0x20 */ 0X6F, /* 0x0D FSCI Default 0x80 */ 0X1F, /* 0x0E FSCI Default 0x08 */ 0XD0, /* 0x0F FSCI Default 0xEB */ 0, /* 0x10 CIVC */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* We don't touch these */ 0X48, /* 0x1C */ 0X40, /* 0x1D */ 0XD2, /* 0x1E */ 0X80, /* 0x1F */ 0X40, /* 0x20 */ 0, /* 0x21 */ 0, /* 0x22 */ }, { 0X64, 0X4F, 0X4F, 0X88, 0X53, 0X83, 0X6F, 0XBA, 0, 0X40, 0, 0, 0, 0, 0, 0, 0X11, 0, 0XDF, 0, 0, 0XDF, 0X70, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X20, 0X40, 0X80, 0, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0X47, 0X7F, 0X7F, 0X47, 0X9A, 0X23, 0X95, 0X1E, 0X70, 0XDF, 0XDF, 0X70, 0X51, 0XA, 0X11, 0X5D, 0, 0, 0, 0, 0, 0X28, 0X50, 0, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X47, 0X7F, 0X7F, 0X47, 0X9A, 0X23, 0X95, 0X1E, 0X70, 0XDF, 0XDF, 0X70, 0X51, 0XA, 0X11, 0X5D, 0, 0, 0, 0, 0, 0X50, 0XA0, 0X40, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X47, 0X7F, 0X7F, 0X47, 0X9A, 0X23, 0X95, 0X1E, 0X70, 0XDF, 0XDF, 0X70, 0X51, 0XA, 0X11, 0X5D, 0, 0, 0, 0, 0, 0XA0, 0X40, 0X81, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X3284, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }, { "800x600", 800, 600, TVTYPE_NTSC, { 0XCF, /* 0x00 Mode 29 */ 0X27, /* 0x01 FF Default 0x27 (was 7F) */ 0XBE, /* 0x02 VBW Default 0xBE (was 0x76) */ 0X8B, /* 0x03 TE Decent Text 0x8B (was 8F) */ 0X59, /* 0x04 SAV*/ 0X3C, /* 0x05 HP */ 0X15, /* 0x06 VP */ 0X66, /* 0x07 BL Default 0x83 */ 0X3, /* 0x08 CE Default 0x03 */ 0X88, 0X59, 0X2E, 0X19, 0X8B, 0X3A, 0X63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0X48, 0X40, 0XD2, 0X80, 0X40, 0, 0, }, { 0X80, 0X63, 0X63, 0X84, 0X69, 0X1A, 0XEC, 0XF0, 0, 0X60, 0, 0, 0, 0, 0, 0, 0X5C, 0, 0X57, 0, 0, 0X57, 0XED, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0X40, 0X80, 0, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0X27, 0X1F, 0X1F, 0X27, 0XE3, 0X34, 0X48, 0XD6, 0XED, 0X57, 0X57, 0XED, 0X52, 0X12, 0X5C, 0X5D, 0, 0, 0, 0, 0, 0X32, 0X64, 0, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X27, 0X1F, 0X1F, 0X27, 0XE3, 0X34, 0X48, 0XD6, 0XED, 0X57, 0X57, 0XED, 0X52, 0X12, 0X5C, 0X5D, 0, 0, 0, 0, 0, 0X64, 0XC8, 0X40, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X27, 0X1F, 0X1F, 0X27, 0XE3, 0X34, 0X48, 0XD6, 0XED, 0X57, 0X57, 0XED, 0X52, 0X12, 0X5C, 0X5D, 0, 0, 0, 0, 0, 0XC8, 0X90, 0X81, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X5A84, 0, 0, 0, 0, 0, 0, 0 }, { 0X2, 0X811, 0X5117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }, { "800x600", 800, 600, TVTYPE_PAL, { 0XC3, 0X7F, 0XE0, 0X8F, 0X39, 0X3F, 0X38, 0X70, 0X3, 0X81, 0X21, 0X56, 0X1F, 0X87, 0X28, 0X18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0X48, 0X40, 0XD2, 0X80, 0X40, 0, 0, }, { 0X73, 0X63, 0X63, 0X97, 0X67, 0X91, 0XEC, 0XF0, 0, 0X60, 0, 0, 0, 0, 0, 0, 0X7E, 0, 0X57, 0, 0, 0X57, 0XED, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X20, 0X40, 0X80, 0, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0XBF, 0X1F, 0X1F, 0XBF, 0XDB, 0X33, 0X38, 0X8E, 0XED, 0X57, 0X57, 0XED, 0X52, 0X12, 0X74, 0X4D, 0, 0, 0, 0, 0, 0X32, 0X64, 0, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XBF, 0X1F, 0X1F, 0XBF, 0XDB, 0X33, 0X38, 0X8E, 0XED, 0X57, 0X57, 0XED, 0X52, 0X12, 0X74, 0X4D, 0, 0, 0, 0, 0, 0X64, 0XC8, 0X40, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XBF, 0X1F, 0X1F, 0XBF, 0XDB, 0X33, 0X38, 0X8E, 0XED, 0X57, 0X57, 0XED, 0X52, 0X12, 0X74, 0X4D, 0, 0, 0, 0, 0, 0XC8, 0X90, 0X81, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X3A84, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }, /*check these two modes*/ { "1024x768", 1024, 768, TVTYPE_NTSC, { 0XEE, 0X3F, /* 0x01 FF Default 0x27 (was 7F) */ 0X7E, 0X87, 0X49, 0X32, 0X9, 0X83, 0X3, 0X88, 0X47, 0X4D, 0X1B, 0XE4, 0X89, 0X51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0X48, 0X40, 0XD2, 0X80, 0X40, 0, 0, }, { 0X8C, 0X7F, 0X7F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0, 0, 0, 0, 0, 0 }, { 0, 0X40, 0X80, 0XE, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0X77, 0XFF, 0XFF, 0X77, 0X2B, 0X35, 0X1B, 0XBE, 0XE7, 0XFF, 0XFF, 0XE7, 0X9A, 0X13, 0X7, 0X7B, 0, 0, 0, 0, 0, 0X40, 0X80, 0, 0, 0, 0X80, 0X20, 0X8E, 0, 0, 0 }, { 0X77, 0XFF, 0XFF, 0X77, 0X2B, 0X35, 0X1B, 0XBE, 0XE7, 0XFF, 0XFF, 0XE7, 0X9A, 0X13, 0X7, 0X7B, 0, 0, 0, 0, 0, 0X80, 0, 0X41, 0, 0, 0X80, 0X20, 0X8E, 0, 0, 0 }, { 0X77, 0XFF, 0XFF, 0X77, 0X2B, 0X35, 0X1B, 0XBE, 0XE7, 0XFF, 0XFF, 0XE7, 0X9A, 0X13, 0X7, 0X7B, 0, 0, 0, 0, 0, 0, 0, 0X86, 0, 0, 0X80, 0X20, 0X8E, 0, 0, 0 }, { 0XC284, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }, { "640x480Over", 640, 480, TVTYPE_NTSC, { 0X69, /* 0x00 DM Mode 16 640x480 1/1 */ 0X3F, /* 0x01 FF Default 0x27 (was 7F) */ 0X7E, /* 0x02 VBW Default 0xBE (was 7E) */ 0X03, /* 0x03 TE Decent text 0x83 (was 8D) */ 0X18, /* 0x04 SAV Default 0x50 (was 10) */ 0X19, /* 0x05 HP Default 0x50 */ 0XFB, /* 0x06 VP Default 0x00 */ 0X83, /* 0x07 BL Default 0x83 (NTSC-J 66) */ 0X03, /* 0x08 CE Default 0x03 */ 0X80, /* 0x09 TPC Default 0x80 */ 0X3F, /* 0x0A PLLM Default 0x3F */ 0X6E, /* 0x0B PLLN Default 0x7E */ 0X25, /* 0x0C FSCI Default 0x25 */ 0X24, /* 0x0D FSCI Default 0x24 */ 0X92, /* 0x0E FSCI Default 0x9C (was 92) */ 0X49, /* 0x0F FSCI Default 0x7A (was 49) */ 0X00, /* 0x10 CIVC Default 0x01 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* We don't touch these */ 0X48, /* 0x1C CM Default 0x00 */ 0X40, /* 0x1D IC Default 0x88 */ 0XD2, /* 0x1E GPIO Default 0xC0 */ 0X80, /* 0x1F IDF Default 0x00 */ 0X40, /* 0x20 CD */ 0X00, /* 0x21 DC */ 0X00, /* 0x22 BCO Default 0x00 */ }, /* why is this #ifed, what's the difference? */ #if 0 { 0X55, 0X4F, 0X4F, 0X99, 0X51, 0X18, 0X2E, 0X3E, 0, 0X40, 0, 0, 0, 0, 0, 0, 0XE7, 0, 0XDF, 0, 0, 0XDF, 0X2F, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X20, 0X40, 0, 0, 0X87, 0X1C, 0, 0 }, { 0, 0, 0, 0X87, 0X1C, 0, 0, 0 }, { 0XCF, 0X7F, 0X7F, 0XCF, 0X92, 0X22, 0X87, 0XBC, 0X2F, 0XDF, 0XDF, 0X2F, 0X11, 0XA, 0XFF, 0X24, 0, 0, 0, 0, 0, 0X28, 0X50, 0, 0, 0, 0X80, 0, 0X80, 0, 0, 0 }, { 0XCF, 0X7F, 0X7F, 0XCF, 0X92, 0X22, 0X87, 0XBC, 0X2F, 0XDF, 0XDF, 0X2F, 0X11, 0XA, 0XFF, 0X24, 0, 0, 0, 0, 0, 0X50, 0XA0, 0X40, 0, 0, 0X80, 0, 0X80, 0, 0, 0 }, { 0XCF, 0X7F, 0X7F, 0XCF, 0X92, 0X22, 0X87, 0XBC, 0X2F, 0XDF, 0XDF, 0X2F, 0X11, 0XA, 0XFF, 0X24, 0, 0, 0, 0, 0, 0XA0, 0X40, 0X81, 0, 0, 0X80, 0, 0X80, 0, 0, 0 }, { 0X7107, 0, 0, 0, 0, 0, 0, 0 }, { 0X3, 0X811, 0XF416, 0X9F17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, #else { 0X5D, 0X4F, 0X4F, 0X81, 0X52, 0X9E, 0XB, 0X3E, 0, 0X60, 0, 0, 0, 0, 0, 0, 0XEE, 0, 0XDF, 0, 0, 0XDF, 0XC, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X20, 0X40, 0X80, 0, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0XF, 0X7F, 0X7F, 0XF, 0X9A, 0X23, 0X8F, 0XFF, 0XC, 0XDF, 0XDF, 0XC, 0X11, 0XA, 0XEE, 0X31, 0, 0, 0, 0, 0, 0X28, 0X50, 0, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XF, 0X7F, 0X7F, 0XF, 0X9A, 0X23, 0X8F, 0XFF, 0XC, 0XDF, 0XDF, 0XC, 0X11, 0XA, 0XEE, 0X31, 0, 0, 0, 0, 0, 0X50, 0XA0, 0X40, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XF, 0X7F, 0X7F, 0XF, 0X9A, 0X23, 0X8F, 0XFF, 0XC, 0XDF, 0XDF, 0XC, 0X11, 0XA, 0XEE, 0X31, 0, 0, 0, 0, 0, 0XA0, 0X40, 0X81, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X1184, 0, 0, 0, 0, 0, 0, 0 }, { 0X2, 0X811, 0XAD17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, #endif }, { "640x480Over", 640, 480, TVTYPE_PAL, { 0X60, /* 0x00 DM Mode 13 PAL 640x480 OS 5/4 */ 0X27, /* 0x01 FF Default 0x27 (was 7F) */ 0XBE, /* 0x02 VBW Default 0xBE (was 7E) */ 0X83, /* 0x03 TE Decent text 0x8B (was 8D) */ 0X10, /* 0x04 SAV Default 0x50 */ 0X19, /* 0x05 HP Default 0x50 */ 0XFB, /* 0x06 VP Default 0x00 */ 0X83, /* 0x07 BL Default 0x83 */ 0X01, /* 0x08 CE Default 0x03 */ 0X81, /* 0x09 TPC Default 0x80 */ 0X0D, /* 0x0A PLLM Default 0x3F */ 0X0B, /* 0x0B PLLN Default 0x7E */ 0X30, /* 0x0C FSCI Default 0x25 */ 0X0A, /* 0x0D FSCI Default 0x24 */ 0XE7, /* 0x0E FSCI Default 0x9C */ 0XC4, /* 0x0F FSCI Default 0x7A */ 0X00, /* 0x10 CIVC Default 0x01 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* We don't touch these */ 0X48, /* 0x1C CM Default 0x00 */ 0X40, /* 0x1D IC Default 0x88 */ 0XD2, /* 0x1E GPIO Default 0xC0 */ 0X80, /* 0x1F IDF Default 0x00 */ 0X40, /* 0x20 CD */ 0X00, /* 0x21 DC */ 0X00, /* 0x22 BCO Default 0x00 */ }, { 0X64, 0X4F, 0X4F, 0X88, 0X53, 0X83, 0XF2, 0X1F, 0, 0X40, 0, 0, 0, 0, 0, 0, 0XE5, 0, 0XDF, 0, 0, 0XDF, 0XF3, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X20, 0X40, 0X80, 0, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0X47, 0X7F, 0X7F, 0X47, 0X9A, 0X23, 0X95, 0XFF, 0XF3, 0XDF, 0XDF, 0XF3, 0X9, 0X9, 0XE5, 0X40, 0, 0, 0, 0, 0, 0X28, 0X50, 0, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X47, 0X7F, 0X7F, 0X47, 0X9A, 0X23, 0X95, 0XFF, 0XF3, 0XDF, 0XDF, 0XF3, 0X9, 0X9, 0XE5, 0X40, 0, 0, 0, 0, 0, 0X50, 0XA0, 0X40, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X47, 0X7F, 0X7F, 0X47, 0X9A, 0X23, 0X95, 0XFF, 0XF3, 0XDF, 0XDF, 0XF3, 0X9, 0X9, 0XE5, 0X40, 0, 0, 0, 0, 0, 0XA0, 0X40, 0X81, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X3184, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }, { "800x600Over", 800, 600, TVTYPE_NTSC, { 0XCE, /* 0x00 Mode 28 */ 0X27, /* 0x01 Default 0x27 (was 7F) */ 0XBE, /* 0x02 Default 0xBE (was 76) */ 0X8F, /* 0x03 */ 0X51, /* 0x04 */ 0X2E, /* 0x05 */ 0X10, /* 0x06 */ 0X83, /* 0x07 */ 0X3, /* 0x08 */ 0X81, /* 0x09 */ 0X13, /* 0x0A */ 0X3E, /* 0x0B */ 0X1C, /* 0x0C */ 0, /* 0x0D */ 0, /* 0x0E */ 0, /* 0x0F */ 0, /* 0x10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0X48, 0X40, 0XD2, 0X80, 0X40, 0, 0, }, { 0X7D, 0X63, 0X63, 0X81, 0X69, 0X18, 0XBA, 0XF0, 0, 0X60, 0, 0, 0, 0, 0, 0, 0X5A, 0, 0X57, 0, 0, 0X57, 0XBB, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0X40, 0X80, 0, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0XF, 0X1F, 0X1F, 0XF, 0XE3, 0X34, 0X44, 0XC6, 0XBB, 0X57, 0X57, 0XBB, 0X52, 0X12, 0X3F, 0X59, 0, 0, 0, 0, 0, 0X32, 0X64, 0, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XF, 0X1F, 0X1F, 0XF, 0XE3, 0X34, 0X44, 0XC6, 0XBB, 0X57, 0X57, 0XBB, 0X52, 0X12, 0X3F, 0X59, 0, 0, 0, 0, 0, 0X64, 0XC8, 0X40, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XF, 0X1F, 0X1F, 0XF, 0XE3, 0X34, 0X44, 0XC6, 0XBB, 0X57, 0X57, 0XBB, 0X52, 0X12, 0X3F, 0X59, 0, 0, 0, 0, 0, 0XC8, 0X90, 0X81, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X5284, 0, 0, 0, 0, 0, 0, 0 }, { 0X2, 0X811, 0XD017, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }, { "800x600Over", 800, 600, TVTYPE_PAL, { 0XC1, 0X7F, 0XE0, 0X8F, 0X20, 0X1D, 0X36, 0X70, 0X3, 0X94, 0X39, 0X87, 0X26, 0X79, 0X8C, 0XC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0X48, 0X40, 0XD2, 0X80, 0X40, 0, 0, }, { 0X71, 0X63, 0X63, 0X95, 0X67, 0X90, 0X6F, 0XF0, 0, 0X60, 0, 0, 0, 0, 0, 0, 0X57, 0, 0X57, 0, 0, 0X57, 0X70, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X20, 0X40, 0X80, 0, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0XAF, 0X1F, 0X1F, 0XAF, 0XDB, 0X33, 0X35, 0X8E, 0X70, 0X57, 0X57, 0X70, 0X52, 0X12, 0X57, 0X5A, 0, 0, 0, 0, 0, 0X32, 0X64, 0, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XAF, 0X1F, 0X1F, 0XAF, 0XDB, 0X33, 0X35, 0X8E, 0X70, 0X57, 0X57, 0X70, 0X52, 0X12, 0X57, 0X5A, 0, 0, 0, 0, 0, 0X64, 0XC8, 0X40, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XAF, 0X1F, 0X1F, 0XAF, 0XDB, 0X33, 0X35, 0X8E, 0X70, 0X57, 0X57, 0X70, 0X52, 0X12, 0X57, 0X5A, 0, 0, 0, 0, 0, 0XC8, 0X90, 0X81, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X2184, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }, { "1024x768Over", 1024, 768, TVTYPE_NTSC, { 0XED, 0X3F, /* 0x01 FF Default 0x27 (was 7F) */ 0X7E, 0X87, 0X49, 0X20, 0, 0X83, 0X3, 0X90, 0X89, 0X35, 0X1F, 0X61, 0X1A, 0X7C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0X48, 0X40, 0XD2, 0X80, 0X40, 0, 0, }, { 0X8C, 0X7F, 0X7F, 0X90, 0X81, 0X8, 0X46, 0XF5, 0, 0X60, 0, 0, 0, 0, 0, 0, 0X4, 0, 0XFF, 0, 0, 0XFF, 0X47, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0X40, 0X80, 0, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0X87, 0XFF, 0XFF, 0X87, 0X23, 0X34, 0X9, 0X38, 0X47, 0XFF, 0XFF, 0X47, 0X9A, 0X13, 0X4, 0X6F, 0, 0, 0, 0, 0, 0X40, 0X80, 0, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X87, 0XFF, 0XFF, 0X87, 0X23, 0X34, 0X9, 0X38, 0X47, 0XFF, 0XFF, 0X47, 0X9A, 0X13, 0X4, 0X6F, 0, 0, 0, 0, 0, 0X80, 0, 0X41, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X87, 0XFF, 0XFF, 0X87, 0X23, 0X34, 0X9, 0X38, 0X47, 0XFF, 0XFF, 0X47, 0X9A, 0X13, 0X4, 0X6F, 0, 0, 0, 0, 0, 0, 0, 0X86, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X5084, 0, 0, 0, 0, 0, 0, 0 }, { 0X2, 0X811, 0X4517, 0, 0, 0, 0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default 0x27 (was 7F) */ 0X7E, /* 0x02 VBW Default 0xBE (was 7E) */ 0X03, /* 0x03 TE Decent text 0x83 (was 8D) */ 0X18, /* 0x04 SAV Default 0x50 (was 10) */ 0X19, /* 0x05 HP Default 0x50 */ 0XFB, /* 0x06 VP Default 0x00 */ 0X83, /* 0x07 BL Default 0x83 (NTSC-J 66) */ 0X03, /* 0x08 CE Default 0x03 */ 0X80, /* 0x09 TPC Default 0x80 */ 0X3F, /* 0x0A PLLM Default 0x3F */ 0X7C, /* 0x0B PLLN Default 0x7C */ 0X21, /* 0x0C FSCI Default 0x25 */ 0X04, /* 0x0D FSCI Default 0x04 */ 0X10, /* 0x0E FSCI Default 0x10 */ 0X41, /* 0x0F FSCI Default 0x41 */ 0X00, /* 0x10 CIVC Default 0x01 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* We don't touch these */ 0X48, /* 0x1C CM Default 0x00 */ 0X40, /* 0x1D IC Default 0x88 */ 0XD2, /* 0x1E GPIO Default 0xC0 */ 0X80, /* 0x1F IDF Default 0x00 */ 0X40, /* 0x20 CD */ 0X00, /* 0x21 DC */ 0X00, /* 0x22 BCO Default 0x00 */ }, { 0X64, 0X59, 0X59, 0X88, 0X5B, 0X81, 0X56, 0X3E, 0, 0X40, 0, 0, 0, 0, 0, 0, 0XFF, 0, 0XDF, 0, 0, 0XDF, 0X57, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X20, 0X40, 0, 0X4, 0X87, 0X1C, 0, 0 }, { 0, 0, 0, 0X87, 0X1C, 0, 0, 0 }, { 0X47, 0XCF, 0XCF, 0X47, 0X9A, 0X23, 0XD9, 0XA, 0X57, 0XDF, 0XDF, 0X57, 0X51, 0XA, 0XFF, 0X3B, 0, 0, 0, 0, 0, 0X2D, 0X5A, 0, 0, 0, 0X80, 0, 0X80, 0, 0, 0 }, { 0X47, 0XCF, 0XCF, 0X47, 0X9A, 0X23, 0XD9, 0XA, 0X57, 0XDF, 0XDF, 0X57, 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{ "800x600", 800, 600, TVTYPE_NTSC, { 0XCF, 0X7F, 0X76, 0X8F, 0X59, 0X3C, 0X15, 0X83, 0X3, 0X88, 0X59, 0X2E, 0X19, 0X8B, 0X3A, 0X63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0X48, 0X40, 0XD2, 0X80, 0X40, 0, 0}, { 0X80, 0X63, 0X63, 0X84, 0X69, 0X1A, 0XEC, 0XF0, 0, 0X60, 0, 0, 0, 0, 0, 0, 0X5C, 0, 0X57, 0, 0, 0X57, 0XED, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0X40, 0X80, 0, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0X27, 0X1F, 0X1F, 0X27, 0XE3, 0X34, 0X48, 0XD6, 0XED, 0X57, 0X57, 0XED, 0X52, 0X12, 0X5C, 0X5D, 0, 0, 0, 0, 0, 0X32, 0X64, 0, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X27, 0X1F, 0X1F, 0X27, 0XE3, 0X34, 0X48, 0XD6, 0XED, 0X57, 0X57, 0XED, 0X52, 0X12, 0X5C, 0X5D, 0, 0, 0, 0, 0, 0X64, 0XC8, 0X40, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X27, 0X1F, 0X1F, 0X27, 0XE3, 0X34, 0X48, 0XD6, 0XED, 0X57, 0X57, 0XED, 0X52, 0X12, 0X5C, 0X5D, 0, 0, 0, 0, 0, 0XC8, 0X90, 0X81, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X5A84, 0, 0, 0, 0, 0, 0, 0 }, { 0X2, 0X811, 0X5117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }, { "800x600", 800, 600, TVTYPE_PAL, { 0XC3, 0X7F, 0XE0, 0X8F, 0X39, 0X3F, 0X38, 0X70, 0X3, 0X81, 0X21, 0X56, 0X1F, 0X87, 0X28, 0X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, 0, 0, 0XC8, 0X90, 0X81, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X5284, 0, 0, 0, 0, 0, 0, 0 }, { 0X2, 0X811, 0XD017, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { "800x600Over", 800, 600, TVTYPE_PAL, { 0XC1, 0X7F, 0XE0, 0X8F, 0X20, 0X1D, 0X36, 0X70, 0X3, 0X94, 0X39, 0X87, 0X26, 0X79, 0X8C, 0XC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0X48, 0X40, 0XD2, 0X80, 0X40, 0, 0}, { 0X71, 0X63, 0X63, 0X95, 0X67, 0X90, 0X6F, 0XF0, 0, 0X60, 0, 0, 0, 0, 0, 0, 0X57, 0, 0X57, 0, 0, 0X57, 0X70, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X20, 0X40, 0X80, 0, 0X47, 0X1C, 0, 0 }, { 0, 0, 0, 0X47, 0X1C, 0, 0, 0 }, { 0XAF, 0X1F, 0X1F, 0XAF, 0XDB, 0X33, 0X35, 0X8E, 0X70, 0X57, 0X57, 0X70, 0X52, 0X12, 0X57, 0X5A, 0, 0, 0, 0, 0, 0X32, 0X64, 0, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XAF, 0X1F, 0X1F, 0XAF, 0XDB, 0X33, 0X35, 0X8E, 0X70, 0X57, 0X57, 0X70, 0X52, 0X12, 0X57, 0X5A, 0, 0, 0, 0, 0, 0X64, 0XC8, 0X40, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0XAF, 0X1F, 0X1F, 0XAF, 0XDB, 0X33, 0X35, 0X8E, 0X70, 0X57, 0X57, 0X70, 0X52, 0X12, 0X57, 0X5A, 0, 0, 0, 0, 0, 0XC8, 0X90, 0X81, 0, 0, 0X80, 0X20, 0X90, 0, 0, 0 }, { 0X2184, 0, 0, 0, 0, 0, 0, 0 }, }, { "1024x768Over", 1024, 768, TVTY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0, 0XFF, 0, 0, 0XFF, 0XFF, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0, 0, 0, 0, 0, 0XFF, 0XFF, 0XFF, 0, 0, 0XFF, 0XFF, 0XFF, 0, 0, 0 }, 0X3F, 0X38,24,13,22 }; static const VIABIOSTVMASKTableRec ch7019MaskTable = { { 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF }, { 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0, 0XFF, 0, 0, 0, 0, 0, 0, 0XFF, 0, 0XFF, 0, 0, 0XFF, 0XFF, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0, 0, 0, 0, 0, 0XFF, 0XFF, 0XFF, 0, 0, 0XFF, 0XFF, 0XFF, 0, 0, 0 }, 0X3F, 0X38,24,13,22 }; #endif xf86-video-openchrome-0.6.0/src/via_3d.c0000664000175000017500000004571712760724526014625 00000000000000/* * Copyright 2006 Thomas Hellström. 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 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. */ #include "via_3d.h" #include "via_3d_reg.h" #include typedef struct { Bool supported; CARD32 col0; CARD32 col1; CARD32 al0; CARD32 al1; } ViaCompositeOperator; typedef struct { CARD32 pictFormat; Bool dstSupported; Bool texSupported; CARD32 dstFormat; CARD32 texFormat; } Via3DFormat; static ViaCompositeOperator viaOperatorModes[256]; static Via3DFormat via3DFormats[256]; #define VIA_NUM_3D_OPCODES 19 #define VIA_NUM_3D_FORMATS 15 #define VIA_FMT_HASH(arg) (((((arg) >> 1) + (arg)) >> 8) & 0xFF) static const CARD32 viaOpCodes[VIA_NUM_3D_OPCODES][5] = { {PictOpClear, 0x05, 0x45, 0x40, 0x80}, {PictOpSrc, 0x15, 0x45, 0x50, 0x80}, {PictOpDst, 0x05, 0x55, 0x40, 0x90}, {PictOpOver, 0x15, 0x52, 0x50, 0x91}, {PictOpOverReverse, 0x13, 0x45, 0x52, 0x90}, {PictOpIn, 0x03, 0x45, 0x42, 0x80}, {PictOpInReverse, 0x05, 0x42, 0x40, 0x81}, {PictOpOut, 0x13, 0x45, 0x52, 0x80}, {PictOpOutReverse, 0x05, 0x52, 0x40, 0x91}, {PictOpAtop, 0x03, 0x52, 0x42, 0x91}, {PictOpAtopReverse, 0x13, 0x42, 0x52, 0x81}, {PictOpXor, 0x15, 0x52, 0x52, 0x91}, {PictOpAdd, 0x15, 0x55, 0x50, 0x90}, {PictOpDisjointClear, 0x05, 0x45, 0x40, 0x80}, {PictOpDisjointSrc, 0x15, 0x45, 0x50, 0x80}, {PictOpDisjointDst, 0x05, 0x55, 0x40, 0x90}, {PictOpConjointClear, 0x05, 0x45, 0x40, 0x80}, {PictOpConjointSrc, 0x15, 0x45, 0x50, 0x80}, {PictOpConjointDst, 0x05, 0x55, 0x40, 0x90} }; static const CARD32 viaFormats[VIA_NUM_3D_FORMATS][5] = { {PICT_x1r5g5b5, HC_HDBFM_RGB555, HC_HTXnFM_RGB555, 1, 1}, {PICT_r5g6b5, HC_HDBFM_RGB565, HC_HTXnFM_RGB565, 1, 1}, {PICT_a4r4g4b4, HC_HDBFM_ARGB4444, HC_HTXnFM_ARGB4444, 1, 1}, {PICT_a1r5g5b5, HC_HDBFM_ARGB1555, HC_HTXnFM_ARGB1555, 1, 1}, {PICT_x1b5g5r5, HC_HDBFM_BGR555, HC_HTXnFM_BGR555, 1, 1}, {PICT_b5g6r5, HC_HDBFM_BGR565, HC_HTXnFM_BGR565, 1, 1}, {PICT_a4b4g4r4, HC_HDBFM_ABGR4444, HC_HTXnFM_ABGR4444, 1, 1}, {PICT_a1b5g5r5, HC_HDBFM_ABGR1555, HC_HTXnFM_ABGR1555, 1, 1}, {PICT_x8r8g8b8, HC_HDBFM_ARGB0888, HC_HTXnFM_ARGB0888, 1, 1}, {PICT_a8r8g8b8, HC_HDBFM_ARGB8888, HC_HTXnFM_ARGB8888, 1, 1}, {PICT_x8b8g8r8, HC_HDBFM_ABGR0888, HC_HTXnFM_ABGR0888, 1, 1}, {PICT_a8b8g8r8, HC_HDBFM_ABGR8888, HC_HTXnFM_ABGR8888, 1, 1}, {PICT_a8, 0x00, HC_HTXnFM_A8, 0, 1}, {PICT_a4, 0x00, HC_HTXnFM_A4, 0, 1}, {PICT_a1, 0x00, HC_HTXnFM_A1, 0, 1} }; static CARD32 via3DDstFormat(int format) { return via3DFormats[VIA_FMT_HASH(format)].dstFormat; } static CARD32 via3DTexFormat(int format) { return via3DFormats[VIA_FMT_HASH(format)].texFormat; } static Bool via3DDstSupported(int format) { Via3DFormat *fm = via3DFormats + VIA_FMT_HASH(format); if (fm->pictFormat != format) return FALSE; return fm->dstSupported; } static Bool via3DTexSupported(int format) { Via3DFormat *fm = via3DFormats + VIA_FMT_HASH(format); if (fm->pictFormat != format) return FALSE; return fm->texSupported; } static void viaSet3DDestination(Via3DState * v3d, CARD32 offset, CARD32 pitch, int format) { v3d->drawingDirty = TRUE; /* Affects planemask format. */ v3d->destDirty = TRUE; v3d->destOffset = offset; v3d->destPitch = pitch; v3d->destFormat = via3DDstFormat(format); v3d->destDepth = (v3d->destFormat < HC_HDBFM_ARGB0888) ? 16 : 32; } static void viaSet3DDrawing(Via3DState * v3d, int rop, CARD32 planeMask, CARD32 solidColor, CARD32 solidAlpha) { v3d->drawingDirty = TRUE; v3d->rop = rop; v3d->planeMask = planeMask; v3d->solidColor = solidColor; v3d->solidAlpha = solidAlpha; } static void viaSet3DFlags(Via3DState * v3d, int numTextures, Bool writeAlpha, Bool writeColor, Bool blend) { v3d->enableDirty = TRUE; v3d->blendDirty = TRUE; v3d->numTextures = numTextures; v3d->writeAlpha = writeAlpha; v3d->writeColor = writeColor; v3d->blend = blend; } static Bool viaOrder(CARD32 val, CARD32 * shift) { *shift = 0; while (val > (1 << *shift)) (*shift)++; return (val == (1 << *shift)); } static Bool viaSet3DTexture(Via3DState * v3d, int tex, CARD32 offset, CARD32 pitch, Bool npot, CARD32 width, CARD32 height, int format, ViaTextureModes sMode, ViaTextureModes tMode, ViaTexBlendingModes blendingMode, Bool agpTexture) { ViaTextureUnit *vTex = v3d->tex + tex; vTex->textureLevel0Offset = offset; vTex->npot = npot; if (!viaOrder(pitch, &vTex->textureLevel0Exp) && !vTex->npot) return FALSE; vTex->textureLevel0Pitch = pitch; if (!viaOrder(width, &vTex->textureLevel0WExp)) return FALSE; if (!viaOrder(height, &vTex->textureLevel0HExp)) return FALSE; if (pitch <= 4) { ErrorF("Warning: texture pitch <= 4 !\n"); } vTex->textureFormat = via3DTexFormat(format); switch (blendingMode) { case via_src: vTex->texCsat = (0x01 << 23) | (0x10 << 14) | (0x03 << 7) | 0x00; vTex->texAsat = ((0x0B << 14) | ((PICT_FORMAT_A(format) ? 0x04 : 0x02) << 7) | 0x03); vTex->texRCa = 0x00000000; vTex->texRAa = 0x00000000; vTex->texBColDirty = TRUE; break; case via_src_onepix_mask: vTex->texCsat = (0x01 << 23) | (0x09 << 14) | (0x03 << 7) | 0x00; vTex->texAsat = ((0x03 << 14) | ((PICT_FORMAT_A(format) ? 0x04 : 0x02) << 7) | 0x03); break; case via_src_onepix_comp_mask: vTex->texCsat = (0x01 << 23) | (0x09 << 14) | (0x03 << 7) | 0x00; vTex->texAsat = ((0x03 << 14) | ((PICT_FORMAT_A(format) ? 0x04 : 0x02) << 7) | 0x03); break; case via_mask: vTex->texCsat = (0x01 << 23) | (0x07 << 14) | (0x04 << 7) | 0x00; vTex->texAsat = (0x01 << 23) | (0x04 << 14) | (0x02 << 7) | 0x03; break; case via_comp_mask: vTex->texCsat = (0x01 << 23) | (0x03 << 14) | (0x04 << 7) | 0x00; vTex->texAsat = (0x01 << 23) | (0x04 << 14) | (0x02 << 7) | 0x03; break; default: return FALSE; } vTex->textureDirty = TRUE; vTex->textureModesS = sMode - via_single; vTex->textureModesT = tMode - via_single; vTex->agpTexture = agpTexture; return TRUE; } static void viaSet3DTexBlendCol(Via3DState * v3d, int tex, Bool component, CARD32 color) { CARD32 alpha; ViaTextureUnit *vTex = v3d->tex + tex; vTex->texRAa = (color >> 8) & 0x00FF0000; if (component) { vTex->texRCa = (color & 0x00FFFFFF); } else { alpha = color >> 24; vTex->texRCa = alpha | (alpha << 8) | (alpha << 16) | (alpha << 24); } vTex->texBColDirty = TRUE; } /* * Check if the compositing operator is supported and * return the corresponding register setting. */ static void viaSet3DCompositeOperator(Via3DState * v3d, CARD8 op) { ViaCompositeOperator *vOp = viaOperatorModes + op; if (v3d) v3d->blendDirty = TRUE; else return; if (vOp->supported) { v3d->blendCol0 = vOp->col0 << 4; v3d->blendCol1 = vOp->col1 << 2; v3d->blendAl0 = vOp->al0 << 4; v3d->blendAl1 = vOp->al1 << 2; } } static Bool via3DOpSupported(CARD8 op) { return viaOperatorModes[op].supported; } static void via3DEmitQuad(Via3DState * v3d, ViaCommandBuffer * cb, int dstX, int dstY, int src0X, int src0Y, int src1X, int src1Y, int w, int h) { CARD32 acmd; float dx1, dx2, dy1, dy2, sx1[2], sx2[2], sy1[2], sy2[2], wf; double scalex, scaley; int i, numTex; ViaTextureUnit *vTex; numTex = v3d->numTextures; dx1 = dstX; dx2 = dstX + w; dy1 = dstY; dy2 = dstY + h; if (numTex) { sx1[0] = src0X; sx1[1] = src1X; sy1[0] = src0Y; sy1[1] = src1Y; for (i = 0; i < numTex; ++i) { vTex = v3d->tex + i; scalex = 1. / (double)((1 << vTex->textureLevel0WExp)); scaley = 1. / (double)((1 << vTex->textureLevel0HExp)); sx2[i] = sx1[i] + w; sy2[i] = sy1[i] + h; sx1[i] *= scalex; sy1[i] *= scaley; sx2[i] *= scalex; sy2[i] *= scaley; } } wf = 0.05; /* * Vertex buffer. Emit two 3-point triangles. The W or Z coordinate * is needed for AGP DMA, and the W coordinate is for some obscure * reason needed for texture mapping to be done correctly. So emit * a w value after the x and y coordinates. */ BEGIN_H2(HC_ParaType_CmdVdata, 22 + numTex * 6); acmd = ((1 << 14) | (1 << 13) | (1 << 11)); if (numTex) acmd |= ((1 << 7) | (1 << 8)); OUT_RING_SubA(0xEC, acmd); acmd = 2 << 16; OUT_RING_SubA(0xEE, acmd); OUT_RING(*((CARD32 *) (&dx1))); OUT_RING(*((CARD32 *) (&dy1))); OUT_RING(*((CARD32 *) (&wf))); for (i = 0; i < numTex; ++i) { OUT_RING(*((CARD32 *) (sx1 + i))); OUT_RING(*((CARD32 *) (sy1 + i))); } OUT_RING(*((CARD32 *) (&dx2))); OUT_RING(*((CARD32 *) (&dy1))); OUT_RING(*((CARD32 *) (&wf))); for (i = 0; i < numTex; ++i) { OUT_RING(*((CARD32 *) (sx2 + i))); OUT_RING(*((CARD32 *) (sy1 + i))); } OUT_RING(*((CARD32 *) (&dx1))); OUT_RING(*((CARD32 *) (&dy2))); OUT_RING(*((CARD32 *) (&wf))); for (i = 0; i < numTex; ++i) { OUT_RING(*((CARD32 *) (sx1 + i))); OUT_RING(*((CARD32 *) (sy2 + i))); } OUT_RING(*((CARD32 *) (&dx1))); OUT_RING(*((CARD32 *) (&dy2))); OUT_RING(*((CARD32 *) (&wf))); for (i = 0; i < numTex; ++i) { OUT_RING(*((CARD32 *) (sx1 + i))); OUT_RING(*((CARD32 *) (sy2 + i))); } OUT_RING(*((CARD32 *) (&dx2))); OUT_RING(*((CARD32 *) (&dy1))); OUT_RING(*((CARD32 *) (&wf))); for (i = 0; i < numTex; ++i) { OUT_RING(*((CARD32 *) (sx2 + i))); OUT_RING(*((CARD32 *) (sy1 + i))); } OUT_RING(*((CARD32 *) (&dx2))); OUT_RING(*((CARD32 *) (&dy2))); OUT_RING(*((CARD32 *) (&wf))); for (i = 0; i < numTex; ++i) { OUT_RING(*((CARD32 *) (sx2 + i))); OUT_RING(*((CARD32 *) (sy2 + i))); } OUT_RING_SubA(0xEE, acmd | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK); OUT_RING_SubA(0xEE, acmd | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK); ADVANCE_RING; } static void via3DEmitState(Via3DState * v3d, ViaCommandBuffer * cb, Bool forceUpload) { int i; Bool saveHas3dState; ViaTextureUnit *vTex; /* * Destination buffer location, format and pitch. */ if (forceUpload || v3d->destDirty) { v3d->destDirty = FALSE; BEGIN_H2(HC_ParaType_NotTex, 3); OUT_RING_SubA(HC_SubA_HDBBasL, v3d->destOffset & 0x00FFFFFF); OUT_RING_SubA(HC_SubA_HDBBasH, v3d->destOffset >> 24); OUT_RING_SubA(HC_SubA_HDBFM, v3d->destFormat | (v3d->destPitch & HC_HDBPit_MASK) | HC_HDBLoc_Local); } if (forceUpload || v3d->blendDirty) { v3d->blendDirty = FALSE; BEGIN_H2(HC_ParaType_NotTex, 6); OUT_RING_SubA(HC_SubA_HABLRFCa, 0x00); OUT_RING_SubA(HC_SubA_HABLRFCb, 0x00); OUT_RING_SubA(HC_SubA_HABLCsat, v3d->blendCol0); OUT_RING_SubA(HC_SubA_HABLCop, v3d->blendCol1); OUT_RING_SubA(HC_SubA_HABLAsat, v3d->blendAl0); OUT_RING_SubA(HC_SubA_HABLAop, v3d->blendAl1); } if (forceUpload || v3d->drawingDirty) { CARD32 planeMaskLo, planeMaskHi; v3d->drawingDirty = FALSE; BEGIN_H2(HC_ParaType_NotTex, 4); /* * Raster operation and Planemask. */ if ( /* v3d->destDepth == 16 Bad Docs? */ FALSE) { planeMaskLo = (v3d->planeMask & 0x000000FF) << 16; planeMaskHi = (v3d->planeMask & 0x0000FF00) >> 8; } else { planeMaskLo = v3d->planeMask & 0x00FFFFFF; planeMaskHi = v3d->planeMask >> 24; } OUT_RING_SubA(HC_SubA_HROP, ((v3d->rop & 0x0F) << 8) | planeMaskHi); OUT_RING_SubA(HC_SubA_HFBBMSKL, planeMaskLo); /* * Solid shading color and alpha. Pixel center at * floating coordinates (X.5,Y.5). */ OUT_RING_SubA(HC_SubA_HSolidCL, (v3d->solidColor & 0x00FFFFFF) | (0 << 23)); OUT_RING_SubA(HC_SubA_HPixGC, (((v3d->solidColor & 0xFF000000) >> 16) | (0 << 23) | (v3d->solidAlpha & 0xFF))); } if (forceUpload || v3d->enableDirty) { v3d->enableDirty = FALSE; BEGIN_H2(HC_ParaType_NotTex, 1); OUT_RING_SubA(HC_SubA_HEnable, ((v3d->writeColor) ? HC_HenCW_MASK : 0) | ((v3d->blend) ? HC_HenABL_MASK : 0) | ((v3d->numTextures) ? HC_HenTXMP_MASK : 0) | ((v3d->writeAlpha) ? HC_HenAW_MASK : 0)); if (v3d->numTextures) { BEGIN_H2((HC_ParaType_Tex | (HC_SubType_TexGeneral << 8)), 2); OUT_RING_SubA(HC_SubA_HTXSMD, (0 << 7) | (0 << 6) | (((v3d->numTextures - 1) & 0x1) << 3) | (0 << 1) | 1); OUT_RING_SubA(HC_SubA_HTXSMD, (0 << 7) | (0 << 6) | (((v3d->numTextures - 1) & 0x1) << 3) | (0 << 1) | 0); } } for (i = 0; i < v3d->numTextures; ++i) { vTex = v3d->tex + i; if (forceUpload || vTex->textureDirty) { vTex->textureDirty = FALSE; BEGIN_H2((HC_ParaType_Tex | (((i == 0) ? HC_SubType_Tex0 : HC_SubType_Tex1) << 8)), 13); OUT_RING_SubA(HC_SubA_HTXnFM, (vTex->textureFormat | (vTex-> agpTexture ? HC_HTXnLoc_AGP : HC_HTXnLoc_Local))); OUT_RING_SubA(HC_SubA_HTXnL0BasL, vTex->textureLevel0Offset & 0x00FFFFFF); OUT_RING_SubA(HC_SubA_HTXnL012BasH, vTex->textureLevel0Offset >> 24); if (vTex->npot) { OUT_RING_SubA(HC_SubA_HTXnL0Pit, (vTex->textureLevel0Pitch & HC_HTXnLnPit_MASK) | HC_HTXnEnPit_MASK); } else { OUT_RING_SubA(HC_SubA_HTXnL0Pit, vTex->textureLevel0Exp << HC_HTXnLnPitE_SHIFT); } OUT_RING_SubA(HC_SubA_HTXnL0_5WE, vTex->textureLevel0WExp); OUT_RING_SubA(HC_SubA_HTXnL0_5HE, vTex->textureLevel0HExp); OUT_RING_SubA(HC_SubA_HTXnL0OS, 0x00); OUT_RING_SubA(HC_SubA_HTXnTB, 0x00); OUT_RING_SubA(HC_SubA_HTXnMPMD, ((((unsigned)vTex->textureModesT) << 19) | (((unsigned)vTex->textureModesS) << 16))); OUT_RING_SubA(HC_SubA_HTXnTBLCsat, vTex->texCsat); OUT_RING_SubA(HC_SubA_HTXnTBLCop, (0x00 << 22) | (0x00 << 19) | (0x00 << 14) | (0x02 << 11) | (0x00 << 7) | (0x03 << 3) | 0x02); OUT_RING_SubA(HC_SubA_HTXnTBLAsat, vTex->texAsat); OUT_RING_SubA(HC_SubA_HTXnTBLRFog, 0x00); } } for (i = 0; i < v3d->numTextures; ++i) { vTex = v3d->tex + i; if (forceUpload || vTex->texBColDirty) { saveHas3dState = cb->has3dState; vTex->texBColDirty = FALSE; BEGIN_H2((HC_ParaType_Tex | (((i == 0) ? HC_SubType_Tex0 : HC_SubType_Tex1) << 8)), 2); OUT_RING_SubA(HC_SubA_HTXnTBLRAa, vTex->texRAa); OUT_RING_SubA(HC_SubA_HTXnTBLRCa, vTex->texRCa); cb->has3dState = saveHas3dState; } } } /* * Cliprect. Considered not important for the DRM 3D State, so restore the * has3dState flag afterwards. */ static void via3DEmitClipRect(Via3DState * v3d, ViaCommandBuffer * cb, int x, int y, int w, int h) { Bool saveHas3dState; saveHas3dState = cb->has3dState; BEGIN_H2(HC_ParaType_NotTex, 4); OUT_RING_SubA(HC_SubA_HClipTB, (y << 12) | (y + h)); OUT_RING_SubA(HC_SubA_HClipLR, (x << 12) | (x + w)); cb->has3dState = saveHas3dState; } void viaInit3DState(Via3DState * v3d) { ViaCompositeOperator *op; int i; CARD32 tmp, hash; Via3DFormat *format; v3d->setDestination = viaSet3DDestination; v3d->setDrawing = viaSet3DDrawing; v3d->setFlags = viaSet3DFlags; v3d->setTexture = viaSet3DTexture; v3d->setTexBlendCol = viaSet3DTexBlendCol; v3d->opSupported = via3DOpSupported; v3d->setCompositeOperator = viaSet3DCompositeOperator; v3d->emitQuad = via3DEmitQuad; v3d->emitState = via3DEmitState; v3d->emitClipRect = via3DEmitClipRect; v3d->dstSupported = via3DDstSupported; v3d->texSupported = via3DTexSupported; for (i = 0; i < 256; ++i) { viaOperatorModes[i].supported = FALSE; } for (i = 0; i < VIA_NUM_3D_OPCODES; ++i) { op = viaOperatorModes + viaOpCodes[i][0]; op->supported = TRUE; op->col0 = viaOpCodes[i][1]; op->col1 = viaOpCodes[i][2]; op->al0 = viaOpCodes[i][3]; op->al1 = viaOpCodes[i][4]; } for (i = 0; i < 256; ++i) { via3DFormats[i].pictFormat = 0x00; } for (i = 0; i < VIA_NUM_3D_FORMATS; ++i) { tmp = viaFormats[i][0]; hash = VIA_FMT_HASH(tmp); format = via3DFormats + hash; if (format->pictFormat) { ErrorF("BUG: Bad hash function\n"); } format->pictFormat = tmp; format->dstSupported = (viaFormats[i][3] != 0x00); format->texSupported = (viaFormats[i][4] != 0x00); format->dstFormat = viaFormats[i][1]; format->texFormat = viaFormats[i][2]; } } xf86-video-openchrome-0.6.0/src/via_tmds.c0000664000175000017500000011765213055135676015264 00000000000000/* * Copyright 2016 Kevin Brace * Copyright 2015-2016 The OpenChrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 2014 SHS SERVICES GmbH * * 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 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. */ /* * via_tmds.c * * Handles initialization of TMDS (DVI) related resources and * controls the integrated TMDS transmitter found in CX700 and * later VIA Technologies chipsets. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "via_driver.h" #include "via_vt1632.h" #include "via_sii164.h" /* 1. Formula: 2^13 X 0.0698uSec [1/14.318MHz] = 8192 X 0.0698uSec =572.1uSec Timer = Counter x 572 uSec 2. Note: 0.0698 uSec is too small to compute for hardware. So we multiply a reference value(2^13) to make it big enough to compute for hardware. 3. Note: The meaning of the TD0~TD3 are count of the clock. TD(sec) = (sec)/(per clock) x (count of clocks) */ #define TD0 200 #define TD1 25 #define TD2 0 #define TD3 25 /* * Initializes most registers related to VIA Technologies IGP * integrated TMDS transmitter. Synchronization polarity and * display output source need to be set separately. */ static void viaTMDSInitRegisters(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaTMDSInitRegisters.\n")); /* Activate DVI + LVDS2 mode. */ /* 3X5.D2[5:4] - Display Channel Select * 00: LVDS1 + LVDS2 * 01: DVI + LVDS2 * 10: One Dual LVDS Channel (High Resolution Pannel) * 11: Single Channel DVI */ ViaCrtcMask(hwp, 0xD2, 0x10, 0x30); /* Various DVI PLL settings should be set to default settings. */ /* 3X5.D1[7] - PLL2 Reference Clock Edge Select Bit * 0: PLLCK lock to rising edge of reference clock * 1: PLLCK lock to falling edge of reference clock * 3X5.D1[6:5] - PLL2 Charge Pump Current Set Bits * 00: ICH = 12.5 uA * 01: ICH = 25.0 uA * 10: ICH = 37.5 uA * 11: ICH = 50.0 uA * 3X5.D1[4:1] - Reserved * 3X5.D1[0] - PLL2 Control Voltage Measurement Enable Bit */ ViaCrtcMask(hwp, 0xD1, 0x00, 0xE1); /* Disable DVI test mode. */ /* 3X5.D5[7] - PD1 Enable Selection * 1: Select by power flag * 0: By register * 3X5.D5[5] - DVI Testing Mode Enable * 3X5.D5[4] - DVI Testing Format Selection * 0: Half cycle * 1: LFSR mode */ ViaCrtcMask(hwp, 0xD5, 0x00, 0xB0); /* Disable DVI sense interrupt. */ /* 3C5.2B[7] - DVI Sense Interrupt Enable * 0: Disable * 1: Enable */ ViaSeqMask(hwp, 0x2B, 0x00, 0x80); /* Clear DVI sense interrupt status. */ /* 3C5.2B[6] - DVI Sense Interrupt Status * (This bit has a RW1C attribute.) */ ViaSeqMask(hwp, 0x2B, 0x40, 0x40); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaTMDSInitRegisters.\n")); } /* * Sets the polarity of horizontal synchronization and vertical * synchronization. */ static void viaTMDSSetSyncPolarity(ScrnInfoPtr pScrn, DisplayModePtr mode) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 cr97; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaTMDSSetSyncPolarity.\n")); /* 3X5.97[6] - DVI (TMDS) VSYNC Polarity * 0: Positive * 1: Negative * 3X5.97[5] - DVI (TMDS) HSYNC Polarity * 0: Positive * 1: Negative */ cr97 = hwp->readCrtc(hwp, 0x97); if (mode->Flags & V_NHSYNC) { cr97 |= 0x20; } else { cr97 &= (~0x20); } if (mode->Flags & V_NVSYNC) { cr97 |= 0x40; } else { cr97 &= (~0x40); } ViaCrtcMask(hwp, 0x97, cr97, 0x60); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaTMDSSetSyncPolarity.\n")); } /* * Sets IGA1 or IGA2 as the display output source for VIA Technologies IGP * integrated TMDS transmitter. */ static void viaTMDSSetSource(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 temp = displaySource; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaTMDSSetSource.\n")); /* Set integrated TMDS transmitter display output source. * The integrated TMDS transmitter appears to utilize LVDS1's data * source selection bit (3X5.99[4]). */ /* 3X5.99[4] - LVDS Channel1 Data Source Selection * 0: Primary Display * 1: Secondary Display */ ViaCrtcMask(hwp, 0x99, temp << 4, 0x10); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Integrated TMDS Transmitter Display Output Source: IGA%d\n", (temp & 0x01) + 1); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaTMDSSetSource.\n")); } /* * Returns TMDS receiver detection state for VIA Technologies IGP * integrated TMDS transmitter. */ static Bool viaTMDSSense(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 tmdsReceiverDetected = 0x00; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaTMDSSense.\n")); /* For now, faking DVI detection.*/ tmdsReceiverDetected = 0x01; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Integrated TMDS transmitter %s a TMDS receiver.\n", (tmdsReceiverDetected & 0x01) ? "detected" : "did not detect"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaTMDSSense.\n")); return tmdsReceiverDetected; } static void viaTMDSPower(ScrnInfoPtr pScrn, Bool powerState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaTMDSPower.\n")); if (powerState) { /* 3X5.91[7] - Software Direct On / Off Display Period in the Panel Path 0: On 1: Off */ ViaCrtcMask(hwp, 0x91, 0x00, 0x80); /* 3X5.91[0] - Hardware or Software Control Power Sequence 1: Software Control */ ViaCrtcMask(hwp, 0x91, 0x01, 0x01); usleep(TD0); /* 3X5.91[4] - Software VDD On 0: Off 1: On */ ViaCrtcMask(hwp, 0x91, 0x10, 0x10); usleep(TD1); /* 3X5.91[3] - Software Data On 0: Off 1: On */ ViaCrtcMask(hwp, 0x91, 0x08, 0x08); /* 3X5.D2[3] - Power Down (Active High) for DVI * 0: TMDS power on * 1: TMDS power down */ ViaCrtcMask(hwp, 0xD2, 0x00, 0x08); } else { ViaCrtcMask(hwp, 0xD2, 0x08, 0x08); ViaCrtcMask(hwp, 0x91, 0x00, 0x08); usleep(TD1); ViaCrtcMask(hwp, 0x91, 0x00, 0x10); } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Integrated TMDS (DVI) Power: %s\n", powerState ? "On" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaTMDSPower.\n")); } static void viaTMDSIOPadSetting(ScrnInfoPtr pScrn, Bool ioPadOn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 sr12, sr13, sr5a; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaTMDSIOPadSetting.\n")); if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { sr5a = hwp->readSeq(hwp, 0x5A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR5A: 0x%02X\n", sr5a)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 0.\n")); ViaSeqMask(hwp, 0x5A, sr5a & 0xFE, 0x01); } sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); switch (pVia->Chipset) { case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* 3C5.13[7:6] - DVP1D15 and DVP1D14 pin strappings * 00: LVDS1 + LVDS2 * 01: DVI + LVDS2 * 10: Dual LVDS (LVDS1 + LVDS2 used * simultaneously) * 11: DVI only */ if ((((~(sr13 & 0x80)) && (sr13 & 0x40)) || ((sr13 & 0x80) && (sr13 & 0x40))) || (pVia->isVIANanoBook)) { viaLVDS1SetIOPadSetting(pScrn, ioPadOn ? 0x03 : 0x00); } break; default: break; } if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { hwp->writeSeq(hwp, 0x5A, sr5a); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring 3C5.5A[0].\n")); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaTMDSIOPadSetting.\n")); } void viaExtTMDSSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 sr12, sr13, sr5a; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaExtTMDSSetDisplaySource.\n")); if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { sr5a = hwp->readSeq(hwp, 0x5A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR5A: 0x%02X\n", sr5a)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 0.\n")); ViaSeqMask(hwp, 0x5A, sr5a & 0xFE, 0x01); } sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); switch (pVia->Chipset) { case VIA_CLE266: /* 3C5.12[5] - FPD18 pin strapping * 0: DIP0 (Digital Interface Port 0) is used by * a TMDS transmitter (DVI) * 1: DIP0 (Digital Interface Port 0) is used by * a TV encoder */ if (!(sr12 & 0x20)) { viaDIP0SetDisplaySource(pScrn, displaySource); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DIP0 was not set up for " "TMDS transmitter use.\n"); } break; case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: /* 3C5.13[3] - DVP0D8 pin strapping * 0: AGP pins are used for AGP * 1: AGP pins are used by FPDP * (Flat Panel Display Port) * 3C5.12[6] - DVP0D6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - DVP0D5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder * 3C5.12[4] - DVP0D4 pin strapping * 0: Dual 12-bit FPDP (Flat Panel Display Port) * 1: 24-bit FPDP (Flat Panel Display Port) */ if ((sr12 & 0x40) && (!(sr12 & 0x20))) { viaDVP0SetDisplaySource(pScrn, displaySource); } else if ((sr13 & 0x08) && (!(sr12 & 0x10))) { viaDFPLowSetDisplaySource(pScrn, displaySource); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "None of the external ports were set up for " "TMDS transmitter use.\n"); } break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: /* 3C5.12[6] - FPD6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - FPD5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder */ if ((sr12 & 0x40) && (!(sr12 & 0x20))) { viaDVP0SetDisplaySource(pScrn, displaySource); } else if (!(sr12 & 0x10)) { viaDFPLowSetDisplaySource(pScrn, displaySource); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "None of the external ports were set up for " "TMDS transmitter use.\n"); } break; case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* 3C5.13[6] - DVP1 DVP / capture port selection * 0: DVP1 is used as a DVP (Digital Video Port) * 1: DVP1 is used as a capture port */ if (!(sr13 & 0x40)) { viaDVP1SetDisplaySource(pScrn, displaySource); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DVP1 is not set up for TMDS " "transmitter use.\n"); } break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unrecognized IGP for " "TMDS transmitter use.\n"); break; } if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { hwp->writeSeq(hwp, 0x5A, sr5a); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring 3C5.5A[0].\n")); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaExtTMDSSetDisplaySource.\n")); } void viaExtTMDSEnableIOPads(ScrnInfoPtr pScrn, CARD8 ioPadState) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 sr12, sr13, sr5a; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaExtTMDSEnableIOPads.\n")); if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { sr5a = hwp->readSeq(hwp, 0x5A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR5A: 0x%02X\n", sr5a)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 0.\n")); ViaSeqMask(hwp, 0x5A, sr5a & 0xFE, 0x01); } sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); switch (pVia->Chipset) { case VIA_CLE266: /* 3C5.12[5] - FPD18 pin strapping * 0: DIP0 (Digital Interface Port 0) is used by * a TMDS transmitter (DVI) * 1: DIP0 (Digital Interface Port 0) is used by * a TV encoder */ if (!(sr12 & 0x20)) { viaDIP0EnableIOPads(pScrn, ioPadState); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DIP0 was not set up for " "TMDS transmitter use.\n"); } break; case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: /* 3C5.13[3] - DVP0D8 pin strapping * 0: AGP pins are used for AGP * 1: AGP pins are used by FPDP * (Flat Panel Display Port) * 3C5.12[6] - DVP0D6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - DVP0D5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder * 3C5.12[4] - DVP0D4 pin strapping * 0: Dual 12-bit FPDP (Flat Panel Display Port) * 1: 24-bit FPDP (Flat Panel Display Port) */ if ((sr12 & 0x40) && (!(sr12 & 0x20))) { viaDVP0EnableIOPads(pScrn, ioPadState); } else if ((sr13 & 0x08) && (!(sr12 & 0x10))) { viaDFPLowEnableIOPads(pScrn, ioPadState); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "None of the external ports were set up for " "TMDS transmitter use.\n"); } break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: /* 3C5.12[6] - FPD6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - FPD5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder */ if ((sr12 & 0x40) && (!(sr12 & 0x20))) { viaDVP0EnableIOPads(pScrn, ioPadState); } else if (!(sr12 & 0x10)) { viaDFPLowEnableIOPads(pScrn, ioPadState); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "None of the external ports were set up for " "TMDS transmitter use.\n"); } break; case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* 3C5.13[6] - DVP1 DVP / capture port selection * 0: DVP1 is used as a DVP (Digital Video Port) * 1: DVP1 is used as a capture port */ if (!(sr13 & 0x40)) { viaDVP1EnableIOPads(pScrn, ioPadState); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DVP1 is not set up for TMDS " "transmitter use.\n"); } break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unrecognized IGP for " "TMDS transmitter use.\n"); break; } if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { hwp->writeSeq(hwp, 0x5A, sr5a); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring 3C5.5A[0].\n")); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaExtTMDSEnableIOPads.\n")); } void viaExtTMDSSetClockDriveStrength(ScrnInfoPtr pScrn, CARD8 clockDriveStrength) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 sr12, sr13, sr5a; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaExtTMDSSetClockDriveStrength.\n")); if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { sr5a = hwp->readSeq(hwp, 0x5A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR5A: 0x%02X\n", sr5a)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 0.\n")); ViaSeqMask(hwp, 0x5A, sr5a & 0xFE, 0x01); } sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); switch (pVia->Chipset) { case VIA_CLE266: /* 3C5.12[5] - FPD18 pin strapping * 0: DIP0 (Digital Interface Port 0) is used by * a TMDS transmitter (DVI) * 1: DIP0 (Digital Interface Port 0) is used by * a TV encoder */ if (!(sr12 & 0x20)) { viaDIP0SetClockDriveStrength(pScrn, clockDriveStrength); } break; case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: /* 3C5.12[6] - DVP0D6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - DVP0D5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder */ if ((sr12 & 0x40) && (!(sr12 & 0x20))) { viaDVP0SetClockDriveStrength(pScrn, clockDriveStrength); } break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: /* 3C5.12[6] - FPD6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - FPD5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder */ if ((sr12 & 0x40) && (!(sr12 & 0x20))) { viaDVP0SetClockDriveStrength(pScrn, clockDriveStrength); } break; case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* 3C5.13[6] - DVP1 DVP / capture port selection * 0: DVP1 is used as a DVP (Digital Video Port) * 1: DVP1 is used as a capture port */ if (!(sr13 & 0x40)) { viaDVP1SetClockDriveStrength(pScrn, clockDriveStrength); } break; default: break; } if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { hwp->writeSeq(hwp, 0x5A, sr5a); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring 3C5.5A[0].\n")); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaExtTMDSSetClockDriveStrength.\n")); } void viaExtTMDSSetDataDriveStrength(ScrnInfoPtr pScrn, CARD8 dataDriveStrength) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 sr12, sr13, sr5a; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaExtTMDSSetDataDriveStrength.\n")); if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { sr5a = hwp->readSeq(hwp, 0x5A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR5A: 0x%02X\n", sr5a)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 0.\n")); ViaSeqMask(hwp, 0x5A, sr5a & 0xFE, 0x01); } sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); switch (pVia->Chipset) { case VIA_CLE266: /* 3C5.12[5] - FPD18 pin strapping * 0: DIP0 (Digital Interface Port 0) is used by * a TMDS transmitter (DVI) * 1: DIP0 (Digital Interface Port 0) is used by * a TV encoder */ if (!(sr12 & 0x20)) { viaDIP0SetDataDriveStrength(pScrn, dataDriveStrength); } break; case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: /* 3C5.12[6] - DVP0D6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - DVP0D5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder */ if ((sr12 & 0x40) && (!(sr12 & 0x20))) { viaDVP0SetDataDriveStrength(pScrn, dataDriveStrength); } break; case VIA_P4M890: case VIA_K8M890: case VIA_P4M900: /* 3C5.12[6] - FPD6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) * 1: Enable DVP0 (Digital Video Port 0) * 3C5.12[5] - FPD5 pin strapping * 0: DVP0 is used by a TMDS transmitter (DVI) * 1: DVP0 is used by a TV encoder */ if ((sr12 & 0x40) && (!(sr12 & 0x20))) { viaDVP0SetDataDriveStrength(pScrn, dataDriveStrength); } break; case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* 3C5.13[6] - DVP1 DVP / capture port selection * 0: DVP1 is used as a DVP (Digital Video Port) * 1: DVP1 is used as a capture port */ if (!(sr13 & 0x40)) { viaDVP1SetDataDriveStrength(pScrn, dataDriveStrength); } break; default: break; } if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { hwp->writeSeq(hwp, 0x5A, sr5a); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring 3C5.5A[0].\n")); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaExtTMDSSetDataDriveStrength.\n")); } static void via_tmds_create_resources(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_create_resources.\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_create_resources.\n")); } static void via_tmds_dpms(xf86OutputPtr output, int mode) { ScrnInfoPtr pScrn = output->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_dpms.\n")); switch (mode) { case DPMSModeOn: viaTMDSPower(pScrn, TRUE); viaTMDSIOPadSetting(pScrn, TRUE); break; case DPMSModeStandby: case DPMSModeSuspend: case DPMSModeOff: viaTMDSPower(pScrn, FALSE); viaTMDSIOPadSetting(pScrn, FALSE); break; default: break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_dpms.\n")); } static void via_tmds_save(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_save.\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_save.\n")); } static void via_tmds_restore(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_restore.\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_restore.\n")); } static int via_tmds_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { ScrnInfoPtr pScrn = output->scrn; int status; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_mode_valid.\n")); if (!ViaModeDotClockTranslate(pScrn, pMode)) { status = MODE_NOCLOCK; } else { status = MODE_OK; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_mode_valid.\n")); return status; } static Bool via_tmds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { ScrnInfoPtr pScrn = output->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_mode_fixup.\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_mode_fixup.\n")); return TRUE; } static void via_tmds_prepare(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_prepare.\n")); viaTMDSPower(pScrn, FALSE); viaTMDSIOPadSetting(pScrn, FALSE); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_prepare.\n")); } static void via_tmds_commit(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_commit.\n")); viaTMDSPower(pScrn, TRUE); viaTMDSIOPadSetting(pScrn, TRUE); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_commit.\n")); } static void via_tmds_mode_set(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { ScrnInfoPtr pScrn = output->scrn; drmmode_crtc_private_ptr iga = output->crtc->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_mode_set.\n")); /* Initialize VIA IGP integrated TMDS transmitter registers. */ viaTMDSInitRegisters(pScrn); /* Set integrated TMDS transmitter synchronization polarity for * both horizontal synchronization and vertical synchronization. */ viaTMDSSetSyncPolarity(pScrn, adjusted_mode); if (output->crtc) { viaTMDSSetSource(pScrn, iga->index ? 0x01 : 0x00); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_mode_set.\n")); } static xf86OutputStatus via_tmds_detect(xf86OutputPtr output) { xf86MonPtr mon; xf86OutputStatus status = XF86OutputStatusDisconnected; ScrnInfoPtr pScrn = output->scrn; VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_detect.\n")); /* Check for DVI presence by sensing the TMDS receiver connected * to the integrated TMDS transmitter. */ if (viaTMDSSense(pScrn)) { if (!pVia->pI2CBus2) { goto exit; } /* Assume that only I2C bus 2 is used for the DVI connected to the * integrated TMDS transmitter. */ if (!xf86I2CProbeAddress(pVia->pI2CBus2, 0xA0)) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "I2C device on I2C Bus 2 does not support EDID.\n"); goto exit; } xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Obtaining EDID for DVI.\n"); /* Since DVI presence was established, access the I2C bus, * in order to obtain EDID from the monitor. */ mon = xf86OutputGetEDID(output, pVia->pI2CBus2); /* Is the interface type digital? */ if (mon && DIGITAL(mon->features.input_type)) { status = XF86OutputStatusConnected; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected a monitor connected to DVI.\n"); xf86OutputSetEDID(output, mon); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Could not obtain EDID from a monitor " "connected to DVI.\n"); } } exit: DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_detect.\n")); return status; } #ifdef RANDR_12_INTERFACE static Bool via_tmds_set_property(xf86OutputPtr output, Atom property, RRPropertyValuePtr value) { ScrnInfoPtr pScrn = output->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_set_property.\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_set_property.\n")); return TRUE; } #endif #ifdef RANDR_13_INTERFACE static Bool via_tmds_get_property(xf86OutputPtr output, Atom property) { ScrnInfoPtr pScrn = output->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_get_property.\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_get_property.\n")); return FALSE; } #endif static void via_tmds_destroy(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tmds_destroy.\n")); if (output->driver_private) { free(output->driver_private); } output->driver_private = NULL; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_tmds_destroy.\n")); } static const xf86OutputFuncsRec via_tmds_funcs = { .create_resources = via_tmds_create_resources, .dpms = via_tmds_dpms, .save = via_tmds_save, .restore = via_tmds_restore, .mode_valid = via_tmds_mode_valid, .mode_fixup = via_tmds_mode_fixup, .prepare = via_tmds_prepare, .commit = via_tmds_commit, .mode_set = via_tmds_mode_set, .detect = via_tmds_detect, .get_modes = xf86OutputGetEDIDModes, #ifdef RANDR_12_INTERFACE .set_property = via_tmds_set_property, #endif #ifdef RANDR_13_INTERFACE .get_property = via_tmds_get_property, #endif .destroy = via_tmds_destroy, }; Bool viaTMDSInit(ScrnInfoPtr pScrn) { xf86OutputPtr output; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIATMDSRecPtr pVIATMDSRec = NULL; CARD8 sr13, sr5a; Bool status = FALSE; char outputNameBuffer[32]; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaTMDSInit.\n")); sr5a = hwp->readSeq(hwp, 0x5A); ViaSeqMask(hwp, 0x5A, sr5a | 0x01, 0x01); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); hwp->writeSeq(hwp, 0x5A, sr5a); /* 3C5.13[7:6] - Integrated LVDS / DVI Mode Select * (DVP1D15-14 pin strapping) * 00: LVDS1 + LVDS2 * 01: DVI + LVDS2 * 10: Dual LVDS Channel (High Resolution Panel) * 11: One DVI only (decrease the clock jitter) */ /* Check for DVI presence using pin strappings. * VIA Technologies NanoBook reference design based products * have their pin strappings set to a wrong setting to communicate * the presence of DVI, so it requires special handling here. */ if ((((~(sr13 & 0x80)) && (sr13 & 0x40)) || ((sr13 & 0x80) && (sr13 & 0x40))) || (pVia->isVIANanoBook)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Integrated TMDS transmitter found via pin strapping.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Integrated TMDS transmitter not found.\n"); goto exit; } pVIATMDSRec = xnfcalloc(1, sizeof(VIATMDSRec)); if (!pVIATMDSRec) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate working storage for integrated " "TMDS transmitter.\n"); goto exit; } /* The code to dynamically designate the particular DVI (i.e., DVI-1, * DVI-2, etc.) for xrandr was borrowed from xf86-video-r128 DDX. */ sprintf(outputNameBuffer, "DVI-%d", (pVia->numberDVI + 1)); output = xf86OutputCreate(pScrn, &via_tmds_funcs, outputNameBuffer); if (!output) { free(pVIATMDSRec); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate X Server display output record for " "integrated TMDS transmitter.\n"); goto exit; } output->driver_private = pVIATMDSRec; /* Since there are two (2) display controllers registered with the * X.Org Server and both IGA1 and IGA2 can handle DVI without any * limitations, possible_crtcs should be set to 0x3 (0b11) so that * either display controller can get assigned to handle DVI. */ output->possible_crtcs = (1 << 1) | (1 << 0); output->possible_clones = 0; output->interlaceAllowed = FALSE; output->doubleScanAllowed = FALSE; pVia->numberDVI++; status = TRUE; exit: DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaTMDSInit.\n")); return status; } void via_dvi_init(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_dvi_init.\n")); if (!pVia->pI2CBus2 || !pVia->pI2CBus3) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I2C Bus 2 or I2C Bus 3 does not exist.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_dvi_init.\n")); return; } /* Check to see if we are dealing with the latest VIA chipsets. */ if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { if (!viaTMDSInit(pScrn)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Integrated TMDS transmitter for DVI not found.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Integrated TMDS transmitter for DVI was " "initialized successfully.\n"); } } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Probing I2C Bus 2 for VT1632.\n"); if (!viaVT1632Init(pScrn, pVia->pI2CBus2)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "I2C Bus 2 was not initialized for DVI use.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1632 attached to I2C Bus 2 was initialized " "successfully for DVI use.\n"); } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Probing I2C Bus 3 for VT1632.\n"); if (!viaVT1632Init(pScrn, pVia->pI2CBus3)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "I2C Bus 3 was not initialized for DVI use.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1632 attached to I2C Bus 3 was initialized " "successfully for DVI use.\n"); } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Probing I2C Bus 2 for SiI 164.\n"); if (!viaSiI164Init(pScrn, pVia->pI2CBus2)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "I2C Bus 2 was not initialized for DVI use.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SiI 164 attached to I2C Bus 2 was initialized " "successfully for DVI use.\n"); } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Probing I2C Bus 3 for SiI 164.\n"); if (!viaSiI164Init(pScrn, pVia->pI2CBus3)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "I2C Bus 3 was not initialized for DVI use.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SiI 164 attached to I2C Bus 3 was initialized " "successfully for DVI use.\n"); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_dvi_init.\n")); } xf86-video-openchrome-0.6.0/src/xvmc/0000775000175000017500000000000013057514156014327 500000000000000xf86-video-openchrome-0.6.0/src/xvmc/viaXvMCPriv.h0000664000175000017500000001743712760724526016616 00000000000000/***************************************************************************** * VIA Unichrome XvMC extension client lib. * * Copyright (c) 2004 Thomas Hellström. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHOR(S) OR COPYRIGHT HOLDER(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. */ #ifndef _VIAXVMCPRIV_H #define _VIAXVMCPRIV_H 1 #include #include #include #include #include #include "vldXvMC.h" #include "via_xvmc.h" typedef struct { int x; int y; int w; int h; } XvMCRegion; extern Status _xvmc_create_context(Display * dpy, XvMCContext * context, int *priv_count, uint ** priv_data); extern Status _xvmc_destroy_context(Display * dpy, XvMCContext * context); extern Status _xvmc_create_surface(Display * dpy, XvMCContext * context, XvMCSurface * surface, int *priv_count, uint ** priv_data); extern Status _xvmc_destroy_surface(Display * dpy, XvMCSurface * surface); extern Status _xvmc_create_subpicture(Display * dpy, XvMCContext * context, XvMCSubpicture * subpicture, int *priv_count, uint ** priv_data); extern Status _xvmc_destroy_subpicture(Display * dpy, XvMCSubpicture * subpicture); #define VIA_SUBPIC_PALETTE_SIZE 16 /*Number of colors in subpicture palette */ #define VIA_CBUFFERSIZE 4096 /*Hardware command buffer size */ #define VIA_MAX_BUFS 2 /*Number of YUV buffers per surface */ #define VIA_MAX_RENDSURF 3 /*Maximum numbers of surfaces per context * that can answer RENDERING to a rendering * query */ typedef enum { context_drawHash, context_lowLevel, context_mutex, context_sAreaMap, context_fbMap, context_mmioMap, context_drmContext, context_fd, context_driConnection, context_context, context_none } ContextRes; typedef struct { unsigned ctxNo; /* XvMC private context reference number */ pthread_mutex_t ctxMutex; /* Mutex for multi-threading. Not used */ drm_context_t drmcontext; /* The drm context */ drm_handle_t fbOffset; /* Handle to drm frame-buffer area */ drm_handle_t mmioOffset; /* Handle to drm mmio area */ drm_handle_t sAreaOffset; /* Handle to drm shared memory area */ unsigned fbSize; /* Size of drm frame-buffer area */ unsigned mmioSize; /* Size of drm mmio area */ unsigned sAreaSize; /* Size of drm shared memory area */ unsigned sAreaPrivOffset; /* Offset in sarea to private part */ drmAddress fbAddress; /* Virtual address of frame buffer area */ drmAddress mmioAddress; /* Virtual address of mmio area */ drmAddress sAreaAddress; /* Virtual address of shared memory area */ char busIdString[21]; /* Busid of video card */ unsigned yStride; /* Y stride of surfaces in this context */ int fd; /* FD for connection to drm module */ unsigned char intra_quantiser_matrix[64]; unsigned char non_intra_quantiser_matrix[64]; unsigned char chroma_intra_quantiser_matrix[64]; unsigned char chroma_non_intra_quantiser_matrix[64]; unsigned rendSurf[VIA_MAX_RENDSURF]; /* Which surfaces answer rendering to * a rendering query */ int decoderOn; /* Decoder switched on ? */ int intraLoaded; /* Intra quantiser matrix loaded in * decoder? */ int nonIntraLoaded; /* Non-Intra quantiser matrix loaded * in decoder */ int chromaIntraLoaded; int chromaNonIntraLoaded; int haveDecoder; /* Does this context own decoder? */ int attribChanged; /* Attributes have changed and need to * be uploaded to Xv at next frame * display */ drmLockPtr hwLock; /* Virtual address Pointer to the * heavyweight drm hardware lock */ unsigned xvMCPort; /* XvMC private port. Corresponds to * an Xv port, but not by number */ ViaXvMCAttrHolder attrib; /* This contexts attributes and their * values */ XvAttribute attribDesc[VIA_NUM_XVMC_ATTRIBUTES]; /* Attribute decriptions */ int useAGP; /* Use the AGP ringbuffer to upload data to the chip */ void *xl; /* Lowlevel context. Opaque to us. */ int haveXv; /* Have I initialized the Xv * connection for this surface? */ XvImage *xvImage; /* Fake Xv Image used for command * buffer transport to the X server */ GC gc; /* X GC needed for displaying */ Drawable draw; /* Drawable to undisplay from */ XvPortID port; /* Xv Port ID when displaying */ int lastSrfDisplaying; ContextRes resources; CARD32 timeStamp; CARD32 videoTimeStamp; XID id; unsigned screen; unsigned depth; unsigned stride; XVisualInfo visualInfo; void *drawHash; CARD32 chipId; XvMCRegion sRegion; XvMCRegion dRegion; } ViaXvMCContext; typedef struct { pthread_mutex_t subMutex; /* Currently not used. */ unsigned srfNo; /* XvMC private surface number */ unsigned offset; /* Offset into frame-buffer area */ unsigned stride; /* Storage stride */ unsigned width; /* Width */ unsigned height; /* Height */ CARD32 palette[VIA_SUBPIC_PALETTE_SIZE]; /* YUV Palette */ ViaXvMCContext *privContext; /* Pointer to context private data */ int ia44; /* IA44 or AI44 format */ int needsSync; CARD32 timeStamp; } ViaXvMCSubPicture; typedef struct { pthread_mutex_t srfMutex; /* For multithreading. Not used. */ pthread_cond_t bufferAvailable; /* For multithreading. Not used. */ unsigned srfNo; /* XvMC private surface numbers */ unsigned numBuffers; /* Number of picture buffers */ unsigned curBuf; /* Which is the current buffer? */ unsigned offsets[VIA_MAX_BUFS]; /* Offsets of picture buffers * into the frame-buffer area */ unsigned yStride; /* Stride of YUV420 Y component. */ unsigned width; /* Dimensions */ unsigned height; int progressiveSequence; /* Mpeg progressive picture? Hmm? */ ViaXvMCContext *privContext; /* XvMC context private part. */ ViaXvMCSubPicture *privSubPic; /* Subpicture to be blended when * displaying. NULL if none. */ int needsSync; int syncMode; CARD32 timeStamp; int topFieldFirst; } ViaXvMCSurface; /* * Take and release the global drm hardware lock. */ #define HW_LOCK(ctx) \ DRM_LOCK((ctx)->fd,(ctx)->hwLock,(ctx)->drmcontext,0) #define HW_UNLOCK(ctx) \ DRM_UNLOCK((ctx)->fd,(ctx->hwLock),(ctx)->drmcontext) /* * Low-level Mpeg functions in viaLowLevel.c */ #define VIABLIT_TRANSCOPY 0 #define VIABLIT_COPY 1 #define VIABLIT_FILL 2 #endif xf86-video-openchrome-0.6.0/src/xvmc/xf86dri.h0000664000175000017500000001040412760724526015715 00000000000000/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.8 2002/10/30 12:51:25 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, 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, 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 PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. **************************************************************************/ /** * \file xf86dri.h * Protocol numbers and function prototypes for DRI X protocol. * * \author Kevin E. Martin * \author Jens Owen * \author Rickard E. (Rik) Faith */ #ifndef _XF86DRI_H_ #define _XF86DRI_H_ #include #include #define X_XF86DRIQueryVersion 0 #define X_XF86DRIQueryDirectRenderingCapable 1 #define X_XF86DRIOpenConnection 2 #define X_XF86DRICloseConnection 3 #define X_XF86DRIGetClientDriverName 4 #define X_XF86DRICreateContext 5 #define X_XF86DRIDestroyContext 6 #define X_XF86DRICreateDrawable 7 #define X_XF86DRIDestroyDrawable 8 #define X_XF86DRIGetDrawableInfo 9 #define X_XF86DRIGetDeviceInfo 10 #define X_XF86DRIAuthConnection 11 #define X_XF86DRIOpenFullScreen 12 /* Deprecated */ #define X_XF86DRICloseFullScreen 13 /* Deprecated */ #define XF86DRINumberEvents 0 #define XF86DRIClientNotLocal 0 #define XF86DRIOperationNotSupported 1 #define XF86DRINumberErrors (XF86DRIOperationNotSupported + 1) #ifndef _XF86DRI_SERVER_ _XFUNCPROTOBEGIN Bool uniDRIQueryExtension(Display * dpy, int *event_base, int *error_base); Bool uniDRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion, int *patchVersion); Bool uniDRIQueryDirectRenderingCapable(Display * dpy, int screen, Bool * isCapable); Bool uniDRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA, char **busIDString); Bool uniDRIAuthConnection(Display * dpy, int screen, drm_magic_t magic); Bool uniDRICloseConnection(Display * dpy, int screen); Bool uniDRIGetClientDriverName(Display * dpy, int screen, int *ddxDriverMajorVersion, int *ddxDriverMinorVersion, int *ddxDriverPatchVersion, char **clientDriverName); Bool uniDRICreateContext(Display * dpy, int screen, Visual * visual, XID * ptr_to_returned_context_id, drm_context_t * hHWContext); Bool uniDRICreateContextWithConfig(Display * dpy, int screen, int configID, XID * ptr_to_returned_context_id, drm_context_t * hHWContext); extern Bool uniDRIDestroyContext(Display * dpy, int screen, XID context_id); extern Bool uniDRICreateDrawable(Display * dpy, int screen, Drawable drawable, drm_drawable_t * hHWDrawable); extern Bool uniDRIDestroyDrawable(Display * dpy, int screen, Drawable drawable); Bool uniDRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, unsigned int *index, unsigned int *stamp, int *X, int *Y, int *W, int *H, int *numClipRects, drm_clip_rect_t ** pClipRects, int *backX, int *backY, int *numBackClipRects, drm_clip_rect_t ** pBackClipRects); Bool uniDRIGetDeviceInfo(Display * dpy, int screen, drm_handle_t * hFrameBuffer, int *fbOrigin, int *fbSize, int *fbStride, int *devPrivateSize, void **pDevPrivate); _XFUNCPROTOEND #endif /* _XF86DRI_SERVER_ */ #endif /* _XF86DRI_H_ */ xf86-video-openchrome-0.6.0/src/xvmc/xf86dri.c0000664000175000017500000004202212760724526015711 00000000000000/* $XFree86: xc/lib/GL/dri/XF86dri.c,v 1.13 2002/10/30 12:51:25 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, 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, 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 PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. **************************************************************************/ /* * Authors: * Kevin E. Martin * Jens Owen * Rickard E. (Rik) Faith * */ /* THIS IS NOT AN X CONSORTIUM STANDARD */ #define NEED_REPLIES #include #include #include #include "xf86dristr.h" #include static XExtensionInfo _xf86dri_info_data; static XExtensionInfo *xf86dri_info = &_xf86dri_info_data; static char xf86dri_extension_name[] = XF86DRINAME; #define uniDRICheckExtension(dpy,i,val) \ XextCheckExtension (dpy, i, xf86dri_extension_name, val) /***************************************************************************** * * * private utility routines * * * *****************************************************************************/ static int close_display(Display * dpy, XExtCodes * extCodes); static /* const */ XExtensionHooks xf86dri_extension_hooks = { NULL, /* create_gc */ NULL, /* copy_gc */ NULL, /* flush_gc */ NULL, /* free_gc */ NULL, /* create_font */ NULL, /* free_font */ close_display, /* close_display */ NULL, /* wire_to_event */ NULL, /* event_to_wire */ NULL, /* error */ NULL, /* error_string */ }; static XEXT_GENERATE_FIND_DISPLAY(find_display, xf86dri_info, xf86dri_extension_name, &xf86dri_extension_hooks, 0, NULL) static XEXT_GENERATE_CLOSE_DISPLAY(close_display, xf86dri_info) /***************************************************************************** * * * public XFree86-DRI Extension routines * * * *****************************************************************************/ #if 0 #include #define TRACE(msg) fprintf(stderr,"uniDRI%s\n", msg); #else #define TRACE(msg) #endif Bool uniDRIQueryExtension(dpy, event_basep, error_basep) Display *dpy; int *event_basep, *error_basep; { XExtDisplayInfo *info = find_display(dpy); TRACE("QueryExtension..."); if (XextHasExtension(info)) { *event_basep = info->codes->first_event; *error_basep = info->codes->first_error; TRACE("QueryExtension... return True"); return True; } else { TRACE("QueryExtension... return False"); return False; } } Bool uniDRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion) Display *dpy; int *majorVersion; int *minorVersion; int *patchVersion; { XExtDisplayInfo *info = find_display(dpy); xXF86DRIQueryVersionReply rep; xXF86DRIQueryVersionReq *req; TRACE("QueryVersion..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRIQueryVersion, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIQueryVersion; if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("QueryVersion... return False"); return False; } *majorVersion = rep.majorVersion; *minorVersion = rep.minorVersion; *patchVersion = rep.patchVersion; UnlockDisplay(dpy); SyncHandle(); TRACE("QueryVersion... return True"); return True; } Bool uniDRIQueryDirectRenderingCapable(dpy, screen, isCapable) Display *dpy; int screen; Bool *isCapable; { XExtDisplayInfo *info = find_display(dpy); xXF86DRIQueryDirectRenderingCapableReply rep; xXF86DRIQueryDirectRenderingCapableReq *req; TRACE("QueryDirectRenderingCapable..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRIQueryDirectRenderingCapable, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIQueryDirectRenderingCapable; req->screen = screen; if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("QueryDirectRenderingCapable... return False"); return False; } *isCapable = rep.isCapable; UnlockDisplay(dpy); SyncHandle(); TRACE("QueryDirectRenderingCapable... return True"); return True; } Bool uniDRIOpenConnection(dpy, screen, hSAREA, busIdString) Display *dpy; int screen; drm_handle_t *hSAREA; char **busIdString; { XExtDisplayInfo *info = find_display(dpy); xXF86DRIOpenConnectionReply rep; xXF86DRIOpenConnectionReq *req; TRACE("OpenConnection..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRIOpenConnection, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIOpenConnection; req->screen = screen; if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("OpenConnection... return False"); return False; } *hSAREA = rep.hSAREALow; #ifdef LONG64 if (sizeof(drm_handle_t) == 8) { *hSAREA |= ((unsigned long)rep.hSAREAHigh) << 32; } #endif if (rep.length) { if (rep.busIdStringLength < INT_MAX) *busIdString = Xcalloc(rep.busIdStringLength + 1, 1); else *busIdString = NULL; if (*busIdString == NULL) { _XEatData(dpy, ((rep.busIdStringLength + 3) & ~3)); UnlockDisplay(dpy); SyncHandle(); TRACE("OpenConnection... return False"); return False; } _XReadPad(dpy, *busIdString, rep.busIdStringLength); } else { *busIdString = NULL; } UnlockDisplay(dpy); SyncHandle(); TRACE("OpenConnection... return True"); return True; } Bool uniDRIAuthConnection(dpy, screen, magic) Display *dpy; int screen; drm_magic_t magic; { XExtDisplayInfo *info = find_display(dpy); xXF86DRIAuthConnectionReq *req; xXF86DRIAuthConnectionReply rep; TRACE("AuthConnection..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRIAuthConnection, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIAuthConnection; req->screen = screen; req->magic = magic; rep.authenticated = 0; if (!_XReply(dpy, (xReply *) & rep, 0, xFalse) || !rep.authenticated) { UnlockDisplay(dpy); SyncHandle(); TRACE("AuthConnection... return False"); return False; } UnlockDisplay(dpy); SyncHandle(); TRACE("AuthConnection... return True"); return True; } Bool uniDRICloseConnection(dpy, screen) Display *dpy; int screen; { XExtDisplayInfo *info = find_display(dpy); xXF86DRICloseConnectionReq *req; TRACE("CloseConnection..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRICloseConnection, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRICloseConnection; req->screen = screen; UnlockDisplay(dpy); SyncHandle(); TRACE("CloseConnection... return True"); return True; } Bool uniDRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion, ddxDriverMinorVersion, ddxDriverPatchVersion, clientDriverName) Display *dpy; int screen; int *ddxDriverMajorVersion; int *ddxDriverMinorVersion; int *ddxDriverPatchVersion; char **clientDriverName; { XExtDisplayInfo *info = find_display(dpy); xXF86DRIGetClientDriverNameReply rep; xXF86DRIGetClientDriverNameReq *req; TRACE("GetClientDriverName..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRIGetClientDriverName, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIGetClientDriverName; req->screen = screen; if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("GetClientDriverName... return False"); return False; } *ddxDriverMajorVersion = rep.ddxDriverMajorVersion; *ddxDriverMinorVersion = rep.ddxDriverMinorVersion; *ddxDriverPatchVersion = rep.ddxDriverPatchVersion; if (rep.length) { if (rep.clientDriverNameLength < INT_MAX) *clientDriverName = Xcalloc(rep.clientDriverNameLength + 1, 1); else *clientDriverName = NULL; if (*clientDriverName == NULL) { _XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3)); UnlockDisplay(dpy); SyncHandle(); TRACE("GetClientDriverName... return False"); return False; } _XReadPad(dpy, *clientDriverName, rep.clientDriverNameLength); } else { *clientDriverName = NULL; } UnlockDisplay(dpy); SyncHandle(); TRACE("GetClientDriverName... return True"); return True; } Bool uniDRICreateContextWithConfig(dpy, screen, configID, context, hHWContext) Display *dpy; int screen; int configID; XID *context; drm_context_t *hHWContext; { XExtDisplayInfo *info = find_display(dpy); xXF86DRICreateContextReply rep; xXF86DRICreateContextReq *req; TRACE("CreateContext..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRICreateContext, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRICreateContext; req->visual = configID; req->screen = screen; *context = XAllocID(dpy); req->context = *context; if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("CreateContext... return False"); return False; } *hHWContext = rep.hHWContext; UnlockDisplay(dpy); SyncHandle(); TRACE("CreateContext... return True"); return True; } Bool uniDRICreateContext(dpy, screen, visual, context, hHWContext) Display *dpy; int screen; Visual *visual; XID *context; drm_context_t *hHWContext; { return uniDRICreateContextWithConfig(dpy, screen, visual->visualid, context, hHWContext); } Bool uniDRIDestroyContext(Display * ndpy, int screen, XID context) { Display *const dpy = (Display *) ndpy; XExtDisplayInfo *info = find_display(dpy); xXF86DRIDestroyContextReq *req; TRACE("DestroyContext..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRIDestroyContext, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIDestroyContext; req->screen = screen; req->context = context; UnlockDisplay(dpy); SyncHandle(); TRACE("DestroyContext... return True"); return True; } Bool uniDRICreateDrawable(Display * ndpy, int screen, Drawable drawable, drm_drawable_t * hHWDrawable) { Display *const dpy = (Display *) ndpy; XExtDisplayInfo *info = find_display(dpy); xXF86DRICreateDrawableReply rep; xXF86DRICreateDrawableReq *req; TRACE("CreateDrawable..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRICreateDrawable, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRICreateDrawable; req->screen = screen; req->drawable = drawable; if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("CreateDrawable... return False"); return False; } *hHWDrawable = rep.hHWDrawable; UnlockDisplay(dpy); SyncHandle(); TRACE("CreateDrawable... return True"); return True; } Bool uniDRIDestroyDrawable(Display * ndpy, int screen, Drawable drawable) { Display *const dpy = (Display *) ndpy; XExtDisplayInfo *info = find_display(dpy); xXF86DRIDestroyDrawableReq *req; TRACE("DestroyDrawable..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRIDestroyDrawable, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIDestroyDrawable; req->screen = screen; req->drawable = drawable; UnlockDisplay(dpy); SyncHandle(); TRACE("DestroyDrawable... return True"); return True; } Bool uniDRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, unsigned int *index, unsigned int *stamp, int *X, int *Y, int *W, int *H, int *numClipRects, drm_clip_rect_t ** pClipRects, int *backX, int *backY, int *numBackClipRects, drm_clip_rect_t ** pBackClipRects) { XExtDisplayInfo *info = find_display(dpy); xXF86DRIGetDrawableInfoReply rep; xXF86DRIGetDrawableInfoReq *req; int total_rects; TRACE("GetDrawableInfo..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRIGetDrawableInfo, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIGetDrawableInfo; req->screen = screen; req->drawable = drawable; if (!_XReply(dpy, (xReply *) & rep, 1, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("GetDrawableInfo... return False"); return False; } *index = rep.drawableTableIndex; *stamp = rep.drawableTableStamp; *X = (int)rep.drawableX; *Y = (int)rep.drawableY; *W = (int)rep.drawableWidth; *H = (int)rep.drawableHeight; *numClipRects = rep.numClipRects; total_rects = *numClipRects; *backX = rep.backX; *backY = rep.backY; *numBackClipRects = rep.numBackClipRects; total_rects += *numBackClipRects; #if 0 /* Because of the fix in Xserver/GL/dri/xf86dri.c, this check breaks * backwards compatibility (Because of the >> 2 shift) but the fix * enables multi-threaded apps to work. */ if (rep.length != ((((SIZEOF(xXF86DRIGetDrawableInfoReply) - SIZEOF(xGenericReply) + total_rects * sizeof(drm_clip_rect_t)) + 3) & ~3) >> 2)) { _XEatData(dpy, rep.length); UnlockDisplay(dpy); SyncHandle(); TRACE("GetDrawableInfo... return False"); return False; } #endif if (*numClipRects) { int len = sizeof(drm_clip_rect_t) * (*numClipRects); *pClipRects = (drm_clip_rect_t *) Xcalloc(len, 1); if (*pClipRects) _XRead(dpy, (char *)*pClipRects, len); } else { *pClipRects = NULL; } if (*numBackClipRects) { int len = sizeof(drm_clip_rect_t) * (*numBackClipRects); *pBackClipRects = (drm_clip_rect_t *) Xcalloc(len, 1); if (*pBackClipRects) _XRead(dpy, (char *)*pBackClipRects, len); } else { *pBackClipRects = NULL; } UnlockDisplay(dpy); SyncHandle(); TRACE("GetDrawableInfo... return True"); return True; } Bool uniDRIGetDeviceInfo(dpy, screen, hFrameBuffer, fbOrigin, fbSize, fbStride, devPrivateSize, pDevPrivate) Display *dpy; int screen; drm_handle_t *hFrameBuffer; int *fbOrigin; int *fbSize; int *fbStride; int *devPrivateSize; void **pDevPrivate; { XExtDisplayInfo *info = find_display(dpy); xXF86DRIGetDeviceInfoReply rep; xXF86DRIGetDeviceInfoReq *req; TRACE("GetDeviceInfo..."); uniDRICheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86DRIGetDeviceInfo, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIGetDeviceInfo; req->screen = screen; if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("GetDeviceInfo... return False"); return False; } *hFrameBuffer = rep.hFrameBufferLow; #ifdef LONG64 if (sizeof(drm_handle_t) == 8) { *hFrameBuffer |= ((unsigned long)rep.hFrameBufferHigh) << 32; } #endif *fbOrigin = rep.framebufferOrigin; *fbSize = rep.framebufferSize; *fbStride = rep.framebufferStride; *devPrivateSize = rep.devPrivateSize; if (rep.length) { if (!(*pDevPrivate = (void *)Xcalloc(rep.devPrivateSize, 1))) { _XEatData(dpy, ((rep.devPrivateSize + 3) & ~3)); UnlockDisplay(dpy); SyncHandle(); TRACE("GetDeviceInfo... return False"); return False; } _XRead(dpy, (char *)*pDevPrivate, rep.devPrivateSize); } else { *pDevPrivate = NULL; } UnlockDisplay(dpy); SyncHandle(); TRACE("GetDeviceInfo... return True"); return True; } xf86-video-openchrome-0.6.0/src/xvmc/xf86dristr.h0000664000175000017500000002414612760724526016456 00000000000000/* $XFree86: xc/lib/GL/dri/xf86dristr.h,v 1.10 2002/10/30 12:51:25 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, 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, 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 PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. **************************************************************************/ /* * Authors: * Kevin E. Martin * Jens Owen * Rickard E. (Rik) Fiath * */ #ifndef _XF86DRISTR_H_ #define _XF86DRISTR_H_ #include "xf86dri.h" #define XF86DRINAME "XFree86-DRI" /* The DRI version number. This was originally set to be the same of the * XFree86 version number. However, this version is really indepedent of * the XFree86 version. * * Version History: * 4.0.0: Original * 4.0.1: Patch to bump clipstamp when windows are destroyed, 28 May 02 * 4.1.0: Add transition from single to multi in DRMInfo rec, 24 Jun 02 */ #define XF86DRI_MAJOR_VERSION 4 #define XF86DRI_MINOR_VERSION 1 #define XF86DRI_PATCH_VERSION 0 typedef struct _XF86DRIQueryVersion { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRIQueryVersion */ CARD16 length B16; } xXF86DRIQueryVersionReq; #define sz_xXF86DRIQueryVersionReq 4 typedef struct { BYTE type; /* X_Reply */ BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 majorVersion B16; /* major version of DRI protocol */ CARD16 minorVersion B16; /* minor version of DRI protocol */ CARD32 patchVersion B32; /* patch version of DRI protocol */ CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xXF86DRIQueryVersionReply; #define sz_xXF86DRIQueryVersionReply 32 typedef struct _XF86DRIQueryDirectRenderingCapable { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* X_DRIQueryDirectRenderingCapable */ CARD16 length B16; CARD32 screen B32; } xXF86DRIQueryDirectRenderingCapableReq; #define sz_xXF86DRIQueryDirectRenderingCapableReq 8 typedef struct { BYTE type; /* X_Reply */ BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; BOOL isCapable; BOOL pad2; BOOL pad3; BOOL pad4; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; CARD32 pad8 B32; CARD32 pad9 B32; } xXF86DRIQueryDirectRenderingCapableReply; #define sz_xXF86DRIQueryDirectRenderingCapableReply 32 typedef struct _XF86DRIOpenConnection { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRIOpenConnection */ CARD16 length B16; CARD32 screen B32; } xXF86DRIOpenConnectionReq; #define sz_xXF86DRIOpenConnectionReq 8 typedef struct { BYTE type; /* X_Reply */ BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 hSAREALow B32; CARD32 hSAREAHigh B32; CARD32 busIdStringLength B32; CARD32 pad6 B32; CARD32 pad7 B32; CARD32 pad8 B32; } xXF86DRIOpenConnectionReply; #define sz_xXF86DRIOpenConnectionReply 32 typedef struct _XF86DRIAuthConnection { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRICloseConnection */ CARD16 length B16; CARD32 screen B32; CARD32 magic B32; } xXF86DRIAuthConnectionReq; #define sz_xXF86DRIAuthConnectionReq 12 typedef struct { BYTE type; BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 authenticated B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xXF86DRIAuthConnectionReply; #define zx_xXF86DRIAuthConnectionReply 32 typedef struct _XF86DRICloseConnection { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRICloseConnection */ CARD16 length B16; CARD32 screen B32; } xXF86DRICloseConnectionReq; #define sz_xXF86DRICloseConnectionReq 8 typedef struct _XF86DRIGetClientDriverName { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRIGetClientDriverName */ CARD16 length B16; CARD32 screen B32; } xXF86DRIGetClientDriverNameReq; #define sz_xXF86DRIGetClientDriverNameReq 8 typedef struct { BYTE type; /* X_Reply */ BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 ddxDriverMajorVersion B32; CARD32 ddxDriverMinorVersion B32; CARD32 ddxDriverPatchVersion B32; CARD32 clientDriverNameLength B32; CARD32 pad5 B32; CARD32 pad6 B32; } xXF86DRIGetClientDriverNameReply; #define sz_xXF86DRIGetClientDriverNameReply 32 typedef struct _XF86DRICreateContext { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRICreateContext */ CARD16 length B16; CARD32 screen B32; CARD32 visual B32; CARD32 context B32; } xXF86DRICreateContextReq; #define sz_xXF86DRICreateContextReq 16 typedef struct { BYTE type; /* X_Reply */ BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 hHWContext B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xXF86DRICreateContextReply; #define sz_xXF86DRICreateContextReply 32 typedef struct _XF86DRIDestroyContext { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRIDestroyContext */ CARD16 length B16; CARD32 screen B32; CARD32 context B32; } xXF86DRIDestroyContextReq; #define sz_xXF86DRIDestroyContextReq 12 typedef struct _XF86DRICreateDrawable { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRICreateDrawable */ CARD16 length B16; CARD32 screen B32; CARD32 drawable B32; } xXF86DRICreateDrawableReq; #define sz_xXF86DRICreateDrawableReq 12 typedef struct { BYTE type; /* X_Reply */ BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 hHWDrawable B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xXF86DRICreateDrawableReply; #define sz_xXF86DRICreateDrawableReply 32 typedef struct _XF86DRIDestroyDrawable { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRIDestroyDrawable */ CARD16 length B16; CARD32 screen B32; CARD32 drawable B32; } xXF86DRIDestroyDrawableReq; #define sz_xXF86DRIDestroyDrawableReq 12 typedef struct _XF86DRIGetDrawableInfo { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRIGetDrawableInfo */ CARD16 length B16; CARD32 screen B32; CARD32 drawable B32; } xXF86DRIGetDrawableInfoReq; #define sz_xXF86DRIGetDrawableInfoReq 12 typedef struct { BYTE type; /* X_Reply */ BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 drawableTableIndex B32; CARD32 drawableTableStamp B32; INT16 drawableX B16; INT16 drawableY B16; INT16 drawableWidth B16; INT16 drawableHeight B16; CARD32 numClipRects B32; INT16 backX B16; INT16 backY B16; CARD32 numBackClipRects B32; } xXF86DRIGetDrawableInfoReply; #define sz_xXF86DRIGetDrawableInfoReply 36 typedef struct _XF86DRIGetDeviceInfo { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRIGetDeviceInfo */ CARD16 length B16; CARD32 screen B32; } xXF86DRIGetDeviceInfoReq; #define sz_xXF86DRIGetDeviceInfoReq 8 typedef struct { BYTE type; /* X_Reply */ BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 hFrameBufferLow B32; CARD32 hFrameBufferHigh B32; CARD32 framebufferOrigin B32; CARD32 framebufferSize B32; CARD32 framebufferStride B32; CARD32 devPrivateSize B32; } xXF86DRIGetDeviceInfoReply; #define sz_xXF86DRIGetDeviceInfoReply 32 typedef struct _XF86DRIOpenFullScreen { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRIOpenFullScreen */ CARD16 length B16; CARD32 screen B32; CARD32 drawable B32; } xXF86DRIOpenFullScreenReq; #define sz_xXF86DRIOpenFullScreenReq 12 typedef struct { BYTE type; BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 isFullScreen B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xXF86DRIOpenFullScreenReply; #define sz_xXF86DRIOpenFullScreenReply 32 typedef struct _XF86DRICloseFullScreen { CARD8 reqType; /* always DRIReqCode */ CARD8 driReqType; /* always X_DRICloseFullScreen */ CARD16 length B16; CARD32 screen B32; CARD32 drawable B32; } xXF86DRICloseFullScreenReq; #define sz_xXF86DRICloseFullScreenReq 12 typedef struct { BYTE type; BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xXF86DRICloseFullScreenReply; #define sz_xXF86DRICloseFullScreenReply 32 #endif /* _XF86DRISTR_H_ */ xf86-video-openchrome-0.6.0/src/xvmc/viaLowLevelPro.c0000664000175000017500000012200012760724526017324 00000000000000/***************************************************************************** * VIA Unichrome XvMC extension client lib. * * Copyright (c) 2004 Thomas Hellström. All rights reserved. * Copyright (c) 2003 Andreas Robinson. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHOR(S) OR COPYRIGHT HOLDER(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. */ /* * Low-level functions that deal directly with the hardware. In the future, * these functions might be implemented in a kernel module. Also, some of them * would benefit from DMA. * * Authors: * Andreas Robinson 2003. (Initial decoder interface functions). * Thomas Hellstrom 2004, 2005 (Blitting functions, AGP and locking, Unichrome Pro Video AGP). * Ivor Hewitt 2005 (Unichrome Pro modifications and merging). */ /* IH * I've left the proReg or-ing in case we need/want to implement the V1/V3 * register toggle too, which also moves the register locations. * The CN400 has dual mpeg decoders, not sure at the moment whether these * are also operated through independent registers also. */ #undef VIDEO_DMA #define HQV_USE_IRQ #define UNICHROME_PRO #include "viaXvMCPriv.h" #include "viaLowLevel.h" #include "driDrawable.h" #include #include #include typedef enum { ll_init, ll_agpBuf, ll_pciBuf, ll_timeStamp, ll_llBuf } LLState; typedef struct { drm_via_mem_t mem; unsigned offset; unsigned stride; unsigned height; } LowLevelBuffer; struct _XvMCLowLevel; typedef struct _ViaCommandBuffer { CARD32 *buf; CARD32 waitFlags; unsigned pos; unsigned bufSize; int mode; int header_start; int rindex; void (*flushFunc) (struct _ViaCommandBuffer * cb, struct _XvMCLowLevel * xl); } ViaCommandBuffer; typedef struct _XvMCLowLevel { ViaCommandBuffer agpBuf, pciBuf, *videoBuf; int use_agp; int fd; drm_context_t *drmcontext; drmLockPtr hwLock; drmAddress mmioAddress; drmAddress fbAddress; unsigned fbStride; unsigned fbDepth; unsigned width; unsigned height; int performLocking; unsigned errors; drm_via_mem_t tsMem; CARD32 tsOffset; volatile CARD32 *tsP; CARD32 curTimeStamp; CARD32 lastReadTimeStamp; int agpSync; CARD32 agpSyncTimeStamp; unsigned chipId; /* * Data for video-engine less display */ XvMCRegion sRegion; XvMCRegion dRegion; LowLevelBuffer scale; LowLevelBuffer back; Bool downScaling; CARD32 downScaleW; CARD32 downScaleH; CARD32 upScaleW; CARD32 upScaleH; unsigned fetch; unsigned line; LLState state; } XvMCLowLevel; /* * For Other architectures than i386 these might have to be modified for * bigendian etc. */ #define MPEGIN(xl,reg) \ *((volatile CARD32 *)(((CARD8 *)(xl)->mmioAddress) + 0xc00 + (reg))) #define VIDIN(ctx,reg) \ *((volatile CARD32 *)(((CARD8 *)(ctx)->mmioAddress) + (reg))) #define REGIN(ctx,reg) \ *((volatile CARD32 *)(((CARD8 *)(ctx)->mmioAddress) + 0x0000 + (reg))) #define HQV_CONTROL 0x3D0 #define HQV_SRC_OFFSET 0x3CC #define HQV_SRC_STARTADDR_Y 0x3D4 #define HQV_SRC_STARTADDR_U 0x3D8 #define HQV_SRC_STARTADDR_V 0x3DC #define HQV_MINIFY_DEBLOCK 0x3E8 #define REG_HQV1_INDEX 0x00001000 #define HQV_SW_FLIP 0x00000010 #define HQV_FLIP_STATUS 0x00000001 #define HQV_SUBPIC_FLIP 0x00008000 #define HQV_FLIP_ODD 0x00000020 #define HQV_DEINTERLACE 0x00010000 #define HQV_FIELD_2_FRAME 0x00020000 #define HQV_FRAME_2_FIELD 0x00040000 #define HQV_FIELD_UV 0x00100000 #define HQV_DEBLOCK_HOR 0x00008000 #define HQV_DEBLOCK_VER 0x80000000 #define HQV_YUV420 0xC0000000 #define HQV_YUV422 0x80000000 #define HQV_ENABLE 0x08000000 #define HQV_GEN_IRQ 0x00000080 #define HQV_SCALE_ENABLE 0x00000800 #define HQV_SCALE_DOWN 0x00001000 #define V_COMPOSE_MODE 0x298 #define V1_COMMAND_FIRE 0x80000000 #define V3_COMMAND_FIRE 0x40000000 /* SUBPICTURE Registers */ #define SUBP_CONTROL_STRIDE 0x3C0 #define SUBP_STARTADDR 0x3C4 #define RAM_TABLE_CONTROL 0x3C8 #define RAM_TABLE_READ 0x3CC /* SUBP_CONTROL_STRIDE 0x3c0 */ #define SUBP_HQV_ENABLE 0x00010000 #define SUBP_IA44 0x00020000 #define SUBP_AI44 0x00000000 #define SUBP_STRIDE_MASK 0x00001fff #define SUBP_CONTROL_MASK 0x00070000 /* RAM_TABLE_CONTROL 0x3c8 */ #define RAM_TABLE_RGB_ENABLE 0x00000007 #define VIA_REG_STATUS 0x400 #define VIA_REG_GEMODE 0x004 #define VIA_REG_SRCBASE 0x030 #define VIA_REG_DSTBASE 0x034 #define VIA_REG_PITCH 0x038 #define VIA_REG_SRCCOLORKEY 0x01C #define VIA_REG_KEYCONTROL 0x02C #define VIA_REG_SRCPOS 0x008 #define VIA_REG_DSTPOS 0x00C #define VIA_REG_GECMD 0x000 #define VIA_REG_DIMENSION 0x010 /* width and height */ #define VIA_REG_FGCOLOR 0x018 #define VIA_VR_QUEUE_BUSY 0x00020000 /* Virtual Queue is busy */ #define VIA_CMD_RGTR_BUSY 0x00000080 /* Command Regulator is busy */ #define VIA_2D_ENG_BUSY 0x00000002 /* 2D Engine is busy */ #define VIA_3D_ENG_BUSY 0x00000001 /* 3D Engine is busy */ #define VIA_GEM_8bpp 0x00000000 #define VIA_GEM_16bpp 0x00000100 #define VIA_GEM_32bpp 0x00000300 #define VIA_GEC_BLT 0x00000001 #define VIA_PITCH_ENABLE 0x80000000 #define VIA_GEC_INCX 0x00000000 #define VIA_GEC_DECY 0x00004000 #define VIA_GEC_INCY 0x00000000 #define VIA_GEC_DECX 0x00008000 #define VIA_GEC_FIXCOLOR_PAT 0x00002000 #define VIA_BLIT_CLEAR 0x00 #define VIA_BLIT_COPY 0xCC #define VIA_BLIT_FILL 0xF0 #define VIA_BLIT_SET 0xFF #define VIA_SYNCWAITTIMEOUT 50000 /* Might be a bit conservative */ #define VIA_DMAWAITTIMEOUT 150000 #define VIA_VIDWAITTIMEOUT 50000 #define VIA_XVMC_DECODERTIMEOUT 50000 /*(microseconds) */ #define VIA_AGP_HEADER5 0xFE040000 #define VIA_AGP_HEADER6 0xFE050000 typedef struct { CARD32 data; Bool set; } HQVRegister; #define H1_ADDR(val) (((val) >> 2) | 0xF0000000) #define WAITFLAGS(cb, flags) \ (cb)->waitFlags |= (flags) #define BEGIN_RING_AGP(cb, xl, size) \ do { \ if ((cb)->pos > ((cb)->bufSize-(size))) { \ cb->flushFunc(cb, xl); \ } \ } while(0) #define OUT_RING_AGP(cb, val) do{ \ (cb)->buf[(cb)->pos++] = (val); \ } while(0); #define OUT_RING_QW_AGP(cb, val1, val2) \ do { \ (cb)->buf[(cb)->pos++] = (val1); \ (cb)->buf[(cb)->pos++] = (val2); \ } while (0) #define BEGIN_HEADER5_AGP(cb, xl, index) \ do { \ BEGIN_RING_AGP(cb, xl, 8); \ (cb)->mode = VIA_AGP_HEADER5; \ (cb)->rindex = (index); \ (cb)->header_start = (cb)->pos; \ (cb)->pos += 4; \ } while (0) #define BEGIN_HEADER6_AGP(cb, xl) \ do { \ BEGIN_RING_AGP(cb, xl, 8); \ (cb)->mode = VIA_AGP_HEADER6; \ (cb)->header_start = (cb)->pos; \ (cb)->pos += 4; \ } while (0) #define BEGIN_HEADER5_DATA(cb, xl, size, index) \ do { \ if ((cb)->pos > ((cb)->bufSize - ((size) + 16))) { \ cb->flushFunc(cb, xl); \ BEGIN_HEADER5_AGP(cb, xl, index); \ } else if ((cb)->mode && (((cb)->mode != VIA_AGP_HEADER5) || \ ((cb)->rindex != index))) { \ finish_header_agp(cb); \ BEGIN_HEADER5_AGP((cb), xl, (index)); \ } else if (cb->mode != VIA_AGP_HEADER5) { \ BEGIN_HEADER5_AGP((cb), xl, (index)); \ } \ }while(0) #define BEGIN_HEADER6_DATA(cb, xl, size) \ do{ \ if ((cb)->pos > (cb->bufSize-(((size) << 1) + 16))) { \ cb->flushFunc(cb, xl); \ BEGIN_HEADER6_AGP(cb, xl); \ } else if ((cb)->mode && ((cb)->mode != VIA_AGP_HEADER6)) { \ finish_header_agp(cb); \ BEGIN_HEADER6_AGP(cb, xl); \ } \ else if ((cb->mode != VIA_AGP_HEADER6)) { \ BEGIN_HEADER6_AGP(cb, (xl)); \ } \ }while(0) #define HQV_SHADOW_BASE 0x3CC #define HQV_SHADOW_SIZE 13 #define SETHQVSHADOW(shadow, offset, value) \ do { \ HQVRegister *r = (shadow) + (((offset) - HQV_SHADOW_BASE) >> 2); \ r->data = (value); \ r->set = TRUE; \ } while(0) #define GETHQVSHADOW(shadow, offset) ((shadow)[(offset - HQV_SHADOW_BASE) >> 2].data) #define LL_HW_LOCK(xl) \ do { \ DRM_LOCK((xl)->fd,(xl)->hwLock,*(xl)->drmcontext,0); \ } while(0); #define LL_HW_UNLOCK(xl) \ do { \ DRM_UNLOCK((xl)->fd,(xl)->hwLock,*(xl)->drmcontext); \ } while(0); static HQVRegister hqvShadow[HQV_SHADOW_SIZE]; static void initHQVShadow(HQVRegister * r) { int i; for (i = 0; i < HQV_SHADOW_SIZE; ++i) { r->data = 0; r++->set = FALSE; } } #if 0 static void setHQVHWDeinterlacing(HQVRegister * shadow, Bool on, Bool motionDetect, CARD32 stride, CARD32 height) { CARD32 tmp = GETHQVSHADOW(shadow, 0x3E4); if (!on) { tmp &= ~((1 << 0) | (1 << 12) | (1 << 27) | (1 << 31)); SETHQVSHADOW(shadow, 0x3E4, tmp); return; } tmp = (1 << 31) | (4 << 28) | (1 << 27) | (3 << 25) | (1 << 18) | (2 << 14) | (8 << 8) | (8 << 1) | (1 << 0); if (motionDetect) tmp |= (1 << 12); SETHQVSHADOW(shadow, 0x3E4, tmp); tmp = GETHQVSHADOW(shadow, 0x3DC); tmp |= (stride * height * 1536) / 1024 & 0x7ff; SETHQVSHADOW(shadow, 0x3DC, tmp); tmp = GETHQVSHADOW(shadow, 0x3D0); tmp |= (1 << 23); SETHQVSHADOW(shadow, 0x3D0, tmp); } #endif static void setHQVDeblocking(HQVRegister * shadow, Bool on, Bool lowPass) { CARD32 tmp = GETHQVSHADOW(shadow, 0x3DC); if (!on) { tmp &= ~(1 << 27); SETHQVSHADOW(shadow, 0x3DC, tmp); return; } tmp |= (8 << 16) | (1 << 27); if (lowPass) tmp |= (1 << 26); SETHQVSHADOW(shadow, 0x3DC, tmp); tmp = GETHQVSHADOW(shadow, 0x3D4); tmp |= (6 << 27); SETHQVSHADOW(shadow, 0x3D4, tmp); tmp = GETHQVSHADOW(shadow, 0x3D8); tmp |= (19 << 27); SETHQVSHADOW(shadow, 0x3D8, tmp); } static void setHQVStartAddress(HQVRegister * shadow, unsigned yOffs, unsigned uOffs, unsigned stride, unsigned format) { CARD32 tmp = GETHQVSHADOW(shadow, 0x3D4); tmp |= yOffs & 0x03FFFFF0; SETHQVSHADOW(shadow, 0x3D4, tmp); tmp = GETHQVSHADOW(shadow, 0x3D8); tmp |= uOffs & 0x03FFFFF0; SETHQVSHADOW(shadow, 0x3D8, tmp); tmp = GETHQVSHADOW(shadow, 0x3F8); tmp |= (stride & 0x1FF8); SETHQVSHADOW(shadow, 0x3F8, tmp); tmp = GETHQVSHADOW(shadow, 0x3D0); if (format == 0) { /* * NV12 */ tmp |= (0x0C << 28); } else if (format == 1) { /* * RGB16 */ tmp |= (0x02 << 28); } else if (format == 2) { /* * RGB32 */ ; } SETHQVSHADOW(shadow, 0x3D0, tmp); } #if 0 static void setHQVColorSpaceConversion(HQVRegister * shadow, unsigned depth, Bool on) { CARD32 tmp = GETHQVSHADOW(shadow, 0x3DC); if (!on) { tmp &= ~(1 << 28); SETHQVSHADOW(shadow, 0x3DC, tmp); return; } if (depth == 32) tmp |= (1 << 29); tmp |= (1 << 28); tmp &= ~(1 << 15); SETHQVSHADOW(shadow, 0x3DC, tmp); } static void setHQVFetchLine(HQVRegister * shadow, unsigned fetch, unsigned lines) { SETHQVSHADOW(shadow, 0x3E0, ((lines - 1) & 0x7FF) | (((fetch - 1) & 0x1FFF) << 16)); } static void setHQVScale(HQVRegister * shadow, unsigned horizontal, unsigned vertical) { SETHQVSHADOW(shadow, 0x3E8, (horizontal & 0xFFFF) | ((vertical & 0xFFFF) << 16)); } static void setHQVSingleDestination(HQVRegister * shadow, unsigned offset, unsigned stride) { CARD32 tmp = GETHQVSHADOW(shadow, 0x3D0); tmp |= (1 << 6); SETHQVSHADOW(shadow, 0x3D0, tmp); SETHQVSHADOW(shadow, 0x3EC, offset & 0x03FFFFF8); SETHQVSHADOW(shadow, 0x3F4, stride & 0x1FF8); } #endif static void setHQVDeinterlacing(HQVRegister * shadow, CARD32 frameType) { CARD32 tmp = GETHQVSHADOW(shadow, 0x3D0); if ((frameType & XVMC_FRAME_PICTURE) == XVMC_TOP_FIELD) { tmp |= HQV_FIELD_UV | HQV_DEINTERLACE | HQV_FIELD_2_FRAME | HQV_FRAME_2_FIELD; } else if ((frameType & XVMC_FRAME_PICTURE) == XVMC_BOTTOM_FIELD) { tmp |= HQV_FIELD_UV | HQV_DEINTERLACE | HQV_FIELD_2_FRAME | HQV_FRAME_2_FIELD | HQV_FLIP_ODD; } SETHQVSHADOW(shadow, 0x3D0, tmp); } static void setHQVTripleBuffer(HQVRegister * shadow, Bool on) { CARD32 tmp = GETHQVSHADOW(shadow, 0x3D0); if (on) tmp |= (1 << 26); else tmp &= ~(1 << 26); SETHQVSHADOW(shadow, 0x3D0, tmp); } static void finish_header_agp(ViaCommandBuffer * cb) { int numDWords, i; CARD32 *hb; if (!cb->mode) return; numDWords = cb->pos - cb->header_start - 4; hb = cb->buf + cb->header_start; switch (cb->mode) { case VIA_AGP_HEADER5: hb[0] = VIA_AGP_HEADER5 | cb->rindex; hb[1] = numDWords; hb[2] = 0x00F50000; /* SW debug flag. (?) */ break; default: hb[0] = VIA_AGP_HEADER6; hb[1] = numDWords >> 1; hb[2] = 0x00F60000; /* SW debug flag. (?) */ break; } hb[3] = 0; if (numDWords & 3) { for (i = 0; i < (4 - (numDWords & 3)); ++i) OUT_RING_AGP(cb, 0x00000000); } cb->mode = 0; } void hwlLock(void *xlp, int videoLock) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; LL_HW_LOCK(xl); } void hwlUnlock(void *xlp, int videoLock) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; LL_HW_UNLOCK(xl); } static unsigned timeDiff(struct timeval *now, struct timeval *then) { return (now->tv_usec >= then->tv_usec) ? now->tv_usec - then->tv_usec : 1000000 - (then->tv_usec - now->tv_usec); } void setAGPSyncLowLevel(void *xlp, int val, CARD32 timeStamp) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; xl->agpSync = val; xl->agpSyncTimeStamp = timeStamp; } CARD32 viaDMATimeStampLowLevel(void *xlp) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; if (xl->use_agp) { viaBlit(xl, 32, xl->tsOffset, 1, xl->tsOffset, 1, 1, 1, 0, 0, VIABLIT_FILL, xl->curTimeStamp); return xl->curTimeStamp++; } return 0; } static void viaDMAWaitTimeStamp(XvMCLowLevel * xl, CARD32 timeStamp, int doSleep) { struct timeval now, then; struct timezone here; struct timespec sleep, rem; if (xl->use_agp && (xl->lastReadTimeStamp - timeStamp > (1 << 23))) { sleep.tv_nsec = 1; sleep.tv_sec = 0; here.tz_minuteswest = 0; here.tz_dsttime = 0; gettimeofday(&then, &here); while (((xl->lastReadTimeStamp = *xl->tsP) - timeStamp) > (1 << 23)) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_DMAWAITTIMEOUT) { if (((xl->lastReadTimeStamp = *xl->tsP) - timeStamp) > (1 << 23)) { xl->errors |= LL_DMA_TIMEDOUT; break; } } if (doSleep) nanosleep(&sleep, &rem); } } } static int viaDMAInitTimeStamp(XvMCLowLevel * xl) { int ret = 0; if (xl->use_agp) { xl->tsMem.context = *(xl->drmcontext); xl->tsMem.size = 64; xl->tsMem.type = VIA_MEM_VIDEO; if ((ret = drmCommandWriteRead(xl->fd, DRM_VIA_ALLOCMEM, &xl->tsMem, sizeof(xl->tsMem))) < 0) return ret; if (xl->tsMem.size != 64) return -1; xl->tsOffset = (xl->tsMem.offset + 31) & ~31; xl->tsP = (CARD32 *) xl->fbAddress + (xl->tsOffset >> 2); xl->curTimeStamp = 1; *xl->tsP = 0; } return 0; } static int viaDMACleanupTimeStamp(XvMCLowLevel * xl) { if (!(xl->tsMem.size) || !xl->use_agp) return 0; return drmCommandWrite(xl->fd, DRM_VIA_FREEMEM, &xl->tsMem, sizeof(xl->tsMem)); } static CARD32 viaMpegGetStatus(XvMCLowLevel * xl) { return MPEGIN(xl, 0x54); } static int viaMpegIsBusy(XvMCLowLevel * xl, CARD32 mask, CARD32 idle) { CARD32 tmp = viaMpegGetStatus(xl); /* * Error detected. * FIXME: Are errors really shown when error concealment is on? */ if (tmp & 0x70) return 0; return (tmp & mask) != idle; } static void syncDMA(XvMCLowLevel * xl, unsigned int doSleep) { /* * Ideally, we'd like to have an interrupt wait here, but, according to second hand * information, the hardware does not support this, although earlier S3 chips do that. * It is therefore not implemented into the DRM, and we'll do a user space wait here. */ struct timeval now, then; struct timezone here; struct timespec sleep, rem; sleep.tv_nsec = 1; sleep.tv_sec = 0; here.tz_minuteswest = 0; here.tz_dsttime = 0; gettimeofday(&then, &here); while (!(REGIN(xl, VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY)) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_DMAWAITTIMEOUT) { if (!(REGIN(xl, VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY)) { xl->errors |= LL_DMA_TIMEDOUT; break; } } if (doSleep) nanosleep(&sleep, &rem); } while (REGIN(xl, VIA_REG_STATUS) & VIA_CMD_RGTR_BUSY) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_DMAWAITTIMEOUT) { if (REGIN(xl, VIA_REG_STATUS) & VIA_CMD_RGTR_BUSY) { xl->errors |= LL_DMA_TIMEDOUT; break; } } if (doSleep) nanosleep(&sleep, &rem); } } #ifdef HQV_USE_IRQ static void syncVideo(XvMCLowLevel * xl, unsigned int doSleep) { int proReg = REG_HQV1_INDEX; /* * Wait for HQV completion using completion interrupt. Nothing strange here. * Note that the interrupt handler clears the HQV_FLIP_STATUS bit, so we * can't wait on that one. */ if ((VIDIN(xl, HQV_CONTROL | proReg) & (HQV_SW_FLIP | HQV_SUBPIC_FLIP))) { drm_via_irqwait_t irqw; irqw.request.irq = 1; irqw.request.type = VIA_IRQ_ABSOLUTE; if (drmCommandWriteRead(xl->fd, DRM_VIA_WAIT_IRQ, &irqw, sizeof(irqw)) < 0) xl->errors |= LL_VIDEO_TIMEDOUT; } } #else static void syncVideo(XvMCLowLevel * xl, unsigned int doSleep) { /* * Wait for HQV completion. Nothing strange here. We assume that the HQV * Handles syncing to the V1 / V3 engines by itself. It should be safe to * always wait for SUBPIC_FLIP completion although subpictures are not * always used. */ struct timeval now, then; struct timezone here; struct timespec sleep, rem; int proReg = REG_HQV1_INDEX; sleep.tv_nsec = 1; sleep.tv_sec = 0; here.tz_minuteswest = 0; here.tz_dsttime = 0; gettimeofday(&then, &here); while ((VIDIN(xl, HQV_CONTROL | proReg) & (HQV_SW_FLIP | HQV_SUBPIC_FLIP))) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_SYNCWAITTIMEOUT) { if ((VIDIN(xl, HQV_CONTROL | proReg) & (HQV_SW_FLIP | HQV_SUBPIC_FLIP))) { xl->errors |= LL_VIDEO_TIMEDOUT; break; } } if (doSleep) nanosleep(&sleep, &rem); } } #endif static void syncAccel(XvMCLowLevel * xl, unsigned int mode, unsigned int doSleep) { struct timeval now, then; struct timezone here; struct timespec sleep, rem; CARD32 mask = ((mode & LL_MODE_2D) ? VIA_2D_ENG_BUSY : 0) | ((mode & LL_MODE_3D) ? VIA_3D_ENG_BUSY : 0); sleep.tv_nsec = 1; sleep.tv_sec = 0; here.tz_minuteswest = 0; here.tz_dsttime = 0; gettimeofday(&then, &here); while (REGIN(xl, VIA_REG_STATUS) & mask) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_SYNCWAITTIMEOUT) { if (REGIN(xl, VIA_REG_STATUS) & mask) { xl->errors |= LL_ACCEL_TIMEDOUT; break; } } if (doSleep) nanosleep(&sleep, &rem); } } static void syncMpeg(XvMCLowLevel * xl, unsigned int mode, unsigned int doSleep) { /* * Ideally, we'd like to have an interrupt wait here, but from information from VIA * at least the MPEG completion interrupt is broken on the CLE266, which was * discovered during validation of the chip. */ struct timeval now, then; struct timezone here; struct timespec sleep, rem; CARD32 busyMask = 0; CARD32 idleVal = 0; CARD32 ret; sleep.tv_nsec = 1; sleep.tv_sec = 0; here.tz_minuteswest = 0; here.tz_dsttime = 0; gettimeofday(&then, &here); if (mode & LL_MODE_DECODER_SLICE) { busyMask = VIA_SLICEBUSYMASK; idleVal = VIA_SLICEIDLEVAL; } if (mode & LL_MODE_DECODER_IDLE) { busyMask |= VIA_BUSYMASK; idleVal = VIA_IDLEVAL; } while (viaMpegIsBusy(xl, busyMask, idleVal)) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_XVMC_DECODERTIMEOUT) { if (viaMpegIsBusy(xl, busyMask, idleVal)) { xl->errors |= LL_DECODER_TIMEDOUT; } break; } if (doSleep) nanosleep(&sleep, &rem); } ret = viaMpegGetStatus(xl); if (ret & 0x70) { xl->errors |= ((ret & 0x70) >> 3); } return; } static void pciFlush(ViaCommandBuffer * cb, XvMCLowLevel * xl) { int ret; drm_via_cmdbuffer_t b; unsigned mode = cb->waitFlags; finish_header_agp(cb); b.buf = (char *)cb->buf; b.size = cb->pos * sizeof(CARD32); if (xl->performLocking) hwlLock(xl, 0); if (((mode == LL_MODE_VIDEO) && (xl->videoBuf == &xl->agpBuf)) || ((mode != LL_MODE_VIDEO) && (mode != 0))) syncDMA(xl, 0); if ((mode & LL_MODE_2D) || (mode & LL_MODE_3D)) { syncAccel(xl, mode, 0); } if (mode & LL_MODE_VIDEO) { syncVideo(xl, 1); } if (mode & (LL_MODE_DECODER_SLICE | LL_MODE_DECODER_IDLE)) { syncMpeg(xl, mode, 0); } ret = drmCommandWrite(xl->fd, DRM_VIA_PCICMD, &b, sizeof(b)); if (xl->performLocking) hwlUnlock(xl, 0); if (ret) { xl->errors |= LL_PCI_COMMAND_ERR; } cb->pos = 0; cb->waitFlags = 0; } static void agpFlush(ViaCommandBuffer * cb, XvMCLowLevel * xl) { drm_via_cmdbuffer_t b; int ret; int i; finish_header_agp(cb); if (xl->use_agp) { b.buf = (char *)cb->buf; b.size = cb->pos * sizeof(CARD32); if (xl->agpSync) { syncXvMCLowLevel(xl, LL_MODE_DECODER_IDLE, 1, xl->agpSyncTimeStamp); xl->agpSync = 0; } if (xl->performLocking) hwlLock(xl, 0); do { ret = drmCommandWrite(xl->fd, DRM_VIA_CMDBUFFER, &b, sizeof(b)); } while (-EAGAIN == ret); if (xl->performLocking) hwlUnlock(xl, 0); if (ret) { xl->errors |= LL_AGP_COMMAND_ERR; for (i = 0; i < cb->pos; i += 2) { printf("0x%x, 0x%x\n", (unsigned)cb->buf[i], (unsigned)cb->buf[i + 1]); } exit(-1); } else { cb->pos = 0; } cb->waitFlags &= LL_MODE_VIDEO; /* FIXME: Check this! */ } else { unsigned mode = cb->waitFlags; b.buf = (char *)cb->buf; b.size = cb->pos * sizeof(CARD32); if (xl->performLocking) hwlLock(xl, 0); if (((mode == LL_MODE_VIDEO) && (cb == &xl->agpBuf)) || ((mode != LL_MODE_VIDEO) && (mode != 0))) syncDMA(xl, 0); if ((mode & LL_MODE_2D) || (mode & LL_MODE_3D)) syncAccel(xl, mode, 0); if (mode & LL_MODE_VIDEO) syncVideo(xl, 1); if (mode & (LL_MODE_DECODER_SLICE | LL_MODE_DECODER_IDLE)) syncMpeg(xl, mode, 0); ret = drmCommandWrite(xl->fd, DRM_VIA_PCICMD, &b, sizeof(b)); if (xl->performLocking) hwlUnlock(xl, 0); if (ret) { xl->errors |= LL_PCI_COMMAND_ERR; } cb->pos = 0; cb->waitFlags = 0; } } #if 0 /* Needs debugging */ static void uploadHQVDeinterlace(XvMCLowLevel * xl, unsigned offset, HQVRegister * shadow, CARD32 cur_offset, CARD32 prev_offset, CARD32 stride, Bool top_field_first, CARD32 height) { CARD32 tmp; ViaCommandBuffer *cb = &xl->agpBuf; BEGIN_HEADER6_DATA(cb, xl, 9); tmp = GETHQVSHADOW(shadow, 0x3F8); tmp &= ~(3 << 30); tmp |= (1 << 30); OUT_RING_QW_AGP(cb, 0x3F8 + offset, tmp); OUT_RING_QW_AGP(cb, 0x3D4 + offset, prev_offset + ((top_field_first) ? stride : 0)); OUT_RING_QW_AGP(cb, 0x3D8 + offset, prev_offset + stride * height); tmp &= ~(3 << 30); tmp |= (2 << 30); OUT_RING_QW_AGP(cb, 0x3F8 + offset, tmp); OUT_RING_QW_AGP(cb, 0x3D4 + offset, cur_offset + ((top_field_first) ? 0 : stride)); OUT_RING_QW_AGP(cb, 0x3D8 + offset, cur_offset + stride * height); tmp |= (3 << 30); OUT_RING_QW_AGP(cb, 0x3F8 + offset, tmp); OUT_RING_QW_AGP(cb, 0x3D4 + offset, cur_offset + ((top_field_first) ? stride : 0)); OUT_RING_QW_AGP(cb, 0x3D8 + offset, cur_offset + stride * height); } #endif static void uploadHQVShadow(XvMCLowLevel * xl, unsigned offset, HQVRegister * shadow, Bool flip) { int i; CARD32 tmp; ViaCommandBuffer *cb = xl->videoBuf; BEGIN_HEADER6_DATA(cb, xl, HQV_SHADOW_SIZE); WAITFLAGS(cb, LL_MODE_VIDEO); if (shadow[0].set) OUT_RING_QW_AGP(cb, 0x3CC + offset, 0); for (i = 2; i < HQV_SHADOW_SIZE; ++i) { if (shadow[i].set) { OUT_RING_QW_AGP(cb, offset + HQV_SHADOW_BASE + (i << 2), shadow[i].data); shadow[i].set = FALSE; } } /* * Finally the control register for flip. */ if (flip) { tmp = GETHQVSHADOW(shadow, 0x3D0); OUT_RING_QW_AGP(cb, offset + HQV_CONTROL, HQV_ENABLE | HQV_GEN_IRQ | HQV_SUBPIC_FLIP | HQV_SW_FLIP | tmp); } shadow[0].set = FALSE; shadow[1].set = FALSE; } unsigned flushXvMCLowLevel(void *xlp) { unsigned errors; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; if (xl->pciBuf.pos) pciFlush(&xl->pciBuf, xl); if (xl->agpBuf.pos) agpFlush(&xl->agpBuf, xl); errors = xl->errors; if (errors) printf("Error 0x%x\n", errors); xl->errors = 0; return errors; } void flushPCIXvMCLowLevel(void *xlp) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; if (xl->pciBuf.pos) pciFlush(&xl->pciBuf, xl); if ((!xl->use_agp && xl->agpBuf.pos)) agpFlush(&xl->agpBuf, xl); } void viaMpegSetSurfaceStride(void *xlp, ViaXvMCContext * ctx) { CARD32 y_stride = ctx->yStride; CARD32 uv_stride = y_stride >> 1; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; ViaCommandBuffer *cb = &xl->agpBuf; BEGIN_HEADER6_DATA(cb, xl, 1); OUT_RING_QW_AGP(cb, 0xc50, (y_stride >> 3) | ((uv_stride >> 3) << 16)); WAITFLAGS(cb, LL_MODE_DECODER_IDLE); } void viaVideoSetSWFLipLocked(void *xlp, unsigned yOffs, unsigned uOffs, unsigned vOffs, unsigned yStride, unsigned uvStride) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; initHQVShadow(hqvShadow); setHQVStartAddress(hqvShadow, yOffs, vOffs, yStride, 0); if (xl->videoBuf == &xl->agpBuf) syncDMA(xl, 1); syncVideo(xl, 1); uploadHQVShadow(xl, REG_HQV1_INDEX, hqvShadow, FALSE); xl->videoBuf->flushFunc(xl->videoBuf, xl); } void viaVideoSWFlipLocked(void *xlp, unsigned flags, Bool progressiveSequence) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; setHQVDeinterlacing(hqvShadow, flags); setHQVDeblocking(hqvShadow, ((flags & XVMC_FRAME_PICTURE) == XVMC_FRAME_PICTURE), TRUE); setHQVTripleBuffer(hqvShadow, TRUE); if (xl->videoBuf == &xl->agpBuf) syncDMA(xl, 1); syncVideo(xl, 1); uploadHQVShadow(xl, REG_HQV1_INDEX, hqvShadow, TRUE); xl->videoBuf->flushFunc(xl->videoBuf, xl); } void viaMpegSetFB(void *xlp, unsigned i, unsigned yOffs, unsigned uOffs, unsigned vOffs) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; ViaCommandBuffer *cb = &xl->agpBuf; i *= (4 * 2); BEGIN_HEADER6_DATA(cb, xl, 2); OUT_RING_QW_AGP(cb, 0xc28 + i, yOffs >> 3); OUT_RING_QW_AGP(cb, 0xc2c + i, vOffs >> 3); WAITFLAGS(cb, LL_MODE_DECODER_IDLE); } void viaMpegBeginPicture(void *xlp, ViaXvMCContext * ctx, unsigned width, unsigned height, const XvMCMpegControl * control) { unsigned j, mb_width, mb_height; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; ViaCommandBuffer *cb = &xl->agpBuf; mb_width = (width + 15) >> 4; mb_height = ((control->mpeg_coding == XVMC_MPEG_2) && (control->flags & XVMC_PROGRESSIVE_SEQUENCE)) ? 2 * ((height + 31) >> 5) : (((height + 15) >> 4)); BEGIN_HEADER6_DATA(cb, xl, 72); WAITFLAGS(cb, LL_MODE_DECODER_IDLE); OUT_RING_QW_AGP(cb, 0xc00, ((control->picture_structure & XVMC_FRAME_PICTURE) << 2) | ((control->picture_coding_type & 3) << 4) | ((control->flags & XVMC_ALTERNATE_SCAN) ? (1 << 6) : 0)); if (!(ctx->intraLoaded)) { OUT_RING_QW_AGP(cb, 0xc5c, 0); for (j = 0; j < 64; j += 4) { OUT_RING_QW_AGP(cb, 0xc60, ctx->intra_quantiser_matrix[j] | (ctx->intra_quantiser_matrix[j + 1] << 8) | (ctx->intra_quantiser_matrix[j + 2] << 16) | (ctx->intra_quantiser_matrix[j + 3] << 24)); } ctx->intraLoaded = 1; } if (!(ctx->nonIntraLoaded)) { OUT_RING_QW_AGP(cb, 0xc5c, 1); for (j = 0; j < 64; j += 4) { OUT_RING_QW_AGP(cb, 0xc60, ctx->non_intra_quantiser_matrix[j] | (ctx->non_intra_quantiser_matrix[j + 1] << 8) | (ctx->non_intra_quantiser_matrix[j + 2] << 16) | (ctx->non_intra_quantiser_matrix[j + 3] << 24)); } ctx->nonIntraLoaded = 1; } if (!(ctx->chromaIntraLoaded)) { OUT_RING_QW_AGP(cb, 0xc5c, 2); for (j = 0; j < 64; j += 4) { OUT_RING_QW_AGP(cb, 0xc60, ctx->chroma_intra_quantiser_matrix[j] | (ctx->chroma_intra_quantiser_matrix[j + 1] << 8) | (ctx->chroma_intra_quantiser_matrix[j + 2] << 16) | (ctx->chroma_intra_quantiser_matrix[j + 3] << 24)); } ctx->chromaIntraLoaded = 1; } if (!(ctx->chromaNonIntraLoaded)) { OUT_RING_QW_AGP(cb, 0xc5c, 3); for (j = 0; j < 64; j += 4) { OUT_RING_QW_AGP(cb, 0xc60, ctx->chroma_non_intra_quantiser_matrix[j] | (ctx->chroma_non_intra_quantiser_matrix[j + 1] << 8) | (ctx->chroma_non_intra_quantiser_matrix[j + 2] << 16) | (ctx->chroma_non_intra_quantiser_matrix[j + 3] << 24)); } ctx->chromaNonIntraLoaded = 1; } OUT_RING_QW_AGP(cb, 0xc90, ((mb_width * mb_height) & 0x3fff) | ((control->flags & XVMC_PRED_DCT_FRAME) ? (1 << 14) : 0) | ((control->flags & XVMC_TOP_FIELD_FIRST) ? (1 << 15) : 0) | ((control->mpeg_coding == XVMC_MPEG_2) ? (1 << 16) : 0) | ((mb_width & 0xff) << 18)); OUT_RING_QW_AGP(cb, 0xc94, ((control->flags & XVMC_CONCEALMENT_MOTION_VECTORS) ? 1 : 0) | ((control->flags & XVMC_Q_SCALE_TYPE) ? 2 : 0) | ((control->intra_dc_precision & 3) << 2) | (((1 + 0x100000 / mb_width) & 0xfffff) << 4) | ((control->flags & XVMC_INTRA_VLC_FORMAT) ? (1 << 24) : 0)); OUT_RING_QW_AGP(cb, 0xc98, (((control->FHMV_range) & 0xf) << 0) | (((control->FVMV_range) & 0xf) << 4) | (((control->BHMV_range) & 0xf) << 8) | (((control->BVMV_range) & 0xf) << 12) | ((control->flags & XVMC_SECOND_FIELD) ? (1 << 20) : 0) | (0x0a6 << 16)); } void viaMpegReset(void *xlp) { int i, j; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; ViaCommandBuffer *cb = &xl->agpBuf; BEGIN_HEADER6_DATA(cb, xl, 99); WAITFLAGS(cb, LL_MODE_DECODER_IDLE); OUT_RING_QW_AGP(cb, 0xcf0, 0); for (i = 0; i < 6; i++) { OUT_RING_QW_AGP(cb, 0xcc0, 0); OUT_RING_QW_AGP(cb, 0xc0c, 0x43 | 0x20); for (j = 0xc10; j < 0xc20; j += 4) OUT_RING_QW_AGP(cb, j, 0); } OUT_RING_QW_AGP(cb, 0xc0c, 0x1c3); for (j = 0xc10; j < 0xc20; j += 4) OUT_RING_QW_AGP(cb, j, 0); for (i = 0; i < 19; i++) OUT_RING_QW_AGP(cb, 0xc08, 0); OUT_RING_QW_AGP(cb, 0xc98, 0x400000); for (i = 0; i < 6; i++) { OUT_RING_QW_AGP(cb, 0xcc0, 0); OUT_RING_QW_AGP(cb, 0xc0c, 0x1c3 | 0x20); for (j = 0xc10; j < 0xc20; j += 4) OUT_RING_QW_AGP(cb, j, 0); } OUT_RING_QW_AGP(cb, 0xcf0, 0); } void viaMpegWriteSlice(void *xlp, CARD8 * slice, int nBytes, CARD32 sCode) { int i, n, r; CARD32 *buf; int count; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; ViaCommandBuffer *cb = &xl->agpBuf; if (xl->errors & (LL_DECODER_TIMEDOUT | LL_IDCT_FIFO_ERROR | LL_SLICE_FIFO_ERROR | LL_SLICE_FAULT)) return; n = nBytes >> 2; if (sCode) nBytes += 4; r = nBytes & 3; buf = (CARD32 *) slice; if (r) nBytes += 4 - r; nBytes += 8; BEGIN_HEADER6_DATA(cb, xl, 2); WAITFLAGS(cb, LL_MODE_DECODER_IDLE); OUT_RING_QW_AGP(cb, 0xc9c, nBytes); if (sCode) OUT_RING_QW_AGP(cb, 0xca0, sCode); i = 0; count = 0; do { count += (LL_AGP_CMDBUF_SIZE - 20); count = (count > n) ? n : count; BEGIN_HEADER5_DATA(cb, xl, (count - i), 0xca0); for (; i < count; i++) { OUT_RING_AGP(cb, *buf++); } finish_header_agp(cb); } while (i < n); BEGIN_HEADER5_DATA(cb, xl, 3, 0xca0); if (r) { OUT_RING_AGP(cb, *buf & ((1 << (r << 3)) - 1)); } OUT_RING_AGP(cb, 0); OUT_RING_AGP(cb, 0); finish_header_agp(cb); } void viaVideoSubPictureOffLocked(void *xlp) { CARD32 stride; int proReg = REG_HQV1_INDEX; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; ViaCommandBuffer *cb = xl->videoBuf; if (xl->videoBuf == &xl->agpBuf) syncDMA(xl, 1); stride = VIDIN(xl, proReg | SUBP_CONTROL_STRIDE); WAITFLAGS(cb, LL_MODE_VIDEO); BEGIN_HEADER6_DATA(cb, xl, 1); OUT_RING_QW_AGP(cb, proReg | SUBP_CONTROL_STRIDE, stride & ~SUBP_HQV_ENABLE); } void viaVideoSubPictureLocked(void *xlp, ViaXvMCSubPicture * pViaSubPic) { unsigned i; CARD32 cWord; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; int proReg = REG_HQV1_INDEX; ViaCommandBuffer *cb = xl->videoBuf; if (xl->videoBuf == &xl->agpBuf) syncDMA(xl, 1); WAITFLAGS(cb, LL_MODE_VIDEO); BEGIN_HEADER6_DATA(cb, xl, VIA_SUBPIC_PALETTE_SIZE + 2); for (i = 0; i < VIA_SUBPIC_PALETTE_SIZE; ++i) { OUT_RING_QW_AGP(cb, proReg | RAM_TABLE_CONTROL, pViaSubPic->palette[i]); } cWord = (pViaSubPic->stride & SUBP_STRIDE_MASK) | SUBP_HQV_ENABLE; cWord |= (pViaSubPic->ia44) ? SUBP_IA44 : SUBP_AI44; OUT_RING_QW_AGP(cb, proReg | SUBP_STARTADDR, pViaSubPic->offset); OUT_RING_QW_AGP(cb, proReg | SUBP_CONTROL_STRIDE, cWord); } void viaBlit(void *xlp, unsigned bpp, unsigned srcBase, unsigned srcPitch, unsigned dstBase, unsigned dstPitch, unsigned w, unsigned h, int xdir, int ydir, unsigned blitMode, unsigned color) { CARD32 dwGEMode = 0, srcY = 0, srcX, dstY = 0, dstX; CARD32 cmd; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; ViaCommandBuffer *cb = &xl->agpBuf; if (!w || !h) return; finish_header_agp(cb); switch (bpp) { case 16: dwGEMode |= VIA_GEM_16bpp; break; case 32: dwGEMode |= VIA_GEM_32bpp; break; default: dwGEMode |= VIA_GEM_8bpp; break; } srcX = srcBase & 31; dstX = dstBase & 31; switch (bpp) { case 16: dwGEMode |= VIA_GEM_16bpp; srcX >>= 2; dstX >>= 2; break; case 32: dwGEMode |= VIA_GEM_32bpp; srcX >>= 4; dstX >>= 4; break; default: dwGEMode |= VIA_GEM_8bpp; break; } BEGIN_RING_AGP(cb, xl, 20); WAITFLAGS(cb, LL_MODE_2D); OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_GEMODE), dwGEMode); cmd = 0; if (xdir < 0) { cmd |= VIA_GEC_DECX; srcX += (w - 1); dstX += (w - 1); } if (ydir < 0) { cmd |= VIA_GEC_DECY; srcY += (h - 1); dstY += (h - 1); } switch (blitMode) { case VIABLIT_TRANSCOPY: OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_SRCCOLORKEY), color); OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_KEYCONTROL), 0x4000); cmd |= VIA_GEC_BLT | (VIA_BLIT_COPY << 24); break; case VIABLIT_FILL: OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_FGCOLOR), color); cmd |= VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT | (VIA_BLIT_FILL << 24); break; default: OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_KEYCONTROL), 0x0); cmd |= VIA_GEC_BLT | (VIA_BLIT_COPY << 24); } OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_SRCBASE), (srcBase & ~31) >> 3); OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_DSTBASE), (dstBase & ~31) >> 3); OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_PITCH), VIA_PITCH_ENABLE | (srcPitch >> 3) | (((dstPitch) >> 3) << 16)); OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_SRCPOS), ((srcY << 16) | srcX)); OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_DSTPOS), ((dstY << 16) | dstX)); OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_DIMENSION), (((h - 1) << 16) | (w - 1))); OUT_RING_QW_AGP(cb, H1_ADDR(VIA_REG_GECMD), cmd); } unsigned syncXvMCLowLevel(void *xlp, unsigned int mode, unsigned int doSleep, CARD32 timeStamp) { unsigned errors; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; if (mode == 0) { errors = xl->errors; xl->errors = 0; return errors; } if ((mode & (LL_MODE_VIDEO | LL_MODE_3D)) || !xl->use_agp) { if (xl->performLocking) hwlLock(xl, 0); if ((xl->videoBuf == &xl->agpBuf) || (mode != LL_MODE_VIDEO)) syncDMA(xl, doSleep); if (mode & LL_MODE_3D) syncAccel(xl, mode, doSleep); if (mode & LL_MODE_VIDEO) syncVideo(xl, doSleep); if (xl->performLocking) hwlUnlock(xl, 0); } else { viaDMAWaitTimeStamp(xl, timeStamp, doSleep); } if (mode & (LL_MODE_DECODER_SLICE | LL_MODE_DECODER_IDLE)) syncMpeg(xl, mode, doSleep); errors = xl->errors; xl->errors = 0; return errors; } static int updateLowLevelBuf(XvMCLowLevel * xl, LowLevelBuffer * buf, unsigned width, unsigned height) { unsigned stride, size; drm_via_mem_t *mem = &buf->mem; int ret; stride = (width + 31) & ~31; size = stride * height + (xl->fbDepth >> 3); if (size != mem->size) { if (mem->size) drmCommandWrite(xl->fd, DRM_VIA_FREEMEM, mem, sizeof(*mem)); mem->context = *(xl->drmcontext); mem->size = size; mem->type = VIA_MEM_VIDEO; if (((ret = drmCommandWriteRead(xl->fd, DRM_VIA_ALLOCMEM, mem, sizeof(*mem))) < 0) || mem->size != size) { mem->size = 0; return -1; } } buf->offset = (mem->offset + 31) & ~31; buf->stride = stride; buf->height = height; return 0; } static void cleanupLowLevelBuf(XvMCLowLevel * xl, LowLevelBuffer * buf) { drm_via_mem_t *mem = &buf->mem; if (mem->size) drmCommandWrite(xl->fd, DRM_VIA_FREEMEM, mem, sizeof(*mem)); mem->size = 0; } static void * releaseXvMCLowLevel(XvMCLowLevel * xl) { switch (xl->state) { case ll_llBuf: cleanupLowLevelBuf(xl, &xl->scale); case ll_timeStamp: viaDMACleanupTimeStamp(xl); case ll_pciBuf: free(xl->pciBuf.buf); case ll_agpBuf: free(xl->agpBuf.buf); case ll_init: free(xl); default: ; } return NULL; } void * initXvMCLowLevel(int fd, drm_context_t * ctx, drmLockPtr hwLock, drmAddress mmioAddress, drmAddress fbAddress, unsigned fbStride, unsigned fbDepth, unsigned width, unsigned height, int useAgp, unsigned chipId) { XvMCLowLevel *xl; if (chipId != PCI_CHIP_VT3259 && chipId != PCI_CHIP_VT3364) { fprintf(stderr, "You are using an XvMC driver for the wrong chip.\n"); fprintf(stderr, "Chipid is 0x%04x.\n", chipId); return NULL; } xl = (XvMCLowLevel *) malloc(sizeof(XvMCLowLevel)); if (!xl) return NULL; xl->state = ll_init; xl->agpBuf.buf = (CARD32 *) malloc(LL_AGP_CMDBUF_SIZE * sizeof(CARD32)); if (!xl->agpBuf.buf) return releaseXvMCLowLevel(xl); xl->state = ll_agpBuf; xl->agpBuf.bufSize = LL_AGP_CMDBUF_SIZE; xl->agpBuf.flushFunc = &agpFlush; xl->agpBuf.pos = 0; xl->agpBuf.mode = 0; xl->agpBuf.waitFlags = 0; xl->pciBuf.buf = (CARD32 *) malloc(LL_PCI_CMDBUF_SIZE * sizeof(CARD32)); if (!xl->pciBuf.buf) return releaseXvMCLowLevel(xl); xl->state = ll_pciBuf; xl->pciBuf.bufSize = LL_PCI_CMDBUF_SIZE; xl->pciBuf.flushFunc = &pciFlush; xl->pciBuf.pos = 0; xl->pciBuf.mode = 0; xl->pciBuf.waitFlags = 0; xl->use_agp = useAgp; xl->fd = fd; xl->drmcontext = ctx; xl->hwLock = hwLock; xl->mmioAddress = mmioAddress; xl->fbAddress = fbAddress; xl->fbDepth = fbDepth; xl->fbStride = fbStride; xl->width = width; xl->height = height; xl->performLocking = 1; xl->errors = 0; xl->agpSync = 0; xl->chipId = chipId; if (viaDMAInitTimeStamp(xl)) return releaseXvMCLowLevel(xl); xl->state = ll_timeStamp; xl->scale.mem.size = 0; xl->back.mem.size = 0; if (updateLowLevelBuf(xl, &xl->scale, width, height)) return releaseXvMCLowLevel(xl); xl->state = ll_llBuf; #ifdef VIDEO_DMA xl->videoBuf = &xl->agpBuf; #else xl->videoBuf = &xl->pciBuf; #endif return xl; } void setLowLevelLocking(void *xlp, int performLocking) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; xl->performLocking = performLocking; } void closeXvMCLowLevel(void *xlp) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; releaseXvMCLowLevel(xl); } #if 0 /* Under development */ static CARD32 computeDownScaling(int dst, int *src) { CARD32 value = 0x800; while (*src > dst) { *src >>= 1; value--; } return value; } static void computeHQVScaleAndFilter(XvMCLowLevel * xl) { int srcW, srcH; const XvMCRegion *src = &xl->sRegion, *back = &xl->dRegion; xl->downScaling = FALSE; if (back->w < src->w || back->h < src->h) { xl->downScaling = TRUE; srcW = src->w; srcH = src->h; xl->downScaleW = (back->w >= srcW) ? 0 : HQV_SCALE_ENABLE | HQV_SCALE_DOWN | (computeDownScaling(back->w, &srcW)); xl->downScaleH = (back->h >= srcH) ? 0 : HQV_SCALE_ENABLE | HQV_SCALE_DOWN | (computeDownScaling(back->h, &srcH)); } xl->upScaleW = (back->w == srcW) ? 0 : (0x800 * srcW / back->w) | HQV_SCALE_ENABLE; xl->upScaleH = (back->h == srcH) ? 0 : (0x800 * srcH / back->h) | HQV_SCALE_ENABLE; } static int setupBackBuffer(XvMCLowLevel * xl) { return updateLowLevelBuf(xl, &xl->back, xl->dRegion.w, xl->dRegion.h); } #endif xf86-video-openchrome-0.6.0/src/xvmc/driDrawable.h0000664000175000017500000000436412760724526016653 00000000000000/***************************************************************************** * driDrawable.h: Lean Version of DRI utilities. * * Copyright (c) 2005 Thomas Hellstrom. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHOR(S) OR COPYRIGHT HOLDER(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. */ #ifndef _DRIDRAWABLE_H #define _DRIDRAWABLE_H typedef struct _drawableInfo { drm_drawable_t drmDraw; unsigned stamp; unsigned index; drm_clip_rect_t *clipFront; drm_clip_rect_t *clipBack; int x; int y; int w; int h; int backX; int backY; int numClipFront; int numClipBack; Bool touched; } drawableInfo; /* * Get updated info about the drawable "draw". The drawableInfo record returned is malloced * and administrated internally. Never free it unless you know exactly what you are doing. * The drm hash table "drawHash" needs to be initialized externally. */ extern int getDRIDrawableInfoLocked(void *drawHash, Display * display, int screen, Drawable draw, unsigned lockFlags, int drmFD, drm_context_t drmContext, drmAddress sarea, Bool updateInfo, drawableInfo ** info, unsigned long infoSize); /* * Free all resources created by the above function. Typically done on exit. */ extern void driDestroyHashContents(void *drawHash); #endif xf86-video-openchrome-0.6.0/src/xvmc/viaXvMC.c0000664000175000017500000015313512760724526015744 00000000000000/***************************************************************************** * VIA Unichrome XvMC extension client lib. * * Copyright (c) 2004-2005 Thomas Hellström. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHOR(S) OR COPYRIGHT HOLDER(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. */ /* *Author: Thomas Hellström, 2004. *Bugfixes by among others Pascal Brisset and Terry Barnaby. *DRI protocol support by Thomas Hellström, 2005. */ #undef WAITPAUSE #include "viaXvMCPriv.h" #include "viaLowLevel.h" #include #include #include #include #include #include #include #include #include "vldXvMC.h" #include "xf86dri.h" #include "driDrawable.h" #define SAREAPTR(ctx) ((ViaXvMCSAreaPriv *) \ (((CARD8 *)(ctx)->sAreaAddress) + \ (ctx)->sAreaPrivOffset)) typedef struct { int major; int minor; int patchlevel; } ViaDRMVersion; static int error_base; static int event_base; static unsigned numContexts = 0; static int globalFD; static drmAddress sAreaAddress; static drmAddress fbAddress; static drmAddress mmioAddress; static const ViaDRMVersion drmExpected = { 2, 0, 0 }; static const ViaDRMVersion drmCompat = { 2, 0, 0 }; #define FOURCC_XVMC (('C' << 24) + ('M' << 16) + ('V' << 8) + 'X') #define ppthread_mutex_lock(arg) \ { \ pthread_mutex_lock(arg); \ } \ #define ppthread_mutex_unlock(arg) \ { \ pthread_mutex_unlock(arg); \ } \ static unsigned yOffs(ViaXvMCSurface * srf) { return srf->offsets[0]; } static unsigned vOffs(ViaXvMCSurface * srf) { return srf->offsets[0] + srf->yStride * srf->height; } static unsigned uOffs(ViaXvMCSurface * srf) { return srf->offsets[0] + (srf->yStride * srf->height) + (srf->yStride >> 1) * (srf->height >> 1); } static void defaultQMatrices(ViaXvMCContext * ctx) { int i; static const char intra[64] = { 8, 16, 19, 22, 26, 27, 29, 34, 16, 16, 22, 24, 27, 29, 34, 37, 19, 22, 26, 27, 29, 34, 34, 38, 22, 22, 26, 27, 29, 34, 37, 40, 22, 26, 27, 29, 32, 35, 40, 48, 26, 27, 29, 32, 35, 40, 48, 58, 26, 27, 29, 34, 38, 46, 56, 69, 27, 29, 35, 38, 46, 56, 69, 83 }; for (i = 0; i < 64; ++i) { ctx->intra_quantiser_matrix[i] = intra[i]; ctx->non_intra_quantiser_matrix[i] = 16; } ctx->intraLoaded = 0; ctx->nonIntraLoaded = 0; } static void releaseDecoder(ViaXvMCContext * ctx, int clearCtx) { volatile ViaXvMCSAreaPriv *sAPriv; sAPriv = SAREAPTR(ctx); UNICHROME_UNLOCK(ctx->fd, UNICHROME_LOCK_DECODER1, sAPriv, ctx->drmcontext); } static int grabDecoder(ViaXvMCContext * ctx, int *hadLastLock) { volatile ViaXvMCSAreaPriv *sAPriv = SAREAPTR(ctx); int retFtx, lc; /* * Try to grab the decoder. If it is not available we will sleep until * it becomes available or for a maximum of 20 ms. * Then try to grab it again, unless a timeout occured. If the decoder is * available, the lock should be reasonably fast. */ if (ctx->haveDecoder) { flushXvMCLowLevel(ctx->xl); /* Ignore errors here. */ /*fprintf(stderr,"ViaXvMC: ERROR: Trying to re-lock decoder.\n"); */ *hadLastLock = 1; return 0; } UNICHROME_LOCK(ctx->fd, UNICHROME_LOCK_DECODER1, sAPriv, ctx->drmcontext, lc, retFtx); *hadLastLock = (ctx->drmcontext == lc); return retFtx; } static void setupAttribDesc(Display * display, XvPortID port, const ViaXvMCAttrHolder * attrib, XvAttribute attribDesc[]) { XvAttribute *XvAttribs, *curAD; int num; unsigned i, j; XLockDisplay(display); XvAttribs = XvQueryPortAttributes(display, port, &num); for (i = 0; i < attrib->numAttr; ++i) { curAD = attribDesc + i; curAD->flags = 0; curAD->min_value = 0; curAD->max_value = 0; curAD->name = NULL; for (j = 0; j < num; ++j) { if (attrib->attributes[i].attribute == XInternAtom(display, XvAttribs[j].name, TRUE)) { *curAD = XvAttribs[j]; curAD->name = strdup(XvAttribs[j].name); break; } } } if (XvAttribs) XFree(XvAttribs); XUnlockDisplay(display); } static void releaseAttribDesc(int numAttr, XvAttribute attribDesc[]) { int i; for (i = 0; i < numAttr; ++i) { if (attribDesc[i].name) free(attribDesc[i].name); } } static Status releaseContextResources(Display * display, XvMCContext * context, int freePrivate, Status errType) { ViaXvMCContext *pViaXvMC = (ViaXvMCContext *) context->privData; switch (pViaXvMC->resources) { case context_drawHash: driDestroyHashContents(pViaXvMC->drawHash); drmHashDestroy(pViaXvMC->drawHash); case context_lowLevel: closeXvMCLowLevel(pViaXvMC->xl); case context_mutex: pthread_mutex_destroy(&pViaXvMC->ctxMutex); case context_drmContext: XLockDisplay(display); uniDRIDestroyContext(display, pViaXvMC->screen, pViaXvMC->id); XUnlockDisplay(display); case context_sAreaMap: numContexts--; if (numContexts == 0) drmUnmap(pViaXvMC->sAreaAddress, pViaXvMC->sAreaSize); case context_fbMap: if (numContexts == 0) drmUnmap(pViaXvMC->fbAddress, pViaXvMC->fbSize); case context_mmioMap: if (numContexts == 0) drmUnmap(pViaXvMC->mmioAddress, pViaXvMC->mmioSize); case context_fd: if (numContexts == 0) { if (pViaXvMC->fd >= 0) drmClose(pViaXvMC->fd); } pViaXvMC->fd = -1; case context_driConnection: if (numContexts == 0) { XLockDisplay(display); uniDRICloseConnection(display, pViaXvMC->screen); XUnlockDisplay(display); } case context_context: XLockDisplay(display); _xvmc_destroy_context(display, context); XUnlockDisplay(display); if (!freePrivate) break; default: free(pViaXvMC); context->privData = NULL; } return errType; } _X_EXPORT Status XvMCCreateContext(Display * display, XvPortID port, int surface_type_id, int width, int height, int flags, XvMCContext * context) { ViaXvMCContext *pViaXvMC; int priv_count; uint *priv_data; uint magic; unsigned i; Status ret; int major, minor; ViaXvMCCreateContextRec *tmpComm; drmVersionPtr drmVer; char *curBusID; int isCapable; /* * Verify Obvious things first */ if (context == NULL) { return XvMCBadContext; } if (!(flags & XVMC_DIRECT)) { fprintf(stderr, "Indirect Rendering not supported! Using Direct.\n"); } /* *FIXME: Check $DISPLAY for legal values here */ context->surface_type_id = surface_type_id; context->width = (unsigned short)((width + 15) & ~15); context->height = (unsigned short)((height + 15) & ~15); context->flags = flags; context->port = port; /* * Width, Height, and flags are checked against surface_type_id * and port for validity inside the X server, no need to check * here. */ /* Allocate private Context data */ context->privData = (void *)malloc(sizeof(ViaXvMCContext)); if (!context->privData) { fprintf(stderr, "Unable to allocate resources for XvMC context.\n"); return BadAlloc; } pViaXvMC = (ViaXvMCContext *) context->privData; pViaXvMC->resources = context_none; /* Verify the XvMC extension exists */ XLockDisplay(display); if (!XvMCQueryExtension(display, &event_base, &error_base)) { fprintf(stderr, "XvMC Extension is not available!\n"); free(pViaXvMC); XUnlockDisplay(display); return BadAlloc; } /* Verify XvMC version */ ret = XvMCQueryVersion(display, &major, &minor); if (ret) { fprintf(stderr, "XvMCQuery Version Failed, unable to determine " "protocol version!\n"); } XUnlockDisplay(display); /* FIXME: Check Major and Minor here */ XLockDisplay(display); if ((ret = _xvmc_create_context(display, context, &priv_count, &priv_data))) { XUnlockDisplay(display); fprintf(stderr, "Unable to create XvMC Context!\n"); return releaseContextResources(display, context, 1, BadAlloc); } XUnlockDisplay(display); /* * Check size and version of returned data. */ tmpComm = (ViaXvMCCreateContextRec *) priv_data; if (priv_count != (sizeof(ViaXvMCCreateContextRec) >> 2)) { fprintf(stderr, "_xvmc_create_context() returned incorrect " "data size!\n"); fprintf(stderr, "\tExpected %d, got %d\n", ((int)(sizeof(ViaXvMCCreateContextRec) >> 2)), priv_count); XFree(priv_data); return releaseContextResources(display, context, 1, BadAlloc); } pViaXvMC->resources = context_context; if ((tmpComm->major != VIAXVMC_MAJOR) || (tmpComm->minor != VIAXVMC_MINOR)) { fprintf(stderr, "Version mismatch between the X via driver\n" "and the XvMC library. Cannot continue!\n"); XFree(priv_data); return releaseContextResources(display, context, 1, BadAlloc); } pViaXvMC->ctxNo = tmpComm->ctxNo; pViaXvMC->fbOffset = tmpComm->fbOffset; pViaXvMC->fbSize = tmpComm->fbSize; pViaXvMC->mmioOffset = tmpComm->mmioOffset; pViaXvMC->mmioSize = tmpComm->mmioSize; pViaXvMC->sAreaSize = tmpComm->sAreaSize; pViaXvMC->sAreaPrivOffset = tmpComm->sAreaPrivOffset; pViaXvMC->decoderOn = 0; pViaXvMC->xvMCPort = tmpComm->xvmc_port; pViaXvMC->useAGP = tmpComm->useAGP; pViaXvMC->attrib = tmpComm->initAttrs; pViaXvMC->screen = tmpComm->screen; pViaXvMC->depth = tmpComm->depth; pViaXvMC->stride = tmpComm->stride; pViaXvMC->chipId = tmpComm->chipId; /* * Must free the private data we were passed from X */ XFree(priv_data); priv_data = NULL; /* * Check for direct rendering capable, establish DRI and DRM connections, * map framebuffer, DRI shared area and read-only register areas. * Initial checking for drm has already been done by the server. * Only do this for the first context we create. */ if (numContexts == 0) { XLockDisplay(display); ret = uniDRIQueryDirectRenderingCapable(display, pViaXvMC->screen, &isCapable); if (!ret || !isCapable) { XUnlockDisplay(display); fprintf(stderr, "Direct Rendering is not available on this system!\n"); return releaseContextResources(display, context, 1, BadAlloc); } if (!uniDRIOpenConnection(display, pViaXvMC->screen, &pViaXvMC->sAreaOffset, &curBusID)) { XUnlockDisplay(display); fprintf(stderr, "Could not open DRI connection to X server!\n"); return releaseContextResources(display, context, 1, BadAlloc); } XUnlockDisplay(display); strncpy(pViaXvMC->busIdString, curBusID, 20); pViaXvMC->busIdString[20] = '\0'; XFree(curBusID); pViaXvMC->resources = context_driConnection; if ((pViaXvMC->fd = drmOpen("via", pViaXvMC->busIdString)) < 0) { fprintf(stderr, "DRM Device for via could not be opened.\n"); return releaseContextResources(display, context, 1, BadAlloc); } globalFD = pViaXvMC->fd; pViaXvMC->resources = context_fd; if (NULL == (drmVer = drmGetVersion(pViaXvMC->fd))) { fprintf(stderr, "viaXvMC: Could not get drm version."); return releaseContextResources(display, context, 1, BadAlloc); } if ((drmVer->version_major < drmExpected.major) || (drmVer->version_major > drmCompat.major) || ((drmVer->version_major == drmExpected.major) && (drmVer->version_minor < drmExpected.minor))) { fprintf(stderr, "viaXvMC: Kernel drm is not compatible with XvMC.\n"); fprintf(stderr, "viaXvMC: Kernel drm version: %d.%d.%d " "and I can work with versions %d.%d.x - %d.x.x\n" "Please update either this XvMC driver or your kernel DRM.\n", drmVer->version_major, drmVer->version_minor, drmVer->version_patchlevel, drmExpected.major, drmExpected.minor, drmCompat.major); drmFreeVersion(drmVer); return releaseContextResources(display, context, 1, BadAlloc); } drmFreeVersion(drmVer); drmGetMagic(pViaXvMC->fd, &magic); XLockDisplay(display); if (!uniDRIAuthConnection(display, pViaXvMC->screen, magic)) { XUnlockDisplay(display); fprintf(stderr, "viaXvMC: X server did not allow DRI. Check permissions.\n"); return releaseContextResources(display, context, 1, BadAlloc); } XUnlockDisplay(display); /* * Map the register memory */ if (drmMap(pViaXvMC->fd, pViaXvMC->mmioOffset, pViaXvMC->mmioSize, &mmioAddress) < 0) { fprintf(stderr, "Unable to map the display chip mmio registers.\n"); return releaseContextResources(display, context, 1, BadAlloc); } pViaXvMC->mmioAddress = mmioAddress; pViaXvMC->resources = context_mmioMap; /* * Map Framebuffer memory */ if (drmMap(pViaXvMC->fd, pViaXvMC->fbOffset, pViaXvMC->fbSize, &fbAddress) < 0) { fprintf(stderr, "Unable to map XvMC Framebuffer.\n"); return releaseContextResources(display, context, 1, BadAlloc); } pViaXvMC->fbAddress = fbAddress; pViaXvMC->resources = context_fbMap; /* * Map DRI Sarea. */ if (drmMap(pViaXvMC->fd, pViaXvMC->sAreaOffset, pViaXvMC->sAreaSize, &sAreaAddress) < 0) { fprintf(stderr, "Unable to map DRI SAREA.\n"); return releaseContextResources(display, context, 1, BadAlloc); } } else { pViaXvMC->fd = globalFD; pViaXvMC->mmioAddress = mmioAddress; pViaXvMC->fbAddress = fbAddress; } pViaXvMC->sAreaAddress = sAreaAddress; pViaXvMC->resources = context_sAreaMap; numContexts++; /* * Find a matching visual. Important only for direct drawing to the visible * frame-buffer. */ XLockDisplay(display); ret = XMatchVisualInfo(display, pViaXvMC->screen, (pViaXvMC->depth == 32) ? 24 : pViaXvMC->depth, TrueColor, &pViaXvMC->visualInfo); XUnlockDisplay(display); if (!ret) { fprintf(stderr, "viaXvMC: Could not find a matching TrueColor visual.\n"); return releaseContextResources(display, context, 1, BadAlloc); } if (!uniDRICreateContext(display, pViaXvMC->screen, pViaXvMC->visualInfo.visual, &pViaXvMC->id, &pViaXvMC->drmcontext)) { fprintf(stderr, "viaXvMC: Could not create DRI context.\n"); return releaseContextResources(display, context, 1, BadAlloc); } pViaXvMC->resources = context_drmContext; for (i = 0; i < VIA_MAX_RENDSURF; ++i) { pViaXvMC->rendSurf[i] = 0; } pViaXvMC->lastSrfDisplaying = ~0; setupAttribDesc(display, port, &pViaXvMC->attrib, pViaXvMC->attribDesc); pViaXvMC->hwLock = (drmLockPtr) pViaXvMC->sAreaAddress; defaultQMatrices(pViaXvMC); pViaXvMC->chromaIntraLoaded = 1; pViaXvMC->chromaNonIntraLoaded = 1; pViaXvMC->yStride = (width + 31) & ~31; pViaXvMC->haveDecoder = 0; pViaXvMC->attribChanged = 1; pViaXvMC->haveXv = 0; pViaXvMC->port = context->port; pthread_mutex_init(&pViaXvMC->ctxMutex, NULL); pViaXvMC->resources = context_mutex; pViaXvMC->timeStamp = 0; setRegion(0, 0, -1, -1, pViaXvMC->sRegion); setRegion(0, 0, -1, -1, pViaXvMC->dRegion); if (NULL == (pViaXvMC->xl = initXvMCLowLevel(pViaXvMC->fd, &pViaXvMC->drmcontext, pViaXvMC->hwLock, pViaXvMC->mmioAddress, pViaXvMC->fbAddress, pViaXvMC->stride, pViaXvMC->depth, context->width, context->height, pViaXvMC->useAGP, pViaXvMC->chipId))) { fprintf(stderr, "ViaXvMC: Could not allocate timestamp blit area.\n"); return releaseContextResources(display, context, 1, BadAlloc); } pViaXvMC->resources = context_lowLevel; setAGPSyncLowLevel(pViaXvMC->xl, 1, 0); if (NULL == (pViaXvMC->drawHash = drmHashCreate())) { fprintf(stderr, "ViaXvMC: Could not allocate drawable hash table.\n"); return releaseContextResources(display, context, 1, BadAlloc); } pViaXvMC->resources = context_drawHash; if (numContexts == 1) { hwlLock(pViaXvMC->xl, 1); setLowLevelLocking(pViaXvMC->xl, 0); viaVideoSubPictureOffLocked(pViaXvMC->xl); flushXvMCLowLevel(pViaXvMC->xl); setLowLevelLocking(pViaXvMC->xl, 1); hwlUnlock(pViaXvMC->xl, 1); } return Success; } _X_EXPORT Status XvMCDestroyContext(Display * display, XvMCContext * context) { ViaXvMCContext *pViaXvMC; if (context == NULL) { return (error_base + XvMCBadContext); } if (NULL == (pViaXvMC = context->privData)) { return (error_base + XvMCBadContext); } /* * Release decoder if we have it. In case of crash or termination * before XvMCDestroyContext, the X server will take care of this. */ releaseAttribDesc(pViaXvMC->attrib.numAttr, pViaXvMC->attribDesc); releaseDecoder(pViaXvMC, 1); return releaseContextResources(display, context, 1, Success); } _X_EXPORT Status XvMCCreateSurface(Display * display, XvMCContext * context, XvMCSurface * surface) { ViaXvMCContext *pViaXvMC; ViaXvMCSurface *pViaSurface; int priv_count; unsigned *priv_data; unsigned i; Status ret; if ((surface == NULL) || (context == NULL) || (display == NULL)) { return BadValue; } pViaXvMC = (ViaXvMCContext *) context->privData; ppthread_mutex_lock(&pViaXvMC->ctxMutex); if (pViaXvMC == NULL) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return (error_base + XvMCBadContext); } pViaSurface = surface->privData = (ViaXvMCSurface *) malloc(sizeof(ViaXvMCSurface)); if (!surface->privData) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadAlloc; } XLockDisplay(display); if ((ret = _xvmc_create_surface(display, context, surface, &priv_count, &priv_data))) { XUnlockDisplay(display); free(pViaSurface); fprintf(stderr, "Unable to create XvMC Surface.\n"); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return ret; } XUnlockDisplay(display); pViaSurface->srfNo = priv_data[0]; /* * Store framebuffer offsets to the buffers allocated for this surface. * For some chipset revisions, surfaces may be double-buffered. */ pViaSurface->numBuffers = priv_data[1]; for (i = 0; i < pViaSurface->numBuffers; ++i) { pViaSurface->offsets[i] = priv_data[i + 2]; } pViaSurface->curBuf = 0; /* Free data returned from xvmc_create_surface */ XFree(priv_data); pViaSurface->width = context->width; pViaSurface->height = context->height; pViaSurface->yStride = pViaXvMC->yStride; pViaSurface->privContext = pViaXvMC; pViaSurface->privSubPic = NULL; pViaSurface->needsSync = 0; ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } _X_EXPORT Status XvMCDestroySurface(Display * display, XvMCSurface * surface) { ViaXvMCSurface *pViaSurface; if ((display == NULL) || (surface == NULL)) { return BadValue; } if (surface->privData == NULL) { return (error_base + XvMCBadSurface); } pViaSurface = (ViaXvMCSurface *) surface->privData; XLockDisplay(display); _xvmc_destroy_surface(display, surface); XUnlockDisplay(display); free(pViaSurface); surface->privData = NULL; return Success; } _X_EXPORT Status XvMCPutSlice2(Display * display, XvMCContext * context, char *slice, int nBytes, int sliceCode) { ViaXvMCContext *pViaXvMC; CARD32 sCode = 0x00010000 | (sliceCode & 0xFF) << 24; if ((display == NULL) || (context == NULL)) { return BadValue; } if (NULL == (pViaXvMC = context->privData)) { return (error_base + XvMCBadContext); } ppthread_mutex_lock(&pViaXvMC->ctxMutex); if (!pViaXvMC->haveDecoder) { fprintf(stderr, "XvMCPutSlice: This context does not own decoder!\n"); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadAlloc; } viaMpegWriteSlice(pViaXvMC->xl, (CARD8 *) slice, nBytes, sCode); flushPCIXvMCLowLevel(pViaXvMC->xl); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } _X_EXPORT Status XvMCPutSlice(Display * display, XvMCContext * context, char *slice, int nBytes) { ViaXvMCContext *pViaXvMC; if ((display == NULL) || (context == NULL)) { return BadValue; } if (NULL == (pViaXvMC = context->privData)) { return (error_base + XvMCBadContext); } ppthread_mutex_lock(&pViaXvMC->ctxMutex); if (!pViaXvMC->haveDecoder) { fprintf(stderr, "XvMCPutSlice: This context does not own decoder!\n"); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadAlloc; } viaMpegWriteSlice(pViaXvMC->xl, (CARD8 *) slice, nBytes, 0); flushPCIXvMCLowLevel(pViaXvMC->xl); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } static Status updateXVOverlay(Display * display, ViaXvMCContext * pViaXvMC, ViaXvMCSurface * pViaSurface, Drawable draw, short srcx, short srcy, unsigned short srcw, unsigned short srch, short destx, short desty, unsigned short destw, unsigned short desth) { ViaXvMCCommandBuffer buf; ViaXvMCSubPicture *pViaSubPic; Status ret; if (!pViaXvMC->haveXv) { pViaXvMC->xvImage = XvCreateImage(display, pViaXvMC->port, FOURCC_XVMC, (char *)&buf, pViaSurface->width, pViaSurface->height); pViaXvMC->gc = XCreateGC(display, draw, 0, 0); pViaXvMC->haveXv = 1; } pViaXvMC->draw = draw; pViaXvMC->xvImage->data = (char *)&buf; buf.command = (pViaXvMC->attribChanged) ? VIA_XVMC_COMMAND_FDISPLAY : VIA_XVMC_COMMAND_DISPLAY; buf.ctxNo = pViaXvMC->ctxNo | VIA_XVMC_VALID; buf.srfNo = pViaSurface->srfNo | VIA_XVMC_VALID; pViaSubPic = pViaSurface->privSubPic; buf.subPicNo = ((NULL == pViaSubPic) ? 0 : pViaSubPic->srfNo) | VIA_XVMC_VALID; buf.attrib = pViaXvMC->attrib; XLockDisplay(display); if ((ret = XvPutImage(display, pViaXvMC->port, draw, pViaXvMC->gc, pViaXvMC->xvImage, srcx, srcy, srcw, srch, destx, desty, destw, desth))) { XUnlockDisplay(display); return ret; } XSync(display, 0); XUnlockDisplay(display); pViaXvMC->attribChanged = 0; return Success; } _X_EXPORT Status XvMCPutSurface(Display * display, XvMCSurface * surface, Drawable draw, short srcx, short srcy, unsigned short srcw, unsigned short srch, short destx, short desty, unsigned short destw, unsigned short desth, int flags) { /* * This function contains some hairy locking logic. What we really want to * do is to flip the picture ASAP, to get a low latency and smooth playback. * However, if somebody else used the overlay since we used it last or if it is * our first time, we'll have to call X to update the overlay first. Otherwise * we'll do the overlay update once we've flipped. Since we release the hardware * lock when we call X, X needs to verify using the SAREA that nobody else flipped * in a picture between the lock release and the X server control. Similarly * when the overlay update returns, we have to make sure that we still own the * overlay. */ ViaXvMCSurface *pViaSurface; ViaXvMCContext *pViaXvMC; ViaXvMCSubPicture *pViaSubPic; volatile ViaXvMCSAreaPriv *sAPriv; Status ret; unsigned dispSurface, lastSurface; int overlayUpdated; drawableInfo *drawInfo; XvMCRegion sReg, dReg; Bool forceUpdate = FALSE; if ((display == NULL) || (surface == NULL)) { return BadValue; } if (NULL == (pViaSurface = surface->privData)) { return (error_base + XvMCBadSurface); } if (NULL == (pViaXvMC = pViaSurface->privContext)) { return (error_base + XvMCBadContext); } ppthread_mutex_lock(&pViaXvMC->ctxMutex); pViaSubPic = pViaSurface->privSubPic; sAPriv = SAREAPTR(pViaXvMC); setRegion(srcx, srcy, srcw, srch, sReg); setRegion(destx, desty, destw, desth, dReg); if ((!regionEqual(sReg, pViaXvMC->sRegion)) || (!regionEqual(dReg, pViaXvMC->dRegion))) { /* * Force update of the video overlay to match the new format. */ pViaXvMC->sRegion = sReg; pViaXvMC->dRegion = dReg; forceUpdate = TRUE; } hwlLock(pViaXvMC->xl, 1); if (getDRIDrawableInfoLocked(pViaXvMC->drawHash, display, pViaXvMC->screen, draw, 0, pViaXvMC->fd, pViaXvMC->drmcontext, pViaXvMC->sAreaAddress, FALSE, &drawInfo, sizeof(*drawInfo))) { hwlUnlock(pViaXvMC->xl, 1); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadAccess; } setLowLevelLocking(pViaXvMC->xl, 0); /* * Put a surface ID in the SAREA to "authenticate" to the * X server. */ dispSurface = sAPriv->XvMCDisplaying[pViaXvMC->xvMCPort]; lastSurface = pViaXvMC->lastSrfDisplaying; sAPriv->XvMCDisplaying[pViaXvMC->xvMCPort] = pViaXvMC->lastSrfDisplaying = pViaSurface->srfNo | VIA_XVMC_VALID; overlayUpdated = 0; viaVideoSetSWFLipLocked(pViaXvMC->xl, yOffs(pViaSurface), uOffs(pViaSurface), vOffs(pViaSurface), pViaSurface->yStride, pViaSurface->yStride >> 1); while ((lastSurface != dispSurface) || forceUpdate) { forceUpdate = FALSE; flushPCIXvMCLowLevel(pViaXvMC->xl); setLowLevelLocking(pViaXvMC->xl, 1); hwlUnlock(pViaXvMC->xl, 1); /* * We weren't the last to display. Update the overlay before flipping. */ ret = updateXVOverlay(display, pViaXvMC, pViaSurface, draw, srcx, srcy, srcw, srch, destx, desty, destw, desth); if (ret) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return ret; } hwlLock(pViaXvMC->xl, 1); if (getDRIDrawableInfoLocked(pViaXvMC->drawHash, display, pViaXvMC->screen, draw, 0, pViaXvMC->fd, pViaXvMC->drmcontext, pViaXvMC->sAreaAddress, FALSE, &drawInfo, sizeof(*drawInfo))) { hwlUnlock(pViaXvMC->xl, 1); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadAccess; } setLowLevelLocking(pViaXvMC->xl, 0); lastSurface = pViaSurface->srfNo | VIA_XVMC_VALID; dispSurface = sAPriv->XvMCDisplaying[pViaXvMC->xvMCPort]; overlayUpdated = 1; } /* * Subpictures */ if (NULL != pViaSubPic) { if (sAPriv->XvMCSubPicOn[pViaXvMC->xvMCPort] != (pViaSubPic->srfNo | VIA_XVMC_VALID)) { sAPriv->XvMCSubPicOn[pViaXvMC->xvMCPort] = pViaSubPic->srfNo | VIA_XVMC_VALID; viaVideoSubPictureLocked(pViaXvMC->xl, pViaSubPic); } } else { if (sAPriv->XvMCSubPicOn[pViaXvMC->xvMCPort] & VIA_XVMC_VALID) { viaVideoSubPictureOffLocked(pViaXvMC->xl); sAPriv->XvMCSubPicOn[pViaXvMC->xvMCPort] &= ~VIA_XVMC_VALID; } } /* * Flip */ viaVideoSWFlipLocked(pViaXvMC->xl, flags, pViaSurface->progressiveSequence); flushXvMCLowLevel(pViaXvMC->xl); setLowLevelLocking(pViaXvMC->xl, 1); hwlUnlock(pViaXvMC->xl, 1); if (overlayUpdated || !drawInfo->touched) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } /* * Update overlay */ ret = updateXVOverlay(display, pViaXvMC, pViaSurface, draw, srcx, srcy, srcw, srch, destx, desty, destw, desth); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return ret; } void debugControl(const XvMCMpegControl * control) { printf("BVMV_range: %u\n", control->BVMV_range); printf("BHMV_range: %u\n", control->BHMV_range); printf("FVMV_range: %u\n", control->FVMV_range); printf("FHMV_range: %u\n", control->FHMV_range); printf("picture_structure: %u\n", control->picture_structure); printf("intra_dc_precision: %u\n", control->intra_dc_precision); printf("picture_coding_type: %u\n", control->picture_coding_type); printf("mpeg_coding: %u\n", control->mpeg_coding); printf("flags: 0x%x\n", control->flags); } _X_EXPORT Status XvMCBeginSurface(Display * display, XvMCContext * context, XvMCSurface * target_surface, XvMCSurface * past_surface, XvMCSurface * future_surface, const XvMCMpegControl * control) { ViaXvMCSurface *targS, *futS, *pastS; ViaXvMCContext *pViaXvMC; int hadDecoderLast; CARD32 timeStamp; if ((display == NULL) || (context == NULL) || (target_surface == NULL)) { return BadValue; } pViaXvMC = context->privData; ppthread_mutex_lock(&pViaXvMC->ctxMutex); if (grabDecoder(pViaXvMC, &hadDecoderLast)) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadAlloc; } pViaXvMC->haveDecoder = 1; /* * We need to wait for decoder idle at next flush, since hardware doesn't queue * beginsurface requests until the decoder is idle. This is * done by waiting on the last previous timestamp, or if there was another context * having the decoder before us, by emitting a new one. */ if (pViaXvMC->useAGP) { if (!hadDecoderLast || pViaXvMC->timeStamp == 0) { timeStamp = viaDMATimeStampLowLevel(pViaXvMC->xl); if (flushXvMCLowLevel(pViaXvMC->xl)) { releaseDecoder(pViaXvMC, 0); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadAlloc; } pViaXvMC->timeStamp = timeStamp; } else { timeStamp = pViaXvMC->timeStamp; } setAGPSyncLowLevel(pViaXvMC->xl, 1, timeStamp); } if (!hadDecoderLast || !pViaXvMC->decoderOn) { pViaXvMC->intraLoaded = 0; pViaXvMC->nonIntraLoaded = 0; } viaMpegReset(pViaXvMC->xl); targS = (ViaXvMCSurface *) target_surface->privData; futS = NULL; pastS = NULL; pViaXvMC->rendSurf[0] = targS->srfNo | VIA_XVMC_VALID; if (future_surface) { futS = (ViaXvMCSurface *) future_surface->privData; futS->needsSync = 0; } if (past_surface) { pastS = (ViaXvMCSurface *) past_surface->privData; pastS->needsSync = 0; } targS->progressiveSequence = (control->flags & XVMC_PROGRESSIVE_SEQUENCE); targS->topFieldFirst = (control->flags & XVMC_TOP_FIELD_FIRST); targS->privSubPic = NULL; viaMpegSetSurfaceStride(pViaXvMC->xl, pViaXvMC); viaMpegSetFB(pViaXvMC->xl, 0, yOffs(targS), uOffs(targS), vOffs(targS)); if (past_surface) { viaMpegSetFB(pViaXvMC->xl, 1, yOffs(pastS), uOffs(pastS), vOffs(pastS)); } else { viaMpegSetFB(pViaXvMC->xl, 1, 0, 0, 0); } if (future_surface) { viaMpegSetFB(pViaXvMC->xl, 2, yOffs(futS), uOffs(futS), vOffs(futS)); } else { viaMpegSetFB(pViaXvMC->xl, 2, 0, 0, 0); } viaMpegBeginPicture(pViaXvMC->xl, pViaXvMC, context->width, context->height, control); flushPCIXvMCLowLevel(pViaXvMC->xl); targS->needsSync = 1; targS->syncMode = LL_MODE_DECODER_IDLE; pViaXvMC->decoderOn = 1; ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } _X_EXPORT Status XvMCSyncSurface(Display * display, XvMCSurface * surface) { ViaXvMCSurface *pViaSurface; ViaXvMCContext *pViaXvMC; unsigned i; if ((display == NULL) || (surface == NULL)) { return BadValue; } if (surface->privData == NULL) { return (error_base + XvMCBadSurface); } pViaSurface = (ViaXvMCSurface *) surface->privData; pViaXvMC = pViaSurface->privContext; if (pViaXvMC == NULL) { return (error_base + XvMCBadSurface); } ppthread_mutex_lock(&pViaXvMC->ctxMutex); if (pViaSurface->needsSync) { CARD32 timeStamp = pViaSurface->timeStamp; int syncMode = pViaSurface->syncMode; if (pViaXvMC->useAGP) { syncMode = (pViaSurface->syncMode == LL_MODE_2D || pViaSurface->timeStamp < pViaXvMC->timeStamp) ? LL_MODE_2D : LL_MODE_DECODER_IDLE; if (pViaSurface->syncMode != LL_MODE_2D) timeStamp = pViaXvMC->timeStamp; } else if (syncMode != LL_MODE_2D && pViaXvMC->rendSurf[0] != (pViaSurface->srfNo | VIA_XVMC_VALID)) { pViaSurface->needsSync = 0; ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } if (syncXvMCLowLevel(pViaXvMC->xl, syncMode, 1, pViaSurface->timeStamp)) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadValue; } pViaSurface->needsSync = 0; } if (pViaXvMC->rendSurf[0] == (pViaSurface->srfNo | VIA_XVMC_VALID)) { pViaSurface->needsSync = 0; for (i = 0; i < VIA_MAX_RENDSURF; ++i) { pViaXvMC->rendSurf[i] = 0; } } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } _X_EXPORT Status XvMCLoadQMatrix(Display * display, XvMCContext * context, const XvMCQMatrix * qmx) { ViaXvMCContext * pViaXvMC; if ((display == NULL) || (context == NULL)) { return BadValue; } if (NULL == (pViaXvMC = context->privData)) { return (error_base + XvMCBadContext); } ppthread_mutex_lock(&pViaXvMC->ctxMutex); if (qmx->load_intra_quantiser_matrix) { memcpy(pViaXvMC->intra_quantiser_matrix, qmx->intra_quantiser_matrix, sizeof(qmx->intra_quantiser_matrix)); pViaXvMC->intraLoaded = 0; } if (qmx->load_non_intra_quantiser_matrix) { memcpy(pViaXvMC->non_intra_quantiser_matrix, qmx->non_intra_quantiser_matrix, sizeof(qmx->non_intra_quantiser_matrix)); pViaXvMC->nonIntraLoaded = 0; } if (qmx->load_chroma_intra_quantiser_matrix) { memcpy(pViaXvMC->chroma_intra_quantiser_matrix, qmx->chroma_intra_quantiser_matrix, sizeof(qmx->chroma_intra_quantiser_matrix)); pViaXvMC->chromaIntraLoaded = 0; } if (qmx->load_chroma_non_intra_quantiser_matrix) { memcpy(pViaXvMC->chroma_non_intra_quantiser_matrix, qmx->chroma_non_intra_quantiser_matrix, sizeof(qmx->chroma_non_intra_quantiser_matrix)); pViaXvMC->chromaNonIntraLoaded = 0; } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } /* * Below, we provide functions unusable for this implementation, but for * standard completeness. */ _X_EXPORT Status XvMCRenderSurface (Display * display, XvMCContext * context, unsigned int picture_structure, XvMCSurface * target_surface, XvMCSurface * past_surface, XvMCSurface * future_surface, unsigned int flags, unsigned int num_macroblocks, unsigned int first_macroblock, XvMCMacroBlockArray * macroblock_array, XvMCBlockArray * blocks) { return (error_base + XvMCBadContext); } _X_EXPORT Status XvMCCreateBlocks (Display * display, XvMCContext * context, unsigned int num_blocks, XvMCBlockArray * block) { return (error_base + XvMCBadContext); } _X_EXPORT Status XvMCDestroyBlocks(Display * display, XvMCBlockArray * block) { return Success; } _X_EXPORT Status XvMCCreateMacroBlocks (Display * display, XvMCContext * context, unsigned int num_blocks, XvMCMacroBlockArray * blocks) { return (error_base + XvMCBadContext); } _X_EXPORT Status XvMCDestroyMacroBlocks(Display * display, XvMCMacroBlockArray * block) { return (error_base + XvMCBadContext); } _X_EXPORT Status XvMCCreateSubpicture(Display * display, XvMCContext * context, XvMCSubpicture * subpicture, unsigned short width, unsigned short height, int xvimage_id) { ViaXvMCContext *pViaXvMC; ViaXvMCSubPicture *pViaSubPic; int priv_count; unsigned *priv_data; Status ret; if ((subpicture == NULL) || (context == NULL) || (display == NULL)) { return BadValue; } pViaXvMC = (ViaXvMCContext *) context->privData; if (pViaXvMC == NULL) { return (error_base + XvMCBadContext); } subpicture->privData = (ViaXvMCSubPicture *) malloc(sizeof(ViaXvMCSubPicture)); if (!subpicture->privData) { return BadAlloc; } ppthread_mutex_lock(&pViaXvMC->ctxMutex); subpicture->width = context->width; subpicture->height = context->height; subpicture->xvimage_id = xvimage_id; pViaSubPic = (ViaXvMCSubPicture *) subpicture->privData; XLockDisplay(display); if ((ret = _xvmc_create_subpicture(display, context, subpicture, &priv_count, &priv_data))) { XUnlockDisplay(display); free(pViaSubPic); fprintf(stderr, "Unable to create XvMC Subpicture.\n"); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return ret; } XUnlockDisplay(display); subpicture->num_palette_entries = VIA_SUBPIC_PALETTE_SIZE; subpicture->entry_bytes = 3; strncpy(subpicture->component_order, "YUV", 4); pViaSubPic->srfNo = priv_data[0]; pViaSubPic->offset = priv_data[1]; pViaSubPic->stride = (subpicture->width + 31) & ~31; pViaSubPic->privContext = pViaXvMC; pViaSubPic->ia44 = (xvimage_id == FOURCC_IA44); pViaSubPic->needsSync = 0; /* Free data returned from _xvmc_create_subpicture */ XFree(priv_data); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } _X_EXPORT Status XvMCSetSubpicturePalette(Display * display, XvMCSubpicture * subpicture, unsigned char *palette) { ViaXvMCSubPicture *pViaSubPic; ViaXvMCContext *pViaXvMC; volatile ViaXvMCSAreaPriv *sAPriv; unsigned i; CARD32 tmp; if ((subpicture == NULL) || (display == NULL)) { return BadValue; } if (subpicture->privData == NULL) { return (error_base + XvMCBadSubpicture); } pViaSubPic = (ViaXvMCSubPicture *) subpicture->privData; for (i = 0; i < VIA_SUBPIC_PALETTE_SIZE; ++i) { tmp = *palette++ << 8; tmp |= *palette++ << 16; tmp |= *palette++ << 24; tmp |= ((i & 0x0f) << 4) | 0x07; pViaSubPic->palette[i] = tmp; } pViaXvMC = pViaSubPic->privContext; ppthread_mutex_lock(&pViaXvMC->ctxMutex); sAPriv = SAREAPTR(pViaXvMC); hwlLock(pViaXvMC->xl, 1); setLowLevelLocking(pViaXvMC->xl, 0); /* * If the subpicture is displaying, Immeadiately update it with the * new palette. */ if (sAPriv->XvMCSubPicOn[pViaXvMC->xvMCPort] == (pViaSubPic->srfNo | VIA_XVMC_VALID)) { viaVideoSubPictureLocked(pViaXvMC->xl, pViaSubPic); } flushPCIXvMCLowLevel(pViaXvMC->xl); setLowLevelLocking(pViaXvMC->xl, 1); hwlUnlock(pViaXvMC->xl, 1); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } static int findOverlap(unsigned width, unsigned height, short *dstX, short *dstY, short *srcX, short *srcY, unsigned short *areaW, unsigned short *areaH) { int w, h; unsigned mWidth, mHeight; w = *areaW; h = *areaH; if ((*dstX >= width) || (*dstY >= height)) return 1; if (*dstX < 0) { w += *dstX; *srcX -= *dstX; *dstX = 0; } if (*dstY < 0) { h += *dstY; *srcY -= *dstY; *dstY = 0; } if ((w <= 0) || ((h <= 0))) return 1; mWidth = width - *dstX; mHeight = height - *dstY; *areaW = (w <= mWidth) ? w : mWidth; *areaH = (h <= mHeight) ? h : mHeight; return 0; } _X_EXPORT Status XvMCClearSubpicture(Display * display, XvMCSubpicture * subpicture, short x, short y, unsigned short width, unsigned short height, unsigned int color) { ViaXvMCContext *pViaXvMC; ViaXvMCSubPicture *pViaSubPic; short dummyX, dummyY; unsigned long bOffs; if ((subpicture == NULL) || (display == NULL)) { return BadValue; } if (subpicture->privData == NULL) { return (error_base + XvMCBadSubpicture); } pViaSubPic = (ViaXvMCSubPicture *) subpicture->privData; pViaXvMC = pViaSubPic->privContext; ppthread_mutex_lock(&pViaXvMC->ctxMutex); /* Clip clearing area so that it fits inside subpicture. */ if (findOverlap(subpicture->width, subpicture->height, &x, &y, &dummyX, &dummyY, &width, &height)) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } bOffs = pViaSubPic->offset + y * pViaSubPic->stride + x; viaBlit(pViaXvMC->xl, 8, 0, pViaSubPic->stride, bOffs, pViaSubPic->stride, width, height, 1, 1, VIABLIT_FILL, color); pViaSubPic->needsSync = 1; pViaSubPic->timeStamp = viaDMATimeStampLowLevel(pViaXvMC->xl); if (flushXvMCLowLevel(pViaXvMC->xl)) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadValue; } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } _X_EXPORT Status XvMCCompositeSubpicture(Display * display, XvMCSubpicture * subpicture, XvImage * image, short srcx, short srcy, unsigned short width, unsigned short height, short dstx, short dsty) { unsigned i; ViaXvMCContext *pViaXvMC; ViaXvMCSubPicture *pViaSubPic; CARD8 *dAddr, *sAddr; if ((subpicture == NULL) || (display == NULL) || (image == NULL)) { return BadValue; } if (NULL == (pViaSubPic = (ViaXvMCSubPicture *) subpicture->privData)) { return (error_base + XvMCBadSubpicture); } pViaXvMC = pViaSubPic->privContext; if (image->id != subpicture->xvimage_id) return BadMatch; ppthread_mutex_lock(&pViaXvMC->ctxMutex); /* * Clip copy area so that it fits inside subpicture and image. */ if (findOverlap(subpicture->width, subpicture->height, &dstx, &dsty, &srcx, &srcy, &width, &height)) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } if (findOverlap(image->width, image->height, &srcx, &srcy, &dstx, &dsty, &width, &height)) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } if (pViaSubPic->needsSync) { if (syncXvMCLowLevel(pViaXvMC->xl, LL_MODE_2D, 0, pViaSubPic->timeStamp)) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadValue; } pViaSubPic->needsSync = 0; } for (i = 0; i < height; ++i) { dAddr = (((CARD8 *) pViaXvMC->fbAddress) + (pViaSubPic->offset + (dsty + i) * pViaSubPic->stride + dstx)); sAddr = (((CARD8 *) image->data) + (image->offsets[0] + (srcy + i) * image->pitches[0] + srcx)); memcpy(dAddr, sAddr, width); } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } _X_EXPORT Status XvMCBlendSubpicture(Display * display, XvMCSurface * target_surface, XvMCSubpicture * subpicture, short subx, short suby, unsigned short subw, unsigned short subh, short surfx, short surfy, unsigned short surfw, unsigned short surfh) { ViaXvMCSurface *pViaSurface; ViaXvMCSubPicture *pViaSubPic; if ((display == NULL) || target_surface == NULL) { return BadValue; } if (subx || suby || surfx || surfy || (subw != surfw) || (subh != surfh)) { fprintf(stderr, "ViaXvMC: Only completely overlapping subpicture " "supported.\n"); return BadValue; } if (NULL == (pViaSurface = target_surface->privData)) { return (error_base + XvMCBadSurface); } if (subpicture) { if (NULL == (pViaSubPic = subpicture->privData)) { return (error_base + XvMCBadSubpicture); } pViaSurface->privSubPic = pViaSubPic; } else { pViaSurface->privSubPic = NULL; } return Success; } _X_EXPORT Status XvMCBlendSubpicture2(Display * display, XvMCSurface * source_surface, XvMCSurface * target_surface, XvMCSubpicture * subpicture, short subx, short suby, unsigned short subw, unsigned short subh, short surfx, short surfy, unsigned short surfw, unsigned short surfh) { ViaXvMCSurface *pViaSurface, *pViaSSurface; ViaXvMCSubPicture *pViaSubPic; ViaXvMCContext *pViaXvMC; unsigned width, height; if ((display == NULL) || target_surface == NULL || source_surface == NULL) { return BadValue; } if (subx || suby || surfx || surfy || (subw != surfw) || (subh != surfh)) { fprintf(stderr, "ViaXvMC: Only completely overlapping subpicture " "supported.\n"); return BadMatch; } if (NULL == (pViaSurface = target_surface->privData)) { return (error_base + XvMCBadSurface); } if (NULL == (pViaSSurface = source_surface->privData)) { return (error_base + XvMCBadSurface); } pViaXvMC = pViaSurface->privContext; width = pViaSSurface->width; height = pViaSSurface->height; if (width != pViaSurface->width || height != pViaSSurface->height) { return BadMatch; } if (XvMCSyncSurface(display, source_surface)) { return BadValue; } ppthread_mutex_lock(&pViaXvMC->ctxMutex); viaBlit(pViaXvMC->xl, 8, yOffs(pViaSSurface), pViaSSurface->yStride, yOffs(pViaSurface), pViaSurface->yStride, width, height, 1, 1, VIABLIT_COPY, 0); flushPCIXvMCLowLevel(pViaXvMC->xl); if (pViaXvMC->chipId != PCI_CHIP_VT3259) { /* * YV12 Chroma blit. */ viaBlit(pViaXvMC->xl, 8, uOffs(pViaSSurface), pViaSSurface->yStride >> 1, uOffs(pViaSurface), pViaSurface->yStride >> 1, width >> 1, height >> 1, 1, 1, VIABLIT_COPY, 0); flushPCIXvMCLowLevel(pViaXvMC->xl); viaBlit(pViaXvMC->xl, 8, vOffs(pViaSSurface), pViaSSurface->yStride >> 1, vOffs(pViaSurface), pViaSurface->yStride >> 1, width >> 1, height >> 1, 1, 1, VIABLIT_COPY, 0); } else { /* * NV12 Chroma blit. */ viaBlit(pViaXvMC->xl, 8, vOffs(pViaSSurface), pViaSSurface->yStride, vOffs(pViaSurface), pViaSurface->yStride, width, height >> 1, 1, 1, VIABLIT_COPY, 0); } pViaSurface->needsSync = 1; pViaSurface->syncMode = LL_MODE_2D; pViaSurface->timeStamp = viaDMATimeStampLowLevel(pViaXvMC->xl); if (flushXvMCLowLevel(pViaXvMC->xl)) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadValue; } if (subpicture) { if (NULL == (pViaSubPic = subpicture->privData)) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return (error_base + XvMCBadSubpicture); } pViaSurface->privSubPic = pViaSubPic; } else { pViaSurface->privSubPic = NULL; } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } _X_EXPORT Status XvMCSyncSubpicture(Display * display, XvMCSubpicture * subpicture) { ViaXvMCSubPicture *pViaSubPic; ViaXvMCContext *pViaXvMC; Status retVal = 0; if ((display == NULL) || subpicture == NULL) { return BadValue; } if (NULL == (pViaSubPic = subpicture->privData)) { return (error_base + XvMCBadSubpicture); } pViaXvMC = pViaSubPic->privContext; ppthread_mutex_lock(&pViaXvMC->ctxMutex); if (pViaSubPic->needsSync) { if (syncXvMCLowLevel(pViaXvMC->xl, LL_MODE_2D, 0, pViaSubPic->timeStamp)) { retVal = BadValue; } pViaSubPic->needsSync = 0; } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return retVal; } _X_EXPORT Status XvMCFlushSubpicture(Display * display, XvMCSubpicture * subpicture) { ViaXvMCSubPicture *pViaSubPic; if ((display == NULL) || subpicture == NULL) { return BadValue; } if (NULL == (pViaSubPic = subpicture->privData)) { return (error_base + XvMCBadSubpicture); } return Success; } _X_EXPORT Status XvMCDestroySubpicture(Display * display, XvMCSubpicture * subpicture) { ViaXvMCSubPicture *pViaSubPic; ViaXvMCContext *pViaXvMC; volatile ViaXvMCSAreaPriv *sAPriv; if ((display == NULL) || subpicture == NULL) { return BadValue; } if (NULL == (pViaSubPic = subpicture->privData)) { return (error_base + XvMCBadSubpicture); } pViaXvMC = pViaSubPic->privContext; ppthread_mutex_lock(&pViaXvMC->ctxMutex); sAPriv = SAREAPTR(pViaXvMC); hwlLock(pViaXvMC->xl, 1); setLowLevelLocking(pViaXvMC->xl, 0); if (sAPriv->XvMCSubPicOn[pViaXvMC->xvMCPort] == (pViaSubPic->srfNo | VIA_XVMC_VALID)) { viaVideoSubPictureOffLocked(pViaXvMC->xl); sAPriv->XvMCSubPicOn[pViaXvMC->xvMCPort] = 0; } flushPCIXvMCLowLevel(pViaXvMC->xl); setLowLevelLocking(pViaXvMC->xl, 1); hwlUnlock(pViaXvMC->xl, 1); XLockDisplay(display); _xvmc_destroy_subpicture(display, subpicture); XUnlockDisplay(display); free(pViaSubPic); subpicture->privData = NULL; ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } _X_EXPORT Status XvMCGetSubpictureStatus(Display * display, XvMCSubpicture * subpic, int *stat) { ViaXvMCSubPicture *pViaSubPic; ViaXvMCContext *pViaXvMC; volatile ViaXvMCSAreaPriv *sAPriv; if ((display == NULL) || subpic == NULL) { return BadValue; } if (NULL == (pViaSubPic = subpic->privData)) { return (error_base + XvMCBadSubpicture); } if (stat) { *stat = 0; pViaXvMC = pViaSubPic->privContext; sAPriv = SAREAPTR(pViaXvMC); if (sAPriv->XvMCSubPicOn[pViaXvMC->xvMCPort] == (pViaSubPic->srfNo | VIA_XVMC_VALID)) *stat |= XVMC_DISPLAYING; } return Success; } _X_EXPORT Status XvMCFlushSurface(Display * display, XvMCSurface * surface) { ViaXvMCSurface *pViaSurface; ViaXvMCContext *pViaXvMC; Status ret; if ((display == NULL) || surface == NULL) { return BadValue; } if (NULL == (pViaSurface = surface->privData)) { return (error_base + XvMCBadSurface); } pViaXvMC = pViaSurface->privContext; ppthread_mutex_lock(&pViaXvMC->ctxMutex); if (pViaSurface->needsSync) pViaSurface->timeStamp = pViaXvMC->timeStamp = viaDMATimeStampLowLevel(pViaXvMC->xl); ret = (flushXvMCLowLevel(pViaXvMC->xl)) ? BadValue : Success; if (pViaXvMC->rendSurf[0] == (pViaSurface->srfNo | VIA_XVMC_VALID)) { hwlLock(pViaXvMC->xl, 0); pViaXvMC->haveDecoder = 0; releaseDecoder(pViaXvMC, 0); hwlUnlock(pViaXvMC->xl, 0); } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return ret; } _X_EXPORT Status XvMCGetSurfaceStatus(Display * display, XvMCSurface * surface, int *stat) { ViaXvMCSurface *pViaSurface; ViaXvMCContext *pViaXvMC; volatile ViaXvMCSAreaPriv *sAPriv; unsigned i; int ret = 0; if ((display == NULL) || surface == NULL) { return BadValue; } if (NULL == (pViaSurface = surface->privData)) { return (error_base + XvMCBadSurface); } if (stat) { *stat = 0; pViaXvMC = pViaSurface->privContext; ppthread_mutex_lock(&pViaXvMC->ctxMutex); sAPriv = SAREAPTR(pViaXvMC); if (sAPriv->XvMCDisplaying[pViaXvMC->xvMCPort] == (pViaSurface->srfNo | VIA_XVMC_VALID)) *stat |= XVMC_DISPLAYING; for (i = 0; i < VIA_MAX_RENDSURF; ++i) { if (pViaXvMC->rendSurf[i] == (pViaSurface->srfNo | VIA_XVMC_VALID)) { *stat |= XVMC_RENDERING; break; } } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); } return ret; } _X_EXPORT XvAttribute * XvMCQueryAttributes(Display * display, XvMCContext * context, int *number) { ViaXvMCContext *pViaXvMC; XvAttribute *ret; unsigned long siz; *number = 0; if ((display == NULL) || (context == NULL)) { return NULL; } if (NULL == (pViaXvMC = context->privData)) { return NULL; } ppthread_mutex_lock(&pViaXvMC->ctxMutex); if (NULL != (ret = (XvAttribute *) malloc(siz = VIA_NUM_XVMC_ATTRIBUTES * sizeof(XvAttribute)))) { memcpy(ret, pViaXvMC->attribDesc, siz); *number = VIA_NUM_XVMC_ATTRIBUTES; } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return ret; } _X_EXPORT Status XvMCSetAttribute(Display * display, XvMCContext * context, Atom attribute, int value) { int found; unsigned i; ViaXvMCContext *pViaXvMC; ViaXvMCCommandBuffer buf; if ((display == NULL) || (context == NULL)) { return (error_base + XvMCBadContext); } if (NULL == (pViaXvMC = context->privData)) { return (error_base + XvMCBadContext); } ppthread_mutex_lock(&pViaXvMC->ctxMutex); found = 0; for (i = 0; i < pViaXvMC->attrib.numAttr; ++i) { if (attribute == pViaXvMC->attrib.attributes[i].attribute) { if ((!(pViaXvMC->attribDesc[i].flags & XvSettable)) || value < pViaXvMC->attribDesc[i].min_value || value > pViaXvMC->attribDesc[i].max_value) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadValue; } pViaXvMC->attrib.attributes[i].value = value; found = 1; pViaXvMC->attribChanged = 1; break; } } if (!found) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return BadMatch; } if (pViaXvMC->haveXv) { buf.command = VIA_XVMC_COMMAND_ATTRIBUTES; pViaXvMC->xvImage->data = (char *)&buf; buf.ctxNo = pViaXvMC->ctxNo | VIA_XVMC_VALID; buf.attrib = pViaXvMC->attrib; XLockDisplay(display); pViaXvMC->attribChanged = XvPutImage(display, pViaXvMC->port, pViaXvMC->draw, pViaXvMC->gc, pViaXvMC->xvImage, 0, 0, 1, 1, 0, 0, 1, 1); XUnlockDisplay(display); } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } _X_EXPORT Status XvMCGetAttribute(Display * display, XvMCContext * context, Atom attribute, int *value) { int found; unsigned i; ViaXvMCContext *pViaXvMC; if ((display == NULL) || (context == NULL)) { return (error_base + XvMCBadContext); } if (NULL == (pViaXvMC = context->privData)) { return (error_base + XvMCBadContext); } ppthread_mutex_lock(&pViaXvMC->ctxMutex); found = 0; for (i = 0; i < pViaXvMC->attrib.numAttr; ++i) { if (attribute == pViaXvMC->attrib.attributes[i].attribute) { if (pViaXvMC->attribDesc[i].flags & XvGettable) { *value = pViaXvMC->attrib.attributes[i].value; found = 1; break; } } } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); if (!found) return BadMatch; return Success; } _X_EXPORT Status XvMCHideSurface(Display * display, XvMCSurface * surface) { ViaXvMCSurface *pViaSurface; ViaXvMCContext *pViaXvMC; ViaXvMCSubPicture *pViaSubPic; volatile ViaXvMCSAreaPriv *sAPriv; ViaXvMCCommandBuffer buf; Status ret; if ((display == NULL) || (surface == NULL)) { return BadValue; } if (NULL == (pViaSurface = surface->privData)) { return (error_base + XvMCBadSurface); } if (NULL == (pViaXvMC = pViaSurface->privContext)) { return (error_base + XvMCBadContext); } ppthread_mutex_lock(&pViaXvMC->ctxMutex); if (!pViaXvMC->haveXv) { ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } sAPriv = SAREAPTR(pViaXvMC); hwlLock(pViaXvMC->xl, 1); if (sAPriv->XvMCDisplaying[pViaXvMC->xvMCPort] != (pViaSurface->srfNo | VIA_XVMC_VALID)) { hwlUnlock(pViaXvMC->xl, 1); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } setLowLevelLocking(pViaXvMC->xl, 0); if (NULL != (pViaSubPic = pViaSurface->privSubPic)) { if (sAPriv->XvMCSubPicOn[pViaXvMC->xvMCPort] == (pViaSubPic->srfNo | VIA_XVMC_VALID)) { sAPriv->XvMCSubPicOn[pViaXvMC->xvMCPort] &= ~VIA_XVMC_VALID; viaVideoSubPictureOffLocked(pViaXvMC->xl); } } flushPCIXvMCLowLevel(pViaXvMC->xl); setLowLevelLocking(pViaXvMC->xl, 1); hwlUnlock(pViaXvMC->xl, 1); buf.command = VIA_XVMC_COMMAND_UNDISPLAY; buf.ctxNo = pViaXvMC->ctxNo | VIA_XVMC_VALID; buf.srfNo = pViaSurface->srfNo | VIA_XVMC_VALID; pViaXvMC->xvImage->data = (char *)&buf; if ((ret = XvPutImage(display, pViaXvMC->port, pViaXvMC->draw, pViaXvMC->gc, pViaXvMC->xvImage, 0, 0, 1, 1, 0, 0, 1, 1))) { fprintf(stderr, "XvMCPutSurface: Hiding overlay failed.\n"); ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return ret; } ppthread_mutex_unlock(&pViaXvMC->ctxMutex); return Success; } xf86-video-openchrome-0.6.0/src/xvmc/Makefile.in0000664000175000017500000007253213057513447016327 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@ 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 = src/xvmc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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__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)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libchromeXvMC_la_DEPENDENCIES = am__libchromeXvMC_la_SOURCES_DIST = viaLowLevel.c driDrawable.c \ viaXvMC.c xf86dri.c viaLowLevel.h driDrawable.h viaXvMCPriv.h \ xf86dri.h xf86dristr.h vldXvMC.h @XVMC_TRUE@am_libchromeXvMC_la_OBJECTS = \ @XVMC_TRUE@ libchromeXvMC_la-viaLowLevel.lo \ @XVMC_TRUE@ libchromeXvMC_la-driDrawable.lo \ @XVMC_TRUE@ libchromeXvMC_la-viaXvMC.lo \ @XVMC_TRUE@ libchromeXvMC_la-xf86dri.lo libchromeXvMC_la_OBJECTS = $(am_libchromeXvMC_la_OBJECTS) libchromeXvMC_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libchromeXvMC_la_CFLAGS) \ $(CFLAGS) $(libchromeXvMC_la_LDFLAGS) $(LDFLAGS) -o $@ @XVMC_TRUE@am_libchromeXvMC_la_rpath = -rpath $(libdir) libchromeXvMCPro_la_DEPENDENCIES = am__libchromeXvMCPro_la_SOURCES_DIST = viaLowLevelPro.c driDrawable.c \ viaXvMC.c xf86dri.c viaLowLevel.h driDrawable.h viaXvMCPriv.h \ xf86dri.h xf86dristr.h vldXvMC.h @XVMC_TRUE@am_libchromeXvMCPro_la_OBJECTS = \ @XVMC_TRUE@ libchromeXvMCPro_la-viaLowLevelPro.lo \ @XVMC_TRUE@ libchromeXvMCPro_la-driDrawable.lo \ @XVMC_TRUE@ libchromeXvMCPro_la-viaXvMC.lo \ @XVMC_TRUE@ libchromeXvMCPro_la-xf86dri.lo libchromeXvMCPro_la_OBJECTS = $(am_libchromeXvMCPro_la_OBJECTS) libchromeXvMCPro_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libchromeXvMCPro_la_CFLAGS) $(CFLAGS) \ $(libchromeXvMCPro_la_LDFLAGS) $(LDFLAGS) -o $@ @XVMC_TRUE@am_libchromeXvMCPro_la_rpath = -rpath $(libdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libchromeXvMC_la_SOURCES) $(libchromeXvMCPro_la_SOURCES) DIST_SOURCES = $(am__libchromeXvMC_la_SOURCES_DIST) \ $(am__libchromeXvMCPro_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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_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@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ 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@ 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@ XVMC_CFLAGS = @XVMC_CFLAGS@ XVMC_LIBS = @XVMC_LIBS@ 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@ @XVMC_TRUE@lib_LTLIBRARIES = libchromeXvMC.la libchromeXvMCPro.la @XVMC_TRUE@libchromeXvMC_la_SOURCES = \ @XVMC_TRUE@ viaLowLevel.c \ @XVMC_TRUE@ driDrawable.c \ @XVMC_TRUE@ viaXvMC.c \ @XVMC_TRUE@ xf86dri.c \ @XVMC_TRUE@ viaLowLevel.h \ @XVMC_TRUE@ driDrawable.h \ @XVMC_TRUE@ viaXvMCPriv.h \ @XVMC_TRUE@ xf86dri.h \ @XVMC_TRUE@ xf86dristr.h \ @XVMC_TRUE@ vldXvMC.h @XVMC_TRUE@libchromeXvMCPro_la_SOURCES = \ @XVMC_TRUE@ viaLowLevelPro.c \ @XVMC_TRUE@ driDrawable.c \ @XVMC_TRUE@ viaXvMC.c \ @XVMC_TRUE@ xf86dri.c \ @XVMC_TRUE@ viaLowLevel.h \ @XVMC_TRUE@ driDrawable.h \ @XVMC_TRUE@ viaXvMCPriv.h \ @XVMC_TRUE@ xf86dri.h \ @XVMC_TRUE@ xf86dristr.h \ @XVMC_TRUE@ vldXvMC.h @XVMC_TRUE@libchromeXvMC_la_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ @XVMC_CFLAGS@ -I$(top_srcdir)/src -I$(top_srcdir)/src/xvmc -DTRUE=1 -DFALSE=0 @XVMC_TRUE@libchromeXvMC_la_LDFLAGS = -version-number 1:0:0 @XVMC_TRUE@libchromeXvMC_la_LIBADD = @DRI_LIBS@ @XVMC_LIBS@ @XVMC_TRUE@libchromeXvMCPro_la_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ @XVMC_CFLAGS@ -I$(top_srcdir)/src -I$(top_srcdir)/src/xvmc -DTRUE=1 -DFALSE=0 @XVMC_TRUE@libchromeXvMCPro_la_LDFLAGS = -version-number 1:0:0 @XVMC_TRUE@libchromeXvMCPro_la_LIBADD = @DRI_LIBS@ @XVMC_LIBS@ @XVMC_FALSE@EXTRA_DIST = \ @XVMC_FALSE@ driDrawable.c \ @XVMC_FALSE@ driDrawable.h \ @XVMC_FALSE@ viaLowLevelPro.c \ @XVMC_FALSE@ viaLowLevel.c \ @XVMC_FALSE@ viaLowLevel.h \ @XVMC_FALSE@ viaXvMC.c \ @XVMC_FALSE@ viaXvMCPriv.h \ @XVMC_FALSE@ xf86dri.c \ @XVMC_FALSE@ xf86dri.h \ @XVMC_FALSE@ xf86dristr.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(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 src/xvmc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/xvmc/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): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libchromeXvMC.la: $(libchromeXvMC_la_OBJECTS) $(libchromeXvMC_la_DEPENDENCIES) $(EXTRA_libchromeXvMC_la_DEPENDENCIES) $(libchromeXvMC_la_LINK) $(am_libchromeXvMC_la_rpath) $(libchromeXvMC_la_OBJECTS) $(libchromeXvMC_la_LIBADD) $(LIBS) libchromeXvMCPro.la: $(libchromeXvMCPro_la_OBJECTS) $(libchromeXvMCPro_la_DEPENDENCIES) $(EXTRA_libchromeXvMCPro_la_DEPENDENCIES) $(libchromeXvMCPro_la_LINK) $(am_libchromeXvMCPro_la_rpath) $(libchromeXvMCPro_la_OBJECTS) $(libchromeXvMCPro_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchromeXvMCPro_la-driDrawable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchromeXvMCPro_la-viaLowLevelPro.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchromeXvMCPro_la-viaXvMC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchromeXvMCPro_la-xf86dri.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchromeXvMC_la-driDrawable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchromeXvMC_la-viaLowLevel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchromeXvMC_la-viaXvMC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchromeXvMC_la-xf86dri.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libchromeXvMC_la-viaLowLevel.lo: viaLowLevel.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMC_la_CFLAGS) $(CFLAGS) -MT libchromeXvMC_la-viaLowLevel.lo -MD -MP -MF $(DEPDIR)/libchromeXvMC_la-viaLowLevel.Tpo -c -o libchromeXvMC_la-viaLowLevel.lo `test -f 'viaLowLevel.c' || echo '$(srcdir)/'`viaLowLevel.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libchromeXvMC_la-viaLowLevel.Tpo $(DEPDIR)/libchromeXvMC_la-viaLowLevel.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='viaLowLevel.c' object='libchromeXvMC_la-viaLowLevel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMC_la_CFLAGS) $(CFLAGS) -c -o libchromeXvMC_la-viaLowLevel.lo `test -f 'viaLowLevel.c' || echo '$(srcdir)/'`viaLowLevel.c libchromeXvMC_la-driDrawable.lo: driDrawable.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMC_la_CFLAGS) $(CFLAGS) -MT libchromeXvMC_la-driDrawable.lo -MD -MP -MF $(DEPDIR)/libchromeXvMC_la-driDrawable.Tpo -c -o libchromeXvMC_la-driDrawable.lo `test -f 'driDrawable.c' || echo '$(srcdir)/'`driDrawable.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libchromeXvMC_la-driDrawable.Tpo $(DEPDIR)/libchromeXvMC_la-driDrawable.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='driDrawable.c' object='libchromeXvMC_la-driDrawable.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMC_la_CFLAGS) $(CFLAGS) -c -o libchromeXvMC_la-driDrawable.lo `test -f 'driDrawable.c' || echo '$(srcdir)/'`driDrawable.c libchromeXvMC_la-viaXvMC.lo: viaXvMC.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMC_la_CFLAGS) $(CFLAGS) -MT libchromeXvMC_la-viaXvMC.lo -MD -MP -MF $(DEPDIR)/libchromeXvMC_la-viaXvMC.Tpo -c -o libchromeXvMC_la-viaXvMC.lo `test -f 'viaXvMC.c' || echo '$(srcdir)/'`viaXvMC.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libchromeXvMC_la-viaXvMC.Tpo $(DEPDIR)/libchromeXvMC_la-viaXvMC.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='viaXvMC.c' object='libchromeXvMC_la-viaXvMC.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMC_la_CFLAGS) $(CFLAGS) -c -o libchromeXvMC_la-viaXvMC.lo `test -f 'viaXvMC.c' || echo '$(srcdir)/'`viaXvMC.c libchromeXvMC_la-xf86dri.lo: xf86dri.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMC_la_CFLAGS) $(CFLAGS) -MT libchromeXvMC_la-xf86dri.lo -MD -MP -MF $(DEPDIR)/libchromeXvMC_la-xf86dri.Tpo -c -o libchromeXvMC_la-xf86dri.lo `test -f 'xf86dri.c' || echo '$(srcdir)/'`xf86dri.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libchromeXvMC_la-xf86dri.Tpo $(DEPDIR)/libchromeXvMC_la-xf86dri.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xf86dri.c' object='libchromeXvMC_la-xf86dri.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMC_la_CFLAGS) $(CFLAGS) -c -o libchromeXvMC_la-xf86dri.lo `test -f 'xf86dri.c' || echo '$(srcdir)/'`xf86dri.c libchromeXvMCPro_la-viaLowLevelPro.lo: viaLowLevelPro.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMCPro_la_CFLAGS) $(CFLAGS) -MT libchromeXvMCPro_la-viaLowLevelPro.lo -MD -MP -MF $(DEPDIR)/libchromeXvMCPro_la-viaLowLevelPro.Tpo -c -o libchromeXvMCPro_la-viaLowLevelPro.lo `test -f 'viaLowLevelPro.c' || echo '$(srcdir)/'`viaLowLevelPro.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libchromeXvMCPro_la-viaLowLevelPro.Tpo $(DEPDIR)/libchromeXvMCPro_la-viaLowLevelPro.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='viaLowLevelPro.c' object='libchromeXvMCPro_la-viaLowLevelPro.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMCPro_la_CFLAGS) $(CFLAGS) -c -o libchromeXvMCPro_la-viaLowLevelPro.lo `test -f 'viaLowLevelPro.c' || echo '$(srcdir)/'`viaLowLevelPro.c libchromeXvMCPro_la-driDrawable.lo: driDrawable.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMCPro_la_CFLAGS) $(CFLAGS) -MT libchromeXvMCPro_la-driDrawable.lo -MD -MP -MF $(DEPDIR)/libchromeXvMCPro_la-driDrawable.Tpo -c -o libchromeXvMCPro_la-driDrawable.lo `test -f 'driDrawable.c' || echo '$(srcdir)/'`driDrawable.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libchromeXvMCPro_la-driDrawable.Tpo $(DEPDIR)/libchromeXvMCPro_la-driDrawable.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='driDrawable.c' object='libchromeXvMCPro_la-driDrawable.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMCPro_la_CFLAGS) $(CFLAGS) -c -o libchromeXvMCPro_la-driDrawable.lo `test -f 'driDrawable.c' || echo '$(srcdir)/'`driDrawable.c libchromeXvMCPro_la-viaXvMC.lo: viaXvMC.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMCPro_la_CFLAGS) $(CFLAGS) -MT libchromeXvMCPro_la-viaXvMC.lo -MD -MP -MF $(DEPDIR)/libchromeXvMCPro_la-viaXvMC.Tpo -c -o libchromeXvMCPro_la-viaXvMC.lo `test -f 'viaXvMC.c' || echo '$(srcdir)/'`viaXvMC.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libchromeXvMCPro_la-viaXvMC.Tpo $(DEPDIR)/libchromeXvMCPro_la-viaXvMC.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='viaXvMC.c' object='libchromeXvMCPro_la-viaXvMC.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMCPro_la_CFLAGS) $(CFLAGS) -c -o libchromeXvMCPro_la-viaXvMC.lo `test -f 'viaXvMC.c' || echo '$(srcdir)/'`viaXvMC.c libchromeXvMCPro_la-xf86dri.lo: xf86dri.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMCPro_la_CFLAGS) $(CFLAGS) -MT libchromeXvMCPro_la-xf86dri.lo -MD -MP -MF $(DEPDIR)/libchromeXvMCPro_la-xf86dri.Tpo -c -o libchromeXvMCPro_la-xf86dri.lo `test -f 'xf86dri.c' || echo '$(srcdir)/'`xf86dri.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libchromeXvMCPro_la-xf86dri.Tpo $(DEPDIR)/libchromeXvMCPro_la-xf86dri.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xf86dri.c' object='libchromeXvMCPro_la-xf86dri.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchromeXvMCPro_la_CFLAGS) $(CFLAGS) -c -o libchromeXvMCPro_la-xf86dri.lo `test -f 'xf86dri.c' || echo '$(srcdir)/'`xf86dri.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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: 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-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES 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-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # 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-openchrome-0.6.0/src/xvmc/Makefile.am0000664000175000017500000000207112760724526016307 00000000000000if XVMC lib_LTLIBRARIES=libchromeXvMC.la libchromeXvMCPro.la libchromeXvMC_la_SOURCES = \ viaLowLevel.c \ driDrawable.c \ viaXvMC.c \ xf86dri.c \ viaLowLevel.h \ driDrawable.h \ viaXvMCPriv.h \ xf86dri.h \ xf86dristr.h \ vldXvMC.h libchromeXvMCPro_la_SOURCES = \ viaLowLevelPro.c \ driDrawable.c \ viaXvMC.c \ xf86dri.c \ viaLowLevel.h \ driDrawable.h \ viaXvMCPriv.h \ xf86dri.h \ xf86dristr.h \ vldXvMC.h libchromeXvMC_la_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ @XVMC_CFLAGS@ -I$(top_srcdir)/src -I$(top_srcdir)/src/xvmc -DTRUE=1 -DFALSE=0 libchromeXvMC_la_LDFLAGS = -version-number 1:0:0 libchromeXvMC_la_LIBADD = @DRI_LIBS@ @XVMC_LIBS@ libchromeXvMCPro_la_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ @XVMC_CFLAGS@ -I$(top_srcdir)/src -I$(top_srcdir)/src/xvmc -DTRUE=1 -DFALSE=0 libchromeXvMCPro_la_LDFLAGS = -version-number 1:0:0 libchromeXvMCPro_la_LIBADD = @DRI_LIBS@ @XVMC_LIBS@ else EXTRA_DIST = \ driDrawable.c \ driDrawable.h \ viaLowLevelPro.c \ viaLowLevel.c \ viaLowLevel.h \ viaXvMC.c \ viaXvMCPriv.h \ xf86dri.c \ xf86dri.h \ xf86dristr.h endif xf86-video-openchrome-0.6.0/src/xvmc/driDrawable.c0000664000175000017500000001146112760724526016642 00000000000000/***************************************************************************** * driDrawable.c: Lean Version of DRI utilities. * * Copyright (c) 2005 Thomas Hellstrom. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHOR(S) OR COPYRIGHT HOLDER(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. */ #include #include #include "xf86drm.h" #include "drm.h" #include "xf86dri.h" #include "drm_sarea.h" #include "driDrawable.h" static unsigned drawStamp(volatile drm_sarea_t * pSarea, int index) { return pSarea->drawableTable[index].stamp; } int getDRIDrawableInfoLocked(void *drawHash, Display * display, int screen, Drawable draw, unsigned lockFlags, int drmFD, drm_context_t drmContext, drmAddress sarea, Bool updateInfo, drawableInfo ** info, unsigned long infoSize) { drawableInfo *drawInfo; void *res; drm_drawable_t drmDraw = 0; volatile drm_sarea_t *pSarea = (drm_sarea_t *) sarea; drm_clip_rect_t *clipFront, *clipBack; int ret; if (drmHashLookup(drawHash, (unsigned long)draw, &res)) { /* * The drawable is unknown to us. Create it and put it in the * hash table. */ DRM_UNLOCK(drmFD, &pSarea->lock, drmContext); if (!uniDRICreateDrawable(display, screen, draw, &drmDraw)) { DRM_LOCK(drmFD, &pSarea->lock, drmContext, lockFlags); return 1; } DRM_LOCK(drmFD, &pSarea->lock, drmContext, lockFlags); drawInfo = (drawableInfo *) malloc(infoSize); if (!drawInfo) return 1; drawInfo->drmDraw = drmDraw; drawInfo->stamp = 0; drawInfo->clipFront = 0; drawInfo->clipBack = 0; drmHashInsert(drawHash, (unsigned long)draw, drawInfo); } else { drawInfo = res; } drawInfo->touched = FALSE; while (!drawInfo->clipFront || drawInfo->stamp != drawStamp(pSarea, drawInfo->index)) { /* * The drawable has been touched since we last got info about it. * obtain new info from the X server. */ drawInfo->touched = TRUE; if (updateInfo || !drawInfo->clipFront) { DRM_UNLOCK(drmFD, &pSarea->lock, drmContext); ret = uniDRIGetDrawableInfo(display, screen, draw, &drawInfo->index, &drawInfo->stamp, &drawInfo->x, &drawInfo->y, &drawInfo->w, &drawInfo->h, &drawInfo->numClipFront, &clipFront, &drawInfo->backX, &drawInfo->backY, &drawInfo->numClipBack, &clipBack); DRM_LIGHT_LOCK(drmFD, &pSarea->lock, drmContext); /* * Error. Probably the drawable is destroyed. Return error and old values. */ if (!ret) { free(drawInfo); drawInfo = NULL; drmHashDelete(drawHash, (unsigned long)draw); DRM_UNLOCK(drmFD, &pSarea->lock, drmContext); uniDRIDestroyDrawable(display, screen, draw); DRM_LOCK(drmFD, &pSarea->lock, drmContext, lockFlags); return 1; } if (drawInfo->stamp != drawStamp(pSarea, drawInfo->index)) { /* * The info is already outdated. Sigh. Have another go. */ XFree(clipFront); XFree(clipBack); continue; } if (drawInfo->clipFront) XFree(drawInfo->clipFront); drawInfo->clipFront = clipFront; if (drawInfo->clipBack) XFree(drawInfo->clipBack); drawInfo->clipBack = clipBack; } else { if (!drawInfo->clipFront) drawInfo->clipFront = (drm_clip_rect_t *) ~ 0UL; drawInfo->stamp = drawStamp(pSarea, drawInfo->index); } } *info = drawInfo; return 0; } void driDestroyHashContents(void *drawHash) { unsigned long key; void *content; drawableInfo *drawInfo; if (drmHashFirst(drawHash, &key, &content) < 1) return; drawInfo = (drawableInfo *) content; if (drawInfo->clipBack) XFree(drawInfo->clipBack); if (drawInfo->clipFront) XFree(drawInfo->clipFront); free(drawInfo); while (drmHashNext(drawHash, &key, &content) == 1) { drawInfo = (drawableInfo *) content; if (drawInfo->clipBack) XFree(drawInfo->clipBack); if (drawInfo->clipFront) XFree(drawInfo->clipFront); free(drawInfo); } return; } xf86-video-openchrome-0.6.0/src/xvmc/vldXvMC.h0000664000175000017500000001310512760724526015747 00000000000000/***************************************************************************** * VLD Nonstandard XvMC extension. * * Copyright (c) 2004 The Unichrome Project. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHOR(S) OR COPYRIGHT HOLDER(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. * * Author: Thomas Hellström, 2004. */ #ifndef _VLDXVMC_H #define _VLDXVMC_H #include #include #include /* * New "Motion compensation type". */ #define XVMC_VLD 0x0020000 /* * Below Flags to be passed in the XvMCMpegControl structure 'flag' field. */ #define XVMC_PROGRESSIVE_SEQUENCE 0x00000010 /* * Zig-Zag Scan / Alternative Scan. */ #define XVMC_ZIG_ZAG_SCAN 0x00000000 #define XVMC_ALTERNATE_SCAN 0x00000100 /* * Frame DCT and frame prediction are used. / * Field prediction */ #define XVMC_PRED_DCT_FRAME 0x00000040 #define XVMC_PRED_DCT_FIELD 0x00000000 /* * Top / Bottom field first */ #define XVMC_TOP_FIELD_FIRST 0x00000080 #define XVMC_BOTTOM_FIELD_FIRST 0x00000000 /* * Motion vectors coded in intra macroblocks */ #define XVMC_CONCEALMENT_MOTION_VECTORS 0x00000200 /* * Which of two mappings between quantiser_scale_code * and quantiser_scale shall apply. */ #define XVMC_Q_SCALE_TYPE 0x00000400 /* * Intra VLC Format: Bit = 0, Bit = 1 * Intra blocks B-14 B-15 * Non-intra blocks B-14 B-14 */ #define XVMC_INTRA_VLC_FORMAT 0x00000800 /* * Also XVMC_SECOND_FIELD should be set in flags if active. */ #define XVMC_I_PICTURE 1 #define XVMC_P_PICTURE 2 #define XVMC_B_PICTURE 3 typedef struct _XvMCMpegControl { unsigned BVMV_range, /* Backward vertical motion vector range */ BHMV_range, /* Backward horizontal motion vector range */ FVMV_range, /* Forward vertical motion vector range */ FHMV_range, /* Forward horizontal motion vector range */ picture_structure, /* XVMC_TOP_FIELD, XVMC_BOTTOM_FIELD, * XVMC_FRAME_PICTURE */ intra_dc_precision, /* 0x00 - 0x03 corresponds to 8 to 11 bits prec. */ picture_coding_type, /* XVMC_X_PICTURE */ mpeg_coding, /* XVMC_MPEG_2 */ flags; /* See above */ } XvMCMpegControl; /* * The following function is called BEFORE starting sending slices to the * lib. It grabs the decoder hardware and prepares it for coming slices. * The function XvMCSyncSurface will release the hardware for other contexts * in addition to it's current functionality. */ extern Status XvMCBeginSurface(Display * display, XvMCContext * context, XvMCSurface * target_surface, XvMCSurface * past_surface, XvMCSurface * future_surface, const XvMCMpegControl * control); /* * The quantizer matrix structure. This should be filled in by the user and * uploaded whenever a change is needed. The lib initializes with * default matrices and will automatically load the hardware with new matrices * on decoder context switches. To load data, set the corresponding load flag * to true and fill in the values. The VIA MPEG2 engine only uses the * intra_quantiser_matrix and the non_intra_quantiser_matrix. RFC: Are * the other fields needed for future compatibility? */ typedef struct _XvMCQMatrix { int load_intra_quantiser_matrix; int load_non_intra_quantiser_matrix; int load_chroma_intra_quantiser_matrix; int load_chroma_non_intra_quantiser_matrix; unsigned char intra_quantiser_matrix[64]; unsigned char non_intra_quantiser_matrix[64]; unsigned char chroma_intra_quantiser_matrix[64]; unsigned char chroma_non_intra_quantiser_matrix[64]; } XvMCQMatrix; /* * Upload a XvMCQMatrix structure to the clientlib. * The hardware will start using it the next XvMCBeginSurface. */ extern Status XvMCLoadQMatrix(Display * display, XvMCContext * context, const XvMCQMatrix * qmx); /* * Put a slice to the decoder. The hardware will start processing it * immediately. */ extern Status XvMCPutSlice(Display * display, XvMCContext * context, char *slice, int nBytes); /* * Put a slice without the slice start code to the decoder. * The hardware will start processing it * immediately. This function is for client optimization. * XvMCPutSlice(display,context,slice,nBytes) is equivalent to * XvMCPutSlice2(display,context,slice+4,nBytes-4,slice[3]); */ extern Status XvMCPutSlice2(Display * display, XvMCContext * context, char *slice, int nBytes, int sliceCode); /* * Debug the XvMCControl structure. For convenience only. */ extern void debugControl(const XvMCMpegControl * control); #endif xf86-video-openchrome-0.6.0/src/xvmc/viaLowLevel.h0000664000175000017500000001153112760724526016656 00000000000000/***************************************************************************** * VIA Unichrome XvMC extension client lib. * * Copyright (c) 2004 The Unichrome Project. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHOR(S) OR COPYRIGHT HOLDER(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. */ /* * Authors: Thomas Hellström 2004 - 2005. */ #ifndef VIA_LOWLEVEL_H #define VIA_LOWLEVEL_H /* * The below define is cache size sensitive. Increasing the AGP buffer size * will enable the library to do deeper pipelining, but will degrade the * performance in the drm dma command verifier. */ #define LL_AGP_CMDBUF_SIZE (4096*2) #define LL_PCI_CMDBUF_SIZE (4096) #define LL_MODE_DECODER_SLICE 0x01 #define LL_MODE_DECODER_IDLE 0x02 #define LL_MODE_VIDEO 0x04 #define LL_MODE_2D 0x08 #define LL_MODE_3D 0x10 /* * Errors */ #define LL_DECODER_TIMEDOUT 0x00000001 #define LL_IDCT_FIFO_ERROR 0x00000002 #define LL_SLICE_FIFO_ERROR 0x00000004 #define LL_SLICE_FAULT 0x00000008 #define LL_DMA_TIMEDOUT 0x00000010 #define LL_VIDEO_TIMEDOUT 0x00000020 #define LL_ACCEL_TIMEDOUT 0x00000040 #define LL_PCI_COMMAND_ERR 0x00000080 #define LL_AGP_COMMAND_ERR 0x00000100 #define VIA_SLICEBUSYMASK 0x00000200 #define VIA_BUSYMASK 0x00000207 #define VIA_SLICEIDLEVAL 0x00000200 #define VIA_IDLEVAL 0x00000204 #include "via_drm.h" #include "viaXvMCPriv.h" #define setRegion(xx,yy,ww,hh,region) \ do { \ (region).x = (xx); \ (region).y = (yy); \ (region).w = (ww); \ (region).h = (hh); \ } while(0) #define regionEqual(r1, r2) \ ((r1).x == (r2).x && \ (r1).y == (r2).y && \ (r1).w == (r2).w && \ (r1).h == (r2).h) extern void *initXvMCLowLevel(int fd, drm_context_t * ctx, drmLockPtr hwLock, drmAddress mmioAddress, drmAddress fbAddress, unsigned fbStride, unsigned fbDepth, unsigned width, unsigned height, int useAgp, unsigned chipId); extern void setLowLevelLocking(void *xlp, int perFormLocking); extern void closeXvMCLowLevel(void *xlp); extern void flushPCIXvMCLowLevel(void *xlp); extern CARD32 viaDMATimeStampLowLevel(void *xlp); extern void setAGPSyncLowLevel(void *xlp, int val, CARD32 timeStamp); /* * These two functions also return and clear the current error status. */ extern unsigned flushXvMCLowLevel(void *xlp); extern unsigned syncXvMCLowLevel(void *xlp, unsigned int mode, unsigned int doSleep, CARD32 timeStamp); extern void hwlUnlock(void *xlp, int videoLock); extern void hwlLock(void *xlp, int videoLock); extern void viaVideoSetSWFLipLocked(void *xlp, unsigned yOffs, unsigned uOffs, unsigned vOffs, unsigned yStride, unsigned uvStride); extern void viaMpegReset(void *xlp); extern void viaMpegWriteSlice(void *xlp, CARD8 * slice, int nBytes, CARD32 sCode); extern void viaMpegSetSurfaceStride(void *xlp, ViaXvMCContext * ctx); extern void viaMpegSetFB(void *xlp, unsigned i, unsigned yOffs, unsigned uOffs, unsigned vOffs); extern void viaMpegBeginPicture(void *xlp, ViaXvMCContext * ctx, unsigned width, unsigned height, const XvMCMpegControl * control); /* * Low-level Video functions in viaLowLevel.c */ extern void viaBlit(void *xlp, unsigned bpp, unsigned srcBase, unsigned srcPitch, unsigned dstBase, unsigned dstPitch, unsigned w, unsigned h, int xdir, int ydir, unsigned blitMode, unsigned color); extern void viaVideoSWFlipLocked(void *xlp, unsigned flags, int progressiveSequence); extern void viaVideoSubPictureLocked(void *xlp, ViaXvMCSubPicture * pViaSubPic); extern void viaVideoSubPictureOffLocked(void *xlp); #define PCI_CHIP_VT3204 0x3108 /* K8M800 */ #define PCI_CHIP_VT3259 0x3118 /* PM800/PM880/CN400 */ #define PCI_CHIP_CLE3122 0x3122 /* CLE266 */ #define PCI_CHIP_VT3205 0x7205 /* KM400 */ #define PCI_CHIP_VT3327 0x3343 /* P4M890 */ #define PCI_CHIP_VT3364 0x3371 /* P4M900 */ #endif xf86-video-openchrome-0.6.0/src/xvmc/viaLowLevel.c0000664000175000017500000006645312760724526016666 00000000000000/***************************************************************************** * VIA Unichrome XvMC extension client lib. * * Copyright (c) 2004 Thomas Hellström. All rights reserved. * Copyright (c) 2003 Andreas Robinson. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHOR(S) OR COPYRIGHT HOLDER(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. */ /* * Low-level functions that deal directly with the hardware. In the future, * these functions might be implemented in a kernel module. Also, some of them * would benefit from DMA. * * Authors: Andreas Robinson 2003. Thomas Hellström 2004. */ #include "viaXvMCPriv.h" #include "viaLowLevel.h" #include #include #include typedef struct { CARD32 agp_buffer[LL_AGP_CMDBUF_SIZE]; CARD32 pci_buffer[LL_PCI_CMDBUF_SIZE]; unsigned agp_pos; unsigned pci_pos; unsigned flip_pos; int use_agp; int agp_mode; int agp_header_start; int agp_index; int fd; drm_context_t *drmcontext; drmLockPtr hwLock; drmAddress mmioAddress; drmAddress fbAddress; unsigned fbStride; unsigned fbDepth; unsigned width; unsigned height; unsigned curWaitFlags; int performLocking; unsigned errors; drm_via_mem_t tsMem; CARD32 tsOffset; volatile CARD32 *tsP; CARD32 curTimeStamp; CARD32 lastReadTimeStamp; int agpSync; CARD32 agpSyncTimeStamp; unsigned chipId; } XvMCLowLevel; /* * For Other architectures than i386 these might have to be modified for * bigendian etc. */ #define MPEGIN(xl,reg) \ *((volatile CARD32 *)(((CARD8 *)(xl)->mmioAddress) + 0xc00 + (reg))) #define VIDIN(ctx,reg) \ *((volatile CARD32 *)(((CARD8 *)(ctx)->mmioAddress) + (reg))) #define REGIN(ctx,reg) \ *((volatile CARD32 *)(((CARD8 *)(ctx)->mmioAddress) + 0x0000 + (reg))) #define HQV_CONTROL 0x3D0 #define HQV_SRC_STARTADDR_Y 0x3D4 #define HQV_SRC_STARTADDR_U 0x3D8 #define HQV_SRC_STARTADDR_V 0x3DC #define HQV_MINIFY_DEBLOCK 0x3E8 #define HQV_SW_FLIP 0x00000010 #define HQV_FLIP_STATUS 0x00000001 #define HQV_SUBPIC_FLIP 0x00008000 #define HQV_FLIP_ODD 0x00000020 #define HQV_DEINTERLACE 0x00010000 #define HQV_FIELD_2_FRAME 0x00020000 #define HQV_FRAME_2_FIELD 0x00040000 #define HQV_FIELD_UV 0x00100000 #define HQV_DEBLOCK_HOR 0x00008000 #define HQV_DEBLOCK_VER 0x80000000 #define V_COMPOSE_MODE 0x298 #define V1_COMMAND_FIRE 0x80000000 #define V3_COMMAND_FIRE 0x40000000 /* SUBPICTURE Registers */ #define SUBP_CONTROL_STRIDE 0x3C0 #define SUBP_STARTADDR 0x3C4 #define RAM_TABLE_CONTROL 0x3C8 #define RAM_TABLE_READ 0x3CC /* SUBP_CONTROL_STRIDE 0x3c0 */ #define SUBP_HQV_ENABLE 0x00010000 #define SUBP_IA44 0x00020000 #define SUBP_AI44 0x00000000 #define SUBP_STRIDE_MASK 0x00001fff #define SUBP_CONTROL_MASK 0x00070000 /* RAM_TABLE_CONTROL 0x3c8 */ #define RAM_TABLE_RGB_ENABLE 0x00000007 #define VIA_REG_STATUS 0x400 #define VIA_REG_GEMODE 0x004 #define VIA_REG_SRCBASE 0x030 #define VIA_REG_DSTBASE 0x034 #define VIA_REG_PITCH 0x038 #define VIA_REG_SRCCOLORKEY 0x01C #define VIA_REG_KEYCONTROL 0x02C #define VIA_REG_SRCPOS 0x008 #define VIA_REG_DSTPOS 0x00C #define VIA_REG_GECMD 0x000 #define VIA_REG_DIMENSION 0x010 /* width and height */ #define VIA_REG_FGCOLOR 0x018 #define VIA_VR_QUEUE_BUSY 0x00020000 /* Virtual Queue is busy */ #define VIA_CMD_RGTR_BUSY 0x00000080 /* Command Regulator is busy */ #define VIA_2D_ENG_BUSY 0x00000002 /* 2D Engine is busy */ #define VIA_3D_ENG_BUSY 0x00000001 /* 3D Engine is busy */ #define VIA_GEM_8bpp 0x00000000 #define VIA_GEM_16bpp 0x00000100 #define VIA_GEM_32bpp 0x00000300 #define VIA_GEC_BLT 0x00000001 #define VIA_PITCH_ENABLE 0x80000000 #define VIA_GEC_INCX 0x00000000 #define VIA_GEC_DECY 0x00004000 #define VIA_GEC_INCY 0x00000000 #define VIA_GEC_DECX 0x00008000 #define VIA_GEC_FIXCOLOR_PAT 0x00002000 #define VIA_BLIT_CLEAR 0x00 #define VIA_BLIT_COPY 0xCC #define VIA_BLIT_FILL 0xF0 #define VIA_BLIT_SET 0xFF #define VIA_SYNCWAITTIMEOUT 50000 /* Might be a bit conservative */ #define VIA_DMAWAITTIMEOUT 150000 #define VIA_VIDWAITTIMEOUT 50000 #define VIA_XVMC_DECODERTIMEOUT 50000 /*(microseconds) */ #define H1_ADDR(val) (((val) >> 2) | 0xF0000000) #define WAITFLAGS(xl, flags) \ (xl)->curWaitFlags |= (flags) #define BEGIN_RING_AGP(xl,size) \ do { \ if ((xl)->agp_pos > (LL_AGP_CMDBUF_SIZE-(size))) { \ agpFlush(xl); \ } \ } while(0) #define OUT_RING_AGP(xl, val) \ (xl)->agp_buffer[(xl)->agp_pos++] = (val) #define OUT_RING_QW_AGP(xl, val1, val2) \ do { \ (xl)->agp_buffer[(xl)->agp_pos++] = (val1); \ (xl)->agp_buffer[(xl)->agp_pos++] = (val2); \ } while (0) #define LL_HW_LOCK(xl) \ do { \ DRM_LOCK((xl)->fd,(xl)->hwLock,*(xl)->drmcontext,0); \ } while(0); #define LL_HW_UNLOCK(xl) \ do { \ DRM_UNLOCK((xl)->fd,(xl)->hwLock,*(xl)->drmcontext); \ } while(0); /* * We want to have two concurrent types of thread taking the hardware * lock simulataneously. One is the video out thread that needs immediate * access to flip an image. The other is everything else which may have * the lock for quite some time. This is only so the video out thread can * sneak in and display an image while other resources are busy. */ void hwlLock(void *xlp, int videoLock) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; LL_HW_LOCK(xl); } void hwlUnlock(void *xlp, int videoLock) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; LL_HW_UNLOCK(xl); } static unsigned timeDiff(struct timeval *now, struct timeval *then) { return (now->tv_usec >= then->tv_usec) ? now->tv_usec - then->tv_usec : 1000000 - (then->tv_usec - now->tv_usec); } void setAGPSyncLowLevel(void *xlp, int val, CARD32 timeStamp) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; xl->agpSync = val; xl->agpSyncTimeStamp = timeStamp; } CARD32 viaDMATimeStampLowLevel(void *xlp) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; if (xl->use_agp) { viaBlit(xl, 32, xl->tsOffset, 1, xl->tsOffset, 1, 1, 1, 0, 0, VIABLIT_FILL, xl->curTimeStamp); return xl->curTimeStamp++; } return 0; } static void viaDMAWaitTimeStamp(XvMCLowLevel * xl, CARD32 timeStamp, int doSleep) { struct timeval now, then; struct timezone here; struct timespec sleep, rem; if (xl->use_agp && (timeStamp > xl->lastReadTimeStamp)) { sleep.tv_nsec = 1; sleep.tv_sec = 0; here.tz_minuteswest = 0; here.tz_dsttime = 0; gettimeofday(&then, &here); while (timeStamp > (xl->lastReadTimeStamp = *xl->tsP)) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_DMAWAITTIMEOUT) { if ((timeStamp > (xl->lastReadTimeStamp = *xl->tsP))) { xl->errors |= LL_DMA_TIMEDOUT; break; } } if (doSleep) nanosleep(&sleep, &rem); } } } static int viaDMAInitTimeStamp(XvMCLowLevel * xl) { int ret = 0; if (xl->use_agp) { xl->tsMem.context = *(xl->drmcontext); xl->tsMem.size = 64; xl->tsMem.type = VIA_MEM_VIDEO; if ((ret = drmCommandWriteRead(xl->fd, DRM_VIA_ALLOCMEM, &xl->tsMem, sizeof(xl->tsMem))) < 0) return ret; if (xl->tsMem.size != 64) return -1; xl->tsOffset = (xl->tsMem.offset + 31) & ~31; xl->tsP = (CARD32 *) xl->fbAddress + (xl->tsOffset >> 2); xl->curTimeStamp = 1; *xl->tsP = 0; } return 0; } static int viaDMACleanupTimeStamp(XvMCLowLevel * xl) { if (!(xl->tsMem.size) || !xl->use_agp) return 0; return drmCommandWrite(xl->fd, DRM_VIA_FREEMEM, &xl->tsMem, sizeof(xl->tsMem)); } static CARD32 viaMpegGetStatus(XvMCLowLevel * xl) { return MPEGIN(xl, 0x54); } static int viaMpegIsBusy(XvMCLowLevel * xl, CARD32 mask, CARD32 idle) { CARD32 tmp = viaMpegGetStatus(xl); /* * Error detected. * FIXME: Are errors really shown when error concealment is on? */ if (tmp & 0x70) return 0; return (tmp & mask) != idle; } static void syncDMA(XvMCLowLevel * xl, unsigned int doSleep) { /* * Ideally, we'd like to have an interrupt wait here, but, according to second hand * information, the hardware does not support this, although earlier S3 chips do that. * It is therefore not implemented into the DRM, and we'll do a user space wait here. */ struct timeval now, then; struct timezone here; struct timespec sleep, rem; sleep.tv_nsec = 1; sleep.tv_sec = 0; here.tz_minuteswest = 0; here.tz_dsttime = 0; gettimeofday(&then, &here); while (!(REGIN(xl, VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY)) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_DMAWAITTIMEOUT) { if (!(REGIN(xl, VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY)) { xl->errors |= LL_DMA_TIMEDOUT; break; } } if (doSleep) nanosleep(&sleep, &rem); } while (REGIN(xl, VIA_REG_STATUS) & VIA_CMD_RGTR_BUSY) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_DMAWAITTIMEOUT) { if (REGIN(xl, VIA_REG_STATUS) & VIA_CMD_RGTR_BUSY) { xl->errors |= LL_DMA_TIMEDOUT; break; } } if (doSleep) nanosleep(&sleep, &rem); } } static void syncVideo(XvMCLowLevel * xl, unsigned int doSleep) { /* * Wait for HQV completion. Nothing strange here. We assume that the HQV * Handles syncing to the V1 / V3 engines by itself. It should be safe to * always wait for SUBPIC_FLIP completion although subpictures are not * always used. */ struct timeval now, then; struct timezone here; struct timespec sleep, rem; sleep.tv_nsec = 1; sleep.tv_sec = 0; here.tz_minuteswest = 0; here.tz_dsttime = 0; gettimeofday(&then, &here); while (VIDIN(xl, HQV_CONTROL) & (HQV_SW_FLIP | HQV_SUBPIC_FLIP)) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_SYNCWAITTIMEOUT) { if (VIDIN(xl, HQV_CONTROL) & (HQV_SW_FLIP | HQV_SUBPIC_FLIP)) { xl->errors |= LL_VIDEO_TIMEDOUT; break; } } if (doSleep) nanosleep(&sleep, &rem); } } static void syncAccel(XvMCLowLevel * xl, unsigned int mode, unsigned int doSleep) { struct timeval now, then; struct timezone here; struct timespec sleep, rem; CARD32 mask = ((mode & LL_MODE_2D) ? VIA_2D_ENG_BUSY : 0) | ((mode & LL_MODE_3D) ? VIA_3D_ENG_BUSY : 0); sleep.tv_nsec = 1; sleep.tv_sec = 0; here.tz_minuteswest = 0; here.tz_dsttime = 0; gettimeofday(&then, &here); while (REGIN(xl, VIA_REG_STATUS) & mask) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_SYNCWAITTIMEOUT) { if (REGIN(xl, VIA_REG_STATUS) & mask) { xl->errors |= LL_ACCEL_TIMEDOUT; break; } } if (doSleep) nanosleep(&sleep, &rem); } } static void syncMpeg(XvMCLowLevel * xl, unsigned int mode, unsigned int doSleep) { /* * Ideally, we'd like to have an interrupt wait here, but from information from VIA * at least the MPEG completion interrupt is broken on the CLE266, which was * discovered during validation of the chip. */ struct timeval now, then; struct timezone here; struct timespec sleep, rem; CARD32 busyMask = 0; CARD32 idleVal = 0; CARD32 ret; sleep.tv_nsec = 1; sleep.tv_sec = 0; here.tz_minuteswest = 0; here.tz_dsttime = 0; gettimeofday(&then, &here); if (mode & LL_MODE_DECODER_SLICE) { busyMask = VIA_SLICEBUSYMASK; idleVal = VIA_SLICEIDLEVAL; } if (mode & LL_MODE_DECODER_IDLE) { busyMask |= VIA_BUSYMASK; idleVal = VIA_IDLEVAL; } while (viaMpegIsBusy(xl, busyMask, idleVal)) { gettimeofday(&now, &here); if (timeDiff(&now, &then) > VIA_XVMC_DECODERTIMEOUT) { if (viaMpegIsBusy(xl, busyMask, idleVal)) { xl->errors |= LL_DECODER_TIMEDOUT; } break; } if (doSleep) nanosleep(&sleep, &rem); } ret = viaMpegGetStatus(xl); if (ret & 0x70) { xl->errors |= ((ret & 0x70) >> 3); } return; } static void pciFlush(XvMCLowLevel * xl) { int ret; drm_via_cmdbuffer_t b; unsigned mode = xl->curWaitFlags; b.buf = (char *)xl->pci_buffer; b.size = xl->pci_pos * sizeof(CARD32); if (xl->performLocking) hwlLock(xl, 0); if ((mode != LL_MODE_VIDEO) && (mode != 0)) syncDMA(xl, 0); if ((mode & LL_MODE_2D) || (mode & LL_MODE_3D)) syncAccel(xl, mode, 0); if (mode & LL_MODE_VIDEO) syncVideo(xl, 0); if (mode & (LL_MODE_DECODER_SLICE | LL_MODE_DECODER_IDLE)) syncMpeg(xl, mode, 0); ret = drmCommandWrite(xl->fd, DRM_VIA_PCICMD, &b, sizeof(b)); if (xl->performLocking) hwlUnlock(xl, 0); if (ret) { xl->errors |= LL_PCI_COMMAND_ERR; } xl->pci_pos = 0; xl->curWaitFlags = 0; } static void agpFlush(XvMCLowLevel * xl) { drm_via_cmdbuffer_t b; int ret; if (xl->use_agp) { b.buf = (char *)xl->agp_buffer; b.size = xl->agp_pos * sizeof(CARD32); if (xl->agpSync) { syncXvMCLowLevel(xl, LL_MODE_DECODER_IDLE, 1, xl->agpSyncTimeStamp); xl->agpSync = 0; } if (xl->performLocking) hwlLock(xl, 0); do { ret = drmCommandWrite(xl->fd, DRM_VIA_CMDBUFFER, &b, sizeof(b)); } while (-EAGAIN == ret); if (xl->performLocking) hwlUnlock(xl, 0); if (ret) { xl->errors |= LL_AGP_COMMAND_ERR; } else { xl->agp_pos = 0; } xl->curWaitFlags &= LL_MODE_VIDEO; } else { unsigned mode = xl->curWaitFlags; b.buf = (char *)xl->agp_buffer; b.size = xl->agp_pos * sizeof(CARD32); if (xl->performLocking) hwlLock(xl, 0); if ((mode != LL_MODE_VIDEO) && (mode != 0)) syncDMA(xl, 0); if ((mode & LL_MODE_2D) || (mode & LL_MODE_3D)) syncAccel(xl, mode, 0); if (mode & LL_MODE_VIDEO) syncVideo(xl, 0); if (mode & (LL_MODE_DECODER_SLICE | LL_MODE_DECODER_IDLE)) syncMpeg(xl, mode, 0); ret = drmCommandWrite(xl->fd, DRM_VIA_PCICMD, &b, sizeof(b)); if (xl->performLocking) hwlUnlock(xl, 0); if (ret) { xl->errors |= LL_PCI_COMMAND_ERR; } xl->agp_pos = 0; xl->curWaitFlags = 0; } } unsigned flushXvMCLowLevel(void *xlp) { unsigned errors; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; if (xl->pci_pos) pciFlush(xl); if (xl->agp_pos) agpFlush(xl); errors = xl->errors; xl->errors = 0; return errors; } void flushPCIXvMCLowLevel(void *xlp) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; if (xl->pci_pos) pciFlush(xl); if (!xl->use_agp && xl->agp_pos) agpFlush(xl); } __inline static void pciCommand(XvMCLowLevel * xl, unsigned offset, unsigned value, unsigned flags) { if (xl->pci_pos > (LL_PCI_CMDBUF_SIZE - 2)) pciFlush(xl); if (flags) xl->curWaitFlags |= flags; xl->pci_buffer[xl->pci_pos++] = (offset >> 2) | 0xF0000000; xl->pci_buffer[xl->pci_pos++] = value; } void viaMpegSetSurfaceStride(void *xlp, ViaXvMCContext * ctx) { CARD32 y_stride = ctx->yStride; CARD32 uv_stride = y_stride >> 1; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; BEGIN_RING_AGP(xl, 2); OUT_RING_QW_AGP(xl, H1_ADDR(0xc50), (y_stride >> 3) | ((uv_stride >> 3) << 16)); WAITFLAGS(xl, LL_MODE_DECODER_IDLE); } void viaVideoSetSWFLipLocked(void *xlp, unsigned yOffs, unsigned uOffs, unsigned vOffs, unsigned yStride, unsigned uvStride) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; pciCommand(xl, HQV_SRC_STARTADDR_Y, yOffs, LL_MODE_VIDEO); pciCommand(xl, HQV_SRC_STARTADDR_U, uOffs, 0); pciCommand(xl, HQV_SRC_STARTADDR_V, vOffs, 0); } void viaVideoSWFlipLocked(void *xlp, unsigned flags, int progressiveSequence) { CARD32 andWd, orWd; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; andWd = 0; orWd = 0; if ((flags & XVMC_FRAME_PICTURE) == XVMC_BOTTOM_FIELD) { andWd = 0xFFFFFFFFU; orWd = HQV_FIELD_UV | HQV_DEINTERLACE | HQV_FIELD_2_FRAME | HQV_FRAME_2_FIELD | HQV_SW_FLIP | HQV_FLIP_ODD | HQV_FLIP_STATUS | HQV_SUBPIC_FLIP; } else if ((flags & XVMC_FRAME_PICTURE) == XVMC_TOP_FIELD) { andWd = ~HQV_FLIP_ODD; orWd = HQV_FIELD_UV | HQV_DEINTERLACE | HQV_FIELD_2_FRAME | HQV_FRAME_2_FIELD | HQV_SW_FLIP | HQV_FLIP_STATUS | HQV_SUBPIC_FLIP; } else if ((flags & XVMC_FRAME_PICTURE) == XVMC_FRAME_PICTURE) { andWd = ~(HQV_DEINTERLACE | HQV_FRAME_2_FIELD | HQV_FIELD_2_FRAME | HQV_FIELD_UV); orWd = HQV_SW_FLIP | HQV_FLIP_STATUS | HQV_SUBPIC_FLIP; } if (progressiveSequence) { andWd &= ~HQV_FIELD_UV; orWd &= ~HQV_FIELD_UV; } pciCommand(xl, HQV_CONTROL, (VIDIN(xl, HQV_CONTROL) & andWd) | orWd, 0); } void viaMpegSetFB(void *xlp, unsigned i, unsigned yOffs, unsigned uOffs, unsigned vOffs) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; i *= 12; BEGIN_RING_AGP(xl, 6); OUT_RING_QW_AGP(xl, H1_ADDR(0xc20 + i), yOffs >> 3); OUT_RING_QW_AGP(xl, H1_ADDR(0xc24 + i), uOffs >> 3); OUT_RING_QW_AGP(xl, H1_ADDR(0xc28 + i), vOffs >> 3); WAITFLAGS(xl, LL_MODE_DECODER_IDLE); } void viaMpegBeginPicture(void *xlp, ViaXvMCContext * ctx, unsigned width, unsigned height, const XvMCMpegControl * control) { unsigned j, mb_width, mb_height; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; mb_width = (width + 15) >> 4; mb_height = ((control->mpeg_coding == XVMC_MPEG_2) && (control->flags & XVMC_PROGRESSIVE_SEQUENCE)) ? 2 * ((height + 31) >> 5) : (((height + 15) >> 4)); BEGIN_RING_AGP(xl, 144); WAITFLAGS(xl, LL_MODE_DECODER_IDLE); OUT_RING_QW_AGP(xl, H1_ADDR(0xc00), ((control->picture_structure & XVMC_FRAME_PICTURE) << 2) | ((control->picture_coding_type & 3) << 4) | ((control->flags & XVMC_ALTERNATE_SCAN) ? (1 << 6) : 0)); if (!(ctx->intraLoaded)) { OUT_RING_QW_AGP(xl, H1_ADDR(0xc5c), 0); for (j = 0; j < 64; j += 4) { OUT_RING_QW_AGP(xl, H1_ADDR(0xc60), ctx->intra_quantiser_matrix[j] | (ctx->intra_quantiser_matrix[j + 1] << 8) | (ctx->intra_quantiser_matrix[j + 2] << 16) | (ctx->intra_quantiser_matrix[j + 3] << 24)); } ctx->intraLoaded = 1; } if (!(ctx->nonIntraLoaded)) { OUT_RING_QW_AGP(xl, H1_ADDR(0xc5c), 1); for (j = 0; j < 64; j += 4) { OUT_RING_QW_AGP(xl, H1_ADDR(0xc60), ctx->non_intra_quantiser_matrix[j] | (ctx->non_intra_quantiser_matrix[j + 1] << 8) | (ctx->non_intra_quantiser_matrix[j + 2] << 16) | (ctx->non_intra_quantiser_matrix[j + 3] << 24)); } ctx->nonIntraLoaded = 1; } if (!(ctx->chromaIntraLoaded)) { OUT_RING_QW_AGP(xl, H1_ADDR(0xc5c), 2); for (j = 0; j < 64; j += 4) { OUT_RING_QW_AGP(xl, H1_ADDR(0xc60), ctx->chroma_intra_quantiser_matrix[j] | (ctx->chroma_intra_quantiser_matrix[j + 1] << 8) | (ctx->chroma_intra_quantiser_matrix[j + 2] << 16) | (ctx->chroma_intra_quantiser_matrix[j + 3] << 24)); } ctx->chromaIntraLoaded = 1; } if (!(ctx->chromaNonIntraLoaded)) { OUT_RING_QW_AGP(xl, H1_ADDR(0xc5c), 3); for (j = 0; j < 64; j += 4) { OUT_RING_QW_AGP(xl, H1_ADDR(0xc60), ctx->chroma_non_intra_quantiser_matrix[j] | (ctx->chroma_non_intra_quantiser_matrix[j + 1] << 8) | (ctx->chroma_non_intra_quantiser_matrix[j + 2] << 16) | (ctx->chroma_non_intra_quantiser_matrix[j + 3] << 24)); } ctx->chromaNonIntraLoaded = 1; } OUT_RING_QW_AGP(xl, H1_ADDR(0xc90), ((mb_width * mb_height) & 0x3fff) | ((control->flags & XVMC_PRED_DCT_FRAME) ? (1 << 14) : 0) | ((control->flags & XVMC_TOP_FIELD_FIRST) ? (1 << 15) : 0) | ((control->mpeg_coding == XVMC_MPEG_2) ? (1 << 16) : 0) | ((mb_width & 0xff) << 18)); OUT_RING_QW_AGP(xl, H1_ADDR(0xc94), ((control->flags & XVMC_CONCEALMENT_MOTION_VECTORS) ? 1 : 0) | ((control->flags & XVMC_Q_SCALE_TYPE) ? 2 : 0) | ((control->intra_dc_precision & 3) << 2) | (((1 + 0x100000 / mb_width) & 0xfffff) << 4) | ((control->flags & XVMC_INTRA_VLC_FORMAT) ? (1 << 24) : 0)); OUT_RING_QW_AGP(xl, H1_ADDR(0xc98), (((control->FHMV_range) & 0xf) << 0) | (((control->FVMV_range) & 0xf) << 4) | (((control->BHMV_range) & 0xf) << 8) | (((control->BVMV_range) & 0xf) << 12) | ((control->flags & XVMC_SECOND_FIELD) ? (1 << 20) : 0) | (0x0a6 << 16)); } void viaMpegReset(void *xlp) { int i, j; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; BEGIN_RING_AGP(xl, 100); WAITFLAGS(xl, LL_MODE_DECODER_IDLE); for (i = 0; i < 14; i++) OUT_RING_QW_AGP(xl, H1_ADDR(0xc08), 0); OUT_RING_QW_AGP(xl, H1_ADDR(0xc98), 0x400000); for (i = 0; i < 6; i++) { OUT_RING_QW_AGP(xl, H1_ADDR(0xc0c), 0x43 | 0x20); for (j = 0xc10; j < 0xc20; j += 4) OUT_RING_QW_AGP(xl, H1_ADDR(j), 0); } OUT_RING_QW_AGP(xl, H1_ADDR(0xc0c), 0xc3 | 0x20); for (j = 0xc10; j < 0xc20; j += 4) OUT_RING_QW_AGP(xl, H1_ADDR(j), 0); } void viaMpegWriteSlice(void *xlp, CARD8 * slice, int nBytes, CARD32 sCode) { int i, n, r; CARD32 *buf; int count; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; if (xl->errors & (LL_DECODER_TIMEDOUT | LL_IDCT_FIFO_ERROR | LL_SLICE_FIFO_ERROR | LL_SLICE_FAULT)) return; n = nBytes >> 2; if (sCode) nBytes += 4; r = nBytes & 3; buf = (CARD32 *) slice; if (r) nBytes += 4 - r; nBytes += 8; BEGIN_RING_AGP(xl, 4); WAITFLAGS(xl, LL_MODE_DECODER_IDLE); OUT_RING_QW_AGP(xl, H1_ADDR(0xc9c), nBytes); if (sCode) OUT_RING_QW_AGP(xl, H1_ADDR(0xca0), sCode); i = 0; count = 0; do { count += (LL_AGP_CMDBUF_SIZE - 20) >> 1; count = (count > n) ? n : count; BEGIN_RING_AGP(xl, (count - i) << 1); for (; i < count; i++) { OUT_RING_QW_AGP(xl, H1_ADDR(0xca0), *buf++); } } while (i < n); BEGIN_RING_AGP(xl, 6); if (r) { OUT_RING_QW_AGP(xl, H1_ADDR(0xca0), *buf & ((1 << (r << 3)) - 1)); } OUT_RING_QW_AGP(xl, H1_ADDR(0xca0), 0); OUT_RING_QW_AGP(xl, H1_ADDR(0xca0), 0); } void viaVideoSubPictureOffLocked(void *xlp) { CARD32 stride; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; stride = VIDIN(xl, SUBP_CONTROL_STRIDE); pciCommand(xl, SUBP_CONTROL_STRIDE, stride & ~SUBP_HQV_ENABLE, LL_MODE_VIDEO); } void viaVideoSubPictureLocked(void *xlp, ViaXvMCSubPicture * pViaSubPic) { unsigned i; CARD32 cWord; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; for (i = 0; i < VIA_SUBPIC_PALETTE_SIZE; ++i) { pciCommand(xl, RAM_TABLE_CONTROL, pViaSubPic->palette[i], LL_MODE_VIDEO); } pciCommand(xl, SUBP_STARTADDR, pViaSubPic->offset, 0); cWord = (pViaSubPic->stride & SUBP_STRIDE_MASK) | SUBP_HQV_ENABLE; cWord |= (pViaSubPic->ia44) ? SUBP_IA44 : SUBP_AI44; pciCommand(xl, SUBP_CONTROL_STRIDE, cWord, 0); } void viaBlit(void *xlp, unsigned bpp, unsigned srcBase, unsigned srcPitch, unsigned dstBase, unsigned dstPitch, unsigned w, unsigned h, int xdir, int ydir, unsigned blitMode, unsigned color) { CARD32 dwGEMode = 0, srcY = 0, srcX, dstY = 0, dstX; CARD32 cmd; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; if (!w || !h) return; switch (bpp) { case 16: dwGEMode |= VIA_GEM_16bpp; break; case 32: dwGEMode |= VIA_GEM_32bpp; break; default: dwGEMode |= VIA_GEM_8bpp; break; } srcX = srcBase & 31; dstX = dstBase & 31; switch (bpp) { case 16: dwGEMode |= VIA_GEM_16bpp; srcX >>= 2; dstX >>= 2; break; case 32: dwGEMode |= VIA_GEM_32bpp; srcX >>= 4; dstX >>= 4; break; default: dwGEMode |= VIA_GEM_8bpp; break; } BEGIN_RING_AGP(xl, 20); WAITFLAGS(xl, LL_MODE_2D); OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_GEMODE), dwGEMode); cmd = 0; if (xdir < 0) { cmd |= VIA_GEC_DECX; srcX += (w - 1); dstX += (w - 1); } if (ydir < 0) { cmd |= VIA_GEC_DECY; srcY += (h - 1); dstY += (h - 1); } switch (blitMode) { case VIABLIT_TRANSCOPY: OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_SRCCOLORKEY), color); OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_KEYCONTROL), 0x4000); cmd |= VIA_GEC_BLT | (VIA_BLIT_COPY << 24); break; case VIABLIT_FILL: OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_FGCOLOR), color); cmd |= VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT | (VIA_BLIT_FILL << 24); break; default: OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_KEYCONTROL), 0x0); cmd |= VIA_GEC_BLT | (VIA_BLIT_COPY << 24); } OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_SRCBASE), (srcBase & ~31) >> 3); OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_DSTBASE), (dstBase & ~31) >> 3); OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_PITCH), VIA_PITCH_ENABLE | (srcPitch >> 3) | (((dstPitch) >> 3) << 16)); OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_SRCPOS), ((srcY << 16) | srcX)); OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_DSTPOS), ((dstY << 16) | dstX)); OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_DIMENSION), (((h - 1) << 16) | (w - 1))); OUT_RING_QW_AGP(xl, H1_ADDR(VIA_REG_GECMD), cmd); } unsigned syncXvMCLowLevel(void *xlp, unsigned int mode, unsigned int doSleep, CARD32 timeStamp) { unsigned errors; XvMCLowLevel *xl = (XvMCLowLevel *) xlp; if (mode == 0) { errors = xl->errors; xl->errors = 0; return errors; } if ((mode & (LL_MODE_VIDEO | LL_MODE_3D)) || !xl->use_agp) { if (xl->performLocking) hwlLock(xl, 0); if ((mode != LL_MODE_VIDEO)) syncDMA(xl, doSleep); if (mode & LL_MODE_3D) syncAccel(xl, mode, doSleep); if (mode & LL_MODE_VIDEO) syncVideo(xl, doSleep); if (xl->performLocking) hwlUnlock(xl, 0); } else { viaDMAWaitTimeStamp(xl, timeStamp, doSleep); } if (mode & (LL_MODE_DECODER_SLICE | LL_MODE_DECODER_IDLE)) syncMpeg(xl, mode, doSleep); errors = xl->errors; xl->errors = 0; return errors; } extern void * initXvMCLowLevel(int fd, drm_context_t * ctx, drmLockPtr hwLock, drmAddress mmioAddress, drmAddress fbAddress, unsigned fbStride, unsigned fbDepth, unsigned width, unsigned height, int useAgp, unsigned chipId) { int ret; XvMCLowLevel *xl; if (chipId == PCI_CHIP_VT3259 || chipId == PCI_CHIP_VT3364) { fprintf(stderr, "You are using an XvMC driver for the wrong chip.\n"); fprintf(stderr, "Chipid is 0x%04x.\n", chipId); return NULL; } xl = (XvMCLowLevel *) malloc(sizeof(XvMCLowLevel)); if (!xl) return NULL; xl->agp_pos = 0; xl->pci_pos = 0; xl->use_agp = useAgp; xl->fd = fd; xl->drmcontext = ctx; xl->hwLock = hwLock; xl->mmioAddress = mmioAddress; xl->fbAddress = fbAddress; xl->curWaitFlags = 0; xl->performLocking = 1; xl->errors = 0; xl->agpSync = 0; ret = viaDMAInitTimeStamp(xl); if (ret) { free(xl); return NULL; } return xl; } void setLowLevelLocking(void *xlp, int performLocking) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; xl->performLocking = performLocking; } void closeXvMCLowLevel(void *xlp) { XvMCLowLevel *xl = (XvMCLowLevel *) xlp; viaDMACleanupTimeStamp(xl); free(xl); } xf86-video-openchrome-0.6.0/src/via_xv_overlay.h0000664000175000017500000001024612760724526016507 00000000000000/* * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifndef _VIA_SWOV_H_ #define _VIA_SWOV_H_ 1 /*#define XV_DEBUG 1 write log msg to /var/log/XFree86.0.log */ #ifdef XV_DEBUG # define DBG_DD(x) (x) #else # define DBG_DD(x) #endif #include "via_priv.h" #include "via_xvpriv.h" /* Definition for VideoStatus */ #define VIDEO_NULL 0x00000000 #define VIDEO_SWOV_SURFACE_CREATED 0x00000001 #define VIDEO_SWOV_ON 0x00000002 /*For Video HW Difference */ #define VID_HWDIFF_TRUE 0x00000001 #define VID_HWDIFF_FALSE 0x00000000 /* * Video HW Difference Structure */ typedef struct __VIAHWDiff { unsigned long dwThreeHQVBuffer; /* Use Three HQV Buffers */ /* unsigned long dwV3SrcHeightSetting; *//* Set Video Source Width and Height */ /* unsigned long dwSupportExtendFIFO; *//* Support Extend FIFO */ unsigned long dwHQVFetchByteUnit; /* HQV Fetch Count unit is byte */ unsigned long dwHQVInitPatch; /* Initialize HQV Engine 2 times */ /*unsigned long dwSupportV3Gamma; *//* Support V3 Gamma */ /*unsigned long dwUpdFlip; *//* Set HQV3D0[15] to flip video */ unsigned long dwHQVDisablePatch; /* Change Video Engine Clock setting for HQV disable bug */ /*unsigned long dwSUBFlip; *//* Set HQV3D0[15] to flip video for sub-picture blending */ unsigned long dwNeedV1Prefetch; /*V1 pre-fetch function for K8*/ /*unsigned long dwNeedV3Prefetch; *//* V3 pre-fetch function for K8 */ /*unsigned long dwNeedV4Prefetch; *//* V4 pre-fetch function for K8 */ /*unsigned long dwUseSystemMemory; *//* Use system memory for DXVA compressed data buffers */ /*unsigned long dwExpandVerPatch; *//* Patch video HW bug in expand SIM mode or same display path */ /*unsigned long dwExpandVerHorPatch; *//* Patch video HW bug in expand SAMM mode or same display path */ /*unsigned long dwV3ExpireNumTune; *//* Change V3 expire number setting for V3 bandwidth issue */ /*unsigned long dwV3FIFOThresholdTune; *//* Change V3 FIFO, Threshold and Pre-threshold setting for V3 bandwidth issue */ /*unsigned long dwCheckHQVFIFOEmpty; *//* HW Flip path, need to check HQV FIFO status */ /*unsigned long dwUseMPEGAGP; *//* Use MPEG AGP function */ /*unsigned long dwV3FIFOPatch; *//* For CLE V3 FIFO Bug (srcWidth <= 8) */ unsigned long dwSupportTwoColorKey; /* Support two color key */ /* unsigned long dwCxColorSpace; *//* CLE_Cx ColorSpace */ unsigned dwNewScaleCtl; /* Use new HQV scale engine code */ const unsigned *HQVCmeRegs; /* Which set of CME regs to use for newer chipsets */ } VIAHWDiff; void VIAVidHWDiffInit(ScrnInfoPtr pScrn); int ViaSwovSurfaceCreate(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv, CARD32 FourCC, CARD16 Width, CARD16 Height); void ViaSwovSurfaceDestroy(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv); Bool VIAVidUpdateOverlay(xf86CrtcPtr crtc, LPDDUPDATEOVERLAY pUpdate); void ViaOverlayHide(ScrnInfoPtr pScrn); #endif /* _VIA_SWOV_H_ */ xf86-video-openchrome-0.6.0/src/via_xvmc.c0000664000175000017500000007520312760724526015265 00000000000000/* * Copyright (c) 2004 The Unichrome Project. All rights reserved. * Copyright (c) 2000 Intel Corporation. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHOR(S) OR COPYRIGHT HOLDER(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 "xf86.h" #include "xf86_OSproc.h" #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86Resources.h" #endif #include "compiler.h" #include "xf86Pci.h" #include "regionstr.h" #ifdef HAVE_DRI #include "via_drmclient.h" #include "via_drm.h" #include "via_dri.h" #include "via_driver.h" #include "xf86xv.h" #include "fourcc.h" #if defined(X_NEED_XVPRIV_H) || defined (_XF86_FOURCC_H_) #include "xf86xvpriv.h" #endif #include "xf86xvmc.h" #include #include #include "dixstruct.h" #include "via_xvmc.h" #include "dristruct.h" #include "dri.h" #include "via_xvpriv.h" #include "via_xv.h" #define MAKE_ATOM(a) MakeAtom(a, strlen(a), TRUE) /* * List of attributes for the XvMC extension to handle. * As long as the attribute is supported by the Xv adaptor, it needs only * to be added here to be supported also by XvMC. * Currently, only colorkey seems to be supported by Xv for Putimage. */ static char *attrXvMC[VIA_NUM_XVMC_ATTRIBUTES] = { "XV_COLORKEY", "XV_AUTOPAINT_COLORKEY", "XV_BRIGHTNESS", "XV_CONTRAST", "XV_SATURATION", "XV_HUE" }; static Atom attrAtoms[VIA_NUM_XVMC_ATTRIBUTES]; /* * Xv Port private structure for XvMC. */ typedef struct { unsigned ctxDisplaying; int xvmc_port; ViaXvMCAttrHolder xvAttr; int newAttribute; SetPortAttributeFuncPtr SetPortAttribute; GetPortAttributeFuncPtr GetPortAttribute; PutImageFuncPtr PutImage; } ViaXvMCXVPriv; /* Proposed XvMC VIA driver extension. */ #define XVMC_VLD 0x0020000 /* Function declarations. */ static int ViaXvMCCreateContext(ScrnInfoPtr pScrn, XvMCContextPtr pContext, int *num_priv, INT32 ** priv); static void ViaXvMCDestroyContext(ScrnInfoPtr pScrn, XvMCContextPtr pContext); static int ViaXvMCCreateSurface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, int *num_priv, INT32 ** priv); static void ViaXvMCDestroySurface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf); static int ViaXvMCCreateSubpicture(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSurf, int *num_priv, INT32 ** priv); static void ViaXvMCDestroySubpicture(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp); static int viaXvMCInterceptXvAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value, pointer data); static int viaXvMCInterceptPutImage(ScrnInfoPtr, short, short, short, short, short, short, short, short, int, unsigned char *, short, short, Bool, RegionPtr, pointer, DrawablePtr); static int viaXvMCInterceptXvGetAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 * value, pointer data); /* * Initialize and clean up the screen private parts of XvMC. */ static void initViaXvMC(ViaXvMCPtr vXvMC) { unsigned i; for (i = 0; i < VIA_XVMC_MAX_CONTEXTS; ++i) { vXvMC->contexts[i] = 0; vXvMC->cPrivs[i] = 0; } for (i = 0; i < VIA_XVMC_MAX_SURFACES; ++i) { vXvMC->surfaces[i] = 0; vXvMC->sPrivs[i] = 0; } } static void cleanupViaXvMC(ViaXvMCPtr vXvMC, XF86VideoAdaptorPtr * XvAdaptors, int XvAdaptorCount) { unsigned i; for (i = 0; i < VIA_XVMC_MAX_CONTEXTS; ++i) { vXvMC->contexts[i] = 0; if (vXvMC->cPrivs[i]) { free(vXvMC->cPrivs[i]); vXvMC->cPrivs[i] = 0; } } for (i = 0; i < VIA_XVMC_MAX_SURFACES; ++i) { vXvMC->surfaces[i] = 0; if (vXvMC->sPrivs[i]) { free(vXvMC->sPrivs[i]); vXvMC->sPrivs[i] = 0; } } } static unsigned stride(int w) { return (w + 31) & ~31; } static unsigned long size_yuv420(int w, int h) { unsigned yPitch = stride(w); return h * (yPitch + (yPitch >> 1)); } static unsigned long size_xx44(int w, int h) { return h * stride(w); } static int yv12_subpicture_index_list[2] = { FOURCC_IA44, FOURCC_AI44 }; static XF86MCImageIDList yv12_subpicture_list = { 2, yv12_subpicture_index_list }; static XF86MCSurfaceInfoRec Via_YV12_mpg2_surface = { FOURCC_YV12, XVMC_CHROMA_FORMAT_420, 0, 1024, 1024, 1024, 1024, XVMC_MPEG_2 | XVMC_VLD, XVMC_OVERLAID_SURFACE | XVMC_BACKEND_SUBPICTURE, &yv12_subpicture_list }; static XF86MCSurfaceInfoRec Via_pga_mpg2_surface = { FOURCC_YV12, XVMC_CHROMA_FORMAT_420, 0, 2048, 2048, 2048, 2048, XVMC_MPEG_2 | XVMC_VLD, XVMC_OVERLAID_SURFACE | XVMC_BACKEND_SUBPICTURE, &yv12_subpicture_list }; static XF86MCSurfaceInfoRec Via_YV12_mpg1_surface = { FOURCC_YV12, XVMC_CHROMA_FORMAT_420, 0, 1024, 1024, 1024, 1024, XVMC_MPEG_1 | XVMC_VLD, XVMC_OVERLAID_SURFACE | XVMC_BACKEND_SUBPICTURE, &yv12_subpicture_list }; static XF86MCSurfaceInfoRec Via_pga_mpg1_surface = { FOURCC_YV12, XVMC_CHROMA_FORMAT_420, 0, 2048, 2048, 2048, 2048, XVMC_MPEG_1 | XVMC_VLD, XVMC_OVERLAID_SURFACE | XVMC_BACKEND_SUBPICTURE, &yv12_subpicture_list }; static XF86MCSurfaceInfoPtr ppSI[2] = { (XF86MCSurfaceInfoPtr) & Via_YV12_mpg2_surface, (XF86MCSurfaceInfoPtr) & Via_YV12_mpg1_surface }; static XF86MCSurfaceInfoPtr ppSI_pga[2] = { (XF86MCSurfaceInfoPtr) & Via_pga_mpg2_surface, (XF86MCSurfaceInfoPtr) & Via_pga_mpg1_surface }; /* List of supported subpicture types. */ static XF86ImageRec ia44_subpicture = XVIMAGE_IA44; static XF86ImageRec ai44_subpicture = XVIMAGE_AI44; static XF86ImagePtr Via_subpicture_list[2] = { (XF86ImagePtr) & ia44_subpicture, (XF86ImagePtr) & ai44_subpicture }; /* * Filling in the device dependent adaptor record. * This is named "VIA Video Overlay" because this code falls under the * XV extension, the name must match or it won't be used. * * For surface and subpicture, see above. * The function pointers point to functions below. */ static XF86MCAdaptorRec pAdapt = { "XV_SWOV", /* name */ 2, /* num_surfaces */ ppSI, /* surfaces */ 2, /* num_subpictures */ Via_subpicture_list, /* subpictures */ (xf86XvMCCreateContextProcPtr) ViaXvMCCreateContext, (xf86XvMCDestroyContextProcPtr) ViaXvMCDestroyContext, (xf86XvMCCreateSurfaceProcPtr) ViaXvMCCreateSurface, (xf86XvMCDestroySurfaceProcPtr) ViaXvMCDestroySurface, (xf86XvMCCreateSubpictureProcPtr) ViaXvMCCreateSubpicture, (xf86XvMCDestroySubpictureProcPtr) ViaXvMCDestroySubpicture }; static XF86MCAdaptorRec pAdapt_pga = { "XV_SWOV", /* name */ 2, /* num_surfaces */ ppSI_pga, /* surfaces */ 2, /* num_subpictures */ Via_subpicture_list, /* subpictures */ (xf86XvMCCreateContextProcPtr) ViaXvMCCreateContext, (xf86XvMCDestroyContextProcPtr) ViaXvMCDestroyContext, (xf86XvMCCreateSurfaceProcPtr) ViaXvMCCreateSurface, (xf86XvMCDestroySurfaceProcPtr) ViaXvMCDestroySurface, (xf86XvMCCreateSubpictureProcPtr) ViaXvMCCreateSubpicture, (xf86XvMCDestroySubpictureProcPtr) ViaXvMCDestroySubpicture }; static XF86MCAdaptorPtr ppAdapt[1] = { (XF86MCAdaptorPtr) & pAdapt }; static XF86MCAdaptorPtr ppAdapt_pga[1] = { (XF86MCAdaptorPtr) & pAdapt_pga }; static void mpegDisable(VIAPtr pVia, CARD32 val) { MPGOutD(0x0c, MPGInD(0x0c) & (val ^ 0xffffffff)); } void ViaInitXVMC(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); ViaXvMCPtr vXvMC = &(pVia->xvmc); volatile ViaXvMCSAreaPriv *saPriv; pVia->XvMCEnabled = 0; if ((pVia->Chipset == VIA_KM400) || (pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_K8M890) || (pVia->Chipset == VIA_P4M900) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[XvMC] XvMC is not supported on this chipset.\n"); return; } if (!pVia->directRenderingType) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[XvMC] Cannot use XvMC without DRI!\n"); return; } if (((pVia->drmVerMajor <= 2) && (pVia->drmVerMinor < 4))) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[XvMC] Kernel drm is not compatible with XvMC.\n"); xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[XvMC] Kernel drm version is %d.%d.%d; " "at least version 2.4.0 is needed.\n", pVia->drmVerMajor, pVia->drmVerMinor, pVia->drmVerPL); xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[XvMC] Please update. Disabling XvMC.\n"); return; } vXvMC->mmioBase = pVia->registerHandle; if (drmAddMap(pVia->drmmode.fd, (drm_handle_t) pVia->FrameBufferBase, pVia->videoRambytes, DRM_FRAME_BUFFER, 0, &(vXvMC->fbBase)) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] drmAddMap(FB) failed. Disabling XvMC.\n"); return; } initViaXvMC(vXvMC); if (!xf86XvMCScreenInit(pScreen, 1, ((pVia->Chipset == VIA_PM800) ? ppAdapt_pga : ppAdapt))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] XvMCScreenInit failed. Disabling XvMC.\n"); drmRmMap(pVia->drmmode.fd, vXvMC->fbBase); return; } #if (XvMCVersion > 1) || (XvMCRevision > 0) { DRIInfoPtr pDRIInfo = pVia->pDRIInfo; if (pVia->ChipId != PCI_CHIP_VT3259 && pVia->ChipId != PCI_CHIP_VT3364) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[XvMC] Registering chromeXvMC.\n"); xf86XvMCRegisterDRInfo(pScreen, "chromeXvMC", pDRIInfo->busIdString, VIAXVMC_MAJOR, VIAXVMC_MINOR, VIAXVMC_PL); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[XvMC] Registering chromeXvMCPro.\n"); xf86XvMCRegisterDRInfo(pScreen, "chromeXvMCPro", pDRIInfo->busIdString, VIAXVMC_MAJOR, VIAXVMC_MINOR, VIAXVMC_PL); } } #endif vXvMC->activePorts = 0; saPriv = (ViaXvMCSAreaPriv *) DRIGetSAREAPrivate(pScreen); saPriv->XvMCCtxNoGrabbed = ~0; XVMCLOCKPTR(saPriv, UNICHROME_LOCK_DECODER1)->lock = 0; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[XvMC] Initialized XvMC extension.\n"); pVia->XvMCEnabled = 1; } void ViaCleanupXVMC(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr * XvAdaptors, int XvAdaptorCount) { VIAPtr pVia = VIAPTR(pScrn); ViaXvMCPtr vXvMC = &(pVia->xvmc); int i, j; if (pVia->XvMCEnabled) { mpegDisable(pVia, 0); drmRmMap(pVia->drmmode.fd, vXvMC->mmioBase); cleanupViaXvMC(vXvMC, XvAdaptors, XvAdaptorCount); } for (i = 0; i < XvAdaptorCount; ++i) { if (!XvAdaptors[i]) continue; for (j = 0; j < XvAdaptors[i]->nPorts; ++j) { viaPortPrivPtr pPriv = XvAdaptors[i]->pPortPrivates[j].ptr; if (pPriv->xvmc_priv) free(pPriv->xvmc_priv); } } pVia->XvMCEnabled = 0; } static int ViaXvMCCreateContext(ScrnInfoPtr pScrn, XvMCContextPtr pContext, int *num_priv, INT32 ** priv) { VIAPtr pVia = VIAPTR(pScrn); ViaXvMCPtr vXvMC = &(pVia->xvmc); DRIInfoPtr pDRIInfo = pVia->pDRIInfo; VIADRIPtr pViaDRI = pDRIInfo->devPrivate; ViaXvMCCreateContextRec *contextRec; unsigned ctxNo; ViaXvMCContextPriv *cPriv; XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) pContext->port_priv; viaPortPrivPtr pPriv = (viaPortPrivPtr) portPriv->DevPriv.ptr; ViaXvMCXVPriv *vx = (ViaXvMCXVPriv *) pPriv->xvmc_priv; volatile ViaXvMCSAreaPriv *sAPriv; sAPriv = (ViaXvMCSAreaPriv *) DRIGetSAREAPrivate(pScrn->pScreen); if (-1 == vx->xvmc_port) { vx->xvmc_port = (vXvMC->activePorts++); sAPriv->XvMCSubPicOn[vx->xvmc_port] = 0; sAPriv->XvMCDisplaying[vx->xvmc_port] = 0; } if (vXvMC->nContexts >= VIA_XVMC_MAX_CONTEXTS) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateContext: Out of contexts.\n"); return BadAlloc; } *priv = calloc(1, sizeof(ViaXvMCCreateContextRec)); contextRec = (ViaXvMCCreateContextRec *) * priv; if (!*priv) { *num_priv = 0; return BadAlloc; } *num_priv = sizeof(ViaXvMCCreateContextRec) >> 2; for (ctxNo = 0; ctxNo < VIA_XVMC_MAX_CONTEXTS; ++ctxNo) { if (0 == vXvMC->contexts[ctxNo]) break; } cPriv = (ViaXvMCContextPriv *) calloc(1, sizeof(ViaXvMCContextPriv)); if (!cPriv) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateContext: Unable to allocate memory!\n"); free(*priv); *num_priv = 0; return BadAlloc; } /* Export framebuffer and mmio to non-root clients. */ contextRec->ctxNo = ctxNo; contextRec->xvmc_port = vx->xvmc_port; contextRec->fbOffset = vXvMC->fbBase; contextRec->fbSize = pVia->videoRambytes; contextRec->mmioOffset = vXvMC->mmioBase; contextRec->mmioSize = VIA_MMIO_REGSIZE; contextRec->sAreaSize = pDRIInfo->SAREASize; contextRec->sAreaPrivOffset = sizeof(XF86DRISAREARec); contextRec->major = VIAXVMC_MAJOR; contextRec->minor = VIAXVMC_MINOR; contextRec->pl = VIAXVMC_PL; contextRec->initAttrs = vx->xvAttr; contextRec->useAGP = (pViaDRI->ringBufActive && ((pVia->Chipset == VIA_CLE266) || (pVia->Chipset == VIA_KM400) || (pVia->Chipset == VIA_PM800) || (pVia->Chipset == VIA_P4M900))); contextRec->chipId = pVia->ChipId; contextRec->screen = pScrn->scrnIndex; contextRec->depth = pScrn->bitsPerPixel; contextRec->stride = pVia->Bpp * pScrn->virtualX; vXvMC->nContexts++; vXvMC->contexts[ctxNo] = pContext->context_id; vXvMC->cPrivs[ctxNo] = cPriv; return Success; } static int ViaXvMCCreateSurface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, int *num_priv, INT32 ** priv) { VIAPtr pVia = VIAPTR(pScrn); ViaXvMCPtr vXvMC = &(pVia->xvmc); unsigned srfNo, numBuffers, i; ViaXvMCSurfacePriv *sPriv; XvMCContextPtr ctx; unsigned bufSize, yBufSize; void *buf; if (VIA_XVMC_MAX_SURFACES == vXvMC->nSurfaces) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSurface: Too many surfaces !\n"); return BadAlloc; } sPriv = (ViaXvMCSurfacePriv *) calloc(1, sizeof(ViaXvMCSurfacePriv)); if (!sPriv) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSurface: Unable to allocate memory!\n"); *num_priv = 0; return BadAlloc; } numBuffers = 1; /* * Some chips require more than one buffer per surface (and a special * flipping procedure; See Ivor Hewitt's ddmpeg.c version 1.6). The client * lib will detect the number of buffers allocated and determine the * flipping method from that. */ #if 0 /* Not enabled yet. */ switch (pVia->ChipSet) { case VIA_CLE266: switch (pVia->ChipRev) { case 0x10: /* CLE266 C0 only? Or all C? */ numBuffers = 2; break; default: break; } break; default: break; } #endif *num_priv = numBuffers + 2; *priv = (INT32 *) calloc(*num_priv, sizeof(INT32)); if (!*priv) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSurface: Unable to allocate memory!\n"); *num_priv = 0; free(sPriv); return BadAlloc; } for (srfNo = 0; srfNo < VIA_XVMC_MAX_SURFACES; ++srfNo) { if (0 == vXvMC->sPrivs[srfNo]) break; } (*priv)[0] = srfNo; ctx = pSurf->context; bufSize = size_yuv420(ctx->width, ctx->height); sPriv->memory_ref = drm_bo_alloc(pScrn, numBuffers * bufSize, 32, TTM_PL_FLAG_VRAM); if (!sPriv->memory_ref) { free(*priv); free(sPriv); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSurface: " "Unable to allocate frambuffer memory!\n"); return BadAlloc; } buf = drm_bo_map(pScrn, sPriv->memory_ref); (*priv)[1] = numBuffers; (*priv)[2] = sPriv->offsets[0] = sPriv->memory_ref->offset; for (i = 1; i < numBuffers; ++i) { (*priv)[i + 2] = sPriv->offsets[i] = sPriv->offsets[i - 1] + bufSize; } yBufSize = stride(ctx->width) * ctx->height; for (i = 0; i < numBuffers; ++i) { memset(buf, 0, yBufSize); memset(buf + yBufSize, 0x80, yBufSize >> 1); buf += bufSize; } drm_bo_unmap(pScrn, sPriv->memory_ref); vXvMC->sPrivs[srfNo] = sPriv; vXvMC->surfaces[srfNo] = pSurf->surface_id; vXvMC->nSurfaces++; return Success; } static int ViaXvMCCreateSubpicture(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, int *num_priv, INT32 ** priv) { VIAPtr pVia = VIAPTR(pScrn); ViaXvMCPtr vXvMC = &(pVia->xvmc); unsigned srfNo; ViaXvMCSurfacePriv *sPriv; XvMCContextPtr ctx; unsigned bufSize; if (VIA_XVMC_MAX_SURFACES == vXvMC->nSurfaces) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSubpicture: Too many surfaces !\n"); return BadAlloc; } sPriv = (ViaXvMCSurfacePriv *) calloc(1, sizeof(ViaXvMCSurfacePriv)); if (!sPriv) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSubpicture:" " Unable to allocate memory!\n"); *num_priv = 0; return BadAlloc; } *priv = (INT32 *) calloc(3, sizeof(INT32)); if (!*priv) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSubpicture:" " Unable to allocate memory!\n"); *num_priv = 0; free(sPriv); return BadAlloc; } *num_priv = 2; for (srfNo = 0; srfNo < VIA_XVMC_MAX_SURFACES; ++srfNo) { if (0 == vXvMC->sPrivs[srfNo]) break; } (*priv)[0] = srfNo; ctx = pSubp->context; bufSize = size_xx44(ctx->width, ctx->height); sPriv->memory_ref = drm_bo_alloc(pScrn, 1 * bufSize, 32, TTM_PL_FLAG_VRAM); if (!sPriv->memory_ref) { free(*priv); free(sPriv); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSubpicture:" " Unable to allocate framebuffer memory!\n"); return BadAlloc; } (*priv)[1] = sPriv->offsets[0] = sPriv->memory_ref->offset; vXvMC->sPrivs[srfNo] = sPriv; vXvMC->surfaces[srfNo] = pSubp->subpicture_id; vXvMC->nSurfaces++; return Success; } static void ViaXvMCDestroyContext(ScrnInfoPtr pScrn, XvMCContextPtr pContext) { VIAPtr pVia = VIAPTR(pScrn); ViaXvMCPtr vXvMC = &(pVia->xvmc); int i; volatile ViaXvMCSAreaPriv *sAPriv; viaPortPrivPtr pPriv; XvPortRecPrivatePtr portPriv; ViaXvMCXVPriv *vx; for (i = 0; i < VIA_XVMC_MAX_CONTEXTS; i++) { if (vXvMC->contexts[i] == pContext->context_id) { sAPriv = (ViaXvMCSAreaPriv *) DRIGetSAREAPrivate(pScrn->pScreen); portPriv = (XvPortRecPrivatePtr) pContext->port_priv; pPriv = (viaPortPrivPtr) portPriv->DevPriv.ptr; vx = (ViaXvMCXVPriv *) pPriv->xvmc_priv; if ((i | VIA_XVMC_VALID) == vx->ctxDisplaying) { vx->ctxDisplaying = 0; } free(vXvMC->cPrivs[i]); vXvMC->cPrivs[i] = 0; vXvMC->nContexts--; vXvMC->contexts[i] = 0; return; } } return; } static void ViaXvMCDestroySurface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf) { VIAPtr pVia = VIAPTR(pScrn); ViaXvMCPtr vXvMC = &(pVia->xvmc); int i; volatile ViaXvMCSAreaPriv *sAPriv; XvMCContextPtr pContext = pSurf->context; XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) pContext->port_priv; viaPortPrivPtr pPriv = (viaPortPrivPtr) portPriv->DevPriv.ptr; ViaXvMCXVPriv *vx = (ViaXvMCXVPriv *) pPriv->xvmc_priv; for (i = 0; i < VIA_XVMC_MAX_SURFACES; i++) { if (vXvMC->surfaces[i] == pSurf->surface_id) { sAPriv = (ViaXvMCSAreaPriv *) DRIGetSAREAPrivate(pScrn->pScreen); { DRM_CAS_RESULT(__ret); DRM_CAS(&(sAPriv->XvMCDisplaying[vx->xvmc_port]), i | VIA_XVMC_VALID, 0, __ret); if (!__ret) ViaOverlayHide(pScrn); } drm_bo_free(pScrn, vXvMC->sPrivs[i]->memory_ref); free(vXvMC->sPrivs[i]); vXvMC->nSurfaces--; vXvMC->sPrivs[i] = 0; vXvMC->surfaces[i] = 0; return; } } return; } static void ViaXvMCDestroySubpicture(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp) { VIAPtr pVia = VIAPTR(pScrn); ViaXvMCPtr vXvMC = &(pVia->xvmc); int i; volatile ViaXvMCSAreaPriv *sAPriv; XvMCContextPtr pContext = pSubp->context; XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) pContext->port_priv; viaPortPrivPtr pPriv = (viaPortPrivPtr) portPriv->DevPriv.ptr; ViaXvMCXVPriv *vx = (ViaXvMCXVPriv *) pPriv->xvmc_priv; for (i = 0; i < VIA_XVMC_MAX_SURFACES; i++) { if (vXvMC->surfaces[i] == pSubp->subpicture_id) { sAPriv = (ViaXvMCSAreaPriv *) DRIGetSAREAPrivate(pScrn->pScreen); { DRM_CAS_RESULT(__ret); DRM_CAS(&(sAPriv->XvMCSubPicOn[vx->xvmc_port]), i | VIA_XVMC_VALID, 0, __ret); if (!__ret) { /* Turn subpicture off. */ while (VIAGETREG(V_COMPOSE_MODE) & (V1_COMMAND_FIRE | V3_COMMAND_FIRE)) ; VIASETREG(SUBP_CONTROL_STRIDE, VIAGETREG(SUBP_CONTROL_STRIDE) & ~SUBP_HQV_ENABLE); } } drm_bo_free(pScrn, vXvMC->sPrivs[i]->memory_ref); free(vXvMC->sPrivs[i]); vXvMC->nSurfaces--; vXvMC->sPrivs[i] = 0; vXvMC->surfaces[i] = 0; return; } } return; } /* * Tell XvMC clients that Xv is currently displaying; * return 1 if another client was displaying before. */ static int viaXvMCSetDisplayLock(ScrnInfoPtr pScrn, ViaXvMCXVPriv * vx) { VIAPtr pVia = VIAPTR(pScrn); ViaXvMCSAreaPriv *sAPriv = (ViaXvMCSAreaPriv *) DRIGetSAREAPrivate(pScrn->pScreen); if (vx->xvmc_port > 0) { if ((VIA_XVMC_MAX_SURFACES | VIA_XVMC_VALID) != sAPriv->XvMCDisplaying[vx->xvmc_port]) { sAPriv->XvMCDisplaying[vx->xvmc_port] = (VIA_XVMC_MAX_SURFACES | VIA_XVMC_VALID); } if (sAPriv->XvMCSubPicOn[vx->xvmc_port] & VIA_XVMC_VALID) { sAPriv->XvMCSubPicOn[vx->xvmc_port] = 0; while (VIAGETREG(V_COMPOSE_MODE) & (V1_COMMAND_FIRE | V3_COMMAND_FIRE)) ; VIASETREG(SUBP_CONTROL_STRIDE, VIAGETREG(SUBP_CONTROL_STRIDE) & ~SUBP_HQV_ENABLE); } } return 0; } int viaXvMCInitXv(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr XvAdapt) { viaPortPrivPtr pPriv; ViaXvMCXVPriv *vx; unsigned i, j; for (j = 0; j < XvAdapt->nPorts; ++j) { pPriv = (viaPortPrivPtr) XvAdapt->pPortPrivates[j].ptr; if (NULL == (pPriv->xvmc_priv = calloc(1, sizeof(ViaXvMCXVPriv)))) return BadAlloc; for (i = 0; i < VIA_NUM_XVMC_ATTRIBUTES; ++i) { attrAtoms[i] = MAKE_ATOM(attrXvMC[i]); } vx = (ViaXvMCXVPriv *) pPriv->xvmc_priv; vx->ctxDisplaying = 0; vx->xvAttr.numAttr = VIA_NUM_XVMC_ATTRIBUTES; vx->xvmc_port = -1; vx->newAttribute = 1; /* Set up wrappers. */ vx->GetPortAttribute = XvAdapt->GetPortAttribute; vx->SetPortAttribute = XvAdapt->SetPortAttribute; vx->PutImage = XvAdapt->PutImage; XvAdapt->GetPortAttribute = viaXvMCInterceptXvGetAttribute; XvAdapt->SetPortAttribute = viaXvMCInterceptXvAttribute; XvAdapt->PutImage = viaXvMCInterceptPutImage; for (i = 0; i < VIA_NUM_XVMC_ATTRIBUTES; ++i) { vx->xvAttr.attributes[i].attribute = attrAtoms[i]; vx->xvAttr.attributes[i].value = 0; vx->GetPortAttribute(pScrn, attrAtoms[i], &(vx->xvAttr.attributes[i].value), pPriv); } } return Success; } static int viaXvMCInterceptXvAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value, pointer data) { unsigned i; viaPortPrivPtr pPriv = (viaPortPrivPtr) data; ViaXvMCXVPriv *vx = (ViaXvMCXVPriv *) pPriv->xvmc_priv; if (VIAPTR(pScrn)->XvMCEnabled) { for (i = 0; i < vx->xvAttr.numAttr; ++i) { if (vx->xvAttr.attributes[i].attribute == attribute) { vx->xvAttr.attributes[i].value = value; if (vx->ctxDisplaying != (VIA_XVMC_MAX_CONTEXTS | VIA_XVMC_VALID)) { vx->newAttribute = 1; return 0; } } } } return vx->SetPortAttribute(pScrn, attribute, value, data); } static int viaXvMCInterceptXvGetAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 * value, pointer data) { unsigned i; viaPortPrivPtr pPriv = (viaPortPrivPtr) data; ViaXvMCXVPriv *vx = (ViaXvMCXVPriv *) pPriv->xvmc_priv; if (VIAPTR(pScrn)->XvMCEnabled) { for (i = 0; i < vx->xvAttr.numAttr; ++i) { if (vx->xvAttr.attributes[i].attribute == attribute) { *value = vx->xvAttr.attributes[i].value; return Success; } } } return vx->GetPortAttribute(pScrn, attribute, value, data); } static int viaXvMCDisplayAttributes(ScrnInfoPtr pScrn, const ViaXvMCAttrHolder * ah, viaPortPrivPtr pPriv) { ViaXvMCXVPriv *vx = (ViaXvMCXVPriv *) pPriv->xvmc_priv; unsigned i; int ret; for (i = 0; i < ah->numAttr; ++i) { ret = vx->SetPortAttribute(pScrn, ah->attributes[i].attribute, ah->attributes[i].value, pPriv); if (ret) return ret; } return Success; } static int viaXvMCInterceptPutImage(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) { viaPortPrivPtr pPriv = (viaPortPrivPtr) data; ViaXvMCXVPriv *vx = (ViaXvMCXVPriv *) pPriv->xvmc_priv; if (VIAPTR(pScrn)->XvMCEnabled) { if (FOURCC_XVMC == id) { volatile ViaXvMCSAreaPriv *sAPriv; ViaXvMCCommandBuffer *vXvMCData = (ViaXvMCCommandBuffer *) buf; sAPriv = (ViaXvMCSAreaPriv *) DRIGetSAREAPrivate(pScrn->pScreen); switch (vXvMCData->command) { case VIA_XVMC_COMMAND_ATTRIBUTES: if ((vXvMCData->ctxNo | VIA_XVMC_VALID) != vx->ctxDisplaying) return 1; viaXvMCDisplayAttributes(pScrn, &vXvMCData->attrib, pPriv); return 0; case VIA_XVMC_COMMAND_FDISPLAY: if (sAPriv->XvMCDisplaying[vx->xvmc_port] != vXvMCData->srfNo) return 1; viaXvMCDisplayAttributes(pScrn, &vXvMCData->attrib, pPriv); vx->ctxDisplaying = vXvMCData->ctxNo; break; case VIA_XVMC_COMMAND_DISPLAY: if ((vXvMCData->ctxNo | VIA_XVMC_VALID) != vx->ctxDisplaying) { viaXvMCDisplayAttributes(pScrn, &vXvMCData->attrib, pPriv); } if (sAPriv->XvMCDisplaying[vx->xvmc_port] != vXvMCData->srfNo) return 1; vx->ctxDisplaying = vXvMCData->ctxNo; break; case VIA_XVMC_COMMAND_UNDISPLAY: { DRM_CAS_RESULT(__ret); DRM_CAS(&(sAPriv->XvMCDisplaying[vx->xvmc_port]), vXvMCData->srfNo, 0, __ret); if (!__ret) ViaOverlayHide(pScrn); } return Success; default: break; } } else { if ((VIA_XVMC_MAX_CONTEXTS | VIA_XVMC_VALID) != vx->ctxDisplaying) { viaXvMCDisplayAttributes(pScrn, &vx->xvAttr, pPriv); vx->ctxDisplaying = VIA_XVMC_MAX_CONTEXTS | VIA_XVMC_VALID; } else if (vx->newAttribute) { vx->newAttribute = 0; viaXvMCDisplayAttributes(pScrn, &vx->xvAttr, pPriv); } viaXvMCSetDisplayLock(pScrn, vx); } } return vx->PutImage(pScrn, src_x, src_y, drw_x, drw_y, src_w, src_h, drw_w, drw_h, id, buf, width, height, sync, clipBoxes, data, pDraw); } unsigned long viaXvMCPutImageSize(ScrnInfoPtr pScrn) { if (VIAPTR(pScrn)->XvMCEnabled) return sizeof(ViaXvMCCommandBuffer); return 0; } #endif /* HAVE_DRI */ xf86-video-openchrome-0.6.0/src/via_drm.h0000664000175000017500000002354712760724526015103 00000000000000/* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 AUTHOR(S) OR COPYRIGHT HOLDER(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. */ #ifndef _VIA_DRM_H_ #define _VIA_DRM_H_ #include "drm.h" /* WARNING: These defines must be the same as what the Xserver uses. * if you change them, you must change the defines in the Xserver. */ #ifndef _VIA_DEFINES_ #define _VIA_DEFINES_ #define VIA_NR_SAREA_CLIPRECTS 8 #define VIA_NR_XVMC_PORTS 10 #define VIA_NR_XVMC_LOCKS 5 #define VIA_MAX_CACHELINE_SIZE 64 #define XVMCLOCKPTR(saPriv,lockNo) \ ((volatile struct drm_hw_lock *)(((((unsigned long) (saPriv)->XvMCLockArea) + \ (VIA_MAX_CACHELINE_SIZE - 1)) & \ ~(VIA_MAX_CACHELINE_SIZE - 1)) + \ VIA_MAX_CACHELINE_SIZE*(lockNo))) /* Each region is a minimum of 64k, and there are at most 64 of them. */ #define VIA_NR_TEX_REGIONS 64 #define VIA_LOG_MIN_TEX_REGION_SIZE 16 #endif #define VIA_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */ #define VIA_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */ #define VIA_UPLOAD_CTX 0x4 #define VIA_UPLOAD_BUFFERS 0x8 #define VIA_UPLOAD_TEX0 0x10 #define VIA_UPLOAD_TEX1 0x20 #define VIA_UPLOAD_CLIPRECTS 0x40 #define VIA_UPLOAD_ALL 0xff /* VIA specific ioctls */ #define DRM_VIA_ALLOCMEM 0x00 #define DRM_VIA_FREEMEM 0x01 #define DRM_VIA_AGP_INIT 0x02 #define DRM_VIA_FB_INIT 0x03 #define DRM_VIA_MAP_INIT 0x04 #define DRM_VIA_DEC_FUTEX 0x05 #define DRM_VIA_OLD_GEM_CREATE 0x06 #define DRM_VIA_DMA_INIT 0x07 #define DRM_VIA_CMDBUFFER 0x08 #define DRM_VIA_FLUSH 0x09 #define DRM_VIA_PCICMD 0x0a #define DRM_VIA_CMDBUF_SIZE 0x0b #define NOT_USED #define DRM_VIA_WAIT_IRQ 0x0d #define DRM_VIA_DMA_BLIT 0x0e #define DRM_VIA_BLIT_SYNC 0x0f /* KMS ioctls */ #define DRM_VIA_GETPARAM 0x10 #define DRM_VIA_SETPARAM 0x11 #define DRM_VIA_GEM_CREATE 0x12 #define DRM_VIA_GEM_WAIT 0x13 #define DRM_VIA_GEM_STATE 0x14 #define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t) #define DRM_IOCTL_VIA_FREEMEM DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t) #define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t) #define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t) #define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t) #define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t) #define DRM_IOCTL_VIA_OLD_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_OLD_GEM_CREATE, struct drm_via_gem_object) #define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t) #define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t) #define DRM_IOCTL_VIA_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_VIA_FLUSH) #define DRM_IOCTL_VIA_PCICMD DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t) #define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \ drm_via_cmdbuf_size_t) #define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t) #define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t) #define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t) /* KMS ioctls */ #define DRM_IOCTL_VIA_GETPARAM DRM_IOR(DRM_COMMAND_BASE + DRM_VIA_GETPARAM, struct drm_via_param) #define DRM_IOCTL_VIA_SETPARAM DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_SETPARAM, struct drm_via_param) #define DRM_IOCTL_VIA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_GEM_CREATE, struct drm_via_gem_object) #define DRM_IOCTL_VIA_GEM_WAIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_GEM_WAIT, struct drm_via_gem_wait) #define DRM_IOCTL_VIA_GEM_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_GEM_STATE, struct drm_via_gem_object) /* Indices into buf.Setup where various bits of state are mirrored per * context and per buffer. These can be fired at the card as a unit, * or in a piecewise fashion as required. */ #define VIA_TEX_SETUP_SIZE 8 /* Flags for clear ioctl */ #define VIA_FRONT 0x1 #define VIA_BACK 0x2 #define VIA_DEPTH 0x4 #define VIA_STENCIL 0x8 #define VIA_MEM_VIDEO 0 /* matches drm constant */ #define VIA_MEM_AGP 1 /* matches drm constant */ #define VIA_MEM_SYSTEM 2 #define VIA_MEM_MIXED 3 #define VIA_MEM_UNKNOWN 4 typedef struct { __u32 offset; __u32 size; } drm_via_agp_t; typedef struct { __u32 offset; __u32 size; } drm_via_fb_t; typedef struct { __u32 context; __u32 type; __u32 size; unsigned long index; unsigned long offset; } drm_via_mem_t; typedef struct _drm_via_init { enum { VIA_INIT_MAP = 0x01, VIA_CLEANUP_MAP = 0x02 } func; unsigned long sarea_priv_offset; unsigned long fb_offset; unsigned long mmio_offset; unsigned long agpAddr; } drm_via_init_t; typedef struct _drm_via_futex { enum { VIA_FUTEX_WAIT = 0x00, VIA_FUTEX_WAKE = 0X01 } func; __u32 ms; __u32 lock; __u32 val; } drm_via_futex_t; typedef struct _drm_via_dma_init { enum { VIA_INIT_DMA = 0x01, VIA_CLEANUP_DMA = 0x02, VIA_DMA_INITIALIZED = 0x03 } func; unsigned long offset; unsigned long size; unsigned long reg_pause_addr; } drm_via_dma_init_t; typedef struct _drm_via_cmdbuffer { char __user *buf; unsigned long size; } drm_via_cmdbuffer_t; /* Warning: If you change the SAREA structure you must change the Xserver * structure as well */ typedef struct _drm_via_tex_region { unsigned char next, prev; /* indices to form a circular LRU */ unsigned char inUse; /* owned by a client, or free? */ int age; /* tracked by clients to update local LRU's */ } drm_via_tex_region_t; typedef struct _drm_via_sarea { unsigned int dirty; unsigned int nbox; struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS]; drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1]; int texAge; /* last time texture was uploaded */ int ctxOwner; /* last context to upload state */ int vertexPrim; /* * Below is for XvMC. * We want the lock integers alone on, and aligned to, a cache line. * Therefore this somewhat strange construct. */ char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)]; unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS]; unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS]; unsigned int XvMCCtxNoGrabbed; /* Last context to hold decoder */ /* Used by the 3d driver only at this point, for pageflipping: */ unsigned int pfCurrentOffset; } drm_via_sarea_t; typedef struct _drm_via_cmdbuf_size { enum { VIA_CMDBUF_SPACE = 0x01, VIA_CMDBUF_LAG = 0x02 } func; int wait; __u32 size; } drm_via_cmdbuf_size_t; typedef enum { VIA_IRQ_ABSOLUTE = 0x0, VIA_IRQ_RELATIVE = 0x1, VIA_IRQ_SIGNAL = 0x10000000, VIA_IRQ_FORCE_SEQUENCE = 0x20000000 } via_irq_seq_type_t; #define VIA_IRQ_FLAGS_MASK 0xF0000000 enum drm_via_irqs { drm_via_irq_hqv0 = 0, drm_via_irq_hqv1, drm_via_irq_dma0_dd, drm_via_irq_dma0_td, drm_via_irq_dma1_dd, drm_via_irq_dma1_td, drm_via_irq_num }; struct drm_via_wait_irq_request { unsigned irq; via_irq_seq_type_t type; __u32 sequence; __u32 signal; }; typedef union drm_via_irqwait { struct drm_via_wait_irq_request request; struct drm_wait_vblank_reply reply; } drm_via_irqwait_t; typedef struct drm_via_blitsync { __u32 sync_handle; unsigned engine; } drm_via_blitsync_t; /* - * Below,"flags" is currently unused but will be used for possible future * extensions like kernel space bounce buffers for bad alignments and * blit engine busy-wait polling for better latency in the absence of * interrupts. */ typedef struct drm_via_dmablit { __u32 num_lines; __u32 line_length; __u32 fb_addr; __u32 fb_stride; unsigned char *mem_addr; __u32 mem_stride; __u32 flags; int to_fb; drm_via_blitsync_t sync; } drm_via_dmablit_t; /* Ioctl to query kernel params: */ #define VIA_PARAM_CHIPSET_ID 0 #define VIA_PARAM_REVISION_ID 1 struct drm_via_param { uint64_t param; uint64_t value; }; struct drm_via_gem_object { /** * Requested size for the object. * * The (page-aligned) allocated size for the object will be returned. */ uint64_t size; /* * Place the memory at the proper byte alignment. */ uint32_t alignment; /** * Format of data i.e tile pitch, for linear it is zero */ uint32_t pitch; /** * Give hints where to allocate this object. */ uint32_t domains; /** * chmod values applied to a buffer. */ uint32_t mode_t; /** * Offset to start of memory region. */ uint64_t offset; /** * Returned handle need to mmap the buffer. */ uint64_t map_handle; /** * Returned handle for the object. * * Object handles are nonzero. */ uint32_t handle; /** * Version to tell how to handle this data. */ uint32_t version; }; struct drm_via_gem_wait { /* the buffer object handle */ uint32_t handle; uint32_t no_wait; }; #endif /* _VIA_DRM_H_ */ xf86-video-openchrome-0.6.0/src/via_analog.c0000664000175000017500000003215713054665201015541 00000000000000/* * Copyright 2005-2016 The OpenChrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ /* * via_analog.c * * Handles the initialization and management of analog VGA related * resources. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "via_driver.h" #include /* * Enables or disables analog VGA output by controlling DAC * (Digital to Analog Converter) output state. */ static void viaAnalogOutput(ScrnInfoPtr pScrn, Bool outputState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaAnalogOutput.\n")); /* This register controls analog VGA DAC output state. */ /* 3X5.47[2] - DACOFF Backdoor Register * 0: DAC on * 1: DAC off */ ViaCrtcMask(hwp, 0x47, outputState ? 0x00 : 0x04, 0x04); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Analog VGA Output: %s\n", outputState ? "On" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaAnalogOutput.\n")); } /* * Specifies IGA1 or IGA2 for analog VGA DAC source. */ static void viaAnalogSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 value = displaySource; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaAnalogSetDisplaySource.\n")); ViaSeqMask(hwp, 0x16, value << 6, 0x40); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Analog VGA Display Output Source: IGA%d\n", (value & 0x01) + 1); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaAnalogSetDisplaySource.\n")); } /* * Intializes analog VGA related registers. */ static void viaAnalogInit(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaAnalogInit.\n")); /* 3X5.37[7] - DAC Power Save Control 1 * 0: Depend on Rx3X5.37[5:4] setting * 1: DAC always goes into power save mode * 3X5.37[6] - DAC Power Down Control * 0: Depend on Rx3X5.47[2] setting * 1: DAC never goes to power down mode * 3X5.37[5:4] - DAC Power Save Control 2 * 00: DAC never goes to power save mode * 01: DAC goes to power save mode by line * 10: DAC goes to power save mode by frame * 11: DAC goes to power save mode by line and frame * 3X5.37[3] - DAC PEDESTAL Control * 3X5.37[2:0] - DAC Factor * (Default: 100) */ ViaCrtcMask(hwp, 0x37, 0x04, 0xFF); switch (pVia->Chipset) { case VIA_CX700: case VIA_VX800: case VIA_VX855: case VIA_VX900: /* 3C5.5E[0] - CRT DACOFF Setting * 1: CRT DACOFF controlled by 3C5.01[5] */ ViaSeqMask(hwp, 0x5E, 0x01, 0x01); break; default: break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaAnalogInit.\n")); } /* * Sets the polarity of horizontal synchronization and vertical * synchronization. */ static void viaAnalogSetSyncPolarity(ScrnInfoPtr pScrn, DisplayModePtr mode) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 miscRegister; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaAnalogSetSyncPolarity.\n")); /* Set certain bits of miscellaneous output register * meant for IGA1. */ miscRegister = hwp->readMiscOut(hwp); if (mode->Flags & V_NHSYNC) { miscRegister |= 0x40; } else { miscRegister &= (~0x40); } if (mode->Flags & V_NVSYNC) { miscRegister |= 0x80; } else { miscRegister &= (~0x80); } hwp->writeMiscOut(hwp, miscRegister); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaAnalogSetSyncPolarity.\n")); } static void via_analog_create_resources(xf86OutputPtr output) { } static void via_analog_dpms(xf86OutputPtr output, int mode) { ScrnInfoPtr pScrn = output->scrn; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_analog_dpms.\n")); switch (mode) { case DPMSModeOn: viaAnalogOutput(pScrn, TRUE); break; case DPMSModeStandby: case DPMSModeSuspend: case DPMSModeOff: viaAnalogOutput(pScrn, FALSE); break; default: break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_analog_dpms.\n")); } static void via_analog_save(xf86OutputPtr output) { } static void via_analog_restore(xf86OutputPtr output) { } static int via_analog_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { ScrnInfoPtr pScrn = output->scrn; if (!ViaModeDotClockTranslate(pScrn, pMode)) return MODE_NOCLOCK; return MODE_OK; } static Bool via_analog_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { return TRUE; } static void via_analog_prepare(xf86OutputPtr output) { via_analog_dpms(output, DPMSModeOff); } static void via_analog_commit(xf86OutputPtr output) { via_analog_dpms(output, DPMSModeOn); } static void via_analog_mode_set(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { ScrnInfoPtr pScrn = output->scrn; drmmode_crtc_private_ptr iga = output->crtc->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_analog_mode_set.\n")); if (output->crtc) { viaAnalogInit(pScrn); viaAnalogSetSyncPolarity(pScrn, adjusted_mode); viaAnalogSetDisplaySource(pScrn, iga->index ? 0x01 : 0x00); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_analog_mode_set.\n")); } static xf86OutputStatus via_analog_detect(xf86OutputPtr output) { xf86OutputStatus status = XF86OutputStatusDisconnected; ScrnInfoPtr pScrn = output->scrn; VIAPtr pVia = VIAPTR(pScrn); xf86MonPtr mon; /* Probe I2C Bus 1 to see if a VGA monitor is connected. */ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Probing for a VGA monitor on I2C Bus 1.\n"); mon = xf86OutputGetEDID(output, pVia->pI2CBus1); if (mon && (!mon->features.input_type)) { xf86OutputSetEDID(output, mon); status = XF86OutputStatusConnected; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected a VGA monitor on I2C Bus 1.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Did not detect a VGA monitor on I2C Bus 1.\n"); /* Probe I2C Bus 2 to see if a VGA monitor is connected. */ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Probing for a VGA monitor on I2C Bus 2.\n"); mon = xf86OutputGetEDID(output, pVia->pI2CBus2); if (mon && (!mon->features.input_type)) { xf86OutputSetEDID(output, mon); status = XF86OutputStatusConnected; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected a VGA monitor on I2C Bus 2.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Did not detect a VGA monitor on I2C Bus 2.\n"); /* Perform manual detection of a VGA monitor since */ /* it was not detected via I2C buses. */ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Now perform manual detection of a VGA " "monitor.\n"); vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 SR01 = hwp->readSeq(hwp, 0x01); CARD8 SR40 = hwp->readSeq(hwp, 0x40); CARD8 CR36 = hwp->readCrtc(hwp, 0x36); /* We have to power on the display to detect it */ ViaSeqMask(hwp, 0x01, 0x00, 0x20); ViaCrtcMask(hwp, 0x36, 0x00, 0xF0); /* Wait for vblank */ usleep(16); /* Detect the load on pins */ ViaSeqMask(hwp, 0x40, 0x80, 0x80); if ((VIA_CX700 == pVia->Chipset) || (VIA_VX800 == pVia->Chipset) || (VIA_VX855 == pVia->Chipset) || (VIA_VX900 == pVia->Chipset)) ViaSeqMask(hwp, 0x40, 0x00, 0x80); if (ViaVgahwIn(hwp, 0x3C2) & 0x20) { status = XF86OutputStatusConnected; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected a VGA monitor using manual " "detection method.\n"); } if ((VIA_CX700 == pVia->Chipset) || (VIA_VX800 == pVia->Chipset) || (VIA_VX855 == pVia->Chipset) || (VIA_VX900 == pVia->Chipset)) ViaSeqMask(hwp, 0x40, 0x00, 0x80); /* Restore previous state */ hwp->writeSeq(hwp, 0x40, SR40); hwp->writeSeq(hwp, 0x01, SR01); hwp->writeCrtc(hwp, 0x36, CR36); } } return status; } #ifdef RANDR_12_INTERFACE static Bool via_analog_set_property(xf86OutputPtr output, Atom property, RRPropertyValuePtr value) { return TRUE; } #endif #ifdef RANDR_13_INTERFACE static Bool via_analog_get_property(xf86OutputPtr output, Atom property) { return FALSE; } #endif static void via_analog_destroy(xf86OutputPtr output) { } static const xf86OutputFuncsRec via_analog_funcs = { .create_resources = via_analog_create_resources, .dpms = via_analog_dpms, .save = via_analog_save, .restore = via_analog_restore, .mode_valid = via_analog_mode_valid, .mode_fixup = via_analog_mode_fixup, .prepare = via_analog_prepare, .commit = via_analog_commit, .mode_set = via_analog_mode_set, .detect = via_analog_detect, .get_modes = xf86OutputGetEDIDModes, #ifdef RANDR_12_INTERFACE .set_property = via_analog_set_property, #endif #ifdef RANDR_13_INTERFACE .get_property = via_analog_get_property, #endif .destroy = via_analog_destroy, }; void via_analog_init(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; xf86OutputPtr output = NULL; char outputNameBuffer[32]; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_analog_init.\n")); if (!pVia->pI2CBus1 || !pVia->pI2CBus2) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I2C Bus 1 or I2C Bus 2 does not exist.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_analog_init.\n")); return; } /* The code to dynamically designate the output name for * xrandr was borrowed from xf86-video-r128 DDX. */ sprintf(outputNameBuffer, "VGA-%d", (pVia->numberVGA + 1)); output = xf86OutputCreate(pScrn, &via_analog_funcs, outputNameBuffer); /* While there are two (2) display controllers registered with the * X.Org Server, it is often desirable to fix the analog VGA output * to IGA1 since LVDS FP (Flat Panel) typically prefers IGA2. (While * it is not used at this point, only IGA2 contains panel resolution * scaling functionality. IGA1 does not have this.) * With this arrangement, DVI should end up getting assigned to IGA2 * since DVI can go to either display controller without limitations. * This should be the case for TV as well. */ output->possible_crtcs = (1 << 0); output->possible_clones = 0; output->interlaceAllowed = TRUE; output->doubleScanAllowed = FALSE; pBIOSInfo->analog = output; /* Increment the number of analog VGA connectors. */ pVia->numberVGA++; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_analog_init.\n")); } xf86-video-openchrome-0.6.0/src/via_priv.h0000664000175000017500000001422113054665201015255 00000000000000/* * Copyright 2006-2015 The Openchrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifndef _VIA_PRIV_H_ #define _VIA_PRIV_H_ 1 #ifdef HAVE_DRI #include "via_drm.h" #endif #include "exa.h" /* * Alignment macro functions */ #define ALIGN_TO(f, alignment) (((f) + ((alignment)-1)) & ~((alignment)-1)) /* * FOURCC definitions */ #define FOURCC_XVMC (('C' << 24) + ('M' << 16) + ('V' << 8) + 'X') #define FOURCC_RV15 (('5' << 24) + ('1' << 16) + ('V' << 8) + 'R') #define FOURCC_RV16 (('6' << 24) + ('1' << 16) + ('V' << 8) + 'R') #define FOURCC_RV32 (('2' << 24) + ('3' << 16) + ('V' << 8) + 'R') /* * Structures for create surface */ typedef struct _SWDEVICE { unsigned char * lpSWOverlaySurface[2]; /* Max 2 Pointers to SW Overlay Surface*/ unsigned long dwSWPhysicalAddr[2]; /*Max 2 Physical address to SW Overlay Surface */ unsigned long dwSWCbPhysicalAddr[2]; /* Physical address to SW Cb Overlay Surface, for YV12 format use */ unsigned long dwSWCrPhysicalAddr[2]; /* Physical address to SW Cr Overlay Surface, for YV12 format use */ unsigned long dwHQVAddr[3]; /* Physical address to HQV surface -- CLE_C0 */ /*unsigned long dwHQVAddr[2];*/ /*Max 2 Physical address to SW HQV Overlay Surface*/ unsigned long dwWidth; /*SW Source Width, not changed*/ unsigned long dwHeight; /*SW Source Height, not changed*/ unsigned long dwPitch; /*SW frame buffer pitch*/ unsigned long gdwSWSrcWidth; /*SW Source Width, changed if window is out of screen*/ unsigned long gdwSWSrcHeight; /*SW Source Height, changed if window is out of screen*/ unsigned long gdwSWDstWidth; /*SW Destination Width*/ unsigned long gdwSWDstHeight; /*SW Destination Height*/ unsigned long gdwSWDstLeft; /*SW Position : Left*/ unsigned long gdwSWDstTop; /*SW Position : Top*/ unsigned long dwDeinterlaceMode; /*BOB / WEAVE*/ }SWDEVICE; typedef SWDEVICE * LPSWDEVICE; typedef struct _DDUPDATEOVERLAY { CARD32 SrcLeft; CARD32 SrcTop; CARD32 SrcRight; CARD32 SrcBottom; CARD32 DstLeft; CARD32 DstTop; CARD32 DstRight; CARD32 DstBottom; unsigned long dwFlags; /* flags */ unsigned long dwColorSpaceLowValue; } DDUPDATEOVERLAY; typedef DDUPDATEOVERLAY * LPDDUPDATEOVERLAY; /* Definition for dwFlags */ #define DDOVER_KEYDEST 1 #define DDOVER_INTERLEAVED 2 #define DDOVER_BOB 4 #define FOURCC_HQVSW 0x34565148 /*HQV4*/ typedef struct { CARD32 dwWidth; CARD32 dwHeight; CARD32 dwOffset; CARD32 dwUVoffset; CARD32 dwFlipTime; CARD32 dwFlipTag; CARD32 dwStartAddr; CARD32 dwV1OriWidth; CARD32 dwV1OriHeight; CARD32 dwV1OriPitch; CARD32 dwV1SrcWidth; CARD32 dwV1SrcHeight; CARD32 dwV1SrcLeft; CARD32 dwV1SrcRight; CARD32 dwV1SrcTop; CARD32 dwV1SrcBot; CARD32 dwSPWidth; CARD32 dwSPHeight; CARD32 dwSPLeft; CARD32 dwSPRight; CARD32 dwSPTop; CARD32 dwSPBot; CARD32 dwSPOffset; CARD32 dwSPstartAddr; CARD32 dwDisplayPictStruct; CARD32 dwDisplayBuffIndex; /* Display buffer Index. 0 to ( dwBufferNumber -1) */ CARD32 dwFetchAlignment; CARD32 dwSPPitch; unsigned long dwHQVAddr[3]; /* CLE_C0 */ /*unsigned long dwHQVAddr[2];*/ CARD32 dwMPEGDeinterlaceMode; /* default value : VIA_DEINTERLACE_WEAVE */ CARD32 dwMPEGProgressiveMode; /* default value : VIA_PROGRESSIVE */ CARD32 dwHQVheapInfo; /* video memory heap of the HQV buffer */ CARD32 dwVideoControl; /* video control flag */ CARD32 dwminifyH; /* Horizontal minify factor */ CARD32 dwminifyV; /* Vertical minify factor */ CARD32 dwMpegDecoded; } OVERLAYRECORD; #define MEM_BLOCKS 4 typedef struct { unsigned long gdwVideoFlagSW; unsigned long gdwVideoFlagMPEG; unsigned long gdwAlphaEnabled; /* For Alpha blending use*/ struct buffer_object *HQVMem; struct buffer_object *SWfbMem; CARD32 SrcFourCC; DDUPDATEOVERLAY UpdateOverlayBackup; /* For HQVcontrol func use // To save MPEG updateoverlay info.*/ /* device struct */ SWDEVICE SWDevice; OVERLAYRECORD overlayRecordV1; OVERLAYRECORD overlayRecordV3; Bool MPEG_ON; Bool SWVideo_ON; /*To solve the bandwidth issue */ unsigned long gdwUseExtendedFIFO; /* For panning mode use */ int panning_x; int panning_y; int oldPanningX; int oldPanningY; /* Maximum resolution with interpolation */ unsigned long maxWInterp; unsigned long maxHInterp; } swovRec, *swovPtr; #endif /* _VIA_PRIV_H_ */ xf86-video-openchrome-0.6.0/src/via_sii164.c0000664000175000017500000003543313054665201015317 00000000000000/* * Copyright 2016 Kevin Brace * Copyright 2016 The OpenChrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 2014 SHS SERVICES GmbH * Copyright 2006-2009 Luc Verhaegen. * * 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 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "via_driver.h" #include "via_sii164.h" static void viaSiI164DumpRegisters(ScrnInfoPtr pScrn, I2CDevPtr pDev) { int i; CARD8 tmp; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaSiI164DumpRegisters.\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SiI 164: dumping registers:\n")); for (i = 0; i <= 0x0f; i++) { xf86I2CReadByte(pDev, i, &tmp); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SiI 164: 0x%02x: 0x%02x\n", i, tmp)); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaSiI164DumpRegisters.\n")); } static void viaSiI164InitRegisters(ScrnInfoPtr pScrn, I2CDevPtr pDev) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaSiI164InitRegisters.\n")); xf86I2CWriteByte(pDev, 0x08, VIA_SII164_VEN | VIA_SII164_HEN | VIA_SII164_DSEL | VIA_SII164_EDGE | VIA_SII164_PDB); /* Route receiver detect bit (Offset 0x09[2]) as the output of * MSEN pin. */ xf86I2CWriteByte(pDev, 0x09, 0x20); xf86I2CWriteByte(pDev, 0x0A, 0x90); xf86I2CWriteByte(pDev, 0x0C, 0x89); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaSiI164InitRegisters.\n")); } /* * Returns TMDS receiver detection state for Silicon Image SiI 164 * external TMDS transmitter. */ static Bool viaSiI164Sense(ScrnInfoPtr pScrn, I2CDevPtr pDev) { CARD8 tmp; Bool receiverDetected = FALSE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaSiI164Sense.\n")); xf86I2CReadByte(pDev, 0x09, &tmp); if (tmp & 0x04) { receiverDetected = TRUE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SiI 164 %s a TMDS receiver.\n", receiverDetected ? "detected" : "did not detect"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaSiI164Sense.\n")); return receiverDetected; } static void viaSiI164Power(ScrnInfoPtr pScrn, I2CDevPtr pDev, Bool powerState) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaSiI164Power.\n")); xf86I2CMaskByte(pDev, 0x08, powerState ? 0x01 : 0x00, 0x01); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SiI 164 (DVI) Power: %s\n", powerState ? "On" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaSiI164Power.\n")); } static void viaSiI164SaveRegisters(ScrnInfoPtr pScrn, I2CDevPtr pDev, viaSiI164RecPtr pSiI164Rec) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaSiI164SaveRegisters.\n")); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Saving SiI 164 registers.\n"); xf86I2CReadByte(pDev, 0x08, &pSiI164Rec->Register08); xf86I2CReadByte(pDev, 0x09, &pSiI164Rec->Register09); xf86I2CReadByte(pDev, 0x0A, &pSiI164Rec->Register0A); xf86I2CReadByte(pDev, 0x0C, &pSiI164Rec->Register0C); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaSiI164SaveRegisters.\n")); } static void viaSiI164RestoreRegisters(ScrnInfoPtr pScrn, I2CDevPtr pDev, viaSiI164RecPtr pSiI164Rec) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaSiI164RestoreRegisters.\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Restoring SiI 164 registers.\n")); xf86I2CWriteByte(pDev, 0x08, pSiI164Rec->Register08); xf86I2CWriteByte(pDev, 0x09, pSiI164Rec->Register09); xf86I2CWriteByte(pDev, 0x0A, pSiI164Rec->Register0A); xf86I2CWriteByte(pDev, 0x0C, pSiI164Rec->Register0C); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaSiI164RestoreRegisters.\n")); } static int viaSiI164CheckModeValidity(xf86OutputPtr output, DisplayModePtr pMode) { ScrnInfoPtr pScrn = output->scrn; viaSiI164RecPtr pSiI164Rec = output->driver_private; int status = MODE_OK; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaSiI164CheckModeValidity.\n")); if (pMode->Clock < pSiI164Rec->DotclockMin) { status = MODE_CLOCK_LOW; goto exit; } if (pMode->Clock > pSiI164Rec->DotclockMax) { status = MODE_CLOCK_HIGH; } exit: DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaSiI164CheckModeValidity.\n")); return status; } static void via_sii164_create_resources(xf86OutputPtr output) { } static void via_sii164_dpms(xf86OutputPtr output, int mode) { ScrnInfoPtr pScrn = output->scrn; viaSiI164RecPtr pSiI164Rec = output->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_sii164_dpms.\n")); switch (mode) { case DPMSModeOn: viaSiI164Power(pScrn, pSiI164Rec->SiI164I2CDev, TRUE); break; case DPMSModeStandby: case DPMSModeSuspend: case DPMSModeOff: viaSiI164Power(pScrn, pSiI164Rec->SiI164I2CDev, FALSE); break; default: break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_sii164_dpms.\n")); } static void via_sii164_save(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; viaSiI164RecPtr pSiI164Rec = output->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_sii164_save.\n")); viaSiI164SaveRegisters(pScrn, pSiI164Rec->SiI164I2CDev, pSiI164Rec); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_sii164_save.\n")); } static void via_sii164_restore(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; viaSiI164RecPtr pSiI164Rec = output->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_sii164_restore.\n")); viaSiI164RestoreRegisters(pScrn, pSiI164Rec->SiI164I2CDev, pSiI164Rec); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_sii164_restore.\n")); } static int via_sii164_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { return viaSiI164CheckModeValidity(output, pMode); } static Bool via_sii164_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { return TRUE; } static void via_sii164_prepare(xf86OutputPtr output) { } static void via_sii164_commit(xf86OutputPtr output) { } static void via_sii164_mode_set(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { ScrnInfoPtr pScrn = output->scrn; drmmode_crtc_private_ptr iga = output->crtc->driver_private; viaSiI164RecPtr pSiI164Rec = output->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_sii164_mode_set.\n")); if (output->crtc) { viaExtTMDSSetClockDriveStrength(pScrn, 0x03); viaExtTMDSSetDataDriveStrength(pScrn, 0x03); viaExtTMDSEnableIOPads(pScrn, 0x03); viaSiI164DumpRegisters(pScrn, pSiI164Rec->SiI164I2CDev); viaSiI164InitRegisters(pScrn, pSiI164Rec->SiI164I2CDev); viaSiI164DumpRegisters(pScrn, pSiI164Rec->SiI164I2CDev); viaExtTMDSSetDisplaySource(pScrn, iga->index ? 0x01 : 0x00); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_sii164_mode_set.\n")); } static xf86OutputStatus via_sii164_detect(xf86OutputPtr output) { xf86MonPtr mon; xf86OutputStatus status = XF86OutputStatusDisconnected; ScrnInfoPtr pScrn = output->scrn; viaSiI164RecPtr pSiI164Rec = output->driver_private; /* Check for the DVI presence via SiI 164 first before accessing * I2C bus. */ if (viaSiI164Sense(pScrn, pSiI164Rec->SiI164I2CDev)) { /* Since DVI presence was established, access the I2C bus * assigned to DVI. */ mon = xf86OutputGetEDID(output, pSiI164Rec->SiI164I2CDev->pI2CBus); /* Is the interface type digital? */ if (mon && DIGITAL(mon->features.input_type)) { status = XF86OutputStatusConnected; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected a monitor connected to DVI.\n"); xf86OutputSetEDID(output, mon); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Could not obtain EDID from a monitor " "connected to DVI.\n"); } } return status; } #ifdef RANDR_12_INTERFACE static Bool via_sii164_set_property(xf86OutputPtr output, Atom property, RRPropertyValuePtr value) { return TRUE; } #endif #ifdef RANDR_13_INTERFACE static Bool via_sii164_get_property(xf86OutputPtr output, Atom property) { return FALSE; } #endif static void via_sii164_destroy(xf86OutputPtr output) { } const xf86OutputFuncsRec via_sii164_funcs = { .create_resources = via_sii164_create_resources, .dpms = via_sii164_dpms, .save = via_sii164_save, .restore = via_sii164_restore, .mode_valid = via_sii164_mode_valid, .mode_fixup = via_sii164_mode_fixup, .prepare = via_sii164_prepare, .commit = via_sii164_commit, .mode_set = via_sii164_mode_set, .detect = via_sii164_detect, .get_modes = xf86OutputGetEDIDModes, #ifdef RANDR_12_INTERFACE .set_property = via_sii164_set_property, #endif #ifdef RANDR_13_INTERFACE .get_property = via_sii164_get_property, #endif .destroy = via_sii164_destroy, }; Bool viaSiI164Init(ScrnInfoPtr pScrn, I2CBusPtr pI2CBus) { xf86OutputPtr output; VIAPtr pVia = VIAPTR(pScrn); viaSiI164RecPtr pSiI164Rec = NULL; I2CDevPtr pI2CDevice = NULL; I2CSlaveAddr i2cAddr = 0x70; CARD8 buf; CARD16 vendorID, deviceID; Bool status = FALSE; char outputNameBuffer[32]; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaSiI164Init.\n")); if (!xf86I2CProbeAddress(pI2CBus, i2cAddr)) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "I2C device not found.\n"); goto exit; } pI2CDevice = xf86CreateI2CDevRec(); if (!pI2CDevice) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to create an I2C bus device record.\n"); goto exit; } pI2CDevice->DevName = "SiI 164"; pI2CDevice->SlaveAddr = i2cAddr; pI2CDevice->pI2CBus = pI2CBus; if (!xf86I2CDevInit(pI2CDevice)) { xf86DestroyI2CDevRec(pI2CDevice, TRUE); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize a device on I2C bus.\n"); goto exit; } xf86I2CReadByte(pI2CDevice, 0, &buf); vendorID = buf; xf86I2CReadByte(pI2CDevice, 1, &buf); vendorID |= buf << 8; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Vendor ID: 0x%04x\n", vendorID)); xf86I2CReadByte(pI2CDevice, 2, &buf); deviceID = buf; xf86I2CReadByte(pI2CDevice, 3, &buf); deviceID |= buf << 8; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Device ID: 0x%04x\n", deviceID)); if ((vendorID != 0x0001) || (deviceID != 0x0006)) { xf86DestroyI2CDevRec(pI2CDevice, TRUE); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "SiI 164 external TMDS transmitter not detected.\n"); goto exit; } xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "SiI 164 external TMDS transmitter detected.\n"); pSiI164Rec = xnfcalloc(1, sizeof(viaSiI164Rec)); if (!pSiI164Rec) { xf86DestroyI2CDevRec(pI2CDevice, TRUE); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate working storage for SiI 164.\n"); goto exit; } // Remembering which I2C bus is used for SiI 164. pSiI164Rec->SiI164I2CDev = pI2CDevice; xf86I2CReadByte(pI2CDevice, 0x06, &buf); pSiI164Rec->DotclockMin = buf * 1000; xf86I2CReadByte(pI2CDevice, 0x07, &buf); pSiI164Rec->DotclockMax = (buf + 65) * 1000; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Supported SiI 164 Dot Clock Range: " "%d to %d MHz\n", pSiI164Rec->DotclockMin / 1000, pSiI164Rec->DotclockMax / 1000); /* The code to dynamically designate the particular DVI (i.e., DVI-1, * DVI-2, etc.) for xrandr was borrowed from xf86-video-r128 DDX. */ sprintf(outputNameBuffer, "DVI-%d", (pVia->numberDVI + 1)); output = xf86OutputCreate(pScrn, &via_sii164_funcs, outputNameBuffer); if (!output) { free(pSiI164Rec); xf86DestroyI2CDevRec(pI2CDevice, TRUE); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate X Server display output record for " "SiI 164.\n"); goto exit; } output->driver_private = pSiI164Rec; /* Since there are two (2) display controllers registered with the * X.Org Server and both IGA1 and IGA2 can handle DVI without any * limitations, possible_crtcs should be set to 0x3 (0b11) so that * either display controller can get assigned to handle DVI. */ output->possible_crtcs = (1 << 1) | (1 << 0); output->possible_clones = 0; output->interlaceAllowed = FALSE; output->doubleScanAllowed = FALSE; viaSiI164DumpRegisters(pScrn, pI2CDevice); pVia->numberDVI++; status = TRUE; exit: DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaSiI164Init.\n")); return status; } xf86-video-openchrome-0.6.0/src/via_xv.h0000664000175000017500000001072412760724526014747 00000000000000/* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifndef _VIA_VIDEO_H_ #define _VIA_VIDEO_H_ 1 /* * I N C L U D E S */ /*#define XV_DEBUG 1 write log msg to /var/log/XFree86.0.log */ #define COLOR_KEY 1 /* set color key value from driver layer */ #define HW_3123 /* Definition for VideoStatus */ #define VIDEO_NULL 0x00000000 #define VIDEO_SWOV_SURFACE_CREATED 0x00000001 #define VIDEO_SWOV_ON 0x00000002 #define SINGLE_3205_100 0.41 #define SINGLE_3205_133 0.70 #define VIDEO_BPP 2 #define V1_COMMAND_FIRE 0x80000000 /* V1 commands fire */ #define V3_COMMAND_FIRE 0x40000000 /* V3 commands fire */ typedef struct { CARD32 interruptflag; /* 200 */ CARD32 ramtab; /* 204 */ CARD32 alphawin_hvstart; /* 208 */ CARD32 alphawin_size; /* 20c */ CARD32 alphawin_ctl; /* 210 */ CARD32 crt_startaddr; /* 214 */ CARD32 crt_startaddr_2; /* 218 */ CARD32 alphafb_stride; /* 21c */ CARD32 color_key; /* 220 */ CARD32 alphafb_addr; /* 224 */ CARD32 chroma_low; /* 228 */ CARD32 chroma_up; /* 22c */ CARD32 video1_ctl; /* 230 */ CARD32 video1_fetch; /* 234 */ CARD32 video1y_addr1; /* 238 */ CARD32 video1_stride; /* 23c */ CARD32 video1_hvstart; /* 240 */ CARD32 video1_size; /* 244 */ CARD32 video1y_addr2; /* 248 */ CARD32 video1_zoom; /* 24c */ CARD32 video1_mictl; /* 250 */ CARD32 video1y_addr0; /* 254 */ CARD32 video1_fifo; /* 258 */ CARD32 video1y_addr3; /* 25c */ CARD32 hi_control; /* 260 */ CARD32 snd_color_key; /* 264 */ CARD32 v3alpha_prefifo; /* 268 */ CARD32 v1_source_w_h; /* 26c */ CARD32 hi_transparent_color; /* 270 */ CARD32 v_display_temp; /* 274 :No use */ CARD32 v3alpha_fifo; /* 278 */ CARD32 v3_source_width; /* 27c */ CARD32 dummy1; /* 280 */ CARD32 video1_CSC1; /* 284 */ CARD32 video1_CSC2; /* 288 */ CARD32 video1u_addr0; /* 28c */ CARD32 video1_opqctl; /* 290 */ CARD32 video3_opqctl; /* 294 */ CARD32 compose; /* 298 */ CARD32 dummy2; /* 29c */ CARD32 video3_ctl; /* 2a0 */ CARD32 video3_addr0; /* 2a4 */ CARD32 video3_addr1; /* 2a8 */ CARD32 video3_stride; /* 2ac */ CARD32 video3_hvstart; /* 2b0 */ CARD32 video3_size; /* 2b4 */ CARD32 v3alpha_fetch; /* 2b8 */ CARD32 video3_zoom; /* 2bc */ CARD32 video3_mictl; /* 2c0 */ CARD32 video3_CSC1; /* 2c4 */ CARD32 video3_CSC2; /* 2c8 */ CARD32 v3_display_temp; /* 2cc */ CARD32 reserved[5]; /* 2d0 */ CARD32 video1u_addr1; /* 2e4 */ CARD32 video1u_addr2; /* 2e8 */ CARD32 video1u_addr3; /* 2ec */ CARD32 video1v_addr0; /* 2f0 */ CARD32 video1v_addr1; /* 2f4 */ CARD32 video1v_addr2; /* 2f8 */ CARD32 video1v_addr3; /* 2fc */ } video_via_regs; #define vmmtr volatile video_via_regs * #endif /* _VIA_VIDEO_H_ */ xf86-video-openchrome-0.6.0/src/via_eng_regs.h0000664000175000017500000007347712760724526016121 00000000000000/* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifndef _VIA_ENG_REGS_H_ #define _VIA_H_ 1 #include #include #include #include #include #include /* Video status flag */ #define VIDEO_HIDE 0x00000000 /*Video off*/ #define VIDEO_SHOW 0x80000000 /*Video on*/ #define VIDEO_ACTIVE 0x10000000 /*Video active*/ #define VIDEO_MPEG_INUSE 0x08000000 /*Video is used with MPEG */ #define VIDEO_HQV_INUSE 0x04000000 /*Video is used with HQV*/ #define VIDEO_CAPTURE0_INUSE 0x02000000 /*Video is used with CAPTURE 0*/ #define VIDEO_CAPTURE1_INUSE 0x00000000 /*Video is used with CAPTURE 1*/ #define VIDEO_1_INUSE 0x01000000 /*Video 1 is used with software flip*/ #define VIDEO_3_INUSE 0x00000000 /*Video 3 is used with software flip*/ #define VIDEO_ON 0x00100000 #define MPEG_USE_V1 0x00010000 /*[16] : 1:MPEG use V1, 0:MPEG use V3*/ #define MPEG_USE_V3 0x00000000 /*[16] : 1:MPEG use V1, 0:MPEG use V3*/ #define MPEG_USE_HQV 0x00020000 /*[17] : 1:MPEG use HQV,0:MPEG not use HQV*/ #define MPEG_USE_HW_FLIP 0x00040000 /*[18] : 1:MPEG use H/W flip,0:MPEG use S/W flip*/ #define MPEG_USE_SW_FLIP 0x00000000 /*[18] : 1:MPEG use H/W flip,0:MPEG use S/W flip*/ #define CAP0_USE_V1 0x00001000 /*[12] : 1:Capture 0 use V1, 0:Capture 0 use V3*/ #define CAP0_USE_V3 0x00000000 /*[12] : 1:Capture 0 use V1, 0:Capture 0 use V3*/ #define CAP0_USE_HQV 0x00002000 /*[13] : 1:Capture 0 use HQV,0:Capture 0 not use HQV*/ #define CAP0_USE_HW_FLIP 0x00004000 /*[14] : 1:Capture 0 use H/W flip,0:Capture 0 use S/W flip*/ #define CAP0_USE_CCIR656 0x00008000 /*[15] : 1:Capture 0 use CCIR656,0:Capture 0 CCIR601*/ #define CAP1_USE_V1 0x00000100 /*[ 8] : 1:Capture 1 use V1, 0:Capture 1 use V3*/ #define CAP1_USE_V3 0x00000000 /*[ 8] : 1:Capture 1 use V1, 0:Capture 1 use V3*/ #define CAP1_USE_HQV 0x00000200 /*[ 9] : 1:Capture 1 use HQV,0:Capture 1 not use HQV*/ #define CAP1_USE_HW_FLIP 0x00000400 /*[10] : 1:Capture 1 use H/W flip,0:Capture 1 use S/W flip */ #define SW_USE_V1 0x00000010 /*[ 4] : 1:Capture 1 use V1, 0:Capture 1 use V3 */ #define SW_USE_V3 0x00000000 /*[ 4] : 1:Capture 1 use V1, 0:Capture 1 use V3 */ #define SW_USE_HQV 0x00000020 /*[ 5] : 1:Capture 1 use HQV,0:Capture 1 not use HQV */ /* #define VIDEO1_INUSE 0x00000010 //[ 4] : 1:Video 1 is used with S/W flip #define VIDEO1_USE_HQV 0x00000020 //[ 5] : 1:Video 1 use HQV with S/W flip #define VIDEO3_INUSE 0x00000001 //[ 0] : 1:Video 3 is used with S/W flip #define VIDEO3_USE_HQV 0x00000002 //[ 1] : 1:Video 3 use HQV with S/W flip */ /* H/W registers for Video Engine */ /* * bus master */ #define PCI_MASTER_ENABLE 0x01 #define PCI_MASTER_SCATTER 0x00 #define PCI_MASTER_SINGLE 0x02 #define PCI_MASTER_GUI 0x00 #define PCI_MASTER_VIDEO 0x04 #define PCI_MASTER_INPUT 0x00 #define PCI_MASTER_OUTPUT 0x08 /* * video registers */ #define V_FLAGS 0x200 #define V_CAP_STATUS 0x204 #define V_FLIP_STATUS 0x204 #define V_ALPHA_WIN_START 0x208 #define V_ALPHA_WIN_END 0x20C #define V_ALPHA_CONTROL 0x210 #define V_CRT_STARTADDR 0x214 #define V_CRT_STARTADDR_2 0x218 #define V_ALPHA_STRIDE 0x21C #define V_COLOR_KEY 0x220 #define V_ALPHA_STARTADDR 0x224 #define V_CHROMAKEY_LOW 0x228 #define V_CHROMAKEY_HIGH 0x22C #define V1_CONTROL 0x230 #define V12_QWORD_PER_LINE 0x234 #define V1_STARTADDR_1 0x238 #define V1_STARTADDR_Y1 V1_STARTADDR_1 #define V1_STRIDE 0x23C #define V1_WIN_START_Y 0x240 #define V1_WIN_START_X 0x242 #define V1_WIN_END_Y 0x244 #define V1_WIN_END_X 0x246 #define V1_STARTADDR_2 0x248 #define V1_STARTADDR_Y2 V1_STARTADDR_2 #define V1_ZOOM_CONTROL 0x24C #define V1_MINI_CONTROL 0x250 #define V1_STARTADDR_0 0x254 #define V1_STARTADDR_Y0 V1_STARTADDR_0 #define V_FIFO_CONTROL 0x258 #define V1_STARTADDR_3 0x25C #define V1_STARTADDR_Y3 V1_STARTADDR_3 #define HI_CONTROL 0x260 #define SND_COLOR_KEY 0x264 #define ALPHA_V3_PREFIFO_CONTROL 0x268 #define V1_SOURCE_HEIGHT 0x26C #define HI_TRANSPARENT_COLOR 0x270 #define V_DISPLAY_TEMP 0x274 /* No use */ #define ALPHA_V3_FIFO_CONTROL 0x278 #define V3_SOURCE_WIDTH 0x27C #define V3_COLOR_KEY 0x280 #define V1_ColorSpaceReg_1 0x284 #define V1_ColorSpaceReg_2 0x288 #define V1_STARTADDR_CB0 0x28C #define V1_OPAQUE_CONTROL 0x290 /* To be deleted */ #define V3_OPAQUE_CONTROL 0x294 /* To be deleted */ #define V_COMPOSE_MODE 0x298 #define V3_STARTADDR_2 0x29C #define V3_CONTROL 0x2A0 #define V3_STARTADDR_0 0x2A4 #define V3_STARTADDR_1 0x2A8 #define V3_STRIDE 0x2AC #define V3_WIN_START_Y 0x2B0 #define V3_WIN_START_X 0x2B2 #define V3_WIN_END_Y 0x2B4 #define V3_WIN_END_X 0x2B6 #define V3_ALPHA_QWORD_PER_LINE 0x2B8 #define V3_ZOOM_CONTROL 0x2BC #define V3_MINI_CONTROL 0x2C0 #define V3_ColorSpaceReg_1 0x2C4 #define V3_ColorSpaceReg_2 0x2C8 #define V3_DISPLAY_TEMP 0x2CC /* No use */ #define V1_STARTADDR_CB1 0x2E4 #define V1_STARTADDR_CB2 0x2E8 #define V1_STARTADDR_CB3 0x2EC #define V1_STARTADDR_CR0 0x2F0 #define V1_STARTADDR_CR1 0x2F4 #define V1_STARTADDR_CR2 0x2F8 #define V1_STARTADDR_CR3 0x2FC /*CN400 and older Hardware Icon engine register*/ #define HI_POSSTART 0x208 #define HI_CENTEROFFSET 0x20C #define HI_FBOFFSET 0x224 #define HI_CONTROL 0x260 #define HI_TRANSPARENT_COLOR 0x270 #define HI_INVTCOLOR 0x274 /* VT3324 primary Hardware Icon engine register */ #define PRIM_HI_POSEND 0x290 #define V327_HI_INVTCOLOR 0x2E4 #define PRIM_HI_FIFO 0x2E8 #define PRIM_HI_TRANSCOLOR 0x2EC #define PRIM_HI_CTRL 0x2F0 #define PRIM_HI_FBOFFSET 0x2F4 #define PRIM_HI_POSSTART 0x2F8 #define PRIM_HI_CENTEROFFSET 0x2FC #define PRIM_HI_INVTCOLOR 0x120C /* Video Capture Engine Registers * Capture Port 1 */ #define CAP0_MASKS 0x100 #define CAP1_MASKS 0x104 #define CAP0_CONTROL 0x110 #define CAP0_H_RANGE 0x114 #define CAP0_V_RANGE 0x118 #define CAP0_SCAL_CONTROL 0x11C #define CAP0_VBI_H_RANGE 0x120 #define CAP0_VBI_V_RANGE 0x124 #define CAP0_VBI_STARTADDR 0x128 #define CAP0_VBI_STRIDE 0x12C #define CAP0_ANCIL_COUNT 0x130 #define CAP0_MAXCOUNT 0x134 #define CAP0_VBIMAX_COUNT 0x138 #define CAP0_DATA_COUNT 0x13C #define CAP0_FB_STARTADDR0 0x140 #define CAP0_FB_STARTADDR1 0x144 #define CAP0_FB_STARTADDR2 0x148 #define CAP0_STRIDE 0x150 /* Capture Port 2 */ #define CAP1_CONTROL 0x154 #define CAP1_SCAL_CONTROL 0x160 #define CAP1_VBI_H_RANGE 0x164 /*To be deleted*/ #define CAP1_VBI_V_RANGE 0x168 /*To be deleted*/ #define CAP1_VBI_STARTADDR 0x16C /*To be deleted*/ #define CAP1_VBI_STRIDE 0x170 /*To be deleted*/ #define CAP1_ANCIL_COUNT 0x174 /*To be deleted*/ #define CAP1_MAXCOUNT 0x178 #define CAP1_VBIMAX_COUNT 0x17C /*To be deleted*/ #define CAP1_DATA_COUNT 0x180 #define CAP1_FB_STARTADDR0 0x184 #define CAP1_FB_STARTADDR1 0x188 #define CAP1_STRIDE 0x18C /* SUBPICTURE Registers */ #define SUBP_CONTROL_STRIDE 0x3C0 #define SUBP_STARTADDR 0x3C4 #define RAM_TABLE_CONTROL 0x3C8 #define RAM_TABLE_READ 0x3CC /* HQV Registers*/ #define HQV_CONTROL 0x3D0 #define HQV_SRC_STARTADDR_Y 0x3D4 #define HQV_SRC_STARTADDR_U 0x3D8 #define HQV_SRC_STARTADDR_V 0x3DC #define HQV_SRC_FETCH_LINE 0x3E0 #define HQV_FILTER_CONTROL 0x3E4 #define HQV_MINIFY_CONTROL 0x3E8 #define HQV_DST_STARTADDR0 0x3EC #define HQV_DST_STARTADDR1 0x3F0 #define HQV_DST_STARTADDR2 0x3FC #define HQV_DST_STRIDE 0x3F4 #define HQV_SRC_STRIDE 0x3F8 #define HQV_H_SCALE_CONTROL 0x3B0 #define HQV_V_SCALE_CONTROL 0x3B4 #define PRO_HQV1_OFFSET 0x1000 /* * Video command definition */ /* #define V_ALPHA_CONTROL 0x210 */ #define ALPHA_WIN_EXPIRENUMBER_4 0x00040000 #define ALPHA_WIN_CONSTANT_FACTOR_4 0x00004000 #define ALPHA_WIN_CONSTANT_FACTOR_12 0x0000c000 #define ALPHA_WIN_BLENDING_CONSTANT 0x00000000 #define ALPHA_WIN_BLENDING_ALPHA 0x00000001 #define ALPHA_WIN_BLENDING_GRAPHIC 0x00000002 #define ALPHA_WIN_PREFIFO_THRESHOLD_12 0x000c0000 #define ALPHA_WIN_FIFO_THRESHOLD_8 0x000c0000 #define ALPHA_WIN_FIFO_DEPTH_16 0x00100000 /* V_CHROMAKEY_LOW 0x228 */ #define V_CHROMAKEY_V3 0x80000000 /* V1_CONTROL 0x230 */ #define V1_ENABLE 0x00000001 #define V1_FULL_SCREEN 0x00000002 #define V1_YUV422 0x00000000 #define V1_RGB32 0x00000004 #define V1_RGB15 0x00000008 #define V1_RGB16 0x0000000C #define V1_YCbCr420 0x00000010 #define V1_COLORSPACE_SIGN 0x00000080 #define V1_SRC_IS_FIELD_PIC 0x00000200 #define V1_SRC_IS_FRAME_PIC 0x00000000 #define V1_BOB_ENABLE 0x00400000 #define V1_FIELD_BASE 0x00000000 #define V1_FRAME_BASE 0x01000000 #define V1_SWAP_SW 0x00000000 #define V1_SWAP_HW_HQV 0x02000000 #define V1_SWAP_HW_CAPTURE 0x04000000 #define V1_SWAP_HW_MC 0x06000000 /* #define V1_DOUBLE_BUFFERS 0x00000000 */ /* #define V1_QUADRUPLE_BUFFERS 0x18000000 */ #define V1_EXPIRE_NUM 0x00050000 #define V1_EXPIRE_NUM_A 0x000a0000 #define V1_EXPIRE_NUM_F 0x000f0000 /* jason */ #define V1_FIFO_EXTENDED 0x00200000 #define V1_ON_PRI 0x00000000 #define V1_ON_SND_DISPLAY 0x80000000 #define V1_FIFO_32V1_32V2 0x00000000 #define V1_FIFO_48V1_32V2 0x00200000 #define V1_PREFETCH_ON_3336 0x40000000 /*V1_PREFETCH_ON*/ #define V1_GAMMA_ENABLE_3336 0x20000000 /*V1_Gamma_ENABLE*/ /* V12_QWORD_PER_LINE 0x234 */ #define V1_FETCH_COUNT 0x3ff00000 #define V1_FETCHCOUNT_ALIGNMENT 0x0000000f #define V1_FETCHCOUNT_UNIT 0x00000004 /* Doubld QWORD */ /* V1_STRIDE */ #define V1_STRIDE_YMASK 0x00001fff #define V1_STRIDE_UVMASK 0x1ff00000 /* V1_ZOOM_CONTROL 0x24C */ #define V1_X_ZOOM_ENABLE 0x80000000 #define V1_Y_ZOOM_ENABLE 0x00008000 /* V1_MINI_CONTROL 0x250 */ #define V1_X_INTERPOLY 0x00000002 /* X interpolation */ #define V1_Y_INTERPOLY 0x00000001 /* Y interpolation */ #define V1_YCBCR_INTERPOLY 0x00000004 /* Y, Cb, Cr all interpolation */ #define V1_X_DIV_2 0x01000000 #define V1_X_DIV_4 0x03000000 #define V1_X_DIV_8 0x05000000 #define V1_X_DIV_16 0x07000000 #define V1_Y_DIV_2 0x00010000 #define V1_Y_DIV_4 0x00030000 #define V1_Y_DIV_8 0x00050000 #define V1_Y_DIV_16 0x00070000 /* V1_STARTADDR0 0x254 */ #define SW_FLIP_ODD 0x08000000 /* V_FIFO_CONTROL 0x258 * IA2 has 32 level FIFO for packet mode video format * 32 level FIFO for planar mode video YV12. with extension reg 230 bit 21 enable * 16 level FIFO for planar mode video YV12. with extension reg 230 bit 21 disable * BCos of 128 bits. 1 level in IA2 = 2 level in VT3122 */ #define V1_FIFO_DEPTH12 0x0000000B #define V1_FIFO_DEPTH16 0x0000000F #define V1_FIFO_DEPTH32 0x0000001F #define V1_FIFO_DEPTH48 0x0000002F #define V1_FIFO_DEPTH64 0x0000003F #define V1_FIFO_THRESHOLD6 0x00000600 #define V1_FIFO_THRESHOLD8 0x00000800 #define V1_FIFO_THRESHOLD12 0x00000C00 #define V1_FIFO_THRESHOLD16 0x00001000 #define V1_FIFO_THRESHOLD24 0x00001800 #define V1_FIFO_THRESHOLD32 0x00002000 #define V1_FIFO_THRESHOLD40 0x00002800 #define V1_FIFO_THRESHOLD48 0x00003000 #define V1_FIFO_THRESHOLD56 0x00003800 #define V1_FIFO_THRESHOLD61 0x00003D00 #define V1_FIFO_PRETHRESHOLD10 0x0A000000 #define V1_FIFO_PRETHRESHOLD12 0x0C000000 #define V1_FIFO_PRETHRESHOLD29 0x1d000000 #define V1_FIFO_PRETHRESHOLD40 0x28000000 #define V1_FIFO_PRETHRESHOLD44 0x2c000000 #define V1_FIFO_PRETHRESHOLD56 0x38000000 #define V1_FIFO_PRETHRESHOLD61 0x3D000000 #define VIDEO_FIFO_DEPTH_VT3336 225 #define VIDEO_FIFO_THRESHOLD_VT3336 200 #define VIDEO_FIFO_PRETHRESHOLD_VT3336 250 #define VIDEO_EXPIRE_NUM_VT3336 31 /* Those values are only valid for IGA1 */ #define VIDEO_FIFO_DEPTH_VT3409 400 #define VIDEO_FIFO_THRESHOLD_VT3409 320 #define VIDEO_FIFO_PRETHRESHOLD_VT3409 230 #define VIDEO_EXPIRE_NUM_VT3409 160 /* ALPHA_V3_FIFO_CONTROL 0x278 * IA2 has 32 level FIFO for packet mode video format * 32 level FIFO for planar mode video YV12. with extension reg 230 bit 21 enable * 16 level FIFO for planar mode video YV12. with extension reg 230 bit 21 disable * 8 level FIFO for ALPHA * BCos of 128 bits. 1 level in IA2 = 2 level in VT3122 */ #define V3_FIFO_DEPTH16 0x0000000F #define V3_FIFO_DEPTH24 0x00000017 #define V3_FIFO_DEPTH32 0x0000001F #define V3_FIFO_DEPTH48 0x0000002F #define V3_FIFO_DEPTH64 0x0000003F #define V3_FIFO_THRESHOLD8 0x00000800 #define V3_FIFO_THRESHOLD12 0x00000C00 #define V3_FIFO_THRESHOLD16 0x00001000 #define V3_FIFO_THRESHOLD24 0x00001800 #define V3_FIFO_THRESHOLD29 0x00001D00 #define V3_FIFO_THRESHOLD32 0x00002000 #define V3_FIFO_THRESHOLD40 0x00002800 #define V3_FIFO_THRESHOLD48 0x00003000 #define V3_FIFO_THRESHOLD56 0x00003800 #define V3_FIFO_THRESHOLD61 0x00003D00 #define V3_FIFO_PRETHRESHOLD10 0x0000000A #define V3_FIFO_PRETHRESHOLD12 0x0000000C #define V3_FIFO_PRETHRESHOLD29 0x0000001d #define V3_FIFO_PRETHRESHOLD40 0x00000028 #define V3_FIFO_PRETHRESHOLD44 0x0000002c #define V3_FIFO_PRETHRESHOLD56 0x00000038 #define V3_FIFO_PRETHRESHOLD61 0x0000003D #define V3_FIFO_MASK 0x0000007F #define V3_FIFO_MASK_3314 0x000000FF #define ALPHA_FIFO_DEPTH8 0x00070000 #define ALPHA_FIFO_THRESHOLD4 0x04000000 #define ALPHA_FIFO_MASK 0xffff0000 #define ALPHA_FIFO_PRETHRESHOLD4 0x00040000 /* IA2 */ #define ColorSpaceValue_1 0x140020f2 #define ColorSpaceValue_2 0x0a0a2c00 #define ColorSpaceValue_1_3123C0 0x13000DED #define ColorSpaceValue_2_3123C0 0x13171000 #define ColorSpaceValue_1_32045 0x13000DED #define ColorSpaceValue_2_32045 0x13171000 /* For TV setting */ #define ColorSpaceValue_1TV 0x140020f2 #define ColorSpaceValue_2TV 0x0a0a2c00 /* V_COMPOSE_MODE 0x298 */ #define SELECT_VIDEO_IF_COLOR_KEY 0x00000001 /* select video if (color key),otherwise select graphics */ #define SELECT_VIDEO3_IF_COLOR_KEY 0x00000020 /* For 3123C0, select video3 if (color key),otherwise select graphics */ #define SELECT_VIDEO_IF_CHROMA_KEY 0x00000002 /* 0x0000000a //select video if (chroma key ),otherwise select graphics */ #define ALWAYS_SELECT_VIDEO 0x00000000 /* always select video,Chroma key and Color key disable */ #define COMPOSE_V1_V3 0x00000000 /* V1 on top of V3 */ #define COMPOSE_V3_V1 0x00100000 /* V3 on top of V1 */ #define COMPOSE_V1_TOP 0x00000000 #define COMPOSE_V3_TOP 0x00100000 #define V1_COMMAND_FIRE 0x80000000 /* V1 commands fire */ #define V3_COMMAND_FIRE 0x40000000 /* V3 commands fire */ #define V_COMMAND_LOAD 0x20000000 /* Video register always loaded */ #define V_COMMAND_LOAD_VBI 0x10000000 /* Video register always loaded at vbi without waiting source flip */ #define V3_COMMAND_LOAD 0x08000000 /* CLE_C0 Video3 register always loaded */ #define V3_COMMAND_LOAD_VBI 0x00000100 /* CLE_C0 Video3 register always loaded at vbi without waiting source flip */ #define SECOND_DISPLAY_COLOR_KEY_ENABLE 0x00010000 /* V3_ZOOM_CONTROL 0x2bc */ #define V3_X_ZOOM_ENABLE 0x80000000 #define V3_Y_ZOOM_ENABLE 0x00008000 /* V3_MINI_CONTROL 0x2c0 */ #define V3_X_INTERPOLY 0x00000002 /* X interpolation */ #define V3_Y_INTERPOLY 0x00000001 /* Y interpolation */ #define V3_YCBCR_INTERPOLY 0x00000004 /* Y, Cb, Cr all interpolation */ #define V3_X_DIV_2 0x01000000 #define V3_X_DIV_4 0x03000000 #define V3_X_DIV_8 0x05000000 #define V3_X_DIV_16 0x07000000 #define V3_Y_DIV_2 0x00010000 #define V3_Y_DIV_4 0x00030000 #define V3_Y_DIV_8 0x00050000 #define V3_Y_DIV_16 0x00070000 /* SUBP_CONTROL_STRIDE 0x3c0 */ #define SUBP_HQV_ENABLE 0x00010000 #define SUBP_IA44 0x00020000 #define SUBP_AI44 0x00000000 #define SUBP_STRIDE_MASK 0x00001fff #define SUBP_CONTROL_MASK 0x00070000 /* RAM_TABLE_CONTROL 0x3c8 */ #define RAM_TABLE_RGB_ENABLE 0x00000007 /* CAPTURE0_CONTROL 0x310 */ #define C0_ENABLE 0x00000001 #define BUFFER_2_MODE 0x00000000 #define BUFFER_3_MODE 0x00000004 #define BUFFER_4_MODE 0x00000006 #define SWAP_YUYV 0x00000000 #define SWAP_UYVY 0x00000100 #define SWAP_YVYU 0x00000200 #define SWAP_VYUY 0x00000300 #define IN_601_8 0x00000000 #define IN_656_8 0x00000010 #define IN_601_16 0x00000020 #define IN_656_16 0x00000030 #define DEINTER_ODD 0x00000000 #define DEINTER_EVEN 0x00001000 #define DEINTER_ODD_EVEN 0x00002000 #define DEINTER_FRAME 0x00003000 #define VIP_1 0x00000000 #define VIP_2 0x00000400 #define H_FILTER_2 0x00010000 #define H_FILTER_4 0x00020000 #define H_FILTER_8_1331 0x00030000 #define H_FILTER_8_12221 0x00040000 #define VIP_ENABLE 0x00000008 #define EN_FIELD_SIG 0x00000800 #define VREF_INVERT 0x00100000 #define FIELD_INPUT_INVERSE 0x00400000 #define FIELD_INVERSE 0x40000000 #define C1_H_MINI_EN 0x00000800 #define C0_H_MINI_EN 0x00000800 #define C1_V_MINI_EN 0x04000000 #define C0_V_MINI_EN 0x04000000 #define C1_H_MINI_2 0x00000400 /* CAPTURE1_CONTROL 0x354 */ #define C1_ENABLE 0x00000001 /* V3_CONTROL 0x2A0 */ #define V3_ENABLE 0x00000001 #define V3_FULL_SCREEN 0x00000002 #define V3_YUV422 0x00000000 #define V3_RGB32 0x00000004 #define V3_RGB15 0x00000008 #define V3_RGB16 0x0000000C #define V3_COLORSPACE_SIGN 0x00000080 #define V3_EXPIRE_NUM 0x00040000 #define V3_EXPIRE_NUM_F 0x000f0000 #define V3_EXPIRE_NUM_3204 0x00100000 #define V3_EXPIRE_NUM_3205 0x00080000 #define V3_BOB_ENABLE 0x00400000 #define V3_FIELD_BASE 0x00000000 #define V3_FRAME_BASE 0x01000000 #define V3_SWAP_SW 0x00000000 #define V3_SWAP_HW_HQV 0x02000000 #define V3_FLIP_HW_CAPTURE0 0x04000000 #define V3_FLIP_HW_CAPTURE1 0x06000000 /* V3_ALPHA_FETCH_COUNT 0x2B8 */ #define V3_FETCH_COUNT 0x3ff00000 #define ALPHA_FETCH_COUNT 0x000003ff /* HQV_CONTROL 0x3D0 */ #define HQV_RGB32 0x00000000 #define HQV_RGB16 0x20000000 #define HQV_RGB15 0x30000000 #define HQV_YUV422 0x80000000 #define HQV_YUV420 0xC0000000 #define HQV_ENABLE 0x08000000 #define HQV_SRC_SW 0x00000000 #define HQV_SRC_MC 0x01000000 #define HQV_SRC_CAPTURE0 0x02000000 #define HQV_SRC_CAPTURE1 0x03000000 #define HQV_FLIP_EVEN 0x00000000 #define HQV_FLIP_ODD 0x00000020 #define HQV_SW_FLIP 0x00000010 /* Write 1 to flip HQV buffer */ #define HQV_DEINTERLACE 0x00010000 /* First line of odd field will be repeated 3 times */ #define HQV_FIELD_2_FRAME 0x00020000 /* Src is field. Display each line 2 times */ #define HQV_FRAME_2_FIELD 0x00040000 /* Src is field. Display field */ #define HQV_FRAME_UV 0x00000000 /* Src is Non-interleaved */ #define HQV_FIELD_UV 0x00100000 /* Src is interleaved */ #define HQV_IDLE 0x00000008 #define HQV_FLIP_STATUS 0x00000001 #define HQV_DOUBLE_BUFF 0x00000000 #define HQV_TRIPLE_BUFF 0x04000000 #define HQV_SUBPIC_FLIP 0x00008000 #define HQV_FIFO_STATUS 0x00001000 #define HQV_GEN_IRQ 0x00000080 #define HQV_FIFO_DEPTH_1 0x00010000 /* for CME engine */ #define HQV_SW_FLIP_QUEUE_ENABLE 0x00100000 /* for hwDiff->dwNewScaleCtl */ #define HQV_H_SCALE_ENABLE 0x80000000 #define HQV_H_SCALE_UP 0x00000000 #define HQV_H_SCALE_DOWN_FOURTH_TO_1 0x10000000 #define HQV_H_SCALE_DOWN_FOURTH_TO_EIGHTH 0x20000000 #define HQV_H_SCALE_DOWN_UNDER_EIGHTH 0x30000000 #define HQV_V_SCALE_ENABLE 0x80000000 #define HQV_V_SCALE_UP 0x00000000 #define HQV_V_SCALE_DOWN 0x10000000 /* HQV Default Vodeo Color 0x3B8 */ #define HQV_FIX_COLOR 0x0643212c /* HQV_FILTER_CONTROL 0x3E4 */ #define HQV_H_LOWPASS_2TAP 0x00000001 #define HQV_H_LOWPASS_4TAP 0x00000002 #define HQV_H_LOWPASS_8TAP1 0x00000003 /* To be deleted */ #define HQV_H_LOWPASS_8TAP2 0x00000004 /* To be deleted */ #define HQV_H_HIGH_PASS 0x00000008 #define HQV_H_LOW_PASS 0x00000000 #define HQV_V_LOWPASS_2TAP 0x00010000 #define HQV_V_LOWPASS_4TAP 0x00020000 #define HQV_V_LOWPASS_8TAP1 0x00030000 #define HQV_V_LOWPASS_8TAP2 0x00040000 #define HQV_V_HIGH_PASS 0x00080000 #define HQV_V_LOW_PASS 0x00000000 #define HQV_H_HIPASS_F1_DEFAULT 0x00000040 #define HQV_H_HIPASS_F2_DEFAULT 0x00000000 #define HQV_V_HIPASS_F1_DEFAULT 0x00400000 #define HQV_V_HIPASS_F2_DEFAULT 0x00000000 #define HQV_H_HIPASS_F1_2TAP 0x00000050 #define HQV_H_HIPASS_F2_2TAP 0x00000100 #define HQV_V_HIPASS_F1_2TAP 0x00500000 #define HQV_V_HIPASS_F2_2TAP 0x01000000 #define HQV_H_HIPASS_F1_4TAP 0x00000060 #define HQV_H_HIPASS_F2_4TAP 0x00000200 #define HQV_V_HIPASS_F1_4TAP 0x00600000 #define HQV_V_HIPASS_F2_4TAP 0x02000000 #define HQV_H_HIPASS_F1_8TAP 0x00000080 #define HQV_H_HIPASS_F2_8TAP 0x00000400 #define HQV_V_HIPASS_F1_8TAP 0x00800000 #define HQV_V_HIPASS_F2_8TAP 0x04000000 /* IA2 NEW */ #define HQV_V_FILTER2 0x00080000 #define HQV_H_FILTER2 0x00000008 #define HQV_H_TAP2_11 0x00000041 #define HQV_H_TAP4_121 0x00000042 #define HQV_H_TAP4_1111 0x00000401 #define HQV_H_TAP8_1331 0x00000221 #define HQV_H_TAP8_12221 0x00000402 #define HQV_H_TAP16_1991 0x00000159 #define HQV_H_TAP16_141041 0x0000026A #define HQV_H_TAP32 0x0000015A #define HQV_V_TAP2_11 0x00410000 #define HQV_V_TAP4_121 0x00420000 #define HQV_V_TAP4_1111 0x04010000 #define HQV_V_TAP8_1331 0x02210000 #define HQV_V_TAP8_12221 0x04020000 #define HQV_V_TAP16_1991 0x01590000 #define HQV_V_TAP16_141041 0x026A0000 #define HQV_V_TAP32 0x015A0000 #define HQV_V_FILTER_DEFAULT 0x00420000 #define HQV_H_FILTER_DEFAULT 0x00000040 /* HQV_MINI_CONTROL 0x3E8 */ #define HQV_H_MINIFY_ENABLE 0x00000800 #define HQV_H_MINIFY_DOWN 0x00001000 #define HQV_V_MINIFY_ENABLE 0x08000000 #define HQV_V_MINIFY_DOWN 0x10000000 #define HQV_VDEBLOCK_FILTER 0x80000000 #define HQV_HDEBLOCK_FILTER 0x00008000 /* new added registers for VT3409.For some registers have different meanings * but the same address,we add postfix _409 to distinguish */ #define HQV_COLOR_ADJUSTMENT_PRE_CTRL1 0x360 #define HQV_COLOR_ADJUSTMENT_PRE_CTRL2 0x364 #define HQV_COLOR_ADJUSTMENT_PRE_CTRL3 0x368 #define HQV_COLOR_ADJUSTMENT_PRE_CTRL4 0x36C #define HQV_SRC_DATA_OFFSET_CTRL1_409 0x370 #define HQV_SRC_DATA_OFFSET_CTRL2_409 0x374 #define HQV_SRC_DATA_OFFSET_CTRL3_409 0x378 #define HQV_SRC_DATA_OFFSET_CTRL4_409 0x37C #define HQV_DST_DATA_OFFSET_CTRL1 0x380 #define HQV_DST_DATA_OFFSET_CTRL2 0x384 #define HQV_DST_DATA_OFFSET_CTRL3 0x388 #define HQV_DST_DATA_OFFSET_CTRL4 0x38C #define HQV_SHARPNESS_DECODER_HANDSHAKE_CTRL_410 0x3A4 #define HQV_RESIDUE_PIXEL_FRAME_STARTADDR 0x3BC #define HQV_BACKGROUND_DATA_OFFSET 0x3CC #define HQV_SUBP_HSCALE_CTRL 0x3E0 #define HQV_SUBP_VSCALE_CTRL 0x3E8 /* Add new HQV Registers for VT3353: */ #define HQV_SRC_DATA_OFFSET_CONTROL1 0x380 #define HQV_SRC_DATA_OFFSET_CONTROL2 0x384 #define HQV_SRC_DATA_OFFSET_CONTROL3 0x388 #define HQV_SRC_DATA_OFFSET_CONTROL4 0x38C #define HQV_HW_TUNING_PERFORMANCE 0x390 #define HQV_EXTENDED_CONTROL 0x394 #define HQV_STATIC_RECORD_FB_STARTADDR 0x398 #define HQV_STATIC_RECORD_FB_STRIDE 0x39C #define HQV_COLOR_ADJUSTMENT_CONTROL1 0x3A0 #define HQV_COLOR_ADJUSTMENT_CONTROL2 0x3A4 #define HQV_COLOR_ADJUSTMENT_CONTROL3 0x3A8 #define HQV_COLOR_ADJUSTMENT_CONTROL5 0x3AC #define HQV_DEFAULT_VIDEO_COLOR 0x3B8 #define CHROMA_KEY_LOW 0x00FFFFFF #define CHROMA_KEY_HIGH 0x00FFFFFF /* V_CAP_STATUS */ #define V_ST_UPDATE_NOT_YET 0x00000003 #define V1_ST_UPDATE_NOT_YET 0x00000001 #define V3_ST_UPDATE_NOT_YET 0x00000008 #define VBI_STATUS 0x00000002 /* * Macros for Video MMIO */ #ifndef V4L2 #define MPGOutD(port, data) *((volatile CARD32 *)(pVia->MpegMapBase +(port))) = (data) #define MPGInD(port) *((volatile CARD32 *)(pVia->MpegMapBase +(port))) #endif /* * Macros for GE MMIO */ #define GEInW(port) *((volatile CARD16 *)(lpGEMMIO + (port))) #define GEInD(port) *((volatile CARD32 *)(lpGEMMIO + (port))) #define GEOutW(port, data) *((volatile CARD16 *)(lpGEMMIO + (port))) = (data) #define GEOutD(port, data) *((volatile CARD32 *)(lpGEMMIO + (port))) = (data) /* * MPEG 1/2 Slice Engine (at 0xC00 relative to base) */ #define MPG_CONTROL 0x00 #define MPG_CONTROL_STRUCT 0x03 #define MPG_CONTROL_STRUCT_TOP 0x01 #define MPG_CONTROL_STRUCT_BOTTOM 0x02 #define MPG_CONTROL_STRUCT_FRAME 0x03 /* Use TOP if interlaced */ #define MPG_CONTROL_TYPE 0x3C #define MPG_CONTROL_TYPE_I (0x01 << 2) #define MPG_CONTROL_TYPE_B (0x02 << 2) #define MPG_CONTROL_TYPE_P (0x03 << 3) #define MPG_CONTROL_ALTSCAN 0x40 #define MPG_BLOCK 0x08 /* Unsure */ #define MPG_COMMAND 0x0C #define MPG_DATA1 0x10 #define MPG_DATA2 0x14 #define MPG_DATA3 0x18 #define MPG_DATA4 0x1C #define MPG_YPHYSICAL(x) (0x20 + 12*(x)) #define MPG_CbPHYSICAL(x) (0x24 + 12*(x)) #define MPG_CrPHYSICAL(x) (0x28 + 12*(x)) #define MPG_PITCH 0x50 #define MPG_STATUS 0x54 #define MPG_MATRIX_IDX 0x5C #define MPG_MATRIX_IDX_INTRA 0x00 #define MPG_MATRIX_IDX_NON 0x01 #define MPG_MATRIX_DATA 0x60 #define MPG_SLICE_CTRL_1 0x90 #define MPG_SLICE_MBAMAX 0x2FFF #define MPG_SLICE_PREDICTIVE_DCT 0x4000 #define MPG_SLICE_TOP_FIRST 0x8000 #define MPG_SLICE_MACROBLOCK_WIDTH(x) ((x)<<18) /* in 64's */ #define MPG_SLICE_CTRL_2 0x94 #define MPG_SLICE_CONCEAL_MVEC 0x0000001 #define MPG_SLICE_QSCALE_TYPE 0x0000002 #define MPG_SLICE_DCPRECISION 0x000000C #define MPG_SLICE_MACROBQUOT 0x0FFFFF0 #define MPG_SLICE_INTRAVLC 0x1000000 #define MPG_SLICE_CTRL_3 0x98 #define MPG_SLICE_FHMVR 0x0000003 #define MPG_SLICE_FVMVR 0x000000C #define MPG_SLICE_BHMVR 0x0000030 #define MPG_SLICE_BVMVR 0x00000C0 #define MPG_SLICE_SECOND_FIELD 0x0100000 #define MPG_SLICE_RESET 0x0400000 #define MPG_SLICE_LENGTH 0x9C #define MPG_SLICE_DATA 0xA0 #ifdef HAVE_PCIACCESS #define VIA_MEMBASE(p,n) (p)->regions[(n)].base_addr #define VENDOR_ID(p) (p)->vendor_id #define DEVICE_ID(p) (p)->device_id #define SUBVENDOR_ID(p) (p)->subvendor_id #define SUBSYS_ID(p) (p)->subdevice_id #define CHIP_REVISION(p) (p)->revision #else #define VIA_MEMBASE(p,n) (p)->memBase[n] #define VENDOR_ID(p) (p)->vendor #define DEVICE_ID(p) (p)->chipType #define SUBVENDOR_ID(p) (p)->subsysVendor #define SUBSYS_ID(p) (p)->subsysCard #define CHIP_REVISION(p) (p)->chipRev #endif #endif /* _VIA_ENG_REGS_H_ */ xf86-video-openchrome-0.6.0/src/Makefile.in0000664000175000017500000007426613057513447015360 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 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. 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@ @DRI_TRUE@am__append_1 = \ @DRI_TRUE@ via_dri.c \ @DRI_TRUE@ via_dri.h \ @DRI_TRUE@ via_drm.h \ @DRI_TRUE@ via_drmclient.h \ @DRI_TRUE@ via_kms.h \ @DRI_TRUE@ via_kms.c \ @DRI_TRUE@ via_xvmc.c \ @DRI_TRUE@ via_xvmc.h \ @DRI_TRUE@ drm_fourcc.h @DRI_FALSE@am__append_2 = \ @DRI_FALSE@ via_dri.c \ @DRI_FALSE@ via_dri.h \ @DRI_FALSE@ via_drm.h \ @DRI_FALSE@ via_drmclient.h \ @DRI_FALSE@ via_kms.h \ @DRI_FALSE@ via_kms.c \ @DRI_FALSE@ via_xvmc.c \ @DRI_FALSE@ via_xvmc.h \ @DRI_FALSE@ drm_fourcc.h subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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_VPATH_FILES = 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)$(openchrome_drv_ladir)" LTLIBRARIES = $(openchrome_drv_la_LTLIBRARIES) openchrome_drv_la_LIBADD = am__openchrome_drv_la_SOURCES_DIST = compat-api.h via_eng_regs.h \ via_3d.c via_3d.h via_3d_reg.h via_analog.c via_rop.h \ via_exa.c via_exa_h2.c via_exa_h6.c via_ums.h via_ch7xxx.c \ via_ch7xxx.h via_display.c via_dmabuffer.h via_driver.c \ via_driver.h via_i2c.c via_id.c via_fp.c via_memcpy.c \ via_memmgr.h via_memmgr.c via_outputs.c via_mode.h via_priv.h \ via_regs.h via_sii164.c via_sii164.h via_tmds.c via_tv.c \ via_xv_overlay.c via_xv_overlay.h via_ums.c via_vgahw.c \ via_vgahw.h via_xv.c via_xv.h via_vt162x.c via_vt162x.h \ via_vt1632.c via_vt1632.h via_xvpriv.h via_dri.c via_dri.h \ via_drm.h via_drmclient.h via_kms.h via_kms.c via_xvmc.c \ via_xvmc.h drm_fourcc.h @DRI_TRUE@am__objects_1 = via_dri.lo via_kms.lo via_xvmc.lo am_openchrome_drv_la_OBJECTS = via_3d.lo via_analog.lo via_exa.lo \ via_exa_h2.lo via_exa_h6.lo via_ch7xxx.lo via_display.lo \ via_driver.lo via_i2c.lo via_id.lo via_fp.lo via_memcpy.lo \ via_memmgr.lo via_outputs.lo via_sii164.lo via_tmds.lo \ via_tv.lo via_xv_overlay.lo via_ums.lo via_vgahw.lo via_xv.lo \ via_vt162x.lo via_vt1632.lo $(am__objects_1) openchrome_drv_la_OBJECTS = $(am_openchrome_drv_la_OBJECTS) openchrome_drv_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(openchrome_drv_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(openchrome_drv_la_SOURCES) DIST_SOURCES = $(am__openchrome_drv_la_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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_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@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ 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@ 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@ XVMC_CFLAGS = @XVMC_CFLAGS@ XVMC_LIBS = @XVMC_LIBS@ 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@ SUBDIRS = xvmc BUILT_SOURCES = version.h EXTRA_DIST = version.h $(am__append_2) CONFIG_CLEAN_FILES = version.h AM_CFLAGS = @XORG_CFLAGS@ @LIBUDEV_CFLAGS@ @DRI_CFLAGS@ openchrome_drv_la_LTLIBRARIES = openchrome_drv.la openchrome_drv_la_LDFLAGS = -module -avoid-version @LIBUDEV_LIBS@ openchrome_drv_ladir = @moduledir@/drivers openchrome_drv_la_SOURCES = compat-api.h via_eng_regs.h via_3d.c \ via_3d.h via_3d_reg.h via_analog.c via_rop.h via_exa.c \ via_exa_h2.c via_exa_h6.c via_ums.h via_ch7xxx.c via_ch7xxx.h \ via_display.c via_dmabuffer.h via_driver.c via_driver.h \ via_i2c.c via_id.c via_fp.c via_memcpy.c via_memmgr.h \ via_memmgr.c via_outputs.c via_mode.h via_priv.h via_regs.h \ via_sii164.c via_sii164.h via_tmds.c via_tv.c via_xv_overlay.c \ via_xv_overlay.h via_ums.c via_vgahw.c via_vgahw.h via_xv.c \ via_xv.h via_vt162x.c via_vt162x.h via_vt1632.c via_vt1632.h \ via_xvpriv.h $(am__append_1) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(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 src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/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): install-openchrome_drv_laLTLIBRARIES: $(openchrome_drv_la_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(openchrome_drv_ladir)" || $(MKDIR_P) "$(DESTDIR)$(openchrome_drv_ladir)" @list='$(openchrome_drv_la_LTLIBRARIES)'; test -n "$(openchrome_drv_ladir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(openchrome_drv_ladir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(openchrome_drv_ladir)"; \ } uninstall-openchrome_drv_laLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(openchrome_drv_la_LTLIBRARIES)'; test -n "$(openchrome_drv_ladir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(openchrome_drv_ladir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(openchrome_drv_ladir)/$$f"; \ done clean-openchrome_drv_laLTLIBRARIES: -test -z "$(openchrome_drv_la_LTLIBRARIES)" || rm -f $(openchrome_drv_la_LTLIBRARIES) @list='$(openchrome_drv_la_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done openchrome_drv.la: $(openchrome_drv_la_OBJECTS) $(openchrome_drv_la_DEPENDENCIES) $(EXTRA_openchrome_drv_la_DEPENDENCIES) $(openchrome_drv_la_LINK) -rpath $(openchrome_drv_ladir) $(openchrome_drv_la_OBJECTS) $(openchrome_drv_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_3d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_analog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_ch7xxx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_display.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_dri.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_exa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_exa_h2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_exa_h6.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_fp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_i2c.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_id.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_kms.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_memcpy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_memmgr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_outputs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_sii164.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_tmds.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_tv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_ums.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_vgahw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_vt162x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_vt1632.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_xv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_xv_overlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/via_xvmc.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(openchrome_drv_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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: 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool \ clean-openchrome_drv_laLTLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-openchrome_drv_laLTLIBRARIES install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-openchrome_drv_laLTLIBRARIES .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ ctags-recursive install install-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-openchrome_drv_laLTLIBRARIES ctags ctags-recursive \ dist-hook distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man \ install-openchrome_drv_laLTLIBRARIES install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-openchrome_drv_laLTLIBRARIES via_driver.lo: version.h version.h: $(openchrome_drv_la_SOURCES) @if [ -d ../.git ]; then \ echo '#define BUILDCOMMENT "(development build, branch' \ "`git branch -v | sed 's/no branch/no_branch/' | \ awk '/^\*/ { print $$2 }'`" \ 'at revision' \ "`git log -1 --pretty=format:%h | head -1`"')"' \ > $@.tmp; \ else \ if [ -d .svn ]; then \ echo '#define BUILDCOMMENT "(development build, at revision '\ "`svnversion -nc .. | sed -e s/^[^:]*://`"')"' > $@.tmp; \ elif [ "$$SOURCE_DATE_EPOCH" ]; then \ printf '#define BUILDCOMMENT "(compiled with SOURCE_DATE_EPOCH: %s)"' $$SOURCE_DATE_EPOCH \ > $@.tmp; \ else \ date +'#define BUILDCOMMENT "(development build, compiled on %c)"' \ > $@.tmp; \ fi; \ fi @chmod 666 $@.tmp @mv $@.tmp $@ @echo "created $@" dist-hook: @[ -e version.h ] && rm version.h; \ echo '#define BUILDCOMMENT "(openchrome '$(VERSION)' release)"' \ > version.h # 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-openchrome-0.6.0/src/via_rop.h0000664000175000017500000002156112760724526015113 00000000000000/* * Copyright 2008 Maarten Maathuis * * 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 AUTHORS 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. */ /* Ternary Raster Operations as defined by GDI * 0 = black * 1 = white * D = destination * S = source * P = pattern * o = bitwise OR * a = bitwise AND * n = bitwise inverse * x = bitwise XOR * * The notation is reverse polish. * Example: * ROP_PDSonon: !(P | !(D | S)) */ #define ROP_0 0x00 #define ROP_DPSoon 0x01 #define ROP_DPSona 0x02 #define ROP_PSon 0x03 #define ROP_SDPona 0x04 #define ROP_DPon 0x05 #define ROP_PDSxnon 0x06 #define ROP_PDSaon 0x07 #define ROP_SDPnaa 0x08 #define ROP_PDSxon 0x09 #define ROP_DPna 0x0A #define ROP_PSDnaon 0x0B #define ROP_SPna 0x0C #define ROP_PDSnaon 0x0D #define ROP_PDSonon 0x0E #define ROP_Pn 0x0F #define ROP_PDSona 0x10 #define ROP_DSon 0x11 #define ROP_SDPxnon 0x12 #define ROP_SDPaon 0x13 #define ROP_DPSxnon 0x14 #define ROP_DPSaon 0x15 #define ROP_PSDPSanaxx 0x16 #define ROP_SSPxDSxaxn 0x17 #define ROP_SPxPDxa 0x18 #define ROP_SDPSanaxn 0x19 #define ROP_PDSPaox 0x1A #define ROP_SDPSxaxn 0x1B #define ROP_PSDPaox 0x1C #define ROP_DSPDxaxn 0x1D #define ROP_PDSox 0x1E #define ROP_PDSoan 0x1F #define ROP_DPSnaa 0x20 #define ROP_SDPxon 0x21 #define ROP_DSna 0x22 #define ROP_SPDnaon 0x23 #define ROP_SPxDSxa 0x24 #define ROP_PDSPanaxn 0x25 #define ROP_SDPSaox 0x26 #define ROP_SDPSxnox 0x27 #define ROP_DPSxa 0x28 #define ROP_PSDPSaoxxn 0x29 #define ROP_DPSana 0x2A #define ROP_SSPxPDxaxn 0x2B #define ROP_SPDSoax 0x2C #define ROP_PSDnox 0x2D #define ROP_PSDPxox 0x2E #define ROP_PSDnoan 0x2F #define ROP_PSna 0x30 #define ROP_SDPnaon 0x31 #define ROP_SDPSoox 0x32 #define ROP_Sn 0x33 #define ROP_SPDSaox 0x34 #define ROP_SPDSxnox 0x35 #define ROP_SDPox 0x36 #define ROP_SDPoan 0x37 #define ROP_PSDPoax 0x38 #define ROP_SPDnox 0x39 #define ROP_SPDSxox 0x3A #define ROP_SPDnoan 0x3B #define ROP_PSx 0x3C #define ROP_SPDSonox 0x3D #define ROP_SPDSnaox 0x3E #define ROP_PSan 0x3F #define ROP_PSDnaa 0x40 #define ROP_DPSxon 0x41 #define ROP_SDxPDxa 0x42 #define ROP_SPDSanaxn 0x43 #define ROP_SDna 0x44 #define ROP_DPSnaon 0x45 #define ROP_DSPDaox 0x46 #define ROP_PSDPxaxn 0x47 #define ROP_SDPxa 0x48 #define ROP_PDSPDaoxxn 0x49 #define ROP_DPSDoax 0x4A #define ROP_PDSnox 0x4B #define ROP_SDPana 0x4C #define ROP_SSPxDSxoxn 0x4D #define ROP_PDSPxox 0x4E #define ROP_PDSnoan 0x4F #define ROP_PDna 0x50 #define ROP_DSPnaon 0x51 #define ROP_DPSDaox 0x52 #define ROP_SPDSxaxn 0x53 #define ROP_DPSonon 0x54 #define ROP_Dn 0x55 #define ROP_DPSox 0x56 #define ROP_DPSoan 0x57 #define ROP_PDSPoax 0x58 #define ROP_DPSnox 0x59 #define ROP_DPx 0x5A #define ROP_DPSDonox 0x5B #define ROP_DPSDxox 0x5C #define ROP_DPSnoan 0x5D #define ROP_DPSDnaox 0x5E #define ROP_DPan 0x5F #define ROP_PDSxa 0x60 #define ROP_DSPDSaoxxn 0x61 #define ROP_DSPDoax 0x62 #define ROP_SDPnox 0x63 #define ROP_SDPSoax 0x64 #define ROP_DSPnox 0x65 #define ROP_DSx 0x66 #define ROP_SDPSonox 0x67 #define ROP_DSPDSonoxxn 0x68 #define ROP_PDSxxn 0x69 #define ROP_DPSax 0x6A #define ROP_PSDPSoaxxn 0x6B #define ROP_SDPax 0x6C #define ROP_PDSPDoaxxn 0x6D #define ROP_SDPSnoax 0x6E #define ROP_PDSxnan 0x6F #define ROP_PDSana 0x70 #define ROP_SSDxPDxaxn 0x71 #define ROP_SDPSxox 0x72 #define ROP_SDPnoan 0x73 #define ROP_DSPDxox 0x74 #define ROP_DSPnoan 0x75 #define ROP_SDPSnaox 0x76 #define ROP_DSan 0x77 #define ROP_PDSax 0x78 #define ROP_DSPDSoaxxn 0x79 #define ROP_DPSDnoax 0x7A #define ROP_SDPxnan 0x7B #define ROP_SPDSnoax 0x7C #define ROP_DPSxnan 0x7D #define ROP_SPxDSxo 0x7E #define ROP_DPSaan 0x7F #define ROP_DPSaa 0x80 #define ROP_SPxDSxon 0x81 #define ROP_DPSxna 0x82 #define ROP_SPDSnoaxn 0x83 #define ROP_SDPxna 0x84 #define ROP_PDSPnoaxn 0x85 #define ROP_DSPDSoaxx 0x86 #define ROP_PDSaxn 0x87 #define ROP_DSa 0x88 #define ROP_SDPSnaoxn 0x89 #define ROP_DSPnoa 0x8A #define ROP_DSPDxoxn 0x8B #define ROP_SDPnoa 0x8C #define ROP_SDPSxoxn 0x8D #define ROP_SSDxPDxax 0x8E #define ROP_PDSanan 0x8F #define ROP_PDSxna 0x90 #define ROP_SDPSnoaxn 0x91 #define ROP_DPSDPoaxx 0x92 #define ROP_SPDaxn 0x93 #define ROP_PSDPSoaxx 0x94 #define ROP_DPSaxn 0x95 #define ROP_DPSxx 0x96 #define ROP_PSDPSonoxx 0x97 #define ROP_SDPSonoxn 0x98 #define ROP_DSxn 0x99 #define ROP_DPSnax 0x9A #define ROP_SDPSoaxn 0x9B #define ROP_SPDnax 0x9C #define ROP_DSPDoaxn 0x9D #define ROP_DSPDSaoxx 0x9E #define ROP_PDSxan 0x9F #define ROP_DPa 0xA0 #define ROP_PDSPnaoxn 0xA1 #define ROP_DPSnoa 0xA2 #define ROP_DPSDxoxn 0xA3 #define ROP_PDSPonoxn 0xA4 #define ROP_PDxn 0xA5 #define ROP_DSPnax 0xA6 #define ROP_PDSPoaxn 0xA7 #define ROP_DPSoa 0xA8 #define ROP_DPSoxn 0xA9 #define ROP_D 0xAA #define ROP_DPSono 0xAB #define ROP_SPDSxax 0xAC #define ROP_DPSDaoxn 0xAD #define ROP_DSPnao 0xAE #define ROP_DPno 0xAF #define ROP_PDSnoa 0xB0 #define ROP_PDSPxoxn 0xB1 #define ROP_SSPxDSxox 0xB2 #define ROP_SDPanan 0xB3 #define ROP_PSDnax 0xB4 #define ROP_DPSDoaxn 0xB5 #define ROP_DPSDPaoxx 0xB6 #define ROP_SDPxan 0xB7 #define ROP_PSDPxax 0xB8 #define ROP_DSPDaoxn 0xB9 #define ROP_DPSnao 0xBA #define ROP_DSno 0xBB #define ROP_SPDSanax 0xBC #define ROP_SDxPDxan 0xBD #define ROP_DPSxo 0xBE #define ROP_DPSano 0xBF #define ROP_Psa 0xC0 #define ROP_SPDSnaoxn 0xC1 #define ROP_SPDSonoxn 0xC2 #define ROP_PSxn 0xC3 #define ROP_SPDnoa 0xC4 #define ROP_SPDSxoxn 0xC5 #define ROP_SDPnax 0xC6 #define ROP_PSDPoaxn 0xC7 #define ROP_SDPoa 0xC8 #define ROP_SPDoxn 0xC9 #define ROP_DPSDxax 0xCA #define ROP_SPDSaoxn 0xCB #define ROP_S 0xCC #define ROP_SDPono 0xCD #define ROP_SDPnao 0xCE #define ROP_SPno 0xCF #define ROP_PSDnoa 0xD0 #define ROP_PSDPxoxn 0xD1 #define ROP_PDSnax 0xD2 #define ROP_SPDSoaxn 0xD3 #define ROP_SSPxPDxax 0xD4 #define ROP_DPSanan 0xD5 #define ROP_PSDPSaoxx 0xD6 #define ROP_DPSxan 0xD7 #define ROP_PDSPxax 0xD8 #define ROP_SDPSaoxn 0xD9 #define ROP_DPSDanax 0xDA #define ROP_SPxDSxan 0xDB #define ROP_SPDnao 0xDC #define ROP_SDno 0xDD #define ROP_SDPxo 0xDE #define ROP_SDPano 0xDF #define ROP_PDSoa 0xE0 #define ROP_PDSoxn 0xE1 #define ROP_DSPDxax 0xE2 #define ROP_PSDPaoxn 0xE3 #define ROP_SDPSxax 0xE4 #define ROP_PDSPaoxn 0xE5 #define ROP_SDPSanax 0xE6 #define ROP_SPxPDxan 0xE7 #define ROP_SSPxDSxax 0xE8 #define ROP_DSPDSanaxxn 0xE9 #define ROP_DPSao 0xEA #define ROP_DPSxno 0xEB #define ROP_SDPao 0xEC #define ROP_SDPxno 0xED #define ROP_DSo 0xEE #define ROP_SDPnoo 0xEF #define ROP_P 0xF0 #define ROP_PDSono 0xF1 #define ROP_PDSnao 0xF2 #define ROP_PSno 0xF3 #define ROP_PSDnao 0xF4 #define ROP_PDno 0xF5 #define ROP_PDSxo 0xF6 #define ROP_PDSano 0xF7 #define ROP_PDSao 0xF8 #define ROP_PDSxno 0xF9 #define ROP_DPo 0xFA #define ROP_DPSnoo 0xFB #define ROP_PSo 0xFC #define ROP_PSDnoo 0xFD #define ROP_DPSoo 0xFE #define ROP_1 0xFF /* derived from XAA */ static struct { int copy; int copy_planemask; int pattern; int pattern_planemask; } VIAROP[] = { { ROP_0, ROP_0, ROP_0, ROP_DPna }, /* GXclear */ { ROP_DSa, ROP_DSPnoa, ROP_DPa, ROP_DPSnoa }, /* GXand */ { ROP_SDna, ROP_DPSnaon, ROP_PDna, ROP_DSPnaon }, /* GXandReverse */ { ROP_S, ROP_DPSDxax, ROP_P, ROP_DSPDxax }, /* GXcopy */ { ROP_DSna, ROP_DPSana, ROP_DPna, ROP_DPSana }, /* GXandInverted */ { ROP_D, ROP_D, ROP_D, ROP_D }, /* GXnoop */ { ROP_DSx, ROP_DPSax, ROP_DPx, ROP_DPSax }, /* GXxor */ { ROP_DSo, ROP_DPSao, ROP_DPo, ROP_DPSao }, /* GXor */ { ROP_DSon, ROP_DPSaon, ROP_DPon, ROP_DPSaon }, /* GXnor */ { ROP_DSxn, ROP_DPSaxn, ROP_PDxn, ROP_DPSaxn }, /* GXequiv */ { ROP_Dn, ROP_Dn, ROP_Dn, ROP_DPx }, /* GXinvert */ { ROP_SDno, ROP_DPSanan, ROP_PDno, ROP_DPSanan }, /* GXorReverse */ { ROP_Sn, ROP_PSDPxox, ROP_Pn, ROP_SPDSxox }, /* GXcopyInverted */ { ROP_DSno, ROP_DPSnao, ROP_DPno, ROP_DSPnao }, /* GXorInverted */ { ROP_DSan, ROP_DSPnoan, ROP_DPan, ROP_DPSnoan }, /* GXnand */ { ROP_1, ROP_1, ROP_1, ROP_DPo } /* GXset */ }; #define VIAACCELCOPYROP(vRop) (VIAROP[vRop].copy << 24) #define VIAACCELPATTERNROP(vRop) (VIAROP[vRop].pattern << 24) xf86-video-openchrome-0.6.0/src/via_memmgr.c0000664000175000017500000002125713032700576015564 00000000000000/* * Copyright 2003 Red Hat, 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, 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 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "xf86.h" #include "xf86_OSproc.h" #include "xf86fbman.h" #ifdef HAVE_DRI #include "xf86drm.h" #endif #include "drm_fourcc.h" #include "via_driver.h" #ifdef HAVE_DRI #include "via_drm.h" #else #include "drm_fourcc.h" #endif /* * Isolate the wonders of X memory allocation and DRI memory allocation * and 4.3 or 4.4 differences in one abstraction. * * The pool code indicates who provided the memory: * 0 - nobody * 1 - xf86 linear * 2 - DRM */ int viaOffScreenLinear(struct buffer_object *obj, ScrnInfoPtr pScrn, unsigned long size) { int depth = pScrn->bitsPerPixel >> 3; FBLinearPtr linear; linear = xf86AllocateOffscreenLinear(pScrn->pScreen, (size + depth - 1) / depth, 32, NULL, NULL, NULL); if (!linear) return BadAlloc; obj->offset = linear->offset * depth; obj->handle = (unsigned long) linear; obj->domain = TTM_PL_FLAG_VRAM; obj->size = size; return Success; } struct buffer_object * drm_bo_alloc_surface(ScrnInfoPtr pScrn, unsigned int width, unsigned int height, int format, unsigned int alignment, int domain) { struct buffer_object *obj = NULL; int pitch; switch (format) { case DRM_FORMAT_C8: pitch = width; break; case DRM_FORMAT_XRGB1555: case DRM_FORMAT_RGB565: pitch = width * 2; break; case DRM_FORMAT_RGB888: pitch = width * 3; break; case DRM_FORMAT_XRGB2101010: case DRM_FORMAT_XRGB8888: pitch = width * 4; break; } pitch = ALIGN_TO(pitch, alignment); obj = drm_bo_alloc(pScrn, pitch * height, alignment, domain); if (!obj->pitch) obj->pitch = pitch; return obj; } struct buffer_object * drm_bo_alloc(ScrnInfoPtr pScrn, unsigned int size, unsigned int alignment, int domain) { struct buffer_object *obj = NULL; VIAPtr pVia = VIAPTR(pScrn); int ret = 0; obj = xnfcalloc(1, sizeof(*obj)); if (obj) { switch (domain) { case TTM_PL_FLAG_TT: case TTM_PL_FLAG_VRAM: if (pVia->directRenderingType == DRI_NONE) { if (Success != viaOffScreenLinear(obj, pScrn, size)) { ErrorF("Linear memory allocation failed\n"); ret = -ENOMEM; } else DEBUG(ErrorF("%lu bytes of Linear memory allocated at %lx, handle %lu\n", obj->size, obj->offset, obj->handle)); #ifdef HAVE_DRI } else if (pVia->directRenderingType == DRI_1) { drm_via_mem_t drm; size = ALIGN_TO(size, alignment); drm.context = DRIGetContext(pScrn->pScreen); drm.size = size; drm.type = (domain == TTM_PL_FLAG_TT ? VIA_MEM_AGP : VIA_MEM_VIDEO); ret = drmCommandWriteRead(pVia->drmmode.fd, DRM_VIA_ALLOCMEM, &drm, sizeof(drm_via_mem_t)); if (!ret && (size == drm.size)) { if (domain == TTM_PL_FLAG_VRAM) drm.offset -= pVia->FBFreeStart; obj->offset = ALIGN_TO(drm.offset, alignment); obj->handle = drm.index; obj->domain = domain; obj->size = drm.size; DEBUG(ErrorF("%lu bytes of DRI memory allocated at %lx, handle %lu\n", obj->size, obj->offset, obj->handle)); } } else if (pVia->directRenderingType == DRI_2) { struct drm_via_gem_object args; /* Some day this will be moved to libdrm. */ args.domains = domain; args.alignment = alignment; args.pitch = 0; args.size = size; ret = drmCommandWriteRead(pVia->drmmode.fd, DRM_VIA_GEM_CREATE, &args, sizeof(struct drm_via_gem_object)); if (!ret) { /* Okay the X server expects to know the offset because * of non-KMS. Once we have KMS working the offset * will not be valid. */ obj->map_offset = args.map_handle; obj->offset = args.offset; obj->handle = args.handle; obj->pitch = args.pitch; obj->size = args.size; obj->domain = domain; DEBUG(ErrorF("%lu bytes of DRI2 memory allocated at %lx, handle %lu\n", obj->size, obj->offset, obj->handle)); } #endif } break; case TTM_PL_FLAG_SYSTEM: default: ret = -ENXIO; break; } if (ret) { DEBUG(ErrorF("DRM memory allocation failed %d\n", ret)); free(obj); obj = NULL; }; } return obj; } void* drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj) { VIAPtr pVia = VIAPTR(pScrn); if (pVia->directRenderingType == DRI_2) { obj->ptr = mmap(0, obj->size, PROT_READ | PROT_WRITE, MAP_SHARED, pVia->drmmode.fd, obj->map_offset); if (obj->ptr == MAP_FAILED) { DEBUG(ErrorF("mmap failed with error %d\n", -errno)); obj->ptr = NULL; } } else { switch (obj->domain) { #ifdef HAVE_DRI case TTM_PL_FLAG_TT: obj->ptr = (pVia->agpMappedAddr + obj->offset); break; #endif case TTM_PL_FLAG_VRAM: obj->ptr = (pVia->FBBase + obj->offset); break; default: obj->ptr = NULL; break; } } return obj->ptr; } void drm_bo_unmap(ScrnInfoPtr pScrn, struct buffer_object *obj) { VIAPtr pVia = VIAPTR(pScrn); if (pVia->directRenderingType == DRI_2) { munmap(obj->ptr, obj->size); } obj->ptr = NULL; } void drm_bo_free(ScrnInfoPtr pScrn, struct buffer_object *obj) { VIAPtr pVia = VIAPTR(pScrn); if (obj) { DEBUG(ErrorF("Freed %lu (pool %d)\n", obj->offset, obj->domain)); switch (obj->domain) { case TTM_PL_FLAG_VRAM: case TTM_PL_FLAG_TT: if (pVia->directRenderingType == DRI_NONE) { FBLinearPtr linear = (FBLinearPtr) obj->handle; xf86FreeOffscreenLinear(linear); #ifdef HAVE_DRI } else if (pVia->directRenderingType == DRI_1) { drm_via_mem_t drm; drm.index = obj->handle; if (drmCommandWrite(pVia->drmmode.fd, DRM_VIA_FREEMEM, &drm, sizeof(drm_via_mem_t)) < 0) ErrorF("DRM failed to free for handle %lu.\n", obj->handle); } else if (pVia->directRenderingType == DRI_2) { struct drm_gem_close close; close.handle = obj->handle; if (drmIoctl(pVia->drmmode.fd, DRM_IOCTL_GEM_CLOSE, &close) < 0) ErrorF("DRM failed to free for handle %lu.\n", obj->handle); #endif } break; default: break; } free(obj); } } Bool drm_bo_manager_init(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); Bool ret = TRUE; if (pVia->directRenderingType == DRI_2) return ret; ret = umsCreate(pScrn); #ifdef HAVE_DRI if (pVia->directRenderingType == DRI_1) ret = VIADRIKernelInit(pScrn); #endif return ret; } xf86-video-openchrome-0.6.0/src/via_ch7xxx.c0000664000175000017500000005004712760724526015540 00000000000000/* * Copyright 2005 Terry Lewis. All Rights Reserved. * Copyright 2005 Philip Langdale. All Rights Reserved. (CH7011 additions) * Copyright 2004 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS 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 "via_driver.h" #include "via_ch7xxx.h" #include #ifdef HAVE_DEBUG /* * */ static void CH7xxxPrintRegs(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; CARD8 i, buf; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Printing registers for %s\n", pBIOSInfo->TVI2CDev->DevName); for (i = 0; i < pBIOSInfo->TVNumRegs; i++) { xf86I2CReadByte(pBIOSInfo->TVI2CDev, i, &buf); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV%02X: 0x%02X\n", i, buf); } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "End of TV registers.\n"); } #endif /* HAVE_DEBUG */ /* * */ I2CDevPtr ViaCH7xxxDetect(ScrnInfoPtr pScrn, I2CBusPtr pBus, CARD8 Address) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; I2CDevPtr pDev = xf86CreateI2CDevRec(); CARD8 buf; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaCH7xxxDetect\n")); pDev->DevName = "CH7xxx"; pDev->SlaveAddr = Address; pDev->pI2CBus = pBus; if (!xf86I2CDevInit(pDev)) { xf86DestroyI2CDevRec(pDev, TRUE); return NULL; } if (!xf86I2CReadByte(pDev, 0x4B, &buf)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to read from %s Slave %d.\n", pBus->BusName, Address); xf86DestroyI2CDevRec(pDev, TRUE); return NULL; } switch (buf) { case 0x17: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7011 TV Encoder\n"); pBIOSInfo->TVEncoder = VIA_CH7011; pDev->DevName="CH7011"; break; case 0x19: xf86I2CReadByte(pDev, 0x4A, &buf); if (buf == 0x81) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7019A LVDS Transmitter/TV Encoder\n"); pBIOSInfo->TVEncoder = VIA_CH7019A; pDev->DevName="CH7019A"; } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7019B LVDS Transmitter/TV Encoder\n"); pBIOSInfo->TVEncoder = VIA_CH7019B; pDev->DevName="CH7019B"; } break; case 0x1B: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7017 LVDS Transmitter\n"); pBIOSInfo->TVEncoder = VIA_CH7017; pDev->DevName="CH7017"; break; case 0x3A: /* single init table --> single channel LVDS transmitter ? */ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7304 LVDS Transmitter\n"); pBIOSInfo->TVEncoder = VIA_CH7304; pDev->DevName="CH7304"; break; case 0x3B: /* dual init table --> dual channel LVDS transmitter ? */ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7305 LVDS Transmitter\n"); pBIOSInfo->TVEncoder = VIA_CH7305; pDev->DevName="CH7305"; break; default: pBIOSInfo->TVEncoder = VIA_NONETV; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unknown CH7xxx" " device found. [%x:0x1B contains %x]\n", Address, buf); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Unknown CH7xxx encoder found\n"); xf86DestroyI2CDevRec(pDev,TRUE); pDev = NULL; break; } return pDev; } /* * */ static void CH7xxxSave(ScrnInfoPtr pScrn) { int i; VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxSave\n")); for (i = 0; i < pBIOSInfo->TVNumRegs; i++) xf86I2CReadByte(pBIOSInfo->TVI2CDev, i, &(pBIOSInfo->TVRegs[i])); } static void CH7xxxRestore(ScrnInfoPtr pScrn) { int i; VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxRestore\n")); for (i = 0; i < pBIOSInfo->TVNumRegs; i++) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, pBIOSInfo->TVRegs[i]); } static CARD8 CH7xxxDACSenseI2C(I2CDevPtr pDev) { CARD8 save, sense; /* Turn all DACP on*/ xf86I2CWriteByte(pDev, 0x49, 0x20); /* Make sure Bypass mode is disabled (DACBP) bit0 is set to '0' */ xf86I2CReadByte(pDev, 0x21, &save); xf86I2CWriteByte(pDev, 0x21, save & ~0x01); /* Set Sense bit0 to '1' */ xf86I2CReadByte(pDev, 0x20, &save); xf86I2CWriteByte(pDev, 0x20, save | 0x01); /* Set Sense bit0 back to '0' */ xf86I2CReadByte(pDev, 0x20, &save); xf86I2CWriteByte(pDev, 0x20, save & ~0x01); /* Read DACT status bits */ xf86I2CReadByte(pDev, 0x20, &sense); return (sense & 0x1F); } /* * A CH7xxx hack. (T. Lewis. S-Video fixed by P. Langdale) * * CH7xxx Cable types (C+S and YcBcR untested and almost certainly wrong) * 0x10 = Composite * 0x0C = S-Video * 0x02 = Composite+S-Video * 0x04 = YcBcR * 0x00 = Nothing Connected */ static Bool CH7xxxDACSense(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; CARD8 sense; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxDACDetect\n")); /* is this needed? IH */ if (!pBIOSInfo->TVI2CDev || !pBIOSInfo->TVEncoder) return FALSE; sense = CH7xxxDACSenseI2C(pBIOSInfo->TVI2CDev); /* I'm sure these case values are correct, * but we should get something in any case. * 0x10 (Composite), 0x0C (S-Video) and 0x00 (Nothing connected) * seem to be correct however. */ switch (sense) { case 0x10: pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxx: Composite connected.\n"); return TRUE; case 0x0C: pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxx: S-Video connected.\n"); return TRUE; case 0x02: pBIOSInfo->TVOutput = TVOUTPUT_SC; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CHxxx: Composite+S-Video connected.\n"); return TRUE; case 0x04: pBIOSInfo->TVOutput = TVOUTPUT_YCBCR; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CHxxx: YcBcR Connected.\n"); return TRUE; case 0x00: pBIOSInfo->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxx: Nothing connected.\n"); return FALSE; default: pBIOSInfo->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "CH7xxx: Unknown cable combination: 0x0%2X.\n",sense); return FALSE; } } static CARD8 CH7011ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7011ModeIndex\n")); for (i = 0; CH7011Table[i].Width; i++) { if ((CH7011Table[i].Width == mode->CrtcHDisplay) && (CH7011Table[i].Height == mode->CrtcVDisplay) && (CH7011Table[i].Standard == pBIOSInfo->TVType) && !(strcmp(CH7011Table[i].name, mode->name))) return i; } xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "CH7011ModeIndex:" " Mode \"%s\" not found in Table\n", mode->name); return 0xFF; } static CARD8 CH7019ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7019ModeIndex\n")); for (i = 0; CH7019Table[i].Width; i++) { if ((CH7019Table[i].Width == mode->CrtcHDisplay) && (CH7019Table[i].Height == mode->CrtcVDisplay) && (CH7019Table[i].Standard == pBIOSInfo->TVType) && !(strcmp(CH7019Table[i].name, mode->name))) return i; } xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "CH7019ModeIndex:" " Mode \"%s\" not found in Table\n", mode->name); return 0xFF; } /* * */ static ModeStatus CH7xxxModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxModeValid\n")); if ((mode->PrivSize != sizeof(struct CH7xxxModePrivate)) || ((mode->Private != (void *) &CH7xxxModePrivateNTSC) && (mode->Private != (void *) &CH7xxxModePrivatePAL))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Not a mode defined by the TV Encoder.\n"); return MODE_BAD; } if ((pBIOSInfo->TVType == TVTYPE_NTSC) && (mode->Private != (void *) &CH7xxxModePrivateNTSC)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is NTSC. This is a PAL mode.\n"); return MODE_BAD; } else if ((pBIOSInfo->TVType == TVTYPE_PAL) && (mode->Private != (void *) &CH7xxxModePrivatePAL)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is PAL. This is a NTSC mode.\n"); return MODE_BAD; } if (pBIOSInfo->TVEncoder == VIA_CH7011) { if (CH7011ModeIndex(pScrn, mode) != 0xFF) return MODE_OK; } else { if (CH7019ModeIndex(pScrn, mode) != 0xFF) return MODE_OK; } return MODE_BAD; } static void CH7xxxModeI2C(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; CARD8 i, j; VIABIOSTVMASKTableRec Mask; struct CH7xxxTableRec Table; if (pBIOSInfo->TVEncoder == VIA_CH7011) { Table = CH7011Table[CH7011ModeIndex(pScrn, mode)]; Mask = ch7011MaskTable; } else { Table = CH7019Table[CH7019ModeIndex(pScrn, mode)]; Mask = ch7019MaskTable; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7011ModeI2C\n")); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x3E); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1E, 0xD0); for (i = 0,j = 0; (j < Mask.numTV) && (i < VIA_BIOS_TABLE_NUM_TV_REG); i++) { if (Mask.TV[i] == 0xFF) { xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, Table.TV[i]); j++; } else { xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, pBIOSInfo->TVRegs[i]); } } if ((pBIOSInfo->TVType == TVTYPE_NTSC) && pBIOSInfo->TVDotCrawl) { CARD16 *DotCrawl = Table.DotCrawlNTSC; CARD8 address, save; for (i = 1; i < (DotCrawl[0] + 1); i++) { address = (CARD8)(DotCrawl[i] & 0xFF); save = (CARD8)(DotCrawl[i] >> 8); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, address, save); } } /* * Only Composite and SVideo have been tested. */ switch(pBIOSInfo->TVOutput){ case TVOUTPUT_COMPOSITE: xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x2E); break; case TVOUTPUT_SVIDEO: xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x32); break; case TVOUTPUT_SC: xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x3C); break; case TVOUTPUT_YCBCR: xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x3A); break; default: break; } if (pVia->IsSecondary) { /* Patch as setting 2nd path */ j = (CARD8)(Mask.misc2 >> 5); for (i = 0; i < j; i++) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, Table.Patch2[i] & 0xFF, Table.Patch2[i] >> 8); } } static void CH7xxxModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) { ScrnInfoPtr pScrn = crtc->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; CARD8 *CRTC, *Misc; int i, j; VIABIOSTVMASKTableRec Mask; struct CH7xxxTableRec Table; if (pBIOSInfo->TVEncoder == VIA_CH7011) { Table = CH7011Table[CH7011ModeIndex(pScrn, mode)]; Mask = ch7011MaskTable; } else { Table = CH7019Table[CH7019ModeIndex(pScrn, mode)]; Mask = ch7019MaskTable; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxModeCrtc\n")); if (pVia->IsSecondary) { switch (pScrn->bitsPerPixel) { case 16: CRTC = Table.CRTC2_16BPP; break; case 24: case 32: CRTC = Table.CRTC2_32BPP; break; case 8: default: CRTC = Table.CRTC2_8BPP; break; } Misc = Table.Misc2; for (i = 0, j = 0; i < Mask.numCRTC2; j++) { if (Mask.CRTC2[j] == 0xFF) { hwp->writeCrtc(hwp, j + 0x50, CRTC[j]); i++; } } if (Mask.misc2 & 0x18) { pBIOSInfo->Clock = (Misc[3] << 8) & Misc[4]; /* VIASetUseExternalClock(hwp); */ } ViaCrtcMask(hwp, 0x6A, 0xC0, 0xC0); ViaCrtcMask(hwp, 0x6B, 0x01, 0x01); ViaCrtcMask(hwp, 0x6C, 0x01, 0x01); /* Disable LCD Scaling */ if (!pVia->SAMM || pVia->FirstInit) hwp->writeCrtc(hwp, 0x79, 0x00);} else { CRTC = Table.CRTC1; Misc = Table.Misc1; for (i = 0, j = 0; i < Mask.numCRTC1; j++) { if (Mask.CRTC1[j] == 0xFF) { hwp->writeCrtc(hwp, j, CRTC[j]); i++; } } ViaCrtcMask(hwp, 0x33, Misc[0], 0x20); hwp->writeCrtc(hwp, 0x6A, Misc[1]); if ((pVia->Chipset == VIA_CLE266) && CLE266_REV_IS_AX(pVia->ChipRev)) { hwp->writeCrtc(hwp, 0x6B, Misc[2] | 0x81); /* Fix TV clock Polarity for CLE266A2 */ if (pVia->ChipRev == 0x02) hwp->writeCrtc(hwp, 0x6C, Misc[3] | 0x01); } else hwp->writeCrtc(hwp, 0x6B, Misc[2] | 0x01); if (Mask.misc1 & 0x30) { /* CLE266Ax use 2x XCLK */ if ((pVia->Chipset == VIA_CLE266) && CLE266_REV_IS_AX(pVia->ChipRev)) pBIOSInfo->Clock = 0x471C; else pBIOSInfo->Clock = (Misc[4] << 8) | Misc[5]; } ViaCrtcMask(hwp, 0x6A, 0x40, 0x40); ViaCrtcMask(hwp, 0x6B, 0x01, 0x01); ViaCrtcMask(hwp, 0x6C, 0x01, 0x01); } ViaSeqMask(hwp, 0x1E, 0xC0, 0xC0); /* Enable DI0/DVP0 */ } /* * */ static void CH7xxxTVPower(ScrnInfoPtr pScrn, Bool On) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; if (On){ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxTVPower: On\n")); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x20); }else{ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxTVPower: Off\n")); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x3E); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1E, 0xD0); } } static void CH7019LCDPower(ScrnInfoPtr pScrn, Bool On) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; CARD8 W_Buffer[2], R_Buffer[1]; int i; if (On){ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxLCDPower: On\n")); W_Buffer[0] = 0x63; W_Buffer[1] = 0x4B; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); W_Buffer[0] = 0x66; W_Buffer[1] = 0x20; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); for (i = 0; i < 10; i++) { W_Buffer[0] = 0x63; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1); usleep(100); W_Buffer[0] = 0x63; W_Buffer[1] = (R_Buffer[0] | 0x40); xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxxLCDPower: [%d]write 0x63 = %X!\n", i+1, W_Buffer[1])); usleep(1); W_Buffer[0] = 0x63; W_Buffer[1] &= ~0x40; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxxLCDPower: [%d]write 0x63 = %X!\n", i+1, W_Buffer[1])); usleep(100); W_Buffer[0] = 0x66; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1); if (((R_Buffer[0] & 0x44) == 0x44) || (i >= 9)) { /* PLL lock OK, Turn on VDD */ usleep(500); W_Buffer[1] = R_Buffer[0] | 0x01; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxxLCDPower: CH7019 PLL lock ok!\n")); /* reset data path */ W_Buffer[0] = 0x48; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1); W_Buffer[1] = R_Buffer[0] & ~0x08; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); usleep(1); W_Buffer[1] = R_Buffer[0]; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); break; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxxLCDPower: [%d]CH7019 PLL lock fail!\n", i+1)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxxLCDPower: [%d]0x66 = %X!\n", i+1, R_Buffer[0])); } }else{ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxLCDPower: Off\n")); /* Turn off VDD (Turn off backlignt only) */ W_Buffer[0] = 0x66; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1); W_Buffer[1] &= ~0x01; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); usleep(100); /* Turn off LVDS path */ W_Buffer[0] = 0x63; xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1); W_Buffer[1] = (R_Buffer[0] | 0x40); xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); } } /* * */ void ViaCH7xxxInit(ScrnInfoPtr pScrn) { VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaCH7xxxInit\n")); switch (pBIOSInfo->TVEncoder) { case VIA_CH7011: pBIOSInfo->TVSave = CH7xxxSave; pBIOSInfo->TVRestore = CH7xxxRestore; pBIOSInfo->TVDACSense = CH7xxxDACSense; pBIOSInfo->TVModeValid = CH7xxxModeValid; pBIOSInfo->TVModeI2C = CH7xxxModeI2C; pBIOSInfo->TVModeCrtc = CH7xxxModeCrtc; pBIOSInfo->TVPower = CH7xxxTVPower; pBIOSInfo->TVModes = CH7011Modes; pBIOSInfo->TVNumModes = sizeof(CH7011Modes) / sizeof(DisplayModeRec); pBIOSInfo->LCDPower = NULL; pBIOSInfo->TVNumRegs = CH_7011_MAX_NUM_REG; #ifdef HAVE_DEBUG pBIOSInfo->TVPrintRegs = CH7xxxPrintRegs; #endif break; case VIA_CH7019A: case VIA_CH7019B: pBIOSInfo->TVDACSense = CH7xxxDACSense; pBIOSInfo->TVSave = CH7xxxSave; pBIOSInfo->TVRestore = CH7xxxRestore; pBIOSInfo->TVModeValid = CH7xxxModeValid; pBIOSInfo->TVModeI2C = CH7xxxModeI2C; pBIOSInfo->TVModeCrtc = CH7xxxModeCrtc; pBIOSInfo->TVPower = CH7xxxTVPower; pBIOSInfo->TVModes = CH7019Modes; pBIOSInfo->TVNumModes = sizeof(CH7019Modes) / sizeof(DisplayModeRec); pBIOSInfo->LCDPower = CH7019LCDPower; pBIOSInfo->TVNumRegs = CH_7019_MAX_NUM_REG; #ifdef HAVE_DEBUG pBIOSInfo->TVPrintRegs = CH7xxxPrintRegs; #endif break; default: DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaCH7xxxInit missing\n")); break; } /* Save before continuing */ if (pBIOSInfo->TVSave) pBIOSInfo->TVSave(pScrn); } xf86-video-openchrome-0.6.0/src/via_memcpy.c0000664000175000017500000004400013033607754015566 00000000000000/* * Copyright (C) 2004 Thomas Hellström, 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 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "via_driver.h" #include "compiler.h" #define BSIZ 2048 /* size of /proc/cpuinfo buffer */ #define BSIZW 720 /* typical copy width (YUV420) */ #define BSIZA 736 /* multiple of 32 bytes */ #define BSIZH 576 /* typical copy height */ #define SSE_PREFETCH " prefetchnta " #define FENCE __asm__ __volatile__ ("sfence":::"memory"); #define FENCEMMS __asm__ __volatile__ ("\t" \ "sfence\n\t" \ "emms\n\t" \ :::"memory"); #define FEMMS __asm__ __volatile__("femms":::"memory"); #define EMMS __asm__ __volatile__("emms":::"memory"); #define NOW_PREFETCH " prefetch " #define PREFETCH1(arch_prefetch,from) \ __asm__ __volatile__ ( \ "1: " 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" \ "2:\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(to, from, n) \ { \ __asm__ __volatile__( \ "movl %2,%%ecx\n\t" \ "sarl $2,%%ecx\n\t" \ "rep ; movsl\n\t" \ "testb $2,%b2\n\t" \ "je 1f\n\t" \ "movsw\n" \ "1:\ttestb $1,%b2\n\t" \ "je 2f\n\t" \ "movsb\n" \ "2:" \ :"=&D" (to), "=&S" (from) \ :"q" (n),"0" ((long) to),"1" ((long) from) \ : "%ecx","memory"); \ } #define SSE_CPY(prefetch, from, to, dummy, lcnt) \ if ((unsigned long) 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" \ " movntps %%xmm2, 32(%0)\n" \ " movntps %%xmm3, 48(%0)\n" \ " addl $64,%0\n" \ " addl $64,%1\n" \ " decl %2\n" \ " jne 1b\n" \ :"=&D"(to), "=&S"(from), "=&r"(dummy) \ :"0" (to), "1" (from), "2" (lcnt): "memory"); \ } 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" \ " movntps %%xmm2, 32(%0)\n" \ " movntps %%xmm3, 48(%0)\n" \ " addl $64,%0\n" \ " addl $64,%1\n" \ " decl %2\n" \ " jne 2b\n" \ :"=&D"(to), "=&S"(from), "=&r"(dummy) \ :"0" (to), "1" (from), "2" (lcnt): "memory"); \ } #define MMX_CPY(prefetch, from, to, dummy, lcnt) \ __asm__ __volatile__ ( \ "1:\n" \ prefetch "320(%1)\n" \ "2: 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" \ " movq %%mm0, 32(%0)\n" \ " movq %%mm1, 40(%0)\n" \ " movq %%mm2, 48(%0)\n" \ " movq %%mm3, 56(%0)\n" \ " addl $64,%0\n" \ " addl $64,%1\n" \ " decl %2\n" \ " jne 1b\n" \ :"=&D"(to), "=&S"(from), "=&r"(dummy) \ :"0" (to), "1" (from), "2" (lcnt) : "memory"); #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" \ " movntq %%mm0, 32(%0)\n" \ " movntq %%mm1, 40(%0)\n" \ " movntq %%mm2, 48(%0)\n" \ " movntq %%mm3, 56(%0)\n" \ " addl $64,%0\n" \ " addl $64,%1\n" \ " decl %2\n" \ " jne 1b\n" \ :"=&D"(to), "=&S"(from), "=&r"(dummy) \ :"0" (to), "1" (from), "2" (lcnt) : "memory"); #define PREFETCH_FUNC(prefix, itype, ptype, begin, fence) \ \ static void prefix##_YUV42X(unsigned char *to, \ const unsigned char *from, \ int dstPitch, \ int w, \ int h, \ int yuv422) \ { \ int dadd, rest, count, hc, lcnt; \ register int dummy; \ PREFETCH1(ptype##_PREFETCH, from); \ begin; \ count = 2; \ \ /* If destination pitch equals width, do it all in one go. */ \ \ if (yuv422) { \ w <<= 1; \ if (w == dstPitch) { \ w *= h; \ h = 1; \ dstPitch = w; \ count = 0; \ } else { \ h -= 1; \ count = 1; \ } \ } else if (w == dstPitch) { \ w = h*(w + (w >> 1)); \ count = 0; \ h = 1; \ dstPitch = w; \ } \ \ lcnt = w >> 6; \ rest = w & 63; \ while (count--) { \ hc = h; \ lcnt = w >> 6; \ rest = w & 63; \ dadd = dstPitch - w; \ while (hc--) { \ if (lcnt) { \ itype##_CPY(ptype##_PREFETCH, from, to, dummy, lcnt); \ } \ if (rest) { \ PREFETCH2(ptype##_PREFETCH, from); \ small_memcpy(to, from, rest); \ PREFETCH3(ptype##_PREFETCH, from); \ } \ to += dadd; \ } \ w >>= 1; \ dstPitch >>= 1; \ h -= 1; \ } \ if (lcnt > 5) { \ lcnt -= 5; \ itype##_CPY(ptype##_PREFETCH, from, to, dummy, lcnt); \ lcnt = 5; \ } \ if (lcnt) { \ itype##_CPY("#", from, to, dummy, lcnt); \ } \ if (rest) small_memcpy(to, from, rest); \ fence; \ } #define NOPREFETCH_FUNC(prefix, itype, begin, fence) \ static void prefix##_YUV42X(unsigned char *to, \ const unsigned char *from, \ int dstPitch, \ int w, \ int h, \ int yuv422) \ \ { \ int dadd, rest, count, hc, lcnt; \ register int dummy; \ begin; \ count = 2; \ \ /* If destination pitch equals width, do it all in one go. */ \ \ if (yuv422) { \ w <<= 1; \ count = 1; \ if (w == dstPitch) { \ w *= h; \ h = 1; \ dstPitch = w; \ } \ } else if (w == dstPitch) { \ w = h*(w + (w >> 1)); \ count = 1; \ h = 1; \ dstPitch = w; \ } \ \ lcnt = w >> 6; \ rest = w & 63; \ while (count--) { \ hc = h; \ dadd = dstPitch - w; \ lcnt = w >> 6; \ rest = w & 63; \ while (hc--) { \ if (lcnt) { \ itype##_CPY("#", from, to, dummy, lcnt); \ } \ if (rest) small_memcpy(to, from, rest); \ to += dadd; \ } \ w >>= 1; \ dstPitch >>= 1; \ } \ fence; \ } static void libc_YUV42X(unsigned char *dst, const unsigned char *src, int dstPitch, int w, int h, int yuv422) { if (yuv422) w <<= 1; if (dstPitch == w) { int size = h * ((yuv422) ? w : (w + (w >> 1))); memcpy(dst, src, size); return; } else { int count; /* Copy Y component to video memory. */ count = h; while (count--) { memcpy(dst, src, w); src += w; dst += dstPitch; } /* UV component is 1/2 of Y. */ if (!yuv422) { w >>= 1; dstPitch >>= 1; /* Copy V(Cr),U(Cb) components to video memory. */ count = h; while (count--) { memcpy(dst, src, w); src += w; dst += dstPitch; } } } } #ifdef __i386__ /* Linux kernel __memcpy. */ static __inline void * __memcpy(void *to, const void *from, size_t n) { int d1, d2, d3; __asm__ __volatile__( "rep ; movsl\n\t" "testb $2,%b4\n\t" "je 1f\n\t" "movsw\n" "1:\ttestb $1,%b4\n\t" "je 2f\n\t" "movsb\n" "2:" :"=&c"(d1), "=&D"(d2), "=&S"(d3) :"0"(n >> 2), "q"(n), "1"((long)to), "2"((long)from) :"memory"); return (to); } static void kernel_YUV42X(unsigned char *dst, const unsigned char *src, int dstPitch, int w, int h, int yuv422) { if (yuv422) w <<= 1; if (dstPitch == w) { int size = h * ((yuv422) ? w : (w + (w >> 1))); __memcpy(dst, src, size); return; } else { int count; /* Copy Y component to video memory. */ count = h; while (count--) { __memcpy(dst, src, w); src += w; dst += dstPitch; } /* UV component is 1/2 of Y. */ if (!yuv422) { w >>= 1; dstPitch >>= 1; /* Copy V(Cr),U(Cb) components to video memory. */ count = h; while (count--) { __memcpy(dst, src, w); src += w; dst += dstPitch; } } } } PREFETCH_FUNC(sse, SSE, SSE,, FENCE) PREFETCH_FUNC(mmxext, MMXEXT, SSE, EMMS, FENCEMMS) PREFETCH_FUNC(now, MMX, NOW, FEMMS, FEMMS) NOPREFETCH_FUNC(mmx, MMX, EMMS, EMMS) static void *kernel_memcpy(void *to, const void *from, size_t len) { return __memcpy(to, from, len); } static unsigned fastrdtsc(void) { unsigned eax; __asm__ volatile ("\t" "pushl %%ebx\n\t" "cpuid\n\t" ".byte 0x0f, 0x31\n\t" "popl %%ebx\n" :"=a" (eax) :"0"(0) :"ecx", "edx", "cc"); return eax; } static unsigned time_function(vidCopyFunc mf, unsigned char *buf1, unsigned char *buf2) { unsigned t, t2; t = fastrdtsc(); (*mf) (buf1, buf2, BSIZA, BSIZW, BSIZH, 0); t2 = fastrdtsc(); return ((t < t2) ? t2 - t : 0xFFFFFFFFU - (t - t2 - 1)); } enum { libc = 0, kernel, sse, mmx, now, mmxext, totNum }; typedef struct { vidCopyFunc mFunc; char *mName, **cpuFlag; } McFuncData; static char *libc_cpuflags[] = { " ", 0 }; static char *kernel_cpuflags[] = { " ", 0 }; static char *sse_cpuflags[] = { " sse ", 0 }; static char *mmx_cpuflags[] = { " mmx ", 0 }; static char *now_cpuflags[] = { " 3dnow ", 0 }; static char *mmx2_cpuflags[] = { " mmxext ", " sse ", 0 }; static McFuncData mcFunctions[totNum] = { {libc_YUV42X, "libc", libc_cpuflags}, {kernel_YUV42X, "kernel", kernel_cpuflags}, {sse_YUV42X, "SSE", sse_cpuflags}, {mmx_YUV42X, "MMX", mmx_cpuflags}, {now_YUV42X, "3DNow!", now_cpuflags}, {mmxext_YUV42X, "MMX2", mmx2_cpuflags} }; static int flagValid(const char *cpuinfo, char *flag) { const char *flagLoc, *nextProc; int located = 0; while ((cpuinfo = strstr(cpuinfo, "processor\t:"))) { located = 1; cpuinfo += 11; if ((flagLoc = strstr(cpuinfo, flag))) { if ((nextProc = strstr(cpuinfo, "processor\t:"))) { if (nextProc < flagLoc) return 0; } } else { return 0; } } return located; } static int cpuValid(const char *cpuinfo, char **flags) { for (; *flags != 0; flags++) { if (flagValid(cpuinfo, *flags)) return 1; } return 0; } /* * Benchmark the video copy routines and choose the fastest. */ vidCopyFunc viaVidCopyInit(char *copyType, ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); char buf[BSIZ]; unsigned char *buf1, *buf2, *buf3; char *tmpBuf, *endBuf; int count, j, bestSoFar; unsigned best, tmp, testSize, alignSize, tmp2; struct buffer_object *tmpFbBuffer; McFuncData *curData; FILE *cpuInfoFile; double cpuFreq; if (NULL == (cpuInfoFile = fopen("/proc/cpuinfo", "r"))) { return libc_YUV42X; } count = fread(buf, 1, BSIZ, cpuInfoFile); if (ferror(cpuInfoFile)) { fclose(cpuInfoFile); return libc_YUV42X; } fclose(cpuInfoFile); if (BSIZ == count) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "\"/proc/cpuinfo\" file too long. " "Using Linux kernel memcpy.\n"); return libc_YUV42X; } buf[count] = 0; while (count--) if ('\n' == buf[count]) buf[count] = ' '; /* Extract the CPU frequency. */ cpuFreq = 0.; if (NULL != (tmpBuf = strstr(buf, "cpu MHz"))) { if (NULL != (tmpBuf = strstr(tmpBuf, ":") + 1)) { cpuFreq = strtod(tmpBuf, &endBuf); if (endBuf == tmpBuf) tmpBuf = NULL; } } alignSize = BSIZH * (BSIZA + (BSIZA >> 1)); testSize = BSIZH * (BSIZW + (BSIZW >> 1)); /* * Allocate an area of offscreen FB memory, (buf1), a simulated video * player buffer (buf2) and a pool of uninitialized "video" data (buf3). */ tmpFbBuffer = drm_bo_alloc(pScrn, alignSize, 32, TTM_PL_FLAG_VRAM); if (!tmpFbBuffer) return libc_YUV42X; if (NULL == (buf2 = (unsigned char *)malloc(testSize))) { drm_bo_free(pScrn, tmpFbBuffer); return libc_YUV42X; } if (NULL == (buf3 = (unsigned char *)malloc(testSize))) { free(buf2); drm_bo_free(pScrn, tmpFbBuffer); return libc_YUV42X; } buf1 = drm_bo_map(pScrn, tmpFbBuffer); bestSoFar = 0; best = 0xFFFFFFFFU; /* Make probable that buf1 and buf2 are in memory by referencing them. */ libc_YUV42X(buf1, buf2, BSIZA, BSIZW, BSIZH, 0); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Benchmarking %s copy. Less time is better.\n", copyType); for (j = 0; j < totNum; ++j) { curData = mcFunctions + j; if (cpuValid(buf, curData->cpuFlag)) { /* Simulate setup of the video buffer. */ kernel_memcpy(buf2, buf3, testSize); /* Copy the video buffer to frame-buffer memory. */ tmp = time_function(curData->mFunc, buf1, buf2); /* Do it again to avoid context-switch effects. */ kernel_memcpy(buf2, buf3, testSize); tmp2 = time_function(curData->mFunc, buf1, buf2); tmp = (tmp2 < tmp) ? tmp2 : tmp; if (NULL == tmpBuf) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Timed %6s YUV420 copy... %u.\n", curData->mName, tmp); } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Timed %6s YUV420 copy... %u. " "Throughput: %.1f MiB/s.\n", curData->mName, tmp, cpuFreq * 1.e6 * (double)testSize / ((double)(tmp) * (double)(0x100000))); } if (tmp < best) { best = tmp; bestSoFar = j; } } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Ditching %6s YUV420 copy. Not supported by CPU.\n", curData->mName); } } free(buf3); free(buf2); drm_bo_unmap(pScrn, tmpFbBuffer); drm_bo_free(pScrn, tmpFbBuffer); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Using %s YUV42X copy for %s.\n", mcFunctions[bestSoFar].mName, copyType); return mcFunctions[bestSoFar].mFunc; } #else vidCopyFunc viaVidCopyInit(char *copyType, ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using default xfree86 memcpy for video.\n"); return libc_YUV42X; } #endif /* __i386__ */ xf86-video-openchrome-0.6.0/src/Makefile.am0000664000175000017500000001033213054671327015326 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. SUBDIRS = xvmc BUILT_SOURCES = version.h EXTRA_DIST = version.h CONFIG_CLEAN_FILES= version.h AM_CFLAGS = @XORG_CFLAGS@ @LIBUDEV_CFLAGS@ @DRI_CFLAGS@ openchrome_drv_la_LTLIBRARIES = openchrome_drv.la openchrome_drv_la_LDFLAGS = -module -avoid-version @LIBUDEV_LIBS@ openchrome_drv_ladir = @moduledir@/drivers openchrome_drv_la_SOURCES = \ compat-api.h \ via_eng_regs.h \ via_3d.c \ via_3d.h \ via_3d_reg.h \ via_analog.c \ via_rop.h \ via_exa.c \ via_exa_h2.c \ via_exa_h6.c \ via_ums.h \ via_ch7xxx.c \ via_ch7xxx.h \ via_display.c \ via_dmabuffer.h \ via_driver.c \ via_driver.h \ via_i2c.c \ via_id.c \ via_fp.c \ via_memcpy.c \ via_memmgr.h \ via_memmgr.c \ via_outputs.c \ via_mode.h \ via_priv.h \ via_regs.h \ via_sii164.c \ via_sii164.h \ via_tmds.c \ via_tv.c \ via_xv_overlay.c \ via_xv_overlay.h \ via_ums.c \ via_vgahw.c \ via_vgahw.h \ via_xv.c \ via_xv.h \ via_vt162x.c \ via_vt162x.h \ via_vt1632.c \ via_vt1632.h \ via_xvpriv.h if DRI openchrome_drv_la_SOURCES += \ via_dri.c \ via_dri.h \ via_drm.h \ via_drmclient.h \ via_kms.h \ via_kms.c \ via_xvmc.c \ via_xvmc.h \ drm_fourcc.h else EXTRA_DIST += \ via_dri.c \ via_dri.h \ via_drm.h \ via_drmclient.h \ via_kms.h \ via_kms.c \ via_xvmc.c \ via_xvmc.h \ drm_fourcc.h endif via_driver.lo: version.h version.h: $(openchrome_drv_la_SOURCES) @if [ -d ../.git ]; then \ echo '#define BUILDCOMMENT "(development build, branch' \ "`git branch -v | sed 's/no branch/no_branch/' | \ awk '/^\*/ { print $$2 }'`" \ 'at revision' \ "`git log -1 --pretty=format:%h | head -1`"')"' \ > $@.tmp; \ else \ if [ -d .svn ]; then \ echo '#define BUILDCOMMENT "(development build, at revision '\ "`svnversion -nc .. | sed -e s/^[^:]*://`"')"' > $@.tmp; \ elif [ "$$SOURCE_DATE_EPOCH" ]; then \ printf '#define BUILDCOMMENT "(compiled with SOURCE_DATE_EPOCH: %s)"' $$SOURCE_DATE_EPOCH \ > $@.tmp; \ else \ date +'#define BUILDCOMMENT "(development build, compiled on %c)"' \ > $@.tmp; \ fi; \ fi @chmod 666 $@.tmp @mv $@.tmp $@ @echo "created $@" dist-hook: @[ -e version.h ] && rm version.h; \ echo '#define BUILDCOMMENT "(openchrome '$(VERSION)' release)"' \ > version.h xf86-video-openchrome-0.6.0/src/via_mode.h0000664000175000017500000102464013033607754015236 00000000000000/* * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifndef _VIA_MODE_H_ #define _VIA_MODE_H_ 1 /* * Bandwidth * */ #define VIA_BW_MIN 74000000 /* > 640x480@60Hz@32bpp */ #define VIA_BW_DDR200 394000000 #define VIA_BW_DDR400 553000000 /* > 1920x1200@60Hz@32bpp */ #define VIA_BW_DDR667 922000000 #define VIA_BW_DDR1066 922000000 union pllparams { struct { CARD32 dtz : 2; CARD32 dr : 3; CARD32 dn : 7; CARD32 dm :10; } params; CARD32 packed; }; /* * simple lookup table for dotclocks * */ static struct ViaDotClock { int DotClock; CARD16 UniChrome; union pllparams UniChromePro; } ViaDotClocks[] = { { 25200, 0x513C, /* 0xa79004 */ { { 1, 4, 6, 169 } } }, { 25312, 0xC763, /* 0xc49005 */ { { 1, 4, 7, 198 } } }, { 26591, 0x471A, /* 0xce9005 */ { { 1, 4, 7, 208 } } }, { 31500, 0xC558, /* 0xae9003 */ { { 1, 4, 5, 176 } } }, { 31704, 0x471F, /* 0xaf9002 */ { { 1, 4, 4, 177 } } }, { 32663, 0xC449, /* 0x479000 */ { { 1, 4, 2, 73 } } }, { 33750, 0x4721, /* 0x959002 */ { { 1, 4, 4, 151 } } }, { 35500, 0x5877, /* 0x759001 */ { { 1, 4, 3, 119 } } }, { 36000, 0x5879, /* 0x9f9002 */ { { 1, 4, 4, 161 } } }, { 39822, 0xC459, /* 0x578c02 */ { { 1, 3, 4, 89 } } }, { 40000, 0x515F, /* 0x848c04 */ { { 1, 3, 6, 134 } } }, { 41164, 0x4417, /* 0x2c8c00 */ { { 1, 3, 2, 46 } } }, { 46981, 0x5069, /* 0x678c02 */ { { 1, 3, 4, 105 } } }, { 49500, 0xC353, /* 0xa48c04 */ { { 3, 3, 5, 138 } } }, { 50000, 0xC354, /* 0x368c00 */ { { 1, 3, 2, 56 } } }, { 56300, 0x4F76, /* 0x3d8c00 */ { { 1, 3, 2, 63 } } }, { 57275, 0, /* 0x3e8c00 */ { { 1, 3, 5, 157 } } }, /* For XO 1.5 no need for a unichrome clock */ { 57284, 0x4E70, /* 0x3e8c00 */ { { 1, 3, 2, 64 } } }, { 64995, 0x0D3B, /* 0x6b8c01 */ { { 1, 3, 3, 109 } } }, { 65000, 0x0D3B, /* 0x6b8c01 */ { { 1, 3, 3, 109 } } }, /* Slightly unstable on PM800 */ { 65028, 0x866D, /* 0x6b8c01 */ { { 1, 3, 3, 109 } } }, { 74480, 0x156E, /* 0x288800 */ { { 1, 2, 2, 42 } } }, { 75000, 0x156E, /* 0x288800 */ { { 1, 2, 2, 42 } } }, { 78800, 0x442C, /* 0x2a8800 */ { { 1, 2, 2, 44 } } }, { 81135, 0x0622, /* 0x428801 */ { { 1, 2, 3, 68 } } }, { 81613, 0x4539, /* 0x708803 */ { { 1, 2, 5, 114 } } }, { 94500, 0x4542, /* 0x4d8801 */ { { 1, 2, 3, 79 } } }, { 108000, 0x0B53, /* 0x778802 */ { { 1, 2, 4, 121 } } }, { 108280, 0x4879, /* 0x778802 */ { { 1, 2, 4, 121 } } }, { 122000, 0x0D6F, /* 0x428800 */ { { 1, 2, 2, 68 } } }, { 122726, 0x073C, /* 0x878802 */ { { 1, 2, 4, 137 } } }, { 135000, 0x0742, /* 0x6f8801 */ { { 1, 2, 3, 113 } } }, { 148500, 0x0853, /* 0x518800 */ { { 1, 2, 2, 83 } } }, { 155800, 0x0857, /* 0x558402 */ { { 1, 1, 4, 87 } } }, { 157500, 0x422C, /* 0x2a8400 */ { { 1, 1, 2, 44 } } }, { 161793, 0x4571, /* 0x6f8403 */ { { 1, 1, 5, 113 } } }, { 162000, 0x0A71, /* 0x6f8403 */ { { 1, 1, 5, 113 } } }, { 175500, 0x4231, /* 0x2f8400 */ { { 1, 1, 2, 49 } } }, { 189000, 0x0542, /* 0x4d8401 */ { { 1, 1, 3, 79 } } }, { 202500, 0x0763, /* 0x6F8402 */ { { 1, 1, 4, 113 } } }, { 204800, 0x0764, /* 0x548401 */ { { 1, 1, 3, 86 } } }, { 218300, 0x043D, /* 0x3b8400 */ { { 1, 1, 2, 61 } } }, { 229500, 0x0660, /* 0x3e8400 */ { { 1, 1, 2, 64 } } }, /* Not tested on Pro } */ { 0, 0, { { 0, 0, 0, 0 } } } }; /* * * Panel * */ #define VIA_RES_640X480 0 #define VIA_RES_800X600 1 #define VIA_RES_1024X768 2 #define VIA_RES_1152X864 3 #define VIA_RES_1280X1024 4 #define VIA_RES_1600X1200 5 #define VIA_RES_1440X1050 6 #define VIA_RES_1280X768 7 #define VIA_RES_1280X960 8 #define VIA_RES_1920X1440 9 #define VIA_RES_848X480 10 #define VIA_RES_1400X1050 11 #define VIA_RES_720X480 12 #define VIA_RES_720X576 13 #define VIA_RES_1024X512 14 #define VIA_RES_856X480 15 #define VIA_RES_1024X576 16 #define VIA_RES_800X480 17 #define VIA_RES_1280X800 18 #define VIA_RES_1280X720 19 #define VIA_RES_1920X1080 20 #define VIA_RES_1366X768 22 #define VIA_RES_1200X900 23 #define VIA_RES_INVALID 0xFF #define VIA_BIOS_REG_LCD_MAX_NUM 48 #define VIA_BIOS_NUM_LCD_SUPPORT_MASK 8 #define VIA_BIOS_NUM_PANEL 7 #define VIA_BIOS_MAX_NUM_MPATCH2 18 #define VIA_BIOS_MAX_NUM_MPATCH1 9 #define VIA_BIOS_MAX_NUM_CTREXP 5 typedef struct _VIALCDMODEENTRY { CARD16 LCDClk; CARD16 VClk; CARD16 LCDClk_12Bit; CARD16 VClk_12Bit; CARD8 port[VIA_BIOS_REG_LCD_MAX_NUM]; CARD8 offset[VIA_BIOS_REG_LCD_MAX_NUM]; CARD8 data[VIA_BIOS_REG_LCD_MAX_NUM]; int numEntry; } VIALCDModeEntry, *VIALCDModeEntryPtr; typedef struct _VIALCDMPATCHENTRY { CARD8 Mode; CARD16 LCDClk; CARD16 VClk; CARD16 LCDClk_12Bit; CARD16 VClk_12Bit; CARD8 port[VIA_BIOS_REG_LCD_MAX_NUM]; CARD8 offset[VIA_BIOS_REG_LCD_MAX_NUM]; CARD8 data[VIA_BIOS_REG_LCD_MAX_NUM]; int numEntry; } VIALCDMPatchEntry, *VIALCDMPatchEntryPtr; typedef struct _VIALCDMODETABLE { CARD8 fpIndex; CARD8 fpSize; CARD8 powerSeq; int numMPatchDP2Ctr; int numMPatchDP2Exp; int numMPatchDP1Ctr; int numMPatchDP1Exp; CARD16 SuptMode[VIA_BIOS_NUM_LCD_SUPPORT_MASK]; VIALCDModeEntry FPconfigTb; VIALCDModeEntry InitTb; VIALCDMPatchEntry MPatchDP2Ctr[VIA_BIOS_MAX_NUM_MPATCH2]; VIALCDMPatchEntry MPatchDP2Exp[VIA_BIOS_MAX_NUM_MPATCH2]; VIALCDMPatchEntry MPatchDP1Ctr[VIA_BIOS_MAX_NUM_MPATCH1]; VIALCDMPatchEntry MPatchDP1Exp[VIA_BIOS_MAX_NUM_MPATCH1]; VIALCDModeEntry LowResCtr; VIALCDModeEntry LowResExp; VIALCDModeEntry MCtr[VIA_BIOS_MAX_NUM_CTREXP]; VIALCDModeEntry MExp[VIA_BIOS_MAX_NUM_CTREXP]; } VIALCDModeTableRec, *VIALCDModePtr; static const VIALCDModeTableRec lcdTable[] = { { 0, 0, 0X1, 13, 13, 5, 5, { 0XE0FF, 0XF, 0XC0FC, 0X1B, 0, 0X7000, 0, 0X7000 }, { 0, 0, 0, 0, { 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X7A, 0X7B, 0X7C, 0X7D, 0X7E, 0X7F, 0X80, 0X81, 0X82, 0X83, 0X84, 0X85, 0X86, 0X87, 0X88, 0X89, 0X8A, 0X8B, 0X8C, 0X8D, 0X8E, 0X8F, 0X90, 0X68, 0X69, 0X92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0X1, 0X2, 0X3, 0X4, 0X7, 0XA, 0XD, 0X13, 0X16, 0X19, 0X1C, 0X1D, 0X1E, 0X1F, 0, 0, 0X88, 0XD, 0X5D, 0X79, 0XFF, 0X10, 0XB, 0X67, 0, 0X7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 26 }, { 0X407, 0X407, 0X4523, 0X4523, { 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD4, 0XD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} } }; static const int NumPowerOn = 2; static const int NumPowerOff = 2; typedef struct _VIALCDPOWERSEQUENCE { CARD8 powerSeq; CARD8 port[4]; CARD8 offset[4]; CARD8 mask[4]; CARD8 data[4]; CARD16 delay[4]; int numEntry; } VIALCDPowerSeqRec, *VIALCDPowerSeqRecPtr; #define VIA_BIOS_NUM_LCD_POWER_SEQ 4 static const VIALCDPowerSeqRec powerOn[] = { { 0, { 0XD4, 0XD4, 0, 0 }, { 0X91, 0X91, 0, 0 }, { 0X10, 0X8, 0, 0 }, { 0X10, 0X8, 0, 0 }, { 0X19, 0X64, 0, 0 }, 2 }, { 1, { 0XD4, 0XD4, 0XD4, 0 }, { 0X91, 0X91, 0X91, 0 }, { 0X10, 0X8, 0X6, 0 }, { 0X10, 0X8, 0X6, 0 }, { 0X19, 0X1FE, 0X1, 0 }, 3 }, { 2, { 0XC4, 0XD4, 0XC4, 0 }, { 0X3D, 0X91, 0X3D, 0 }, { 0X10, 0X8, 0X20, 0 }, { 0X10, 0X8, 0X20, 0 }, { 0X19, 0X1FE, 0X1, 0 }, 3 }, { 0, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 0 } }; static const VIALCDPowerSeqRec powerOff[] = { { 0, { 0XD4, 0, 0, 0 }, { 0X91, 0, 0, 0 }, { 0X18, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0X1, 0, 0, 0 }, 1 }, { 1, { 0XD4, 0XD4, 0XD4, 0 }, { 0X91, 0X91, 0X91, 0 }, { 0X6, 0X8, 0X10, 0 }, { 0, 0, 0, 0 }, { 0XD2, 0X19, 0X1, 0 }, 3 }, { 2, { 0XC4, 0XD4, 0XC4, 0 }, { 0X3D, 0X91, 0X3D, 0 }, { 0X20, 0X8, 0X10, 0 }, { 0, 0, 0, 0 }, { 0XD2, 0X19, 0X1, 0 }, 3 }, { 0, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 0 } }; typedef struct _VIALCDMODEFIX { CARD8 reqMode[32]; CARD8 fixMode[32]; int numEntry; } VIALCDModeFixRec, *VIALCDModeFixRecPtr; static const VIALCDModeFixRec modeFix = { { 0X1, 0X3, 0X7, 0X5, 0X2E, 0X2F, 0X52, 0X53, 0X56, 0X57, 0X5A, 0X5B, 0X67, 0X68, 0X5D, 0X5E, 0X7D, 0X7E, 0X23, 0X24, 0X26, 0X27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0X2, 0X2, 0X4, 0X30, 0X30, 0X50, 0X50, 0X54, 0X54, 0X58, 0X58, 0X66, 0X66, 0X5C, 0X5C, 0X7C, 0X7C, 0X22, 0X22, 0X25, 0X25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 22 }; #endif /* _VIA_MODE_H_ */ xf86-video-openchrome-0.6.0/src/via_memmgr.h0000664000175000017500000000416412760724526015577 00000000000000/* * Copyright 2011 James Simmons, 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 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. */ #ifndef _VIA_MEMMGR_H_ #define _VIA_MEMMGR_H_ #include #include "xf86.h" #define TTM_PL_FLAG_SYSTEM 1 #define TTM_PL_FLAG_TT 2 #define TTM_PL_FLAG_VRAM 4 struct buffer_object { off_t map_offset; unsigned long handle; unsigned long offset; /* Offset into fb */ unsigned long pitch; unsigned long size; void *ptr; int domain; }; /* In via_memory.c */ Bool drm_bo_manager_init(ScrnInfoPtr pScrn); struct buffer_object * drm_bo_alloc_surface(ScrnInfoPtr pScrn, unsigned int width, unsigned int height, int format, unsigned int alignment, int domain); struct buffer_object * drm_bo_alloc(ScrnInfoPtr pScrn, unsigned int size, unsigned int alignment, int domain); void *drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj); void drm_bo_unmap(ScrnInfoPtr pScrn, struct buffer_object *obj); void drm_bo_free(ScrnInfoPtr pScrn, struct buffer_object *); #endif xf86-video-openchrome-0.6.0/src/via_outputs.c0000664000175000017500000007254113054665201016024 00000000000000/* * Copyright 2016 Kevin Brace * Copyright 2005-2016 The OpenChrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ /* * via_outputs.c * * Everything to do with setting and changing xf86Outputs. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "via_driver.h" #include /* * Modetable nonsense. * */ #include "via_mode.h" /* * Sets IGA1 or IGA2 as the display output source for DIP0 * (Digital Interface Port 0) interface for CLE266 only. */ void viaDIP0SetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 temp = displaySource; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDIP0SetDisplaySource.\n")); /* Set DIP0 display output source. */ /* 3X5.6C[7] - DIP0 (Digital Interface Port 0) Data Source Selection * 0: Primary Display (IGA1) * 1: Secondary Display (IGA2) */ ViaCrtcMask(hwp, 0x6C, temp << 7, 0x80); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DIP0 Display Output Source: IGA%d\n", (temp & 0x01) + 1); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDIP0SetDisplaySource.\n")); } /* * Sets DIP0 (Digital Interface Port 0) I/O pad state. * This function is for CLE266 chipset only. */ void viaDIP0EnableIOPads(ScrnInfoPtr pScrn, CARD8 ioPadState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDIP0EnableIOPads.\n")); /* Set DIP0 I/O pad state. */ /* 3C5.1E[7:6] - DIP0 Power Control * 0x: Pad always off * 10: Depend on the other control signal * 11: Pad on/off according to the * Power Management Status (PMS) */ ViaSeqMask(hwp, 0x1E, ioPadState << 6, 0xC0); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DIP0 I/O Pad State: %s\n", (ioPadState & 0x02) ? (ioPadState & 0x01) ? "Automatic On / Off" : "Conditional" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDIP0EnableIOPads.\n")); } /* * Sets DIP0 (Digital Interface Port 0) clock I/O pad drive strength * for CLE266 chipset only. */ void viaDIP0SetClockDriveStrength(ScrnInfoPtr pScrn, CARD8 clockDriveStrength) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDIP0SetClockDriveStrength.\n")); /* 3C5.1E[2] - DIP0 Clock Drive Strength Bit [0] */ ViaSeqMask(hwp, 0x1E, clockDriveStrength << 2, 0x04); /* 3C5.2A[4] - DIP0 Clock Drive Strength Bit [1] */ ViaSeqMask(hwp, 0x2A, clockDriveStrength << 3, 0x10); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DIP0 Clock I/O Pad Drive Strength: %u\n", clockDriveStrength & 0x03); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDIP0SetClockDriveStrength.\n")); } /* * Sets DIP0 (Digital Interface Port 0) data I/O pads drive strength * for CLE266 chipset only. */ void viaDIP0SetDataDriveStrength(ScrnInfoPtr pScrn, CARD8 dataDriveStrength) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDIP0SetDataDriveStrength.\n")); /* 3C5.1B[1] - DIP0 Data Drive Strength Bit [0] */ ViaSeqMask(hwp, 0x1B, dataDriveStrength << 1, 0x02); /* 3C5.2A[5] - DIP0 Data Drive Strength Bit [1] */ ViaSeqMask(hwp, 0x2A, dataDriveStrength << 4, 0x20); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DIP0 Data I/O Pads Drive Strength: %u\n", dataDriveStrength); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDIP0SetDataDriveStrength.\n")); } /* * Sets IGA1 or IGA2 as the display output source for DVP0 * (Digital Video Port) interface. */ void viaDVP0SetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 temp = displaySource; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDVP0SetDisplaySource.\n")); /* Set DVP0 display output source. */ /* 3X5.96[4] - DVP0 Data Source Selection * 0: Primary Display * 1: Secondary Display */ ViaCrtcMask(hwp, 0x96, temp << 4, 0x10); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DVP0 Display Output Source: IGA%d\n", (temp & 0x01) + 1); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDVP0SetDisplaySource.\n")); } /* * Sets DVP0 (Digital Video Port 0) I/O pad state. */ void viaDVP0EnableIOPads(ScrnInfoPtr pScrn, CARD8 ioPadState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDVP0EnableIOPads.\n")); /* Set DVP0 I/O pad state. */ /* 3C5.1E[7:6] - DVP0 Power Control * 0x: Pad always off * 10: Depend on the other control signal * 11: Pad on/off according to the * Power Management Status (PMS) */ ViaSeqMask(hwp, 0x1E, ioPadState << 6, 0xC0); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DVP0 I/O Pad State: %s\n", (ioPadState & 0x02) ? (ioPadState & 0x01) ? "Automatic On / Off" : "Conditional" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDVP0EnableIOPads.\n")); } /* * Sets DVP0 (Digital Video Port 0) clock I/O pad drive strength. */ void viaDVP0SetClockDriveStrength(ScrnInfoPtr pScrn, CARD8 clockDriveStrength) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDVP0SetClockDriveStrength.\n")); /* 3C5.1E[2] - DVP0 Clock Drive Strength Bit [0] */ ViaSeqMask(hwp, 0x1E, clockDriveStrength << 2, 0x04); /* 3C5.2A[4] - DVP0 Clock Drive Strength Bit [1] */ ViaSeqMask(hwp, 0x2A, clockDriveStrength << 3, 0x10); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DVP0 Clock I/O Pad Drive Strength: %u\n", clockDriveStrength & 0x03); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDVP0SetClockDriveStrength.\n")); } /* * Sets DVP0 (Digital Video Port 0) data I/O pads drive strength. */ void viaDVP0SetDataDriveStrength(ScrnInfoPtr pScrn, CARD8 dataDriveStrength) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDVP0SetDataDriveStrength.\n")); /* 3C5.1B[1] - DVP0 Data Drive Strength Bit [0] */ ViaSeqMask(hwp, 0x1B, dataDriveStrength << 1, 0x02); /* 3C5.2A[5] - DVP0 Data Drive Strength Bit [1] */ ViaSeqMask(hwp, 0x2A, dataDriveStrength << 4, 0x20); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DVP0 Data I/O Pads Drive Strength: %u\n", dataDriveStrength); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDVP0SetDataDriveStrength.\n")); } /* * Sets IGA1 or IGA2 as the display output source for DVP1 * (Digital Video Port) interface. */ void viaDVP1SetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 temp = displaySource; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDVP1SetDisplaySource.\n")); /* Set DVP1 display output source. */ /* 3X5.9B[4] - DVP1 Data Source Selection * 0: Primary Display * 1: Secondary Display */ ViaCrtcMask(hwp, 0x9B, temp << 4, 0x10); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DVP1 Display Output Source: IGA%d\n", (temp & 0x01) + 1); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDVP1SetDisplaySource.\n")); } /* * Sets DVP1 (Digital Video Port 1) I/O pad state. */ void viaDVP1EnableIOPads(ScrnInfoPtr pScrn, CARD8 ioPadState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDVP1EnableIOPads.\n")); /* Set DVP1 I/O pad state. */ /* 3C5.1E[5:4] - DVP1 Power Control * 0x: Pad always off * 10: Depend on the other control signal * 11: Pad on/off according to the * Power Management Status (PMS) */ ViaSeqMask(hwp, 0x1E, ioPadState << 4, 0x30); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DVP1 I/O Pad State: %s\n", (ioPadState & 0x02) ? (ioPadState & 0x01) ? "Automatic On / Off": "Conditional" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDVP1EnableIOPads.\n")); } /* * Sets DVP1 (Digital Video Port 1) clock I/O pad drive strength. */ void viaDVP1SetClockDriveStrength(ScrnInfoPtr pScrn, CARD8 clockDriveStrength) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDVP1SetClockDriveStrength.\n")); /* 3C5.65[3:2] - DVP1 Clock Pads Driving Select * 00: lowest * 01: low * 10: high * 11: highest */ ViaSeqMask(hwp, 0x65, clockDriveStrength << 2, 0x0C); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DVP1 Clock I/O Pad Drive Strength: %u\n", clockDriveStrength & 0x03); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDVP1SetClockDriveStrength.\n")); } /* * Sets DVP1 (Digital Video Port 1) data I/O pads drive strength. */ void viaDVP1SetDataDriveStrength(ScrnInfoPtr pScrn, CARD8 dataDriveStrength) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDVP1SetDataDriveStrength.\n")); /* 3C5.65[1:0] - DVP1 Data Pads Driving Select * 00: lowest * 01: low * 10: high * 11: highest */ ViaSeqMask(hwp, 0x65, dataDriveStrength, 0x03); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DVP1 Data I/O Pads Drive Strength: %u\n", dataDriveStrength & 0x03); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDVP1SetDataDriveStrength.\n")); } /* * Sets IGA1 or IGA2 as the display output source for VIA Technologies * Chrome IGP DFP (Digital Flat Panel) Low interface. */ void viaDFPLowSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 temp = displaySource; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDFPLowSetDisplaySource.\n")); /* Set DFP Low display output source. */ /* 3X5.99[4] - DFP Low Data Source Selection * 0: Primary Display * 1: Secondary Display */ ViaCrtcMask(hwp, 0x99, temp << 4, 0x10); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DFP Low Display Output Source: IGA%d\n", (temp & 0x01) + 1); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDFPLowSetDisplaySource.\n")); } /* * Sets DFP (Digital Flat Panel) Low I/O pad state. */ void viaDFPLowEnableIOPads(ScrnInfoPtr pScrn, CARD8 ioPadState) { vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaDFPLowEnableIOPads.\n")); /* Set DFP Low I/O pad state. */ /* 3C5.2A[1:0] - DFP Low Power Control * 0x: Pad always off * 10: Depend on the other control signal * 11: Pad on/off according to the * Power Management Status (PMS) */ ViaSeqMask(hwp, 0x2A, ioPadState, 0x03); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DFP Low I/O Pad State: %s\n", (ioPadState & 0x02) ? (ioPadState & 0x01) ? "Automatic On / Off": "Conditional" : "Off"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaDFPLowEnableIOPads.\n")); } /* * Reads off the VIA Technologies IGP pin strapping for * display detection purposes. */ void viaProbePinStrapping(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); CARD8 sr12, sr13, sr5a; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaProbePinStrapping.\n")); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Probing VIA Technologies IGP pin strapping . . .\n"); if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { sr5a = hwp->readSeq(hwp, 0x5A); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR5A: 0x%02X\n", sr5a)); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 0.\n"); ViaSeqMask(hwp, 0x5A, sr5a & 0xFE, 0x01); } sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); switch (pVia->Chipset) { case VIA_CLE266: /* 3C5.12[4] - FPD17 pin strapping * 0: TMDS transmitter (DVI) / capture device * 1: Flat panel */ if (sr12 & 0x10) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "A flat panel is connected to " "flat panel interface.\n"); /* 3C5.12[3:0] - FPD16-13 pin strapping * 0 ~ 15: Flat panel code defined * by VIA Technologies */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected Flat Panel Type from " "Strapping Pins: %d\n", sr12 & 0x0F); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "A TMDS transmitter (DVI) / capture device is " "connected to DIP0.\n"); } /* 3C5.12[5] - FPD18 pin strapping * 0: TMDS transmitter (DVI) * 1: TV encoder */ if (sr12 & 0x20) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "A TV encoder is connected to " "DIP0.\n"); /* 3C5.13[4:3] - FPD21-20 pin strapping * 00: PAL * 01: NTSC * 10: PAL-N * 11: PAL-NC */ if ((!(sr13 & 0x08)) && (sr13 & 0x04)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "NTSC for the TV encoder.\n"); } else { if (!(sr13 & 0x08)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PAL for the TV encoder.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PAL%s for the TV encoder.\n", (sr13 & 0x04) ? "-NC" : "-N"); } } /* 3C5.12[6] - FPD19 pin strapping * 0: 525 lines (NTSC) * 1: 625 lines (PAL) */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s lines for the TV encoder.\n", (sr12 & 0x40) ? "625" : "525"); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "A TMDS transmitter (DVI) is connected to " "DIP0.\n"); } break; case VIA_KM400: case VIA_K8M800: case VIA_PM800: case VIA_P4M800PRO: /* 3C5.12[6] - DVP0D6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) for * DVI or TV out use * 1: Enable DVP0 (Digital Video Port 0) for * DVI or TV out use */ if (sr12 & 0x40) { /* 3C5.12[5] - DVP0D5 pin strapping * 0: TMDS transmitter (DVI) * 1: TV encoder */ if (sr12 & 0x20) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "A TV encoder is detected on " "DVP0 (Digital Video Port 0).\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "A TMDS transmitter (DVI) is detected on " "DVP0 (Digital Video Port 0).\n"); } } /* 3C5.13[3] - DVP0D8 pin strapping * 0: AGP pins are used for AGP * 1: AGP pins are used by FPDP * (Flat Panel Display Port) */ if (sr13 & 0x08) { /* 3C5.12[4] - DVP0D4 pin strapping * 0: Dual 12-bit FPDP (Flat Panel Display Port) * 1: 24-bit FPDP (Flat Panel Display Port) */ if (sr12 & 0x10) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "24-bit FPDP (Flat Panel Display Port) " "detected.\n"); /* 3C5.12[3:0] - DVP0D3-0 pin strapping * 0 ~ 15: Flat panel code defined * by VIA Technologies */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected Flat Panel Type from " "Strapping Pins: %d\n", sr12 & 0x0F); } else { /* 3C5.12[6] - DVP0D6 pin strapping * 0: Disable DVP0 (Digital Video Port 0) for * DVI or TV out use * 1: Enable DVP0 (Digital Video Port 0) for * DVI or TV out use * 3C5.12[5] - DVP0D5 pin strapping * 0: TMDS transmitter (DVI) * 1: TV encoder */ if ((!(sr12 & 0x40)) && (!(sr12 & 0x20))) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "A TV encoder is connected to " "FPDP (Flat Panel Display Port).\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Dual 12-bit FPDP (Flat Panel Display Port) " "detected.\n"); /* 3C5.12[3:0] - DVP0D3-0 pin strapping * 0 ~ 15: Flat panel code defined * by VIA Technologies */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected Flat Panel Type from " "Strapping Pins: %d\n", sr12 & 0x0F); } } } break; default: break; } if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting 3C5.5A[0] to 1.\n"); ViaSeqMask(hwp, 0x5A, sr5a | 0x01, 0x01); sr12 = hwp->readSeq(hwp, 0x12); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR12: 0x%02X\n", sr12)); sr13 = hwp->readSeq(hwp, 0x13); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SR13: 0x%02X\n", sr13)); /* 3C5.13[7:6] - Integrated LVDS / DVI Mode Select * (DVP1D15-14 pin strapping) * 00: LVDS1 + LVDS2 * 01: DVI + LVDS2 * 10: Dual LVDS Channel (High Resolution Panel) * 11: One DVI only (decrease the clock jitter) */ switch (sr13 & 0xC0) { case 0x00: xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS1 + LVDS2 detected.\n"); break; case 0x40: xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Single Link DVI + LVDS2 detected.\n"); break; case 0x80: xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Dual Channel LVDS detected.\n"); break; case 0xC0: xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Single Link DVI detected.\n"); break; default: break; } hwp->writeSeq(hwp, 0x5A, sr5a); } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaProbePinStrapping.\n")); } void viaOutputDetect(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaOutputDetect.\n")); pBIOSInfo->analog = NULL; /* Initialize the number of VGA connectors. */ pVia->numberVGA = 0; /* Initialize the number of DVI connectors. */ pVia->numberDVI = 0; /* Initialize the number of FP connectors. */ pVia->numberFP = 0; /* Read off the VIA Technologies IGP pin strapping for display detection purposes. */ viaProbePinStrapping(pScrn); /* VGA */ via_analog_init(pScrn); /* TV */ via_tv_init(pScrn); /* DVI */ via_dvi_init(pScrn); /* LVDS */ via_lvds_init(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaOutputDetect.\n")); } #ifdef HAVE_DEBUG /* * Returns: * Bit[7] 2nd Path * Bit[6] 1/0 MHS Enable/Disable * Bit[5] 0 = Bypass Callback, 1 = Enable Callback * Bit[4] 0 = Hot-Key Sequence Control (OEM Specific) * Bit[3] LCD * Bit[2] TV * Bit[1] CRT * Bit[0] DVI */ static CARD8 VIAGetActiveDisplay(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); CARD8 tmp; tmp = (hwp->readCrtc(hwp, 0x3E) >> 4); tmp |= ((hwp->readCrtc(hwp, 0x3B) & 0x18) << 3); return tmp; } #endif /* HAVE_DEBUG */ /* * */ CARD32 ViaGetMemoryBandwidth(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaGetMemoryBandwidth. Memory type: %d\n", pVia->MemClk)); switch (pVia->MemClk) { case VIA_MEM_SDR66: case VIA_MEM_SDR100: case VIA_MEM_SDR133: return VIA_BW_MIN; case VIA_MEM_DDR200: return VIA_BW_DDR200; case VIA_MEM_DDR266: case VIA_MEM_DDR333: case VIA_MEM_DDR400: return VIA_BW_DDR400; case VIA_MEM_DDR533: case VIA_MEM_DDR667: return VIA_BW_DDR667; case VIA_MEM_DDR800: case VIA_MEM_DDR1066: return VIA_BW_DDR1066; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaBandwidthAllowed: Unknown memory type: %d\n", pVia->MemClk); return VIA_BW_MIN; } } /* * * Some very common abstractions. * */ /* * Standard vga call really. * Needs to be called to reset the dotclock (after SR40:2/1 reset) */ void ViaSetUseExternalClock(vgaHWPtr hwp) { CARD8 data; DEBUG(xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "ViaSetUseExternalClock\n")); data = hwp->readMiscOut(hwp); hwp->writeMiscOut(hwp, data | 0x0C); } /* * */ static void ViaSetDotclock(ScrnInfoPtr pScrn, CARD32 clock, int base, int probase) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, "ViaSetDotclock to 0x%06x\n", (unsigned)clock)); if ((pVia->Chipset == VIA_CLE266) || (pVia->Chipset == VIA_KM400)) { hwp->writeSeq(hwp, base, clock >> 8); hwp->writeSeq(hwp, base+1, clock & 0xFF); } else { /* unichrome pro */ union pllparams pll; int dtz, dr, dn, dm; pll.packed = clock; dtz = pll.params.dtz; dr = pll.params.dr; dn = pll.params.dn; dm = pll.params.dm; /* The VX855 and VX900 do not modify dm/dn, but earlier chipsets do. */ if ((pVia->Chipset != VIA_VX855) && (pVia->Chipset != VIA_VX900)) { dm -= 2; dn -= 2; } hwp->writeSeq(hwp, probase, dm & 0xff); hwp->writeSeq(hwp, probase+1, ((dm >> 8) & 0x03) | (dr << 2) | ((dtz & 1) << 7)); hwp->writeSeq(hwp, probase+2, (dn & 0x7f) | ((dtz & 2) << 6)); } } /* * */ void ViaSetPrimaryDotclock(ScrnInfoPtr pScrn, CARD32 clock) { vgaHWPtr hwp = VGAHWPTR(pScrn); ViaSetDotclock(pScrn, clock, 0x46, 0x44); ViaSeqMask(hwp, 0x40, 0x02, 0x02); ViaSeqMask(hwp, 0x40, 0x00, 0x02); } /* * */ void ViaSetSecondaryDotclock(ScrnInfoPtr pScrn, CARD32 clock) { vgaHWPtr hwp = VGAHWPTR(pScrn); ViaSetDotclock(pScrn, clock, 0x44, 0x4A); ViaSeqMask(hwp, 0x40, 0x04, 0x04); ViaSeqMask(hwp, 0x40, 0x00, 0x04); } /* * */ static void ViaSetECKDotclock(ScrnInfoPtr pScrn, CARD32 clock) { /* Does the non-pro chip have an ECK clock ? */ ViaSetDotclock(pScrn, clock, 0, 0x47); } static CARD32 ViaComputeDotClock(unsigned clock) { double fout, fref, err, minErr; CARD32 dr, dn, dm, maxdm, maxdn; CARD32 factual, best; fref = 14.31818e6; fout = (double)clock * 1.e3; factual = ~0; maxdm = 127; maxdn = 7; minErr = 1e10; best = 0; for (dr = 0; dr < 4; ++dr) { for (dn = (dr == 0) ? 2 : 1; dn <= maxdn; ++dn) { for (dm = 1; dm <= maxdm; ++dm) { factual = fref * dm; factual /= (dn << dr); err = fabs((double)factual / fout - 1.); if (err < minErr) { minErr = err; best = (dm & 127) | ((dn & 31) << 8) | (dr << 14); } } } } return best; } static CARD32 ViaComputeProDotClock(unsigned clock) { double fvco, fout, err, minErr; CARD32 dr = 0, dn, dm, maxdm, maxdn; CARD32 factual; union pllparams bestClock; fout = (double)clock * 1.e3; factual = ~0; maxdm = factual / 14318000U; minErr = 1.e10; bestClock.packed = 0U; do { fvco = fout * (1 << dr); } while (fvco < 300.e6 && dr++ < 8); if (dr == 8) { return 0; } if (clock < 30000) maxdn = 8; else if (clock < 45000) maxdn = 7; else if (clock < 170000) maxdn = 6; else maxdn = 5; for (dn = 2; dn < maxdn; ++dn) { for (dm = 2; dm < maxdm; ++dm) { factual = 14318000U * dm; factual /= dn << dr; if ((err = fabs((double)factual / fout - 1.)) < 0.005) { if (err < minErr) { minErr = err; bestClock.params.dtz = 1; bestClock.params.dr = dr; bestClock.params.dn = dn; bestClock.params.dm = dm; } } } } return bestClock.packed; } /* * */ CARD32 ViaModeDotClockTranslate(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIAPtr pVia = VIAPTR(pScrn); int i; if ((pVia->Chipset == VIA_CLE266) || (pVia->Chipset == VIA_KM400)) { CARD32 best1 = 0, best2; for (i = 0; ViaDotClocks[i].DotClock; i++) if (ViaDotClocks[i].DotClock == mode->Clock) { best1 = ViaDotClocks[i].UniChrome; break; } best2 = ViaComputeDotClock(mode->Clock); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaComputeDotClock %d : %04x : %04x\n", mode->Clock, (unsigned int)best1, (unsigned int)best2)); return best2; } else { for (i = 0; ViaDotClocks[i].DotClock; i++) if (ViaDotClocks[i].DotClock == mode->Clock) return ViaDotClocks[i].UniChromePro.packed; return ViaComputeProDotClock(mode->Clock); } return 0; } xf86-video-openchrome-0.6.0/src/compat-api.h0000664000175000017500000000704013033607754015477 00000000000000/* * Copyright 2012 Red Hat, Inc. * * 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. * * Author: Dave Airlie */ /* this file provides API compat between server post 1.13 and pre it, it should be reused inside as many drivers as possible */ #ifndef COMPAT_API_H #define COMPAT_API_H #ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR #define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum] #define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p #endif #ifndef XF86_HAS_SCRN_CONV #define xf86ScreenToScrn(s) xf86Screens[(s)->myNum] #define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex] #endif #ifndef XF86_SCRN_INTERFACE #define SCRN_ARG_TYPE int #define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)] #define SCREEN_ARG_TYPE int #define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)] #define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScreen, int argc, char **argv #define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask #define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask #define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen #define CLOSE_SCREEN_ARGS scrnIndex, pScreen #define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags #define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags #define FREE_SCREEN_ARGS_DECL int arg, int flags #define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0 #define VT_FUNC_ARGS_DECL int arg, int flags #define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags) #define XF86_SCRN_ARG(x) ((x)->scrnIndex) #else #define SCRN_ARG_TYPE ScrnInfoPtr #define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1) #define SCREEN_ARG_TYPE ScreenPtr #define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1) #define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv #if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0) #define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout #define BLOCKHANDLER_ARGS arg, pTimeout #else #define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask #define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask #endif #define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen #define CLOSE_SCREEN_ARGS pScreen #define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y #define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode #define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg #define FREE_SCREEN_ARGS(x) (x) #define VT_FUNC_ARGS_DECL ScrnInfoPtr arg #define VT_FUNC_ARGS(flags) pScrn #define XF86_SCRN_ARG(x) (x) #endif #endif xf86-video-openchrome-0.6.0/src/via_dri.c0000664000175000017500000007617613054665201015067 00000000000000/* * Copyright 2005-2015 The Openchrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Priv.h" #include "xf86Pci.h" #define _XF86DRI_SERVER_ #include "GL/glxtokens.h" #include "sarea.h" #include "via_driver.h" #include "via_drm.h" #include "via_dri.h" #include "xf86drm.h" #ifndef DRIINFO_MAJOR_VERSION #define DRIINFO_MAJOR_VERSION 4 #endif #ifndef DRIINFO_MINOR_VERSION #define DRIINFO_MINOR_VERSION 0 #endif #define VIDEO 0 #define AGP 1 #define AGP_CMDBUF_PAGES 512 #define AGP_CMDBUF_SIZE (AGP_PAGE_SIZE * AGP_CMDBUF_PAGES) #define VIA_AGP_MODE_MASK 0x17 #define VIA_AGPv3_MODE 0x08 #define VIA_AGPv3_8X_MODE 0x02 #define VIA_AGPv3_4X_MODE 0x01 #define VIA_AGP_4X_MODE 0x04 #define VIA_AGP_2X_MODE 0x02 #define VIA_AGP_1X_MODE 0x01 #define VIA_AGP_FW_MODE 0x10 extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig * configs, void **configprivs); typedef struct { int major; int minor; int patchlevel; } ViaDRMVersion; static char VIAKernelDriverName[] = "via"; static char VIAClientDriverName[] = "unichrome"; static const ViaDRMVersion drmExpected = { 1, 3, 0 }; static const ViaDRMVersion drmCompat = { 2, 0, 0 }; static Bool VIAInitVisualConfigs(ScreenPtr pScreen); static Bool VIADRIMapInit(ScreenPtr pScreen, VIAPtr pVia); static Bool VIACreateContext(ScreenPtr pScreen, VisualPtr visual, drm_context_t hwContext, void *pVisualConfigPriv, DRIContextType contextStore); static void VIADestroyContext(ScreenPtr pScreen, drm_context_t hwContext, DRIContextType contextStore); static void VIADRISwapContext(ScreenPtr pScreen, DRISyncType syncType, DRIContextType readContextType, void *readContextStore, DRIContextType writeContextType, void *writeContextStore); static void VIADRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index); static void VIADRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, RegionPtr prgnSrc, CARD32 index); void kickVblank(ScrnInfoPtr pScrn) { /* * Switching mode will clear registers that make vblank * interrupts happen. If the driver thinks interrupts * are enabled, make sure vblank interrupts go through. * registers are not documented in VIA docs. */ VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); VIADRIPtr pVIADRI = pVia->pDRIInfo->devPrivate; if (pVIADRI->irqEnabled) hwp->writeCrtc(hwp, 0x11, hwp->readCrtc(hwp, 0x11) | 0x30); } static void VIADRIIrqInit(ScrnInfoPtr pScrn, VIADRIPtr pVIADRI) { VIAPtr pVia = VIAPTR(pScrn); pVIADRI->irqEnabled = drmGetInterruptFromBusID (pVia->drmmode.fd, #ifdef HAVE_PCIACCESS ((pVia->PciInfo->domain << 8) | pVia->PciInfo->bus), pVia->PciInfo->dev, pVia->PciInfo->func #else ((pciConfigPtr)pVia->PciInfo->thisCard)->busnum, ((pciConfigPtr)pVia->PciInfo->thisCard)->devnum, ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum #endif ); if ((drmCtlInstHandler(pVia->drmmode.fd, pVIADRI->irqEnabled))) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[drm] Failure adding IRQ handler. " "Falling back to IRQ-free operation.\n"); pVIADRI->irqEnabled = 0; } if (pVIADRI->irqEnabled) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] IRQ handler installed, using IRQ %d.\n", pVIADRI->irqEnabled); } static void VIADRIIrqExit(ScrnInfoPtr pScrn, VIADRIPtr pVIADRI) { VIAPtr pVia = VIAPTR(pScrn); if (pVIADRI->irqEnabled) { if (drmCtlUninstHandler(pVia->drmmode.fd)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] IRQ handler uninstalled.\n"); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] Could not uninstall IRQ handler.\n"); } } } void VIADRIRingBufferCleanup(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); VIADRIPtr pVIADRI = pVia->pDRIInfo->devPrivate; if (pVIADRI->ringBufActive) { drm_via_dma_init_t ringBufInit; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Cleaning up DMA ring-buffer.\n"); ringBufInit.func = VIA_CLEANUP_DMA; if (drmCommandWrite(pVia->drmmode.fd, DRM_VIA_DMA_INIT, &ringBufInit, sizeof(ringBufInit))) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[drm] Failed to clean up DMA ring-buffer: %d\n", errno); } pVIADRI->ringBufActive = 0; } } Bool VIADRIRingBufferInit(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); VIADRIPtr pVIADRI = pVia->pDRIInfo->devPrivate; if (pVIADRI->ringBufActive) return TRUE; if (pVia->agpEnable) { drm_via_dma_init_t ringBufInit; if ((pVia->drmVerMajor == 1) && (pVia->drmVerMinor <= 3)) return FALSE; /* * Info from code-snippet on DRI-DEVEL list; Erdi Chen. */ switch (pVia->ChipId) { case PCI_CHIP_VT3314: case PCI_CHIP_VT3259: pVIADRI->reg_pause_addr = 0x40c; break; default: pVIADRI->reg_pause_addr = 0x418; break; } ringBufInit.offset = pVia->agpSize; ringBufInit.size = AGP_CMDBUF_SIZE; ringBufInit.reg_pause_addr = pVIADRI->reg_pause_addr; ringBufInit.func = VIA_INIT_DMA; if (drmCommandWrite(pVia->drmmode.fd, DRM_VIA_DMA_INIT, &ringBufInit, sizeof(ringBufInit))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] Failed to initialize DMA ring-buffer: %d\n", errno); return FALSE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Initialized AGP ring-buffer, size 0x%lx at AGP " "offset 0x%lx.\n", ringBufInit.size, ringBufInit.offset); pVIADRI->ringBufActive = 1; } return TRUE; } static Bool VIASetAgpMode(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); CARD32 mode = drmAgpGetMode(pVia->drmmode.fd); unsigned int vendor = drmAgpVendorId(pVia->drmmode.fd); unsigned int device = drmAgpDeviceId(pVia->drmmode.fd); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Detected AGP " "vendor 0x%04x, device 0x%04x\n", vendor, device); mode &= ~VIA_AGP_MODE_MASK; if (mode & VIA_AGPv3_MODE) { mode |= VIA_AGPv3_8X_MODE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Found AGP v3 " "compatible device. Trying AGP 8X mode.\n"); } else { mode |= VIA_AGP_4X_MODE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Didn't find any AGP v3 " "compatible device. Trying AGP 4X mode.\n"); } mode |= VIA_AGP_FW_MODE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Trying to enable AGP fast writes.\n"); if (drmAgpEnable(pVia->drmmode.fd, mode) < 0) return FALSE; return TRUE; } static Bool VIADRIAgpInit(ScrnInfoPtr pScrn) { unsigned long agpCmdSize, agp_phys; VIAPtr pVia = VIAPTR(pScrn); drm_handle_t handle; drmAddress agpaddr; drm_via_agp_t agp; int agpPages; pVia->agpSize = 0; if (drmAgpAcquire(pVia->drmmode.fd) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] drmAgpAcquire failed %d\n", errno); return FALSE; } if (!VIASetAgpMode(pScrn)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] VIASetAgpMode failed\n"); drmAgpRelease(pVia->drmmode.fd); return FALSE; } agpCmdSize = (pVia->agpEnable) ? AGP_CMDBUF_SIZE : 0; if (pVia->agpMem * 1024 < agpCmdSize + AGP_PAGE_SIZE) { pVia->agpMem = (agpCmdSize + AGP_PAGE_SIZE) / 1024; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Forcing AGP size to %d kB\n", pVia->agpMem); } agpPages = (pVia->agpMem * 1024 + AGP_PAGE_SIZE - 1) / AGP_PAGE_SIZE; if (drmAgpAlloc(pVia->drmmode.fd, agpPages * AGP_PAGE_SIZE, 0, &agp_phys, &pVia->agpHandle) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] drmAgpAlloc failed\n"); drmAgpRelease(pVia->drmmode.fd); return FALSE; } if (drmAgpBind(pVia->drmmode.fd, pVia->agpHandle, 0) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] drmAgpBind failed\n"); drmAgpFree(pVia->drmmode.fd, pVia->agpHandle); drmAgpRelease(pVia->drmmode.fd); return FALSE; } /* * Place the ring-buffer last in the AGP region, and restrict the * public map not to include the buffer for security reasons. */ pVia->agpSize = agpPages * AGP_PAGE_SIZE - agpCmdSize; pVia->agpAddr = drmAgpBase(pVia->drmmode.fd); agp.offset = 0; agp.size = pVia->agpSize; if (drmCommandWrite(pVia->drmmode.fd, DRM_VIA_AGP_INIT, &agp, sizeof(drm_via_agp_t)) < 0) { drmAgpUnbind(pVia->drmmode.fd, pVia->agpHandle); drmAgpFree(pVia->drmmode.fd, pVia->agpHandle); drmAgpRelease(pVia->drmmode.fd); return FALSE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] drmAgpEnabled succeeded\n"); /* Allocate all of AGP memory */ if (drmAddMap(pVia->drmmode.fd, 0, pVia->agpSize, DRM_AGP, 0, &handle) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] Failed to map public agp area.\n"); pVia->agpSize = 0; drmAgpUnbind(pVia->drmmode.fd, pVia->agpHandle); drmAgpFree(pVia->drmmode.fd, pVia->agpHandle); drmAgpRelease(pVia->drmmode.fd); return FALSE; } drmMap(pVia->drmmode.fd, handle, pVia->agpSize, &agpaddr); pVia->agpMappedAddr = agpaddr; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] agpAddr = 0x%08lx\n", pVia->agpAddr); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] agpSize = 0x%08x\n", pVia->agpSize); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] agp physical addr = %p\n", pVia->agpMappedAddr); return TRUE; } static Bool VIADRIFBInit(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); drm_via_fb_t fb; fb.offset = pVia->FBFreeStart; fb.size = pVia->FBFreeEnd; if (drmCommandWrite(pVia->drmmode.fd, DRM_VIA_FB_INIT, &fb, sizeof(drm_via_fb_t)) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] Failed to initialize frame buffer area.\n"); return FALSE; } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Using %d KB for DRM memory heap.\n", fb.size >> 10); return TRUE; } } static Bool VIAInitVisualConfigs(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); int numConfigs = 0; __GLXvisualConfig *pConfigs = 0; VIAConfigPrivPtr pVIAConfigs = 0; VIAConfigPrivPtr *pVIAConfigPtrs = 0; int i, db, stencil, accum; if (pScrn->bitsPerPixel == 16 || pScrn->bitsPerPixel == 32) { numConfigs = 12; if (!(pConfigs = (__GLXvisualConfig *) calloc(sizeof(__GLXvisualConfig), numConfigs))) return FALSE; if (!(pVIAConfigs = (VIAConfigPrivPtr) calloc(sizeof(VIAConfigPrivRec), numConfigs))) { free(pConfigs); return FALSE; } if (!(pVIAConfigPtrs = (VIAConfigPrivPtr *) calloc(sizeof(VIAConfigPrivPtr), numConfigs))) { free(pConfigs); free(pVIAConfigs); return FALSE; } for (i = 0; i < numConfigs; i++) pVIAConfigPtrs[i] = &pVIAConfigs[i]; i = 0; for (accum = 0; accum <= 1; accum++) { /* 32bpp depth buffer disabled, as Mesa has limitations */ for (stencil = 0; stencil <= 2; stencil++) { for (db = 0; db <= 1; db++) { pConfigs[i].vid = -1; pConfigs[i].class = -1; pConfigs[i].rgba = TRUE; pConfigs[i].redSize = -1; pConfigs[i].greenSize = -1; pConfigs[i].blueSize = -1; pConfigs[i].redMask = -1; pConfigs[i].greenMask = -1; pConfigs[i].blueMask = -1; if (pScrn->bitsPerPixel == 32) { pConfigs[i].alphaSize = 8; pConfigs[i].alphaMask = 0xFF000000; } else { pConfigs[i].alphaSize = 0; pConfigs[i].alphaMask = 0; } if (accum) { pConfigs[i].accumRedSize = 16; pConfigs[i].accumGreenSize = 16; pConfigs[i].accumBlueSize = 16; if (pScrn->bitsPerPixel == 32) pConfigs[i].accumAlphaSize = 16; else pConfigs[i].accumAlphaSize = 0; } 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 (stencil) { case 0: pConfigs[i].depthSize = 24; pConfigs[i].stencilSize = 8; break; case 1: pConfigs[i].depthSize = 16; pConfigs[i].stencilSize = 0; break; case 2: pConfigs[i].depthSize = 0; pConfigs[i].stencilSize = 0; break; case 3: pConfigs[i].depthSize = 32; pConfigs[i].stencilSize = 0; break; } pConfigs[i].auxBuffers = 0; pConfigs[i].level = 0; if (accum) pConfigs[i].visualRating = GLX_SLOW_VISUAL_EXT; else pConfigs[i].visualRating = GLX_NONE_EXT; pConfigs[i].transparentPixel = GLX_NONE_EXT; 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 DRI.\n"); if (pConfigs) free(pConfigs); if (pVIAConfigs) free(pVIAConfigs); if (pVIAConfigPtrs) free(pVIAConfigPtrs); return FALSE; } } pVia->numVisualConfigs = numConfigs; pVia->pVisualConfigs = pConfigs; pVia->pVisualConfigsPriv = pVIAConfigs; GlxSetVisualConfigs(numConfigs, pConfigs, (void **)pVIAConfigPtrs); return TRUE; } Bool VIADRI1ScreenInit(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); int major, minor, patch; DRIInfoPtr pDRIInfo; VIADRIPtr pVIADRI; /* If symbols or version check fails, we still want this to be NULL. */ pVia->pDRIInfo = NULL; drmClose(pVia->drmmode.fd); /* 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(pScrn->scrnIndex, X_ERROR, "[dri] VIADRI1ScreenInit failed (libdri.a is too old).\n"); return FALSE; } /* Check the DRI version. */ DRIQueryVersion(&major, &minor, &patch); if (major != DRIINFO_MAJOR_VERSION || minor < DRIINFO_MINOR_VERSION) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] VIADRI1ScreenInit failed -- FALSE mismatch.\n" "[dri] libdri is %d.%d.%d, but %d.%d.x is needed.\n" "[dri] Disabling DRI.\n", major, minor, patch, DRIINFO_MAJOR_VERSION, DRIINFO_MINOR_VERSION); return FALSE; } pVia->pDRIInfo = DRICreateInfoRec(); if (!pVia->pDRIInfo) return FALSE; pDRIInfo = pVia->pDRIInfo; pDRIInfo->drmDriverName = VIAKernelDriverName; switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: case VIA_VX800: case VIA_VX855: case VIA_VX900: pDRIInfo->clientDriverName = "swrast"; break; default: pDRIInfo->clientDriverName = VIAClientDriverName; break; } pDRIInfo->busIdString = DRICreatePCIBusID(pVia->PciInfo); pDRIInfo->ddxDriverMajorVersion = VIA_DRIDDX_VERSION_MAJOR; pDRIInfo->ddxDriverMinorVersion = VIA_DRIDDX_VERSION_MINOR; pDRIInfo->ddxDriverPatchVersion = VIA_DRIDDX_VERSION_PATCH; #if (DRIINFO_MAJOR_VERSION == 5) pDRIInfo->frameBufferPhysicalAddress = (pointer) pVia->FrameBufferBase; #else pDRIInfo->frameBufferPhysicalAddress = pVia->FrameBufferBase; #endif pDRIInfo->frameBufferSize = pVia->videoRambytes; pDRIInfo->frameBufferStride = (pScrn->displayWidth * pScrn->bitsPerPixel / 8); pDRIInfo->ddxDrawableTableEntry = VIA_MAX_DRAWABLES; if (SAREA_MAX_DRAWABLES < VIA_MAX_DRAWABLES) pDRIInfo->maxDrawableTableEntry = SAREA_MAX_DRAWABLES; else pDRIInfo->maxDrawableTableEntry = VIA_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) + 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(drm_via_sarea_t) > SAREA_MAX) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Data does not fit in SAREA\n"); DRIDestroyInfoRec(pVia->pDRIInfo); pVia->pDRIInfo = NULL; return FALSE; } pDRIInfo->SAREASize = SAREA_MAX; #endif if (!(pVIADRI = (VIADRIPtr) calloc(sizeof(VIADRIRec), 1))) { DRIDestroyInfoRec(pVia->pDRIInfo); pVia->pDRIInfo = NULL; return FALSE; } pDRIInfo->devPrivate = pVIADRI; pDRIInfo->devPrivateSize = sizeof(VIADRIRec); pDRIInfo->contextSize = sizeof(VIADRIContextRec); pDRIInfo->CreateContext = VIACreateContext; pDRIInfo->DestroyContext = VIADestroyContext; pDRIInfo->SwapContext = VIADRISwapContext; pDRIInfo->InitBuffers = VIADRIInitBuffers; pDRIInfo->MoveBuffers = VIADRIMoveBuffers; pDRIInfo->bufferRequests = DRI_ALL_WINDOWS; if (!DRIScreenInit(pScreen, pDRIInfo, &pVia->drmmode.fd)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] DRIScreenInit failed. Disabling DRI.\n"); free(pDRIInfo->devPrivate); pDRIInfo->devPrivate = NULL; DRIDestroyInfoRec(pVia->pDRIInfo); pVia->pDRIInfo = NULL; pVia->drmmode.fd = -1; return FALSE; } if (!(VIAInitVisualConfigs(pScreen))) { VIADRICloseScreen(pScreen); return FALSE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized.\n"); /* DRIScreenInit doesn't add all the common mappings. * Add additional mappings here. */ if (!VIADRIMapInit(pScreen, pVia)) { VIADRICloseScreen(pScreen); return FALSE; } pVIADRI->regs.size = VIA_MMIO_REGSIZE; pVIADRI->regs.handle = pVia->registerHandle; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] mmio Registers = 0x%08lx\n", (unsigned long)pVIADRI->regs.handle); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] mmio mapped.\n"); return TRUE; } void VIADRICloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); VIADRIPtr pVIADRI; VIADRIRingBufferCleanup(pScrn); if (pVia->agpSize) { drmUnmap(pVia->agpMappedAddr, pVia->agpSize); drmRmMap(pVia->drmmode.fd, pVia->agpHandle); drmAgpUnbind(pVia->drmmode.fd, pVia->agpHandle); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Freeing agp memory\n"); drmAgpFree(pVia->drmmode.fd, pVia->agpHandle); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] Releasing agp module\n"); drmAgpRelease(pVia->drmmode.fd); } DRICloseScreen(pScreen); drm_bo_free(pScrn, pVia->driOffScreenMem); if (pVia->pDRIInfo) { if ((pVIADRI = (VIADRIPtr) pVia->pDRIInfo->devPrivate)) { VIADRIIrqExit(pScrn, pVIADRI); free(pVIADRI); pVia->pDRIInfo->devPrivate = NULL; } DRIDestroyInfoRec(pVia->pDRIInfo); pVia->pDRIInfo = NULL; } if (pVia->pVisualConfigs) { free(pVia->pVisualConfigs); pVia->pVisualConfigs = NULL; } if (pVia->pVisualConfigsPriv) { free(pVia->pVisualConfigsPriv); pVia->pVisualConfigsPriv = NULL; } } /* TODO: xserver receives driver's swapping event and does something * according the data initialized in this function. */ static Bool VIACreateContext(ScreenPtr pScreen, VisualPtr visual, drm_context_t hwContext, void *pVisualConfigPriv, DRIContextType contextStore) { return TRUE; } static void VIADestroyContext(ScreenPtr pScreen, drm_context_t hwContext, DRIContextType contextStore) { } Bool VIADRIFinishScreenInit(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); VIADRIPtr pVIADRI; pVia->pDRIInfo->driverSwapMethod = DRI_HIDE_X_CONTEXT; pVia->agpDMA = FALSE; pVIADRI = (VIADRIPtr) pVia->pDRIInfo->devPrivate; pVIADRI->drixinerama = FALSE; if (pVia->driSize < pVia->Bpl) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] No DRM framebuffer heap available.\n" "[drm] Please increase the frame buffer\n" "[drm] memory area in the BIOS. Disabling DRI.\n"); return FALSE; } if (pVia->driSize < 3 * (pScrn->virtualY * pVia->Bpl)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[drm] The DRM heap and pixmap cache memory may be too\n" "[drm] small for optimal performance. Please increase\n" "[drm] the frame buffer memory area in the BIOS.\n"); } pVia->driOffScreenMem = drm_bo_alloc(pScrn, pVia->driSize, 16, TTM_PL_FLAG_VRAM); DRIFinishScreenInit(pScreen); /* Set SAREA value. */ { drm_via_sarea_t *saPriv; saPriv = (drm_via_sarea_t *) DRIGetSAREAPrivate(pScreen); assert(saPriv); memset(saPriv, 0, sizeof(*saPriv)); saPriv->ctxOwner = -1; } pVIADRI->deviceID = pVia->Chipset; pVIADRI->width = pScrn->virtualX; pVIADRI->height = pScrn->virtualY; pVIADRI->mem = pScrn->videoRam * 1024; pVIADRI->bytesPerPixel = (pScrn->bitsPerPixel + 7) / 8; pVIADRI->sarea_priv_offset = sizeof(XF86DRISAREARec); /* TODO */ pVIADRI->scrnX = pVIADRI->width; pVIADRI->scrnY = pVIADRI->height; /* Initialize IRQ. */ if (pVia->DRIIrqEnable) VIADRIIrqInit(pScrn, pVIADRI); pVIADRI->ringBufActive = 0; VIADRIRingBufferInit(pScrn); pVia->agpDMA = pVia->dma2d && pVIADRI->ringBufActive; return TRUE; } static void VIADRISwapContext(ScreenPtr pScreen, DRISyncType syncType, DRIContextType oldContextType, void *oldContext, DRIContextType newContextType, void *newContext) { #if 0 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); #endif return; } static void VIADRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index) { #if 0 ScreenPtr pScreen = pWin->drawable.pScreen; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); #endif return; } static void VIADRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, RegionPtr prgnSrc, CARD32 index) { #if 0 ScreenPtr pScreen = pParent->drawable.pScreen; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VIAPtr pVia = VIAPTR(pScrn); #endif return; } /* Initialize the kernel data structures. */ Bool VIADRIKernelInit(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); drm_via_init_t drmInfo; pVia->IsPCI = !VIADRIAgpInit(pScrn); if (pVia->IsPCI) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] Using PCI.\n"); else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] Using AGP.\n"); if (!(VIADRIFBInit(pScrn))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] Frame buffer initialization failed.\n"); return FALSE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] Frame buffer initialized.\n"); memset(&drmInfo, 0, sizeof(drm_via_init_t)); drmInfo.func = VIA_INIT_MAP; drmInfo.sarea_priv_offset = sizeof(XF86DRISAREARec); drmInfo.fb_offset = pVia->frameBufferHandle; drmInfo.mmio_offset = pVia->registerHandle; if (pVia->IsPCI) { drmInfo.agpAddr = 0; } else { /*For AMD64*/ #ifndef __x86_64__ drmInfo.agpAddr = (CARD32)pVia->agpAddr; #else drmInfo.agpAddr = (CARD64)pVia->agpAddr; #endif } if ((drmCommandWrite(pVia->drmmode.fd, DRM_VIA_MAP_INIT, &drmInfo, sizeof(drm_via_init_t))) < 0) return FALSE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] Kernel data initialized.\n"); return TRUE; } /* Add a map for the MMIO registers. */ static Bool VIADRIMapInit(ScreenPtr pScreen, VIAPtr pVia) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); int flags = DRM_READ_ONLY; if (drmAddMap(pVia->drmmode.fd, pVia->MmioBase, VIA_MMIO_REGSIZE, DRM_REGISTERS, flags, &pVia->registerHandle) < 0) { return FALSE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] register handle = 0x%08lx\n", (unsigned long)pVia->registerHandle); if (drmAddMap(pVia->drmmode.fd, pVia->FrameBufferBase, pVia->videoRambytes, DRM_FRAME_BUFFER, 0, &pVia->frameBufferHandle) < 0) { return FALSE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] framebuffer handle = 0x%08lx\n", (unsigned long)pVia->frameBufferHandle); return TRUE; } #define DRM_VIA_BLIT_MAX_SIZE (2048*2048*4) static int viaDRIFBMemcpy(int fd, struct buffer_object *vram, unsigned char *addr, Bool toFB) { unsigned long fbOffset = vram->offset, size = vram->size, curSize; drm_via_dmablit_t blit; int err; do { curSize = (size > DRM_VIA_BLIT_MAX_SIZE) ? DRM_VIA_BLIT_MAX_SIZE : size; blit.num_lines = 1; blit.line_length = curSize; blit.fb_addr = fbOffset; blit.fb_stride = ALIGN_TO(curSize, 16); blit.mem_addr = addr; blit.mem_stride = blit.fb_stride; blit.to_fb = (toFB) ? 1 : 0; do { err = drmCommandWriteRead(fd, DRM_VIA_DMA_BLIT, &blit, sizeof(blit)); } while (-EAGAIN == err); if (err) return err; do { err = drmCommandWriteRead(fd, DRM_VIA_BLIT_SYNC, &blit.sync, sizeof(blit.sync)); } while (-EAGAIN == err); if (err) return err; fbOffset += curSize; addr += curSize; size -= curSize; } while (size > 0); return 0; } void viaDRIOffscreenSave(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); unsigned long srcSize = pVia->driOffScreenMem->size; int err; if (pVia->driOffScreenSave) free(pVia->driOffScreenSave); pVia->driOffScreenSave = malloc(srcSize + 16); if (pVia->driOffScreenSave) { void *dst, *src = drm_bo_map(pScrn, pVia->driOffScreenMem); dst = (void *) ALIGN_TO((unsigned long) pVia->driOffScreenSave, 16); if ((pVia->drmVerMajor == 2) && (pVia->drmVerMinor >= 8)) { err = viaDRIFBMemcpy(pVia->drmmode.fd, pVia->driOffScreenMem, dst, FALSE); if (!err) return; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Hardware backup of DRI offscreen memory failed: %s.\n" "\tUsing slow software backup instead.\n", strerror(-err)); } memcpy(dst, src, srcSize); drm_bo_unmap(pScrn, pVia->driOffScreenMem); } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Out of memory trying to backup DRI offscreen memory.\n"); } return; } void viaDRIOffscreenRestore(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); if (pVia->driOffScreenSave) { void *src, *dst = drm_bo_map(pScrn, pVia->driOffScreenMem); src = pVia->driOffScreenSave; memcpy(dst, src, pVia->driOffScreenMem->size); free(pVia->driOffScreenSave); pVia->driOffScreenSave = NULL; drm_bo_unmap(pScrn, pVia->driOffScreenMem); } else { } } xf86-video-openchrome-0.6.0/src/via_vt162x.h0000664000175000017500000017330712760724526015373 00000000000000/* * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * * 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 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. */ #ifndef _VIA_VT162X_H_ #define _VIA_VT162X_H_ 1 struct VT162xModePrivate { char id[12]; /* "VT162x" */ CARD8 Standard; }; /* Hmm this seemed like a reasonable approach initially. perhaps not. */ static struct VT162xModePrivate VT162xModePrivateNTSC = { { 'V', 'T', '1', '6', '2', 'x', 0, 0, 0, 0, 0, 0 }, TVTYPE_NTSC,}; static struct VT162xModePrivate VT162xModePrivatePAL = { { 'V', 'T', '1', '6', '2', 'x', 0, 0, 0, 0, 0, 0 }, TVTYPE_PAL,}; static struct VT162xModePrivate VT162xModePrivate480P = { { 'V', 'T', '1', '6', '2', 'x', 0, 0, 0, 0, 0, 0 }, TVTYPE_480P,}; static struct VT162xModePrivate VT162xModePrivate576P = { { 'V', 'T', '1', '6', '2', 'x', 0, 0, 0, 0, 0, 0 }, TVTYPE_576P,}; static struct VT162xModePrivate VT162xModePrivate720P = { { 'V', 'T', '1', '6', '2', 'x', 0, 0, 0, 0, 0, 0 }, TVTYPE_720P,}; static struct VT162xModePrivate VT162xModePrivate1080I = {{ 'V', 'T', '1', '6', '2', 'x', 0, 0, 0, 0, 0, 0 }, TVTYPE_1080I,}; #define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DEFAULT #define MODESUFFIXNTSC 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,\ sizeof(struct VT162xModePrivate),(void *)&VT162xModePrivateNTSC,0,0.0,0.0 #define MODESUFFIXPAL 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,\ sizeof(struct VT162xModePrivate),(void *)&VT162xModePrivatePAL,0,0.0,0.0 #define MODESUFFIX480P 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,\ sizeof(struct VT162xModePrivate),(void *)&VT162xModePrivate480P,0,0.0,0.0 #define MODESUFFIX576P 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,\ sizeof(struct VT162xModePrivate),(void *)&VT162xModePrivate576P,0,0.0,0.0 #define MODESUFFIX720P 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,\ sizeof(struct VT162xModePrivate),(void *)&VT162xModePrivate720P,0,0.0,0.0 #define MODESUFFIX1080I 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,\ sizeof(struct VT162xModePrivate),(void *)&VT162xModePrivate1080I,0,0.0,0.0 /* * * VT1621 modetables * */ /* for dotclock i just took HTotal*VTotal*50 -- is not actually used - just to satisfy modevalidation */ static DisplayModeRec VT1621Modes[] = { { MODEPREFIX("640x480"), 23520, 640, 656, 752, 784, 0, 480, 520, 523, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("640x480"), 26250, 640, 664, 792, 840, 0, 480, 529, 539, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600"), 39900, 800, 840, 976, 1064, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("800x600"), 36000, 800, 824, 904, 960, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("640x480Over"), 20580, 640, 656, 752, 784, 0, 480, 494, 507, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("640x480Over"), 24000, 640, 672, 888, 960, 0, 480, 485, 491, 500, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600Over"), 36400, 800, 840, 960, 1040, 0, 600, 602, 604, 700, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("800x600Over"), 29500, 800, 824, 896, 944, 0, 600, 599, 604, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, }; struct VT1621TableRec { char * name; CARD16 Width; CARD16 Height; int Standard; CARD8 PrimaryCR6C; CARD8 TV[0x25]; CARD8 TVC[0x18]; CARD8 TVS[0x18]; CARD32 SubCarrier; CARD32 DotCrawlSubCarrier; }; static struct VT1621TableRec VT1621Table[] = { { "640x480", 640, 480, TVTYPE_NTSC, 0, { 0x64, 0x03, 0x22, 0x33, 0x43, 0, 0x10, 0x7D, 0xAC, 0x05, 0x99, 0x17, 0x93, 0xA5, 0x03, 0xBA, 0, 0, 0x0A, 0xCD, 0x80, 0x28, 0, 0, 0, 0, 0, 0, 0x02, 0, 0, 0, 0x75, 0x0C, 0x04, 0x6D }, { 0x48, 0x01, 0x02, 0, 0xFC, 0xF9, 0xFF, 0x10, 0x23, 0x2C, 0x09, 0x08, 0x0A, 0x0C, 0x0D, 0x0D }, { 0x48, 0x02, 0x02, 0xFD, 0x06, 0xF8, 0x0B, 0xF3, 0x0F, 0x70, 0x05, 0xF9, 0x0B, 0xF1, 0x11, 0x6E }, 0x207FFFBE, 0x207FF6BE, }, { "640x480", 640, 480, TVTYPE_PAL, 0x04, { 0x64, 0x01, 0x02, 0x33, 0x40, 0, 0x10, 0xAD, 0xD3, 0x37, 0xA3, 0, 0x94, 0xFF, 0x03, 0xBA, 0, 0, 0x07, 0x26, 0x2C, 0x20, 0, 0, 0, 0, 0, 0, 0x02, 0, 0, 0, 0x75, 0x0C, 0x04, 0x76 }, { 0x48, 0, 0, 0xFE, 0xFC, 0xFD, 0x05, 0x12, 0x1F, 0x25, 0x0B, 0x08, 0x0A, 0x0C, 0x0D, 0x0D }, { 0x48, 0xFE, 0x03, 0xFB, 0x06, 0xF8, 0x0A, 0xF5, 0x0C, 0x73, 0x06, 0xF8, 0x0B, 0xF2, 0x10, 0x6F }, 0x25D56350, 0, }, { "800x600", 800, 600, TVTYPE_NTSC, 0x1E, { 0x84, 0x03, 0x2A, 0x33, 0x43, 0, 0x10, 0xDD, 0xB9, 0x15, 0x99, 0x17, 0x93, 0xA5, 0x03, 0xBA, 0, 0, 0x0A, 0xED, 0x98, 0x1C, 0, 0, 0, 0, 0, 0, 0x02, 0, 0, 0, 0x75, 0x0C, 0x04, 0x6D }, { 0x48, 0, 0xFF, 0xFD, 0xFC, 0xFF, 0x07, 0x13, 0x1E, 0x22, 0x0D, 0x08, 0x09, 0x0A, 0x0B, 0x0C }, { 0x48, 0x02, 0x02, 0xFD, 0x06, 0xF8, 0x0B, 0xF3, 0x0F, 0x70, 0x05, 0xF9, 0x0B, 0xF1, 0x11, 0x6E }, 0x1B5E5096, 0x1B5E5796, }, { "800x600", 800, 600, TVTYPE_PAL, 0x04, { 0x84, 0x03, 0x1A, 0x33, 0x40, 0, 0x10, 0x85, 0xF1, 0x4B, 0xA3, 0, 0x94, 0xFF, 0x03, 0xBA, 0, 0, 0x07, 0x25, 0x2C, 0x1C, 0, 0, 0, 0, 0, 0, 0x02, 0, 0, 0, 0x75, 0x0C, 0x04, 0x76 }, { 0x48, 0xFF, 0xFE, 0xFD, 0xFE, 0x02, 0x0A, 0x13, 0x1A, 0x1D, 0x0F, 0x08, 0x09, 0x0A, 0x0B, 0x0B }, { 0x48, 0xFB, 0x04, 0xFB, 0x07, 0xF8, 0x09, 0xF6, 0x0A, 0x74, 0x06, 0xF8, 0x0B, 0xF2, 0x10, 0x6F }, 0x1F872818, 0, }, { "640x480Over", 640, 480, TVTYPE_NTSC, 0, { 0x64, 0x03, 0x02, 0x33, 0x43, 0, 0x10, 0x7D, 0x72, 0x05, 0x99, 0x17, 0x93, 0xA5, 0x03, 0xBA, 0, 0, 0x0D, 0x45, 0x38, 0x34, 0, 0, 0, 0, 0, 0, 0x02, 0, 0, 0, 0x75, 0x0C, 0x04, 0x6D }, { 0x48, 0, 0x01, 0x02, 0xFF, 0xF9, 0xFA, 0x0C, 0x26, 0x32, 0x07, 0x08, 0x0A, 0x0D, 0x0E, 0x0F }, { 0x48, 0x02, 0x02, 0xFD, 0x06, 0xF8, 0x0B, 0xF3, 0x0F, 0x70, 0x05, 0xF9, 0x0B, 0xF1, 0x11, 0x6E }, 0x252491F1, 0x252499F1, }, { "640x480Over", 640, 480, TVTYPE_PAL, 0, { 0x64, 0x01, 0x12, 0x33, 0x40, 0, 0x10, 0x1D, 0x68, 0x26, 0xA3, 0, 0x94, 0xFF, 0x03, 0xBA, 0, 0, 0x0F, 0x67, 0x58, 0x3C, 0, 0, 0, 0, 0, 0, 0x0A, 0, 0, 0, 0x75, 0x0C, 0x04, 0x76 }, { 0x48, 0, 0x01, 0x01, 0xFE, 0xFA, 0xFD, 0x0E, 0x24, 0x2E, 0x07, 0x07, 0x0A, 0x0D, 0x0F, 0x0F }, { 0x48, 0xFD, 0x03, 0xFB, 0x07, 0xF8, 0x0A, 0xF5, 0x0B, 0x74, 0x06, 0xF8, 0x0B, 0xF2, 0x10, 0x6F }, 0x2F4ABC24, 0, }, { "800x600Over", 800, 600, TVTYPE_NTSC, 0, { 0x84, 0x03, 0x0A, 0x33, 0x43, 0, 0x10, 0xC5, 0xAD, 0x10, 0x99, 0x17, 0x93, 0xA5, 0x03, 0xBA, 0, 0, 0x04, 0x07, 0x20, 0x0C, 0, 0, 0, 0, 0, 0, 0x02, 0, 0, 0, 0x75, 0x0C, 0x04, 0x6D }, { 0x48, 0, 0xFF, 0xFD, 0xFC, 0xFE, 0x06, 0x13, 0x1E, 0x23, 0x0D, 0x08, 0x0A, 0x0B, 0x0C, 0x0C }, { 0x48, 0x02, 0x02, 0xFD, 0x06, 0xF8, 0x0B, 0xF3, 0x0F, 0x70, 0x05, 0xF9, 0x0B, 0xF1, 0x11, 0x6E }, 0x1C000008, 0x1C000808, }, { "800x600Over", 800, 600, TVTYPE_PAL, 0, { 0x84, 0x03, 0x02, 0x33, 0x40, 0, 0x10, 0x75, 0x7B, 0x34, 0xA3, 0, 0x94, 0xFF, 0x03, 0xBA, 0, 0, 0x08, 0xFD, 0xEF, 0x20, 0, 0, 0, 0, 0, 0, 0x02, 0, 0, 0, 0x75, 0x0C, 0x04, 0x76 }, { 0x48, 0xFF, 0xFE, 0xFD, 0xFE, 0x02, 0x0A, 0x13, 0x1A, 0x1D, 0x0F, 0x08, 0x09, 0x0A, 0x0B, 0x0B }, { 0x48, 0xFB, 0x04, 0xFB, 0x07, 0xF8, 0x09, 0xF6, 0x0A, 0x74, 0x06, 0xF8, 0x0B, 0xF2, 0x10, 0x6F }, 0x26798C0C, 0, }, { NULL, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 0, } }; /* * * VT1622 modetables * */ static DisplayModeRec VT1622Modes[] = { { MODEPREFIX("640x480"), 23520, 640, 656, 744, 784, 0, 480, 487, 491, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("640x480"), 30000, 640, 680, 808, 1000, 0, 480, 520, 523, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600"), 39900, 800, 840, 976, 1064, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("800x600"), 34500, 800, 816, 880, 920, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("1024x768"), 54810, 1024, 1032, 1088, 1160, 0, 768, 780, 792, 945, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("1024x768"), 57000, 1024, 1040, 1112, 1200, 0, 768, 829, 840, 950, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("848x480"), 34860, 848, 872, 1032, 1200, 0, 480, 495, 509, 581, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("848x480"), 36000, 848, 872, 1032, 1200, 0, 480, 498, 509, 600, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x480"), 25200, 720, 728, 776, 840, 0, 480, 511, 515, 600, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x576"), 28500, 720, 728, 744, 760, 0, 576, 635, 643, 750, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("640x480Over"), 20160, 640, 648, 704, 720, 0, 480, 487, 491, 560, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("640x480Over"), 21000, 640, 664, 792, 840, 0, 480, 485, 491, 500, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600Over"), 35910, 800, 840, 984, 1080, 0, 600, 601, 604, 665, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("800x600Over"), 32500, 800, 832, 928, 1000, 0, 600, 600, 604, 650, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("1024x768Over"), 50400, 1024, 1040, 1112, 1200, 0, 768, 772, 776, 840, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("1024x768Over"), 49500, 1024, 1032, 1112, 1200, 0, 768, 771, 776, 825, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("848x480Over"), 27720, 848, 856, 928, 1008, 0, 480, 490, 493, 550, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("848x480Over"), 33000, 848, 872, 1032, 1200, 0, 480, 490, 493, 550, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x480Over"), 21000, 720, 728, 760, 800, 0, 480, 480, 483, 525, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x576Over"), 30000, 720, 728, 864, 1000, 0, 576, 576, 579, 600, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x480Noscale"), 27972, 720, 736, 768, 888, 0, 480, 480, 483, 525, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x576Noscale"), 28000, 720, 728, 864, 896, 0, 576, 576, 579, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, }; struct VT162XTableRec { char * name; CARD16 Width; CARD16 Height; int Standard; CARD8 PrimaryCR6C; CARD8 SecondaryCR6C; CARD8 TV1[0x30]; CARD8 TV2[0x1B]; CARD8 RGB[6]; CARD8 YCbCr[3]; CARD32 SubCarrier; CARD32 DotCrawlSubCarrier; }; static struct VT162XTableRec VT1622Table[] = { { "640x480", 640, 480, TVTYPE_NTSC, 0, 0, { 0x04, 0, 0, 0x02, 0x03, 0, 0x10, 0x7E, 0x9D, 0x0D, 0x60, 0x17, 0x52, 0x45, 0x0F, 0, 0, 0, 0xD0, 0x33, 0xBF, 0x3A, 0, 0, 0, 0, 0xE9, 0, 0, 0, 0, 0x05, 0x12, 0x0C, 0x04, 0x74, 0, 0x5A, 0x2F, 0x97, 0x50, 0, 0, 0xAA, 0x2B, 0x7A, 0xD8, 0 }, { 0xDC, 0x50, 0x04, 0, 0, 0x40, 0x0F, 0x81, 0x23, 0x57, 0x02, 0x0F, 0x29, 0x73, 0x23, 0x86, 0xC4, 0xEA, 0xDF, 0x05, 0x92, 0xA1, 0x04, 0, 0, 0x7F, 0x03 }, { 0xAF, 0xAA, 0xAA, 0x91, 0x9C, 0x27 }, { 0x50, 0x4B, 0x4D }, 0x252491F1, 0x252487BE, }, { "640x480", 640, 480, TVTYPE_PAL, 0, 0, { 0x04, 0, 0, 0x82, 0, 0, 0x10, 0x3E, 0xA4, 0x37, 0x67, 0, 0x49, 0x49, 0x0F, 0, 0, 0, 0xEC, 0x2A, 0xB8, 0x29, 0, 0, 0, 0, 0xED, 0, 0x0A, 0, 0, 0x04, 0x12, 0x0C, 0x04, 0x7B, 0, 0x64, 0x30, 0x93, 0x49, 0x5F, 0x15, 0xA5, 0x23, 0x7A, 0xCC, 0 }, { 0xF9, 0x50, 0x04, 0, 0, 0x45, 0xE7, 0x81, 0x23, 0x57, 0x02, 0x1F, 0x31, 0x75, 0x23, 0x8A, 0xC8, 0xF0, 0xFF, 0x05, 0xD7, 0x8E, 0x03, 0x7F, 0xCF, 0xBF, 0x03 }, { 0x8A, 0x86, 0x86, 0x8D, 0x96, 0x20 }, { 0x42, 0x49, 0x49 }, 0x2D66772D, 0, }, { "800x600", 800, 600, TVTYPE_NTSC, 0x1E, 0, { 0x84, 0, 0, 0x24, 0x03, 0, 0x10, 0xDE, 0xD4, 0x0E, 0x59, 0x17, 0x46, 0x40, 0x0F, 0, 0, 0, 0xEA, 0x0D, 0x98, 0x1C, 0, 0, 0, 0, 0x3D, 0, 0x01, 0, 0, 0x85, 0x0D, 0x0A, 0x04, 0x74, 0, 0x5A, 0x41, 0x96, 0x6B, 0, 0, 0xAA, 0x2B, 0xA6, 0x1E, 0x10 }, { 0xE4, 0x69, 0x04, 0, 0, 0x3F, 0x27, 0x21, 0x34, 0xED, 0x02, 0x27, 0xF5, 0x9D, 0x24, 0xB7, 0x0D, 0x40, 0, 0x58, 0xB6, 0x3B, 0x05, 0, 0x01, 0xEF, 0x05 }, { 0x93, 0x90, 0x90, 0x91, 0x9C, 0 }, { 0x43, 0x4A, 0x49 }, 0x1B5E5096, 0x1B5E4912, }, { "800x600", 800, 600, TVTYPE_PAL, 0, 0, { 0x84, 0, 0, 0xA4, 0, 0, 0x19, 0x66, 0xBF, 0x12, 0x60, 0, 0x56, 0x45, 0x0F, 0, 0, 0, 0xEC, 0x15, 0xFD, 0x28, 0, 0, 0, 0, 0x16, 0, 0x01, 0, 0, 0x85, 0x10, 0x0C, 0x04, 0x7B, 0, 0x64, 0x37, 0x93, 0x54, 0x5F, 0x15, 0xA5, 0x23, 0x8F, 0xF4, 0 }, { 0xE7, 0x45, 0x04, 0, 0, 0x44, 0x97, 0x21, 0x33, 0xED, 0x02, 0x97, 0x87, 0x87, 0x23, 0x9F, 0xE7, 0x16, 0xE7, 0x16, 0xCC, 0xF3, 0x04, 0, 0x01, 0x4F, 0x04 }, { 0xB8, 0xB4, 0xB4, 0, 0, 0 }, { 0x58, 0x5E, 0x5E }, 0x277A7DE4, 0, }, { "1024x768", 1024, 768, TVTYPE_NTSC, 0x12, 0x1C, { 0x84, 0, 0, 0x44, 0x03, 0, 0x10, 0x80, 0x15, 0x0A, 0x58, 0x17, 0x5B, 0x40, 0x0F, 0, 0, 0, 0xE9, 0x1E, 0x9D, 0x19, 0, 0, 0, 0, 0x9C, 0, 0x05, 0, 0, 0x85, 0x0A, 0x05, 0x04, 0x74, 0, 0x5A, 0x56, 0x96, 0x8B, 0, 0, 0xAA, 0x2B, 0xDA, 0x79, 0x10 }, { 0xDA, 0x50, 0x04, 0, 0, 0x3F, 0x87, 0xFF, 0x34, 0xB0, 0x03, 0x6F, 0xDB, 0xCD, 0x35, 0xF1, 0x5E, 0xA5, 0x7E, 0x5A, 0x33, 0x26, 0x07, 0, 0x01, 0x27, 0x08 }, { 0xC2, 0xBE, 0xBE, 0x91, 0x9C, 0 }, { 0x58, 0x4B, 0x4A }, 0x14EB66D6, 0x14EB6118, }, { "1024x768", 1024, 768, TVTYPE_PAL, 0x1E, 0, { 0x84, 0, 0, 0xC0, 0, 0, 0x10, 0xA0, 0x2A, 0x38, 0x70, 0, 0x4E, 0x50, 0x0F, 0, 0, 0, 0xE4, 0x23, 0xD1, 0x0C, 0, 0, 0, 0, 0x96, 0, 0x07, 0, 0, 0x85, 0x0C, 0x0C, 0x04, 0x7B, 0, 0x64, 0x53, 0x90, 0x7B, 0x5B, 0x15, 0xA0, 0x22, 0xD1, 0x71, 0x10 }, { 0xDD, 0x60, 0x04, 0, 0, 0x45, 0xAF, 0xFF, 0x34, 0xB5, 0x03, 0x57, 0xA8, 0xC8, 0x35, 0xEC, 0x4C, 0xCC, 0x67, 0x5A, 0x14, 0x5C, 0x06, 0, 0x01, 0x1F, 0x07 }, { 0xA9, 0xA6, 0xA6, 0x90, 0x99, 0 }, { 0x51, 0x49, 0x49 }, 0x1A8CC372, 0, }, { "848x480", 848, 480, TVTYPE_NTSC, 0, 0, { 0x84, 0, 0, 0x24, 0x03, 0, 0x10, 0x46, 0xCC, 0x0E, 0x56, 0x17, 0x43, 0x3E, 0x0F, 0, 0, 0, 0xE8, 0x29, 0x67, 0x19, 0, 0, 0, 0, 0x29, 0, 0x0B, 0, 0, 0x85, 0x0E, 0x08, 0x04, 0x74, 0, 0x5A, 0x3D, 0x96, 0x64, 0, 0, 0xAA, 0x2B, 0x9C, 0x17, 0x10 }, { 0xDC, 0x50, 0, 0, 0, 0x40, 0xAF, 0x51, 0x34, 0x44, 0x02, 0xE3, 0xC1, 0x93, 0x23, 0xAD, 0xFD, 0x2B, 0x7C, 0x17, 0x6D, 0xCA, 0x04, 0, 0x01, 0x2F, 0x05 }, { 0x94, 0x90, 0x91, 0x91, 0x9C, 0 }, { 0x44, 0x45, 0x45 }, 0x1D3CA863, 0x1D3CA05B, }, { "848x480", 848, 480, TVTYPE_PAL, 0x08, 0, { 0x04, 0, 0, 0xC2, 0, 0, 0x10, 0x47, 0xE4, 0x09, 0x64, 0, 0x4F, 0x48, 0x0F, 0, 0, 0, 0xE7, 0x05, 0x2C, 0x1C, 0, 0, 0, 0, 0x5E, 0, 0x09, 0, 0, 0x84, 0x0A, 0x0C, 0x04, 0x7B, 0, 0x64, 0x46, 0x93, 0x68, 0x5F, 0x15, 0xA5, 0x23, 0xB4, 0x2A, 0x10 }, { 0xE7, 0x45, 0x04, 0, 0, 0x43, 0xAF, 0x51, 0x34, 0x57, 0x02, 0x7F, 0x4F, 0xA9, 0x34, 0xD1, 0x2B, 0x5D, 0xAA, 0x58, 0xD7, 0x01, 0x03, 0, 0x01, 0x7F, 0x04 }, { 0xA4, 0xA0, 0xA1, 0, 0, 0 }, { 0x50, 0x49, 0x49 }, 0x1F872818, 0, }, { "720x480", 720, 480, TVTYPE_NTSC, 0x04, 0, { 0x04, 0, 0, 0x26, 0x03, 0, 0x10, 0x6D, 0xC3, 0x08, 0x56, 0x17, 0x43, 0x3E, 0x0F, 0, 0, 0, 0x0D, 0x07, 0x60, 0x34, 0, 0, 0, 0, 0x1E, 0, 0x03, 0, 0, 0x85, 0x0F, 0x08, 0x04, 0x74, 0, 0x5A, 0x39, 0x95, 0x5E, 0, 0, 0xAA, 0x2B, 0x92, 0xFF, 0 }, { 0xE4, 0x69, 0x04, 0, 0, 0x40, 0x47, 0xD1, 0x23, 0x57, 0x02, 0xBF, 0xAF, 0x8D, 0x23, 0xA4, 0xF3, 0x20, 0x36, 0x17, 0x92, 0x33, 0x04, 0, 0, 0xBF, 0x03 }, { 0x94, 0x90, 0x90, 0x91, 0x9C, 0 }, { 0x42, 0x49, 0x48 }, 0x1E555518, 0x1E554CC3, }, { "720x576", 720, 576, TVTYPE_PAL, 0, 0, { 0x04, 0, 0, 0xA2, 0, 0, 0x10, 0x1E, 0xAC, 0x38, 0x67, 0, 0x57, 0x49, 0x0F, 0, 0, 0, 0xF0, 0x0F, 0xD1, 0x38, 0, 0, 0, 0, 0xF2, 0, 0x02, 0, 0, 0x84, 0x13, 0x0C, 0x04, 0x7B, 0x48, 0x64, 0x30, 0x93, 0x49, 0x5F, 0x15, 0xA5, 0x23, 0x8B, 0xBD, 0 }, { 0xE7, 0x45, 0x04, 0, 0, 0x45, 0xF7, 0xD1, 0x22, 0xED, 0x02, 0x1D, 0x29, 0x75, 0x23, 0x88, 0xC6, 0xF0, 0xFA, 0x0F, 0xCC, 0x30, 0x14, 0, 0, 0x8F, 0x03 }, { 0xB5, 0xB1, 0xB1, 0, 0, 0 }, { 0x59, 0x4D, 0x4A }, 0x2D839832, 0, }, { "640x480Over", 640, 480, TVTYPE_NTSC, 0, 0, { 0x04, 0, 0, 0x02, 0x03, 0, 0x10, 0x48, 0x72, 0x0A, 0x60, 0x17, 0x52, 0x45, 0x0F, 0, 0, 0, 0xED, 0x23, 0x80, 0x35, 0, 0, 0, 0, 0xE9, 0, 0x02, 0, 0, 0x05, 0x12, 0x0C, 0x04, 0x75, 0, 0x5A, 0x2F, 0x97, 0x50, 0, 0, 0xAA, 0x2B, 0x7A, 0xD8, 0 }, { 0xC4, 0x50, 0x04, 0, 0, 0x41, 0xCF, 0x7F, 0x22, 0x2F, 0x02, 0xFF, 0x7F, 0x71, 0x22, 0x83, 0xC0, 0xE5, 0xC0, 0x05, 0x44, 0, 0x04, 0, 0, 0xFF, 0x02 }, { 0xAD, 0xA9, 0xA9, 0, 0, 0 }, { 0x4F, 0x49, 0x49 }, 0x25EAAA5E, 0x25EA9FF4, }, { "640x480Over", 640, 480, TVTYPE_PAL, 0, 0, { 0x04, 0, 0, 0x82, 0, 0, 0x10, 0xB0, 0x39, 0x39, 0x67, 0, 0x48, 0x4A, 0x0F, 0, 0, 0, 0x2C, 0x05, 0x2C, 0x30, 0, 0, 0, 0, 0xC8, 0, 0x02, 0, 0, 0x05, 0x15, 0x0C, 0x04, 0x7B, 0, 0x64, 0x28, 0x93, 0x3E, 0x5F, 0x15, 0xA5, 0x23, 0x65, 0xCC, 0 }, { 0xF9, 0x50, 0x04, 0, 0, 0x45, 0x47, 0x7F, 0x23, 0xF3, 0x01, 0x9F, 0x7F, 0x62, 0x22, 0x72, 0xA7, 0xCB, 0x05, 0x05, 0x33, 0, 0x03, 0, 0, 0x9F, 0x02 }, { 0x8A, 0x86, 0x86, 0x90, 0x99, 0 }, { 0x42, 0x49, 0x49 }, 0x360C44BC, 0, }, { "800x600Over", 800, 600, TVTYPE_NTSC, 0, 0, { 0x84, 0, 0, 0x24, 0x03, 0, 0x10, 0xEF, 0xB0, 0x0A, 0x5A, 0x17, 0x46, 0x40, 0x0F, 0, 0, 0, 0xE8, 0x32, 0xC3, 0x19, 0, 0, 0, 0, 0x33, 0, 0x01, 0, 0, 0x85, 0x0D, 0x0A, 0x04, 0x75, 0, 0x5A, 0x41, 0x96, 0x68, 0, 0, 0xAA, 0x2B, 0x9E, 0x1E, 0x10 }, { 0xE4, 0x69, 0x04, 0, 0, 0x40, 0x37, 0x21, 0x34, 0x98, 0x02, 0x01, 0x21, 0x97, 0x34, 0xB1, 0xFF, 0x34, 0xB6, 0x17, 0x11, 0, 0x05, 0, 0x01, 0x57, 0x05 }, { 0x93, 0x90, 0x90, 0, 0, 0 }, { 0x42, 0x45, 0x45 }, 0x1C61CEE0, 0x1C61C714, }, { "800x600Over", 800, 600, TVTYPE_PAL, 0, 0, { 0x84, 0, 0, 0xA0, 0, 0, 0x19, 0xA6, 0x9F, 0x38, 0x60, 0, 0x57, 0x45, 0x0F, 0, 0, 0, 0xC8, 0x12, 0x8F, 0x1C, 0, 0, 0, 0, 0x0E, 0, 0x03, 0, 0, 0x85, 0x10, 0x0C, 0x04, 0x7B, 0, 0x64, 0x37, 0x93, 0x54, 0x5F, 0x15, 0xA5, 0x23, 0x8B, 0xF4, 0 }, { 0xE9, 0x50, 0x04, 0, 0, 0x44, 0xE7, 0x1F, 0x33, 0x89, 0x02, 0x8D, 0xBC, 0x85, 0x23, 0x9C, 0xE4, 0x13, 0xD4, 0x16, 0x28, 0x90, 0x04, 0, 0x01, 0x0F, 0x04 }, { 0xB8, 0xB4, 0xB4, 0x90, 0x99, 0 }, { 0x58, 0x48, 0x48 }, 0x27E98D57, 0, }, { "1024x768Over", 1024, 768, TVTYPE_NTSC, 0x16, 0x1C, { 0x84, 0, 0, 0x44, 0x03, 0, 0x10, 0xA0, 0xAA, 0x05, 0x57, 0x17, 0x5C, 0x3F, 0x0F, 0, 0, 0, 0xE8, 0x33, 0x1A, 0x16, 0, 0, 0, 0, 0x66, 0, 0x01, 0, 0, 0x85, 0x0A, 0x05, 0x04, 0x74, 0, 0x5A, 0x4B, 0x96, 0x79, 0, 0, 0xAA, 0x2B, 0xB9, 0x4B, 0x10 }, { 0xE4, 0x50, 0x04, 0, 0, 0x40, 0xAF, 0xFF, 0x34, 0x47, 0x03, 0xAF, 0xFF, 0xB1, 0x34, 0xD1, 0x30, 0x68, 0x0B, 0x59, 0x66, 0, 0x06, 0, 0x01, 0x7F, 0x07 }, { 0xC2, 0xBE, 0xBE, 0, 0, 0 }, { 0x57, 0x45, 0x45 }, 0x1844440E, 0x18443D63, }, { "1024x768Over", 1024, 768, TVTYPE_PAL, 0x1E, 0, { 0x84, 0, 0, 0xC0, 0, 0, 0x10, 0xA8, 0xC5, 0x36, 0x5D, 0, 0x4E, 0x43, 0x0F, 0, 0, 0, 0xC9, 0x0A, 0x79, 0x1C, 0, 0, 0, 0, 0x6E, 0, 0x03, 0, 0, 0x85, 0x0C, 0x0C, 0x04, 0x7B, 0, 0x64, 0x4B, 0x93, 0x6F, 0x5F, 0x15, 0xA5, 0x23, 0xBE, 0x5A, 0x10 }, { 0xDD, 0x60, 0x04, 0, 0, 0x43, 0xAF, 0xFF, 0x34, 0x38, 0x03, 0xCF, 0xDF, 0xB4, 0x34, 0xD6, 0x35, 0x75, 0x47, 0x59, 0x47, 0x20, 0x05, 0, 0x01, 0x2F, 0x06 }, { 0xA9, 0xA6, 0xA6, 0x90, 0x99, 0 }, { 0x51, 0x49, 0x49 }, 0x1D7B0E38, 0, }, { "848x480Over", 848, 480, TVTYPE_NTSC, 0, 0, { 0x84, 0, 0, 0x44, 0x03, 0, 0x10, 0x96, 0xA7, 0x08, 0x5B, 0x17, 0x46, 0x40, 0x0F, 0, 0, 0, 0xE8, 0x3C, 0x2D, 0x22, 0, 0, 0, 0, 0x3D, 0, 0x01, 0, 0, 0x85, 0x0D, 0x08, 0x04, 0x75, 0, 0x5A, 0x41, 0x96, 0x69, 0, 0, 0xAA, 0x2B, 0xA2, 0x24, 0x10 }, { 0xDC, 0x50, 0, 0, 0, 0x40, 0xEF, 0x51, 0x33, 0x25, 0x02, 0x1F, 0x4D, 0x9C, 0x34, 0xB5, 0x0C, 0x3D, 0xF1, 0x57, 0x30, 0x01, 0x04, 0, 0x01, 0x1F, 0x04 }, { 0xC0, 0xBC, 0xBC, 0, 0, 0 }, { 0x58, 0x45, 0x45 }, 0x1B9364A1, 0x1B933067, }, { "848x480Over", 848, 480, TVTYPE_PAL, 0, 0, { 0x84, 0, 0, 0xC0, 0, 0, 0x10, 0x47, 0xA8, 0x39, 0x64, 0, 0x4E, 0x46, 0x0F, 0, 0, 0, 0xEA, 0x15, 0xF2, 0x28, 0, 0, 0, 0, 0x39, 0, 0x0B, 0, 0, 0x84, 0x0F, 0x0C, 0x04, 0x7B, 0, 0x64, 0x40, 0x93, 0x5F, 0x5F, 0x15, 0xA5, 0x23, 0xA3, 0x2A, 0x10 }, { 0xE7, 0x45, 0x04, 0, 0, 0x43, 0xAF, 0x4F, 0x34, 0x25, 0x02, 0x1F, 0x4F, 0x9B, 0x34, 0xB7, 0x0A, 0x3F, 0xF0, 0x57, 0x85, 0, 0x03, 0, 0x01, 0x1F, 0x04 }, { 0xA4, 0xA1, 0xA1, 0x90, 0x99, 0 }, { 0x4E, 0x49, 0x49 }, 0x2264E5EC, 0, }, { "720x480Over", 720, 480, TVTYPE_NTSC, 0, 0, { 0x04, 0, 0, 0x02, 0x03, 0, 0x10, 0x18, 0x28, 0x09, 0x5B, 0x17, 0x46, 0x41, 0x0F, 0, 0, 0, 0xEE, 0x0D, 0xA0, 0x38, 0, 0, 0, 0, 0xEE, 0, 0x02, 0, 0, 0x85, 0x11, 0x08, 0x04, 0x75, 0, 0x5A, 0x31, 0x95, 0x51, 0, 0, 0xAA, 0x2B, 0x7A, 0xDB, 0 }, { 0xE4, 0x69, 0x04, 0, 0, 0x40, 0x1F, 0xCF, 0x23, 0x0C, 0x02, 0x1F, 0xCF, 0x76, 0x23, 0x88, 0xC9, 0xEF, 0xFF, 0x05, 0, 0, 0, 0, 0, 0x1F, 0x03 }, { 0xAB, 0xA7, 0xA7, 0, 0, 0 }, { 0x4D, 0x49, 0x49 }, 0x2466661D, 0x24665C1E, }, { "720x576Over", 720, 576, TVTYPE_PAL, 0, 0, { 0x04, 0, 0, 0xA6, 0, 0, 0x10, 0x10, 0x7D, 0x32, 0x60, 0, 0x57, 0x46, 0x0F, 0, 0, 0, 0xEC, 0x15, 0xDC, 0x28, 0, 0, 0, 0, 0xEE, 0, 0x0A, 0, 0, 0x84, 0x13, 0x0C, 0x04, 0x7B, 0x48, 0x64, 0x30, 0x93, 0x49, 0x5F, 0x15, 0xA5, 0x23, 0x77, 0xFF, 0 }, { 0xE7, 0x45, 0x04, 0, 0, 0x45, 0xE7, 0xCF, 0x23, 0x57, 0x02, 0x1F, 0x80, 0x75, 0x23, 0x89, 0xC7, 0xF1, 0xFF, 0x05, 0xD7, 0x80, 0x03, 0, 0, 0xBF, 0x03 }, { 0xBA, 0xB8, 0xB8, 0x90, 0x99, 0 }, { 0x58, 0x48, 0x49 }, 0x2D66772D, 0, }, { "720x480Noscale", 720, 480, TVTYPE_NTSC, 0, 0, { 0x04, 0, 0, 0, 0x03, 0, 0x10, 0x98, 0x98, 0x08, 0x5A, 0x17, 0x49, 0x41, 0, 0x89, 0, 0, 0xA9, 0x19, 0xDC, 0x24, 0, 0, 0, 0, 0xEE, 0x03, 0x02, 0x80, 0, 0x04, 0x11, 0x08, 0x04, 0x75, 0, 0x5A, 0x31, 0x95, 0x51, 0, 0, 0xAA, 0x2B, 0x7A, 0xDB, 0 }, { 0xE4, 0x69, 0x04, 0, 0, 0x40, 0x77, 0xD0, 0x23, 0x0C, 0x02, 0x77, 0xD0, 0x80, 0x23, 0x88, 0xC9, 0x30, 0xD0, 0x16, 0, 0, 0, 0, 0, 0x77, 0x03 }, { 0xBA, 0xB8, 0xB8, 0x90, 0x99, 0 }, /* added later - untested */ { 0x58, 0x48, 0x49 }, /* added later - untested */ 0x20BA2E8B, 0, }, { "720x576Noscale", 720, 576, TVTYPE_PAL, 0, 0, { 0x04, 0, 0, 0xA4, 0, 0, 0x10, 0x75, 0xA5, 0x3A, 0x5A, 0, 0x49, 0x46, 0, 0x89, 0, 0, 0xE9, 0x19, 0xDC, 0x24, 0, 0, 0, 0, 0xEE, 0, 0x0A, 0, 0, 0x04, 0x13, 0x0C, 0x04, 0x7B, 0x48, 0x64, 0x30, 0x93, 0x49, 0x5F, 0x15, 0xA5, 0x23, 0x77, 0xFF, 0 }, { 0xE7, 0x45, 0x04, 0, 0, 0x45, 0x7F, 0xD0, 0x23, 0x70, 0x02, 0x7F, 0xD0, 0x93, 0x23, 0x89, 0xC7, 0xF1, 0xBD, 0x06, 0, 0, 0, 0, 0, 0x7F, 0x03 }, { 0xBA, 0xB8, 0xB8, 0x90, 0x99, 0 }, /* added later - untested */ { 0x58, 0x48, 0x49 }, /* added later - untested */ 0x288933E3, 0, }, { NULL, 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, 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, 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, 0, 0 }, 0, 0, } }; /* * * VT1622A/VT1623 modetables * */ static DisplayModeRec VT1623Modes[] = { { MODEPREFIX("640x480"), 23520, 640, 656, 744, 784, 0, 480, 487, 491, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("640x480"), 30000, 640, 680, 808, 1000, 0, 480, 520, 523, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600"), 39900, 800, 840, 976, 1064, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("800x600"), 34500, 800, 816, 880, 920, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("1024x768"), 54810, 1024, 1032, 1088, 1160, 0, 768, 780, 792, 945, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("1024x768"), 57000, 1024, 1040, 1112, 1200, 0, 768, 829, 840, 950, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("848x480"), 34860, 848, 872, 1032, 1200, 0, 480, 495, 509, 581, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("848x480"), 36000, 848, 872, 1032, 1200, 0, 480, 498, 509, 600, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x480"), 25200, 720, 728, 776, 840, 0, 480, 511, 515, 600, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x576"), 28500, 720, 728, 744, 760, 0, 576, 635, 643, 750, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("640x480Over"), 20160, 640, 648, 704, 720, 0, 480, 490, 491, 560, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("640x480Over"), 21000, 640, 664, 792, 840, 0, 480, 485, 491, 500, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600Over"), 35910, 800, 840, 984, 1080, 0, 600, 601, 604, 665, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("800x600Over"), 32500, 800, 832, 928, 1000, 0, 600, 600, 604, 650, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("1024x768Over"), 50400, 1024, 1040, 1112, 1200, 0, 768, 772, 776, 840, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("1024x768Over"), 49500, 1024, 1032, 1112, 1200, 0, 768, 771, 776, 825, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("848x480Over"), 27720, 848, 856, 928, 1008, 0, 480, 490, 493, 550, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("848x480Over"), 33000, 848, 872, 1032, 1200, 0, 480, 490, 493, 550, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x480Over"), 21000, 720, 728, 760, 800, 0, 480, 480, 483, 525, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x576Over"), 27000, 720, 768, 800, 864, 0, 576, 577, 579, 625, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x576Noscale"), 28000, 720, 736, 768, 896, 0, 576, 576, 579, 625, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x480Noscale"), 27972, 720, 736, 768, 888, 0, 480, 480, 483, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x480pal"), 27972, 720, 736, 768, 888, 0, 480, 480, 483, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, }; static struct VT162XTableRec VT1623Table[] = { { "640x480", 640, 480, TVTYPE_NTSC, 0, 0, { 0x04, 0, 0, 0x06, 0x03, 0, 0x20, 0x28, 0x9A, 0x0C, 0x55, 0, 0x52, 0x3B, 0x0F, 0, 0, 0, 0xF8, 0x3E, 0x81, 0x56, 0, 0, 0, 0, 0xEA, 0, 0, 0, 0, 0x11, 0x15, 0x0C, 0x5F, 0x75, 0x08, 0x56, 0x2F, 0x90, 0x50, 0, 0, 0xA3, 0x29, 0x5B, 0xBF, 0 }, { 0, 0, 0, 0, 0, 0x3B, 0x0F, 0x7F, 0x23, 0x57, 0x02, 0x0F, 0x26, 0x73, 0x63, 0x86, 0xC4, 0xEA, 0xDF, 0x05, 0x92, 0xA1, 0x84, 0, 0, 0x7F, 0x03 }, { 0x6A, 0x62, 0x65, 0x91, 0x9C, 0x27 }, { 0x50, 0x4B, 0x4D }, 0x252491F1, 0x252487BE, }, { "640x480", 640, 480, TVTYPE_PAL, 0, 0, { 0x04, 0, 0, 0x06, 0, 0, 0x20, 0xBF, 0x9F, 0x37, 0x5D, 0, 0x4F, 0x42, 0x0F, 0, 0, 0, 0xAC, 0x15, 0x6E, 0x28, 0, 0, 0, 0, 0xED, 0, 0x02, 0, 0, 0x99, 0x17, 0x0C, 0x31, 0x7A, 0x04, 0x62, 0x30, 0x8E, 0x4A, 0x5B, 0x15, 0xA0, 0x22, 0x5C, 0xCC, 0 }, { 0, 0, 0, 0, 0, 0x43, 0xE7, 0x7F, 0x23, 0x57, 0x02, 0x1F, 0x2F, 0x75, 0x63, 0x8A, 0xC8, 0xF0, 0xFF, 0x05, 0xD7, 0x8E, 0x83, 0x7F, 0xCF, 0xBF, 0x03 }, { 0x6A, 0x62, 0x65, 0x8D, 0x96, 0x20 }, { 0x42, 0x49, 0x49 }, 0x2D66772D, 0, }, { "800x600", 800, 600, TVTYPE_NTSC, 0, 0, { 0x84, 0, 0, 0x04, 0x03, 0, 0x20, 0x58, 0xD4, 0x09, 0x52, 0, 0x51, 0x3B, 0x0F, 0, 0, 0, 0x6A, 0x0D, 0x4C, 0x1C, 0, 0, 0, 0, 0x3E, 0, 0x01, 0, 0, 0x44, 0x10, 0x0A, 0x9C, 0x75, 0x04, 0x56, 0x41, 0x90, 0x6B, 0, 0, 0xA3, 0x29, 0x86, 0x10, 0x10 }, { 0, 0, 0, 0, 0, 0x3A, 0x27, 0x1F, 0x34, 0xED, 0x02, 0x27, 0xF5, 0x9D, 0x64, 0xB7, 0x0D, 0x40, 0, 0x58, 0xB6, 0x3B, 0x85, 0, 0x01, 0xEF, 0x05 }, { 0x6A, 0x62, 0x65, 0x91, 0x9C, 0 }, { 0x43, 0x4A, 0x49 }, 0x1B5E5096, 0x1B5E4912, }, { "800x600", 800, 600, TVTYPE_PAL, 0, 0, { 0x84, 0, 0, 0x04, 0, 0, 0x20, 0x27, 0xB8, 0x0D, 0x5C, 0, 0x4E, 0x40, 0x0F, 0, 0, 0, 0xEC, 0x2A, 0xFD, 0x28, 0, 0, 0, 0, 0x11, 0, 0x01, 0, 0, 0xAA, 0x13, 0x0C, 0x9F, 0x79, 0x0C, 0x62, 0x37, 0x8E, 0x54, 0x5B, 0x15, 0xA0, 0x22, 0x70, 0xF4, 0 }, { 0, 0, 0, 0, 0, 0x41, 0x97, 0x1F, 0x33, 0xED, 0x02, 0x97, 0x87, 0x87, 0x63, 0x9F, 0xE7, 0x16, 0xE7, 0x16, 0xCC, 0xF3, 0x84, 0, 0x01, 0x4F, 0x04 }, { 0x6A, 0x62, 0x65, 0, 0, 0}, { 0x58, 0x5E, 0x5E }, 0x277A7DE4, 0, }, { "1024x768", 1024, 768, TVTYPE_NTSC, 0, 0, { 0x84, 0, 0, 0x04, 0x03, 0, 0x20, 0x47, 0x12, 0x08, 0x50, 0, 0x50, 0x3A, 0x0F, 0, 0, 0, 0xEF, 0x37, 0x77, 0x2A, 0, 0, 0, 0, 0xA1, 0, 0x05, 0, 0, 0x77, 0x0D, 0x05, 0xEF, 0x73, 0x0C, 0x56, 0x56, 0x90, 0x8B, 0, 0, 0xA3, 0x29, 0xB9, 0x6A, 0x10 }, { 0, 0, 0, 0, 0, 0x39, 0x87, 0xFF, 0x34, 0xB0, 0x03, 0x6F, 0xDC, 0xCD, 0x35, 0xF1, 0x5E, 0xA5, 0x7E, 0x5A, 0x33, 0x26, 0x87, 0, 0x01, 0x27, 0x08 }, { 0x6A, 0x62, 0x65, 0x91, 0x9C, 0 }, { 0x58, 0x4B, 0x4A }, 0x14EB66D6, 0x14EB6118, }, { "1024x768", 1024, 768, TVTYPE_PAL, 0, 0, { 0x84, 0, 0, 0x04, 0, 0, 0x20, 0x57, 0x25, 0x35, 0x5A, 0, 0x4D, 0x40, 0x0F, 0, 0, 0, 0xE8, 0x23, 0xD1, 0x18, 0, 0, 0, 0, 0x96, 0, 0x07, 0, 0, 0xFF, 0x0F, 0x0C, 0x87, 0x79, 0, 0x62, 0x53, 0x8E, 0x7B, 0x5B, 0x15, 0xA0, 0x22, 0xB6, 0x5A, 0x10 }, { 0, 0, 0, 0, 0, 0x40, 0xAF, 0xFF, 0x34, 0xB5, 0x03, 0x57, 0xA8, 0xC8, 0x35, 0xEC, 0x4C, 0xCC, 0x67, 0x5A, 0x14, 0x5C, 0x06, 0, 0x01, 0x1F, 0x07 }, { 0x6A, 0x62, 0x65, 0, 0, 0 }, { 0x50, 0x69, 0x69 }, 0x1A8CC372, 0, }, { "848x480", 848, 480, TVTYPE_NTSC, 0, 0, { 0x84, 0, 0, 0x04, 0x03, 0, 0x20, 0xA7, 0xC1, 0x07, 0x50, 0, 0x50, 0x39, 0x0F, 0, 0, 0, 0xF0, 0x29, 0x67, 0x31, 0, 0, 0, 0, 0x2A, 0, 0x03, 0, 0, 0x33, 0x11, 0x08, 0x47, 0x73, 0x0C, 0x56, 0x3C, 0x90, 0x65, 0, 0, 0xA3, 0x29, 0x7C, 0, 0x10 }, { 0, 0, 0, 0, 0, 0x39, 0xAF, 0x4F, 0x34, 0x44, 0x02, 0xE3, 0xC2, 0x93, 0x63, 0xAD, 0xFD, 0x2B, 0x7C, 0x17, 0x6D, 0xCA, 0x84, 0, 0x01, 0x2F, 0x05 }, { 0x6A, 0x62, 0x65, 0x91, 0x9C, 0 }, { 0x44, 0x45, 0x45 }, 0x1D3CA863, 0x1D3CA05B, }, { "848x480", 848, 480, TVTYPE_PAL, 0, 0, { 0x04, 0, 0, 0x06, 0, 0, 0x20, 0xA7, 0xE6, 0x06, 0x5C, 0, 0x4E, 0x41, 0x0F, 0, 0, 0, 0xE6, 0x23, 0x84, 0x18, 0, 0, 0, 0, 0x56, 0, 0x01, 0, 0, 0xCC, 0x0F, 0x0C, 0x60, 0x79, 0, 0x62, 0x46, 0x8E, 0x68, 0x5B, 0x15, 0xA0, 0x22, 0x94, 0x2A, 0x10 }, { 0, 0, 0, 0, 0, 0x40, 0xAF, 0x4F, 0x34, 0x57, 0x02, 0x7F, 0x31, 0xA9, 0x74, 0xD1, 0x2B, 0x5D, 0xAA, 0x58, 0xD7, 0x26, 0x83, 0, 0x01, 0x7F, 0x04 }, { 0x6A, 0x62, 0x65, 0, 0, 0 }, { 0x50, 0x49, 0x49 }, 0x1F872818, 0, }, { "720x480", 720, 480, TVTYPE_NTSC, 0, 0, { 0x04, 0, 0, 0x06, 0x03, 0, 0x20, 0x3F, 0xB6, 0x07, 0x52, 0, 0x51, 0x3A, 0x0F, 0, 0, 0, 0xED, 0x31, 0x50, 0x35, 0, 0, 0, 0, 0x1E, 0, 0x03, 0, 0, 0x33, 0x12, 0x08, 0x57, 0x75, 0, 0x56, 0x3A, 0x90, 0x61, 0, 0, 0xA3, 0x29, 0x76, 0xF1, 0 }, { 0, 0, 0, 0, 0, 0x3A, 0x47, 0xCF, 0x23, 0x57, 0x02, 0xBF, 0xAD, 0x8D, 0x63, 0xA4, 0xF3, 0x20, 0x36, 0x17, 0x92, 0x33, 0x84, 0, 0, 0xBF, 0x03 }, { 0x6A, 0x62, 0x65, 0x91, 0x9C, 0 }, { 0x42, 0x49, 0x48 }, 0x1E555518, 0x1E554CC3, }, { "720x576", 720, 576, TVTYPE_PAL, 0, 0, { 0x04, 0, 0, 0x06, 0, 0, 0x20, 0x0F, 0xAF, 0x35, 0x5D, 0, 0x4F, 0x41, 0x0F, 0, 0, 0, 0xF8, 0x3C, 0x73, 0x56, 0, 0, 0, 0, 0xED, 0, 0x02, 0, 0, 0x99, 0x18, 0x0C, 0x76, 0x7A, 0x44, 0x62, 0x30, 0x8E, 0x49, 0x5B, 0x15, 0xA0, 0x22, 0x5C, 0xBD, 0 }, { 0, 0, 0, 0, 0, 0x43, 0xF7, 0xCF, 0x22, 0xED, 0x02, 0x1D, 0x29, 0x75, 0x63, 0x88, 0xC6, 0xF0, 0xFA, 0x0F, 0xCC, 0x30, 0x94, 0, 0, 0x8F, 0x03 }, { 0x6A, 0x62, 0x65, 0, 0, 0 }, { 0x59, 0x4D, 0x4A }, 0x2D839832, 0, }, { "640x480Over", 640, 480, TVTYPE_NTSC, 0, 0, { 0x04, 0, 0, 0x06, 0x03, 0, 0x20, 0x10, 0x76, 0x0A, 0x56, 0x05, 0x50, 0x3B, 0x0F, 0, 0, 0, 0xED, 0x23, 0xC0, 0x34, 0, 0, 0, 0, 0xE5, 0, 0x02, 0, 0, 0x11, 0x17, 0x0C, 0x46, 0x73, 0x0C, 0x56, 0x2E, 0x90, 0x4E, 0, 0, 0xA3, 0x29, 0x59, 0xBA, 0 }, { 0, 0, 0, 0, 0, 0x3A, 0xCF, 0x7F, 0x22, 0x2F, 0x02, 0xFF, 0x59, 0x71, 0x62, 0x83, 0xC0, 0xE5, 0xC0, 0x05, 0x44, 0x44, 0x84, 0, 0, 0xFF, 0x02 }, { 0x6A, 0x62, 0x65, 0, 0, 0 }, { 0x4F, 0x49, 0x49 }, 0x25EAAA5E, 0x25EA9FF4, }, { "640x480Over", 640, 480, TVTYPE_PAL, 0, 0, { 0x04, 0, 0, 0x06, 0, 0, 0x20, 0x23, 0x4E, 0x2A, 0x61, 0, 0x4D, 0x47, 0x0F, 0, 0, 0, 0x4A, 0x0F, 0x37, 0x28, 0, 0, 0, 0, 0xC7, 0, 0x02, 0, 0, 0x88, 0x1B, 0x0C, 0xFF, 0x79, 0, 0x62, 0x28, 0x8E, 0x3E, 0x5B, 0x15, 0xA0, 0x22, 0x49, 0xCC, 0 }, { 0, 0, 0, 0, 0, 0x44, 0x47, 0x7F, 0x23, 0xF3, 0x01, 0x9F, 0x3F, 0x62, 0x62, 0x72, 0xA7, 0xCB, 0x05, 0x05, 0x33, 0x70, 0x83, 0, 0, 0x9F, 0x02 }, { 0x6A, 0x62, 0x65, 0x90, 0x99, 0 }, { 0x42, 0x49, 0x49 }, 0x360C44BC, 0, }, { "800x600Over", 800, 600, TVTYPE_NTSC, 0, 0, { 0x84, 0, 0, 0x04, 0x03, 0, 0x20, 0x5F, 0xA4, 0x08, 0x51, 0, 0x50, 0x39, 0x0F, 0, 0, 0, 0xE8, 0x33, 0xE6, 0x18, 0, 0, 0, 0, 0x32, 0, 0x03, 0, 0, 0x33, 0x11, 0x0A, 0x9B, 0x73, 0x08, 0x56, 0x3F, 0x90, 0x68, 0, 0, 0xA3, 0x29, 0x82, 0x02, 0x10 }, { 0, 0, 0, 0, 0, 0x39, 0x37, 0x21, 0x34, 0x98, 0x02, 0x01, 0x21, 0x97, 0x74, 0xB1, 0xFF, 0x34, 0xB6, 0x17, 0x11, 0, 0x85, 0, 0x01, 0x57, 0x05 }, { 0x6A, 0x62, 0x65, 0, 0, 0 }, { 0x42, 0x45, 0x45 }, 0x1C61CEE0, 0x1C61C714, }, { "800x600Over", 800, 600, TVTYPE_PAL, 0, 0, { 0x84, 0, 0, 0x04, 0, 0, 0x20, 0x47, 0x90, 0x3B, 0x5A, 0, 0x4D, 0x3F, 0x0F, 0, 0, 0, 0xE8, 0x24, 0x8F, 0x1C, 0, 0, 0, 0, 0x0E, 0, 0x03, 0, 0, 0xAA, 0x14, 0x0C, 0x2F, 0x79, 0, 0x62, 0x37, 0x8E, 0x54, 0x5B, 0x15, 0xA0, 0x22, 0x6E, 0xF4, 0 }, { 0, 0, 0, 0, 0, 0x41, 0xE7, 0x1F, 0x33, 0x89, 0x02, 0x8D, 0xCD, 0x85, 0x63, 0x9C, 0xE4, 0x13, 0xD4, 0x16, 0x28, 0x60, 0x84, 0, 0x01, 0x0F, 0x04 }, { 0x6A, 0x62, 0x65, 0x90, 0x99, 0 }, { 0x58, 0x48, 0x48 }, 0x27E98D57, 0, }, { "1024x768Over", 1024, 768, TVTYPE_NTSC, 0, 0, { 0x84, 0, 0, 0x04, 0x03, 0, 0x20, 0x52, 0xAE, 0x09, 0x50, 0, 0x50, 0x39, 0x0F, 0, 0, 0, 0xE8, 0x33, 0x0D, 0x15, 0, 0, 0, 0, 0x66, 0, 0x03, 0, 0, 0x55, 0x0F, 0x05, 0xF1, 0x73, 0x08, 0x56, 0x4A, 0x90, 0x79, 0, 0, 0xA3, 0x29, 0x9B, 0x33, 0x10 }, { 0, 0, 0, 0, 0, 0x39, 0xAF, 0xFF, 0x34, 0x47, 0x03, 0xAF, 0xC3, 0xB1, 0x34, 0xD1, 0x30, 0x68, 0x0B, 0x59, 0x66, 0x40, 0x86, 0, 0x01, 0x7F, 0x07 }, { 0x6A, 0x62, 0x65, 0, 0, 0 }, { 0x57, 0x45, 0x45 }, 0x1844440E, 0x18443D63, }, { "1024x768Over", 1024, 768, TVTYPE_PAL, 0, 0, { 0x84, 0, 0, 0x04, 0, 0, 0x20, 0x56, 0xC0, 0x32, 0x5A, 0, 0x4D, 0x40, 0x0F, 0, 0, 0, 0xC9, 0x14, 0x79, 0x1C, 0, 0, 0, 0, 0x6D, 0, 0x03, 0, 0, 0xDD, 0x0F, 0x0C, 0xCA, 0x79, 0x08, 0x62, 0x4B, 0x8E, 0x6F, 0x5B, 0x15, 0xA0, 0x22, 0xA1, 0x5A, 0x10 }, { 0, 0, 0, 0, 0, 0x40, 0xAF, 0xFF, 0x34, 0x38, 0x03, 0xCF, 0xDF, 0xB4, 0x34, 0xD6, 0x35, 0x75, 0x47, 0x59, 0x47, 0x20, 0x05, 0, 0x01, 0x2F, 0x06 }, { 0x6A, 0x62, 0x65, 0x90, 0x99, 0 }, { 0x51, 0x49, 0x49 }, 0x1D7B0E38, 0, }, { "848x480Over", 848, 480, TVTYPE_NTSC, 0, 0, { 0x84, 0, 0, 0x04, 0x03, 0, 0x20, 0x4E, 0x9E, 0x07, 0x51, 0, 0x50, 0x3A, 0x0F, 0, 0, 0, 0xED, 0x23, 0x08, 0x35, 0, 0, 0, 0, 0x3C, 0, 0x03, 0, 0, 0x44, 0x11, 0x0A, 0xF0, 0x73, 0x04, 0x56, 0x41, 0x90, 0x6A, 0, 0, 0xA3, 0x29, 0x87, 0x0A, 0x10 }, { 0, 0, 0, 0, 0, 0x39, 0xEF, 0x51, 0x33, 0x25, 0x02, 0x1F, 0x47, 0x9C, 0x74, 0xB5, 0x0C, 0x3D, 0xF1, 0x57, 0x30, 0x0C, 0x84, 0, 0x01, 0x1F, 0x04 }, { 0x6A, 0x62, 0x65, 0, 0, 0 }, { 0x58, 0x45, 0x45 }, 0x1B9364A1, 0x1B933067, }, { "848x480Over", 848, 480, TVTYPE_PAL, 0, 0, { 0x84, 0, 0, 0x04, 0, 0, 0x20, 0xA5, 0xA1, 0x38, 0x5E, 0, 0x4D, 0x41, 0x0F, 0, 0, 0, 0xC7, 0x1E, 0x79, 0x1C, 0, 0, 0, 0, 0x39, 0, 0x03, 0, 0, 0xBB, 0x12, 0x0C, 0x5A, 0x79, 0x0C, 0x62, 0x40, 0x8E, 0x5F, 0x5B, 0x15, 0xA0, 0x22, 0x88, 0x2A, 0x10 }, { 0, 0, 0, 0, 0, 0x3A, 0xAF, 0x4F, 0x34, 0x25, 0x02, 0x1F, 0x4F, 0x9B, 0x74, 0xB7, 0x0A, 0x3F, 0xF0, 0x58, 0x85, 0, 0x83, 0, 0x01, 0x1F, 0x04 }, { 0x6A, 0x62, 0x65, 0x90, 0x99, 0 }, { 0x4E, 0x49, 0x49 }, 0x2264E5EC, 0, }, { "720x480Over", 720, 480, TVTYPE_NTSC, 0, 0, { 0x04, 0, 0, 0, 0x03, 0, 0x20, 0x28, 0x52, 0x08, 0x50, 0, 0x4E, 0x2F, 0x0F, 0, 0, 0, 0x2D, 0x07, 0x28, 0x34, 0, 0, 0, 0, 0xEE, 0, 0x02, 0, 0, 0x11, 0x16, 0x08, 0xDF, 0x76, 0x04, 0x56, 0x31, 0x90, 0x51, 0, 0, 0xA3, 0x29, 0x5D, 0xC3, 0 }, { 0, 0, 0, 0, 0x08, 0x3A, 0x1F, 0xCF, 0x23, 0x0C, 0x02, 0x1F, 0xCE, 0x76, 0x23, 0x88, 0xC9, 0xEF, 0xFF, 0x05, 0, 0, 0, 0, 0, 0x1F, 0x03 }, { 0x6A, 0x62, 0x65, 0, 0, 0 }, { 0x4D, 0x49, 0x49 }, 0x2466661D, 0x24665C1E, }, { "720x576Over", 720, 576, TVTYPE_PAL, 0, 0, { 0x04, 0, 0, 0, 0, 0, 0x20, 0x3F, 0x89, 0x35, 0x50, 0, 0x43, 0x2E, 0x0F, 0, 0, 0, 0xE8, 0x23, 0x84, 0x20, 0, 0, 0, 0, 0xFF, 0, 0x02, 0, 0, 0x99, 0x17, 0x0C, 0x6F, 0x79, 0x48, 0x62, 0x34, 0x8E, 0x4F, 0x5B, 0x15, 0xA0, 0x22, 0x67, 0xFF, 0 }, { 0, 0, 0, 0, 0, 0x3A, 0x5F, 0xCF, 0x23, 0x70, 0x02, 0x5F, 0xBF, 0x7E, 0x23, 0x94, 0xD0, 0x27, 0x8F, 0x16, 0, 0, 0x04, 0, 0, 0x5F, 0x03 }, { 0x6A, 0x62, 0x65, 0x90, 0x99, 0 }, { 0x58, 0x48, 0x49 }, 0x2A098ACB, 0, }, { "720x576Noscale", 720, 576, TVTYPE_PAL, 0, 0, { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x78, 0x78, 0x38, 0x5a, 0x00, 0x49, 0x2e, 0x00, 0x80, 0x00, 0x00, 0x03, 0x0f, 0x16, 0x0c, 0x8d, 0x33, 0x89, 0x28, 0xee, 0x10, 0x02, 0x80, 0x00, 0x00, 0x13, 0x0c, 0x04, 0x7b, 0x48, 0x64, 0x30, 0x93, 0x49, 0x5f, 0x15, 0xa5, 0x23, 0x77, 0xff, 0x00, }, { 0x00, 0x00, 0x04, 0x00, 0x00, 0x45, 0x7f, 0xd0, 0x23, 0x70, 0x02, 0x7f, 0xd0, 0x83, 0x23, 0x9c, 0xdb, 0x08, 0xb7, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x03, }, { 0xBA, 0xB8, 0xB8, 0x90, 0x99, 0 }, { 0x58, 0x48, 0x49 }, 0x2889338d, 0, }, { "720x480Noscale", 720, 480, TVTYPE_NTSC, 0, 0, { 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x20, 0x78, 0x78, 0x06, 0x5a, 0x00, 0x49, 0x2f, 0x00, 0x80, 0x00, 0x00, 0xed, 0x23, 0xde, 0x34, 0x97, 0xab, 0xca, 0x20, 0xee, 0x10, 0x02, 0x80, 0x00, 0x11, 0x11, 0x08, 0x04, 0x76, 0x08, 0x5a, 0x31, 0x95, 0x51, 0x00, 0x00, 0xaa, 0x2b, 0x7a, 0xdb, 0x00, }, { 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x77, 0xd0, 0x23, 0x0c, 0x02, 0x77, 0xd0, 0x83, 0x23, 0x98, 0xde, 0xe8, 0xc4, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x03, }, { 0xBA, 0xB8, 0xB8, 0x90, 0x99, 0 }, { 0x58, 0x48, 0x49 }, 0x20caab97, 0, }, { "720x480pal", 720, 480, TVTYPE_PAL, 0, 0, { 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20, 0x74, 0x8c, 0x06, 0x50, 0x00, 0x4e, 0x2f, 0x00, 0x07, 0x00, 0x00, 0xa9, 0x19, 0x6e, 0x24, 0xe3, 0x33, 0x89, 0x28, 0xee, 0x10, 0x02, 0x80, 0x00, 0x11, 0x11, 0x08, 0x04, 0x76, 0x08, 0x5a, 0x31, 0x95, 0x51, 0x00, 0x00, 0xaa, 0x2b, 0x7a, 0xdb, 0x00, }, { 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x77, 0xd0, 0x23, 0x0c, 0x02, 0x77, 0xd0, 0xb0, 0x23, 0x88, 0xc9, 0x30, 0xd0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x03 }, { 0xBA, 0xB8, 0xB8, 0x90, 0x99, 0 }, { 0x58, 0x48, 0x49 }, 0x288933e3, 0, }, { NULL, 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, 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, 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, 0, 0 }, 0, 0, } }; /* * * VT1625 modetables * */ static DisplayModeRec VT1625Modes[] = { /* all available modes are: */ /* { MODEPREFIX("640x480"), ... , MODESUFFIXNTSC }, { MODEPREFIX("800x600"), ... , MODESUFFIXNTSC }, { MODEPREFIX("1024x768"), ... , MODESUFFIXNTSC }, { MODEPREFIX("720x480"), ... , MODESUFFIX480P }, { MODEPREFIX("640x480"), ... , MODESUFFIX720P }, { MODEPREFIX("800x600"), ... , MODESUFFIX720P }, { MODEPREFIX("1024x768"), ... , MODESUFFIX720P }, { MODEPREFIX("720x480"), ... , MODESUFFIX720P }, { MODEPREFIX("720x576"), ... , MODESUFFIX720P }, { MODEPREFIX("640x480"), ... , MODESUFFIX1080I }, { MODEPREFIX("800x600"), ... , MODESUFFIX1080I }, { MODEPREFIX("1024x768"), ... , MODESUFFIX1080I }, { MODEPREFIX("720x480"), ... , MODESUFFIX1080I }, { MODEPREFIX("720x576"), ... , MODESUFFIX1080I }, { MODEPREFIX("640x480Over"), ... , MODESUFFIXNTSC }, { MODEPREFIX("800x600Over"), ... , MODESUFFIXNTSC }, { MODEPREFIX("1024x768Over"), ... , MODESUFFIXNTSC }, { MODEPREFIX("720x480Over"), ... , MODESUFFIXNTSC }, { MODEPREFIX("640x480Over"), ... , MODESUFFIXPAL }, { MODEPREFIX("800x600Over"), ... , MODESUFFIXPAL }, { MODEPREFIX("1024x768Over"), ... , MODESUFFIXPAL }, { MODEPREFIX("720x576Over"), ... , MODESUFFIXPAL },*/ /* clock HR SH1 SH2 HFL VR SV1 SV2 VFL*/ { MODEPREFIX("640x480"), 30000, 640, 688, 744, 784, 0, 480, 488, 495, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600"), 34500, 800, 816, 880, 920, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("1024x768"), 57000, 1024, 1040, 1112, 1200, 0, 768, 829, 840, 950, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x576"), 34500, 720, 760, 800, 1000, 0, 576, 577, 580, 690, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x576Over"), 27000, 720, 768, 800, 864, 0, 576, 577, 579, 625, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("1280x720"), 74250, 1280, 1320, 1376, 1650, 0, 720, 722, 728, 750, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX720P }, { MODEPREFIX("1920x1080"), 74250, 1920, 1960, 2064, 2200, 0, 1080, 1083, 1087, 1125, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX1080I }, { MODEPREFIX("640x480"), 24696, 640, 656, 744, 784, 0, 480, 482, 483, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x480Under"), 34000, 720, 728, 744, 784, 0, 480, 490, 496, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x480Fit"), 28980, 720, 728, 776, 840, 0, 480, 484, 499, 575, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x480Over"), 27025, 720, 752, 792, 800, 0, 480, 482, 485, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x480Under"), 28224, 720, 728, 744, 784, 0, 480, 490, 496, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX480P }, { MODEPREFIX("720x480Fit"), 28980, 720, 728, 776, 840, 0, 480, 484, 499, 575, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX480P }, { MODEPREFIX("720x480Over"), 27027, 720, 784, 808, 858, 0, 480, 483, 486, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX480P }, }; static struct VT162XTableRec VT1625Table[] = { { "640x480", 640, 480, TVTYPE_NTSC, 0, 0, /* 00 0F */ { 0x03, 0, 0x10, 0x40, 0x10, 0, 0, 0x28, 0x47, 0x15, 0x7B, 0, 0x50, 0x57, 0, 0x9E, 0, 0x80, 0xFA, 0x21, 0xE0, 0x68, 0xD6, 0x7B, 0xF0, 0x21, 0x02, 0x50, 0x41, 0x80, 0, 0x10, 0x1C, 0x2A, 0xCB, 0x77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0, 0, 0x01, 0x10, 0x4A, 0x0F, 0x83, 0x23, 0x57, 0x22, 0x59, 0x83, 0x7F, 0x23, 0x91, /* 5A 5F 60 64 */ 0xD2, 0x13, 0x7C, 0x16, 0x49, 0, 0x92, 0x20, 0, 0x7F, 0x03 }, /* RBG 65,66,67,27,2b,2c */ { 0x55, 0x37, 0x5C, 0, 0, 0 }, /* Y-Cb-Cr 65,66,67 */ { 0x55, 0x56, 0x55 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x21F07BD6, 0x21F087BE, }, { "720x480Under", 720, 480, TVTYPE_NTSC, 0, 0, /* 00 0F */ { 0x03, 0, 0x10, 0x1F, 0x00, 0, 0, 0x2A, 0x41, 0x0A, 0x7B, 0x15, 0x50, 0x57, 0, 0xB7, 0, 0x80, 0xAB, 0x27, 0x70, 0x2C, 0xD6, 0x7B, 0xF0, 0x21, 0x02, 0x50, 0x41, 0x80, 0, 0x10, 0x1C, 0x08, 0xCB, 0x77, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0x00, 0x01, 0x10, 0x4A, 0x0F, 0xCF, 0x23, 0x57, 0x22, 0x59, 0x83, 0x7F, 0x23, 0x91, /* 5A 5F 60 64 */ 0xD2, 0x13, 0x7A, 0x16, 0x49, 0xF1, 0x92, 0xA8, 0xFF, 0x7F, 0x03 }, /* RBG 65,66,67,27,2b,2c */ { 0x55, 0x37, 0x5C, 0, 0, 0 }, /* Y-Cb-Cr 65,66,67 */ { 0x55, 0x54, 0x56 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x21F07BD6, 0x21F04CC3, }, { "720x480Fit", 720, 480, TVTYPE_NTSC, 0, 0, /* 00 0F */ { 0x03, 0, 0x10, 0x1F, 0x00, 0, 0, 0x41, 0x3B, 0x0B, 0x7B, 0x15, 0x50, 0x57, 0, 0xB7, 0, 0x80, 0xCD, 0x21, 0x73, 0x34, 0xD6, 0x7B, 0xF0, 0x21, 0x02, 0x50, 0x43, 0x80, 0, 0x10, 0x1C, 0x08, 0xCA, 0x77, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0, 0x01, 0x10, 0x4A, 0x47, 0xCF, 0x23, 0x3E, 0x22, 0x59, 0x8B, 0x7F, 0x23, 0x91, /* 5A 5F 60 64 */ 0xD2, 0x13, 0x7A, 0x16, 0x30, 0xD4, 0x8C, 0x28, 0xFF, 0x97, 0x03 }, /* RBG 65,66,67,27,2b,2c */ { 0x55, 0x37, 0x5C, 0, 0, 0 }, /* Y-Cb-Cr 65,66,67 */ { 0x55, 0x54, 0x56 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x21F07BD6, 0x21F0EBE8, }, { "720x480Over", 720, 480, TVTYPE_NTSC, 0, 0, /* 00 0F */ { 0x03, 0, 0x10, 0x1F, 0x00, 0, 0, 0x02, 0x10, 0x00, 0x7B, 0x15, 0x50, 0x57, 0, 0xB7, 0, 0x80, 0xAD, 0x21, 0x64, 0x34, 0xD6, 0x7B, 0xF0, 0x21, 0x00, 0x50, 0x00, 0x80, 0, 0x10, 0x1C, 0x08, 0xE5, 0x77, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0, 0x01, 0x10, 0x4A, 0x1F, 0xD2, 0x23, 0x0C, 0x22, 0x59, 0xC0, 0x7E, 0x23, 0x8C, /* 5A 5F 60 64 */ 0xD0, 0xF6, 0x7C, 0x06, 0, 0x34, 0x80, 0x28, 0xFF, 0x1F, 0x03 }, /* RBG 65,66,67,27,2b,2c */ { 0x55, 0x37, 0x5C, 0, 0, 0 }, /* Y-Cb-Cr 65,66,67 */ { 0x55, 0x54, 0x56 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x21F07BD6, 0x21F05C1E, }, { "720x480Under", 720, 480, TVTYPE_480P, 0, 0, /* 00 0F */ { 0x03, 0, 0x10, 0x40, 0x10, 0, 0, 0x2A, 0x41, 0x14, 0x7B, 0, 0x50, 0x57, 0, 0xB7, 0, 0x80, 0xAB, 0x27, 0x70, 0x2C, 0xD6, 0x7B, 0xF0, 0x21, 0x02, 0x50, 0x41, 0x80, 0, 0x01, 0x2F, 0x08, 0xCB, 0x7E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0, 0x01, 0, 0x4A, 0x0F, 0xCF, 0x23, 0x57, 0x22, 0x59, 0x83, 0x7F, 0x23, 0x91, /* 5A 5F 60 64 */ 0xD2, 0x13, 0x7A, 0x16, 0x49, 0xF1, 0x92, 0xA8, 0, 0x7F, 0x03 }, /* RBG 65,66,67,27,2b,2c */ { 0x55, 0x37, 0x5C, 0, 0, 0 }, /* Y-Cb-Cr 65,66,67 */ { 0x55, 0x54, 0x56 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x21F07BD6, 0x21F087BE, }, { "720x480Fit", 720, 480, TVTYPE_480P, 0, 0, /* 00 0F */ { 0x03, 0, 0x10, 0x40, 0x10, 0, 0, 0x41, 0x43, 0xFF, 0x7B, 0, 0x50, 0x57, 0, 0xB7, 0, 0x80, 0xCD, 0x21, 0x73, 0x34, 0xD6, 0x7B, 0xF0, 0x21, 0x02, 0x50, 0x43, 0x80, 0, 0x01, 0x2F, 0x08, 0xCA, 0x7E, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0, 0x01, 0, 0x4A, 0x47, 0xCF, 0x23, 0x3E, 0x22, 0x59, 0x8B, 0x7F, 0x23, 0x91, /* 5A 5F 60 64 */ 0xD2, 0x13, 0x7A, 0x16, 0x30, 0xD4, 0x8C, 0x28, 0, 0x97, 0x03 }, /* RBG 65,66,67,27,2b,2c */ { 0x55, 0x37, 0x5C, 0, 0, 0 }, /* Y-Cb-Cr 65,66,67 */ { 0x55, 0x54, 0x56 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x21F07BD6, 0x21F087BE, }, { "720x480Over", 720, 480, TVTYPE_480P, 0, 0, /* 00 0F */ { 0x03, 0, 0x10, 0x40, 0x10, 0, 0, 0x01, 0x20, 0, 0x7B, 0, 0x50, 0x57, 0, 0x9E, 0, 0x80, 0x04, 0x08, 0x08, 0x10, 0xD6, 0x7B, 0xF0, 0x21, 0x02, 0x50, 0x00, 0x80, 0, 0x01, 0x2F, 0x08, 0xDC, 0x7E, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0, 0x01, 0, 0x4A, 0x59, 0xCF, 0x23, 0x0C, 0x22, 0x59, 0xCF, 0x7F, 0x23, 0x91, /* 5A 5F 60 64 */ 0xD2, 0xE1, 0x7D, 0x06, 0, 0, 0x80, 0x28, 0, 0x59, 0x03 }, /* RBG 65,66,67,27,2b,2c */ { 0x55, 0x37, 0x5C, 0, 0, 0 }, /* Y-Cb-Cr 65,66,67 */ { 0x55, 0x54, 0x56 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x21F07BD6, 0x21F087BE, }, { "1280x720", 1280, 720, TVTYPE_720P, 0, 0, /* 00 0F */ { 0x83, 0, 0x10, 0x40, 0x94, 0x00, 0, 0xFF, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9E, 0x00, 0x80, 0x89, 0x10, 0x63, 0x24, 0x00, 0x00, 0x00, 0x00, 0, 0x50, 0x40, 0x80, 0x00, 0x03, 0x25, 0x00, 0x00, 0x7E, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* hdtv - 4A 0x85, 4B 0x0A */ /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0, 0x01, 0, 0x00, 0x71, 0xFF, 0x46, 0xED, 0x12, 0x71, 0xFF, 0x50, 0x46, 0x30, /* 5A 5F 60 64 */ 0x30, 0x1C, 0x47, 0x96, 0x00, 0x00, 0x80, 0x28, 0x00, 0x71, 0x36 }, /* RBG 65,66,67,27,2b,2c */ { 0x55, 0x39, 0x66, 0, 0, 0 }, /* Y-Cb-Cr 65,66,67 */ { 0x55, 0x56, 0x55 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x0, 0x0, }, { "1920x1080", 1920, 1080, TVTYPE_1080I, 0, 0, /* 00 0F */ { 0x83, 0, 0x10, 0x4A, 0x86, 0x32, 0, 0x8B, 0x3D, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9E, 0x00, 0x80, 0x4A, 0x08, 0x37, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x04, 0x80, 0x00, 0x03, 0x25, 0x00, 0x00, 0x7E, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0, 0x01, 0, 0x00, 0x97, 0x7F, 0x78, 0x64, 0x14, 0x97, 0x7f, 0x59, 0x78, 0xb0, /* 5A 5F 60 64 */ 0x1a, 0xdc, 0x5d, 0x08, 0x00, 0x00, 0x80, 0x28, 0xFF, 0x97, 0x28 }, /* RBG 65,66,67,27,2b,2c */ { 0x55, 0x39, 0x66, 0, 0, 0 }, /* Y-Cb-Cr 65,66,67 */ { 0x55, 0x56, 0x55 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x0, 0x0, }, { "640x480", 640, 480, TVTYPE_PAL, 0, 0, /* 00 0F */ { 0x03, 0, 0x10, 0x1F, 0x03, 0, 0, 0xF2, 0x42, 0x0A, 0x88, 0x00, 0x55, 0x5E, 0, 0xB0, 0, 0x80, 0x0A, 0x09, 0x19, 0x28, 0xCB, 0x8A, 0x09, 0x2A, 0, 0x50, 0x41, 0x80, 0, 0x10, 0x17, 0x1C, 0x35, 0x7D, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0, 0x01, 0x10, 0x51, 0xE7, 0x81, 0x23, 0x57, 0x22, 0x5F, 0x6F, 0x7F, 0x23, 0x94, /* 5A 5F 60 64 */ 0xD0, 0x1C, 0x8F, 0x16, 0xE1, 0x38, 0x7A, 0x28, 0xFF, 0xBF, 0x03 }, /* RBG 65,66,67,27,2b,2c */ { 0x6A, 0x62, 0x65, 0x8D, 0x96, 0x20 }, /* Y-Cb-Cr 65,66,67 */ { 0x42, 0x49, 0x49 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x2D66772D, 0, }, { "720x576", 720, 576, TVTYPE_PAL, 0, 0, /* 00 0F */ { 0x03, 0x00, 0x10, 0x1f, 0x03, 0x00, 0x00, 0xc9, 0x4c, 0x10, 0x7c, 0x00, 0x56, 0x57, 0x07, 0xbf, 0x00, 0x80, 0x09, 0x08, 0x17, 0x24, 0xcb, 0x8a, 0x09, 0x2a, 0x06, 0x50, 0x00, 0x80, 0x00, 0x10, 0x14, 0x0c, 0x32, 0x7e, 0x00, 0x5f, 0x34, 0x8c, 0x4f, 0x5e, 0x15, 0xa2, 0x22, 0x80, 0xd3, 0x10 }, /* 4A 4F 50 59 */ { 0xc5, 0x0f, 0x00, 0x01, 0x00, 0x4b, 0xe7, 0xd2, 0x23, 0xb1, 0x22, 0x5f, 0x61, 0x7f, 0x23, 0x90, /* 5A 5F 60 64 */ 0xcd, 0x35, 0x83, 0x16, 0x4F, 0x76, 0x8d, 0xa9, 0xff, 0x4f, 0x04 }, /* RBG 65,66,67,27,2b,2c */ { 0x6A, 0x62, 0x65, 0x90, 0x99, 0 }, /* Y-Cb-Cr 65,66,67 */ { 0x58, 0x48, 0x49 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x2A098ACB, 0, }, { "720x576Over", 720, 576, TVTYPE_PAL, 0, 0, /* 00 0F */ { 0x03, 0, 0x10, 0x1F, 0x03, 0, 0, 0x39, 0x19, 0x01, 0x88, 0x00, 0x55, 0x5E, 0x00, 0x9E, 0, 0x80, 0x04, 0x08, 0x08, 0x10, 0xCB, 0x8A, 0x09, 0x2A, 0x00, 0x50, 0x41, 0x80, 0, 0x10, 0x17, 0x0C, 0x32, 0x7D, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0, 0x01, 0x10, 0x51, 0x5F, 0xCF, 0x23, 0x70, 0x22, 0x5F, 0xD0, 0x7F, 0x23, 0x92, /* 5A 5F 60 64 */ 0xCE, 0x0C, 0x8E, 0x16, 0, 0, 0x80, 0x20, 0xFF, 0x5F, 0x03 }, /* RBG 65,66,67,27,2b,2c */ { 0x6A, 0x62, 0x65, 0x90, 0x99, 0 }, /* Y-Cb-Cr 65,66,67 */ { 0x58, 0x48, 0x49 }, /* Subcarrier 19,18,17,16, DotCrawl Subcarrier (set bit 3 of reg 11 then subcarrier) */ 0x2A098ACB, 0, }, /* { "1920x1080", 1920, 540, TVTYPE_NTSC, 0, 0, { 0x83, 0, 0x10, 0x4A, 0x86, 0x39, 0, 0x8B, 0x3D, 0x32, 0, 0, 0, 0, 0, 0x9E, 0, 0x80, 0x4A, 0x08, 0x37, 0x14, 0, 0, 0, 0, 0, 0x50, 0x44, 0x80, 0, 0x03, 0x25, 0, 0, 0x7E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0xC5, 0x0F, 0, 0x01, 0, 0, 0x97, 0x7F, 0x78, 0x64, 0x14, 0x97, 0x7F, 0x59, 0x78, 0xB0, 0x1A, 0xEC, 0xFA, 0x08, 0, 0, 0x80, 0x20, 0xFF, 0x97, 0x28 }, { 0x55, 0x56, 0x55, 0x91, 0x9C, 0 }, { 0x42, 0x49, 0x48 }, 0x1E555518, 0x1E554CC3, }, { "960x540", 960, 540, TVTYPE_NTSC, 0, 0, { 0x83, 0, 0x10, 0x4A, 0x86, 0x39, 0, 0x8B, 0x3D, 0x32, 0, 0, 0, 0, 0, 0x9E, 0, 0x80, 0x4A, 0x08, 0x37, 0x14, 0, 0, 0, 0, 0, 0x50, 0x44, 0x80, 0, 0x03, 0x25, 0, 0, 0x7E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0xC5, 0x0F, 0, 0x01, 0, 0, 0x97, 0x7F, 0x78, 0x64, 0x14, 0x97, 0x7F, 0x59, 0x78, 0xB0, 0x1A, 0xEC, 0xFA, 0x08, 0, 0, 0x80, 0x20, 0xFF, 0x97, 0x28 }, { 0x55, 0x56, 0x55, 0x91, 0x9C, 0 }, { 0x42, 0x49, 0x48 }, 0x1E555518, 0x1E554CC3, }, */ { NULL, 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, 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, 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, 0, 0 }, 0, 0, } }; #endif /* _VIA_VT162X_H_ */ xf86-video-openchrome-0.6.0/src/via_vgahw.h0000664000175000017500000000343113033607755015421 00000000000000/* * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * * 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 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. */ #ifndef _VIA_VGAHW_H_ #define _VIA_VGAHW_H_ #include "vgaHW.h" CARD8 ViaVgahwIn(vgaHWPtr hwp, int address); void ViaVgahwWrite(vgaHWPtr hwp, int indexaddress, CARD8 index, int valueaddress, CARD8 value); void ViaVgahwMask(vgaHWPtr hwp, int indexaddress, CARD8 index, int valueaddress, CARD8 value, CARD8 mask); void ViaCrtcMask(vgaHWPtr hwp, CARD8 index, CARD8 value, CARD8 mask); void ViaSeqMask(vgaHWPtr hwp, CARD8 index, CARD8 value, CARD8 mask); void ViaGrMask(vgaHWPtr hwp, CARD8 index, CARD8 value, CARD8 mask); #ifdef HAVE_DEBUG void ViaVgahwPrint(vgaHWPtr hwp); #endif /* HAVE_DEBUG */ #endif /* _VIA_VGAHW_H_ */ xf86-video-openchrome-0.6.0/src/via_id.c0000664000175000017500000000434513054665201014672 00000000000000/* * Copyright 2005-2015 The Openchrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * * 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 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. */ /* * A big structure with card-ID information, plus some checking functions. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "via_driver.h" static void ViaDoubleCheckCLE266Revision(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); /* Crtc 0x4F is only defined in CLE266Cx */ CARD8 tmp = hwp->readCrtc(hwp, 0x4F); hwp->writeCrtc(hwp, 0x4F, 0x55); if (hwp->readCrtc(hwp, 0x4F) == 0x55) { if (CLE266_REV_IS_AX(pVia->ChipRev)) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "CLE266 Revision seems" " to be Cx, yet %d was detected previously.\n", pVia->ChipRev); } else { if (CLE266_REV_IS_CX(pVia->ChipRev)) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "CLE266 Revision seems" " to be Ax, yet %d was detected previously.\n", pVia->ChipRev); } hwp->writeCrtc(hwp, 0x4F, tmp); } xf86-video-openchrome-0.6.0/src/via_vt1632.h0000664000175000017500000000333113033607755015251 00000000000000/* * Copyright 2014 SHS SERVICES GmbH * Copyright 2006-2009 Luc Verhaegen. * * 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 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. */ #ifndef _VIA_VT1632_H_ #define _VIA_VT1632_H_ 1 #define VIA_VT1632_VEN 0x20 #define VIA_VT1632_HEN 0x10 #define VIA_VT1632_DSEL 0x08 #define VIA_VT1632_BSEL 0x04 #define VIA_VT1632_EDGE 0x02 #define VIA_VT1632_PDB 0x01 typedef struct _viaVT1632Rec { I2CDevPtr VT1632I2CDev; int DotclockMin; int DotclockMax; CARD8 Register08; CARD8 Register09; CARD8 Register0A; CARD8 Register0C; } viaVT1632Rec, *viaVT1632RecPtr; const xf86OutputFuncsRec via_vt1632_funcs; Bool viaVT1632Init(ScrnInfoPtr pScrn, I2CBusPtr pI2CBus); #endif /* _VIA_VT1632_H_ */ xf86-video-openchrome-0.6.0/src/via_regs.h0000664000175000017500000003301713032677013015241 00000000000000/* * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2008 S3 Graphics, 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, 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 AUTHOR(S) OR COPYRIGHT HOLDER(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. */ /************************************************************************* * * File: via_regs.c * Content: The defines of Via registers * ************************************************************************/ #ifndef _VIA_REGS_H_ #define _VIA_REGS_H_ 1 #include "via_driver.h" /*#define VIA_SERIES(chip) (chip == VIA_CLE266)*/ /* Chip tags. These are used to group the adapters into * related families. */ enum VIACHIPTAGS { VIA_UNKNOWN = 0, VIA_CLE266, VIA_KM400, VIA_K8M800, VIA_PM800, VIA_P4M800PRO, /* VT3314 */ VIA_CX700, /* VT3324 */ #ifdef VIA_VT3293_SUPPORT VIA_CN750, /* VT3293 */ #endif VIA_P4M890, /* VT3327 */ VIA_K8M890, /* VT3336 */ VIA_P4M900, /* VT3364 */ VIA_VX800, /* VT3353 */ VIA_VX855, /* VT3409*/ VIA_VX900, /* VT3410*/ VIA_LAST }; #define PCI_VIA_VENDOR_ID 0x1106 #define PCI_CHIP_CLE3122 0x3122 /* CLE266 */ #define PCI_CHIP_VT3205 0x7205 /* KM400 */ #define PCI_CHIP_VT3204 0x3108 /* K8M800 */ #define PCI_CHIP_VT3259 0x3118 /* PM800 */ #define PCI_CHIP_VT3314 0x3344 /* P4M800 Pro */ #define PCI_CHIP_VT3324 0x3157 /* CX700 */ #ifdef VIA_VT3293_SUPPORT #define PCI_CHIP_VT3293 0x3225 /* CN750 */ #endif #define PCI_CHIP_VT3327 0x3343 /* P4M890 */ #define PCI_CHIP_VT3336 0x3230 /* K8M890 */ #define PCI_CHIP_VT3364 0x3371 /* P4M900 */ #define PCI_CHIP_VT3353 0x1122 /* VX800 */ #define PCI_CHIP_VT3409 0x5122 /* VX855/VX875 */ #define PCI_CHIP_VT3410 0x7122 /* VX900 */ /* There is some conflicting information about the two major revisions of * the CLE266, often labelled Ax and Cx. The dividing line seems to be * either 0x0f or 0x10. */ #define CLE266_REV_IS_AX(x) ((x) < 0x10) #define CLE266_REV_IS_CX(x) ((x) >= 0x10) #define BIOS_BSIZE 1024 #define BIOS_BASE 0xc0000 #define VIA_MMIO_REGSIZE 0xD000 /* DisplayPort: 0xC610~0xC7D4 */ #define VIA_MMIO_REGBASE 0x0 #define VIA_MMIO_VGABASE 0x8000 #define VIA_MMIO_BLTBASE 0x200000 #define VIA_MMIO_BLTSIZE 0x200000 #define VIA_MMIO_INTEGRATED_TV_BASE 0xC000 #define VIA_MMIO_INTEGRATED_TV_SIZE 256 /* defines for VIA 2D registers */ #define VIA_REG_GECMD 0x000 #define VIA_REG_GEMODE 0x004 #define VIA_REG_GESTATUS 0x004 /* as same as VIA_REG_GEMODE */ #define VIA_REG_SRCPOS 0x008 #define VIA_REG_DSTPOS 0x00C #define VIA_REG_LINE_K1K2 0x008 #define VIA_REG_LINE_XY 0x00C #define VIA_REG_DIMENSION 0x010 /* width and height */ #define VIA_REG_PATADDR 0x014 #define VIA_REG_FGCOLOR 0x018 #define VIA_REG_DSTCOLORKEY 0x018 /* as same as VIA_REG_FG */ #define VIA_REG_BGCOLOR 0x01C #define VIA_REG_SRCCOLORKEY 0x01C /* as same as VIA_REG_BG */ #define VIA_REG_CLIPTL 0x020 /* top and left of clipping */ #define VIA_REG_CLIPBR 0x024 /* bottom and right of clipping */ #define VIA_REG_OFFSET 0x028 #define VIA_REG_LINE_ERROR 0x028 #define VIA_REG_KEYCONTROL 0x02C /* color key control */ #define VIA_REG_SRCBASE 0x030 #define VIA_REG_DSTBASE 0x034 #define VIA_REG_PITCH 0x038 /* pitch of src and dst */ #define VIA_REG_MONOPAT0 0x03C #define VIA_REG_MONOPAT1 0x040 #define VIA_REG_ROT_TMP_ADDR 0x044 /* Rotation Temporary Base Address */ #define VIA_REG_ROTSRC 0x048 /* Resolution X,Y of Rotation Source */ #define VIA_REG_ROT_TMP_PITCH 0x04C /* Pitch of Rotation Temporary Memory */ #define VIA_REG_ROTDST 0x050 /* Resolution X,Y of Rotation Destination*/ #define VIA_REG_COLORPAT 0x100 /* from 0x100 to 0x1ff */ /* defines for VIA 2D registers for vt3353 (M1 engine)*/ #define VIA_REG_GECMD_M1 0x000 #define VIA_REG_GEMODE_M1 0x004 #define VIA_REG_GESTATUS_M1 0x004 /* as same as VIA_REG_GEMODE + rotate 410*/ #define VIA_REG_PITCH_M1 0x008 /* pitch of src and dst */ #define VIA_REG_DIMENSION_M1 0x00C /* width and height */ #define VIA_REG_DSTPOS_M1 0x010 #define VIA_REG_LINE_XY_M1 0x010 #define VIA_REG_DSTBASE_M1 0x014 #define VIA_REG_SRCPOS_M1 0x018 #define VIA_REG_LINE_K1K2_M1 0x018 #define VIA_REG_SRCBASE_M1 0x01C #define VIA_REG_PATADDR_M1 0x020 #define VIA_REG_MONOPAT0_M1 0x024 #define VIA_REG_MONOPAT1_M1 0x028 #define VIA_REG_OFFSET_M1 0x02C #define VIA_REG_LINE_ERROR_M1 0x02C #define VIA_REG_CLIPTL_M1 0x040 /* top and left of clipping */ #define VIA_REG_CLIPBR_M1 0x044 /* bottom and right of clipping */ #define VIA_REG_KEYCONTROL_M1 0x048 /* color key control */ #define VIA_REG_FGCOLOR_M1 0x04C #define VIA_REG_DSTCOLORKEY_M1 0x04C /* as same as VIA_REG_FG */ #define VIA_REG_BGCOLOR_M1 0x050 #define VIA_REG_SRCCOLORKEY_M1 0x050 /* as same as VIA_REG_BG */ #define VIA_REG_MONOPATFGC_M1 0x058 /* VT3353 Add Backgroung color of Pattern. */ #define VIA_REG_MONOPATBGC_M1 0x05C /* VT3353 Add Foregroung color of Pattern. */ #define VIA_REG_COLORPAT_M1 0x100 /* from 0x100 to 0x1ff */ /*410*/ #define VIA_REG_CFC 0x030 #define VIA_REG_SCALEFACTOR 0x034 #define VIA_REG_SCALINGMODE 0x038 #define VIA_REG_23DIDCLT 0x060 #define VIA_REG_23DWAITCLT 0x06C /* defines for VIA video registers */ #define VIA_REG_INTERRUPT 0x200 #define VIA_REG_CRTCSTART 0x214 /* defines for VIA HW cursor registers */ #define VIA_REG_CURSOR_MODE 0x2D0 #define VIA_REG_CURSOR_POS 0x2D4 #define VIA_REG_CURSOR_ORG 0x2D8 #define VIA_REG_CURSOR_BG 0x2DC #define VIA_REG_CURSOR_FG 0x2E0 /* defines for VIA 3D registers */ #define VIA_REG_STATUS 0x400 #define VIA_REG_TRANSET 0x43C #define VIA_REG_TRANSPACE 0x440 /* VIA_REG_STATUS(0x400): Engine Status */ #define VIA_CMD_RGTR_BUSY 0x00000080 /* Command Regulator is busy */ #define VIA_2D_ENG_BUSY 0x00000002 /* 2D Engine is busy */ #define VIA_3D_ENG_BUSY 0x00000001 /* 3D Engine is busy */ #define VIA_VR_QUEUE_EMPTY 0x00020000 /* Virtual Queue is empty */ /* VIA_REG_STATUS(0x400): Engine Status for H5 */ #define VIA_CMD_RGTR_BUSY_H5 0x00000010 /* Command Regulator is busy */ #define VIA_2D_ENG_BUSY_H5 0x00000002 /* 2D Engine is busy */ #define VIA_3D_ENG_BUSY_H5 0x00001FE1 /* 3D Engine is busy */ #define VIA_VR_QUEUE_BUSY_H5 0x00000004 /* Virtual Queue is busy */ /* VIA_REG_STATUS(0x400): Engine Status for VT3353 */ #define VIA_CMD_RGTR_BUSY_M1 0x00000010 /* Command Regulator is busy */ #define VIA_2D_ENG_BUSY_M1 0x00000002 /* 2D Engine is busy */ #define VIA_3D_ENG_BUSY_M1 0x00001FE1 /* 3D Engine is busy */ #define VIA_VR_QUEUE_BUSY_M1 0x00000004 /* Virtual Queue is busy */ /* VIA_REG_GECMD(0x00): 2D Engine Command */ #define VIA_GEC_NOOP 0x00000000 #define VIA_GEC_BLT 0x00000001 #define VIA_GEC_LINE 0x00000005 /*410 GECMD*/ #define VIA_GEC_ALPHA 0x00000003 #define VIA_GEC_BLT_ROT 0x00000009 #define VIA_GEC_MONOTEX 0x00000002 #define VIA_GEC_ALPHA_ROT_MONOTEX 0x0000000a #define VIA_GEC_ROT 0x00000008 /* Rotate Command */ #define VIA_GEC_SRC_XY 0x00000000 #define VIA_GEC_SRC_LINEAR 0x00000010 #define VIA_GEC_DST_XY 0x00000000 #define VIA_GEC_DST_LINRAT 0x00000020 #define VIA_GEC_SRC_FB 0x00000000 #define VIA_GEC_SRC_SYS 0x00000040 #define VIA_GEC_DST_FB 0x00000000 #define VIA_GEC_DST_SYS 0x00000080 #define VIA_GEC_SRC_MONO 0x00000100 /* source is mono */ #define VIA_GEC_PAT_MONO 0x00000200 /* pattern is mono */ #define VIA_GEC_MSRC_OPAQUE 0x00000000 /* mono src is opaque */ #define VIA_GEC_MSRC_TRANS 0x00000400 /* mono src is transparent */ #define VIA_GEC_PAT_FB 0x00000000 /* pattern is in frame buffer */ #define VIA_GEC_PAT_REG 0x00000800 /* pattern is from reg setting */ #define VIA_GEC_CLIP_DISABLE 0x00000000 #define VIA_GEC_CLIP_ENABLE 0x00001000 #define VIA_GEC_FIXCOLOR_PAT 0x00002000 #define VIA_GEC_INCX 0x00000000 #define VIA_GEC_DECY 0x00004000 #define VIA_GEC_INCY 0x00000000 #define VIA_GEC_DECX 0x00008000 #define VIA_GEC_MPAT_OPAQUE 0x00000000 /* mono pattern is opaque */ #define VIA_GEC_MPAT_TRANS 0x00010000 /* mono pattern is transparent */ #define VIA_GEC_MONO_UNPACK 0x00000000 #define VIA_GEC_MONO_PACK 0x00020000 #define VIA_GEC_MONO_DWORD 0x00000000 #define VIA_GEC_MONO_WORD 0x00040000 #define VIA_GEC_MONO_BYTE 0x00080000 #define VIA_GEC_LASTPIXEL_ON 0x00000000 #define VIA_GEC_LASTPIXEL_OFF 0x00100000 #define VIA_GEC_X_MAJOR 0x00000000 #define VIA_GEC_Y_MAJOR 0x00200000 #define VIA_GEC_QUICK_START 0x00800000 /* VIA_REG_GEMODE(0x04): GE mode */ #define VIA_GEM_8bpp 0x00000000 #define VIA_GEM_16bpp 0x00000100 #define VIA_GEM_32bpp 0x00000300 /*410 GEM*/ #define VIA_GEM_ALPHA 0x00100000 #define VIA_GEM_degree90 0x00000001 #define VIA_GEM_degree180 0x00000002 #define VIA_GEM_degree270 0x00000303 #define VIA_GEM_ALPHA_CNT_EN 0x00100000 #define VIA_GEM_SETALPHA8(cnst) (cnst>>24)<<12 /*410 SCALE*/ #define VIA_SCALEF_VFactor8(cnst) cnst<<20 #define VIA_SCALEF_HFactor8(cnst) cnst<<4 #define VIA_SCALEM_En 0x80000000 #define VIA_SCALEM_Shrink 0x40000000 #define VIA_SCALEM_BW 0x00000000 #define VIA_SCALEM_WB 0x10000000 #define VIA_SCALEM_CC 0x20000000 #define VIA_SCALEM_Half 0x30000000 #define VIA_SCALEM_SrcDimenH12(cnst) (cnst-1)<<16 #define VIA_SCALEM_SrcDimenW12(cnst) (cnst-1)<<0 /*410 CFC new 2D pipline must set ??*/ #define VIA_CFC_en 0x80000000 #define VIA_CFC_EXT_en 0x40000000 #define VIA_CFC_DITH_en 0x20000000 #define VIA_CFC_DesCF16_555 0x00000000 #define VIA_CFC_DesCF16_565 0x00000100 #define VIA_CFC_DesCF32_888 0x00000000 #define VIA_CFC_DesCF32_000 0x00000100 #define VIA_CFC_SrcDep8 0x00000000 #define VIA_CFC_SrcDep16 0x00000050 #define VIA_CFC_SrcDep32 0x000000c0 #define VIA_CFC_SrcCF16_555 0x00000000 #define VIA_CFC_SrcCF16_565 0x00000001 #define VIA_CFC_SrcCF32_888 0x00000000 #define VIA_CFC_SrcCF32_000 0x00000001 #define VIA_GEM_640 0x00000000 /* 640*480 */ #define VIA_GEM_800 0x00000400 /* 800*600 */ #define VIA_GEM_1024 0x00000800 /* 1024*768 */ #define VIA_GEM_1280 0x00000C00 /* 1280*1024 */ #define VIA_GEM_1600 0x00001000 /* 1600*1200 */ #define VIA_GEM_2048 0x00001400 /* 2048*1536 */ #define VIA_GEM_ROTATE_90 0x00000001 /* Rotate anticlockwise 90 degree */ #define VIA_GEM_ROTATE_180 0x00000002 /* Rotate anticlockwise 180 degree */ #define VIA_GEM_ROTATE_270 0x00000003 /* Rotate anticlockwise 270 degree */ /* VIA_REG_PITCH(0x38): Pitch Setting */ #define VIA_PITCH_ENABLE 0x80000000 #define MAXLOOP 0xffffff #define VerticalRetraceWait() \ { \ VGAOUT8(vgaCRIndex, 0x17); \ if (VGAIN8(vgaCRReg) & 0x80) { \ while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x00) ; \ while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x08) ; \ while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x00) ; \ } \ } #define VIASETREG(addr, data) *(volatile unsigned int *)(pVia->MapBase + (addr)) = (data) #define VIAGETREG(addr) *(volatile unsigned int *)(pVia->MapBase + (addr)) #endif /* _VIA_REGS_H_ */ xf86-video-openchrome-0.6.0/src/via_ums.h0000664000175000017500000002451213054665201015105 00000000000000/* * Copyright 2016 Kevin Brace * Copyright 2005-2016 The OpenChrome Project * [https://www.freedesktop.org/wiki/Openchrome] * Copyright 2004-2005 The Unichrome Project [unichrome.sf.net] * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, 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, 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 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. */ #ifndef _VIA_BIOS_H_ #define _VIA_BIOS_H_ 1 #include "via_vgahw.h" #define VIA_PANEL6X4 0 #define VIA_PANEL8X6 1 #define VIA_PANEL10X7 2 #define VIA_PANEL12X7 3 #define VIA_PANEL12X10 4 #define VIA_PANEL14X10 5 #define VIA_PANEL16X12 6 #define VIA_PANEL12X8 7 #define VIA_PANEL8X4 8 #define VIA_PANEL1366X7 9 #define VIA_PANEL1360X7 10 #define VIA_PANEL1920x1080 11 #define VIA_PANEL1920x1200 12 #define VIA_PANEL10X6 13 #define VIA_PANEL14X9 14 #define VIA_PANEL1280X720 15 #define VIA_PANEL12X9 16 #define VIA_PANEL_INVALID 255 #define TVTYPE_NONE 0x00 #define TVTYPE_NTSC 0x01 #define TVTYPE_PAL 0x02 #define TVTYPE_480P 0X03 #define TVTYPE_576P 0X04 #define TVTYPE_720P 0X05 #define TVTYPE_1080I 0X06 #define TVOUTPUT_NONE 0x00 #define TVOUTPUT_COMPOSITE 0x01 #define TVOUTPUT_SVIDEO 0x02 #define TVOUTPUT_RGB 0x04 #define TVOUTPUT_YCBCR 0x08 #define TVOUTPUT_SC 0x16 #define VIA_NONETV 0 #define VIA_VT1621 1 /* TV2PLUS */ #define VIA_VT1622 2 /* TV3 */ #define VIA_VT1623 3 /* also VT1622A */ #define VIA_VT1625 4 #define VIA_CH7011 5 #define VIA_CH7019A 6 #define VIA_CH7019B 7 #define VIA_CH7017 8 #define VIA_CH7304 9 #define VIA_CH7305 10 #define VIA_TVNORMAL 0 #define VIA_TVOVER 1 #define VIA_DEVICE_NONE 0x00 #define VIA_DEVICE_CRT 0x01 #define VIA_DEVICE_LCD 0x02 #define VIA_DEVICE_TV 0x04 #define VIA_DEVICE_DFP 0x08 #define VIA_I2C_NONE 0x00 #define VIA_I2C_BUS1 0x01 #define VIA_I2C_BUS2 0x02 #define VIA_I2C_BUS3 0x04 /* System Memory CLK */ #define VIA_MEM_SDR66 0x00 #define VIA_MEM_SDR100 0x01 #define VIA_MEM_SDR133 0x02 #define VIA_MEM_DDR200 0x03 #define VIA_MEM_DDR266 0x04 #define VIA_MEM_DDR333 0x05 #define VIA_MEM_DDR400 0x06 #define VIA_MEM_DDR533 0x07 #define VIA_MEM_DDR667 0x08 #define VIA_MEM_DDR800 0x09 #define VIA_MEM_DDR1066 0x0A #define VIA_MEM_END 0x0B #define VIA_MEM_NONE 0xFF /* Digital Output Bus Width */ #define VIA_DI_12BIT 0x00 #define VIA_DI_24BIT 0x01 /* Digital Port */ #define VIA_DI_PORT_NONE 0x0 #define VIA_DI_PORT_DVP0 0x1 #define VIA_DI_PORT_DVP1 0x2 #define VIA_DI_PORT_DFPLOW 0x4 #define VIA_DI_PORT_LVDS1 0x4 #define VIA_DI_PORT_TMDS 0x4 #define VIA_DI_PORT_DFPHIGH 0x8 #define VIA_DI_PORT_LVDS2 0x8 /* External TMDS (DVI) Transmitter Type */ #define VIA_TMDS_NONE 0x0 #define VIA_TMDS_VT1632 0x1 typedef struct ViaPanelMode { int Width; int Height; Bool useDualEdge; Bool useDithering; } ViaPanelModeRec, *ViaPanelModePtr ; typedef struct ViaPanelInfo { Bool IsActive ; /* Native physical resolution */ int NativeHeight; int NativeWidth; Bool useDualEdge; Bool useDithering; /* Native resolution index, see via_panel.c */ CARD8 NativeModeIndex; /* Determine if we must use the hardware scaler * It might be false even if the "Center" option * was specified */ Bool Scale; /* Panel/LCD entries */ CARD16 ResolutionIndex; int PanelIndex; Bool Center; Bool SetDVI; /* LCD Simultaneous Expand Mode HWCursor Y Scale */ Bool scaleY; int resY; } ViaPanelInfoRec, *ViaPanelInfoPtr ; typedef struct _VIABIOSINFO { xf86OutputPtr analog; xf86OutputPtr tv; CARD32 Clock; /* register value for the dotclock */ Bool ClockExternal; CARD32 Bandwidth; /* available memory bandwidth */ /* TV entries */ int TVEncoder; int TVOutput; I2CDevPtr TVI2CDev; int TVType; Bool TVDotCrawl; int TVDeflicker; CARD8 TVRegs[0xFF]; int TVNumRegs; /* TV Callbacks */ void (*TVSave) (ScrnInfoPtr pScrn); void (*TVRestore) (ScrnInfoPtr pScrn); Bool (*TVDACSense) (ScrnInfoPtr pScrn); ModeStatus (*TVModeValid) (ScrnInfoPtr pScrn, DisplayModePtr mode); void (*TVModeI2C) (ScrnInfoPtr pScrn, DisplayModePtr mode); void (*TVModeCrtc) (xf86CrtcPtr crtc, DisplayModePtr mode); void (*TVPower) (ScrnInfoPtr pScrn, Bool On); void (*LCDPower) (ScrnInfoPtr pScrn, Bool On); DisplayModePtr TVModes; int TVNumModes; void (*TVPrintRegs) (ScrnInfoPtr pScrn); } VIABIOSInfoRec, *VIABIOSInfoPtr; typedef struct _VIATMDSRec { I2CBusPtr pVIATMDSI2CBus; } VIATMDSRec, *VIATMDSRecPtr; typedef struct { CARD16 X; CARD16 Y; CARD16 Bpp; CARD8 bRamClock; CARD8 bTuningValue; } ViaExpireNumberTable; /* via_ums.c */ void viaUnmapMMIO(ScrnInfoPtr pScrn); void viaDisableVQ(ScrnInfoPtr pScrn); Bool umsAccelInit(ScreenPtr pScreen); Bool umsCreate(ScrnInfoPtr pScrn); Bool umsPreInit(ScrnInfoPtr pScrn); Bool umsCrtcInit(ScrnInfoPtr pScrn); /* via_output.c */ void viaDIP0SetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource); void viaDIP0EnableIOPads(ScrnInfoPtr pScrn, CARD8 ioPadState); void viaDIP0SetClockDriveStrength(ScrnInfoPtr pScrn, CARD8 clockDriveStrength); void viaDIP0SetDataDriveStrength(ScrnInfoPtr pScrn, CARD8 dataDriveStrength); void viaDVP0SetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource); void viaDVP0EnableIOPads(ScrnInfoPtr pScrn, CARD8 ioPadState); void viaDVP0SetClockDriveStrength(ScrnInfoPtr pScrn, CARD8 clockDriveStrength); void viaDVP0SetDataDriveStrength(ScrnInfoPtr pScrn, CARD8 dataDriveStrength); void viaDVP1SetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource); void viaDVP1EnableIOPads(ScrnInfoPtr pScrn, CARD8 ioPadState); void viaDVP1SetClockDriveStrength(ScrnInfoPtr pScrn, CARD8 clockDriveStrength); void viaDVP1SetDataDriveStrength(ScrnInfoPtr pScrn, CARD8 dataDriveStrength); void viaDFPLowSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource); void viaDFPLowEnableIOPads(ScrnInfoPtr pScrn, CARD8 ioPadState); void viaOutputDetect(ScrnInfoPtr pScrn); CARD32 ViaGetMemoryBandwidth(ScrnInfoPtr pScrn); CARD32 ViaModeDotClockTranslate(ScrnInfoPtr pScrn, DisplayModePtr mode); void viaProbePinStrapping(ScrnInfoPtr pScrn); void ViaSetPrimaryDotclock(ScrnInfoPtr pScrn, CARD32 clock); void ViaSetSecondaryDotclock(ScrnInfoPtr pScrn, CARD32 clock); void ViaSetUseExternalClock(vgaHWPtr hwp); /* via_display.c */ void viaIGA2DisplayChannel(ScrnInfoPtr pScrn, Bool channelState); void viaDisplayInit(ScrnInfoPtr pScrn); void ViaGammaDisable(ScrnInfoPtr pScrn); void viaIGAInitCommon(ScrnInfoPtr pScrn); void viaIGA1Init(ScrnInfoPtr pScrn); void viaIGA1SetFBStartingAddress(xf86CrtcPtr crtc, int x, int y); void viaIGA1SetDisplayRegister(ScrnInfoPtr pScrn, DisplayModePtr mode); void viaIGA1Save(ScrnInfoPtr pScrn); void viaIGA1Restore(ScrnInfoPtr pScrn); void viaIGA2Init(ScrnInfoPtr pScrn); void viaIGA2SetFBStartingAddress(xf86CrtcPtr crtc, int x, int y); void viaIGA2SetDisplayRegister(ScrnInfoPtr pScrn, DisplayModePtr mode); void viaIGA2Save(ScrnInfoPtr pScrn); void viaIGA2Restore(ScrnInfoPtr pScrn); void ViaShadowCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode); /* via_analog.c */ void via_analog_init(ScrnInfoPtr pScrn); /* via_lvds.c */ void viaLVDS1SetIOPadSetting(ScrnInfoPtr pScrn, CARD8 ioPadState); void via_lvds_init(ScrnInfoPtr pScrn); /* via_tmds.c */ void viaExtTMDSSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource); void viaExtTMDSEnableIOPads(ScrnInfoPtr pScrn, CARD8 ioPadState); void viaExtTMDSSetClockDriveStrength(ScrnInfoPtr pScrn, CARD8 clockDriveStrength); void viaExtTMDSSetDataDriveStrength(ScrnInfoPtr pScrn, CARD8 dataDriveStrength); void via_dvi_init(ScrnInfoPtr pScrn); /*via_tv.c */ #ifdef HAVE_DEBUG void ViaTVPrintRegs(ScrnInfoPtr pScrn); #endif Bool via_tv_init(ScrnInfoPtr pScrn); /* via_vt162x.c */ I2CDevPtr ViaVT162xDetect(ScrnInfoPtr pScrn, I2CBusPtr pBus, CARD8 Address); void ViaVT162xInit(ScrnInfoPtr pScrn); /* via_ch7xxx.c */ I2CDevPtr ViaCH7xxxDetect(ScrnInfoPtr pScrn, I2CBusPtr pBus, CARD8 Address); void ViaCH7xxxInit(ScrnInfoPtr pScrn); #endif /* _VIA_BIOS_H_ */ xf86-video-openchrome-0.6.0/acinclude.m40000664000175000017500000000726612656266431014713 00000000000000dnl 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],[ 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 ]) 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 # -------------------- # Adds --with/without-release-string and changes the PACKAGE and # PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If # no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. AC_DEFUN([XORG_RELEASE_VERSION],[ AC_ARG_WITH(release-version, AC_HELP_STRING([--with-release-version=STRING], [Use release version string in package name]), [RELEASE_VERSION="$withval"], [RELEASE_VERSION=""]) if test "x$RELEASE_VERSION" != "x"; then PACKAGE="$PACKAGE-$RELEASE_VERSION" PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" AC_MSG_NOTICE([Building with package name set to $PACKAGE]) fi ]) xf86-video-openchrome-0.6.0/depcomp0000755000175000017500000004755613057513446014100 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-openchrome-0.6.0/aclocal.m40000664000175000017500000146524513057513373014364 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 # 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="/lib /usr/lib $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' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_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* | netbsdelf*-gnu) 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* | netbsdelf*-gnu) ;; *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 ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _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 ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=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* | netbsdelf*-gnu) 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 _LT_TAGVAR(link_all_deplibs, $1)=no 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* | netbsdelf*-gnu) 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|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) 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` test "x$?" != "x0" && pkg_failed=yes ], [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 --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$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])[]dnl ]) 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 .])[]dnl ]) 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 # 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) 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 m4_include([acinclude.m4]) xf86-video-openchrome-0.6.0/config.guess0000755000175000017500000012743213057513402015023 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-02-10' # 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, 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 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 ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu 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 ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx 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-openchrome-0.6.0/README0000664000175000017500000001663213057472674013403 00000000000000OpenChrome DDX Version 0.6 Release Note (March 7th, 2017) --------------------------------------------------------- OpenChrome DDX is an open source implementation of X.Org Server DDX (Device Dependent X) graphics device driver for VIA Technologies UniChrome and Chrome9 IGPs. (Integrated Graphics Processor) OpenChrome DDX handles only 2D and video acceleration. Please note that OpenChrome does not support VIA Technologies IGPs that are related to Trident Microsystems (i.e., Apollo MVP4, PLE133, and KLE133) or S3 Graphics (i.e., KM266). Here is the project home page for OpenChrome. http://www.freedesktop.org/wiki/Openchrome/ Please note that VIA Technologies does not support OpenChrome in any way. Supported Chipsets ------------------ - CLE266 - KM400(A) / KN400(A) / P4M800 - K8M800 / K8N800 - PM800 / PN800 / PM880 / CN333 / CN400 - P4M800 Pro / VN800 / CN700 - CX700 / VX700 - P4M890 / VN890 / CN800 - K8M890 / K8N890 - P4M900 / VN896 / CN896 - VX800 / VX820 - VX855 / VX875 - VX900 Supported Features ------------------ - VGA - DVI from an integrated TMDS transmitter (CX700, VX700, and VX800 chipsets) - DVI from Silicon Image SiI 164 and VIA Technologies VT1632(A) TMDS transmitters - Flat Panel - EXA acceleration (RENDER acceleration) - Xv and XvMC - Dual monitor support Unproven Features ----------------- - Standby resume - TV out - KMS support (Kernel Mode Setting; requires the use of still in development KMS supporting OpenChrome DRM. See "Where to Obtain OpenChrome Source Code" section for more details.) Unimplemented Features ---------------------- - Hardware cursor support for CLE266, KM400(A) / KN400(A), and P4M800 chipsets - DVI via Chrontel TMDS transmitter - LVDS via VT1631 / VT1636 LVDS transmitter - External HDMI transmitter (i.e., Jetway J7F5M-VHE-LF motherboard, VIA Embedded EPIA-P720 motherboard, etc.) - HDMI support for VX900 chipset (HDMI is supported via still in development KMS supporting OpenChrome DRM. See "Where to Obtain OpenChrome Source Code" section for more details.) - DisplayPort support for VX900 chipset OS Support ---------- - X.Org Server Version 1.7 or later (It might not work correctly if it is compiled against an older X.Org Server.) - Linux Version 2.6.32 or later (Note: For Linux Version 4.5 or later, you may have to blacklist vesafb. This is a bug that has not been fixed so far.) What's New for OpenChrome DDX Version 0.6 ----------------------------------------- OpenChrome DDX Version 0.6 is an improved version of OpenChrome DDX Version 0.5 with a number of improvements made to the code. OpenChrome DDX Version 0.6 is written in a way to completely replace Version 0.2.904 through 0.5. OpenChrome DDX Version 0.6 has added the following new features. - First official support for CX700, VX700, and VX800 chipsets integrated TMDS transmitter (i.e., DVI support) - Initial support for Silicon Image SiI 164 TMDS transmitter OpenChrome DDX Version 0.6 has the following improvements. - Improved FP reinitialization when resuming from standby (HP 2133 Mini-Note, FIC CE260 / CE261 based netbooks like Everex CloudBook and Sylvania g netbook) - Improved automatic detection of display resources - Improved X Server stability in dual monitor mode - Automatic active steering of the display controller channel to the correct display output device OpenChrome DDX Version 0.6 fixes the following bugs. - Fix for the disruption of the VT (Virtual Terminal) screen bug introduced in Version 0.5 - Fix for HP 2133 Mini-Note's PCIe WLAN getting turned off inadvertently bug introduced in Version 0.5 How to Contact OpenChrome Developers ------------------------------------ Please visit these OpenChrome mailing lists. http://lists.freedesktop.org/mailman/listinfo/openchrome-users http://lists.freedesktop.org/mailman/listinfo/openchrome-devel openchrome-users mailing list is meant for non-technical users asking questions about how to use OpenChrome, etc. openchrome-devel mailing list is for discussing OpenChrome development issues. Support for Older Versions -------------------------- The OpenChrome Project practices rolling release update policy for OpenChrome DDX. What this means is that the older version of OpenChrome DDX will not be supported once a new version is out. It is sometimes useful to try out the older version, in order to see if a regression has occurred, but generally speaking, there will be no fixes for the older versions. OpenChrome DDX is written so that it can be compiled against X.Org Server Version 1.7 or later and Linux Version 2.6.32 or later. We will likely maintain this minimum platform requirement for the foreseeable future. What this means is that if the user wanted to try the latest OpenChrome DDX, it can do so with an OS that was released around Year 2010. OpenChrome DDX might still compile for anything older than that, but it might not be stable enough to be useful. Where to File a Bug Report -------------------------- In order to file a bug report, please visit http://bugs.freedesktop.org. When you file the bug, file it against "xorg." When specifying the component, please select "Driver/openchrome." This allows a message to be sent to openchrome-devel mailing list, so that developers can be notified of the bug. It is highly recommended to file the bug report over at http://bugs.freedesktop.org rather than sending a message to openchrome-devel mailing list. Also, filing a bug report against the Linux / BSD distribution you are using (i.e., Debian, Ubuntu, Fedora, etc.) will likely be a waste of your time since the developers for those distributions do not directly work on developing OpenChrome. Where to Submit a Patch ----------------------- In order to submit a patch to improve OpenChrome, please visit http://bugs.freedesktop.org. Open a bug report and upload the patch there. When you file the bug, file it against "xorg." When specifying the component, please select "Driver/openchrome." This allows a message to be sent to openchrome-devel mailing list, so that developers can be notified of the bug. Where to Obtain OpenChrome Source Code -------------------------------------- OpenChrome source code repository is located at. http://cgit.freedesktop.org/openchrome/xf86-video-openchrome/ OpenChrome DRM (Direct Rendering Manager) module source code repository is located at. https://cgit.freedesktop.org/openchrome/drm-openchrome/ https://cgit.freedesktop.org/openchrome/drm-openchrome/tree/drivers/gpu/drm/via If You See a Bug ---------------- If you see a bug, please don't be surprised. OpenChrome has been in development for more than 10 years. In that process, there were many different developers that wrote the code in varying ways. OpenChrome is a unified graphics device driver that supports 12 generations of VIA Technologies IGP starting from CLE266 chipset all the way to VX900 chipset. Even the VIA Technologies in house unified graphics device driver does not support the number of devices OpenChrome does. Furthermore, VIA Technologies IGPs tend to rely heavily on many different external encoders and transmitters to display the image. As a result, it is very difficult to get the code right for every possible configuration you can think of. Starting with OpenChrome Version 0.4, the project is under new management, and moving forward, the emphasis will be on device driver reliability and code maintainability. (End of document.) xf86-video-openchrome-0.6.0/config.h.in0000664000175000017500000000563413057513444014535 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ #include "xorg-server.h" /* Use Damage extension */ #undef DAMAGE /* Enable debug support */ #undef HAVE_DEBUG /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* DRI is available */ #undef HAVE_DRI /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* libudev support */ #undef HAVE_LIBUDEV /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* libpciacces available */ #undef HAVE_PCIACCESS /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_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_IOCTL_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_TIME_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_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_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 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Enable build of registers dumper tool */ #undef TOOLS /* Version number of package */ #undef VERSION /* Major version */ #undef VIA_MAJOR_VERSION /* Minor version */ #undef VIA_MINOR_VERSION /* Patch version */ #undef VIA_PATCHLEVEL /* Enable DRI driver support */ #undef XF86DRI /* Enable XVideo debug support */ #undef XV_DEBUG /* Compatibility define for older Xen */ #undef X_HAVE_XAAGETROP /* Compatibility define for older Xen */ #undef X_NEED_I2CSTART /* Compatibility define for older Xen */ #undef X_USE_LINEARFB /* Compatibility define for older Xen */ #undef X_USE_REGION_NULL /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES xf86-video-openchrome-0.6.0/configure.ac0000664000175000017500000001404013057472674015000 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.57) AC_INIT([xf86-video-openchrome], [0.6.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome], [xf86-video-openchrome]) AC_DEFINE_UNQUOTED([VIA_MAJOR_VERSION], [$(echo $PACKAGE_VERSION | sed -e 's/^\([[0-9]]*\)\.[[0-9]]*\.[[0-9]]*/\1/')], [Major version]) AC_DEFINE_UNQUOTED([VIA_MINOR_VERSION], [$(echo $PACKAGE_VERSION | sed -e 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*/\1/')], [Minor version]) AC_DEFINE_UNQUOTED([VIA_PATCHLEVEL], [$(echo $PACKAGE_VERSION | sed -e 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)/\1/')], [Patch version]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR(.) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE # Initialize libtool AC_DISABLE_STATIC AC_PROG_LIBTOOL AC_SYS_LARGEFILE AH_TOP([#include "xorg-server.h"]) AC_ARG_WITH(xorg-module-dir, AC_HELP_STRING([--with-xorg-module-dir=DIR], [Default xorg module directory [[default=$libdir/xorg/modules]]]), [moduledir="$withval"], [moduledir="$libdir/xorg/modules"]) AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging support [[default=no]]]), [DEBUG="$enableval"], [DEBUG=no]) AC_ARG_ENABLE(xv-debug, AC_HELP_STRING([--enable-xv-debug], [Enable XVideo debugging support [[default=no]]]), [XV_DEBUG="$enableval"], [XV_DEBUG=no]) AC_ARG_ENABLE(viaregtool, AC_HELP_STRING([--enable-viaregtool], [Enable build of registers dumper tool [[default=no]]]), [TOOLS="$enableval"], [TOOLS=no]) # Checks for extensions XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(RENDER, renderproto) XORG_DRIVER_CHECK_EXT(XV, videoproto) XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11) XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) # Checks for pkg-config packages PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto glproto $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" ]) # Checks for libraries. # Checks for header files. AC_HEADER_STDC save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$XORG_CFLAGS $CPPFLAGS" AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include "xorg-server.h"]) PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.11.0], HAVE_PCIACCESS="yes"; AC_DEFINE(HAVE_PCIACCESS, 1, [libpciacces available]), HAVE_PCIACCESS="no") AC_SUBST([PCIACCESS_CFLAGS]) AC_SUBST([PCIACCESS_LIBS]) PKG_CHECK_MODULES(DRI, [libdrm >= 2.4.4 xf86driproto], DRI="yes"; AC_DEFINE(HAVE_DRI, 1, [DRI is available]), DRI="no") AC_MSG_CHECKING([whether to build KMS support]) AC_MSG_RESULT([$DRI]) AM_CONDITIONAL(DRI, test x$DRI = xyes) if test "$DRI" = yes; then AC_DEFINE(XF86DRI,1,[Enable DRI driver support]) AC_CHECK_HEADER([damage.h], [have_damage_h="yes"], [have_damage_h="no"],[-]) if test "$have_damage_h" = yes; then AC_DEFINE(DAMAGE,1,[Use Damage extension]) fi PKG_CHECK_MODULES(LIBUDEV, [libudev], [LIBUDEV=yes], [LIBUDEV=no]) if test "x$LIBUDEV" = xyes; then AC_DEFINE(HAVE_LIBUDEV, 1,[libudev support]) fi case "$host_cpu" in i*86) XVMC=yes ;; amd64*|x86_64*) XVMC=yes ;; *) XVMC=no ;; esac else XVMC="no" fi if test "x$XVMC" = xyes; then AC_CHECK_HEADERS(pthread.h sys/ioctl.h sys/time.h time.h,,[XVMC="no"; break],) PKG_CHECK_MODULES(XVMC, [x11 xext xvmc]) fi AC_MSG_CHECKING([whether to build XvMC driver support]) AC_MSG_RESULT([$XVMC]) AM_CONDITIONAL(XVMC, test x$XVMC = xyes) AM_CONDITIONAL(DEBUG, test x$DEBUG = xyes) if test "$DEBUG" = yes; then AC_DEFINE(HAVE_DEBUG,1,[Enable debug support]) fi AM_CONDITIONAL(XV_DEBUG, test x$XV_DEBUG = xyes) if test "$XV_DEBUG" = yes; then AC_DEFINE(XV_DEBUG,1,[Enable XVideo debug support]) fi AM_CONDITIONAL(TOOLS, test x$TOOLS = xyes) if test "$TOOLS" = yes; then AC_DEFINE(TOOLS,1,[Enable build of registers dumper tool]) fi AC_SUBST([DRI_CFLAGS]) AC_SUBST([XORG_CFLAGS]) AC_SUBST([moduledir]) DRIVER_NAME=openchrome AC_SUBST([DRIVER_NAME]) AC_DEFINE(X_USE_LINEARFB,1,[Compatibility define for older Xen]) AC_DEFINE(X_USE_REGION_NULL,1,[Compatibility define for older Xen]) AC_DEFINE(X_HAVE_XAAGETROP,1,[Compatibility define for older Xen]) AC_DEFINE(X_NEED_I2CSTART,1,[Compatibility define for older Xen]) DRIVER_MAN_SUFFIX="4" AC_SUBST([DRIVER_MAN_SUFFIX]) XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION AC_OUTPUT([ Makefile src/xvmc/Makefile src/Makefile man/Makefile tools/Makefile ]) xf86-video-openchrome-0.6.0/ChangeLog0000664000175000017500000025704012760724526014271 000000000000002011-05-10 Bartosz Kosiorek Workaround EXA crash with new libcairo2 (#298) * src/via_accel.c: (viaExaPrepareComposite): 2011-05-08 Bartosz Kosiorek Fix cursor garbage after suspend/resume for Xserver 1.10 (#405) * src/via_video.c: (viaRestoreVideo): 2011-05-04 Bartosz Kosiorek Fix XAA displaying issues * src/via_accel.c: (viaInitXAA): 2011-01-23 Bartosz Kosiorek Enable hardware cursor for VX900 * src/via_cursor.c: (viaHWCursorInit): * src/via_mode.c: (ViaModeSet): 2010-12-16 Bartosz Kosiorek Merge vx900_branch - initial VX900 support * src/via_accel.c: (viaFlushPCI), (viaDisableVQ), (viaInitialize2DEngine), (viaAccelSync), (viaPitchHelper), (viaInitXAA): * src/via_bandwidth.c: (ViaSetPrimaryFIFO), (ViaSetSecondaryFIFO): * src/via_bios.h: * src/via_crtc.c: (ViaFirstCRTCSetMode), (ViaSecondCRTCSetMode): * src/via_cursor.c: (viaHWCursorInit), (viaCursorStore), (viaCursorRestore), (viaShowCursor), (viaHideCursor), (viaSetCursorPosition), (viaLoadCursorImage), (viaSetCursorColors): * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit), (VIALeaveVT), (VIASave), (VIARestore), (ViaMMIOEnable), (ViaMMIODisable), (VIAMapFB), (VIAWriteMode), (VIACloseScreen): * src/via_driver.h: * src/via_id.c: * src/via_id.h: * src/via_mode.c: (ViaDFPDetect), (ViaOutputsDetect), (ViaOutputsSelect), (ViaGetMemoryBandwidth), (ViaSetDotclock), (ViaModeSet): * src/via_mode.h: * src/via_panel.c: (ViaPanelScaleDisable), (ViaPanelPreInit), (ViaPanelGetSizeFromDDC): * src/via_video.c: (DecideOverlaySupport): * src/via_xvmc.c: (ViaInitXVMC): 2010-12-15 Bartosz Kosiorek Enable the new mode switch and panel support on K8M800 and VM800 chipsets * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit): * src/via_mode.c: (ViaModeSet): 2010-11-10 Bartosz Kosiorek Replace the deprecated functions xalloc/xrealloc/xfree/xcalloc with malloc/realloc/free/calloc. Refer to "/xserver/include/os.h" * src/via_accel.c: (viaSetupCBuffer), (viaTearDownCBuffer), (viaInitExa), (viaExitAccel), (viaFinishInitAccel): * src/via_dga.c: (VIASetupDGAMode): * src/via_dri.c: (VIAInitVisualConfigs), (VIADRIScreenInit), (VIADRICloseScreen): * src/via_driver.c: (VIAFreeRec), (VIAProbe), (VIAPreInit), (VIACloseScreen): * src/via_memcpy.c: (viaVidCopyInit): * src/via_swov.c: (Upd_Video): * src/via_vbe.c: (ViaVbeSetMode): * src/via_video.c: (viaExitVideo), (viaStopVideo), (viaDmaBlitImage): * src/via_xvmc.c: (cleanupViaXvMC), (ViaCleanupXVMC), (ViaXvMCCreateContext), (ViaXvMCCreateSurface), (ViaXvMCCreateSubpicture), (ViaXvMCDestroyContext), (ViaXvMCDestroySurface), (ViaXvMCDestroySubpicture), (viaXvMCInitXv): 2010-10-24 Bartosz Kosiorek Siragon ML-6200 laptop support * src/via_id.c: 2010-06-24 Jon Nettleton PM800 also uses the CME Engine. Setup the hqv_cme_regs for it. * src/via_swov.c: (VIAVidHWDiffInit): 2010-06-09 Bartosz Kosiorek Fix freeze on 64bit system for K8M800 chipset * src/via_dri.c: (VIADRIAgpInit): 2010-05-04 Jon Nettleton Re-enable the Virtual Queue for the VX800/VX855 chipsets. * src/via_accel.c: (viaDisableVQ), (viaInitialize2DEngine): 2010-05-04 Jon Nettleton Disable certain hardware clipping options for the VX855. These cause the 2d engine to become unstable when in 16-bit mode. * src/via_accel.c: (viaInitXAA): 2010-05-04 Jon Nettleton Add an undocumented option which allows certain I2C buses to be probed at startup. This allows workarounds for custom chipset makers that have used the VX855 I2C buses for other purposes. * src/via_bios.h: * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit): * src/via_driver.h: * src/via_i2c.c: 2010-05-04 Jon Nettleton Improve 2d performance on chipsets that don't have AGP/PCIe support yet. * src/via_accel.c: (viaSetupForScreenToScreenCopy), (viaSetupForSolidFill), (viaSetupForMono8x8PatternFill), (viaSetupForColor8x8PatternFill), (viaSetupForCPUToScreenColorExpandFill), (viaSubsequentScanlineCPUToScreenColorExpandFill), (viaSetupForImageWrite), (viaSubsequentImageWriteRect), (viaSetupForSolidLine), (viaSetupForDashedLine), (viaInitXAA): 2010-05-04 Jon Nettleton Put timeouts on our while statements. These codepaths should be interrupted by a hardware state change, but if something goes wrong they loop forevere. Let's try and behave a little by putting a timeout on these loops. * src/via_swov.c: (viaWaitHQVFlip), (viaWaitHQVFlipClear), (viaWaitHQVDone): * src/via_video.c: (Flip): 2010-05-04 Jon Nettleton Add XVideo support for the VX855 Chipset. To support this chipset I have added HWDiff->HQVCmeRegs that allows handling differing register values, and HWDiff->dwNewScaleCtl which allows selection of a new Video scaling engine needed for the VX800/VX855 chipsets. * src/via.h: * src/via_bandwidth.c: (ViaSetSecondaryFIFO): * src/via_driver.h: * src/via_swov.c: (SaveVideoRegister), (VIAVidHWDiffInit), (viaOverlayHQVCalcZoomWidth), (viaOverlayHQVCalcZoomHeight), (ViaSwovSurfaceCreate), (SetHQVFetch), (Upd_Video): * src/via_swov.h: 2010-04-21 Bartosz Kosiorek Replace RegionsEqual with REGION_EQUAL and use the xf86XVFillKeyHelperDrawable instead of xf86XVFillKeyHelper * src/via_video.c: (viaReputImage), (viaPutImage): 2010-03-07 Bartosz Kosiorek Fix segfaults with EXA and XV (Ticket #359) Tested on K8M890 and VN800 * src/via_video.c: (viaReputImage), (viaPutImage): 2010-02-10 Bartosz Kosiorek Fix bug with suspend and VT switch on VX800 and 64bit systems * src/via_driver.h: * src/via_video.c: (viaResetVideo), (viaSaveVideo), (viaRestoreVideo), (viaExitVideo): * src/via_video.h: 2010-01-24 Bartosz Kosiorek Fix starting address restore and save (initial 64-bit support) * src/via_crtc.c: (ViaFirstCRTCSetMode), (ViaFirstCRTCSetStartingAddress): * src/via_dri.c: (VIADRIAgpInit): * src/via_driver.c: (VIASave), (VIARestore): * src/via_driver.h: 2009-12-04 Bartosz Kosiorek Enable new mode switch for VM800 chipsets * src/via_driver.c: (VIASetupDefaultOptions): 2009-11-21 Bartosz Kosiorek Add option to enable unaccelerated RandR rotation ("SWRandR"). The accelerated option "HWRandR" is currently not implemented. * src/openchrome.man: * src/via_driver.c: (VIAPreInit): 2009-11-20 Bartosz Kosiorek Enabled new mode switch for PM800 chipset, to resolve many bugs with resolution detecting and changing (eg. switching to console) * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit): 2009-11-07 Bartosz Kosiorek Add more comments to ViaSetSecondaryFIFO, add panel scale support for CLE266 and KM400, fix bug with malloc. * src/via_bandwidth.c: (ViaSetSecondaryFIFO): * src/via_panel.c: (ViaPanelScale), (ViaPanelGetNativeDisplayMode): 2009-09-26 Bartosz Kosiorek Save/restore ECK Clock Synthesizer * src/via_driver.c: (VIASave), (VIARestore): * src/via_driver.h: 2009-09-21 Bartosz Kosiorek Fixed bug with panel autodetection using ViaPanelGetNativeModeFromScratchPad function * src/via_panel.c: 2009-09-21 Bartosz Kosiorek Fixed problem with backlite (Ticket #308) * src/via_lvds.c: (ViaLVDSSoftwarePowerFirstSequence), (ViaLVDSSoftwarePowerSecondSequence), (ViaLVDSHardwarePowerFirstSequence), (ViaLVDSHardwarePowerSecondSequence), (ViaLVDSPower): 2009-09-15 Bartosz Kosiorek TV-out VT1625 chip support * src/via_bios.h: * src/via_crtc.c: (ViaFirstCRTCSetMode): * src/via_display.c: (ViaDisplayEnableDVO), (ViaDisplayDisableDVO), (ViaDisplaySetStreamOnDVO): * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit): * src/via_mode.c: (ViaTVSetMode), (ViaOutputsSelect), (ViaModeSet): * src/via_vt162x.c: (ViaSetTVClockSource), (VT1622ModeI2C), (VT1622ModeCrtc): * src/via_vt162x.h: 2009-09-15 Bartosz Kosiorek Cursor support speedup * src/via_cursor.c: (viaHWCursorInit), (viaCursorStore), (viaCursorRestore), (viaShowCursor), (viaHideCursor), (viaSetCursorPosition), (viaLoadCursorImage), (viaLoadCursorARGB): 2009-09-14 Bartosz Kosiorek Removed two old variables: pBIOSInfo->panelX pBIOSInfo->panelY and replaced it by: pBIOSInfo->Panel->NativeMode->Width pBIOSInfo->Panel->NativeMode->Height * src/via_bios.h: * src/via_driver.c: (VIASetupDefaultOptions): * src/via_mode.c: (ViaPanelGetIndex), (VIASetLCDMode), (ViaModePrimaryLegacy), (ViaModeSecondaryLegacy): * src/via_swov.c: (SetVideoWindow): * src/via_video.c: (DecideOverlaySupport): 2009-09-10 Bartosz Kosiorek Fix bug with DFP Power Off (ticket #317) * src/via_mode.c: (ViaDFPPower): 2009-08-20 Bartosz Kosiorek Fix bug with wrong panel size value (http://www.openchrome.org/trac/ticket/301) This bug appeared only when UseLegacyModeSwitch was TRUE * src/via_driver.c: (VIASetupDefaultOptions): * src/via_video.c: (DecideOverlaySupport): 2009-08-17 Bartosz Kosiorek Added support of the VIA OpenBook * src/via_id.c: 2009-08-08 Bartosz Kosiorek Added support for screen rotate upside-down and remove "magic numbers" * src/via_driver.c: * src/via_driver.h: * src/via_shadow.c: 2009-07-28 Jon Nettleton Forgot to remove an old Dot Clock entry from the table. * src/via_mode.h: 2009-07-28 Jon Nettleton XO 1.5 Panel patch contributed by Xavier Bachelot. Fixup some of the Dotclock code and add working plls for the XO 1.5 * src/via_bios.h: * src/via_mode.c: (ViaSetDotclock), (ViaSetPrimaryDotclock), (ViaSetSecondaryDotclock): * src/via_mode.h: * src/via_panel.c: 2009-03-21 Xavier Bachelot * src/via_bios.h: * src/via_display.c: (ViaDisplaySetStreamOnDFP): * src/via_driver.c: (VIAPreInit), (VIASave), (VIARestore), (VIADPMS): * src/via_driver.h: * src/via_mode.c: (ViaDFPDetect), (ViaOutputsDetect), (ViaOutputsSelect), (ViaDFPPower), (ViaModeSet): CX700 integrated TMDS (Patch courtesy Tim Chen from VIA). 2009-02-19 Gabriel Mansi * src/via_driver.c: (VIAScreenInit), (VIAWriteMode): Initialize CRTC before a mode switch. Fix bug #260. 2009-01-26 Jon Nettleton * src/via_accel.c: (viaInitXAA), (viaExaCheckComposite): a couple of small compatibility fixes for XAA and EXA. 2009-01-17 Jon Nettleton * libxvmc/viaLowLevel.c: (viaDMAInitTimeStamp): * src/via_accel.c: (viaDisableVQ): * src/via_video.c: (viaVideoFillPixmap): viaLowLevel.c and via_accel.c are fixes by Bartosz Kosiorek. The via_video.c is a syntax fix by Robert Bridge. Thanks for the bug fixes. 2009-01-17 Jon Nettleton * configure.ac: * src/via_accel.c: (viaInitAccel), (viaExitAccel), (viaFinishInitAccel): * src/via_driver.c: (VIASetup), (VIASetupDefaultOptions), (VIAPreInit), (VIAWriteMode), (VIAInitialize3DEngine): * src/via_driver.h: * src/via_memory.c: (viaExaFBSave), (VIAFreeLinear), (viaOffScreenLinear), (VIAInitLinear): * src/via_priv.h: Patch submitted by Robert Bridge, originally started by Xavier Bachelot, to remove old EXA support. We are moving forward with the driver and are no longer supporting the old EXA initializations. 2009-01-14 Jon Nettleton * src/via_accel.c: (viaDisableVQ), (viaInitialize2DEngine), (viaAccelSync): According to VIA's code the P4M900 should have the same acceleration initialization registers as the K8M890. This patch fixes this and gives about a 10x increase in the video benchmark numbers. 2009-01-14 Jon Nettleton * src/via_accel.c: (viaFlushPCI): remove the check for VIA_3D_ENG_BUSY in the idle loop. This causes xorg to chew a bit more cpu with XAA enabled, and it causes the entire X server to dump if EXA is enabled. I should investigate further, but for now I will just remove it. 2009-01-14 Jon Nettleton * src/via_accel.c: (viaFlushPCI): Oops forgot to change registers for the vx800 chipset when waiting for Idle in the engines. I also added back in waiting for the 3d engine to be idle. I am not sure if this was removed for a reason. 2009-01-07 Jon Nettleton * src/via_bios.h: * src/via_crtc.c: (via_xf86crtc_resize), (ViaPreInitCRTCConfig): * src/via_driver.c: (VIAPreInit): Temporary hack to fix a bug with newer Xorg and DRI that crashes if CRTC is not setup. I am adding this because I am working on this part of the code anyways so it won't get lost in bit rot. 2009-01-06 Jon Nettleton * src/via_mode.c: (ViaModesMonitorFixup), (ViaModesAttachHelper): Make sure that the monitor settings will handle our internal Modes set for TV out and LCD Panels. 2009-01-05 Jon Nettleton * src/via_cursor.c: (viaHWCursorInit), (viaLoadCursorImage): A couple more tweaks to fix mono hardware cursor on older chipsets. 2009-01-05 Jon Nettleton * src/via_cursor.c: (viaHWCursorInit), (viaUseHWCursorARGB), (viaUseHWCursor): * src/via_driver.c: (VIAScreenInit): Missed a couple of changes for the chipset specific cursors. Moved chipset detection to HWInit. Removed some extraneous debugging. 2009-01-04 Gabriel Mansi * src/via.h: * src/via_accel.c: (viaInitialize2DEngine): * src/via_crtc.c: (ViaFirstCRTCSetMode), (ViaSecondCRTCSetMode): * src/via_driver.c: (ViaMMIOEnable), (ViaMMIODisable), (VIAWriteMode): * src/via_swov.c: (SetFIFO_V3), (Upd_Video): * src/via_video.c: (DecideOverlaySupport): Initial XVideo support for VX800. 2009-01-04 Jon Nettleton * src/via_cursor.c: (viaHWCursorInit), (viaCursorSetFB), (viaUseHWCursorARGB), (viaUseHWCursor), (viaLoadCursorImage), (viaSetCursorColors), (viaLoadCursorARGB): * src/via_driver.h: Okay I tried to cheat. We need to have some chipset specific intelligence. I have added this back into the initial test to check for HWCursor support. 2009-01-04 Jon Nettleton * src/via_accel.c: (viaInitXAA), (viaInitAccel): * src/via_crtc.c: (ViaSecondCRTCSetStartingAddress): * src/via_cursor.c: (viaHWCursorInit), (viaCursorSetFB), (viaCursorStore), (viaCursorRestore), (viaShowCursor), (viaHideCursor), (viaSetCursorPosition), (viaUseHWCursorARGB), (viaUseHWCursor), (viaLoadCursorImage), (viaSetCursorColors), (viaLoadCursorARGB): * src/via_dga.c: (VIADGASetMode): * src/via_driver.c: (VIAFreeRec), (VIASetupDefaultOptions), (VIAPreInit), (VIAEnterVT), (VIALeaveVT), (VIAScreenInit), (VIACloseScreen): * src/via_driver.h: * src/via_regs.h: This is a take at reworking HWCursor. It works off the ttm_branch and the work done in the randr_branch. It only needs marginal testing as HWCursor was already very broken. 2009-01-04 Jon Nettleton * src/via_driver.c: (VIAMapMMIO), (VIAMapFB): Moved pVia->FrameBufferBase setting to within VIAMapFB where it was before being called without being set. 2009-01-04 Jon Nettleton * src/via_driver.c: (VIAPreInit): Patch submitted by Robert Bridge to clean up compiler warnings. Should close trac ticket #243. Thanks RobbieAB. 2008-12-29 Jon Nettleton * src/via_accel.c: (viaInitXAA): * src/via_driver.c: (VIAMapMMIO), (VIAMapFB): Finally tracked down the XAA libpciaccess bug. Also Realized I had not enabled write-combining on the main framebuffer. This should give a small speed boost. 2008-12-26 Jon Nettleton * src/via_mode.h: Added support for all Modes in ViaPanelNativeModes to ViaPanelModes. Modes used are from Via's released driver in ViaSupportModes. 2008-11-04 Jon Nettleton * src/via_crtc.c: (ViaFirstCRTCSetMode), (ViaSecondCRTCSetMode): Found needed register writes that are needed so VX800 doesn't crash when CRT is not enabled. I also removed NEEDS FIXING comments from them as they are obviously needed. 2008-11-03 Jon Nettleton * src/via_accel.c: (viaSubsequentMono8x8PatternFillRect), (viaSetupForSolidLine), (viaSubsequentSolidHorVertLine), (viaSetupForDashedLine), (viaAccelMarkSync): A few more acceleration tweaks for the VX800. This should fix all the XAA rendering issues. This should also allow 800x480 Panels to work without custom modelines. 2008-11-02 Jon Nettleton * src/via_accel.c: (viaFlushPCI), (viaDisableVQ), (viaInitialize2DEngine), (viaAccelSync), (viaPitchHelper), (viaAccelClippingHelper), (viaAccelSolidHelper), (viaAccelTransparentHelper), (viaAccelCopyHelper), (viaSetupForScreenToScreenCopy), (viaSubsequentScreenToScreenCopy), (viaSetupForSolidFill), (viaSubsequentSolidFillRect), (viaSetupForMono8x8PatternFill), (viaSubsequentMono8x8PatternFillRect), (viaSetupForColor8x8PatternFill), (viaSubsequentColor8x8PatternFillRect), (viaSetupForCPUToScreenColorExpandFill), (viaSubsequentScanlineCPUToScreenColorExpandFill), (viaSetupForImageWrite), (viaSubsequentImageWriteRect), (viaSetupForSolidLine), (viaSubsequentSolidTwoPointLine), (viaSubsequentSolidHorVertLine), (viaSetupForDashedLine), (viaInitXAA), (viaAccelMarkSync), (viaExaPrepareSolid), (viaExaSolid), (viaExaPrepareCopy), (viaExaCopy): * src/via_bandwidth.c: (ViaSetPrimaryFIFO), (ViaSetSecondaryFIFO): * src/via_cursor.c: (viaCursorARGBInit), (viaCursorARGBShow), (viaCursorARGBHide), (viaCursorARGBSetPosition), (viaCursorRecInit): * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit), (VIALeaveVT), (VIACloseScreen): * src/via_driver.h: * src/via_id.c: * src/via_id.h: * src/via_mode.c: (ViaOutputsSelect), (VIAGetPanelSize), (ViaPanelGetIndex): * src/via_mode.h: * src/via_panel.c: (ViaPanelPreInit): * src/via_regs.h: * src/via_swov.c: (VIAVidHWDiffInit), (viaCalculateVideoColor), (viaSetColorSpace), (ViaInitVideoStatusFlag), (ViaSetVidCtl), (SetFIFO_V3_64or32or32), (SetFIFO_V3_64or32or16): * src/via_video.c: (viaInitVideo): Initial support for the VX800 chipset. This is based off the Basic chipset support work of Xavier Bachelot and the inital Acceleration work done by Harald Welte. I verified the changes based off the most recent VIA codebaase and fixed a couple of rendering issues. Still needs more work on EXA ( font rendering glitches ) and XVideo. 2008-05-26 Gabriel Mansi * src/Makefile.am: * src/via_accel.c: (viaInitAccel): * src/via_bios.h: * src/via_crtc.c: (ViaCRTCSetGraphicsRegisters), (ViaCRTCSetAttributeRegisters), (ViaCRTCInit), (ViaFirstCRTCSetMode), (ViaFirstCRTCSetStartingAddress), (ViaSecondCRTCSetStartingAddress), (ViaSecondCRTCHorizontalQWCount), (ViaSecondCRTCHorizontalOffset), (ViaSecondCRTCSetMode), (ViaFirstCRTCModeValid), (ViaSecondCRTCModeValid), (ViaShadowCRTCSetMode): * src/via_cursor.c: (viaCursorARGBInit), (viaCursorSetFB), (viaCursorHWInit), (viaCursorHWShow), (viaCursorHWHide), (viaCursorShow), (viaCursorHide), (viaCursorLoadImage), (viaCursorHWSetPosition), (viaCursorSetPosition), (viaCursorSetColors), (viaCursorStore), (viaCursorRestore), (viaCursorARGBShow), (viaCursorARGBHide), (viaCursorARGBSetPosition), (viaCursorARGBUse), (viaCursorARGBLoad), (viaCursorRecInit), (viaCursorRecDestroy), (viaCursorHWUse): * src/via_dga.c: (VIADGASetMode): * src/via_display.c: (ViaSecondDisplayChannelEnable), (ViaSecondDisplayChannelDisable), (ViaDisplayInit), (ViaDisplayEnableSimultaneous), (ViaDisplayDisableSimultaneous), (ViaDisplayEnableCRT), (ViaDisplayDisableCRT), (ViaDisplaySetStreamOnCRT): * src/via_driver.c: (VIAGetRec), (VIAFreeRec), (VIASetupDefaultOptions), (VIAPreInit), (VIAEnterVT), (VIALeaveVT), (ViaGammaDisable), (VIASave), (VIARestore), (ViaMMIOEnable), (ViaMMIODisable), (VIAMapMMIO), (VIAUnmapMem), (VIALoadPalette), (VIAScreenInit), (VIAWriteMode), (VIACloseScreen), (VIAAdjustFrame), (VIADPMS): * src/via_driver.h: * src/via_lvds.c: (ViaLVDSPowerFirstSequence), (ViaLVDSPowerSecondSequence), (ViaLVDSDFPPower), (ViaLVDSPowerChannel), (ViaLVDSPower): * src/via_mode.c: (ViaPrintMode), (ViaOutputsSelect), (VIAGetPanelSize), (ViaPanelGetIndex), (ViaModesAttach), (ViaValidMode), (VIASetLCDMode), (ViaModePrimaryLegacy), (ViaModeSecondaryLegacy), (ViaLCDPower), (ViaModeFirstCRTC), (ViaModeSecondCRTC), (ViaModeSet): * src/via_panel.c: (ViaPanelLookUpModeIndex), (ViaPanelGetNativeModeFromOption), (ViaPanelGetNativeModeFromScratchPad), (ViaPanelScaleDisable), (ViaPanelScale), (ViaPanelGetNativeDisplayMode), (ViaPanelPreInit), (ViaPanelCenterMode), (ViaPanelGetSizeFromEDID), (ViaPanelGetSizeFromDDCv1), (ViaPanelGetSizeFromDDCv2): * src/via_regs.h: * src/via_swov.c: (Upd_Video): * src/via_timing.c: (froundf), (timingGenerateMode), (viaTimingCvt), (viaTimingGtf): * src/via_timing.h: * src/via_vbe.c: (ViaVbeGetActiveDevices), (ViaVbeSetMode), (ViaVbeDoDPMS): * src/via_video.c: (DecideOverlaySupport), (viaSaveVideo), (viaRestoreVideo): Merge panel code from randr branch (rev. 427 to 553) Add native mode setting for P4M890, P4M900, K8M890 and CX700 Add LVDS power functions for P4M900 and CX700 Add ARGB hardware cursor support 2008-03-11 Xavier Bachelot * configure.ac: * src/via.h: * src/via_dri.c: (VIADRIIrqInit), (VIADRIScreenInit): * src/via_driver.c: (via_pci_device), (via_host_bridge), (viaPciDeviceVga), (if), (switch): * src/via_driver.h: * src/via_id.c: (ViaCheckCardId): Merge changes from pciaccess branch. 2008-02-19 Benno Schulenberg * src/via_driver.c: (VIAPreInit): Dealing with the NoAccel option before the Rotate option, since the latter overrides the first. 2008-01-28 Benno Schulenberg * src/Makefile.am: Recreating svnversion.h only when a source file has changed. 2008-01-18 Benno Schulenberg * src/via_dri.c: (VIAInitVisualConfigs): Condensing an unneeded code duplication. 2008-01-11 Benno Schulenberg * src/openchrome.man: * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit): Removing the redundant HWCursor option. 2008-01-10 Benno Schulenberg * src/openchrome.man: Tweaking the text, clarifying the effect of an option, giving the default value. 2008-01-08 Benno Schulenberg * src/via_accel.c: (viaBitExpandHelper), (viaPixelARGB8888): Moving a little more computation into the helper function. 2007-10-29 Benno Schulenberg * src/via_driver.c: (VIAPreInit): Redoing the second change of June 10: Printing VideoRAM again only when it's actually been probed; plus further tiny code cleanups: comments, line wraps, whitespace. 2007-10-29 Benno Schulenberg * src/via_driver.c: (VIAPreInit): Redoing the first change of June 10: Putting the chipset and revision print statements together at the beginning; moving the reading of the VideoRAM option to after X has parsed the config file; plus a few small layout tweaks. 2007-10-05 Gabriel Mansi * src/via_swov.c: (Upd_Video): Enable colorkey on secondary. 2007-10-03 Gabriel Mansi * src/via_driver.c: (VIAPreInit): Fix memory detection for P4M900 and CX700. 2007-09-12 Gabriel Mansi * src/via_bios.h: * src/via_driver.c: (VIAWriteMode), (VIAAdjustFrame), (VIASwitchMode): * src/via_mode.c: (ViaModeSecondaryVGAFetchCount), (ViaModeSecondaryVGAOffset), (ViaModeSecondaryVGA): * src/via_swov.c: (Upd_Video): * src/via_vbe.c: (ViaVbeSetPanelMode), (ViaVbeSetMode): Fix offset when using vbe modes on secondary. 2007-09-11 Xavier Bachelot * libxvmc/viaLowLevel.c: (initXvMCLowLevel): * libxvmc/viaLowLevel.h: * libxvmc/viaLowLevelPro.c: (initXvMCLowLevel): * src/via.h: * src/via_accel.c: (viaInitExa): * src/via_bandwidth.c: (ViaSetPrimaryFIFO): * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit), (VIASave), (VIARestore), (VIALoadPalette): * src/via_driver.h: * src/via_id.c: * src/via_mode.c: (ViaOutputsDetect): * src/via_priv.h: * src/via_swov.c: (Upd_Video): * src/via_vbe.c: (ViaVbeInitInt10), (ViaVbeGetRefreshRateIndex), (ViaVbeGetActiveDevices), (ViaVbeSetActiveDevices), (ViaVbeSetPanelExpansion), (ViaVbeSetRefresh), (ViaVbeSetMode), (ViaVbeSaveRestore), (ViaVbeModePreInit): * src/via_xvmc.c: (ViaInitXVMC), (ViaXvMCCreateContext): Sync with experimental_branch. 2007-09-07 Gabriel Mansi * unichrome/via_id.c: Added Gigabyte GA-VM900M ID, reported by Alexandre Penasso Teixeira. 2007-09-07 Gabiel Mansi * libxvmc/viaLowLevel.c: (initXvMCLowLevel): * libxvmc/viaLowLevel.h: * libxvmc/viaLowLevelPro.c: (initXvMCLowLevel): * unichrome/via.h: * unichrome/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit), (VIASave), (VIARestore), (VIALoadPalette): * unichrome/via_driver.h: * unichrome/via_mode.c: (ViaOutputsDetect): * unichrome/via_swov.c: (Upd_Video): * unichrome/via_vbe.c: (ViaVbeInitInt10), (ViaVbeGetRefreshRateIndex), (ViaVbeGetActiveDevices), (ViaVbeSetActiveDevices), (ViaVbeSetPanelExpansion), (ViaVbeSetRefresh), (ViaVbeSetMode), (ViaVbeSaveRestore), (ViaVbeModePreInit): * unichrome/via_xvmc.c: (ViaInitXVMC), (ViaXvMCCreateContext): Merged vn896_branch from revision 361 to 391. 2007-09-07 Gabriel Mansi * unichrome/via_driver.c: (VIAPreInit): * unichrome/via_mode.c: (ViaOutputsDetect): * unichrome/via_vbe.c: (ViaVbeSetActiveDevices): Disabled TV detection for P4M900. 2007-09-07 Gabriel Mansi * unichrome/via_driver.h: * unichrome/via_vbe.c: (ViaVbeInitInt10), (ViaVbeGetRefreshRateIndex), (ViaVbeGetActiveDevices), (ViaVbeSetActiveDevices), (ViaVbeSetPanelExpansion), (ViaVbeSetRefresh), (ViaVbeSetMode), (ViaVbeModePreInit): VBE code cleanup. 2007-09-02 Gabriel Mansi * unichrome/via_driver.c: (VIASetupDefaultOptions), (VIASave), (VIARestore): * unichrome/via_vbe.c: (ViaVbeSetMode): Disabled XvDMA for P4M900. Modified VBE functions calling order. 2007-08-18 Gabriel Mansi * unichrome/via_driver.c: (VIASetupDefaultOptions): * unichrome/via_priv.h: * unichrome/via_swov.c: (Upd_Video): Xvideo code cleanup; added maximum resolution with interpolation for all chipsets. 2007-08-03 Xavier Bachelot * src/via_bios.h: * src/via_mode.h: * src/via_video.c: (DecideOverlaySupport): Add basic support for DDR667. 2007-07-31 Jon Nettleton * src/via_xvmc.c: (ViaInitXVMC): Fixed the xvmc name we register. Was still looking for the old via xvmc library names. 2007-07-04 Xavier Bachelot * configure.ac: * src/via_driver.c: (VIAPreInit): * src/via_driver.h: Bump driver version to 0.2.900. Do not log detected chipset 2 times. Remove duplicate changelog entry. 2007-06-20 Gabriel Mansi * unichrome/via_bandwidth.c: (ViaSetPrimaryFIFO) FIFO settings for CX700. 2007-06-14 Jon Nettleton * configure.ac: * libxvmc/viaLowLevel.h: * src/via.h: * src/via_accel.c: (viaFlushPCI), (viaInitPCIe), (viaEnableAgpVQ), (viaEnablePCIeVQ), (viaDisableVQ), (viaInitialize2DEngine), (viaAccelSync), (viaInitXAA), (viaInitExa), (viaInitAccel): * src/via_bandwidth.c: (ViaSetPrimaryFIFO), (ViaSetSecondaryFIFO): * src/via_dri.c: (VIADRIRingBufferInit): * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit), (VIALeaveVT), (VIASave), (VIAScreenInit), (VIACloseScreen): * src/via_driver.h: * src/via_id.c: (ViaDoubleCheckCLE266Revision), (ViaCheckCardId): * src/via_id.h: * src/via_mode.c: (ViaGetMemoryBandwidth), (ViaModePrimary): * src/via_mode.h: * src/via_regs.h: * src/via_swov.c: (viaWaitHQVFlip), (viaWaitHQVDone), (VIAVidHWDiffInit), (viaCalculateVideoColor), (viaSetColorSpace), (ViaInitVideoStatusFlag), (ViaSetVidCtl), (AddHQVSurface), (SetFIFO_V3), (SetFIFO_V3_64or32or32), (SetFIFO_V3_64or32or16), (SetColorKey), (SetChromaKey), (SetHQVFetch), (Upd_Video), (VIAVidUpdateOverlay), (ViaOverlayHide): * src/via_swov.h: * src/via_vbe.c: (ViaVbeSetMode): * src/via_video.c: (DecideOverlaySupport), (viaInitVideo), (Flip), (viaDmaBlitImage), (viaPutImage): * src/via_video.h: * src/via_xvmc.c: (ViaInitXVMC): Pulled in Changes from the experimental_branch including - Partial support for VIA_K8M890, VIA_P4M900, VIA_CX700, VIA_P4M890 - Added the VideoEngine option to help clean up code - Ability to enable debugging with the configure script 2007-06-12 Gabriel Mansi * unichrome/via.h: * unichrome/via_dri.c: (VIADRIRingBufferInit): * unichrome/via_driver.c: * unichrome/via_id.c: * unichrome/via_id.h: * unichrome/via_swov.c: (viaCalculateVideoColor), (viaSetColorSpace), (ViaInitVideoStatusFlag), (ViaSetVidCtl), (SetFIFO_V3), (SetFIFO_V3_64or32or32), (SetFIFO_V3_64or32or16), (Upd_Video): * unichrome/via_vbe.c: (ViaVbeSetMode): * unichrome/via_video.c: (DecideOverlaySupport): Renamed VT3157 to VT3324. Added check for null data block in vbe. Remove version check for older version of Xorg. 2007-06-12 Gabriel Mansi * unichrome/via.h: Added missing includes. 2007-06-10 Benno Schulenberg * unichrome/via_driver.c: (VIAPreInit): Print VideoRAM again only when it's actually been probed. Further tiny code cleanups: comments, line wraps, whitespace. 2007-06-10 Benno Schulenberg * unichrome/via.man: * unichrome/via_driver.c: (VIAPreInit): Move reading of the VideoRAM option to after X has parsed the config file. Also put the chipset and revision print statements together and at the beginning. Plus several small layout tweaks. 2007-06-07 Jon Nettleton * Makefile.am: * configure.ac: * libxvmc/Makefile.am: * man/Makefile.am: * src/Makefile.am: * src/via_driver.c: * src/via_driver.h: Renaming driver to openchrome_drv.so and XvMC library to libchromeXvMC.so. 2007-06-06 Jon Nettleton * unichrome/via_driver.c: Removed the chipset option definitions that aren't in trunk yet. 2007-06-06 Jon Nettleton * unichrome/via_driver.c: * unichrome/via_driver.h: * unichrome/via.man: Added per-chipset option defaults. This should allow the driver to work out of the box with almost all hardware and xorg.conf configurations. 2007-05-23 Jon Nettleton * unichrome/via.h: Remove version check for older version of Xorg. This is really not necessary anymore, and was causing some breakage with xorg-server's new version numbering. 2007-05-18 Xavier Bachelot * libxvmc/Makefile.am: * libxvmc/viaXvMC.c: (XvMCCreateContext): Backport 2 fixes from Xorg tree. http://gitweb.freedesktop.org/?p=xorg/driver/xf86-video-via.git;a=commit;h=362e03a38682bfcf366242c53444fa36b6052794 http://gitweb.freedesktop.org/?p=xorg/driver/xf86-video-via.git;a=commit;h=3cd7dac2b5a1c4bfb66bd1b67904d72dc08cbd0e 2007-05-15 Gabriel Mansi * unichrome/via.h: * unichrome/via_driver.c: (VIASetupDefaultOptions): * unichrome/via_driver.h: * unichrome/via_swov.c: (viaWaitHQVFlip), (SetColorKey), (SetChromaKey), (Upd_Video): * unichrome/via_video.c: (Flip), (viaDmaBlitImage), (viaPutImage): Xv code cleanup. 2007-05-10 Jon Nettleton * unichrome/via_driver.c: * unichrome/via_driver.h: * unichrome/via.man: Added per chipset option defaults. This should allow the driver to install and work out of the box with almost all hardware and xorg.conf configurations. 2007-05-07 Gabriel Mansi * libxvmc/viaLowLevel.h: * unichrome/via_accel.c: (viaFlushPCI), (viaDisableVQ), (viaAccelSync): * unichrome/via_bandwidth.c: (ViaSetPrimaryFIFO), (ViaSetSecondaryFIFO): * unichrome/via_dri.c: (VIADRIRingBufferInit): * unichrome/via_driver.c: (VIAPreInit): * unichrome/via_id.c: * unichrome/via_swov.c: (viaWaitHQVFlip), (VIAVidHWDiffInit), (viaSetColorSpace), (ViaInitVideoStatusFlag), (ViaSetVidCtl), (SetFIFO_V3_64or32or32), (SetFIFO_V3_64or32or16), (SetColorKey), (SetChromaKey), (Upd_Video): * unichrome/via_video.c: (DecideOverlaySupport), (Flip), (viaDmaBlitImage), (viaPutImage): Fix Xv for P4M890. 2007-04-30 Gabriel Mansi * unichrome/via_swov.c: (Upd_Video): * unichrome/via_xvmc.c: (ViaInitXVMC): Disable interpolation when the source width is greater than 800, otherwise the picture wraps around the screen (bug #109). Fix a typo in ViaInitXVMC (bug #111). 2007-04-14 Benno Schulenberg * unichrome/via_id.c: (ViaDoubleCheckCLE266Revision), (ViaCheckCardId): VN -> VM, message tweaks, and trailing white space fixes. 2007-03-28 Gabriel Mansi * unichrome/via_bandwidth.c: (ViaSetPrimaryFIFO): * unichrome/via_swov.c: (viaWaitHQVFlip), (VIAVidHWDiffInit), (viaSetColorSpace), (ViaInitVideoStatusFlag), (ViaSetVidCtl), (SetFIFO_V3_64or32or32), (SetFIFO_V3_64or32or16), (SetColorKey), (SetChromaKey), (Upd_Video): * unichrome/via_video.c: (Flip), (viaDmaBlitImage), (viaPutImage): Fix Xv for CX700. 2007-03-20 Xavier Bachelot * unichrome/via_bandwidth.c: (ViaSetPrimaryFIFO), (ViaSetSecondaryFIFO): * unichrome/via_dri.c: (VIADRIRingBufferInit): * unichrome/via_driver.c: * unichrome/via_id.c: * unichrome/via_id.h: * unichrome/via_mode.c: (ViaGetMemoryBandwidth), (ViaModePrimary): * unichrome/via_mode.h: * unichrome/via_swov.c: (VIAVidHWDiffInit), (viaCalculateVideoColor), (viaSetColorSpace), (ViaInitVideoStatusFlag), (SetFIFO_V3), (SetFIFO_V3_64or32or32): * unichrome/via_video.c: (viaInitVideo): * unichrome/via_xvmc.c: (ViaInitXVMC): Initial support for P4M890. 2007-03-09 Gabriel Mansi * unichrome/via_accel.c: (viaFlushPCI), (viaAccelSync), (viaInitXAA): * unichrome/via_bandwidth.c: (ViaSetPrimaryFIFO), (ViaSetSecondaryFIFO): * unichrome/via_driver.c: (VIAPreInit), (VIALeaveVT), (VIACloseScreen): * unichrome/via_id.c: * unichrome/via_id.h: * unichrome/via_mode.c: (ViaGetMemoryBandwidth), (ViaModePrimary): * unichrome/via_mode.h: * unichrome/via_swov.c: (viaWaitHQVFlip), (VIAVidHWDiffInit), (viaCalculateVideoColor), (viaSetColorSpace), (ViaInitVideoStatusFlag), (ViaSetVidCtl), (SetFIFO_V3_64or32or32), (SetFIFO_V3_64or32or16), (SetColorKey), (SetChromaKey), (Upd_Video): * unichrome/via_video.c: (DecideOverlaySupport), (viaInitVideo), (Flip), (viaDmaBlitImage), (viaPutImage): * unichrome/via_xvmc.c: (ViaInitXVMC): Initial support for P4M900. 2007-03-08 Xavier Bachelot * unichrome/via_bandwidth.c: (ViaSetPrimaryFIFO), (ViaSetSecondaryFIFO): * unichrome/via_dri.c: (VIADRIRingBufferInit): * unichrome/via_driver.c: * unichrome/via_id.c: * unichrome/via_id.h: * unichrome/via_mode.c: (ViaGetMemoryBandwidth), (ViaModePrimary): * unichrome/via_mode.h: * unichrome/via_swov.c: (VIAVidHWDiffInit), (viaCalculateVideoColor), (viaSetColorSpace), (ViaInitVideoStatusFlag), (SetFIFO_V3), (SetFIFO_V3_64or32or32): * unichrome/via_video.c: (DecideOverlaySupport), (viaInitVideo): * unichrome/via_xvmc.c: (ViaInitXVMC): Initial support for CX700. 2007-03-04 Benno Schulenberg * unichrome/via.man: Textual tweaks and options ordered alphabetically. 2007-02-16 Benno Schulenberg * unichrome/via_accel.c: (viaSetClippingRectangle), (viaAccelSolidHelper), (viaAccelCopyHelper), (viaSubsequentMono8x8PatternFillRect), (viaSubsequentColor8x8PatternFillRect), (viaSubsequentSolidTwoPointLine), (viaSubsequentSolidHorVertLine): Limit x value to sixteen bits. Fixes a rendering glitch reported by Marg Huijgen ; solution found by Thomas. 2007-02-10 Thomas Hellström * unichrome/via_accel.c: (viaFlushDRIEnabled), (viaSubsequentSolidTwoPointLine): Fix line-clipping bug reported by Manuel Bilderbeek . 2007-02-06 Benno Schulenberg * unichrome/via_driver.c: Try CR39 when CR34 says zero during memory detection on the CLE266. Idea from Luc Verhaegen, patch by Mark Huijgen . 2007-01-20 Benno Schulenberg * ChangeLog Switch encoding of ChangeLog file to Unicode. Whitespace and format adjustments. 2007-01-20 Benno Schulenberg * unichrome/via_driver.c: (VIALoadRgbLut), (VIALoadPalette), (VIAScreenInit): Add ability to change gamma setting. Original patch by Gonzalo A. de la Vega , adapted from Luc Verhaegen's implementation. 2006-12-28 Thomas Hellström * unichrome/via_accel.c: (viaExaTexUploadToScreen): Work around an obscure hardware limitation when texturing from AGP. 2006-12-28 Thomas Hellström * unichrome/via_dri.c: (VIASetAgpMode): Fix AGP mode setting. 2006-12-28 Thomas Hellström Use non-power-of-two textures for EXA whenever possible. 2006-12-18 Jon Nettleton * unichrome/via_xvmc.c: Thomas needs a good drm test which means we need XvMC. I have re-enabled it for testing. 2006-12-15 Jon Nettleton * unichrome/via.h: * unichrome/via_swov.c: This is my cleanup commit of the excellent patch that Gabriel Mansi provided, which finishes the XVideo work on the VT3336 chipset. Nice work Gabriel. 2006-12-13 Jon Nettleton * unichrome/via_video.c: Don't use HQV Offset for HQV_CONTROL. 2006-12-11 Jon Nettleton * unichrome/via_video.c: * unichrome/via_swov.c: Looks like the VT3336 has the same offset as the VT3259 for the hardware overlay. 2006-12-10 Jon Nettleton * unichrome/via_memcpy.c: * unichrome/via_swov.c: Removed the previous changes; I am not ready to rewrite the assembly code for x86_64. The ColorSpace registers were being set up incorrectly for VT3336. 2006-12-09 Jon Nettleton * unichrome/via_memcpy.c: The ifdef's in memcpy.c only support i386 arch; should also support i86_64. 2006-12-09 Jon Nettleton * unichrome/via_xvmc.c: K8M890 does not support XvMC like the other chipsets; disable it for now. 2006-12-09 Jon Nettleton * unichrome/via_video.h: * unichrome/via_swov.h: * unichrome/via_swov.c: Made K8M890 XV FIFO settings match K8M800. Enabled XV_DEBUG. 2006-12-07 Jon Nettleton * unichrome/via_mode.h: Updated the BandwidthTable for K8M890 chipset. 2006-12-07 Thomas Hellström * unichrome/via_driver.c: (VIAEnterVT): Initialize the AGP ring buffer before command submission. 2006-12-07 Thomas Hellström * unichrome/via_driver.c: (VIAEnterVT): Blank and clear screen when entering VT. 2006-12-07 Thomas Hellström * unichrome/via_driver.c: (VIAEnterVT): Blank and clear screen when entering VT. 2006-12-07 Thomas Hellström * unichrome/via_accel.c: (viaAccelDMADownload), (viaExaDownloadFromScreen), (viaInitExa): Indent via_accel.c. 2006-12-07 Thomas Hellström * unichrome/via_accel.c: (viaAccelDMADownload): Fix download from screen which was reusing kernel argument data that was altered by the kernel. 2006-12-07 Thomas Hellström * unichrome/via_accel.c: (viaAccelDMADownload), (viaExaDownloadFromScreen): Reimplement download from screen to something more easily debuggable. 2006-12-06 Jon Nettleton * unichrome/via_driver.c: Fixed some of the boolean option changes that are inverses such as DisableIRQ. 2006-12-06 Thomas Hellström * unichrome/via_memory.c: (viaExaFBSave), (viaOffScreenLinear): Cause a "FatalError" if EXA is used with an un-patched Xserver, and an illegal save locked memory action is requested. 2006-12-06 Thomas Hellström * unichrome/via_driver.c: (VIAInitialize3DEngine): Proper register names in VIAInitialize3DEngine. 2006-12-06 Thomas Hellström * unichrome/via_driver.c: (VIALeaveVT), (VIAWriteMode), (VIACloseScreen): * unichrome/via_vbe.c: (ViaVbeSetMode): Now that we initialize the 3D engine every time we write mode, make sure this is done before setting up VQ and AGP so that those settings persist. The GPU will be unstable otherwise. Also fix some code comments. 2006-12-06 Thomas Hellström * unichrome/via_driver.c: (VIALeaveVT): Force 3D context upload after a VT switch. 2006-12-06 Thomas Hellström * unichrome/via_dri.c: (viaDRIFBMemcpy), (viaDRIOffscreenSave): Fix up previous commit for > 16MB sizes. 2006-12-06 Thomas Hellström * unichrome/via_dri.c: (viaDRIOffscreenSave), (viaDRIOffscreenRestore): * unichrome/via_driver.c: (VIAEnterVT), (VIALeaveVT): * unichrome/via_driver.h: Back up DRI offscreen memory before leaving VT and restore it when entering VT. It may be overwritten in between. Use PCI DMA blit for this if available. 2006-12-05 Thomas Hellström * unichrome/via_driver.c: (VIAWriteMode), (VIAInitialize3DEngine): * unichrome/via_vbe.c: (ViaVbeSetMode): With EXA + 3D we need to reinitialize the 3D engine after a mode switch (possibly the soft reset + 2D engine initialization). Otherwise the GPU will hang. 2006-12-05 Thomas Hellström * unichrome/via_driver.c: (VIAPreInit): Fix the dma2d option setting. 2006-12-05 Thomas Hellström * unichrome/via_bandwidth.c: (ViaSetPrimaryFIFO): Use a more aggressive fifo setting for CLE266 Cx. Boosts performance. Please report problems with this. 2006-12-05 Jon Nettleton * unichrome/via_video.c: * unichrome/via_swov.c: Added missing hardware overlay support for VT3336. 2006-12-04 Jon Nettleton * unichrome/via_driver.c: Added patch to fix the K8M890 hang on VT switch; submitted by Gabriel Mansi . 2006-12-01 Thomas Hellström * unichrome/via.man: * unichrome/via_bios.h: * unichrome/via_dri.c: (VIADRIScreenInit): * unichrome/via_driver.c: (VIAPreInit): * unichrome/via_driver.h: Remove unused options. First pass cleaning up option handling. Make most boolean options work as expected; (that is, accepting both a "true" and a "false" argument). 2006-11-30 Jon Nettleton * unichrome/via_mode.c: * unichrome/via_accel.c: Added patch to fix some of the K8M890 logic; submitted by Gabriel Mansi . 2006-11-28 Jon Nettleton * unichrome/via_bandwidth.c: * unichrome/via_accel.c: Patched via_bandwidth.c for dumb mistake I made. Thanks, Gabriel Mansi, for the second set of eyes. Move HWCursor memory allocation even further in the driver initialization. 2006-11-25 Jon Nettleton * unichrome/via_id.c: * unichrome/via_accel.c: Added additional IDs for the K8M890 cards. Changed memory allocation order for the HW cursor and 2D engine. 2006-10-29 Thomas Hellström * libxvmc/viaLowLevel.c: * libxvmc/viaLowLevelPro.c: * unichrome/via_regs.h: Via managed to mix up the 2D / 3D engine busy status bits. Funny we never noticed this before. 2006-10-24 Thomas Hellström * unichrome/via_xvmc.c: (ViaXvMCCreateContext): Remove VT3314 (CN700, VM800 etc.) mpeg2 AGP DMA support. 2006-10-11 Xavier Bachelot reviewed by: Ivor * unichrome/via_bios.h: * unichrome/via_id.c: * unichrome/via_mode.h: * unichrome/via_video.c: (DecideOverlaySupport): DDR533 memory support and small cleanup. Fujitsu/Siemens Amilo L7320 pci id (reported by DeNayGo). 2006-10-03 Thomas Hellström * unichrome/via_video.c: (viaPutImage): Removed some stray debug messages. 2006-10-02 Benno Schulenberg * unichrome/via_driver.c: (VIASave), (VIARestore): Moved a line to after declarations for picky gcc-2.96, tweaked comments and debugging lines. 2006-09-27 Thomas Hellström * unichrome/via_memory.c: Don't include drm headers in non-dri build. 2006-09-25 Benno Schulenberg * unichrome/Makefile.am: Mention the overall revision number in the log, not just the driver code revision. 2006-09-24 Thomas Hellström * libxvmc/viaLowLevel.c: (initXvMCLowLevel): * libxvmc/viaLowLevelPro.c: (initXvMCLowLevel): * libxvmc/viaXvMC.c: (XvMCSetAttribute): Fix a mutex unlocking issue (Luc Verhaegen). Have the lowlevel drivers check for the correct chipid. 2006-09-24 Michal Ludvig * man/Makefile.am: Fix man-page symlink for out-of-tree build (trac ticket #50). 2006-09-22 Jon Nettleton * unichrome/via_drmclient.h: Include stdint.h instead of re-typedefining CARD32. 2006-09-22 Jon Nettleton * src/via_id.h * src/via_video.c * src/via_mode.c * src/via_mode.h * src/via_driver.c * src/via_swov.c * src/via_bandwidth.c * src/via_accel.c * src/via_vbe.c * src/via_xvmc.c * src/via_id.c Initial code for support of VT3336 cards. 2006-09-17 Benno Schulenberg * unichrome/via_driver.c: (VIASave): Put in a few extra debugging lines. 2006-09-05 Benno Schulenberg * unichrome/via_swov.c: Comment and whitespace tweaks. 2006-09-05 Benno Schulenberg * unichrome/via_id.c: Add an ID (trac ticket #67), note identical numbers, remove a duplicate, remove obsolete unknown, remove trailing tab. 2006-08-27 Benno Schulenberg * unichrome/via_id.c: Textual tweaks. 2006-08-27 Benno Schulenberg * unichrome/via_dri.c: (VIADRIAgpInit): Rearrange declarations to fix compilation problem with gcc-2.96, reported by Nikolai V. Ivanyushin . 2006-08-22 Benno Schulenberg * unichrome/via_accel.c: Whitespace adjustment; getting back close to Xorg. Comment tweaks and #endif clarifications. 2006-08-19 Benno Schulenberg * unichrome/via_swov.c: (viaWaitVideoCommandFire), (SetVideoWindow): Comment tweaks. 2006-08-18 Benno Schulenberg * unichrome/via_driver.h: Move definition of AGP_SIZE out of #ifdef VIA_HAVE_EXA block, to make the driver compile again for Xorg-6.8.2. 2006-08-10 Thomas Hellström * unichrome/via_mode.c: (ViaModeDotClockTranslate): * unichrome/via_video.c: (viaPaintColorkey): Re-enable Ivor's Dotclock computation. Enable accelerated redirected colorkey painting for Xv. 2006-07-28 Thomas Hellström * unichrome/via_driver.c: (VIAPreInit): ...And get default AGP size correct as well. 2006-07-28 Thomas Hellström * unichrome/via_accel.c: (viaIsAGP): * unichrome/via_dri.c: (VIADRIAgpInit): Fix false AGP detection and make sure we have the correct AGP size. 2006-07-27 Thomas Hellström * unichrome/via.man: * unichrome/via_accel.c: (viaExaUploadToScratch), (viaExaCheckComposite), (viaIsAGP), (viaInitExa), (viaInitAccel): * unichrome/via_ch7xxx.c: (ViaCH7xxxInit): * unichrome/via_dri.c: (VIADRIAgpInit): * unichrome/via_driver.c: (VIAPreInit), (VIAEnterVT), (VIALeaveVT), (VIAScreenInit), (VIACloseScreen): * unichrome/via_driver.h: Changes donated by "PConRails, LLC" and "Tungsten Graphics, Inc.": EXA and memory management optimizations, Manpage update. New options: ExaScratchSize MaxDRIMem AGPMem VBESaveRestore 2006-07-27 Thomas Hellström * unichrome/via.h: * unichrome/via_accel.c: * unichrome/via_dri.h: * unichrome/via_driver.h: * unichrome/via_mode.c: (ViaModeDotClockTranslate): * unichrome/via_swov.c: (ViaOverlayHide): * unichrome/via_video.c: (DecideOverlaySupport), (viaVideoFillPixmap), (viaPaintColorkey), (viaReputImage), (viaPutImage): Changes donated by "PConRails, LLC" and "Tungsten Graphics, Inc.": Video optimizations: Paint colorkey correctly under composite manager. Make sure the driver compiles with Xorg git. Don't reset the primary display FIFO after XV. It's never touched by the Xv code, and slows things down in VBE mode. 2006-07-11 Thomas Hellström * libxvmc/viaXvMC.c: * unichrome/via_dri.c: Change DRM major compatibility from 3.x.x to 2.x.x. 2006-07-10 Thomas Hellström * libxvmc/driDrawable.c: * libxvmc/viaLowLevel.c: * libxvmc/viaLowLevelPro.c: (finish_header_agp), (computeHQVScaleAndFilter): * libxvmc/viaXvMC.c: (yOffs), (vOffs), (uOffs), (defaultQMatrices), (releaseDecoder), (grabDecoder), (setupAttribDesc), (releaseAttribDesc), (releaseContextResources), (XvMCCreateContext), (XvMCDestroyContext), (XvMCCreateSurface), (XvMCDestroySurface), (XvMCPutSlice2), (XvMCPutSlice), (updateXVOverlay), (XvMCPutSurface), (debugControl), (XvMCBeginSurface), (XvMCSyncSurface), (XvMCLoadQMatrix), (XvMCRenderSurface), (XvMCCreateBlocks), (XvMCDestroyBlocks), (XvMCCreateMacroBlocks), (XvMCDestroyMacroBlocks), (XvMCCreateSubpicture), (XvMCSetSubpicturePalette), (findOverlap), (XvMCClearSubpicture), (XvMCCompositeSubpicture), (XvMCBlendSubpicture), (XvMCBlendSubpicture2), (XvMCSyncSubpicture), (XvMCFlushSubpicture), (XvMCDestroySubpicture), (XvMCGetSubpictureStatus), (XvMCFlushSurface), (XvMCGetSurfaceStatus), (XvMCQueryAttributes), (XvMCSetAttribute), (XvMCGetAttribute), (XvMCHideSurface): * libxvmc/xf86dri.c: Remove the "config.h" includes from libxvmc, as they break it. I wonder how the openChrome libXvMC has been working? Indent viaXvMC.c. 2006-07-10 Thomas Hellström * libxvmc/viaXvMC.c: (XvMCCreateContext): * unichrome/via_dri.c: (VIADRIRingBufferInit), (VIADRIScreenInit): * unichrome/via_xvmc.c: (ViaInitXVMC): Update DRM version checking. 2006-07-10 Thomas Hellström * unichrome/via_swov.c: (viaWaitVideoCommandFire): Increase video command fire timeout. 2006-07-10 Thomas Hellström * unichrome/via_memory.c: (viaOffScreenLinear): Fix dri close screen segfault caused by previous commit. 2006-06-15 Thomas Hellström * unichrome/via_dri.c: (VIADRIFBInit): * unichrome/via_driver.h: * unichrome/via_memory.c: (viaOffScreenLinear), (VIAAllocLinear): Fix severe dri memory allocation bug. (Reported by Trevor Kramer) 2006-05-11 Ivor Hewitt * configure.ac: * unichrome/via.h: * unichrome/via_accel.c: * unichrome/via_cursor.c: * unichrome/via_dri.c: * unichrome/via_driver.h: * unichrome/via_memcpy.c: * unichrome/via_memory.c: * unichrome/via_mode.c: * unichrome/via_shadow.c: * unichrome/via_swov.c: * unichrome/via_vbe.c: * unichrome/via_vgahw.c: * unichrome/via_video.c: * unichrome/via_xvmc.c: - Xorg xv ABI compatibility patch. (Marcin Kurek) 2006-04-14 Ivor Hewitt * libxvmc/Imakefile: - Unbreak makefile. 2006-03-19 Thomas Hellström * libxvmc/Makefile.am: * unichrome/Makefile.am: - Backport Makefile changes form xorg. 2006-03-17 Thomas Hellström * unichrome/via_driver.c: - Update the built-against macro to recognize Xorg if present. (Reported by Eric Anholt) 2006-03-17 Thomas Hellström * configure.ac: - Update compatibility check for XvMC. 2006-03-17 Thomas Hellström * unichrome/via_accel.c: (viaInitExa): * unichrome/via_driver.c: (VIAPreInit): - Support EXA 2.0. 2006-03-13 Thomas Hellström * unichrome/via_accel.c: (viaSetupForSolidLine), (viaSubsequentSolidTwoPointLine), (viaSetupForDashedLine): * unichrome/via_driver.h: - Possible fix for XAA bug rendering solid lines as dashed. (Reported by Lewin Edwards) 2006-03-08 Thomas Hellström * libxvmc/Imakefile: * unichrome/via_swov.c: * unichrome/via_swov.h: * unichrome/via_video.c: (viaInitVideo), (viaExitVideo), * unichrome/via_video.h: * unichrome/via_xvmc.c: (initViaXvMC), (cleanupViaXvMC), (stride), * unichrome/via_xvmc.h: * unichrome/via_xvpriv.h: - Run indent on above files after syncing them with Xorg. 2006-02-23 Xavier Bachelot * configure.ac: - Fix man pages suffix. - Bump driver version number to be equal to xorg. 2006-02-21 Ivor Hewitt * unichrome/via_bios.h: * unichrome/via_driver.c: (VIAPreInit): * unichrome/via_mode.h: * unichrome/via_priv.h: * unichrome/via_swov.c: (viaOverlayGetV1V3Format), (viaOverlayGetSrcStartAddress), (viaOverlayGetFetch), (CreateSurface), (ViaSwovSurfaceCreate), (ViaSwovSurfaceDestroy), (VIAVidUpdateOverlay), (ViaOverlayHide): * unichrome/via_video.c: (viaInitVideo), (Flip), (viaDmaBlitImage), (viaPutImage), (viaQueryImageAttributes): - Lets have RV32 too. - Add 12x8 panel. 2006-02-10 Ivor Hewitt * unichrome/via.h: * unichrome/via_bandwidth.c: (ViaSetPrimaryFIFO), (ViaSetSecondaryFIFO): * unichrome/via_dri.c: (VIADRIRingBufferInit): * unichrome/via_mode.c: (ViaModePrimary): * unichrome/via_swov.c: (VIAVidHWDiffInit), (viaOverlayGetSrcStartAddress), (viaOverlayGetFetch), (viaCalculateVideoColor), (viaSetColorSpace), (ViaInitVideoStatusFlag), (ViaSetVidCtl), (SetFIFO_V3), (SetFIFO_V3_64or32or32), (SetFIFO_V3_64or32or16), (SetColorKey), (SetChromaKey), (SetHQVFetch), (Upd_Video): * unichrome/via_video.c: (DecideOverlaySupport), (viaInitVideo), (viaDmaBlitImage): * unichrome/via_xvmc.c: (ViaInitXVMC), (ViaXvMCCreateContext): - Get some code exercised for VM800, let's see where it crumbles. 2006-01-29 Thomas Hellström * unichrome/via_vbe.c: (ViaVbeSetMode): - Fix VBE refresh setting. 2006-01-29 Thomas Hellström * unichrome/via_accel.c: (viaInitExa): * unichrome/via_driver.c: (VIAPreInit): - Merge EXA branch revisions 152:155 2006-01-29 Thomas Hellström * unichrome/via_swov.c: * unichrome/via_video.c: (viaXvError), (viaReputImage), (viaSetupAdaptors), (viaDmaBlitImage), (viaPutImage): * unichrome/via_xvpriv.h: - Removed time.h and sys/time.h includes from via_swov.c (Reported by George E Sollish). - More verbose Xv error reporting. 2006-01-27 Thomas Hellström * unichrome/via.man: * unichrome/via_3d.c: * unichrome/via_accel.c: (viaAccelPlaneMaskHelper), (viaInitExa), (viaInitAccel), (viaExitAccel), (viaFinishInitAccel): * unichrome/via_driver.c: (VIAPreInit): * unichrome/via_driver.h: - Merge EXA branch revisions 138:152 2006-01-27 Thomas Hellström * unichrome/via_mode.c: (ViaModePrimary): - Import Luc's fix for sometimes-blanking CRTs on CLE266. (Luc Verhaegen) 2006-01-27 Thomas Hellström * unichrome/via_swov.c: (viaWaitVideoCommandFire): - The previous commit causes problems with older X versions. Avoid using gettimeofday(). Reported by Paul Bender. 2006-01-26 Thomas Hellström * unichrome/via_swov.c: (viaTimeDiff), (viaWaitVideoCommandFire): - Make the Xv viaWaitVideoCommandFire loop time out. Better than server hang? 2006-01-26 Thomas Hellström * unichrome/via.man: * unichrome/via_driver.c: (VIAPreInit): * unichrome/via_driver.h: * unichrome/via_video.c: (viaInitVideo): - Added a "NoXVDMA" option to disable PCI DMA for Xv image transfers. May turn out useful to vlc users. - Updated man page. 2006-01-26 Thomas Hellström * unichrome/via_driver.c: - Added vgaHWGetIndex to vgaHW symbol list. (Reported by Ole Sandum) 2006-01-26 Thomas Hellström * unichrome/via_swov.c: (ViaOverlayHide): - Fix HQV offset bug. 2006-01-26 Thomas Hellström * libxvmc/driDrawable.c: (drawStamp), (getDRIDrawableInfoLocked), (driDestroyHashContents): * libxvmc/driDrawable.h: * libxvmc/viaLowLevel.c: (hwlLock), (hwlUnlock), (timeDiff), (viaDMATimeStampLowLevel), (viaDMAWaitTimeStamp), (viaDMAInitTimeStamp), (viaDMACleanupTimeStamp), (viaMpegGetStatus), (viaMpegIsBusy), (syncDMA), (syncVideo), (syncAccel), (syncMpeg), (pciFlush), (agpFlush), (flushXvMCLowLevel), (flushPCIXvMCLowLevel), (pciCommand), (viaMpegSetSurfaceStride), (viaVideoSetSWFLipLocked), (viaVideoSWFlipLocked), (viaMpegSetFB), (viaMpegBeginPicture), (viaMpegReset), (viaMpegWriteSlice), (viaVideoSubPictureOffLocked), (viaVideoSubPictureLocked), (viaBlit), (syncXvMCLowLevel), (initXvMCLowLevel), (closeXvMCLowLevel): * libxvmc/viaLowLevel.h: * libxvmc/viaLowLevelPro.c: (initHQVShadow), (setHQVHWDeinterlacing), (setHQVDeblocking), (setHQVStartAddress), (setHQVColorSpaceConversion), (setHQVFetchLine), (setHQVScale), (setHQVSingleDestination), (setHQVDeinterlacing), (setHQVTripleBuffer), (finish_header_agp), (hwlLock), (hwlUnlock), (timeDiff), (viaDMATimeStampLowLevel), (viaDMAWaitTimeStamp), (viaDMAInitTimeStamp), (viaDMACleanupTimeStamp), (viaMpegGetStatus), (viaMpegIsBusy), (syncDMA), (syncVideo), (syncAccel), (syncMpeg), (pciFlush), (agpFlush), (uploadHQVDeinterlace), (uploadHQVShadow), (flushXvMCLowLevel), (flushPCIXvMCLowLevel), (viaMpegSetSurfaceStride), (viaVideoSetSWFLipLocked), (viaVideoSWFlipLocked), (viaMpegSetFB), (viaMpegBeginPicture), (viaMpegReset), (viaMpegWriteSlice), (viaVideoSubPictureOffLocked), (viaVideoSubPictureLocked), (viaBlit), (syncXvMCLowLevel), (updateLowLevelBuf), (cleanupLowLevelBuf), (releaseXvMCLowLevel), (initXvMCLowLevel), (setLowLevelLocking), (closeXvMCLowLevel), (computeDownScaling), (computeHQVScaleAndFilter), (setupBackBuffer): * libxvmc/viaXvMCPriv.h: * libxvmc/vldXvMC.h: * libxvmc/xf86dri.c: (uniDRIDestroyContext), (uniDRICreateDrawable), (uniDRIDestroyDrawable), (uniDRIGetDrawableInfo): * libxvmc/xf86dri.h: * libxvmc/xf86dristr.h: - Run indent on libXvMC. Sync XvMC with Xorg 7.0. 2006-01-26 Thomas Hellström * unichrome/via_dri.c: (VIADRIKernelInit), (VIADRIMapInit): * unichrome/via_driver.h: - Add a framebuffer map for DRI. Don't just assume that the framebuffer map handle is the physical address. 2006-01-12 Thomas Hellström * unichrome/via_accel.c: (viaExaDownloadFromScreen), (viaExaTexUploadToScreen), (viaExaUploadToScreen), (viaExaCheckComposite): * unichrome/via_driver.h: - Exa branch revision 132:138 merge. 2006-01-12 Thomas Hellström * unichrome/via_swov.c: (CreateSurface): * unichrome/via_video.c: (viaInitVideo), (Flip), (viaDmaBlitImage): - Fix planar Xv Flipping and surface allocation size. (Reported by Tim, MagicITX) - Fix Xv dmablit strides and bump drm version for dmablit to 2.9.0, since there is a direction bug in earlier versions. 2006-01-09 Thomas Hellström * libxvmc/viaXvMC.c: (releaseContextResources): * unichrome/via_swov.c: (CreateSurface), (ViaSwovSurfaceDestroy): - Mark already destroyed XvMC contexts as bad, in case clients try to destroy them twice. - Don't try to destroy YV12 buffers when exiting XvMC video. 2006-01-08 Thomas Hellström * unichrome/via_accel.c: (viaPixelARGB8888): - Merge exa_branch 130:132. Rendering errors. - Changelog typo. 2006-01-08 Thomas Hellström * unichrome/via_3d.c: (viaSet3DFlags), (viaSet3DCompositeOperator): * unichrome/via_accel.c: (viaIsAGP): - Merge exa_branch 127:130. Rendering errors. 2006-01-08 Thomas Hellström * unichrome/Makefile.am: - Modular build fix. (Boris Dusek) 2006-01-07 Thomas Hellström * unichrome/Imakefile: * unichrome/via_accel.c: (viaDumpDMA), (viaFlushPCI), (viaFlushDRIEnabled), (viaSetupCBuffer), (viaAccelClippingHelper), (viaAccelSolidHelper), (viaAccelPlaneMaskHelper), (viaAccelTransparentHelper), (viaAccelCopyHelper), (viaSetupForScreenToScreenCopy), (viaSubsequentScreenToScreenCopy), (viaSetupForSolidFill), (viaSubsequentSolidFillRect), (viaSetupForMono8x8PatternFill), (viaSubsequentMono8x8PatternFillRect), (viaSetupForColor8x8PatternFill), (viaSubsequentColor8x8PatternFillRect), (viaSetupForCPUToScreenColorExpandFill), (viaSubsequentScanlineCPUToScreenColorExpandFill), (viaSetupForImageWrite), (viaSubsequentImageWriteRect), (viaSetupForSolidLine), (viaSubsequentSolidTwoPointLine), (viaSubsequentSolidHorVertLine), (viaSetupForDashedLine), (viaAccelMarkSync), (viaExaPrepareSolid), (viaExaSolid), (viaExaPrepareCopy), (viaExaCopy), (viaExaCompositePictDesc), (viaExaPrintComposite), (viaBitExpandHelper), (viaPixelARGB8888), (viaExpandablePixel), (viaCheckUpload), (viaOrder), (viaExaDownloadFromScreen), (viaExaTexUploadToScreen), (viaExaUploadToScreen), (viaExaUploadToScratch), (viaExaCheckComposite), (viaIsAGP), (viaIsOffscreen), (viaExaPrepareComposite), (viaExaComposite), (viaInitExa), (viaInitAccel), (viaExitAccel), (viaFinishInitAccel), (viaAccelBlitRect), (viaAccelFillRect), (viaAccelSyncMarker): * unichrome/via_dga.c: * unichrome/via_dmabuffer.h: * unichrome/via_dri.c: (VIADRIFBInit): * unichrome/via_driver.c: (VIALeaveVT), (VIAScreenInit), (VIAWriteMode), (VIACloseScreen): * unichrome/via_driver.h: - Merge in exa_branch from revision 104 to 127. Exa Composite acceleration. See the branch Changelog for a detailed description of changes. 2006-01-06 Thomas Hellström * unichrome/via_accel.c: (viaExaDownloadFromScreen), (viaExaUploadToScreen): * unichrome/via_video.c: (viaDmaBlitImage): - Update Xv blit to new blit-combining feature of DRM. (Idea from Luc Verhaegen/Unichrome). - Prepare for ugly via_drm.h dmablit IOCTL arg change and via_drm.h versioning. 2005-12-29 Thomas Hellström * unichrome/via_video.c: (viaDmaBlitImage): - Fix Xv YUY2/RVXX dmaBlit stride. 2005-12-26 Thomas Hellström * libxvmc/Makefile.am: - Modular built two identical XvMC libs. The pro lib was not a pro lib. Fix this. (Tim Dodge) 2005-12-15 Thomas Hellström * unichrome/via_accel.c: (viaInitAccel): - Make sure the accel marker system is properly initialized. 2005-12-08 Thomas Hellström * unichrome/via_driver.c: (VIAScreenInit): * unichrome/via_memory.c: (VIAAllocLinear): - Protect the accelerated initial sceen clearing with a DRI lock. - Submit the correct context for drm memory allocation. 2005-12-08 Thomas Hellström * unichrome/via_ch7xxx.c: (CH7xxxModeI2C): * unichrome/via_dri.c: (VIADRIAgpInit): * unichrome/via_driver.c: (VIAScreenInit): * unichrome/via_id.c: - Moved the memset from previous commit to after dri is initialized, so that AGP command submission will work. - Silenced some warnings. 2005-12-08 Thomas Hellström * unichrome/via_driver.c: (VIAScreenInit): * unichrome/via_mode.c: (ViaModePrimary): * unichrome/via_vbe.c: (ViaVbeSetMode): - Moved memset to blank screen from ModeSetting to ScreenInit, in an attempt to avoid long standing hangs on K8M800. Also use the 2D engine for this if acceleration is enabled. 2005-12-07 Thomas Hellström * Makefile.in: - Removed Makefile.in since it is generated by the build process. 2005-12-06 Jon Nettleton * Makefile.am: * Makefile.in: - Added Makefile.am and Makefile.in to allow running make in the root directory. 2005-12-06 Thomas Hellström * acinclude.m4: * autogen.sh: * configure.ac: * libxvmc/Makefile.am: * libxvmc/driDrawable.c: * libxvmc/viaLowLevel.c: * libxvmc/viaLowLevelPro.c: * libxvmc/viaXvMC.c: * libxvmc/viaXvMCPriv.h: * libxvmc/xf86dri.c: * man/Makefile.am: * unichrome/Makefile.am: * unichrome/via_accel.c: * unichrome/via_bandwidth.c: * unichrome/via_ch7xxx.c: * unichrome/via_cursor.c: * unichrome/via_dga.c: * unichrome/via_dri.c: * unichrome/via_driver.c: * unichrome/via_i2c.c: * unichrome/via_id.c: * unichrome/via_memcpy.c: * unichrome/via_memory.c: * unichrome/via_mode.c: * unichrome/via_shadow.c: * unichrome/via_vbe.c: * unichrome/via_vgahw.c: * unichrome/via_vt162x.c: * unichrome/via_xvmc.c: - Adjust for modular build. 2005-12-04 Thomas Hellström * unichrome/via_vt162x.c: (VT1622ModeCrtc): - Fix trac item #13. This will probably also make TV-out work on some K8M/N800 laptops, and will probaly fix TV-out after a resume. 2005-12-02 Thomas Hellström * libxvmc/Imakefile: * libxvmc/xf86dri.c: - 64 bit fixes on libviaXvMC* 2005-12-02 Thomas Hellström * unichrome/via_accel.c: (viaAccelPlaneMaskHelper), (viaAccelTransparentHelper), (viaSetupForScreenToScreenCopy), (viaSetupForSolidFill), (viaSetupForMono8x8PatternFill), (viaSetupForColor8x8PatternFill), (viaSetupForCPUToScreenColorExpandFill), (viaSetupForImageWrite), (viaSetupForSolidLine), (viaSubsequentSolidTwoPointLine), (viaSetupForDashedLine), (viaAccelMarkSync), (viaExaPrepareSolid), (viaExaPrepareCopy), (viaInitAccel), (viaDGABlitRect), (viaDGAFillRect): * unichrome/via_driver.c: * unichrome/via_driver.h: - Merge exa_branch revisions 91:104: Add support for EXA planemasks. Tell loader about some missing EXA functions (Reported by Adam Jackson). Fix broken XAA dashed lines. 2005-12-01 Thomas Hellström * libxvmc/Imakefile: * unichrome/Imakefile: * unichrome/via_driver.c: - Remove drmCommandWriteRead from drm loader symbols again. Ivor had already added it :) - Fix a typo in unichrome/Imakefile that broke build on x86_64. - Add $(PICFLAGS) to libxvmc Makefile to make it build on x86_64. 2005-12-01 Thomas Hellström * unichrome/via_driver.c: * unichrome/via_memory.c: (VIAFreeLinear): - Add drmCommandWriteRead to drm loader symbols. - Make the drm freemem call drmCommandWrite. 2005-11-29 Thomas Hellström * unichrome/via_accel.c: (viaInitAccel): * unichrome/via_memory.c: (VIAAllocLinear): - Merge exa_branch revisions 86:91 2005-11-29 Thomas Hellström * unichrome/Imakefile: - Yet another drm.h include fixup. For 6.8 and earlier? 2005-11-28 Ivor Hewitt * unichrome/via_id.c: - Just another id. (Tobias Blom) 2005-11-28 Thomas Hellström * unichrome/Imakefile: - Include the correct drm.h file. This is important for 64 bit builds. 2005-11-26 Thomas Hellström * unichrome/via_accel.c: (viaFlushDRIEnabled), (viaSetupCBuffer): - Merged EXA branch changes between revisions 84 and 86. 2005-11-23 Thomas Hellström * unichrome/via_accel.c: (viaFlushPCI), (viaFlushDRIEnabled), (viaSetupCBuffer), (viaTearDownCBuffer), (viaEnableVQ), (viaDisableVQ), (viaAccelSetMode), (viaInitialize2DEngine), (viaAccelSync), (viaSetClippingRectangle), (viaAccelClippingHelper), (viaAccelSolidHelper), (viaAccelTransparentHelper), (viaAccelCopyHelper), (viaSetupForScreenToScreenCopy), (viaSubsequentScreenToScreenCopy), (viaSetupForSolidFill), (viaSubsequentSolidFillRect), (viaSetupForMono8x8PatternFill), (viaSubsequentMono8x8PatternFillRect), (viaSetupForColor8x8PatternFill), (viaSubsequentColor8x8PatternFillRect), (viaSetupForCPUToScreenColorExpandFill), (viaSubsequentScanlineCPUToScreenColorExpandFill), (viaSetupForImageWrite), (viaSubsequentImageWriteRect), (viaSetupForSolidLine), (viaSubsequentSolidTwoPointLine), (viaSubsequentSolidHorVertLine), (viaSetupForDashedLine), (viaSubsequentDashedTwoPointLine), (viaInitXAA), (viaAccelMarkSync), (viaAccelWaitMarker), (viaExaPrepareSolid), (viaExaSolid), (viaExaPrepareCopy), (viaExaCopy), (viaExaDownloadFromScreen), (viaExaUploadToScreen), (viaInitExa), (viaInitAccel), (viaExitAccel), (viaDGABlitRect), (viaDGAFillRect): - Merged EXA branch changes between revisions 74 and 84. Mainly indentations and minor bugfixes. 2005-11-15 Thomas Hellström * unichrome/via_swov.c: (ViaSwovSurfaceCreate), (ViaSwovSurfaceDestroy): * unichrome/via_video.c: (viaSetupAdaptors): * unichrome/via_xvpriv.h: - Fix Xv surface destruction and re-allocation. (Reported by Cedric Berger). 2005-11-15 Thomas Hellström * unichrome/Imakefile: * unichrome/via_accel.c: (viaTearDownCBuffer), (viaAccelSolidHelper), (viaAccelCopyHelper), (viaExaDownloadFromScreen), (viaExaUploadToScreen): * unichrome/via_driver.c: (VIAScreenInit): - Merged changes in exa_branch revisions 67 to 74. For a detailed ChangeLog, see that branch. 2005-11-09 Thomas Hellström * unichrome/Imakefile: * unichrome/via_accel.c: (viaFlushPCI), (viaFlushDRIEnabled), (viaSetupCBuffer), (viaTearDownCBuffer), (viaInitAgp), (viaEnableVQ), (viaDisableVQ), (viaAccelSetMode), (viaInitialize2DEngine), (viaAccelSync), (viaSetClippingRectangle), (viaDisableClipping), (viaAccelClippingHelper), (viaAccelSolidHelper), (viaAccelTransparentHelper), (viaAccelCopyHelper), (viaSetupForScreenToScreenCopy), (viaSubsequentScreenToScreenCopy), (viaSetupForSolidFill), (viaSubsequentSolidFillRect), (viaSetupForMono8x8PatternFill), (viaSubsequentMono8x8PatternFillRect), (viaSetupForColor8x8PatternFill), (viaSubsequentColor8x8PatternFillRect), (viaSetupForCPUToScreenColorExpandFill), (viaSubsequentScanlineCPUToScreenColorExpandFill), (viaSetupForImageWrite), (viaSubsequentImageWriteRect), (viaSetupForSolidLine), (viaSubsequentSolidTwoPointLine), (viaSubsequentSolidHorVertLine), (viaSetupForDashedLine), (viaSubsequentDashedTwoPointLine), (viaInitXAA), (viaAccelMarkSync), (viaAccelWaitMarker), (viaExaPrepareSolid), (viaExaSolid), (viaExaDoneSolidCopy), (viaExaPrepareCopy), (viaExaCopy), (viaExaDownloadFromScreen), (viaExaUploadToScreen), (viaInitExa), (viaInitAccel), (viaExitAccel), (viaDGABlitRect), (viaDGAFillRect), (viaDGAWaitMarker): * unichrome/via_cursor.c: (VIALoadCursorImage): * unichrome/via_dga.c: * unichrome/via_dri.c: (VIADRIFBInit), (VIADRIScreenInit), (VIADRICloseScreen), (VIADRIFinishScreenInit): * unichrome/via_driver.c: (VIASetup), (VIAPreInit), (VIALeaveVT), (VIAScreenInit), (VIAWriteMode), (VIACloseScreen), (VIASwitchMode): * unichrome/via_driver.h: * unichrome/via_memcpy.c: (viaVidCopyInit): * unichrome/via_memory.c: (VIAFreeLinear), (offScreenLinear), (VIAAllocLinear), (VIAInitLinear): * unichrome/via_priv.h: * unichrome/via_vbe.c: (ViaVbeSetMode): - Merge exa_branch from revision 52 to 67. For a detailed Changelog, check that branch. 2005-11-09 Ivor Hewitt * unichrome/via_driver.c: (VIAPreInit): * unichrome/via_mode.c: (ViaModeDotClockTranslate): - Fix pro-mode and remove pro warning. (Paul Bender) 2005-11-08 Ivor Hewitt * unichrome/via_driver.c: (VIASwitchMode): - Don't kickVblank with no DRI enabled. (Joris van Rantwijk) 2005-11-02 Ivor Hewitt * unichrome/via_mode.c: (ViaGetMemoryBandwidth): * unichrome/via_mode.h: - Give VM800 some bandwidth. 2005-11-01 Thomas Hellström * libxvmc/viaLowLevel.c: (viaDMAInitTimeStamp): * libxvmc/viaLowLevelPro.c: (viaDMAInitTimeStamp), (updateLowLevelBuf): * unichrome/via_drmclient.h: - Fix compilation errors caused by the drm / dri update. (reported by Tarun Kripalani) 2005-10-31 Thomas Hellström * unichrome/via_accel.c: (VIAInitAccel): * unichrome/via_cursor.c: (VIAHWCursorInit): - Second attempt at fixing the hw cursor issue. There were actually two errors involved. 2005-10-31 Thomas Hellström * unichrome/via_xvpriv.h: - Fix stray include left over by previous commit. 2005-10-31 Ivor Hewitt * unichrome/via_id.c: - Mitac 8889 device id. (Daniel Schindler) 2005-10-30 Thomas Hellström * unichrome/via_accel.c: (VIAInitAccel): - Revert the hardware cursor fix since it for some strange reason makes hw cursors white. Need to figure out why. 2005-10-30 Thomas Hellström * unichrome/via_video.c: (viaInitVideo), (viaSetupAdaptors), (nv12cp), (viaDmaBlitImage), (viaPutImage), (nv12Blit): * unichrome/via_xvpriv.h: - Enable DMA Xv image transfers also for PM8X0 / CN400. YV12 to NV12 conversion is still software but now takes place in system memory instead of during transfer to framebuffer memory. CPU usage is much improved on PM8X0. Less so on CN400. Hardware YV12 to NV12 conversion using the blitter was implemented and tested but was very slow, probably due to the fact that blitting only took place one column at a time. Since sync on the 2D engine currently requires a busy-wait, the approach was not only slow, but also CPU-consuming. 2005-10-27 Thomas Hellström * unichrome/via_video.c: (viaExitVideo), (viaSaveVideo), (viaRestoreVideo), (VIAVidAdjustFrame): - Fix server crash when compiled without -DXvExtension. 2005-10-27 Thomas Hellström * unichrome/via_dri.c: (VIADRIRingBufferInit), (VIADRIScreenInit), (VIADRIFinishScreenInit), (VIADRIMapInit): * unichrome/via_dri.h: * unichrome/via_driver.h: * unichrome/via_drm.h: * unichrome/via_memory.c: (VIAFreeLinear), (VIAAllocLinear): * unichrome/via_video.c: (viaInitVideo): * unichrome/via_xvmc.c: (ViaInitXVMC): - Sync dri handling with Xorg. This should hopefully make it run with Mesa 6.4 again. (Luc Verhaegen, Eric Anholt, me) 2005-10-27 Thomas Hellström * unichrome/via_video.c: (viaPutImage): - Make via_video.c compile without -DXF86DRI. Was broken with the dmablit commit. (Reported by Luc Verhaegen) 2005-10-27 Thomas Hellström * unichrome/via_accel.c: (VIAInitAccel): - Fix HW cursor memory allocation. 2005-10-18 Ivor Hewitt * unichrome/via_bandwidth.c: (ViaSetPrimaryFIFO), (ViaSetSecondaryFIFO): * unichrome/via_driver.c: (VIAPreInit): * unichrome/via_id.c: * unichrome/via_id.h: * unichrome/via_swov.c: (VIAVidHWDiffInit): - Remaining device id's lying about. - Remove PM800 conditionals. 2005-10-18 Ivor Hewitt * unichrome/via_driver.c: (VIAPreInit): * unichrome/via_id.c: * unichrome/via_id.h: * unichrome/via_mode.h: - Device id additions. AsRock P4VM800 reported by Mariano Benedettini 2005-09-25 Thomas Hellström * unichrome/via.h: * unichrome/via_dri.c: (VIADRIRingBufferInit), (VIADRIFinishScreenInit): * unichrome/via_dri.h: * unichrome/via_driver.h: * unichrome/via_drm.h: * unichrome/via_priv.h: * unichrome/via_swov.c: (viaWaitHQVFlip), (viaWaitHQVFlipClear), (viaWaitHQVDone), (viaOverlayGetV1V3Format), (viaOverlayGetSrcStartAddress), (viaOverlayGetFetch), (viaSetColorSpace), (ViaSetVidCtl), (AddHQVSurface), (ViaSwovSurfaceCreate), (ViaSwovSurfaceDestroy), (SetFIFO_V3_64or32or32), (SetFIFO_V3_64or32or16), (SetColorKey), (SetChromaKey), (SetHQVFetch), (Upd_Video), (VIAVidUpdateOverlay), (ViaOverlayHide): * unichrome/via_video.c: (DecideOverlaySupport), (viaResetVideo), (viaSaveVideo), (viaExitVideo), (viaInitVideo), (viaReputImage), (viaSetupAdaptors), (viaStopVideo), (Flip), (nv12cp), (viaDmaBlitImage), (viaPutImage), (viaQueryImageAttributes): * unichrome/via_xvmc.c: (ViaInitXVMC): * unichrome/via_xvpriv.h: Big Xv update. - Bring Xv in sync with Xorg, which includes RV15 and RV16 support. - Add support for PCI DMA Xv image transfer. This requires DRM >= 2.7.0, and does not yet work on Unichrome Pro group A, since YV12->NV12 hardware conversion is not yet implemented. 2005-08-13 Thomas Hellström * unichrome/via_swov.c: (ViaSwovSurfaceDestroy): - Destroy video surfaces on video exit / stop. 2005-08-13 Thomas Hellström * unichrome/via_driver.c: (VIAAdjustFrame) - Fix Xv panning also for VBEModes. 2005-08-12 Thomas Hellström * unichrome/via_driver.c: (VIAEnterVT): - Fix segfault on EnterVT when DRI is not enabled. (Joris van Rantwijk) 2005-08-12 Thomas Hellström * unichrome/via_priv.h: * unichrome/via_swov.c: (VIAVidUpdateOverlay): * unichrome/via_video.c: (RegionsEqual), (viaReputImage), (viaSetupAdaptors), (VIAVidAdjustFrame): - Fix Xv panning. Speed up overlay updates on window moves. 2005-08-12 Thomas Hellström * unichrome/via_video.c: (viaExitVideo): - Fix stopvideo for all ports and adaptors. 2005-08-10 Ivor Hewitt * unichrome/Imakefile: * unichrome/via_bios.h: * unichrome/via_ch7xxx.c: (CH7xxxPrintRegs), (ViaCH7xxxDetect), (CH7xxxSave), (CH7xxxRestore), (CH7xxxDACSenseI2C), (CH7xxxDACSense), (CH7011ModeIndex), (CH7019ModeIndex), (CH7xxxModeValid), (CH7xxxModeI2C), (CH7xxxModeCrtc), (CH7xxxTVPower), (CH7019LCDPower), (ViaCH7xxxInit): * unichrome/via_ch7xxx.h: * unichrome/via_driver.c: (VIAPreInit): * unichrome/via_id.c: * unichrome/via_mode.c: (ViaTVDetect), (ViaTVInit): * unichrome/via_vt162x.c: (ViaVT162xDetect), (VT1625DACSenseI2C), (VT1625DACSense), (VT1621ModeIndex), (VT1622ModeIndex), (VT1625ModeValid), (VT1622ModeI2C), (VT1622ModeCrtc), (VT1625Power), (ViaVT162xInit): * unichrome/via_vt162x.h: - Initial steps to incorporating CH7xxx and VT1625 support; merging patches from David George, Philip Prindeville, Terry Lewis. 2005-07-30 Ivor Hewitt * libxvmc/Imakefile: * unichrome/via_mode.c: (ViaGetMemoryBandwidth), (ViaModePrimaryVGA), (ViaModePrimary): * unichrome/via_swov.c: - Merge fixes from xorg for typos in mode setting and sync set 2005-07-18 Ivor Hewitt * unichrome/via_id.c: - Additional card-id. Reported by Philip Prindeville. 2005-07-04 Thomas Hellström * unichrome/via_driver.c: (VIAPreInit), (VIAScreenInit): * unichrome/via_id.c: - Avoid calling DPMS to blank screen during init with VBEModes. - Add another card ID. 2005-06-29 Ivor Hewitt * unichrome/via_id.c: - Additional card-ids. Patch from Xavier Bachelot 2005-06-26 Thomas Hellström * libxvmc/viaLowLevelPro.c: (finish_header_agp), (syncDMA), (syncVideo), (pciFlush), (agpFlush), (uploadHQVDeinterlace), (uploadHQVShadow), (flushXvMCLowLevel), (flushPCIXvMCLowLevel), (viaMpegSetSurfaceStride), (viaVideoSetSWFLipLocked), (viaVideoSWFlipLocked), (viaMpegSetFB), (viaMpegBeginPicture), (viaMpegReset), (viaMpegWriteSlice), (viaVideoSubPictureOffLocked), (viaVideoSubPictureLocked), (viaBlit), (syncXvMCLowLevel), (releaseXvMCLowLevel), (initXvMCLowLevel), (closeXvMCLowLevel): - Clean up the VIDEO_DMA ifdef mess before xorg inclusion. - Make VIDEO_DMA wait for DMA quiescent before flipping, pending proper HQV locking. - Disable VIDEO_DMA to improve latency pending proper HQV locking. 2005-06-17 Thomas Hellström * unichrome/via_mode.c: (ViaSetPrimaryDotclock), (ViaSetSecondaryDotclock), (ViaComputeProDotClock), (ViaModeDotClockTranslate): - Free dotclock on Unichrome Pro. Pls report problems with unstable clocks. - Minor 64-bit fixes. 2005-06-16 Thomas Hellström * unichrome/via_xvmc.c: (ViaXvMCCreateContext), (ViaXvMCCreateSurface), (ViaXvMCCreateSubpicture): * unichrome/via_xvmc.h: - XvMC 64 bit fixes. XvMC now runs on K8M800 64-bit Linux. 2005-06-12 Thomas Hellström * unichrome/via_bios.h: * unichrome/via_i2c.c: * unichrome/via_mode.c: (ViaTVRestore): * unichrome/via_vt162x.c: (VT162xPrintRegs), (ViaVT162xDetect), (VT162xSave), (VT162xRestore), (ViaVT162xInit): - Fix up the vt1623 encoder: Correct device ID, number of registers and most of all reading from the i2cbus it is sitting on. 2005-06-11 Thomas Hellström * unichrome/via_dri.c: (VIADRIScreenInit): - Update via_dri.c to compile with new libdri. 2005-06-01 Thomas Hellström * unichrome/via_mode.c: (ViaModePrimary): * unichrome/via_vt162x.h: - Fix TV-out on Unichrome Pro. To make it work CRT+TV needs to be enabled in BIOS. Still it will hang the machine or possibly only the display chip on X server exit. - Import the 720x576Noscale mode for vt1622A/vt1623 from the Unichrome driver (Terry Barnaby) 2005-05-25 Thomas Hellström * libxvmc/viaLowLevelPro.c: (setHQVDeinterlacing): * libxvmc/viaXvMC.c: * unichrome/via_driver.c: * unichrome/via_mode.c: (ViaModePrimary): * unichrome/via_mode.h: * unichrome/via_vt162x.c: (ViaVT162xDetect): - Updated incorrect field order in libViaXvMCPro. - Fixed warnings about unresolved int10 symbols in the Unichrome driver. - Updated Unichrome Pro dotclocks - also for TV. - Made the driver recognize the vt1623 TV encoder on the EPIA SP13000. - Removed unnecessary define in viaXvMC.c. 2005-05-16 Thomas Hellström * libxvmc/driDrawable.c: (getDRIDrawableInfoLocked): * libxvmc/viaXvMC.c: (releaseContextResources), (XvMCCreateContext): * libxvmc/xf86dri.c: (uniDRIDestroyContext), (uniDRICreateDrawable), (uniDRIDestroyDrawable), (uniDRIGetDrawableInfo): * libxvmc/xf86dri.h: - Changed DRI client function names since they clash with via_dri.so, causing strange problems in, for example, xine. 2005-05-16 Thomas Hellström * unichrome/via_dri.c: (VIASetAgpMode), (VIADRIAgpInit): - Added better AGP mode control to the DDX. 2005-05-11 Thomas Hellström * prepare-ChangeLogSVN.pl: - Added the above file for generation of ChangeLog Entries. 2005-05-11 Thomas Hellström * libxvmc/driDrawable.c: * libxvmc/viaLowLevel.c: (hwlLock), (hwlUnlock), (setAGPSyncLowLevel), (viaDMATimeStampLowLevel), (flushXvMCLowLevel), (flushPCIXvMCLowLevel), (viaMpegSetSurfaceStride), (viaVideoSetSWFLipLocked), (viaVideoSWFlipLocked), (viaMpegSetFB), (viaMpegBeginPicture), (viaMpegReset), (viaMpegWriteSlice), (viaVideoSubPictureOffLocked), (viaVideoSubPictureLocked), (viaBlit), (syncXvMCLowLevel), (initXvMCLowLevel), (setLowLevelLocking), (closeXvMCLowLevel): * libxvmc/viaLowLevel.h: * libxvmc/viaLowLevelPro.c: (initHQVShadow), (setHQVHWDeinterlacing), (setHQVDeblocking), (setHQVStartAddress), (setHQVColorSpaceConversion), (setHQVFetchLine), (setHQVScale), (setHQVSingleDestination), (setHQVDeinterlacing), (setHQVTripleBuffer), (hwlLock), (hwlUnlock), (setAGPSyncLowLevel), (viaDMATimeStampLowLevel), (viaDMAInitTimeStamp), (uploadHQVDeinterlace), (uploadHQVShadow), (flushXvMCLowLevel), (flushPCIXvMCLowLevel), (viaMpegSetSurfaceStride), (viaVideoSetSWFLipLocked), (viaVideoSWFlipLocked), (viaMpegSetFB), (viaMpegBeginPicture), (viaMpegReset), (viaMpegWriteSlice), (viaVideoSubPictureOffLocked), (viaVideoSubPictureLocked), (viaBlit), (syncXvMCLowLevel), (updateLowLevelBuf), (cleanupLowLevelBuf), (initXvMCLowLevel), (setLowLevelLocking), (closeXvMCLowLevel), (computeDownScaling), (computeHQVScaleAndFilter), (setupBackBuffer): * libxvmc/viaXvMC.c: (grabDecoder), (releaseContextResources), (XvMCCreateContext), (XvMCCreateSurface), (XvMCPutSlice2), (XvMCPutSlice), (XvMCPutSurface), (XvMCBeginSurface), (XvMCSyncSurface), (XvMCLoadQMatrix), (XvMCCreateSubpicture), (XvMCSetSubpicturePalette), (XvMCClearSubpicture), (XvMCCompositeSubpicture), (XvMCBlendSubpicture2), (XvMCSyncSubpicture), (XvMCDestroySubpicture), (XvMCFlushSurface), (XvMCGetSurfaceStatus), (XvMCQueryAttributes), (XvMCSetAttribute), (XvMCGetAttribute), (XvMCHideSurface): * libxvmc/viaXvMCPriv.h: * unichrome/via_swov.c: (ViaSwovSurfaceCreate): * unichrome/via_video.c: (viaSetupAdaptors): * unichrome/via_xvpriv.h: - Added ChangeLog to the repository. - Made the DDX update the overlay if a change in surface format occured while it's dimensions are still the same. - Made the XvMCLowLevel struct opaque (void *) and not defined in the header file. This allows for different definitions for different hardware - Added a HQV shadow which holds the HQV context for the Unichrome Pro. The purpose is twofold: 1. If someone else touched the HQV since we last used it, we can upload the whole context. 2. We do not need to read from the HQV, which is bad because we have to halt the DMA engine to do that. - Added and activated mpeg deblocking for Unichrome Pro. - Added a number of HQV utility functions for the upcoming video engine free output. These are not activated yet. (Unichrome Pro.) - Added HW deinterlacing functions. Deactivated, since I cannot see any visible difference. (Unichrome Pro.) xf86-video-openchrome-0.6.0/Makefile.in0000664000175000017500000006217313057513450014555 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 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. 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 = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure COPYING ChangeLog NEWS config.guess \ config.sub depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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_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@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ 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@ 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@ XVMC_CFLAGS = @XVMC_CFLAGS@ XVMC_LIBS = @XVMC_LIBS@ 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@ AUTOMAKE_OPTIONS = foreign SUBDIRS = src man tools EXTRA_DIST = COPYING NEWS README all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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: 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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzip dist-lzma dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ 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 installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog # 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-openchrome-0.6.0/ltmain.sh0000644000175000017500000105204013057513402014314 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 Debian-2.4.2-1ubuntu1 # 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 Debian-2.4.2-1ubuntu1" 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%" test "X$link_all_deplibs" != Xno && libs="$libs $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" 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 elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi 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 ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; 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-openchrome-0.6.0/configure0000775000175000017500000156377313057513442014435 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for xf86-video-openchrome 0.6.0. # # 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 -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 test \$(( 1 + 1 )) = 2 || 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&component=Driver/openchrome $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-openchrome' PACKAGE_TARNAME='xf86-video-openchrome' PACKAGE_VERSION='0.6.0' PACKAGE_STRING='xf86-video-openchrome 0.6.0' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome' 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 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 MISC_MAN_SUFFIX FILE_MAN_SUFFIX LIB_MAN_SUFFIX APP_MAN_SUFFIX DRIVER_MAN_SUFFIX DRIVER_NAME moduledir TOOLS_FALSE TOOLS_TRUE XV_DEBUG_FALSE XV_DEBUG_TRUE DEBUG_FALSE DEBUG_TRUE XVMC_FALSE XVMC_TRUE XVMC_LIBS XVMC_CFLAGS LIBUDEV_LIBS LIBUDEV_CFLAGS DRI_FALSE DRI_TRUE DRI_LIBS DRI_CFLAGS PCIACCESS_LIBS PCIACCESS_CFLAGS HAVE_XEXTPROTO_71_FALSE HAVE_XEXTPROTO_71_TRUE XEXT_LIBS XEXT_CFLAGS XORG_LIBS XORG_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED 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 host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL 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_static enable_shared with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_largefile with_xorg_module_dir enable_debug enable_xv_debug enable_viaregtool with_release_version ' 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 PCIACCESS_CFLAGS PCIACCESS_LIBS DRI_CFLAGS DRI_LIBS LIBUDEV_CFLAGS LIBUDEV_LIBS XVMC_CFLAGS XVMC_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-openchrome 0.6.0 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-openchrome] --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-openchrome 0.6.0:";; 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 --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-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files --enable-debug Enable debugging support [[default=no]] --enable-xv-debug Enable XVideo debugging support [[default=no]] --enable-viaregtool Enable build of registers dumper tool [[default=no]] 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]] --with-release-version=STRING Use release version string in package name 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 PCIACCESS_CFLAGS C compiler flags for PCIACCESS, overriding pkg-config PCIACCESS_LIBS linker flags for PCIACCESS, overriding pkg-config DRI_CFLAGS C compiler flags for DRI, overriding pkg-config DRI_LIBS linker flags for DRI, overriding pkg-config LIBUDEV_CFLAGS C compiler flags for LIBUDEV, overriding pkg-config LIBUDEV_LIBS linker flags for LIBUDEV, overriding pkg-config XVMC_CFLAGS C compiler flags for XVMC, overriding pkg-config XVMC_LIBS linker flags for XVMC, 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-openchrome configure 0.6.0 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_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_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_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_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_preproc LINENO HEADER VAR # ---------------------------------------------- # Tests whether HEADER is present, setting the cache variable VAR accordingly. ac_fn_c_check_header_preproc () { 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. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f conftest.err conftest.i 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_preproc # 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&component=Driver/openchrome ## ## -------------------------------------------------------------------------------------------------- ##" ) | 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-openchrome $as_me 0.6.0, 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 cat >>confdefs.h <<_ACEOF #define VIA_MAJOR_VERSION $(echo $PACKAGE_VERSION | sed -e 's/^\([0-9]*\)\.[0-9]*\.[0-9]*/\1/') _ACEOF cat >>confdefs.h <<_ACEOF #define VIA_MINOR_VERSION $(echo $PACKAGE_VERSION | sed -e 's/^[0-9]*\.\([0-9]*\)\.[0-9]*/\1/') _ACEOF cat >>confdefs.h <<_ACEOF #define VIA_PATCHLEVEL $(echo $PACKAGE_VERSION | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)/\1/') _ACEOF 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. 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-openchrome' VERSION='0.6.0' 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 # 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" # 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 # 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 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 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 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 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* | netbsdelf*-gnu) 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 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 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 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 ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=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* | netbsdelf*-gnu) 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 link_all_deplibs=no 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* | netbsdelf*-gnu) 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 # 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="/lib /usr/lib $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' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_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: # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi # 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-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; DEBUG="$enableval" else DEBUG=no fi # Check whether --enable-xv-debug was given. if test "${enable_xv_debug+set}" = set; then : enableval=$enable_xv_debug; XV_DEBUG="$enableval" else XV_DEBUG=no fi # Check whether --enable-viaregtool was given. if test "${enable_viaregtool+set}" = set; then : enableval=$enable_viaregtool; TOOLS="$enableval" else TOOLS=no fi # Checks for extensions 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 XF86DRI #error XF86DRI 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 XF86DRI is defined" >&5 $as_echo_n "checking if XF86DRI 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 x11" 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 # Checks for pkg-config packages 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 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 xproto fontsproto glproto \$REQUIRED_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "xorg-server xproto fontsproto glproto $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 xproto fontsproto glproto $REQUIRED_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes 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 xproto fontsproto glproto \$REQUIRED_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "xorg-server xproto fontsproto glproto $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 xproto fontsproto glproto $REQUIRED_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes 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 --cflags --libs "xorg-server xproto fontsproto glproto $REQUIRED_MODULES" 2>&1` else XORG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xorg-server xproto fontsproto glproto $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 xproto fontsproto glproto $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` test "x$?" != "x0" && pkg_failed=yes 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` test "x$?" != "x0" && pkg_failed=yes 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 --cflags --libs "xextproto >= 7.0.99.1" 2>&1` else XEXT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "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 # Checks for libraries. # Checks for header files. { $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 save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$XORG_CFLAGS $CPPFLAGS" ac_fn_c_check_header_compile "$LINENO" "xf86Modes.h" "ac_cv_header_xf86Modes_h" "#include \"xorg-server.h\" " if test "x$ac_cv_header_xf86Modes_h" = xyes; then : XMODES=yes else XMODES=no fi 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.11.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.11.0") 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.11.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes 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.11.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.11.0") 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.11.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes 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 --cflags --libs "pciaccess >= 0.11.0" 2>&1` else PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pciaccess >= 0.11.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PCIACCESS_PKG_ERRORS" >&5 HAVE_PCIACCESS="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_PCIACCESS="no" 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; } HAVE_PCIACCESS="yes"; $as_echo "#define HAVE_PCIACCESS 1" >>confdefs.h fi 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.4.4 xf86driproto\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm >= 2.4.4 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.4.4 xf86driproto" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes 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.4.4 xf86driproto\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm >= 2.4.4 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.4.4 xf86driproto" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes 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 --cflags --libs "libdrm >= 2.4.4 xf86driproto" 2>&1` else DRI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm >= 2.4.4 xf86driproto" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DRI_PKG_ERRORS" >&5 DRI="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } DRI="no" 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; } DRI="yes"; $as_echo "#define HAVE_DRI 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build KMS support" >&5 $as_echo_n "checking whether to build KMS support... " >&6; } { $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 $as_echo "#define XF86DRI 1" >>confdefs.h ac_fn_c_check_header_preproc "$LINENO" "damage.h" "ac_cv_header_damage_h" if test "x$ac_cv_header_damage_h" = xyes; then : have_damage_h="yes" else have_damage_h="no" fi if test "$have_damage_h" = yes; then $as_echo "#define DAMAGE 1" >>confdefs.h fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDEV" >&5 $as_echo_n "checking for LIBUDEV... " >&6; } if test -n "$LIBUDEV_CFLAGS"; then pkg_cv_LIBUDEV_CFLAGS="$LIBUDEV_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBUDEV_LIBS"; then pkg_cv_LIBUDEV_LIBS="$LIBUDEV_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUDEV_LIBS=`$PKG_CONFIG --libs "libudev" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes 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 LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev" 2>&1` else LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBUDEV_PKG_ERRORS" >&5 LIBUDEV=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } LIBUDEV=no else LIBUDEV_CFLAGS=$pkg_cv_LIBUDEV_CFLAGS LIBUDEV_LIBS=$pkg_cv_LIBUDEV_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } LIBUDEV=yes fi if test "x$LIBUDEV" = xyes; then $as_echo "#define HAVE_LIBUDEV 1" >>confdefs.h fi case "$host_cpu" in i*86) XVMC=yes ;; amd64*|x86_64*) XVMC=yes ;; *) XVMC=no ;; esac else XVMC="no" fi if test "x$XVMC" = xyes; then for ac_header in pthread.h sys/ioctl.h sys/time.h time.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$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 else XVMC="no"; break fi done pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XVMC" >&5 $as_echo_n "checking for XVMC... " >&6; } if test -n "$XVMC_CFLAGS"; then pkg_cv_XVMC_CFLAGS="$XVMC_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xext xvmc\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11 xext xvmc") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XVMC_CFLAGS=`$PKG_CONFIG --cflags "x11 xext xvmc" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XVMC_LIBS"; then pkg_cv_XVMC_LIBS="$XVMC_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xext xvmc\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11 xext xvmc") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XVMC_LIBS=`$PKG_CONFIG --libs "x11 xext xvmc" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes 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 XVMC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xext xvmc" 2>&1` else XVMC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xext xvmc" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XVMC_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (x11 xext xvmc) were not met: $XVMC_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 XVMC_CFLAGS and XVMC_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 XVMC_CFLAGS and XVMC_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 XVMC_CFLAGS=$pkg_cv_XVMC_CFLAGS XVMC_LIBS=$pkg_cv_XVMC_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build XvMC driver support" >&5 $as_echo_n "checking whether to build XvMC driver support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XVMC" >&5 $as_echo "$XVMC" >&6; } if test x$XVMC = xyes; then XVMC_TRUE= XVMC_FALSE='#' else XVMC_TRUE='#' XVMC_FALSE= fi if test x$DEBUG = xyes; then DEBUG_TRUE= DEBUG_FALSE='#' else DEBUG_TRUE='#' DEBUG_FALSE= fi if test "$DEBUG" = yes; then $as_echo "#define HAVE_DEBUG 1" >>confdefs.h fi if test x$XV_DEBUG = xyes; then XV_DEBUG_TRUE= XV_DEBUG_FALSE='#' else XV_DEBUG_TRUE='#' XV_DEBUG_FALSE= fi if test "$XV_DEBUG" = yes; then $as_echo "#define XV_DEBUG 1" >>confdefs.h fi if test x$TOOLS = xyes; then TOOLS_TRUE= TOOLS_FALSE='#' else TOOLS_TRUE='#' TOOLS_FALSE= fi if test "$TOOLS" = yes; then $as_echo "#define TOOLS 1" >>confdefs.h fi DRIVER_NAME=openchrome $as_echo "#define X_USE_LINEARFB 1" >>confdefs.h $as_echo "#define X_USE_REGION_NULL 1" >>confdefs.h $as_echo "#define X_HAVE_XAAGETROP 1" >>confdefs.h $as_echo "#define X_NEED_I2CSTART 1" >>confdefs.h DRIVER_MAN_SUFFIX="4" 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 --with-release-version was given. if test "${with_release_version+set}" = set; then : withval=$with_release_version; RELEASE_VERSION="$withval" else RELEASE_VERSION="" fi if test "x$RELEASE_VERSION" != "x"; then PACKAGE="$PACKAGE-$RELEASE_VERSION" PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" { $as_echo "$as_me:${as_lineno-$LINENO}: Building with package name set to $PACKAGE" >&5 $as_echo "$as_me: Building with package name set to $PACKAGE" >&6;} fi ac_config_files="$ac_config_files Makefile src/xvmc/Makefile src/Makefile man/Makefile tools/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 "${XVMC_TRUE}" && test -z "${XVMC_FALSE}"; then as_fn_error $? "conditional \"XVMC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then as_fn_error $? "conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XV_DEBUG_TRUE}" && test -z "${XV_DEBUG_FALSE}"; then as_fn_error $? "conditional \"XV_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${TOOLS_TRUE}" && test -z "${TOOLS_FALSE}"; then as_fn_error $? "conditional \"TOOLS\" 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-openchrome $as_me 0.6.0, 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-openchrome config.status 0.6.0 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/xvmc/Makefile") CONFIG_FILES="$CONFIG_FILES src/xvmc/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/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-openchrome-0.6.0/tools/0000775000175000017500000000000013057514157013724 500000000000000xf86-video-openchrome-0.6.0/tools/registers.c0000664000175000017500000011006513033607755016023 00000000000000/* * Copyright 2009 VIA Technologies, Inc. All Rights Reserved. * * 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 WARRANTIES OR REPRESENTATIONS; 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. */ #include #include #include #include #include #include #include #include #include #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) struct bit_desc { uint8_t mask; char *name; }; struct io_index { char *name; struct bit_desc *bit_desc; }; struct io_reg { uint16_t io_port_addr; /* port for address */ uint16_t io_port_data; /* port for address */ char * name; struct io_index index[0xff]; }; struct io_reg attr_regs = { .io_port_addr = 0x3c0, .io_port_data = 0x3c1, .name = "Attribute Controller", .index = { [0x00] = { "Palette 0", }, [0x01] = { "Palette 1", }, [0x02] = { "Palette 2", }, [0x03] = { "Palette 3", }, [0x04] = { "Palette 4", }, [0x05] = { "Palette 5", }, [0x06] = { "Palette 6", }, [0x07] = { "Palette 7", }, [0x08] = { "Palette 8", }, [0x09] = { "Palette 9", }, [0x0a] = { "Palette a", }, [0x0b] = { "Palette b", }, [0x0c] = { "Palette c", }, [0x0d] = { "Palette d", }, [0x0e] = { "Palette e", }, [0x0f] = { "Palette f", }, [0x10] = { "Mode Control", }, [0x11] = { "Overscan Color", }, [0x12] = { "Color Plane Enable", }, [0x13] = { "Horizontal Pixel Panning", }, [0x14] = { "Color Select", }, }, }; struct io_reg graphic_regs = { .io_port_addr = 0x3ce, .io_port_data = 0x3cf, .name = "Graphic Controller", .index = { [0x00] = { "Set / Reset", }, [0x01] = { "Enable Set / Reset", }, [0x02] = { "Color Compare", }, [0x03] = { "Data Rotate", }, [0x04] = { "Read Map Select", }, [0x05] = { "Mode", }, [0x06] = { "Miscellaneous", }, [0x07] = { "Color Don't Care", }, [0x08] = { "Bit Mask", }, /* Extended */ [0x20] = { "Offset Register Control", }, [0x21] = { "Offset Register A", }, [0x22] = { "Offset Register B", }, }, }; static struct bit_desc crtc_32_desc[] = { { 0x01, "Real-Time Flipping", }, { 0x02, "Digital Video Port (DVP) Grammar Correction", }, { 0x04, "Display End Blanking Enable", }, { 0x08, "CRT SYNC Driving Selection (0: Low, 1: High)", }, { 0xE0, "HSYNC Delay Number by VCLK", }, { 0 }, }; struct io_reg crtc_regs = { .io_port_addr = 0x3d4, .io_port_data = 0x3d5, .name = "CRT controller", .index = { /* CRT Controller registers */ [0x00] = { "Horizontal Total", }, [0x01] = { "Horizontal Display End", }, [0x02] = { "Start Horizontal Blank", }, [0x03] = { "End Horizontal Blank", }, [0x04] = { "Start Horizontal Retrace", }, [0x05] = { "End Horizontal Retrace", }, [0x06] = { "Vertical Total", }, [0x07] = { "Overflow", }, [0x08] = { "Preset Row Scan", }, [0x09] = { "Max Scan Line", }, [0x0a] = { "Cursor Start", }, [0x0b] = { "Cursor End", }, [0x0c] = { "Start Address High", }, [0x0d] = { "Start Address Low", }, [0x0e] = { "Cursor Location High", }, [0x0f] = { "Cursor Location Low", }, [0x10] = { "Vertical Retrace Start", }, [0x11] = { "Vertical Retrace End", }, [0x12] = { "Vertical Display End", }, [0x13] = { "Offset", }, [0x14] = { "Underline Location", }, [0x15] = { "Start Vertical Blank", }, [0x16] = { "End Vertical Blank", }, [0x17] = { "CRTC Mode Control", }, [0x18] = { "Line Compare", }, /* CRT Controller Extended Register */ [0x30] = { "Display Fetch Blocking Control", }, [0x31] = { "Half Line Position", }, [0x32] = { "Mode Control", crtc_32_desc, }, [0x33] = { "Hsync Adjuster", }, [0x34] = { "Starting Address Overflow, Bits [23:16]", }, [0x35] = { "Extended Overflow", }, [0x36] = { "Power Management Control 3", }, [0x37] = { "DAC Control", }, [0x38] = { "Signature Data B0", }, [0x39] = { "Signature Data B1", }, [0x3a] = { "Signature Data B2", }, [0x3b] = { "Scratch Pad 2", }, [0x3c] = { "Scratch Pad 3", }, [0x3d] = { "Scratch Pad 4", }, [0x3e] = { "Scratch Pad 5", }, [0x3f] = { "Scratch Pad 6", }, [0x40] = { "Test Mode Control 0", }, [0x43] = { "IGA1 Display Control", }, [0x45] = { "Power Now Indicator Control 3", }, [0x46] = { "Test Mode Control 1", }, [0x47] = { "Test Mode Control 2", }, [0x48] = { "Starting Address Overflow", }, /* Sequencer Extended Registers */ [0x50] = { "Second CRTC Horizontal Total Period", }, [0x51] = { "Second CRTC Horizontal Active Data Period", }, [0x52] = { "Second CRTC Horizontal Blanking Start", }, [0x53] = { "Second CRTC Horizontal Blanking End", }, [0x54] = { "Second CRTC Horizontal Blanking Overflow", }, [0x55] = { "Second CRTC Horizontal Period Overflow", }, [0x56] = { "Second CRTC Horizontal Retrace Start", }, [0x57] = { "Second CRTC Horizontal Retrace End", }, [0x58] = { "Second CRTC Vertical Total Period", }, [0x59] = { "Second CRTC Vertical Active Data Period", }, [0x5a] = { "Second CRTC Vertical Blanking Start", }, [0x5b] = { "Second CRTC Vertical Blanking End", }, [0x5c] = { "Second CRTC Vertical Blanking Overflow", }, [0x5d] = { "Second CRTC Vertical Period Overflow", }, [0x5e] = { "Second CRTC Vertical Retrace Start", }, [0x5f] = { "Second CRTC Vertical Retrace End", }, [0x60] = { "Second CRTC Vertical Status 1", }, [0x61] = { "Second CRTC Vertical Status 2", }, [0x62] = { "Second Display Starting Address Low", }, [0x63] = { "Second Display Starting Address Middle", }, [0x64] = { "Second Display Starting Address High", }, [0x65] = { "Second Display Horizontal Quadword Count", }, [0x66] = { "Second Display Horizontal Offset", }, [0x67] = { "Second Display Color Depth and Horizontal Overflow", }, [0x68] = { "Second Display Queue Depth and Read Threshold", }, [0x69] = { "Second Display Interrupt Enable and Status", }, [0x6a] = { "Second Display Channel and LCD Enable", }, [0x6b] = { "Channel 1 and 2 Clock Mode Selection", }, [0x6c] = { "TV Clock Control", }, [0x6d] = { "Horizontal Total Shadow", }, [0x6e] = { "End Horizontal Blanking Shadow", }, [0x6f] = { "Vertical Total Shadow", }, [0x70] = { "Vertical Display Enable End Shadow", }, [0x71] = { "Vertical Display Overflow Shadow", }, [0x72] = { "Start Vertical Blank Shadow", }, [0x73] = { "End Vertical Blank Shadow", }, [0x74] = { "Vertical Blank Overflow Shadow", }, [0x75] = { "Vertical Retrace Start Shadow", }, [0x76] = { "Vertical Retrace End Shadow", }, [0x77] = { "LCD Horizontal Scaling Factor", }, [0x78] = { "LCD Vertical Scaling Factor", }, [0x79] = { "LCD Scaling Control", }, [0x7a] = { "LCD Scaling Parameter 1", }, [0x7b] = { "LCD Scaling Parameter 2", }, [0x7c] = { "LCD Scaling Parameter 3", }, [0x7d] = { "LCD Scaling Parameter 4", }, [0x7e] = { "LCD Scaling Parameter 5", }, [0x7f] = { "LCD Scaling Parameter 6", }, [0x80] = { "LCD Scaling Parameter 7", }, [0x81] = { "LCD Scaling Parameter 8", }, [0x82] = { "LCD Scaling Parameter 9", }, [0x83] = { "LCD Scaling Parameter 10", }, [0x84] = { "LCD Scaling Parameter 11", }, [0x85] = { "LCD Scaling Parameter 12", }, [0x86] = { "LCD Scaling Parameter 13", }, [0x87] = { "LCD Scaling Parameter 14", }, [0x88] = { "LCD Panel Type", }, [0x8a] = { "LCD Timing Control 1", }, [0x8b] = { "LCD Power Sequence Control 0", }, [0x8c] = { "LCD Power Sequence Control 1", }, [0x8d] = { "LCD Power Sequence Control 2", }, [0x8e] = { "LCD Power Sequence Control 3", }, [0x8f] = { "LCD Power Sequence Control 4", }, [0x90] = { "LCD Power Sequence Control 5", }, [0x91] = { "Software Control Power Sequence", }, [0x92] = { "Read Threshold 2", }, [0x94] = { "Expire Number and Display Queue Extend", }, [0x95] = { "Extend Threshold Bit", }, [0x97] = { "LVDS Channel 2 Function Select 0", }, [0x98] = { "LVDS Channel 2 Function Select 1", }, [0x99] = { "LVDS Channel 1 Function Select 0", }, [0x9a] = { "LVDS Channel 1 Function Select 1", }, [0x9b] = { "Digital Video Port 1 Function Select 0", }, [0x9c] = { "Digital Video Port 1 Function Select 1", }, [0x9d] = { "Power Now Control 2", }, [0x9e] = { "Power Now Control 3", }, [0x9f] = { "Power Now Control 4", }, [0xa0] = { "Horizontal Scaling Initial Value", }, [0xa1] = { "Vertical Scaling Initial Value", }, [0xa2] = { "Horizontal and Vertical Scaling Enable", }, [0xa3] = { "Second Display Starting Address Extended", }, [0xa5] = { "Second LCD Vertical Scaling Factor", }, [0xa6] = { "Second LCD Vertical Scaling Factor", }, [0xa7] = { "Expected IGA1 Vertical Display End", }, [0xa8] = { "Expected IGA1 Vertical Display End", }, [0xa9] = { "Hardware Gamma Control", }, [0xaa] = { "FIFO Depth + Threshold Overflow", }, [0xab] = { "IGA2 Interlace Half Line", }, [0xac] = { "IGA2 Interlace Half Line", }, [0xaf] = { "P-Arbiter Write Expired Number", }, [0xb0] = { "IGA2 Pack Circuit Request Threshold", }, [0xb1] = { "IGA2 Pack Circuit Request High Threshold", }, [0xb2] = { "IGA2 Pack Circuit Request Expire Threshold", }, [0xb3] = { "IGA2 Pack Circuit Control", }, [0xb4] = { "IGA2 Pack Circuit Target Base Address 0", }, [0xb5] = { "IGA2 Pack Circuit Target Base Address 0", }, [0xb6] = { "IGA2 Pack Circuit Target Base Address 0", }, [0xb7] = { "IGA2 Pack Circuit Target Base Address 0", }, [0xb8] = { "IGA2 Pack Circuit Target Line Pitch", }, [0xb9] = { "IGA2 Pack Circuit Target Line Pitch", }, [0xba] = { "V Counter Set Pointer", }, [0xbb] = { "V Counter Set Pointer", }, [0xbc] = { "V Counter Reset Value", }, [0xbd] = { "V Counter Reset Value", }, [0xbe] = { "Frame Buffer Limit Value", }, [0xbf] = { "Frame Buffer Limit Value", }, [0xc0] = { "Expected IGA1 Vertical Display End 1", }, [0xc1] = { "Expected IGA1 Vertical Display End 1", }, [0xc2] = { "Third LCD Vertical Scaling Factor", }, [0xc3] = { "Third LCD Vertical Scaling Factor", }, [0xc4] = { "Expected IGA1 Vertical Display End 2", }, [0xc5] = { "Expected IGA1 Vertical Display End 2", }, [0xc7] = { "Fourth LCD Vertical Scaling Factor", }, [0xc8] = { "IGA2 Pack Circuit Target Base Address 1", }, [0xc9] = { "IGA2 Pack Circuit Target Base Address 1", }, [0xca] = { "IGA2 Pack Circuit Target Base Address 1", }, [0xcb] = { "IGA2 Pack Circuit Target Base Address 1", }, [0xd0] = { "LVDS PLL1 Control", }, [0xd1] = { "LVDS PLL2 Control", }, [0xd2] = { "LVDS Control", }, [0xd3] = { "LVDS Second Power Sequence Control 0", }, [0xd4] = { "LVDS Second Power Sequence Control 1", }, [0xd5] = { "LVDS Texting Mode Control", }, [0xd6] = { "DCVI Control Register 0", }, [0xd7] = { "DCVI Control Register 1", }, [0xd9] = { "Scaling Down Source Data Offset Control", }, [0xda] = { "Scaling Down Source Data Offset Control", }, [0xdb] = { "Scaling Down Source Data Offset Control", }, [0xdc] = { "Scaling Down Vertical Scale Control", }, [0xdd] = { "Scaling Down Vertical Scale Control", }, [0xde] = { "Scaling Down Vertical Scale Control", }, [0xdf] = { "Scaling Down Vertical Scale Control", }, [0xe0] = { "Scaling Down Destination FB Starting Addr 0", }, [0xe1] = { "Scaling Down Destination FB Starting Addr 0", }, [0xe2] = { "Scaling Down Destination FB Starting Addr 0", }, [0xe3] = { "Scaling Down Destination FB Starting Addr 0", }, [0xe4] = { "Scaling Down SW Source FB Stride", }, [0xe5] = { "Scaling Down Destination FB Starting Addr 1", }, [0xe6] = { "Scaling Down Destination FB Starting Addr 1", }, [0xe7] = { "Scaling Down Destination FB Starting Addr 1", }, [0xe8] = { "Scaling Down Destination FB Starting Addr 1", }, [0xe9] = { "Scaling Down Destination FB Starting Addr 2", }, [0xea] = { "Scaling Down Destination FB Starting Addr 2", }, [0xeb] = { "Scaling Down Destination FB Starting Addr 2", }, [0xec] = { "IGA1 Down Scaling Destination Control", }, [0xf0] = { "Snapshot Mode - Starting Address of Disp Data", }, [0xf1] = { "Snapshot Mode - Starting Address of Disp Data", }, [0xf2] = { "Snapshot Mode - Starting Address of Disp Data", }, [0xf3] = { "Snapshot Mode Control", }, [0xf4] = { "Snapshot Mode Control", }, [0xf5] = { "Snapshot Mode Control", }, [0xf6] = { "Snapshot Mode Control", }, }, }; static struct bit_desc seq_19_desc[] = { { 0x01, "CPU Interface Clock Control", }, { 0x02, "Display Interface Clock Control", }, { 0x04, "MC Interface Clock Control", }, { 0x08, "Typical Arbiter Interface Clock Control", }, { 0x10, "AGP Interface Clock Control", }, { 0x20, "P-Arbiter Interface Clock Control", }, { 0x40, "MIU/AGP Interface Clock Control", }, { 0 }, }; static struct bit_desc seq_1a_desc[] = { { 0x01, "LUT Shadow Access", }, { 0x04, "PCI Burst Write Wait State Select (0: 0 Wait state, 1: 1 Wait state)", }, { 0x08, "Extended Mode Memory Access Enable (0: Disable, 1: Enable)", }, { 0x40, "Software Reset (0: Default value, 1: Reset)", }, { 0x80, "Read Cache Enable (0: Disable, 1: Enable)", }, { 0 }, }; static struct bit_desc seq_1b_desc[] = { { 0x01, "Primary Display's LUT Off", }, { 0x18, "Primary Display Engine VCK Gating", }, { 0x60, "Secondary Display Engine LCK Gating", }, { 0 }, }; static struct bit_desc seq_1e_desc[] = { { 0x01, "ROC ECK", }, { 0x02, "Replace ECK by MCK", }, { 0x08, "Spread Spectrum", }, { 0x30, "DVP1 Power Control", }, { 0xc0, "VCP Power Control", }, { 0 }, }; static struct bit_desc seq_2a_desc[] = { { 0x03, "LVDS Channel 1 Pad Control" }, { 0x0c, "LVDS Channel 2 Pad Control" }, { 0x40, "Spread Spectrum Type FIFO" }, { 0 }, }; static struct bit_desc seq_2b_desc[] = { { 0x01, "MSI Pending IRQ Re-trigger", }, { 0x02, "CRT Hot Plug Detect Enable", }, { 0x04, "CRT Sense IRQ status", }, { 0x08, "CRT Sense IRQ enable", }, { 0x10, "LVDS Sense IRQ status", }, { 0x20, "LVDS Sense IRQ enable", }, { 0 }, }; static struct bit_desc seq_2d_desc[] = { { 0x03, "ECK Pll Power Control", }, { 0x0c, "LCK PLL Power Control", }, { 0x30, "VCK PLL Power Control", }, { 0xc0, "E3_ECK_N Selection", }, { 0 }, }; static struct bit_desc seq_2e_desc[] = { { 0x03, "Video Playback Engine V3/V4 Gated Clock VCK", }, { 0x0c, "PCI Master / DMA Gated Clock ECK/CPUCK", }, { 0x30, "Video Processor Gated Clock ECK", }, { 0xc0, "Capturer Gated Clock ECK", }, { 0 }, }; static struct bit_desc seq_3c_desc[] = { { 0x01, "AGP Bus Pack Door AGP3 Enable", }, { 0x02, "Switch 3 PLLs to Prime Output", }, { 0x04, "LCDCK PLL Locked Detect", }, { 0x08, "VCK PLL Locked Detect", }, { 0x10, "ECL PLL Locked Detect", }, { 0x60, "PLL Frequency Division Select for Testing", }, { 0 }, }; static struct bit_desc seq_3f_desc[] = { { 0x03, "Video Clock Control (Gated ECK)", }, { 0x0c, "2D Clock Control (Gated ECK/CPUCK)", }, { 0x30, "3D Clock Control (Gated ECK)", }, { 0xc0, "CR Clock Control (Gated ECK)", }, { 0 }, }; static struct bit_desc seq_40_desc[] = { { 0x01, "Reset ECK PLL", }, { 0x02, "Reset VCK PLL", }, { 0x04, "Reset LCDCK PLL", }, { 0x08, "LVDS Interrupt Method", }, { 0x30, "Free Run ECK Frequency within Idle Mode", }, { 0x80, "CRT Sense Enable", }, { 0 }, }; static struct bit_desc seq_43_desc[] = { { 0x01, "Notebook Used Flag", }, { 0x04, "Typical Channel 1 Arbiter Read Back Data Overwrite Flag", }, { 0x08, "Typical Channel 0 Arbiter Read Back Data Overwrite Flag", }, { 0x10, "IGA1 Display FIFO Underflow Flag", }, { 0x20, "IGA2 Display FIFO Underflow Flag", }, { 0x40, "Windows Media Video Enable Flag", }, { 0x80, "Advance Video Enable Flag", }, { 0 }, }; static struct bit_desc seq_4e_desc[] = { { 0x01, "HQV/Video/Capture Engine Reset", }, { 0x02, "HQV/Video/Capture Register Reset", }, { 0x04, "2D Engine Reset", }, { 0x08, "2D Register Reset", }, { 0x10, "3D Engine Reset", }, { 0x20, "3D Register Reset", }, { 0x40, "CR Engine Reset", }, { 0x80, "CR Register Reset", }, { 0 }, }; static struct bit_desc seq_59_desc[] = { { 0x01, "GFX-NM AGP Dynamic Clock Enable", }, { 0x02, "GFX-NM GMINT Channel 0 Dynamic Clock Enable", }, { 0x04, "GFX-NM GMINT Channel 1 Dynamic Clock Enable", }, { 0x08, "GFX-NM PCIC Dynamic Clock Enable", }, { 0x10, "GFX-NM IGA Dynamic Clock Enable", }, { 0x20, "IGA Low Threshold Enable", }, { 0x80, "IGA1 Enable", }, { 0 }, }; static struct bit_desc seq_5b_desc[] = { { 0x01, "LVDS1 Used IGA2 Source", }, { 0x02, "LBDS1 Used IGA1 Source", }, { 0x04, "LVDS0 Used IGA2 Source", }, { 0x08, "LVDS1 Used IGA1 Source", }, { 0x10, "DAC0 Used IGA2 Source", }, { 0x20, "DAC0 Used IGA1 Source", }, { 0x40, "DAC0 User is TV", }, { 0x80, "DCVI Source Selection is TV", }, { 0 }, }; static struct bit_desc seq_5c_desc[] = { { 0x01, "DVP1 Used IGA2 Source", }, { 0x02, "DVP1 Used IGA1 Source", }, { 0x10, "DAC1 Used IGA2 Source", }, { 0x20, "DAC1 Used IGA1 Source", }, { 0x40, "DAC1 User is TV", }, { 0 }, }; static struct bit_desc seq_76_desc[] = { { 0x01, "Backlight Control Enable", }, { 0 }, }; struct io_reg sequencer_regs = { .io_port_addr = 0x3c4, .io_port_data = 0x3c5, .name = "Sequencer", .index = { /* Sequencer Registers */ [0x00] = { "Reset", }, [0x01] = { "Clocking Mode", }, [0x02] = { "Map Mask", }, [0x03] = { "Character Map Select", }, [0x04] = { "Memory Mode", }, /* Extended Sequencer Registers */ [0x10] = { "Extended Register Unlock", }, [0x11] = { "Configuration 0", }, [0x12] = { "Configuration 1", }, [0x13] = { "Configuration 2 (DVP1 strapping)", }, [0x14] = { "Frame Buffer Size Control", }, [0x15] = { "Display Mode Control", }, [0x16] = { "Display FIFO Threshold Control", }, [0x17] = { "Display FIFO Control", }, [0x18] = { "Display Arbiter Control 0", }, [0x19] = { "Power Management", seq_19_desc, }, [0x1a] = { "PCI Bus Control", seq_1a_desc, }, [0x1b] = { "Power Management Control 0", seq_1b_desc, }, [0x1c] = { "Horizontal Display Fetch Count Data", }, [0x1d] = { "Horizontal Display Fetch Count Control", }, [0x1e] = { "Power Management Control", seq_1e_desc, }, /* 1f: reserved */ [0x20] = { "Typical Arbiter Control 0", }, [0x21] = { "Typical Arbiter Control 1", }, [0x22] = { "Display Arbiter Control 1", }, [0x26] = { "IIC Serial Port Control 0", }, [0x2a] = { "Power Management Control 5", seq_2a_desc, }, [0x2b] = { "LVDS Interrupt Control", seq_2b_desc, }, [0x2c] = { "General Purpose I/O Port", }, [0x2d] = { "Power Management Control 1", seq_2d_desc, }, [0x2e] = { "Power Management Control 2", seq_2e_desc, }, [0x31] = { "IIC Serial Port Control 1", }, [0x35] = { "Subsystem Vendor ID Low", }, [0x36] = { "Subsystem Vendor ID High", }, [0x37] = { "Subsystem ID Low", }, [0x38] = { "Subsystem ID High", }, [0x39] = { "BIOS Reserved Register 0", }, [0x3a] = { "BIOS Reserved Register 1", }, [0x3b] = { "PCI Revision ID Back Door", }, [0x3c] = { "Miscellaneous", seq_3c_desc, }, [0x3d] = { "General Purpose I/O Port", }, [0x3e] = { "Miscellaneous Register for AGP Mux", }, [0x3f] = { "Power Management Control 2", seq_3f_desc, }, [0x40] = { "PLL Control", seq_40_desc, }, [0x41] = { "Typical Arbiter Control 1", }, [0x42] = { "Typical Arbiter Control 2", }, [0x43] = { "Graphics Bonding Option", seq_43_desc, }, [0x44] = { "VCK Clock Synthesizer Value 0", }, [0x45] = { "VCK Clock Synthesizer Value 1", }, [0x46] = { "VCK Clock Synthesizer Value 2", }, [0x47] = { "ECK Clock Synthesizer Value 0", }, [0x48] = { "ECK Clock Synthesizer Value 1", }, [0x49] = { "ECK Clock Synthesizer Value 2", }, [0x4a] = { "LDCK Clock Synthesizer Value 0", }, [0x4b] = { "LDCK Clock Synthesizer Value 1", }, [0x4c] = { "LDCK Clock Synthesizer Value 2", }, [0x4d] = { "Preemptive Arbiter Control", }, [0x4e] = { "Software Reset Control", seq_4e_desc, }, [0x4f] = { "CR Gating Clock Control", }, [0x50] = { "AGP Control", }, [0x51] = { "Display FIFO Control 1", }, [0x52] = { "Integrated TV Shadow Register Control", }, [0x53] = { "DAC Sense Control 1", }, [0x54] = { "DAC Sense Control 2", }, [0x55] = { "DAC Sense Control 3", }, [0x56] = { "DAC Sense Control 4", }, [0x57] = { "Display FIFO Control 2", }, [0x58] = { "GFX Power Control 1", }, [0x59] = { "GFX Power Control 2", seq_59_desc, }, [0x5a] = { "PCI Bus Control 2", }, [0x5b] = { "Device Used Status 0", seq_5b_desc, }, [0x5c] = { "Device Used Status 1", seq_5c_desc, }, [0x5d] = { "Timer Control", }, [0x5e] = { "DAC Control 2", }, [0x60] = { "I2C Mode Control", }, [0x61] = { "I2C Host Address", }, [0x62] = { "I2C Host Data", }, [0x63] = { "I2C Host Control", }, [0x64] = { "I2C Status", }, [0x65] = { "Power Management Control 6", }, [0x66] = { "GTI Control 0", }, [0x67] = { "GTI Control 1", }, [0x68] = { "GTI Control 2", }, [0x69] = { "GTI Control 3", }, [0x6a] = { "GTI Control 4", }, [0x6b] = { "GTI Control 5", }, [0x6c] = { "GTI Control 6", }, [0x6d] = { "GTI Control 7", }, [0x6e] = { "GTI Control 8", }, [0x6f] = { "GTI Control 9", }, [0x70] = { "GARB Control 0", }, [0x71] = { "Typical Arbiter Control 2", }, [0x72] = { "Typical Arbiter Control 3", }, [0x73] = { "Typical Arbiter Control 4", }, [0x74] = { "Typical Arbiter Control 5", }, [0x75] = { "Typical Arbiter Control 6", }, [0x76] = { "Backlight Control 1", seq_76_desc, }, [0x77] = { "Backlight Control 2", }, [0x78] = { "Backlight Control 3", }, }, }; static uint8_t readb_idx_reg(uint16_t port, uint8_t index) { outb(index, port-1); return inb(port); } static void writeb_idx_reg(uint16_t port, uint8_t index, uint8_t val) { outb(index, port-1); outb(val, port); } static void writeb_idx_mask(uint16_t reg, uint8_t idx, uint8_t val, uint8_t mask) { uint8_t tmp; tmp = readb_idx_reg(reg, idx); tmp &= ~ mask; tmp |= (val & mask); writeb_idx_reg(reg, idx, tmp); } struct io_reg *io_regs[] = { //&attr_regs, &sequencer_regs, &graphic_regs, &crtc_regs, NULL }; struct half_mode { uint16_t total; uint16_t active; uint16_t blank_start; uint16_t blank_end; uint16_t retr_start; uint16_t retr_end; int n_sync; }; struct mode { struct half_mode h; struct half_mode v; uint32_t addr_start; uint8_t bpp; uint16_t horiz_quad_count; uint16_t horiz_offset; }; static int get_mode(struct mode *m, int secondary) { uint8_t val; memset(m, 0, sizeof(*m)); if (!secondary) { m->h.total = readb_idx_reg(0x3d5, 0x00); m->h.active = readb_idx_reg(0x3d5, 0x01); m->h.blank_start = readb_idx_reg(0x3d5, 0x02); m->h.blank_end = readb_idx_reg(0x3d5, 0x03) & 0x1f; m->h.retr_start = readb_idx_reg(0x3d5, 0x04); m->h.retr_end = readb_idx_reg(0x3d5, 0x05) & 0x1f; m->v.total = readb_idx_reg(0x3d5, 0x06) + 2; m->addr_start = readb_idx_reg(0x3d5, 0x0d); m->addr_start |= readb_idx_reg(0x3d5, 0x0c) << 8; m->v.retr_start = readb_idx_reg(0x3d5, 0x10); m->v.retr_end = readb_idx_reg(0x3d5, 0x11) & 0x0f; m->v.active = readb_idx_reg(0x3d5, 0x12) + 1; m->horiz_offset = readb_idx_reg(0x3d5, 0x13); m->v.blank_start = readb_idx_reg(0x3d5, 0x15) + 1; m->v.blank_end = readb_idx_reg(0x3d5, 0x16) + 1; /* overflow register 0x07 */ val = readb_idx_reg(0x3d5, 0x07); m->v.total |= ((val >> 0) & 0x1) << 8; m->v.active |= ((val >> 1) & 0x1) << 8; m->v.retr_start |= ((val >> 2) & 0x1) << 8; m->v.blank_start |= ((val >> 3) & 0x1) << 8; /* line compare */ m->v.total |= ((val >> 5) & 0x1) << 9; m->v.active |= ((val >> 6) & 0x1) << 9; m->v.retr_start |= ((val >> 7) & 0x1) << 9; val = readb_idx_reg(0x3d5, 0x09); m->v.blank_start |= ((val >> 5) & 0x1) << 9; val = readb_idx_reg(0x3d5, 0x33); m->h.retr_start |= ((val >> 4) & 0x1) << 8; m->h.blank_end |= ((val >> 5) & 0x1) << 6; val = readb_idx_reg(0x3d5, 0x34); m->addr_start |= val << 16; val = readb_idx_reg(0x3d5, 0x35); m->v.total |= ((val >> 0) & 0x1) << 10; m->v.retr_start |= ((val >> 1) & 0x1) << 10; m->v.active |= ((val >> 2) & 0x1) << 10; m->v.blank_start |= ((val >> 3) & 0x1) << 10; //line_comp |= ((val >> 4) & 0x1) << 10; m->horiz_offset |= ((val >> 5) & 0x7) << 8; val = readb_idx_reg(0x3d5, 0x36); m->h.total |= ((val >> 3) & 0x1) << 8; val = readb_idx_reg(0x3d5, 0x48); m->addr_start |= ((val >> 0) & 0x1f) << 24; val = readb_idx_reg(0x3c5, 0x15); switch ((val >> 2) & 0x3) { case 0: m->bpp = 8; break; case 1: m->bpp = 16; break; case 2: m->bpp = 30; break; case 3: m->bpp = 32; break; } val = inb(0x3cc); if (val & 0x40) m->h.n_sync; if (val & 0x80) m->v.n_sync; /* add some weird multipliers and offsets */ m->h.total = (m->h.total + 5) << 3; m->h.active = (m->h.active + 1) << 3; m->h.blank_start = (m->h.blank_start + 1) << 3; m->h.blank_end = (m->h.blank_end + 1) << 3; m->h.retr_start = (m->h.retr_start << 3); m->h.retr_end = (m->h.retr_end << 3); } else { /* horizontal */ m->h.total = readb_idx_reg(0x3d5, 0x50) + 1; m->h.active = readb_idx_reg(0x3d5, 0x51) + 1; m->h.blank_start = readb_idx_reg(0x3d5, 0x52) + 1; m->h.blank_end = readb_idx_reg(0x3d5, 0x53) + 1; m->h.retr_start = readb_idx_reg(0x3d5, 0x56); m->h.retr_end = readb_idx_reg(0x3d5, 0x57); /* add blanking overflow */ val = readb_idx_reg(0x3d5, 0x54); m->h.blank_start |= ((val >> 0) & 0x7) << 8; m->h.blank_end |= ((val >> 3) & 0x7) << 8; m->h.retr_start |= ((val >> 6) & 0x3) << 8; /* add period overflow */ val = readb_idx_reg(0x3d5, 0x55); m->h.total |= ((val >> 0) & 0xf) << 8; m->h.active |= ((val >> 4) & 0x7) << 8; /* vertical */ m->v.total = readb_idx_reg(0x3d5, 0x58) + 1; m->v.active = readb_idx_reg(0x3d5, 0x59) + 1; m->v.blank_start = readb_idx_reg(0x3d5, 0x5a) + 1; m->v.blank_end = readb_idx_reg(0x3d5, 0x5b) + 1; m->v.retr_start = readb_idx_reg(0x3d5, 0x5e); val = readb_idx_reg(0x3d5, 0x5f); m->v.retr_end = val & 0x1f; m->v.retr_start |= (val >> 5) << 8; /* add blanking overflow */ val = readb_idx_reg(0x3d5, 0x5c); m->v.blank_start |= ((val >> 0) & 0x7) << 8; m->v.blank_end |= ((val >> 3) & 0x7) << 8; m->h.retr_end |= ((val >> 6) & 0x1) << 8; m->h.retr_start |= ((val >> 7) & 0x1) << 10; /* add period overflow */ val = readb_idx_reg(0x3d5, 0x5d); m->v.total |= ((val >> 0) & 0x7) << 8; m->v.active |= ((val >> 3) & 0x7) << 8; m->h.blank_end |= ((val >> 6) & 0x7) << 11; m->h.retr_start |= ((val >> 7) & 0x7) << 11; /* puzzle together the start address */ val = readb_idx_reg(0x3d5, 0x62); m->addr_start = (val >> 1) << 3; val = readb_idx_reg(0x3d5, 0x63); m->addr_start |= (val << 10); val = readb_idx_reg(0x3d5, 0x64); m->addr_start |= (val << 18); val = readb_idx_reg(0x3d5, 0xa3); m->addr_start |= (val & 0x7) << 26; m->horiz_quad_count = readb_idx_reg(0x3d5, 0x65); m->horiz_offset = readb_idx_reg(0x3d5, 0x66) << 3; val = readb_idx_reg(0x3d5, 0x67); m->horiz_offset |= ((val >> 0) & 0x3) << 11; m->horiz_quad_count |= ((val >> 2) & 0x3) << 8; switch (val >> 6) { case 0: m->bpp = 8; break; case 1: m->bpp = 16; break; case 2: m->bpp = 30; break; case 3: m->bpp = 32; break; } } } static void dump_scaling(void) { u_int32_t h_scaling, v_scaling; uint8_t val; val = readb_idx_reg(0x3d5, 0x79); if (val & 0x01) { printf("Panel Scaling enabled, mode %s\n", val & 0x02 ? "Interpolation" : "Duplication"); v_scaling = (val >> 3) & 0x1; h_scaling = ((val >> 4) & 0x3) << 10; v_scaling |= ((val >> 6) & 0x3) << 9; val = readb_idx_reg(0x3d5, 0x77); h_scaling |= val << 2; val = readb_idx_reg(0x3d5, 0x78); v_scaling |= val << 1; val = readb_idx_reg(0x3d5, 0x9f); h_scaling |= val & 0x3; printf("Scaling Factors: horizontal=%u, vertical=%u\n", h_scaling, v_scaling); } else printf("Panel Scaling disabled\n"); } static void dump_registers(struct io_reg *ior) { uint8_t idx; printf("%s register dump (IO Port address: 0x%03x): \n", ior->name, ior->io_port_addr); for (idx = 0; idx < 0xff; idx++) { uint8_t val; struct bit_desc *desc = ior->index[idx].bit_desc; if (!ior->index[idx].name) continue; outb(idx, ior->io_port_addr); val = inb(ior->io_port_data); printf(" %03x.%02x = 0x%02x (%s)\n", ior->io_port_data, idx, val, ior->index[idx].name); if (!desc) continue; while (desc->mask) { printf(" 0x%02x %s: 0x%02x\n", desc->mask, desc->name, val & desc->mask); desc++; } } printf("\n"); } enum pll { PLL_VCK, PLL_ECK, PLL_LDCK, }; #define REF_FREQ 14318 static void get_vck_clock(enum pll pll, unsigned int f_ref_khz) { uint8_t reg_ofs = 0; uint8_t val; unsigned int dm, dtz, dr, dn; unsigned long f_vco, f_out; char *name; switch (pll) { case PLL_VCK: reg_ofs = 0; name = "VCK"; break; case PLL_ECK: reg_ofs = 3; name = "ECK"; break; case PLL_LDCK: reg_ofs = 6; name = "LDCK"; break; default: return; } dm = readb_idx_reg(0x3c5, 0x44 + reg_ofs); val = readb_idx_reg(0x3c5, 0x45 + reg_ofs); dtz = val & 0x1; dr = (val >> 3) & 0x7; dm |= ((val >> 6) & 0x3) << 8; val = readb_idx_reg(0x3c5, 0x46 + reg_ofs); dtz |= (val & 0x1) << 1; dn = val >> 1; printf("%s PLL: dm=%u, dtx=%u, dr=%u, dn=%u ", name, dm, dtz, dr, dn); f_vco = f_ref_khz * (dm + 2) / (dn + 2); if (dr) f_out = f_ref_khz * (dm + 2) / ( (dn + 2) * (2 * dr) ); else f_out = 0; printf("%s Fvco=%lu kHz, Fout=%lu kHz\n", name, f_vco, f_out); } struct gpio_state { u_int32_t mode_output; u_int32_t pin_status; u_int32_t output_bit; u_int32_t alt_function; }; static int get_gpio_state(struct gpio_state *s) { uint8_t val; memset(s, 0, sizeof(*s)); val = readb_idx_reg(0x3c5, 0x2c); if (val & 0x01) s->alt_function |= (3 << 2); if (val & 0x04) s->pin_status |= (1 << 3); if (val & 0x08) s->pin_status |= (1 << 2); if (val & 0x10) s->output_bit |= (1 << 3); if (val & 0x20) s->output_bit |= (1 << 2); if (val & 0x40) s->mode_output |= (1 << 3); if (val & 0x80) s->mode_output |= (1 << 2); val = readb_idx_reg(0x3c5, 0x3d); if (val & 0x01) s->alt_function |= (3 << 4); if (val & 0x04) s->pin_status |= (1 << 5); if (val & 0x08) s->pin_status |= (1 << 4); if (val & 0x10) s->output_bit |= (1 << 5); if (val & 0x20) s->output_bit |= (1 << 4); if (val & 0x40) s->mode_output |= (1 << 5); if (val & 0x80) s->mode_output |= (1 << 4); } static void dump_gpio_state(const char *pfx, const struct gpio_state *gs) { unsigned int i; for (i = 2; i < 6; i++) { printf("%sGPIO %u: function=", pfx, i); if (gs->alt_function & (1 << i)) printf("alternate\n"); else if (gs->mode_output & (1 << i)) printf("output(%u)\n", gs->output_bit & (1 <pin_status & (1 << i) ? 1 : 0); } } static void dump_all_registers(void) { int i; for (i = 0; i < ARRAY_SIZE(io_regs); i++) { struct io_reg *reg = io_regs[i]; if (!reg) break; dump_registers(reg); } } static void dump_mode(const char *pfx, struct mode *m) { printf("%sH total=%u, active=%u, blank (%u-%u), sync(%u-%u)\n", pfx, m->h.total, m->h.active, m->h.blank_start, m->h.blank_end, m->h.retr_start, m->h.retr_end); printf("%sV total=%u, active=%u, blank (%u-%u), sync(%u-%u)\n", pfx, m->v.total, m->v.active, m->v.blank_start, m->v.blank_end, m->v.retr_start, m->v.retr_end); printf("base_addr=0x%08x, bpp=%d\n", m->addr_start, m->bpp); } static void dump_sl(const char *pfx) { uint8_t val; unsigned int sl_size_mb; unsigned long rtsf_in_sl_addr; uint64_t sl_in_mem_addr, temp; val = readb_idx_reg(0x3c5, 0x68); switch (val) { case 0: sl_size_mb = 512; break; case 0x80: sl_size_mb = 256; break; case 0xc0: sl_size_mb = 128; break; case 0xe0: sl_size_mb = 64; break; case 0xf0: sl_size_mb = 32; break; case 0xf8: sl_size_mb = 16; break; case 0xfc: sl_size_mb = 8; break; case 0xfe: sl_size_mb = 4; break; case 0xff: sl_size_mb = 2; break; } rtsf_in_sl_addr = readb_idx_reg(0x3c5, 0x6a) << 12; rtsf_in_sl_addr |= readb_idx_reg(0x3c5, 0x6b) << 20; val = readb_idx_reg(0x3c5, 0x6c); rtsf_in_sl_addr |= (val & 0x1) << 28; sl_in_mem_addr = readb_idx_reg(0x3c5, 0x6d) << 21; sl_in_mem_addr |= readb_idx_reg(0x3c5, 0x6d) << 29; temp = (readb_idx_reg(0x3c5, 0x6d) & 0x7f); sl_in_mem_addr |= (temp << 37); printf("%sSL in System memory: 0x%llx, RTSF in SL: 0x%lx\n", pfx, sl_in_mem_addr, rtsf_in_sl_addr); } static int dump_lvds(void) { uint8_t val; char *mode; writeb_idx_mask(0x3c5, 0x5a, 0x01, 0x01); val = readb_idx_reg(0x3c5, 0x13); switch (val >> 6) { case 0: mode = "LVDS1 + LVDS2"; break; case 2: mode = "One Dual LVDS Channel"; break; default: mode = "RESERVED"; break; } printf("LVDS Seq Mode: %s\n", mode); val = readb_idx_reg(0x3d5, 0xd2); switch ((val >> 4) & 3) { case 0: mode = "LVDS1 + LVDS2"; break; case 2: mode = "One Dual LVDS Channel"; break; default: mode = "RESERVED"; break; } printf("LVDS CRT Mode: %s\n", mode); printf("LVDS Channel 1 Format %s, Power %s\n", val & 2 ? "OpenLDI":"SPWG", val & 0x80 ? "Down" : "Up"); printf("LVDS Channel 2 Format %s, Power %s\n", val & 1 ? "OpenLDI":"SPWG", val & 0x40 ? "Down" : "Up"); } static int parse_ioreg(uint16_t *reg, uint8_t *index, char *str) { char *dot; char buf[255]; memset(buf, 0, sizeof(*buf)); strncpy(buf, str, sizeof(buf)-1); dot = strchr(buf, '.'); if (!dot) return -EINVAL; *dot = '\0'; *reg = strtoul(buf, NULL, 16); *index = strtoul(dot+1, NULL, 16); return 0; } static void reset_mode(int secondary) { if (!secondary) { writeb_idx_mask(0x3d5, 0x11, 0x00 , 0x80); writeb_idx_mask(0x3d5, 0x03, 0x80 , 0x80); } else { } } static void unlock_registers(void) { writeb_idx_reg(0x3c5, 0x10, 0x01); /* unlock extended */ writeb_idx_mask(0x3d5, 0x47, 0x00, 0x01); /* unlock CRT */ writeb_idx_mask(0x3d5, 0x03, 0x80, 0x80); /* disable EGA lightpen */ writeb_idx_mask(0x3d5, 0x11, 0x00, 0x80); /* unlock 0..7 */ } static void usage(void) { printf("Usage :\n"); printf("-h | --help : Display this usage message.\n"); printf("-d | --dump : Dump all registers.\n"); printf("-p | --pll : Display PLL.\n"); printf("-m | --mode : Display modes.\n"); printf("-r | --read : Read register. Example : $0 -r 3d5.17\n"); printf("-w | --write : Write register. Example : $0 -w 3d5.17 0xa3\n"); printf("-g | --gpio : Display GPIO state.\n"); } int main(int argc, char **argv) { struct mode m; struct gpio_state gs; int rc, option_index = 0; printf("via-chrome-tool (C) 2009 by VIA Technologies, Inc.\n"); printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n"); rc = iopl(3); if (rc < 0) { perror("iopl"); printf("Need root privileges.\n"); exit(1); } if (argc <= 1) { usage(); exit(1); } unlock_registers(); while (1) { int c; uint16_t reg; uint8_t index; unsigned long val; static struct option long_options[] = { { "help", 0, 0, 'h' }, { "dump", 0, 0, 'd' }, { "pll", 0, 0, 'p' }, { "mode", 0, 0, 'm' }, { "read", 1, 0, 'r' }, { "write", 1, 0, 'w' }, { "gpio", 1, 0, 'g' }, }; c = getopt_long(argc, argv, "hdpmr:w:g", long_options, &option_index); if (c == -1) { break; } switch (c) { case 'h': usage(); exit(1); case 'd': dump_all_registers(); break; case 'p': get_vck_clock(PLL_VCK, REF_FREQ); get_vck_clock(PLL_ECK, REF_FREQ); get_vck_clock(PLL_LDCK, REF_FREQ); break; case 'm': dump_sl(""); printf("Primary Display:\n"); get_mode(&m, 0); dump_mode(" ", &m); printf("\n"); printf("Secondary Display:\n"); get_mode(&m, 1); dump_mode(" ", &m); printf("\n"); dump_scaling(); printf("\n"); dump_lvds(); printf("\n"); break; case 'r': parse_ioreg(®, &index, optarg); printf("%03x.%02x = 0x%02x\n", reg, index, readb_idx_reg(reg, index)); break; case 'w': parse_ioreg(®, &index, optarg); /* we need one extra argument */ if (argc <= optind) exit(1); val = strtoul(argv[optind], NULL, 16); if (val > 0xff) exit(1); writeb_idx_reg(reg, index, val); printf("%03x.%02x = 0x%02x\n", reg, index, readb_idx_reg(reg, index)); break; case 'g': printf("GPIO State\n"); get_gpio_state(&gs); dump_gpio_state(" ", &gs); printf("\n"); break; default: usage(); exit(1); } } exit(0); } xf86-video-openchrome-0.6.0/tools/Makefile.in0000664000175000017500000004143513057513450015713 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@ 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@ @TOOLS_TRUE@sbin_PROGRAMS = via_regs_dump$(EXEEXT) subdir = tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am__via_regs_dump_SOURCES_DIST = registers.c @TOOLS_TRUE@am_via_regs_dump_OBJECTS = registers.$(OBJEXT) via_regs_dump_OBJECTS = $(am_via_regs_dump_OBJECTS) via_regs_dump_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(via_regs_dump_SOURCES) DIST_SOURCES = $(am__via_regs_dump_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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_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@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ 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@ 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@ XVMC_CFLAGS = @XVMC_CFLAGS@ XVMC_LIBS = @XVMC_LIBS@ 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@ @TOOLS_TRUE@via_regs_dump_SOURCES = registers.c @TOOLS_FALSE@EXTRA_DIST = registers.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(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 tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/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): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list via_regs_dump$(EXEEXT): $(via_regs_dump_OBJECTS) $(via_regs_dump_DEPENDENCIES) $(EXTRA_via_regs_dump_DEPENDENCIES) @rm -f via_regs_dump$(EXEEXT) $(LINK) $(via_regs_dump_OBJECTS) $(via_regs_dump_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/registers.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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 $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; 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: 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 clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-sbinPROGRAMS # 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-openchrome-0.6.0/tools/Makefile.am0000664000175000017500000000015712760724526015706 00000000000000if TOOLS sbin_PROGRAMS = via_regs_dump via_regs_dump_SOURCES = registers.c else EXTRA_DIST = registers.c endif xf86-video-openchrome-0.6.0/NEWS0000664000175000017500000003315513057472674013221 00000000000000OpenChrome DDX Version 0.6 (March 7th, 2017) -------------------------------------------- OpenChrome DDX Version 0.6 is an improved version of OpenChrome DDX Version 0.5 with a number of improvements made to the code. OpenChrome DDX Version 0.6 is written in a way to completely replace Version 0.2.904 through 0.5. OpenChrome DDX Version 0.6 has added the following new features. - First official support for CX700, VX700, and VX800 chipsets integrated TMDS transmitter (i.e., DVI support) - Initial support for Silicon Image SiI 164 TMDS transmitter OpenChrome DDX Version 0.6 has the following improvements. - Improved FP reinitialization when resuming from standby (HP 2133 Mini-Note, FIC CE260 / CE261 based netbooks like Everex CloudBook and Sylvania g netbook) - Improved automatic detection of display resources - Improved X Server stability in dual monitor mode - Automatic active steering of the display controller channel to the correct display output device OpenChrome DDX Version 0.6 fixes the following bugs. - Fix for the disruption of the VT (Virtual Terminal) screen bug introduced in Version 0.5 - Fix for HP 2133 Mini-Note's PCIe WLAN getting turned off inadvertently bug introduced in Version 0.5 OpenChrome Version 0.5 (July 6th, 2016) --------------------------------------- Based on OpenChrome Version 0.4.0 code, OpenChrome Version 0.5 fixes several bugs while adding two new features. - Major code cleanup - Removal of more manual options (BusWidth, ForcePanel, and AccelMethod) - Fix for runtime screen resolution change X.Org Server crash bug - Fix for CLE266 chipset not being able to function correctly if "CRT + TV" option was chosen in BIOS setup - Initial support for VIA Technologies VT1632A TMDS transmitter for DVI - Initial support for multiple display output (i.e., RandR) OpenChrome Version 0.4.0 (March 31st, 2016) ------------------------------------------- OpenChrome Version 0.4.0 is a major break from the past versions where configuring the display resources were done manually. Now the displays are detected mostly automatically, although a few manual options still remain. These will be retired in the near future. Besides that, two alternative mode setting options were discontinued (VBE mode setting and "legacy" mode setting), in order to simplify the code. A regression affecting those with a DVI to VGA adapter, which appeared in OpenChrome Version 0.3.x, is now fixed. More importantly, devices that were not registered with a known device table (a large table that is located internally inside the code) used to crash during boot time, but since this table was removed completely, this bug does not appear anymore. - Removal of VBE (VESA BIOS Extension) mode setting (removal of VBEModes and VbeSaveRestore options) - Removal of "legacy" mode setting (removal of ModeSwitchMethod option) - Removal of ActiveDevice option - Removal of ForcePanel option - Removal of PanelSize option - Removal of a known device table internally - Mostly automatic display detection - Fix for a regression affecting those with DVI to VGA adapter - Fix for a boot time crash for devices that were not on the known device table - Fix for a possible OLPC XO-1.5 detection issue (untested) - Fix for various small compilation warnings / errors openchrome 0.3.3 (23/05/2013) ----------------------------- This is a bugfix release. - Fix integer overflow in libchromeXvMC (CVE-2013-1994). - Various bug fixes and improvements. openchrome 0.3.2 (27/03/2013) ----------------------------- This is a bugfix release. - EXA fixes. Compositing is now enabled again. - TV out fixes and enhancements. - Fix memory detection on P4M800. - Fix for lockup when probing some I2C bus on P4M900. - VGA out probing with Vblank. - Fix building with autoconf 1.13.1. - Fix for X server 1.14. - Various bug fixes and improvements. openchrome 0.3.1 (04/09/2012) ----------------------------- This is a bugfix release. It mainly fixes a crash at startup with X server 1.13. openchrome 0.3.0 (20/07/2012) ----------------------------- The 0.3.0 release is a major step forward for the openchrome X.org driver. It brings most of the features that are needed with todays X server. The code has seen a major overhaul, with a lot of new features and a lot of cleanup. It has been tested on most of the available VIA IGPs and we believe there are no regression at this point. However, the testing was done on a limited range of hardware, so your mileage may vary. Please let us know if you have any trouble using it. * New Features : - TTM/GEM support. - KMS support. - Better RandR support. - XAA removal. - DGA removal. - Support for X server 1.13 API. - Code cleanup and bug fixes. * Known bugs and limitations : - Dual screen is not fully working. - EXA compositing is disabled. - KMS-enabled DRM module is not in upstream kernel yet. Starting with the 0.3.0 release, please submit bugs and patches to freedesktop.org bug tracker. https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome The old ticket tracker is kept as a reference only. It is still available at : http://www.openchrome.org/trac/report/1?asc=1&sort=ticket openchrome 0.2.906 (15/05/2012) ------------------------------- * New features : - VX900 Xv support. - EXA is now the default although compositing is buggy and thus disabled. * Bugfixes and enhancements : - Fix I420 Xv surface on CME engine. - Fix EXA to not require XAA module in X server. openchrome 0.2.905 (10/02/2012) ------------------------------- * New features : - VX900 support (Xv not supported yet). - VX855 XVideo support. * Bugfixes and enhancements : - More debug information to video decoding. - Add secondary FIFO support for K8M890 and P4M890. - Check the primary FIFO for VX855. - Add panel scale support for CLE266 and KM400. - Fix bug with malloc. - Enabled new mode switch for PM800 chipset. - Add option to enable unaccelerated RandR rotation ("SWRandR"). - Enable new mode switch for VM800 chipsets. - More debug traces to via_video.c. - Fix manual and add more comments. - Fix start address. - Optimization of the hardware accelerated cursor and XAA (K8M890 chipset). - Code clean up. - Fix bug with suspend and VT switch on VX800 chipset and 64bit systems. - Synchronize via_drm.h with drm-2.4.17. - Fix segfaults with EXA and XV. - Fix build on old kernels. - Replace RegionsEqual with REGION_EQUAL and use the xf86XVFillKeyHelperDrawable instead of xf86XVFillKeyHelper. - Fix DFP parameter description for the ActiveDevice option. - Manpage update and some minor changes. - Set colorkey for 2nd_monitor. - Add timeouts to HQV while loops. - Improve 2d performance on chipsets without AGP/PCIe. - Add option I2CDevices. - Disable Hardware Clipping for the VX855. - Re-Enable the VQ for VX800/VX855. - Disable AGP and DMA by default for VX800 and VX855. - Fixed freeze on 64bit system for K8M800 chipset. - Increase bandwidth to handle 1920x1200 resolution with DDR266. - Fix XV crash on PM800 post VX855 rework. - Fix several typo in code comments. - Update VX855 FIFO. - Fix bug with TV out flickering. - Replace the deprecated functions with new ones. Refer to "/xserver/include/os.h". - Replace remaining xalloc to malloc. - Change maximum line pitch and virtual height according to chipset. - Update 1024x600 modeline. - Add workaround for memory autodetection. - Enable new mode switch and panel support on K8M800 and VM800. - Fix type in VIASave. - Use DRICreatePCIBusID when available to create Bus ID string. - Restore video interrupt flag. - Fix OpenGL application crash on VX900 chipset. - Fix VIA VB8001 Mini-ITX Board (P4M900) support. - Add workaround for bad memory detection on some P4M800. - Fix resolution detection for OLPC 1.5. - Fix Xvideo crash on X.Org server 1.10. - Fix XAA displaying issues. - Fix cursor garbare after suspend/hibernate/resume on VX855/VX900. - Workaround EXA crash with new libcairo2. - Handle X server 1.12 (videoabi 12). - Add support for I420 Xv surface. - Limit video RAM size to 256 MB, PCI BAR can't handle more. - Add Harald Welte's registers dump tool. * New boards : - ASRock PV530, ECS P4M800PRO-M2 (V2.0) , FIC CE2A1, FIC PTM800Pro LF, Guillemot-Hercules ECafe EC900B, Hewlett Packard DX2020, Hewlett Packard t5550 Thin Client, Lenovo ThinkCenter E51 8714, MSI K8M890M2-V, MSI PM8M-V, MSI PM9M-V, OLPC XO 1.5, Semp Informática Notebook IS 1462, Sharp Mebius PC-CS30H, Siragon ML-6200, Twinhead K15V openchrome 0.2.904 (09/10/2009) ------------------------------- * New features : - Basic VX855 support. - VX800 support. - CX700, VX800 integrated TMDS support. - ARGB cursor support. - Panel modesetting code rework. * Bug fixes and enhancements : - Add checking of the initialization of the XFree86 framebuffer manager. - Save/restore ECK Clock Synthesizer. - Fix bug with panel autodetection. - Fixed problem with backlite (Ticket #308). - Better VT1625 chipset support. - Cursor support speedup. - Fix bug with wrong panel size (Ticket #301). - Remove build warnings and removed unused variables. - Unified variable names with RandR. - RandR initial support. - Updated manpage. - Add rotate upside-down and remove "Magic numbers". - Disable TMDS by default for now, output detection is not working properly. - Fix hardlock on resolution change. - Remove loader symbol lists. - XO-1.5 panel patch and dot clock fixup. - Switch on LVDS pads only for active channel. - Modify PLL generation and add VX855 support. - Fix cursor on secondary. - Fix a segfault on shutdown in ViaCleanupXVMC when there's no Xv. - Fix null pointer dereference in viaExaCheckComposite. - Clean up duplicate defines in via_regs.h. - Remove VT8454B LCD flag. - Make sure Chrome9 chipsets use software rasterizer for 3D. - Cosmetic fix for ViaMMIODisable. - Fix DFP pad mask. - Fix possible use of uninitialized variable (ticket#292). - Fix use of uninitialized variable. - Fix 2D engine init. - ViaPanelGetIndex: 1 bugfix and 1 cosmetic fix. - Set P4M890 primary FIFO. - Initialize CRTC before a mode switch. Fix bug #260. - Small bug fixes for XAA and EXA. - Minor bug fixes and tweaks. - Remove support for old EXA. - Fix 2d initialization for P4M900. - Temporary workaround for freedesktop bug 21563. - Adjust monitor values to handle preset LCD panel and TV modes. - Fix placement of pVia->FrameBufferBase to MapFB. - Clean up compile warnings. - Fix crash worked around by XaaNoImageWriteRect. - Restore panel backlight after VT switch (Ticket #29). - XvMC Unichrome Pro allocation fixes. - Add more needed modes to ViaPanelModes. - XvMC symbol visibility. - Properly link XvMC. - Hide overlay when video is invisible (ticket #266). - Allow FullHD with DDR400. - Add missing 640x480 PAL mode for VT1625. - Remove support for pre-xorg 7.1rc1 Xv ABI. * New boards : - Axper XP-M8VM800, Gigabyte M704 / RoverPC A700GQ, IBM AnyPlace Kiosk 3xx, ECS P4M890T-M v2.0, Foxconn P4M800P7MB-RS2H, Haier A60-440256080BD, Lenovo S12, Mitac 8624 (w/ P4M890), MSI K8M Neo-V (broken pci id), MSI P4M900M3-L, Packard Bell Lima (ASUS MBP5VDZ-NVM), Samsung NC20, Twinhead H12V, Twinhead M6, VIA Epia M700. VIA Openbook, Sharp PC-AE30J. openchrome 0.2.903 (19/08/2008) ------------------------------- * Enhancements and bug fixes: - Simplify memory bandwidth setting. - Fix compilation without EXA. - Fix interpolation for CN400. - Fix Xv on LCD for K8M890 and CX700. - Disable XvDMA for P4M890 and K8M890, it is broken... - Replace xf86strstr by the unwrapped version. - Fix chipset revision detection in libpciaccess code path. - Print driver version in the libpciaccess code path. * New boards: - Biostar P4M890-M7 TE, ECS CLE266, FIC CE261, Foxconn P4M9007MB-8RS2H, Hewlett Packard 2133 Mini-Note, KamLAB KINO-LUKE-533-R20, Mercury P4VM800M7, MSI K9MM-V, MSI VR321, PCChips (unknown model), Samsung Q1B. openchrome 0.2.902 (08/04/2008) ------------------------------- * Enhancements and bug fixes: - libpciaccess support. - Fix Xv on LCD for VM800/CN700/P4M800pro. - Fix P4M900 fifo setting. - Various code clean up. * New boards: - ASRock P4VM900-SATA2, Asustek M2V-MX SE, Asustek P5VD2-VM SE, Biostar P4M800 Pro-M7, Clevo M54xSR, Clevo M660SR, Medion Notebook MD96483, Mitac 8515, Mitac 8624, MSI Fuzzy CX700/CX700D, Packard Bell EasyNote XS (aka Everex Cloudbook CE1200V), VIA Epia SN. * Notes: - The "HWCursor" option has been removed. Hardware-accelerated cursor is on by default, so this option was useless. Use the "SWCursor" option if you want to disable HW cursor. - AGPDMA has been disabled for K8M800 and VM800/CN700/P4M800pro in this release because it causes screen repaint and lockup issues. The problem has been tracked down to a bug in kernel drm. All kernel >= 2.6.22 are affected. This bug will be fixed in the upcoming 2.6.25-rc7. It is also fixed in current drm git tree. If you're using one of the affected kernels, you'll have to either keep AGPDMA disabled or build the modules from the fixed drm git tree. This option brings extra performance for some operations. To use it, add 'Option "EnableAGPDMA"' in the Device section of the xorg configuration. openchrome 0.2.901 (02/01/2008) ------------------------------- * Enhancements : - New pci ids : FIC CE260, Hasee F700C, MSI P4M900M / P4M900M2-F/L, PCChips V21G, Biostar P4M900M-M7 SE. - Identify the driver as Openchrome, with CHROME as a shorthand. - Report chipset too in case of an unknown card id. - Improve P4M890 memory detection. - Add VT1625 720x480Under, 720x480Fit and 720x480Over NTSC modes. - Add VT1625 720x576 PAL mode. * Fixes : - Panel on CX700 needs VBE. - K8M890 can use DDR667. - Never enable IRQ on KM400, KM400A owner will still need to enable manually. - Various code cleanups. openchrome 0.2.900 (20/10/2007) ------------------------------- - First openchrome official release. xf86-video-openchrome-0.6.0/Makefile.am0000664000175000017500000000235312760724526014546 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. AUTOMAKE_OPTIONS = foreign SUBDIRS = src man tools EXTRA_DIST = COPYING NEWS README ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog xf86-video-openchrome-0.6.0/man/0000775000175000017500000000000013057514157013337 500000000000000xf86-video-openchrome-0.6.0/man/openchrome.man0000664000175000017500000002674712760724526016136 00000000000000.\" Shorthand for double quote that works everywhere, .\" also within other double quotes: .ds q \N'34' .TH OPENCHROME __drivermansuffix__ __vendorversion__ .SH NAME openchrome \- video driver for VIA Unichromes .SH SYNOPSIS .nf .B "Section \*qDevice\*q" .BI " Identifier \*q" devname \*q .B " Driver \*qopenchrome\*q" \ \ ... .B EndSection .fi .SH DESCRIPTION .B openchrome is an __xservername__ driver for VIA chipsets that have an integrated Unichrome graphics engine. .PP The .B openchrome driver supports the following chipsets: CLE266, KM400/KN400/KM400A/P4M800, CN400/PM800/PN800/PM880, K8M800, CN700/VM800/P4M800Pro, CX700, P4M890, K8M890, P4M900/VN896/CN896, VX800, VX855 and VX900. The driver includes 2D acceleration and Xv video overlay extensions. Flat panel, TV, and VGA outputs are supported, depending on the hardware configuration. .PP 3D direct rendering is available using experimental drivers from Mesa (www.mesa3d.org). There is also an XvMC client library for hardware acceleration of MPEG1/MPEG2 decoding (not available on the KM/N400) that uses the Direct Rendering Infrastructure (DRI). The XvMC client library implements a non-standard "VLD" extension to the XvMC standard. The current Direct Rendering Manager (DRM) kernel module is available at dri.sourceforge.net. .PP The driver supports free modes for Unichrome Pros (K8M800/K8N800, PM800/PN800, and CN400). For plain Unichromes (CLE266, KM400/KN400), it currently supports only a limited number of dotclocks, so if you are using X modelines you must make sure that the dotclock is one of those supported. Supported dotclocks on plain Unichromes are currently (in MHz): 25.2, 25.312, 26.591, 31.5, 31.704, 32.663, 33.750, 35.5, 36.0, 39.822, 40.0, 41.164, 46.981, 49.5, 50.0, 56.3, 57.284, 64.995, 65.0, 65.028, 74.480, 75.0, 78.8, 81.613, 94.5, 108.0, 108.28, 122.0, 122.726, 135.0, 148.5, 155.8, 157.5, 161.793, 162.0, 175.5, 189.0, 202.5, 204.8, 218.3, 229.5. On top of this, bandwidth restrictions apply for both Unichromes and Unichrome Pros. .PP .SH CONFIGURATION DETAILS Please refer to __xconfigfile__(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this driver. .PP The following driver .B options are supported: .TP .BI "Option \*qAccelMethod\*q \*q" string \*q The driver supports "XAA" and "EXA" acceleration methods. The default method is XAA, since EXA is still experimental. Contrary to XAA, EXA implements acceleration for screen uploads and downloads (if DRI is enabled) and for the Render/Composite extension. .TP .BI "Option \*qActiveDevice\*q \*q" string \*q Specifies the active device combination. Any string containing "CRT", "LCD", "DFP", "TV" should be possible. "CRT" represents anything that is connected to the VGA port, "LCD" is for laptop panels (not TFT screens attached to the VGA port), "DFP" is for screens connected to the DVI port, "TV" is self-explanatory. The default is to use what is detected. The driver is currently unable to use LCD and TV simultaneously, and will favour the LCD. The DVI port is not properly probed and needs to be enabled with this option. .TP .BI "Option \*qAGPMem\*q \*q" integer \*q Sets the amount of AGP memory that is allocated at X server startup. The allocated memory will be "integer" kB. This AGP memory is used for the AGP command buffer (if the option "EnableAGPDMA" is set to "true"), for DRI textures, and for the EXA scratch area. The driver will allocate at least one system page of AGP memory, or \-\- if the AGP command buffer is used \-\- at least 2 MB plus one system page. If there is no room for the EXA scratch area in AGP space, it will be allocated from VRAM. If there is no room for DRI textures, they will be allocated from the DRI part of VRAM (see the option "MaxDRIMem"). The default amount of AGP is 32768 kB. Note that the AGP aperture set in the BIOS must be able to accommodate the amount of AGP memory specified here. Otherwise no AGP memory will be available. It is safe to set a very large AGP aperture in the BIOS. .TP .BI "Option \*qCenter\*q \*q" boolean \*q Enables image centering on DVI displays. The default is disabled. .TP .BI "Option \*qDisableIRQ\*q \*q" boolean \*q Disables the vertical blank IRQ. This is a workaround for some mainboards that have problems with IRQs coming from the Unichrome engine. With IRQs disabled, DRI clients have no way to synchronize their drawing to Vblank. (IRQ is disabled by default on the KM400 and K8M800 chipsets.) .TP .BI "Option \*qDisableVQ\*q \*q" boolean \*q Disables the use of the virtual command queue. The queue is enabled by default. .TP .BI "Option \*qEnableAGPDMA\*q \*q" boolean \*q Enables the AGP DMA functionality in DRM. This requires that DRI is enabled and will force 2D and 3D acceleration to use AGP DMA. The XvMC DRI client will also make use of this on the CLE266 to consume much less CPU. (This option is enabled by default, except on the K8M890 and P4M900.) .TP .BI "Option \*qExaNoComposite\*q \*q" boolean \*q If EXA is enabled (using the option "AccelMethod"), this option enables acceleration of compositing. Since EXA, and in particular its composite acceleration, is still experimental, this is a way to disable a misbehaving composite acceleration. .TP .BI "Option \*qExaScratchSize\*q \*q" integer \*q Sets the size of the EXA scratch area to "integer" kB. This area is used by EXA as a last place to look for available space for pixmaps. Too little space will slow compositing down. This option should be set to the size of the largest pixmap used. If you have a screen width of over 1024 pixels and use 24 bpp, set this to 8192. Otherwise you can leave this at the default 4096. The space will be allocated from AGP memory if available, otherwise from VRAM. .TP .BI "Option \*qLCDDualEdge\*q \*q" boolean \*q Enables the use of dual-edge mode to set the LCD. The default is disabled. .TP .BI "Option \*qMaxDRIMem\*q \*q" integer \*q Sets the maximum amount of VRAM memory allocated for DRI clients to "integer" kB. Normally DRI clients get half the available VRAM size, but in some cases it may make sense to limit this amount. For example, if you are using a composite manager and you want to give as much memory as possible to the EXA pixmap storage area. .TP .BI "Option \*qMigrationHeuristic\*q \*q" string \*q Sets the heuristic for EXA pixmap migration. This is an EXA core option, and starting from __xservername__ server version 1.3.0 this defaults to "always". The openchrome driver performs best with "greedy", so you should really add this option to your configuration file. The third possibility is "smart". .TP .BI "Option \*qNoAccel\*q \*q" boolean \*q Disables the use of hardware acceleration. Acceleration is enabled by default. .TP .BI "Option \*qNoAGPFor2D\*q \*q" boolean \*q Disables the use of AGP DMA for 2D acceleration, even when AGP DMA is enabled. The default is enabled. .TP .BI "Option \*qNoXVDMA\*q \*q" boolean \*q If DRI is enabled, Xv normally uses PCI DMA to transfer video images from system to frame-buffer memory. This is somewhat slower than direct copies due to the limitations of the PCI bus, but on the other hand it decreases CPU usage significantly, particularly on computers with fast processors. Some video players are buggy and will display rendering artifacts when PCI DMA is used. If you experience this, or don't want your PCI bus to be stressed with Xv images, set this option to "true". This option has no effect when DRI is not enabled. .TP .BI "Option \*qPanelSize\*q \*q" string \*q Specifies the size (width x height) of the LCD panel attached to the system. The sizes 640x480, 800x600, 1024x768, 1280x1024, and 1400x1050 are supported. .TP .BI "Option \*qRotationType\*q \*q" string \*q Enabled rotation by using RandR. The driver only support unaccelerated RandR rotations "SWRandR". Hardware rotations "HWRandR" is currently unimplemented. .TP .BI "Option \*qRotate\*q \*q" string \*q Rotates the display either clockwise ("CW"), counterclockwise ("CCW") and upside-down ("UD"). Rotation is only supported unaccelerated. Adding option "Rotate", enables RandR rotation feature. The RandR allows clients to dynamically change X screens. .TP .BI "Option \*qShadowFB\*q \*q" boolean \*q Enables the use of a shadow frame buffer. This is required when rotating the display, but otherwise defaults to disabled. .TP .BI "Option \*qSWCursor\*q \*q" boolean \*q Enables the use of a software cursor. The default is disabled: the hardware cursor is used. .TP .BI "Option \*qTVDeflicker\*q \*q" integer \*q Specifies the deflicker setting for TV output. Valid values are "0", "1", and "2". Here 0 means no deflicker, 1 means 1:1:1 deflicker, and 2 means 1:2:1 deflicker. .TP .BI "Option \*qTVDotCrawl\*q \*q" boolean \*q Enables dot-crawl suppression. The default is disabled. .TP .BI "Option \*qTVOutput\*q \*q" string \*q Specifies which TV output to use. The driver supports "S-Video", "Composite", "SC", "RGB", and "YCbCr" outputs. Note that on some EPIA boards the composite-video port is shared with audio-out and is selected via a jumper. .TP .BI "Option \*qTVPort\*q \*q" string \*q Specifies TV port. The driver currently supports "DVP0", "DVP1", "DFPHigh" and "DFPLow" ports. .TP .BI "Option \*qTVType\*q \*q" string \*q Specifies TV output format. The driver currently supports "NTSC" and "PAL" timings only. .TP .BI "Option \*qVBEModes\*q \*q" boolean \*q Enables the use of VBE BIOS calls for setting the display mode. This mimics the behaviour of the vesa driver but still provides acceleration and other features. This option may be used if your hardware works with the vesa driver but not with the openchrome driver. It may not work on 64-bit systems. Using "VBEModes" may speed up driver acceleration significantly due to a more aggressive hardware setting, particularly on systems with low memory bandwidth. Your refresh rate may be limited to 60 Hz on some systems. .TP .BI "Option \*qVBESaveRestore\*q \*q" boolean \*q Enables the use of VBE BIOS calls for saving and restoring the display state when the X server is launched. This can be extremely slow on some hardware, and the system may appear to have locked for 10 seconds or so. The default is to use the driver builtin function. This option only works if option "VBEModes" is enabled. .TP .BI "Option \*qVideoRAM\*q \*q" integer \*q Overrides the VideoRAM autodetection. This should never be needed. .PP .SH "TV ENCODERS" Unichromes tend to be paired with several different TV encoders. .TP .BI "VIA Technologies VT1621" Still untested, as no combination with a Unichrome is known or available. Supports the following normal modes: "640x480" and "800x600". Use "640x480Over" and "800x600Over" for vertical overscan. These modes are made available by the driver; modelines provided in __xconfigfile__ will be ignored. .TP .BI "VIA Technologies VT1622, VT1622A, VT1623" Supports the following modes: "640x480", "800x600", "1024x768", "848x480", "720x480" (NTSC only) and "720x576" (PAL only). Use "640x480Over", "800x600Over", "1024x768Over", "848x480Over", "720x480Over" (NTSC) and "720x576Over" (PAL) for vertical overscan. The modes "720x480Noscale" (NTSC) and "720x576Noscale" (PAL) (available on VT1622 only) provide cleaner TV output (unscaled with only minimal overscan). These modes are made available by the driver; modelines provided in __xconfigfile__ will be ignored. .SH "SEE ALSO" __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), EXA(__filemansuffix__), Xv(__filemansuffix__) .SH AUTHORS Authors include: ... xf86-video-openchrome-0.6.0/man/Makefile.in0000664000175000017500000003535713057513446015341 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@ # $Id: Makefile.am,v 1.4 2005/10/18 00:01:55 alanc Exp $ # # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # # 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. # # 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 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the copyright holders shall # not be used in advertising or otherwise to promote the sale, use or # other dealings in this Software without prior written authorization # from the copyright holders. # 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)/acinclude.m4 \ $(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 = 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@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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_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@ LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@ LIBUDEV_LIBS = @LIBUDEV_LIBS@ 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 = \ -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ -e 's|__xservername__|Xorg|g' \ -e 's|__xconfigfile__|xorg.conf|g' \ -e 's|__projectroot__|$(prefix)|g' \ -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \ -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' 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@ 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@ XVMC_CFLAGS = @XVMC_CFLAGS@ XVMC_LIBS = @XVMC_LIBS@ 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 = $(mandir)/man$(DRIVER_MAN_SUFFIX) driverman_MANFILES = @DRIVER_NAME@.man driverman_DATA = $(driverman_MANFILES:man=@DRIVER_MAN_SUFFIX@) EXTRA_DIST = @DRIVER_NAME@.man CLEANFILES = $(driverman_DATA) # Strings to replace in man pages XORGRELSTRING = @PACKAGE_STRING@ XORGMANNAME = X Version 11 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 .man.$(DRIVER_MAN_SUFFIX): sed $(MAN_SUBSTS) < $< > $@ @DRIVER_NAME@.man: ln -s -f $(top_srcdir)/src/@DRIVER_NAME@.man . # 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-openchrome-0.6.0/man/Makefile.am0000664000175000017500000000433612760724526015324 00000000000000# $Id: Makefile.am,v 1.4 2005/10/18 00:01:55 alanc Exp $ # # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # # 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. # # 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 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the copyright holders shall # not be used in advertising or otherwise to promote the sale, use or # other dealings in this Software without prior written authorization # from the copyright holders. # drivermandir = $(mandir)/man$(DRIVER_MAN_SUFFIX) driverman_MANFILES = @DRIVER_NAME@.man driverman_DATA = $(driverman_MANFILES:man=@DRIVER_MAN_SUFFIX@) EXTRA_DIST = @DRIVER_NAME@.man CLEANFILES = $(driverman_DATA) SED = sed # Strings to replace in man pages XORGRELSTRING = @PACKAGE_STRING@ XORGMANNAME = X Version 11 MAN_SUBSTS = \ -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ -e 's|__xservername__|Xorg|g' \ -e 's|__xconfigfile__|xorg.conf|g' \ -e 's|__projectroot__|$(prefix)|g' \ -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \ -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man .man.$(DRIVER_MAN_SUFFIX): sed $(MAN_SUBSTS) < $< > $@ @DRIVER_NAME@.man: ln -s -f $(top_srcdir)/src/@DRIVER_NAME@.man . xf86-video-openchrome-0.6.0/config.sub0000755000175000017500000010517613057513402014467 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-02-10' # 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, 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. # 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/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) 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 \ | aarch64 | aarch64_be \ | 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 | m68hcs12x | 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 ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; 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-* \ | aarch64-* | aarch64_be-* \ | 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: