xf86-video-nouveau-1.0.16/ 0000755 0001750 0001756 00000000000 13423754654 012202 5 0000000 0000000 xf86-video-nouveau-1.0.16/depcomp 0000755 0001750 0001756 00000056020 13423754646 013503 0000000 0000000 #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2018 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
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
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"
# Avoid interferences from the environment.
gccflag= dashmflag=
# 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
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
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 -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## 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). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - 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 -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# 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.
## 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.
tr ' ' "$nl" < "$tmpdepfile" \
| 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 -ne 0; then
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 ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# 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
;;
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.
set_dir_from "$object"
set_base_from "$object"
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 -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
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.
set_dir_from "$object"
set_base_from "$object"
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 -ne 0; then
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,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_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.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool 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$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
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 -ne 0; then
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/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
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|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| 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"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| 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::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$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 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
xf86-video-nouveau-1.0.16/man/ 0000755 0001750 0001756 00000000000 13423754654 012755 5 0000000 0000000 xf86-video-nouveau-1.0.16/man/nouveau.man 0000644 0001750 0001756 00000013727 13423754626 015065 0000000 0000000 .\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH NOUVEAU __drivermansuffix__ __vendorversion__
.SH NAME
nouveau \- NVIDIA video driver
.SH SYNOPSIS
.nf
.B "Section \*qDevice\*q"
.BI " Identifier \*q" devname \*q
.B " Driver \*qnouveau\*q"
\ \ ...
.B EndSection
.fi
.SH DESCRIPTION
.B nouveau
is an __xservername__ driver for NVIDIA video cards. The driver supports 2D
acceleration and provides support for the following framebuffer depths:
(15,) 16 and 24. TrueColor visuals are supported for these depths.
.SH SUPPORTED HARDWARE
The
.B nouveau
driver supports PCI, PCI-Express and AGP video cards based on the following NVIDIA chips:
.TP 22
.B RIVA TNT
NV4
.TP 22
.B RIVA TNT2
NV5
.TP 22
.B GeForce 256, QUADRO
NV10
.TP 22
.B GeForce2, QUADRO2
NV11 & NV15
.TP 22
.B GeForce3, QUADRO DCC
NV20
.TP 22
.B nForce, nForce2
NV1A, NV1F
.TP 22
.B GeForce4, QUADRO4
NV17, NV18, NV25, NV28
.TP 22
.B GeForce FX, QUADRO FX
NV30, NV31, NV34, NV35, NV36, NV37, NV38
.TP 22
.B GeForce 6XXX
NV40, NV41, NV43, NV44, NV45, C51, MCP61
.TP 22
.B GeForce 7XXX
G70, G71, G72, G73, MCP67, MCP68, MCP73
.TP 22
.B GeForce 8XXX, 9XXX, 2XX, 3XX
G80, G84, G86, G92, G94, G96, G98, G200, GT215, GT216, GT218, MCP77,
MCP79, MCP89
.TP 22
.B GeForce 4XX, 5XX
GF100, GF104, GF106, GF108, GF110, GF114, GF116, GF117, GF119
.TP 22
.B GeForce 6XX, 7XX
GK104, GK106, GK107, GK110, GK208
.TP 22
.B GeForce GTX 750
GM107, GM108
.TP 22
.B GeForce GTX 9XX
GM200, GM204, GM206
.TP 22
.B GeForce GTX 10XX
GP102, GP104, GP106, GP107, GP108
.SH CONFIGURATION DETAILS
Please refer to __xconfigfile__(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
driver.
.PP
The driver auto-detects the chipset type and the amount of video memory
present for all chips.
.PP
The following driver
.B Options
are supported:
.TP
.BI "Option \*qHWCursor\*q \*q" boolean \*q
Enable or disable the HW cursor. Default: on.
.TP
.BI "Option \*qAccelMethod\*q \*q" string \*q
Specify the acceleration method. One of \*qnone\*q, or \*qexa\*q. Default: exa.
.TP
.BI "Option \*qNoAccel\*q \*q" boolean \*q
Disable or enable acceleration. Default: acceleration is enabled.
.TP
.BI "Option \*qShadowFB\*q \*q" boolean \*q
Enable or disable use of the shadow framebuffer layer. Default: off.
.TP
.BI "Option \*qWrappedFB\*q \*q" boolean \*q
Enable or disable wfb, only affects nv50+. Useful for some legacy configurations where high rendering latency is perceived. Default: wfb is disabled.
.TP
.BI "Option \*qGLXVBlank\*q \*q" boolean \*q
Synchronize GLX clients to VBlank. Useful where tearing is a problem,
harmful if the GPU isn't fast enough to keep up with the monitor
refresh rate. Default: on.
.TP
.BI "Option \*qZaphodHeads\*q \*q" string \*q
Specify the randr output(s) to use with zaphod mode for a particular driver
instance. If you use this option you most use this option for all instances
of the driver.
.br
For example:
.B
Option \*qZaphodHeads\*q \*qLVDS,VGA-0\*q
will assign xrandr outputs LVDS and VGA-0 to this instance of the driver.
.TP
.BI "Option \*qPageFlip\*q \*q" boolean \*q
Enable DRI2 page flipping. Default: on.
.TP
.BI "Option \*qSwapLimit\*q \*q" integer \*q
Set maximum allowed number of pending OpenGL double-buffer swaps for
a drawable before a client is blocked.
.br
A value of 1 corresponds to double-buffering. A value of 2 corresponds
to triple-buffering. Higher values may allow higher framerate, but also
increase lag for interactive applications, e.g., games. Nouveau currently
reliably supports a maximum value of 2 on XOrg 1.12+. A maximum setting of 2
on older x-servers is allowed, but it will break conformance with the
OpenML OML_sync_control specification and will cause failure of software
that relies on correct presentation timing behaviour as defined in that
specification.
.br
Default: 1.
.TP
.BI "Option \*qDRI\*q \*q" integer \*q
Define the maximum level of DRI to enable. Valid values are 2 or 3.
exa acceleration will honor the maximum level if it is supported.
Default: 2.
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
.SH AUTHORS
Authors include: David McKay, Jarno Paananen, Chas Inman, Dave Schmenk,
Mark Vojkovich
.SH COPYRIGHT
.LP
NOTICE TO USER: The source code is copyrighted under U.S. and
international laws. Users and possessors of this source code are
hereby granted a nonexclusive, royalty-free copyright license to
use this code in individual and commercial software.
.LP
Any use of this source code must include, in the user documentation and
internal comments to the code, notices to the end user as follows:
.LP
Copyright 1993-2003 NVIDIA, Corporation. All rights reserved.
.LP
NVIDIA, CORPORATION MAKES NO REPRESENTATION ABOUT THE SUITABILITY
OF THIS SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS"
WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. NVIDIA, CORPORATION
DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOURCE CODE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT,
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
NVIDIA, CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE.
.LP
U.S. Government End Users. This source code is a "commercial
item," as that term is defined at 48 C.F.R. 2.101 (OCT 1995),
consisting of "commercial computer software" and "commercial
computer software documentation," as such terms are used in
48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
only as a commercial end item. Consistent with 48 C.F.R.
12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995),
all U.S. Government End Users acquire the source code with only
those rights set forth herein.
xf86-video-nouveau-1.0.16/man/Makefile.am 0000644 0001750 0001756 00000003114 13423754626 014727 0000000 0000000 # $Id$
#
# 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 = $(DRIVER_MAN_DIR)
driverman_PRE = @DRIVER_NAME@.man
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = @DRIVER_NAME@.man
CLEANFILES = $(driverman_DATA)
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
.man.$(DRIVER_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
xf86-video-nouveau-1.0.16/man/Makefile.in 0000644 0001750 0001756 00000041300 13423754646 014741 0000000 0000000 # Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 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$
#
# 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@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
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
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
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)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DRIVER_NAME = @DRIVER_NAME@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIBS = @LIBDRM_LIBS@
LIBDRM_NOUVEAU_CFLAGS = @LIBDRM_NOUVEAU_CFLAGS@
LIBDRM_NOUVEAU_LIBS = @LIBDRM_NOUVEAU_LIBS@
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@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
PCIACCESS_LIBS = @PCIACCESS_LIBS@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
XEXT_CFLAGS = @XEXT_CFLAGS@
XEXT_LIBS = @XEXT_LIBS@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
moduledir = @moduledir@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
drivermandir = $(DRIVER_MAN_DIR)
driverman_PRE = @DRIVER_NAME@.man
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = @DRIVER_NAME@.man
CLEANFILES = $(driverman_DATA)
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
all: all-am
.SUFFIXES:
.SUFFIXES: .$(DRIVER_MAN_SUFFIX) .man
$(srcdir)/Makefile.in: $(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
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__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(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)
@list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(drivermandir)" || exit 1; \
fi; \
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:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(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 \
cscopelist-am ctags-am 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 tags-am uninstall \
uninstall-am uninstall-drivermanDATA
.PRECIOUS: Makefile
.man.$(DRIVER_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
xf86-video-nouveau-1.0.16/missing 0000755 0001750 0001756 00000015336 13423754646 013532 0000000 0000000 #! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Originally written 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
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
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
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=https://www.perl.org/
flex_URL=https://github.com/westes/flex
gnu_software_URL=https://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
xf86-video-nouveau-1.0.16/m4/ 0000755 0001750 0001756 00000000000 13423754654 012522 5 0000000 0000000 xf86-video-nouveau-1.0.16/m4/ltversion.m4 0000644 0001750 0001756 00000001273 13423754636 014734 0000000 0000000 # ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004, 2011-2015 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 4179 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.6])
m4_define([LT_PACKAGE_REVISION], [2.4.6])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.6'
macro_revision='2.4.6'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
xf86-video-nouveau-1.0.16/m4/lt~obsolete.m4 0000644 0001750 0001756 00000013774 13423754636 015272 0000000 0000000 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 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])])
xf86-video-nouveau-1.0.16/m4/ltoptions.m4 0000644 0001750 0001756 00000034262 13423754636 014746 0000000 0000000 # Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004-2005, 2007-2009, 2011-2015 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 8 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_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
[_LT_WITH_AIX_SONAME([aix])])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT 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_AIX_SONAME([DEFAULT])
# ----------------------------------
# implement the --with-aix-soname flag, and support the `aix-soname=aix'
# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
m4_define([_LT_WITH_AIX_SONAME],
[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[[5-9]]*,yes)
AC_MSG_CHECKING([which variant of shared library versioning to provide])
AC_ARG_WITH([aix-soname],
[AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
[shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
[case $withval in
aix|svr4|both)
;;
*)
AC_MSG_ERROR([Unknown argument to --with-aix-soname])
;;
esac
lt_cv_with_aix_soname=$with_aix_soname],
[AC_CACHE_VAL([lt_cv_with_aix_soname],
[lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
with_aix_soname=$lt_cv_with_aix_soname])
AC_MSG_RESULT([$with_aix_soname])
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
# based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
# and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
# Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
# the AIX toolchain works better with OBJECT_MODE set (default 32).
if test 64 = "${OBJECT_MODE-32}"; then
shared_archive_member_spec=shr_64
else
shared_archive_member_spec=shr
fi
fi
;;
*)
with_aix_soname=aix
;;
esac
_LT_DECL([], [shared_archive_member_spec], [0],
[Shared archive member basename, for filename based shared library versioning on AIX])dnl
])# _LT_WITH_AIX_SONAME
LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
# _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=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], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
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])])
xf86-video-nouveau-1.0.16/m4/libtool.m4 0000644 0001750 0001756 00001125746 13423754635 014367 0000000 0000000 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
# Copyright (C) 1996-2001, 2003-2015 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) 2014 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 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 this program. If not, see .
])
# serial 58 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.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
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_PREPARE_CC_BASENAME
# -----------------------
m4_defun([_LT_PREPARE_CC_BASENAME], [
# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
func_cc_basename ()
{
for cc_temp in @S|@*""; do
case $cc_temp in
compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
\-*) ;;
*) break;;
esac
done
func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
}
])# _LT_PREPARE_CC_BASENAME
# _LT_CC_BASENAME(CC)
# -------------------
# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
# but that macro is also expanded into generated libtool script, which
# arranges for $SED and $ECHO to be set by different means.
m4_defun([_LT_CC_BASENAME],
[m4_require([_LT_PREPARE_CC_BASENAME])dnl
AC_REQUIRE([_LT_DECL_SED])dnl
AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
func_cc_basename $1
cc_basename=$func_cc_basename_result
])
# _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
m4_require([_LT_CMD_TRUNCATE])dnl
_LT_CONFIG_LIBTOOL_INIT([
# See if we are running on zsh, and set the options that 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 set != "${COLLECT_NAMES+set}"; 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
## ------------------------------------- ##
## Accumulate code for creating libtool. ##
## ------------------------------------- ##
# 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], [[!?.]$], [], [.])
)])
## ------------------------ ##
## FIXME: Eliminate VARNAME ##
## ------------------------ ##
# _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\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
;;
*)
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\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
;;
*)
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 0 = "$lt_write_fail" && 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 yes = "$silent" &&
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 that 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
# Generated automatically by $as_me ($PACKAGE) $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.
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit, 1996
_LT_COPYING
_LT_LIBTOOL_TAGS
# Configured defaults for sys_lib_dlsearch_path munging.
: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
# ### BEGIN LIBTOOL CONFIG
_LT_LIBTOOL_CONFIG_VARS
_LT_LIBTOOL_TAG_VARS
# ### END LIBTOOL CONFIG
_LT_EOF
cat <<'_LT_EOF' >> "$cfgfile"
# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
_LT_PREPARE_MUNGE_PATH_LIST
_LT_PREPARE_CC_BASENAME
# ### END FUNCTIONS SHARED WITH CONFIGURE
_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 set != "${COLLECT_NAMES+set}"; 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)
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'
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 0 = "$_lt_result"; 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 0 = "$_lt_result" && $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 yes = "$lt_cv_apple_cc_single_mod"; then
_lt_dar_single_mod='$single_module'
fi
if test yes = "$lt_cv_ld_exported_symbols_list"; 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 no = "$lt_cv_ld_force_load"; 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 yes = "$lt_cv_ld_force_load"; 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*|nagfor*) _lt_dar_can_shared=yes ;;
*) _lt_dar_can_shared=$GCC ;;
esac
if test yes = "$_lt_dar_can_shared"; 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 yes != "$lt_cv_apple_cc_single_mod"; 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 set = "${lt_cv_aix_libpath+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 that will find a shell with a builtin
# printf (that 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],
[AS_HELP_STRING([--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 yes = "$GCC"; 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 where 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 no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode
# options accordingly.
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 what ABI is being produced by ac_compile, and set linker
# options accordingly.
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
if test yes = "$lt_cv_prog_gnu_ld"; 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*
;;
mips64*-*linux*)
# Find out what ABI is being produced by ac_compile, and set linker
# options accordingly.
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
emul=elf
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
emul="${emul}32"
;;
*64-bit*)
emul="${emul}64"
;;
esac
case `/usr/bin/file conftest.$ac_objext` in
*MSB*)
emul="${emul}btsmip"
;;
*LSB*)
emul="${emul}ltsmip"
;;
esac
case `/usr/bin/file conftest.$ac_objext` in
*N32*)
emul="${emul}n32"
;;
esac
LD="${LD-ld} -m $emul"
fi
rm -rf conftest*
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out what ABI is being produced by ac_compile, and set linker
# options accordingly. Note that the listed cases only cover the
# situations where additional linker options are needed (such as when
# doing 32-bit compilation for a host where ld defaults to 64-bit, or
# vice versa); the common cases where no linker options are needed do
# not appear in the list.
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*)
case `/usr/bin/file conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
;;
*)
LD="${LD-ld} -m elf_i386"
;;
esac
;;
powerpc64le-*linux*)
LD="${LD-ld} -m elf32lppclinux"
;;
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"
;;
powerpcle-*linux*|powerpc64le-*linux*)
LD="${LD-ld} -m elf64lppc"
;;
powerpc-*linux*|powerpc64-*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 yes != "$lt_cv_cc_needs_belf"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS=$SAVE_CFLAGS
fi
;;
*-*solaris*)
# Find out what ABI is being produced by ac_compile, and set linker
# options accordingly.
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*|x86_64-*-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 0 -eq "$ac_status"; then
# Ensure the archiver fails upon bogus file names.
rm -f conftest.$ac_objext libconftest.a
AC_TRY_EVAL([lt_ar_try])
if test 0 -ne "$ac_status"; then
lt_cv_ar_at_file=@
fi
fi
rm -f conftest.* libconftest.a
])
])
if test no = "$lt_cv_ar_at_file"; 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
bitrig* | 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" ## exclude from sc_useless_quotes_in_assignment
# 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 yes = "[$]$2"; 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 yes = "[$]$2"; 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;
;;
bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
# 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" && \
test undefined != "$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 17 != "$i" # 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 yes = "$cross_compiling"; 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 -fvisibility=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 yes != "$enable_dlopen"; 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
])
;;
tpf*)
# Don't try to run any link tests for TPF. We know it's impossible
# because TPF is a cross-compiler, and we know how we open DSOs.
lt_cv_dlopen=dlopen
lt_cv_dlopen_libs=
lt_cv_dlopen_self=no
;;
*)
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 no = "$lt_cv_dlopen"; then
enable_dlopen=no
else
enable_dlopen=yes
fi
case $lt_cv_dlopen in
dlopen)
save_CPPFLAGS=$CPPFLAGS
test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$lt_cv_dlopen_self"; 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 no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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 no = "$hard_links"; 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 where 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 yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
# We can hardcode non-existent directories.
if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
# 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; 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 relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
# Fast installation is not supported
enable_fast_install=no
elif test yes = "$shlibpath_overrides_runpath" ||
test no = "$enable_shared"; 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_PREPARE_MUNGE_PATH_LIST
# ---------------------------
# Make sure func_munge_path_list() is defined correctly.
m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
[[# func_munge_path_list VARIABLE PATH
# -----------------------------------
# VARIABLE is name of variable containing _space_ separated list of
# directories to be munged by the contents of PATH, which is string
# having a format:
# "DIR[:DIR]:"
# string "DIR[ DIR]" will be prepended to VARIABLE
# ":DIR[:DIR]"
# string "DIR[ DIR]" will be appended to VARIABLE
# "DIRP[:DIRP]::[DIRA:]DIRA"
# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
# "DIRA[ DIRA]" will be appended to VARIABLE
# "DIR[:DIR]"
# VARIABLE will be replaced by "DIR[ DIR]"
func_munge_path_list ()
{
case x@S|@2 in
x)
;;
*:)
eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
;;
x:*)
eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
;;
*::*)
eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
;;
*)
eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
;;
esac
}
]])# _LT_PREPARE_PATH_LIST
# _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
m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
AC_MSG_CHECKING([dynamic linker characteristics])
m4_if([$1],
[], [
if test yes = "$GCC"; 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`
# ...but if some path component already ends with the multilib dir we assume
# that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
case "$lt_multi_os_dir; $lt_search_path_spec " in
"/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
lt_multi_os_dir=
;;
esac
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"
elif test -n "$lt_multi_os_dir"; then
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
AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
[User-defined run-time library search path.])
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 ia64 = "$host_cpu"; 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
# Using Import Files as archive members, it is possible to support
# filename-based versioning of shared library archives on AIX. While
# this would work for both with and without runtime linking, it will
# prevent static linking of such archives. So we do filename-based
# shared library versioning with .so extension only, which is used
# when both runtime linking and shared linking is enabled.
# Unfortunately, runtime linking may impact performance, so we do
# not want this to be the default eventually. Also, we use the
# versioned .so libs for executables only if there is the -brtl
# linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
# To allow for filename-based versioning support, we need to create
# libNAME.so.V as an archive file, containing:
# *) an Import File, referring to the versioned filename of the
# archive as well as the shared archive member, telling the
# bitwidth (32 or 64) of that shared object, and providing the
# list of exported symbols of that shared object, eventually
# decorated with the 'weak' keyword
# *) the shared object with the F_LOADONLY flag set, to really avoid
# it being seen by the linker.
# At run time we better use the real file rather than another symlink,
# but for link time we create the symlink libNAME.so -> libNAME.so.V
case $with_aix_soname,$aix_use_runtimelinking in
# AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
# soname into executable. Probably we can add versioning support to
# collect2, so additional links can be useful in future.
aix,yes) # traditional libtool
dynamic_linker='AIX unversionable lib.so'
# 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'
;;
aix,no) # traditional AIX only
dynamic_linker='AIX lib.a[(]lib.so.V[)]'
# 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'
;;
svr4,*) # full svr4 only
dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
# We do not specify a path in Import Files, so LIBPATH fires.
shlibpath_overrides_runpath=yes
;;
*,yes) # both, prefer svr4
dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
# unpreferred sharedlib libNAME.a needs extra handling
postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
# We do not specify a path in Import Files, so LIBPATH fires.
shlibpath_overrides_runpath=yes
;;
*,no) # both, prefer aix
dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
library_names_spec='$libname$release.a $libname.a'
soname_spec='$libname$release$shared_ext$major'
# unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
;;
esac
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%'\''`; $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
# Handle Gentoo/FreeBSD as it was Linux
case $host_vendor in
gentoo)
version_type=linux ;;
*)
version_type=freebsd-$objformat ;;
esac
case $version_type in
freebsd-elf*)
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
soname_spec='$libname$release$shared_ext$major'
need_version=no
need_lib_prefix=no
;;
freebsd-*)
library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
need_version=yes
;;
linux)
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
need_lib_prefix=no
need_version=no
;;
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
;;
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=no
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 32 = "$HPUX_IA64_MODE"; then
sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
sys_lib_dlsearch_path_spec=/usr/lib/hpux32
else
sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
sys_lib_dlsearch_path_spec=/usr/lib/hpux64
fi
;;
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 yes = "$lt_cv_prog_gnu_ld"; 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
;;
linux*android*)
version_type=none # Android doesn't support versioned libraries.
need_lib_prefix=no
need_version=no
library_names_spec='$libname$release$shared_ext'
soname_spec='$libname$release$shared_ext'
finish_cmds=
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
# 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
dynamic_linker='Android linker'
# Don't embed -rpath directories since the linker doesn't support them.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
;;
# This must be glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu | 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
# Ideally, we could use ldconfig to report *all* directores which are
# searched for libraries, however this is still not possible. Aside from not
# being certain /sbin/ldconfig is available, command
# 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
# even though it is searched at run-time. Try to do the best guess by
# appending ld.so.conf contents (and includes) 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'
;;
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* | bitrig*)
version_type=sunos
sys_lib_dlsearch_path_spec=/usr/lib
need_lib_prefix=no
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
need_version=no
else
need_version=yes
fi
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
shlibpath_overrides_runpath=yes
;;
os2*)
libname_spec='$name'
version_type=windows
shrext_cmds=.dll
need_version=no
need_lib_prefix=no
# OS/2 can only load a DLL with a base name of 8 characters or less.
soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
v=$($ECHO $release$versuffix | tr -d .-);
n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
$ECHO $n$v`$shared_ext'
library_names_spec='${libname}_dll.$libext'
dynamic_linker='OS/2 ld.exe'
shlibpath_var=BEGINLIBPATH
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
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'
;;
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 yes = "$with_gnu_ld"; 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=sco
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 yes = "$with_gnu_ld"; 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 no = "$dynamic_linker" && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test yes = "$GCC"; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
fi
if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
fi
# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
_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], [configure_time_dlsearch_path], [2],
[Detected run-time system search path for libraries])
_LT_DECL([], [configure_time_lt_sys_library_path], [2],
[Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
])# _LT_SYS_DYNAMIC_LINKER
# _LT_PATH_TOOL_PREFIX(TOOL)
# --------------------------
# find a file program that 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 that 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 no = "$withval" || with_gnu_ld=yes],
[with_gnu_ld=no])dnl
ac_prog=ld
if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 conftest.i
cat conftest.i conftest.i >conftest2.i
: ${lt_DD:=$DD}
AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then
cmp -s conftest.i conftest.out \
&& ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
fi])
rm -f conftest.i conftest2.i conftest.out])
])# _LT_PATH_DD
# _LT_CMD_TRUNCATE
# ----------------
# find command to truncate a binary pipe
m4_defun([_LT_CMD_TRUNCATE],
[m4_require([_LT_PATH_DD])
AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
[printf 0123456789abcdef0123456789abcdef >conftest.i
cat conftest.i conftest.i >conftest2.i
lt_cv_truncate_bin=
if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then
cmp -s conftest.i conftest.out \
&& lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
fi
rm -f conftest.i conftest2.i conftest.out
test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
[Command to truncate a binary pipe])
])# _LT_CMD_TRUNCATE
# _LT_CHECK_MAGIC_METHOD
# ----------------------
# how to check for library dependencies
# -- PORTME fill in with the dynamic library characteristics
m4_defun([_LT_CHECK_MAGIC_METHOD],
[m4_require([_LT_DECL_EGREP])
m4_require([_LT_DECL_OBJDUMP])
AC_CACHE_CHECK([how to recognize dependent libraries],
lt_cv_deplibs_check_method,
[lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
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
# that 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.
if ( file / ) >/dev/null 2>&1; then
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_file_magic_cmd='func_win32_libid'
else
# 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
;;
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 | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
fi
;;
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
*nto* | *qnx*)
lt_cv_deplibs_check_method=pass_all
;;
openbsd* | bitrig*)
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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
;;
os2*)
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
# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
case $build_os in
mingw*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
*$lt_bad_file* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break 2
;;
*)
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break 2
;;
*)
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 no != "$lt_cv_path_NM"; 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 -headers /dev/null 2>&1 | sed '1q'` in
*COFF*)
DUMPBIN="$DUMPBIN -symbols -headers"
;;
*)
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 one 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 yes != "$lt_cv_path_mainfest_tool"; then
MANIFEST_TOOL=:
fi
_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
])# _LT_PATH_MANIFEST_TOOL
# _LT_DLL_DEF_P([FILE])
# ---------------------
# True iff FILE is a Windows DLL '.def' file.
# Keep in sync with func_dll_def_p in the libtool script
AC_DEFUN([_LT_DLL_DEF_P],
[dnl
test DEF = "`$SED -n dnl
-e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
-e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
-e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
-e q dnl Only consider the first "real" line
$1`" dnl
])# _LT_DLL_DEF_P
# 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 yes = "$GCC"; 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 ia64 = "$host_cpu"; 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
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Gets list of data symbols to import.
lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
# Adjust the below global symbol transforms to fixup imported variables.
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
lt_c_name_lib_hook="\
-e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
-e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
else
# Disable hooks by default.
lt_cv_sys_global_symbol_to_import=
lt_cdecl_hook=
lt_c_name_hook=
lt_c_name_lib_hook=
fi
# 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"\
$lt_cdecl_hook\
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
" -e 's/^$symcode$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"\
$lt_c_name_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
# Transform an extracted symbol line into symbol name with lib prefix and
# symbol address.
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
$lt_c_name_lib_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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,
# D for any global variable and I for any imported 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};"\
" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
" \$ 0!~/External *\|/{next};"\
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
" {if(hide[section]) next};"\
" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
" s[1]~prfx {split(s[1],t,\"@\"); print f,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 can'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* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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 yes = "$pipe_works"; 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_import], [lt_cv_sys_global_symbol_to_import], [1],
[Transform the output of nm into a list of symbols to manually relocate])
_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_interface], [lt_cv_nm_interface], [1],
[The name lister interface])
_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 yes = "$GXX"; 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 ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
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'])
case $host_os in
os2*)
_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
;;
esac
;;
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 ia64 = "$host_cpu"; 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 ia64 != "$host_cpu"; 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 | gnu*)
case $cc_basename in
KCC*)
# KAI C++ Compiler
_LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
ecpc* )
# old Intel C++ for x86_64, which still supported -KPIC.
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
icpc* )
# Intel C++, used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
pgCC* | pgcpp*)
# Portland Group C++ compiler
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
cxx*)
# Compaq C++
# Make sure the PIC flag is empty. It appears that all Alpha
# Linux and Compaq Tru64 Unix objects are PIC.
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
# IBM XL 8.0, 9.0 on PPC and BlueGene
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
;;
esac
;;
esac
;;
lynxos*)
;;
m88k*)
;;
mvs*)
case $cc_basename in
cxx*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
;;
*)
;;
esac
;;
netbsd*)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
osf3* | osf4* | osf5*)
case $cc_basename in
KCC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
;;
RCC*)
# Rational C++ 2.4.1
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
;;
cxx*)
# Digital/Compaq C++
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# Make sure the PIC flag is empty. It appears that all Alpha
# Linux and Compaq Tru64 Unix objects are PIC.
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
*)
;;
esac
;;
psos*)
;;
solaris*)
case $cc_basename in
CC* | sunCC*)
# Sun C++ 4.2, 5.x and Centerline C++
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
;;
gcx*)
# Green Hills C++ Compiler
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
;;
*)
;;
esac
;;
sunos4*)
case $cc_basename in
CC*)
# Sun C++ 4.x
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
lcc*)
# Lucid
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
;;
*)
;;
esac
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
case $cc_basename in
CC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
esac
;;
tandem*)
case $cc_basename in
NCC*)
# NonStop-UX NCC 3.20
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
;;
*)
;;
esac
;;
vxworks*)
;;
*)
_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
;;
esac
fi
],
[
if test yes = "$GCC"; 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 ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
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'])
case $host_os in
os2*)
_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
;;
esac
;;
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 ia64 = "$host_cpu"; 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
;;
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'
case $cc_basename in
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'
;;
esac
;;
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'])
case $host_os in
os2*)
_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
;;
esac
;;
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 | 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'
;;
tcc*)
# Fabrice Bellard et al's Tiny 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)='-static'
;;
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 that 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 GNU nm, but means don't demangle to AIX nm.
# Without the "-l" option, or with the "-B" option, AIX nm treats
# weak defined symbols like other global defined symbols, whereas
# GNU nm marks them as "W".
# While the 'weak' keyword is ignored in the Export File, we need
# it in the Import File for the 'aix-soname' feature, so we have
# to replace the "-B" option with "-P" for AIX nm.
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) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
_LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
;;
cygwin* | mingw* | cegcc*)
case $cc_basename in
cl*)
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
;;
esac
;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
esac
], [
runpath_var=
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(archive_cmds, $1)=
_LT_TAGVAR(archive_expsym_cmds, $1)=
_LT_TAGVAR(compiler_needs_object, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(hardcode_automatic, $1)=no
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_TAGVAR(inherit_rpath, $1)=no
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(module_cmds, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(old_archive_from_new_cmds, $1)=
_LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
_LT_TAGVAR(thread_safe_flag_spec, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
_LT_TAGVAR(include_expsyms, $1)=
# exclude_expsyms can be an extended regexp of symbols to exclude
# it will be wrapped by ' (' and ')$', so one must not match beginning or
# end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
# as well as any symbol that contains 'd'.
_LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
# Exclude shared library initialization/finalization symbols.
dnl Note also adjust exclude_expsyms for C++ above.
extract_expsyms_cmds=
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd* | bitrig*)
with_gnu_ld=no
;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
# On some targets, GNU ld is compatible enough with the native linker
# that we're better off using the native interface for both.
lt_use_gnu_ld_interface=no
if test yes = "$with_gnu_ld"; 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 yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/([^)]\+)\s\+//' 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 ia64 != "$host_cpu"; 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, use it as
# is; otherwise, prepend EXPORTS...
_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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
;;
os2*)
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
shrext_cmds=.dll
_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
$ECHO EXPORTS >> $output_objdir/$libname.def~
emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
$ECHO EXPORTS >> $output_objdir/$libname.def~
prefix_cmds="$SED"~
if test EXPORTS = "`$SED 1q $export_symbols`"; then
prefix_cmds="$prefix_cmds -e 1d";
fi~
prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet"
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' ;;
nagfor*) # NAGFOR 5.3
tmp_sharedflag='-Wl,-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 yes = "$supports_anon_versioning"; 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
tcc*)
_LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
;;
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 yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
;;
esac
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
solaris*)
if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.9.1 or newer. Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
*** 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 no = "$_LT_TAGVAR(ld_shlibs, $1)"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm.
# Without the "-l" option, or with the "-B" option, AIX nm treats
# weak defined symbols like other global defined symbols, whereas
# GNU nm marks them as "W".
# While the 'weak' keyword is ignored in the Export File, we need
# it in the Import File for the 'aix-soname' feature, so we have
# to replace the "-B" option with "-P" for AIX nm.
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) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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
# have runtime linking enabled, and use it for executables.
# For shared libraries, we enable/disable runtime linking
# depending on the kind of the shared library created -
# when "with_aix_soname,aix_use_runtimelinking" is:
# "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
# "aix,yes" lib.so shared, rtl:yes, for executables
# lib.a static archive
# "both,no" lib.so.V(shr.o) shared, rtl:yes
# lib.a(lib.so.V) shared, rtl:no, for executables
# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
# lib.a(lib.so.V) shared, rtl:no
# "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
# lib.a static archive
case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
aix_use_runtimelinking=yes
break
fi
done
if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
# With aix-soname=svr4, we create the lib.so.V shared archives only,
# so we don't have lib.a shared libs to link our executables.
# We have to force runtime linking in this case.
aix_use_runtimelinking=yes
LDFLAGS="$LDFLAGS -Wl,-brtl"
fi
;;
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,'
case $with_aix_soname,$aix_use_runtimelinking in
aix,*) ;; # traditional, no import file
svr4,* | *,yes) # use import file
# The Import File defines what to hardcode.
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
;;
esac
if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then
shared_flag="$shared_flag "'$wl-G'
fi
# Need to ensure runtime linking is disabled for the traditional
# shared library, or the linker may eventually find shared libraries
# /with/ Import File - we do not want to mix them.
shared_flag_aix='-shared'
shared_flag_svr4='-shared $wl-G'
else
# not using gcc
if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then
shared_flag='$wl-G'
else
shared_flag='$wl-bM:SRE'
fi
shared_flag_aix='$wl-bM:SRE'
shared_flag_svr4='$wl-G'
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,yes = "$with_aix_soname,$aix_use_runtimelinking"; 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
else
if test ia64 = "$host_cpu"; 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 yes = "$with_gnu_ld"; 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
_LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
# -brtl affects multiple linker settings, -berok does not and is overridden later
compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
if test svr4 != "$with_aix_soname"; then
# This is similar to how AIX traditionally builds its shared libraries.
_LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
fi
if test aix != "$with_aix_soname"; then
_LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
else
# used by -dlpreopen to get the symbols
_LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
fi
_LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
cp "$export_symbols" "$output_objdir/$soname.def";
echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
else
$SED -e '\''s/^/-link -EXPORT:/'\'' < $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 yes = "$GCC"; 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 "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; 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 no = "$with_gnu_ld"; 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 yes,no = "$GCC,$with_gnu_ld"; 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 no = "$with_gnu_ld"; 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 yes = "$GCC"; 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 yes = "$lt_cv_irix_exported_symbol"; 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
;;
linux*)
case $cc_basename in
tcc*)
# Fabrice Bellard et al's Tiny C Compiler
_LT_TAGVAR(ld_shlibs, $1)=yes
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
;;
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
newsos6)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*nto* | *qnx*)
;;
openbsd* | bitrig*)
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__`"; 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
_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'
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
shrext_cmds=.dll
_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
$ECHO EXPORTS >> $output_objdir/$libname.def~
emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
$ECHO EXPORTS >> $output_objdir/$libname.def~
prefix_cmds="$SED"~
if test EXPORTS = "`$SED 1q $export_symbols`"; then
prefix_cmds="$prefix_cmds -e 1d";
fi~
prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
;;
osf3*)
if test yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT 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 yes = "$GCC"; 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 sni = "$host_vendor"; 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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes,yes = "$GCC,$enable_shared"; 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
## 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...
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 what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
aix[[4-9]]*)
if test ia64 != "$host_cpu"; then
case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
yes,aix,yes) ;; # shared object as lib.so file only
yes,svr4,*) ;; # shared object as lib.so archive member only
yes,*) enable_static=no ;; # shared object in lib.a archive as well
esac
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 yes = "$enable_shared" || 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 no != "$CXX" &&
( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
(test g++ != "$CXX"))); 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 yes != "$_lt_caught_CXX_error"; 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 yes = "$GXX"; 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 yes = "$GXX"; 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 yes = "$with_gnu_ld"; 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 ia64 = "$host_cpu"; 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
# have runtime linking enabled, and use it for executables.
# For shared libraries, we enable/disable runtime linking
# depending on the kind of the shared library created -
# when "with_aix_soname,aix_use_runtimelinking" is:
# "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
# "aix,yes" lib.so shared, rtl:yes, for executables
# lib.a static archive
# "both,no" lib.so.V(shr.o) shared, rtl:yes
# lib.a(lib.so.V) shared, rtl:no, for executables
# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
# lib.a(lib.so.V) shared, rtl:no
# "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
# lib.a static archive
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
if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
# With aix-soname=svr4, we create the lib.so.V shared archives only,
# so we don't have lib.a shared libs to link our executables.
# We have to force runtime linking in this case.
aix_use_runtimelinking=yes
LDFLAGS="$LDFLAGS -Wl,-brtl"
fi
;;
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,'
case $with_aix_soname,$aix_use_runtimelinking in
aix,*) ;; # no import file
svr4,* | *,yes) # use import file
# The Import File defines what to hardcode.
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
;;
esac
if test yes = "$GXX"; 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 yes = "$aix_use_runtimelinking"; then
shared_flag=$shared_flag' $wl-G'
fi
# Need to ensure runtime linking is disabled for the traditional
# shared library, or the linker may eventually find shared libraries
# /with/ Import File - we do not want to mix them.
shared_flag_aix='-shared'
shared_flag_svr4='-shared $wl-G'
else
# not using gcc
if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then
shared_flag='$wl-G'
else
shared_flag='$wl-bM:SRE'
fi
shared_flag_aix='$wl-bM:SRE'
shared_flag_svr4='$wl-G'
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,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
# The "-G" linker flag allows undefined symbols.
_LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
# 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
else
if test ia64 = "$host_cpu"; 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 yes = "$with_gnu_ld"; 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
_LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
# -brtl affects multiple linker settings, -berok does not and is overridden later
compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
if test svr4 != "$with_aix_soname"; then
# This is similar to how AIX traditionally builds its shared
# libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
_LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
fi
if test aix != "$with_aix_soname"; then
_LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
else
# used by -dlpreopen to get the symbols
_LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
fi
_LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
cp "$export_symbols" "$output_objdir/$soname.def";
echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
else
$SED -e '\''s/^/-link -EXPORT:/'\'' < $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, use it as
# is; otherwise, prepend EXPORTS...
_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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)
;;
os2*)
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
shrext_cmds=.dll
_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
$ECHO EXPORTS >> $output_objdir/$libname.def~
emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
$ECHO EXPORTS >> $output_objdir/$libname.def~
prefix_cmds="$SED"~
if test EXPORTS = "`$SED 1q $export_symbols`"; then
prefix_cmds="$prefix_cmds -e 1d";
fi~
prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
;;
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
;;
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 "x$output_objdir/$soname" = "x$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 yes = "$GXX"; 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 "x$output_objdir/$soname" = "x$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 no = "$with_gnu_ld"; 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 yes = "$GXX"; then
if test no = "$with_gnu_ld"; 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 yes = "$GXX"; then
if test no = "$with_gnu_ld"; 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 | 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 yes = "$supports_anon_versioning"; 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
;;
openbsd* | bitrig*)
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__`"; 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 yes,no = "$GXX,$with_gnu_ld"; 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 yes,no = "$GXX,$with_gnu_ld"; 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 $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 $wl-h $wl$soname -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 $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 $wl-h $wl$soname -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 CANNOT 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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes != "$_lt_caught_CXX_error"
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 @S|@2 in
.*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@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 x-L = "$p" ||
test x-R = "$p"; 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 no = "$pre_test_object_deps_done"; 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 no = "$pre_test_object_deps_done"; 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)=
;;
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 no = "$F77"; 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 yes != "$_lt_disable_F77"; 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
aix[[4-9]]*)
if test ia64 != "$host_cpu"; then
case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
yes,aix,yes) ;; # shared object as lib.so file only
yes,svr4,*) ;; # shared object as lib.so archive member only
yes,*) enable_static=no ;; # shared object in lib.a archive as well
esac
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 yes = "$enable_shared" || 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 yes != "$_lt_disable_F77"
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 no = "$FC"; 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 yes != "$_lt_disable_FC"; 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
aix[[4-9]]*)
if test ia64 != "$host_cpu"; then
case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
yes,aix,yes) ;; # shared object as lib.so file only
yes,svr4,*) ;; # shared object as lib.so archive member only
yes,*) enable_static=no ;; # shared object in lib.a archive as well
esac
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 yes = "$enable_shared" || 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 yes != "$_lt_disable_FC"
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
## 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...
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
## 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...
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 set = "${GCJFLAGS+set}" || 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 10 -lt "$lt_ac_count" && 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],
[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_PATH_CONVERSION_FUNCTIONS
# -----------------------------
# Determine what 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
xf86-video-nouveau-1.0.16/m4/ltsugar.m4 0000644 0001750 0001756 00000010440 13423754636 014364 0000000 0000000 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007-2008, 2011-2015 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
])
xf86-video-nouveau-1.0.16/configure.ac 0000644 0001750 0001756 00000012666 13423754626 014422 0000000 0000000 # Copyright 2005 Adam Jackson.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Process this file with autoconf to produce a configure script
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-nouveau],
[1.0.16],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/nouveau],
[xf86-video-nouveau])
AC_DEFINE_UNQUOTED([NV_DRIVER_DATE],
[$(echo -n \";git log |head -3|tail -1|tr -d '\n';echo -n \")],
[Driver date])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR(.)
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen
Hint: either install from source, https://gitlab.freedesktop.org/xorg/util/macros.git or,
depending on you distribution, try package 'xutils-dev' or 'xorg-x11-util-macros'])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
# Require X.Org server macros (i.e. XORG_DRIVER_CHECK_EXT) to check for required modules
m4_ifndef([XORG_DRIVER_CHECK_EXT],
[m4_fatal([must install xorg-server macros before running autoconf/autogen
Hint: either install from source, https://gitlab.freedesktop.org/xorg/xserver.git or,
depending on your distribution, try package 'xserver-xorg-dev' or 'xorg-x11-server-devel'])])
# Initialize libtool
LT_INIT([disable-static])
AH_TOP([#include "xorg-server.h"])
# Define a configure option for an alternate module directory
AC_ARG_WITH(xorg-module-dir,
AS_HELP_STRING([--with-xorg-module-dir=DIR],
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
[moduledir="$withval"],
[moduledir="$libdir/xorg/modules"])
# Store the list of server defined optional extensions in REQUIRED_MODULES
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
XORG_DRIVER_CHECK_EXT(XV, videoproto)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
XORG_DRIVER_CHECK_EXT(DRI2, [dri2proto >= 2.6])
# Checks for libraries
PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.60])
PKG_CHECK_MODULES(LIBDRM_NOUVEAU, [libdrm_nouveau >= 2.4.25])
# Obtain compiler/linker options for the driver dependencies
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.8] xproto fontsproto $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" ])
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
PKG_CHECK_MODULES(LIBUDEV, [libudev], [LIBUDEV=yes], [LIBUDEV=no])
if test "x$LIBUDEV" = xyes; then
AC_DEFINE(HAVE_LIBUDEV, 1, [libudev support])
fi
AM_CONDITIONAL(LIBUDEV, [ test "x$LIBUDEV" = "xyes" ] )
# Use -Wall all the time
CFLAGS="$CFLAGS -Wall"
# Check for -minline-all-stringops availability
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -minline-all-stringops"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ ]])],
[ CFLAGS="$OLD_CFLAGS -minline-all-stringops"],[CFLAGS="$OLD_CFLAGS"])
# needed for the next test
CFLAGS="$CFLAGS $XORG_CFLAGS"
AC_SUBST([CFLAGS])
AC_SUBST([moduledir])
DRIVER_NAME=nouveau
AC_SUBST([DRIVER_NAME])
AC_CHECK_DECL(xf86CursorResetCursor,
[AC_DEFINE(HAVE_XF86_CURSOR_RESET_CURSOR, 1,
[Have xf86CursorResetCursor API])], [],
[#include
#include ])
AC_CHECK_DECL(xorg_list_init,
[AC_DEFINE(HAVE_XORG_LIST, 1, [Have xorg_list API])], [],
[#include
#include "xorg-server.h"
#include "list.h"])
AC_CONFIG_FILES([
Makefile
src/Makefile
man/Makefile
])
AC_OUTPUT
dnl
dnl Output some configuration info for the user
dnl
echo ""
echo " prefix: $prefix"
echo " exec_prefix: $exec_prefix"
echo " libdir: $libdir"
echo " includedir: $includedir"
echo ""
echo " CFLAGS: $CFLAGS"
echo " CXXFLAGS: $CXXFLAGS"
echo " Macros: $DEFINES"
echo ""
echo " Run '${MAKE-make}' to build xf86-video-nouveau"
echo ""
xf86-video-nouveau-1.0.16/config.sub 0000755 0001750 0001756 00000107415 13423754646 014116 0000000 0000000 #! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2017 Free Software Foundation, Inc.
timestamp='2017-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 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 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. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches to .
#
# 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
# 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 or 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 1992-2017 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-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | cloudabi*-eabi* | \
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*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-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 | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| ba \
| be32 | be64 \
| bfin \
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx | dvp \
| e2k | epiphany \
| fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| k1om \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | microblazeel | 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 \
| mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pru \
| pyramid \
| riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]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 \
| visium \
| 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
;;
leon|leon[3-9])
basic_machine=sparc-$basic_machine
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | 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-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| ba-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| e2k-* | 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-* \
| k1om-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| 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-* \
| mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pru-* \
| pyramid-* \
| riscv32-* | riscv64-* \
| 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-* \
| visium-* \
| 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
;;
asmjs)
basic_machine=asmjs-unknown
;;
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
;;
e500v[12])
basic_machine=powerpc-unknown
os=$os"spe"
;;
e500v[12]-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
os=$os"spe"
;;
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
;;
leon-*|leon[3-9]-*)
basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
;;
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
;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
mingw32)
basic_machine=i686-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
;;
mipsEE* | ee | ps2)
basic_machine=mips64r5900el-scei
case $os in
-linux*)
;;
*)
os=-elf
;;
esac
;;
iop)
basic_machine=mipsel-scei
os=-irx
;;
dvp)
basic_machine=dvp-scei
os=-elf
;;
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
;;
moxiebox)
basic_machine=moxie-unknown
os=-moxiebox
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i686-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)
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)
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 | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
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* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* | -cloudabi* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -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* | -glidix* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
| -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
# 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
;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-nacl*)
;;
-ios)
;;
-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
;;
c8051-*)
os=-elf
;;
hexagon-*)
os=-elf
;;
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
;;
pru-*)
os=-elf
;;
*-be)
os=-beos
;;
*-haiku)
os=-haiku
;;
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-cnk*|-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
xf86-video-nouveau-1.0.16/src/ 0000755 0001750 0001756 00000000000 13423754654 012771 5 0000000 0000000 xf86-video-nouveau-1.0.16/src/nv04_exa.c 0000644 0001750 0001756 00000030423 13423754626 014502 0000000 0000000 /*
* Copyright 2003 NVIDIA, 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 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.
*/
#include "nv_include.h"
#include "nv_rop.h"
#include "hwdefs/nv_object.xml.h"
#include "hwdefs/nv_m2mf.xml.h"
#include "hwdefs/nv01_2d.xml.h"
#include "nv04_accel.h"
static void
NV04EXASetPattern(NVPtr pNv, CARD32 clr0, CARD32 clr1, CARD32 pat0, CARD32 pat1)
{
struct nouveau_pushbuf *push = pNv->pushbuf;
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, pNv->NvImagePattern->handle);
BEGIN_NV04(push, NV01_PATT(MONOCHROME_COLOR(0)), 4);
PUSH_DATA (push, clr0);
PUSH_DATA (push, clr1);
PUSH_DATA (push, pat0);
PUSH_DATA (push, pat1);
}
static Bool
NV04EXASetROP(PixmapPtr ppix, int subc, int mthd, int alu, Pixel planemask)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
if (ppix->drawable.bitsPerPixel < 32)
planemask |= ~0 << ppix->drawable.bitsPerPixel;
if (planemask != ~0 || alu != GXcopy) {
if (ppix->drawable.bitsPerPixel == 32)
return FALSE;
if (planemask != ~0) {
NV04EXASetPattern(pNv, 0, planemask, ~0, ~0);
if (pNv->currentRop != (alu + 32)) {
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, pNv->NvRop->handle);
BEGIN_NV04(push, NV01_ROP(ROP), 1);
PUSH_DATA (push, NVROP[alu].copy_planemask);
pNv->currentRop = alu + 32;
}
} else
if (pNv->currentRop != alu) {
if(pNv->currentRop >= 16)
NV04EXASetPattern(pNv, ~0, ~0, ~0, ~0);
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, pNv->NvRop->handle);
BEGIN_NV04(push, NV01_ROP(ROP), 1);
PUSH_DATA (push, NVROP[alu].copy);
pNv->currentRop = alu;
}
BEGIN_NV04(push, subc, mthd, 1);
PUSH_DATA (push, 1); /* ROP_AND */
} else {
BEGIN_NV04(push, subc, mthd, 1);
PUSH_DATA (push, 3); /* SRCCOPY */
}
return TRUE;
}
Bool
NV04EXAPrepareSolid(PixmapPtr ppix, int alu, Pixel planemask, Pixel fg)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
unsigned pitch = exaGetPixmapPitch(ppix);
unsigned surf_fmt, rect_fmt;
/* When SURFACE_FORMAT_A8R8G8B8 is used with GDI_RECTANGLE_TEXT, the
* alpha channel gets forced to 0xFF for some reason. We're using
* SURFACE_FORMAT_Y32 as a workaround
*/
if (!NVAccelGetCtxSurf2DFormatFromPixmap(ppix, (int*)&surf_fmt))
return FALSE;
if (surf_fmt == NV04_SURFACE_2D_FORMAT_A8R8G8B8)
surf_fmt = NV04_SURFACE_2D_FORMAT_Y32;
rect_fmt = NV04_GDI_COLOR_FORMAT_A8R8G8B8;
if (ppix->drawable.bitsPerPixel == 16) {
if (ppix->drawable.depth == 16)
rect_fmt = NV04_GDI_COLOR_FORMAT_A16R5G6B5;
else
rect_fmt = NV04_GDI_COLOR_FORMAT_X16A1R5G5B5;
}
if (!PUSH_SPACE(push, 64))
return FALSE;
PUSH_RESET(push);
if (!NV04EXASetROP(ppix, NV04_RECT(OPERATION), alu, planemask))
return FALSE;
BEGIN_NV04(push, NV04_SF2D(FORMAT), 4);
PUSH_DATA (push, surf_fmt);
PUSH_DATA (push, (pitch << 16) | pitch);
PUSH_MTHDl(push, NV04_SF2D(OFFSET_SOURCE), bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
PUSH_MTHDl(push, NV04_SF2D(OFFSET_DESTIN), bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
BEGIN_NV04(push, NV04_RECT(COLOR_FORMAT), 1);
PUSH_DATA (push, rect_fmt);
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push)) {
nouveau_pushbuf_bufctx(push, NULL);
return FALSE;
}
pNv->fg_colour = fg;
return TRUE;
}
void
NV04EXASolid (PixmapPtr pPixmap, int x, int y, int x2, int y2)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
int w = x2 - x;
int h = y2 - y;
if (!PUSH_SPACE(push, 5))
return;
BEGIN_NV04(push, NV04_RECT(COLOR1_A), 1);
PUSH_DATA (push, pNv->fg_colour);
BEGIN_NV04(push, NV04_RECT(UNCLIPPED_RECTANGLE_POINT(0)), 2);
PUSH_DATA (push, (x << 16) | y);
PUSH_DATA (push, (w << 16) | h);
if ((w * h) >= 512)
PUSH_KICK(push);
}
void
NV04EXADoneSolid (PixmapPtr pPixmap)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
nouveau_pushbuf_bufctx(NVPTR(pScrn)->pushbuf, NULL);
}
Bool
NV04EXAPrepareCopy(PixmapPtr pspix, PixmapPtr pdpix, int dx, int dy,
int alu, Pixel planemask)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pspix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_bo *src_bo = nouveau_pixmap_bo(pspix);
struct nouveau_bo *dst_bo = nouveau_pixmap_bo(pdpix);
int surf_fmt;
if (pspix->drawable.bitsPerPixel != pdpix->drawable.bitsPerPixel)
return FALSE;
if (!NVAccelGetCtxSurf2DFormatFromPixmap(pdpix, &surf_fmt))
return FALSE;
if (!PUSH_SPACE(push, 64))
return FALSE;
PUSH_RESET(push);
if (!NV04EXASetROP(pdpix, NV01_BLIT(OPERATION), alu, planemask))
return FALSE;
BEGIN_NV04(push, NV04_SF2D(FORMAT), 4);
PUSH_DATA (push, surf_fmt);
PUSH_DATA (push, (exaGetPixmapPitch(pdpix) << 16) |
exaGetPixmapPitch(pspix));
PUSH_MTHDl(push, NV04_SF2D(OFFSET_SOURCE), src_bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
PUSH_MTHDl(push, NV04_SF2D(OFFSET_DESTIN), dst_bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push)) {
nouveau_pushbuf_bufctx(push, NULL);
return FALSE;
}
pNv->pspix = pspix;
pNv->pmpix = NULL;
pNv->pdpix = pdpix;
return TRUE;
}
void
NV04EXACopy(PixmapPtr pdpix, int srcX, int srcY, int dstX, int dstY,
int width, int height)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pdpix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
int split_dstY = NOUVEAU_ALIGN(dstY + 1, 64);
int split_height = split_dstY - dstY;
if (nouveau_pushbuf_space(push, 16, 2, 0))
return;
if ((width * height) >= 200000 && pNv->pspix != pNv->pdpix &&
(dstY > srcY || dstX > srcX) && split_height < height) {
/*
* KLUDGE - Split the destination rectangle in an
* upper misaligned half and a lower tile-aligned
* half, then get IMAGE_BLIT to blit the lower piece
* downwards (required for sync-to-vblank if the area
* to be blitted is large enough). The blob does a
* different (not nicer) trick to achieve the same
* effect.
*/
struct nouveau_bo *dst_bo = nouveau_pixmap_bo(pdpix);
unsigned dst_pitch = exaGetPixmapPitch(pdpix);
BEGIN_NV04(push, NV01_BLIT(POINT_IN), 3);
PUSH_DATA (push, (srcY << 16) | srcX);
PUSH_DATA (push, (dstY << 16) | dstX);
PUSH_DATA (push, (split_height << 16) | width);
BEGIN_NV04(push, NV04_SF2D(OFFSET_DESTIN), 1);
PUSH_RELOC(push, dst_bo, split_dstY * dst_pitch,
NOUVEAU_BO_LOW, 0, 0);
srcY += split_height;
height -= split_height;
dstY = 0;
pNv->pmpix = pdpix;
}
BEGIN_NV04(push, NV01_BLIT(POINT_IN), 3);
PUSH_DATA (push, (srcY << 16) | srcX);
PUSH_DATA (push, (dstY << 16) | dstX);
PUSH_DATA (push, (height << 16) | width);
if (pNv->pmpix) {
struct nouveau_bo *dst_bo = nouveau_pixmap_bo(pdpix);
BEGIN_NV04(push, NV04_SF2D(OFFSET_DESTIN), 1);
PUSH_RELOC(push, dst_bo, 0, NOUVEAU_BO_LOW, 0, 0);
pNv->pmpix = NULL;
}
if ((width * height) >= 512)
PUSH_KICK(push);
}
void
NV04EXADoneCopy(PixmapPtr pdpix)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pdpix->drawable.pScreen);
nouveau_pushbuf_bufctx(NVPTR(pScrn)->pushbuf, NULL);
}
Bool
NV04EXAUploadIFC(ScrnInfoPtr pScrn, const char *src, int src_pitch,
PixmapPtr pdpix, int x, int y, int w, int h, int cpp)
{
NVPtr pNv = NVPTR(pScrn);
ScreenPtr pScreen = pdpix->drawable.pScreen;
struct nouveau_bo *bo = nouveau_pixmap_bo(pdpix);
struct nouveau_pushbuf *push = pNv->pushbuf;
int line_len = w * cpp;
int surf_fmt, ifc_fmt;
int iw, id, py, ph;
int padbytes;
Bool ret = FALSE;
if (pNv->Architecture >= NV_TESLA)
return FALSE;
if (h > 1024)
return FALSE;
if (line_len < 4)
return FALSE;
switch (cpp) {
case 2: ifc_fmt = 1; break;
case 4: ifc_fmt = 4; break;
default:
return FALSE;
}
if (!NVAccelGetCtxSurf2DFormatFromPixmap(pdpix, &surf_fmt))
return FALSE;
/* Pad out input width to cover both COLORA() and COLORB() */
iw = (line_len + 7) & ~7;
padbytes = iw - line_len;
id = iw / 4; /* line push size */
iw /= cpp;
/* Don't support lines longer than max push size yet.. */
if (id > 1792)
return FALSE;
if (!PUSH_SPACE(push, 16))
return FALSE;
PUSH_RESET(push);
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, pNv->NvClipRectangle->handle);
BEGIN_NV04(push, NV01_CLIP(POINT), 2);
PUSH_DATA (push, (y << 16) | x);
PUSH_DATA (push, (h << 16) | w);
BEGIN_NV04(push, NV04_SF2D(FORMAT), 4);
PUSH_DATA (push, surf_fmt);
PUSH_DATA (push, (exaGetPixmapPitch(pdpix) << 16) |
exaGetPixmapPitch(pdpix));
PUSH_MTHDl(push, NV04_SF2D(OFFSET_SOURCE), bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
PUSH_MTHDl(push, NV04_SF2D(OFFSET_DESTIN), bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push))
goto out;
py = y;
ph = h;
while (ph--) {
if (PUSH_AVAIL(push) < id + 1 || (py == y)) {
if (!PUSH_SPACE(push, id + 8))
goto out;
BEGIN_NV04(push, NV01_IFC(OPERATION), 2);
PUSH_DATA (push, NV01_IFC_OPERATION_SRCCOPY);
PUSH_DATA (push, ifc_fmt);
BEGIN_NV04(push, NV01_IFC(POINT), 3);
PUSH_DATA (push, (py << 16) | x);
PUSH_DATA (push, (h << 16) | w);
PUSH_DATA (push, (h << 16) | iw);
}
/* send a line */
if (ph > 0 || !padbytes) {
BEGIN_NV04(push, NV01_IFC(COLOR(0)), id);
PUSH_DATAp(push, src, id);
} else {
char padding[8];
int aux = (padbytes + 7) >> 2;
memcpy(padding, src + (id - aux) * 4, padbytes);
BEGIN_NV04(push, NV01_IFC(COLOR(0)), id);
PUSH_DATAp(push, src, id - aux);
PUSH_DATAp(push, padding, aux);
}
src += src_pitch;
py++;
}
ret = TRUE;
out:
nouveau_pushbuf_bufctx(push, NULL);
if (pdpix == pScreen->GetScreenPixmap(pScreen))
PUSH_KICK(push);
return ret;
}
Bool
NV04EXARectM2MF(NVPtr pNv, int w, int h, int cpp,
struct nouveau_bo *src, uint32_t src_off, int src_dom,
int src_pitch, int src_h, int src_x, int src_y,
struct nouveau_bo *dst, uint32_t dst_off, int dst_dom,
int dst_pitch, int dst_h, int dst_x, int dst_y)
{
struct nv04_fifo *fifo = pNv->channel->data;
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_pushbuf_refn refs[] = {
{ src, src_dom | NOUVEAU_BO_RD },
{ dst, dst_dom | NOUVEAU_BO_WR },
};
src_off += src_y * src_pitch + src_x * cpp;
dst_off += dst_y * dst_pitch + dst_x * cpp;
while (h) {
int line_count = h;
if (line_count > 2047)
line_count = 2047;
h -= line_count;
if (nouveau_pushbuf_space(push, 16, 4, 0) ||
nouveau_pushbuf_refn (push, refs, 2))
return FALSE;
BEGIN_NV04(push, NV03_M2MF(DMA_BUFFER_IN), 2);
PUSH_RELOC(push, src, 0, NOUVEAU_BO_OR, fifo->vram, fifo->gart);
PUSH_RELOC(push, dst, 0, NOUVEAU_BO_OR, fifo->vram, fifo->gart);
BEGIN_NV04(push, NV03_M2MF(OFFSET_IN), 8);
PUSH_RELOC(push, src, src_off, NOUVEAU_BO_LOW, 0, 0);
PUSH_RELOC(push, dst, dst_off, NOUVEAU_BO_LOW, 0, 0);
PUSH_DATA (push, src_pitch);
PUSH_DATA (push, dst_pitch);
PUSH_DATA (push, w * cpp);
PUSH_DATA (push, line_count);
PUSH_DATA (push, 0x00000101);
PUSH_DATA (push, 0x00000000);
BEGIN_NV04(push, NV04_GRAPH(M2MF, NOP), 1);
PUSH_DATA (push, 0x00000000);
BEGIN_NV04(push, NV03_M2MF(OFFSET_OUT), 1);
PUSH_DATA (push, 0x00000000);
src_off += src_pitch * line_count;
dst_off += dst_pitch * line_count;
}
return TRUE;
}
xf86-video-nouveau-1.0.16/src/nv50_xv.c 0000644 0001750 0001756 00000032666 13423754626 014376 0000000 0000000 /*
* Copyright 2008 Ben Skeggs
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "xf86xv.h"
#include
#include "exa.h"
#include "damage.h"
#include "dixstruct.h"
#include "fourcc.h"
#include "nv_include.h"
#include "nv_dma.h"
#include "nv50_accel.h"
extern Atom xvSyncToVBlank, xvSetDefaults;
extern Atom xvBrightness, xvContrast, xvHue, xvSaturation;
extern Atom xvITURBT709;
static Bool
nv50_xv_check_image_put(PixmapPtr ppix)
{
switch (ppix->drawable.bitsPerPixel) {
case 32:
case 24:
case 16:
case 15:
break;
default:
return FALSE;
}
if (!nv50_style_tiled_pixmap(ppix))
return FALSE;
return TRUE;
}
int
nv50_xv_image_put(ScrnInfoPtr pScrn,
struct nouveau_bo *src, int packed_y, int uv,
int id, int src_pitch, BoxPtr dstBox,
int x1, int y1, int x2, int y2,
uint16_t width, uint16_t height,
uint16_t src_w, uint16_t src_h,
uint16_t drw_w, uint16_t drw_h,
RegionPtr clipBoxes, PixmapPtr ppix,
NVPortPrivPtr pPriv)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_bo *dst = nouveau_pixmap_bo(ppix);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_pushbuf_refn refs[] = {
{ pNv->scratch, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR },
{ src, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD },
{ dst, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR },
};
uint32_t mode = 0xd0005000 | (src->config.nv50.tile_mode << 18);
float X1, X2, Y1, Y2;
BoxPtr pbox;
int nbox;
if (!nv50_xv_check_image_put(ppix))
return BadMatch;
if (!PUSH_SPACE(push, 256))
return BadImplementation;
BEGIN_NV04(push, NV50_3D(RT_ADDRESS_HIGH(0)), 5);
PUSH_DATA (push, dst->offset >> 32);
PUSH_DATA (push, dst->offset);
switch (ppix->drawable.depth) {
case 32: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGRA8_UNORM); break;
case 30: PUSH_DATA (push, NV50_SURFACE_FORMAT_RGB10_A2_UNORM); break;
case 24: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGRX8_UNORM); break;
case 16: PUSH_DATA (push, NV50_SURFACE_FORMAT_B5G6R5_UNORM); break;
case 15: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGR5_X1_UNORM); break;
}
PUSH_DATA (push, dst->config.nv50.tile_mode);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV50_3D(RT_HORIZ(0)), 2);
PUSH_DATA (push, ppix->drawable.width);
PUSH_DATA (push, ppix->drawable.height);
BEGIN_NV04(push, NV50_3D(RT_ARRAY_MODE), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV50_3D(BLEND_ENABLE(0)), 1);
PUSH_DATA (push, 0);
PUSH_DATAu(push, pNv->scratch, TIC_OFFSET, 16);
if (id == FOURCC_YV12 || id == FOURCC_I420) {
PUSH_DATA (push, NV50TIC_0_0_MAPA_C0 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_ZERO | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8);
PUSH_DATA (push, (src->offset + packed_y));
PUSH_DATA (push, (src->offset + packed_y) >> 32 | mode);
PUSH_DATA (push, 0x00300000);
PUSH_DATA (push, width);
PUSH_DATA (push, (1 << NV50TIC_0_5_DEPTH_SHIFT) | height);
PUSH_DATA (push, 0x03000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, NV50TIC_0_0_MAPA_C1 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_C0 | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8_8);
PUSH_DATA (push, (src->offset + uv));
PUSH_DATA (push, (src->offset + uv) >> 32 | mode);
PUSH_DATA (push, 0x00300000);
PUSH_DATA (push, width >> 1);
PUSH_DATA (push, (1 << NV50TIC_0_5_DEPTH_SHIFT) | (height >> 1));
PUSH_DATA (push, 0x03000000);
PUSH_DATA (push, 0x00000000);
} else {
if (id == FOURCC_UYVY) {
PUSH_DATA (push, NV50TIC_0_0_MAPA_C1 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_ZERO | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8_8);
} else {
PUSH_DATA (push, NV50TIC_0_0_MAPA_C0 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_ZERO | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8_8);
}
PUSH_DATA (push, (src->offset + packed_y));
PUSH_DATA (push, (src->offset + packed_y) >> 32 | mode);
PUSH_DATA (push, 0x00300000);
PUSH_DATA (push, width);
PUSH_DATA (push, (1 << NV50TIC_0_5_DEPTH_SHIFT) | height);
PUSH_DATA (push, 0x03000000);
PUSH_DATA (push, 0x00000000);
if (id == FOURCC_UYVY) {
PUSH_DATA (push, NV50TIC_0_0_MAPA_C2 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_C0 | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8_8_8_8);
} else {
PUSH_DATA (push, NV50TIC_0_0_MAPA_C3 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_C1 | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8_8_8_8);
}
PUSH_DATA (push, (src->offset + packed_y));
PUSH_DATA (push, (src->offset + packed_y) >> 32 | mode);
PUSH_DATA (push, 0x00300000);
PUSH_DATA (push, (width >> 1));
PUSH_DATA (push, (1 << NV50TIC_0_5_DEPTH_SHIFT) | height);
PUSH_DATA (push, 0x03000000);
PUSH_DATA (push, 0x00000000);
}
PUSH_DATAu(push, pNv->scratch, TSC_OFFSET, 16);
PUSH_DATA (push, NV50TSC_1_0_WRAPS_CLAMP_TO_EDGE |
NV50TSC_1_0_WRAPT_CLAMP_TO_EDGE |
NV50TSC_1_0_WRAPR_CLAMP_TO_EDGE);
PUSH_DATA (push, NV50TSC_1_1_MAGF_LINEAR |
NV50TSC_1_1_MINF_LINEAR |
NV50TSC_1_1_MIPF_NONE);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, NV50TSC_1_0_WRAPS_CLAMP_TO_EDGE |
NV50TSC_1_0_WRAPT_CLAMP_TO_EDGE |
NV50TSC_1_0_WRAPR_CLAMP_TO_EDGE);
PUSH_DATA (push, NV50TSC_1_1_MAGF_LINEAR |
NV50TSC_1_1_MINF_LINEAR |
NV50TSC_1_1_MIPF_NONE);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
BEGIN_NV04(push, NV50_3D(FP_START_ID), 1);
PUSH_DATA (push, PFP_NV12);
BEGIN_NV04(push, NV50_3D(TIC_FLUSH), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV50_3D(BIND_TIC(2)), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV50_3D(BIND_TIC(2)), 1);
PUSH_DATA (push, 0x203);
PUSH_DATAu(push, pNv->scratch, PVP_DATA, 11);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 1.0 / width);
PUSH_DATAf(push, 1.0 / height);
if (pPriv->SyncToVBlank)
NV50SyncToVBlank(ppix, dstBox);
/* These are fixed point values in the 16.16 format. */
X1 = (float)(x1>>16)+(float)(x1&0xFFFF)/(float)0x10000;
Y1 = (float)(y1>>16)+(float)(y1&0xFFFF)/(float)0x10000;
X2 = (float)(x2>>16)+(float)(x2&0xFFFF)/(float)0x10000;
Y2 = (float)(y2>>16)+(float)(y2&0xFFFF)/(float)0x10000;
pbox = REGION_RECTS(clipBoxes);
nbox = REGION_NUM_RECTS(clipBoxes);
while(nbox--) {
float tx1=X1+(float)(pbox->x1 - dstBox->x1)*(X2-X1)/(float)(drw_w);
float tx2=X1+(float)(pbox->x2 - dstBox->x1)*(src_w)/(float)(drw_w);
float ty1=Y1+(float)(pbox->y1 - dstBox->y1)*(Y2-Y1)/(float)(drw_h);
float ty2=Y1+(float)(pbox->y2 - dstBox->y1)*(src_h)/(float)(drw_h);
int sx1=pbox->x1;
int sx2=pbox->x2;
int sy1=pbox->y1;
int sy2=pbox->y2;
if (nouveau_pushbuf_space(push, 64, 0, 0) ||
nouveau_pushbuf_refn (push, refs, 3))
return BadImplementation;
/* NV50_3D_SCISSOR_VERT_T_SHIFT is wrong, because it was deducted with
* origin lying at the bottom left. This will be changed to _MIN_ and _MAX_
* later, because it is origin dependent.
*/
BEGIN_NV04(push, NV50_3D(SCISSOR_HORIZ(0)), 2);
PUSH_DATA (push, sx2 << NV50_3D_SCISSOR_HORIZ_MAX__SHIFT | sx1);
PUSH_DATA (push, sy2 << NV50_3D_SCISSOR_VERT_MAX__SHIFT | sy1 );
BEGIN_NV04(push, NV50_3D(VERTEX_BEGIN_GL), 1);
PUSH_DATA (push, NV50_3D_VERTEX_BEGIN_GL_PRIMITIVE_TRIANGLES);
PUSH_VTX1s(push, tx1, ty1, sx1, sy1);
PUSH_VTX1s(push, tx2+(tx2-tx1), ty1, sx2+(sx2-sx1), sy1);
PUSH_VTX1s(push, tx1, ty2+(ty2-ty1), sx1, sy2+(sy2-sy1));
BEGIN_NV04(push, NV50_3D(VERTEX_END_GL), 1);
PUSH_DATA (push, 0);
pbox++;
}
PUSH_KICK(push);
return Success;
}
void
nv50_xv_video_stop(ScrnInfoPtr pScrn, pointer data, Bool exit)
{
}
/* Reference color space transform data */
struct REF_TRANSFORM {
float RefLuma;
float RefRCb;
float RefRCr;
float RefGCb;
float RefGCr;
float RefBCb;
float RefBCr;
} trans[] = {
{ 1.1643, 0.0, 1.5960, -0.3918, -0.8129, 2.0172, 0.0 }, /* BT.601 */
{ 1.1643, 0.0, 1.7927, -0.2132, -0.5329, 2.1124, 0.0 } /* BT.709 */
};
#define RTFSaturation(a) (1.0 + ((a)*1.0)/1000.0)
#define RTFBrightness(a) (((a)*1.0)/2000.0)
#define RTFContrast(a) (1.0 + ((a)*1.0)/1000.0)
#define RTFHue(a) (((a)*3.1416)/1000.0)
void
nv50_xv_csc_update(ScrnInfoPtr pScrn, NVPortPrivPtr pPriv)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
const float Loff = -0.0627;
const float Coff = -0.502;
float yco, off[3], uco[3], vco[3];
float uvcosf, uvsinf;
float bright, cont;
int ref = pPriv->iturbt_709;
cont = RTFContrast(pPriv->contrast);
bright = RTFBrightness(pPriv->brightness);
uvcosf = RTFSaturation(pPriv->saturation) * cos(RTFHue(pPriv->hue));
uvsinf = RTFSaturation(pPriv->saturation) * sin(RTFHue(pPriv->hue));
yco = trans[ref].RefLuma * cont;
uco[0] = -trans[ref].RefRCr * uvsinf;
uco[1] = trans[ref].RefGCb * uvcosf - trans[ref].RefGCr * uvsinf;
uco[2] = trans[ref].RefBCb * uvcosf;
vco[0] = trans[ref].RefRCr * uvcosf;
vco[1] = trans[ref].RefGCb * uvsinf + trans[ref].RefGCr * uvcosf;
vco[2] = trans[ref].RefBCb * uvsinf;
off[0] = Loff * yco + Coff * (uco[0] + vco[0]) + bright;
off[1] = Loff * yco + Coff * (uco[1] + vco[1]) + bright;
off[2] = Loff * yco + Coff * (uco[2] + vco[2]) + bright;
if (pNv->Architecture >= NV_FERMI) {
nvc0_xv_csc_update(pNv, yco, off, uco, vco);
return;
}
if (nouveau_pushbuf_space(push, 64, 0, 0) ||
nouveau_pushbuf_refn (push, &(struct nouveau_pushbuf_refn) {
pNv->scratch, NOUVEAU_BO_WR |
NOUVEAU_BO_VRAM }, 1))
return;
PUSH_DATAu(push, pNv->scratch, PFP_DATA, 10);
PUSH_DATAf(push, yco);
PUSH_DATAf(push, off[0]);
PUSH_DATAf(push, off[1]);
PUSH_DATAf(push, off[2]);
PUSH_DATAf(push, uco[0]);
PUSH_DATAf(push, uco[1]);
PUSH_DATAf(push, uco[2]);
PUSH_DATAf(push, vco[0]);
PUSH_DATAf(push, vco[1]);
PUSH_DATAf(push, vco[2]);
}
void
nv50_xv_set_port_defaults(ScrnInfoPtr pScrn, NVPortPrivPtr pPriv)
{
pPriv->videoStatus = 0;
pPriv->grabbedByV4L = FALSE;
pPriv->blitter = FALSE;
pPriv->texture = TRUE;
pPriv->doubleBuffer = FALSE;
pPriv->SyncToVBlank = TRUE;
pPriv->brightness = 0;
pPriv->contrast = 0;
pPriv->saturation = 0;
pPriv->hue = 0;
pPriv->iturbt_709 = 0;
pPriv->max_image_dim = 8192;
}
int
nv50_xv_port_attribute_set(ScrnInfoPtr pScrn, Atom attribute,
INT32 value, pointer data)
{
NVPortPrivPtr pPriv = (NVPortPrivPtr)data;
if (attribute == xvSyncToVBlank) {
if (value < 0 || value > 1)
return BadValue;
pPriv->SyncToVBlank = value;
} else
if (attribute == xvBrightness) {
if (value < -1000 || value > 1000)
return BadValue;
pPriv->brightness = value;
} else
if (attribute == xvContrast) {
if (value < -1000 || value > 1000)
return BadValue;
pPriv->contrast = value;
} else
if (attribute == xvSaturation) {
if (value < -1000 || value > 1000)
return BadValue;
pPriv->saturation = value;
} else
if (attribute == xvHue) {
if (value < -1000 || value > 1000)
return BadValue;
pPriv->hue = value;
} else
if (attribute == xvITURBT709) {
if (value < 0 || value > 1)
return BadValue;
pPriv->iturbt_709 = value;
} else
if (attribute == xvSetDefaults) {
nv50_xv_set_port_defaults(pScrn, pPriv);
} else
return BadMatch;
nv50_xv_csc_update(pScrn, pPriv);
return Success;
}
int
nv50_xv_port_attribute_get(ScrnInfoPtr pScrn, Atom attribute,
INT32 *value, pointer data)
{
NVPortPrivPtr pPriv = (NVPortPrivPtr)data;
if (attribute == xvSyncToVBlank)
*value = (pPriv->SyncToVBlank) ? 1 : 0;
else
if (attribute == xvBrightness)
*value = pPriv->brightness;
else
if (attribute == xvContrast)
*value = pPriv->contrast;
else
if (attribute == xvSaturation)
*value = pPriv->saturation;
else
if (attribute == xvHue)
*value = pPriv->hue;
else
if (attribute == xvITURBT709)
*value = pPriv->iturbt_709;
else
return BadMatch;
return Success;
}
xf86-video-nouveau-1.0.16/src/nouveau_copy85b5.c 0000644 0001750 0001756 00000006614 13423754626 016203 0000000 0000000 /*
* Copyright 2014 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 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.
*
* Authors: Ben Skeggs
*/
#include "nouveau_copy.h"
#include "hwdefs/nv_object.xml.h"
#include "nv50_accel.h"
static Bool
nouveau_copy85b5_rect(struct nouveau_pushbuf *push, struct nouveau_object *copy,
int w, int h, int cpp,
struct nouveau_bo *src, uint32_t src_off, int src_dom,
int src_pitch, int src_h, int src_x, int src_y,
struct nouveau_bo *dst, uint32_t dst_off, int dst_dom,
int dst_pitch, int dst_h, int dst_x, int dst_y)
{
struct nouveau_pushbuf_refn refs[] = {
{ src, src_dom | NOUVEAU_BO_RD },
{ dst, dst_dom | NOUVEAU_BO_WR },
};
unsigned exec;
if (nouveau_pushbuf_space(push, 64, 0, 0) ||
nouveau_pushbuf_refn (push, refs, 2))
return FALSE;
exec = 0x00000000;
if (!src->config.nv50.memtype) {
src_off += src_y * src_pitch + src_x * cpp;
exec |= 0x00000010;
}
if (!dst->config.nv50.memtype) {
dst_off += dst_y * dst_pitch + dst_x * cpp;
exec |= 0x00000100;
}
BEGIN_NV04(push, SUBC_COPY(0x0200), 7);
PUSH_DATA (push, src->config.nv50.tile_mode);
PUSH_DATA (push, src_pitch);
PUSH_DATA (push, src_h);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
PUSH_DATA (push, src_x * cpp);
PUSH_DATA (push, src_y);
BEGIN_NV04(push, SUBC_COPY(0x0220), 7);
PUSH_DATA (push, dst->config.nv50.tile_mode);
PUSH_DATA (push, dst_pitch);
PUSH_DATA (push, dst_h);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
PUSH_DATA (push, dst_x * cpp);
PUSH_DATA (push, dst_y);
BEGIN_NV04(push, SUBC_COPY(0x030c), 8);
PUSH_DATA (push, (src->offset + src_off) >> 32);
PUSH_DATA (push, (src->offset + src_off));
PUSH_DATA (push, (dst->offset + dst_off) >> 32);
PUSH_DATA (push, (dst->offset + dst_off));
PUSH_DATA (push, src_pitch);
PUSH_DATA (push, dst_pitch);
PUSH_DATA (push, w * cpp);
PUSH_DATA (push, h);
BEGIN_NV04(push, SUBC_COPY(0x0300), 1);
PUSH_DATA (push, exec);
return TRUE;
}
Bool
nouveau_copy85b5_init(NVPtr pNv)
{
struct nouveau_pushbuf *push = pNv->ce_pushbuf;
struct nv04_fifo *fifo = pNv->ce_channel->data;
if (PUSH_SPACE(push, 8)) {
BEGIN_NV04(push, NV01_SUBC(COPY, OBJECT), 1);
PUSH_DATA (push, pNv->NvCopy->handle);
BEGIN_NV04(push, SUBC_COPY(0x0180), 3);
PUSH_DATA (push, fifo->vram);
PUSH_DATA (push, fifo->vram);
PUSH_DATA (push, fifo->vram);
pNv->ce_rect = nouveau_copy85b5_rect;
return TRUE;
}
return FALSE;
}
xf86-video-nouveau-1.0.16/src/nouveau_local.h 0000644 0001750 0001756 00000015214 13423754626 015720 0000000 0000000 /*
* Copyright 2007 Nouveau Project
*
* 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.
*/
#ifndef __NOUVEAU_LOCAL_H__
#define __NOUVEAU_LOCAL_H__
#include "compiler.h"
#include "xf86_OSproc.h"
#include
/* Debug output */
#define NOUVEAU_MSG(fmt,args...) ErrorF(fmt, ##args)
#define NOUVEAU_ERR(fmt,args...) \
ErrorF("%s:%d - "fmt, __func__, __LINE__, ##args)
#if 0
#define NOUVEAU_FALLBACK(fmt,args...) do { \
NOUVEAU_ERR("FALLBACK: "fmt, ##args); \
return FALSE; \
} while(0)
#else
#define NOUVEAU_FALLBACK(fmt,args...) do { \
return FALSE; \
} while(0)
#endif
#define NOUVEAU_ALIGN(x,bytes) (((x) + ((bytes) - 1)) & ~((bytes) - 1))
#define NV50_TILE_PITCH(m) (64 << ((m) & 0xf))
#define NV50_TILE_HEIGHT(m) (4 << ((m) >> 4))
#define NVC0_TILE_PITCH(m) (64 << ((m) & 0xf))
#define NVC0_TILE_HEIGHT(m) (8 << ((m) >> 4))
static inline int log2i(int i)
{
int r = 0;
if (i & 0xffff0000) {
i >>= 16;
r += 16;
}
if (i & 0x0000ff00) {
i >>= 8;
r += 8;
}
if (i & 0x000000f0) {
i >>= 4;
r += 4;
}
if (i & 0x0000000c) {
i >>= 2;
r += 2;
}
if (i & 0x00000002) {
r += 1;
}
return r;
}
static inline int round_down_pow2(int x)
{
return 1 << log2i(x);
}
static inline int round_up_pow2(int x)
{
int r = round_down_pow2(x);
if (r < x)
r <<= 1;
return r;
}
#define SWAP(x, y) do { \
typeof(x) __z = (x); \
(x) = (y); \
(y) = __z; \
} while (0)
static inline uint32_t
PUSH_AVAIL(struct nouveau_pushbuf *push)
{
return push->end - push->cur;
}
static inline Bool
PUSH_SPACE(struct nouveau_pushbuf *push, uint32_t size)
{
if (PUSH_AVAIL(push) < size)
return nouveau_pushbuf_space(push, size, 0, 0) == 0;
return TRUE;
}
static inline void
PUSH_DATA(struct nouveau_pushbuf *push, uint32_t data)
{
*push->cur++ = data;
}
static inline void
PUSH_DATAp(struct nouveau_pushbuf *push, const void *data, uint32_t size)
{
memcpy(push->cur, data, size * 4);
push->cur += size;
}
static inline void
PUSH_RELOC(struct nouveau_pushbuf *push, struct nouveau_bo *bo, uint32_t offset,
uint32_t flags, uint32_t vor, uint32_t tor)
{
nouveau_pushbuf_reloc(push, bo, offset, flags, vor, tor);
}
static inline void
PUSH_KICK(struct nouveau_pushbuf *push)
{
nouveau_pushbuf_kick(push, push->channel);
}
static inline struct nouveau_bufctx *
BUFCTX(struct nouveau_pushbuf *push)
{
return push->user_priv;
}
static inline void
PUSH_RESET(struct nouveau_pushbuf *push)
{
nouveau_bufctx_reset(BUFCTX(push), 0);
}
static inline void
PUSH_REFN(struct nouveau_pushbuf *push, struct nouveau_bo *bo, uint32_t access)
{
nouveau_bufctx_refn(BUFCTX(push), 0, bo, access);
}
static inline void
PUSH_MTHDl(struct nouveau_pushbuf *push, int subc, int mthd,
struct nouveau_bo *bo, uint32_t offset, uint32_t access)
{
nouveau_bufctx_mthd(BUFCTX(push), 0, (1 << 18) | (subc << 13) | mthd,
bo, offset, access | NOUVEAU_BO_LOW, 0, 0);
PUSH_DATA (push, bo->offset + offset);
}
static inline void
PUSH_MTHDo(struct nouveau_pushbuf *push, int subc, int mthd,
struct nouveau_bo *bo, uint32_t access, uint32_t vor, uint32_t tor)
{
nouveau_bufctx_mthd(BUFCTX(push), 0, (1 << 18) | (subc << 13) | mthd,
bo, 0, access | NOUVEAU_BO_OR, vor, tor);
if (bo->flags & NOUVEAU_BO_VRAM)
PUSH_DATA (push, vor);
else
PUSH_DATA (push, tor);
}
static inline void
PUSH_MTHDs(struct nouveau_pushbuf *push, int subc, int mthd,
struct nouveau_bo *bo, uint32_t data, uint32_t access,
uint32_t vor, uint32_t tor)
{
nouveau_bufctx_mthd(BUFCTX(push), 0, (1 << 18) | (subc << 13) | mthd,
bo, data, access | NOUVEAU_BO_OR, vor, tor);
if (bo->flags & NOUVEAU_BO_VRAM)
PUSH_DATA (push, data | vor);
else
PUSH_DATA (push, data | tor);
}
static inline void
PUSH_MTHD(struct nouveau_pushbuf *push, int subc, int mthd,
struct nouveau_bo *bo, uint32_t data, uint32_t access,
uint32_t vor, uint32_t tor)
{
nouveau_bufctx_mthd(BUFCTX(push), 0, (1 << 18) | (subc << 13) | mthd,
bo, data, access | NOUVEAU_BO_OR, vor, tor);
if (access & NOUVEAU_BO_LOW)
data += bo->offset;
if (access & NOUVEAU_BO_OR) {
if (bo->flags & NOUVEAU_BO_VRAM)
data |= vor;
else
data |= tor;
}
PUSH_DATA (push, data);
}
static inline void
PUSH_DATAf(struct nouveau_pushbuf *push, float v)
{
union { float f; uint32_t i; } d = { .f = v };
PUSH_DATA (push, d.i);
}
static inline void
BEGIN_NV04(struct nouveau_pushbuf *push, int subc, int mthd, int size)
{
PUSH_DATA (push, 0x00000000 | (size << 18) | (subc << 13) | mthd);
}
static inline void
BEGIN_NI04(struct nouveau_pushbuf *push, int subc, int mthd, int size)
{
PUSH_DATA (push, 0x40000000 | (size << 18) | (subc << 13) | mthd);
}
static inline void
BEGIN_NVC0(struct nouveau_pushbuf *push, int subc, int mthd, int size)
{
PUSH_DATA (push, 0x20000000 | (size << 16) | (subc << 13) | (mthd / 4));
}
static inline void
BEGIN_NIC0(struct nouveau_pushbuf *push, int subc, int mthd, int size)
{
PUSH_DATA (push, 0x60000000 | (size << 16) | (subc << 13) | (mthd / 4));
}
static inline void
IMMED_NVC0(struct nouveau_pushbuf *push, int subc, int mthd, int data)
{
PUSH_DATA (push, 0x80000000 | (data << 16) | (subc << 13) | (mthd / 4));
}
static inline void
BEGIN_1IC0(struct nouveau_pushbuf *push, int subc, int mthd, int size)
{
PUSH_DATA (push, 0xa0000000 | (size << 16) | (subc << 13) | (mthd / 4));
}
#define NV01_SUBC(subc, mthd) SUBC_##subc((NV01_SUBCHAN_##mthd))
#define NV11_SUBC(subc, mthd) SUBC_##subc((NV11_SUBCHAN_##mthd))
#define NV84_SUBC(subc, mthd) SUBC_##subc((NV84_SUBCHAN_##mthd))
#define NV04_GRAPH(subc, mthd) SUBC_##subc((NV04_GRAPH_##mthd))
#define NV50_GRAPH(subc, mthd) SUBC_##subc((NV50_GRAPH_##mthd))
#define NVC0_GRAPH(subc, mthd) SUBC_##subc((NVC0_GRAPH_##mthd))
#endif
xf86-video-nouveau-1.0.16/src/vl_hwmc.c 0000644 0001750 0001756 00000007200 13423754626 014512 0000000 0000000 #ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "vl_hwmc.h"
#include
#include
#include
#include
#include
#include "compat-api.h"
#define FOURCC_RGB 0x0000003
#define XVIMAGE_RGB \
{ \
FOURCC_RGB, \
XvRGB, \
LSBFirst, \
{ \
'R', 'G', 'B', 0x00, \
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71 \
}, \
32, \
XvPacked, \
1, \
24, 0x00FF0000, 0x0000FF00, 0x000000FF, \
0, 0, 0, \
0, 0, 0, \
0, 0, 0, \
{ \
'B','G','R','X', \
0,0,0,0,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 int subpicture_index_list[] =
{
FOURCC_RGB,
FOURCC_IA44,
FOURCC_AI44
};
static XF86MCImageIDList subpicture_list =
{
3,
subpicture_index_list
};
static XF86MCSurfaceInfoRec yv12_mpeg2_surface =
{
FOURCC_YV12,
XVMC_CHROMA_FORMAT_420,
0,
2048,
2048,
2048,
2048,
XVMC_IDCT | XVMC_MOCOMP | XVMC_MPEG_2,
XVMC_SUBPICTURE_INDEPENDENT_SCALING | XVMC_BACKEND_SUBPICTURE,
&subpicture_list
};
static XF86MCSurfaceInfoRec uyvy_mpeg2_surface =
{
FOURCC_UYVY,
XVMC_CHROMA_FORMAT_422,
0,
2048,
2048,
2048,
2048,
XVMC_IDCT | XVMC_MOCOMP | XVMC_MPEG_2,
XVMC_SUBPICTURE_INDEPENDENT_SCALING | XVMC_BACKEND_SUBPICTURE,
&subpicture_list
};
static XF86MCSurfaceInfoPtr surfaces[] =
{
(XF86MCSurfaceInfoPtr)&yv12_mpeg2_surface,
(XF86MCSurfaceInfoPtr)&uyvy_mpeg2_surface
};
static XF86ImageRec rgb_subpicture = XVIMAGE_RGB;
static XF86ImageRec ia44_subpicture = XVIMAGE_IA44;
static XF86ImageRec ai44_subpicture = XVIMAGE_AI44;
static XF86ImagePtr subpictures[] =
{
(XF86ImagePtr)&rgb_subpicture,
(XF86ImagePtr)&ia44_subpicture,
(XF86ImagePtr)&ai44_subpicture
};
static XF86MCAdaptorRec adaptor_template =
{
"",
2,
surfaces,
3,
subpictures,
(xf86XvMCCreateContextProcPtr)NULL,
(xf86XvMCDestroyContextProcPtr)NULL,
(xf86XvMCCreateSurfaceProcPtr)NULL,
(xf86XvMCDestroySurfaceProcPtr)NULL,
(xf86XvMCCreateSubpictureProcPtr)NULL,
(xf86XvMCDestroySubpictureProcPtr)NULL
};
XF86MCAdaptorPtr vlCreateAdaptorXvMC(ScreenPtr pScreen, char *xv_adaptor_name)
{
XF86MCAdaptorPtr adaptor;
ScrnInfoPtr pScrn;
assert(pScreen);
assert(xv_adaptor_name);
pScrn = xf86ScreenToScrn(pScreen);
adaptor = xf86XvMCCreateAdaptorRec();
if (!adaptor)
{
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] Memory allocation failed.\n");
return NULL;
}
*adaptor = adaptor_template;
adaptor->name = xv_adaptor_name;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[XvMC] Associated with %s.\n", xv_adaptor_name);
return adaptor;
}
void vlDestroyAdaptorXvMC(XF86MCAdaptorPtr adaptor)
{
assert(adaptor);
xf86XvMCDestroyAdaptorRec(adaptor);
}
/* TODO: Manage adaptor list and adaptor rec memory internally */
void vlInitXvMC(ScreenPtr pScreen, unsigned int num_adaptors, XF86MCAdaptorPtr *adaptors)
{
ScrnInfoPtr pScrn;
int i;
assert(pScreen);
assert(adaptors);
for (i = 0; i < num_adaptors; ++i)
assert(adaptors[i]);
pScrn = xf86ScreenToScrn(pScreen);
if (!xf86XvMCScreenInit(pScreen, num_adaptors, adaptors))
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] Failed to initialize extension.\n");
else
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[XvMC] Extension initialized.\n");
#if (XvMCVersion > 1) || (XvMCRevision > 0)
/*
if (xf86XvMCRegisterDRInfo(pScreen, "XvMCg3dvl", "0:0.0", -1, -1, -1) != Success)
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[XvMC] Failed to register client library, using XvMCConfig.\n");
else
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[XvMC] Registered client library.\n");
*/
#endif
}
xf86-video-nouveau-1.0.16/src/nv_type.h 0000644 0001750 0001756 00000013530 13423754626 014547 0000000 0000000 #ifndef __NV_STRUCT_H__
#define __NV_STRUCT_H__
#include "colormapst.h"
#include "xf86Cursor.h"
#include "exa.h"
#include "xf86drm.h"
#include
#include
#include "xf86Crtc.h"
#if XF86_CRTC_VERSION >= 5
#define NOUVEAU_PIXMAP_SHARING 1
#endif
#define NV_ARCH_03 0x03
#define NV_ARCH_04 0x04
#define NV_ARCH_10 0x10
#define NV_ARCH_20 0x20
#define NV_ARCH_30 0x30
#define NV_ARCH_40 0x40
#define NV_TESLA 0x50
#define NV_FERMI 0xc0
#define NV_KEPLER 0xe0
#define NV_MAXWELL 0x110
#define NV_PASCAL 0x130
struct xf86_platform_device;
/* NV50 */
typedef struct _NVRec *NVPtr;
typedef struct {
int fd;
unsigned long reinitGeneration;
struct xf86_platform_device *platform_dev;
unsigned int assigned_crtcs;
unsigned long fd_wakeup_registered;
int fd_wakeup_ref;
} NVEntRec, *NVEntPtr;
NVEntPtr NVEntPriv(ScrnInfoPtr pScrn);
typedef struct _NVRec {
uint32_t Architecture;
EntityInfoPtr pEnt;
struct pci_device *PciInfo;
Bool Primary;
Bool Secondary;
struct nouveau_bo * scanout;
enum {
UNKNOWN = 0,
NONE,
EXA,
} AccelMethod;
void (*Flush)(ScrnInfoPtr);
Bool HWCursor;
Bool ShadowFB;
unsigned char * ShadowPtr;
int ShadowPitch;
ExaDriverPtr EXADriverPtr;
Bool exa_force_cp;
Bool wfb_enabled;
Bool tiled_scanout;
Bool glx_vblank;
Bool has_async_pageflip;
Bool has_pageflip;
int swap_limit;
int max_swap_limit;
int max_dri_level;
ScreenBlockHandlerProcPtr BlockHandler;
CreateScreenResourcesProcPtr CreateScreenResources;
CloseScreenProcPtr CloseScreen;
void (*VideoTimerCallback)(ScrnInfoPtr, Time);
XF86VideoAdaptorPtr overlayAdaptor;
XF86VideoAdaptorPtr blitAdaptor;
XF86VideoAdaptorPtr textureAdaptor[2];
int videoKey;
OptionInfoPtr Options;
Bool LockedUp;
CARD32 currentRop;
void *drmmode; /* for KMS */
/* DRM interface */
struct nouveau_device *dev;
char *drm_device_name;
/* GPU context */
struct nouveau_client *client;
struct nouveau_bo *transfer;
CARD32 transfer_offset;
struct nouveau_object *channel;
struct nouveau_pushbuf *pushbuf;
struct nouveau_bufctx *bufctx;
struct nouveau_object *notify0;
struct nouveau_object *vblank_sem;
struct nouveau_object *NvNull;
struct nouveau_object *NvContextSurfaces;
struct nouveau_object *NvContextBeta1;
struct nouveau_object *NvContextBeta4;
struct nouveau_object *NvImagePattern;
struct nouveau_object *NvRop;
struct nouveau_object *NvRectangle;
struct nouveau_object *NvImageBlit;
struct nouveau_object *NvScaledImage;
struct nouveau_object *NvClipRectangle;
struct nouveau_object *NvMemFormat;
struct nouveau_object *NvImageFromCpu;
struct nouveau_object *Nv2D;
struct nouveau_object *Nv3D;
struct nouveau_object *NvSW;
struct nouveau_object *NvCOPY;
struct nouveau_bo *scratch;
Bool ce_enabled;
struct nouveau_object *ce_channel;
struct nouveau_pushbuf *ce_pushbuf;
struct nouveau_object *NvCopy;
Bool (*ce_rect)(struct nouveau_pushbuf *, struct nouveau_object *,
int, int, int,
struct nouveau_bo *, uint32_t, int, int, int, int, int,
struct nouveau_bo *, uint32_t, int, int, int, int, int);
/* SYNC extension private */
void *sync;
/* Present extension private */
void *present;
/* Acceleration context */
PixmapPtr pspix, pmpix, pdpix;
PicturePtr pspict, pmpict;
Pixel fg_colour;
char *render_node;
} NVRec;
#define NVPTR(p) ((NVPtr)((p)->driverPrivate))
typedef struct _NVPortPrivRec {
short brightness;
short contrast;
short saturation;
short hue;
RegionRec clip;
CARD32 colorKey;
Bool autopaintColorKey;
Bool doubleBuffer;
CARD32 videoStatus;
int currentBuffer;
Time videoTime;
int overlayCRTC;
Bool grabbedByV4L;
Bool iturbt_709;
Bool blitter;
Bool texture;
Bool bicubic; /* only for texture adapter */
Bool SyncToVBlank;
int max_image_dim;
struct nouveau_bo *video_mem;
int pitch;
int offset;
struct nouveau_bo *TT_mem_chunk[2];
int currentHostBuffer;
} NVPortPrivRec, *NVPortPrivPtr;
#define GET_OVERLAY_PRIVATE(pNv) \
(NVPortPrivPtr)((pNv)->overlayAdaptor->pPortPrivates[0].ptr)
#define GET_BLIT_PRIVATE(pNv) \
(NVPortPrivPtr)((pNv)->blitAdaptor->pPortPrivates[0].ptr)
#define OFF_TIMER 0x01
#define FREE_TIMER 0x02
#define CLIENT_VIDEO_ON 0x04
#define OFF_DELAY 500 /* milliseconds */
#define FREE_DELAY 5000
#define TIMER_MASK (OFF_TIMER | FREE_TIMER)
/* EXA driver-controlled pixmaps */
#define NOUVEAU_CREATE_PIXMAP_ZETA 0x10000000
#define NOUVEAU_CREATE_PIXMAP_TILED 0x20000000
#define NOUVEAU_CREATE_PIXMAP_SCANOUT 0x40000000
struct nouveau_pixmap {
struct nouveau_bo *bo;
Bool shared;
};
static inline struct nouveau_pixmap *
nouveau_pixmap(PixmapPtr ppix)
{
return (struct nouveau_pixmap *)exaGetPixmapDriverPrivate(ppix);
}
static inline struct nouveau_bo *
nouveau_pixmap_bo(PixmapPtr ppix)
{
struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
return nvpix ? nvpix->bo : NULL;
}
static inline uint32_t
nv_pitch_align(NVPtr pNv, uint32_t width, int bpp)
{
int mask;
if (bpp == 15)
bpp = 16;
if (bpp == 24 || bpp == 30)
bpp = 8;
/* Alignment requirements taken from the Haiku driver */
if (pNv->Architecture == NV_ARCH_04)
mask = 128 / bpp - 1;
else
mask = 512 / bpp - 1;
return (width + mask) & ~mask;
}
/* nv04 cursor max dimensions of 32x32 (A1R5G5B5) */
#define NV04_CURSOR_SIZE 32
/* limit nv10 cursors to 64x64 (ARGB8) (we could go to 64x255) */
#define NV10_CURSOR_SIZE 64
static inline int nv_cursor_width(NVPtr pNv)
{
return pNv->dev->chipset >= 0x10 ? NV10_CURSOR_SIZE : NV04_CURSOR_SIZE;
}
#define xFixedToFloat(v) \
((float)xFixedToInt((v)) + ((float)xFixedFrac(v) / 65536.0))
#endif /* __NV_STRUCT_H__ */
xf86-video-nouveau-1.0.16/src/nvc0_accel.c 0000644 0001750 0001756 00000033056 13423754626 015060 0000000 0000000 /*
* Copyright 2008 Ben Skeggs
*
* 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.
*/
#include "nv_include.h"
#include "nvc0_accel.h"
#include "shader/xfrm2nvc0.vp"
#include "shader/videonvc0.fp"
#include "shader/exascnvc0.fp"
#include "shader/exacmnvc0.fp"
#include "shader/exacanvc0.fp"
#include "shader/exasanvc0.fp"
#include "shader/exas8nvc0.fp"
#include "shader/exac8nvc0.fp"
#include "shader/xfrm2nve0.vp"
#include "shader/videonve0.fp"
#include "shader/exascnve0.fp"
#include "shader/exacmnve0.fp"
#include "shader/exacanve0.fp"
#include "shader/exasanve0.fp"
#include "shader/exas8nve0.fp"
#include "shader/exac8nve0.fp"
#include "shader/xfrm2nvf0.vp"
#include "shader/videonvf0.fp"
#include "shader/exascnvf0.fp"
#include "shader/exacmnvf0.fp"
#include "shader/exacanvf0.fp"
#include "shader/exasanvf0.fp"
#include "shader/exas8nvf0.fp"
#include "shader/exac8nvf0.fp"
#include "shader/xfrm2nv110.vp"
#include "shader/videonv110.fp"
#include "shader/exascnv110.fp"
#include "shader/exacmnv110.fp"
#include "shader/exacanv110.fp"
#include "shader/exasanv110.fp"
#include "shader/exas8nv110.fp"
#include "shader/exac8nv110.fp"
#define NVC0PushProgram(pNv,addr,code) do { \
const unsigned size = sizeof(code) / sizeof(code[0]); \
PUSH_DATAu((pNv)->pushbuf, (pNv)->scratch, (addr), size); \
PUSH_DATAp((pNv)->pushbuf, (code), size); \
} while(0)
void
NVC0SyncToVBlank(PixmapPtr ppix, BoxPtr box)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
int head;
xf86CrtcPtr crtc;
if (!pNv->NvSW || !nouveau_exa_pixmap_is_onscreen(ppix))
return;
crtc = nouveau_pick_best_crtc(pScrn, FALSE, box->x1, box->y1,
box->x2 - box->x1,
box->y2 - box->y1);
if (!crtc)
return;
if (!PUSH_SPACE(push, 32))
return;
head = drmmode_head(crtc);
BEGIN_NVC0(push, NV01_SUBC(NVSW, OBJECT), 1);
PUSH_DATA (push, pNv->NvSW->handle);
BEGIN_NVC0(push, NV84_SUBC(NVSW, SEMAPHORE_ADDRESS_HIGH), 4);
PUSH_DATA (push, (pNv->scratch->offset + SEMA_OFFSET) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + SEMA_OFFSET));
PUSH_DATA (push, 0x22222222);
PUSH_DATA (push, NV84_SUBCHAN_SEMAPHORE_TRIGGER_WRITE_LONG);
BEGIN_NVC0(push, SUBC_NVSW(0x0400), 4);
PUSH_DATA (push, (pNv->scratch->offset + SEMA_OFFSET) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + SEMA_OFFSET));
PUSH_DATA (push, 0x11111111);
PUSH_DATA (push, head);
BEGIN_NVC0(push, NV84_SUBC(NVSW, SEMAPHORE_ADDRESS_HIGH), 4);
PUSH_DATA (push, (pNv->scratch->offset + SEMA_OFFSET) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + SEMA_OFFSET));
PUSH_DATA (push, 0x11111111);
PUSH_DATA (push, NV84_SUBCHAN_SEMAPHORE_TRIGGER_ACQUIRE_EQUAL);
}
Bool
NVAccelInitM2MF_NVC0(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
int ret;
ret = nouveau_object_new(pNv->channel, 0x00009039, 0x9039,
NULL, 0, &pNv->NvMemFormat);
if (ret)
return FALSE;
BEGIN_NVC0(push, NV01_SUBC(M2MF, OBJECT), 1);
PUSH_DATA (push, pNv->NvMemFormat->handle);
BEGIN_NVC0(push, NVC0_M2MF(QUERY_ADDRESS_HIGH), 3);
PUSH_DATA (push, (pNv->scratch->offset + NTFY_OFFSET) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + NTFY_OFFSET));
PUSH_DATA (push, 0);
return TRUE;
}
Bool
NVAccelInitP2MF_NVE0(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
uint32_t class = (pNv->dev->chipset < 0xf0) ? 0xa040 : 0xa140;
int ret;
ret = nouveau_object_new(pNv->channel, class, class, NULL, 0,
&pNv->NvMemFormat);
if (ret)
return FALSE;
BEGIN_NVC0(push, NV01_SUBC(P2MF, OBJECT), 1);
PUSH_DATA (push, pNv->NvMemFormat->handle);
return TRUE;
}
Bool
NVAccelInitCOPY_NVE0(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
uint32_t class;
int ret;
if (pNv->dev->chipset < 0x110)
class = 0xa0b5;
else if (pNv->dev->chipset < 0x130)
class = 0xb0b5;
else
class = 0xc0b5;
ret = nouveau_object_new(pNv->channel, class, class,
NULL, 0, &pNv->NvCOPY);
if (ret)
return FALSE;
BEGIN_NVC0(push, NV01_SUBC(COPY, OBJECT), 1);
PUSH_DATA (push, pNv->NvCOPY->handle);
return TRUE;
}
Bool
NVAccelInit2D_NVC0(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
int ret;
ret = nouveau_object_new(pNv->channel, 0x0000902d, 0x902d,
NULL, 0, &pNv->Nv2D);
if (ret)
return FALSE;
if (!PUSH_SPACE(push, 64))
return FALSE;
BEGIN_NVC0(push, NV01_SUBC(2D, OBJECT), 1);
PUSH_DATA (push, pNv->Nv2D->handle);
BEGIN_NVC0(push, NV50_2D(CLIP_ENABLE), 1);
PUSH_DATA (push, 1);
BEGIN_NVC0(push, NV50_2D(COLOR_KEY_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NVC0(push, NV50_2D(UNK0884), 1);
PUSH_DATA (push, 0x3f);
BEGIN_NVC0(push, NV50_2D(UNK0888), 1);
PUSH_DATA (push, 1);
BEGIN_NVC0(push, NV50_2D(ROP), 1);
PUSH_DATA (push, 0x55);
BEGIN_NVC0(push, NV50_2D(OPERATION), 1);
PUSH_DATA (push, NV50_2D_OPERATION_SRCCOPY);
BEGIN_NVC0(push, NV50_2D(BLIT_DU_DX_FRACT), 4);
PUSH_DATA (push, 0);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
PUSH_DATA (push, 1);
BEGIN_NVC0(push, NV50_2D(DRAW_SHAPE), 2);
PUSH_DATA (push, 4);
PUSH_DATA (push, NV50_SURFACE_FORMAT_B5G6R5_UNORM);
BEGIN_NVC0(push, NV50_2D(PATTERN_COLOR_FORMAT), 2);
PUSH_DATA (push, 2);
PUSH_DATA (push, 1);
pNv->currentRop = 0xfffffffa;
return TRUE;
}
Bool
NVAccelInit3D_NVC0(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_bo *bo = pNv->scratch;
uint32_t class, handle;
int ret;
if (pNv->Architecture < NV_KEPLER) {
class = 0x9097;
handle = 0x001f906e;
} else if (pNv->dev->chipset == 0xea) {
class = 0xa297;
handle = 0x0000906e;
} else if (pNv->dev->chipset < 0xf0) {
class = 0xa097;
handle = 0x0000906e;
} else if (pNv->dev->chipset < 0x110) {
class = 0xa197;
handle = 0x0000906e;
} else if (pNv->dev->chipset < 0x120) {
class = 0xb097;
handle = 0x0000906e;
} else if (pNv->dev->chipset < 0x130) {
class = 0xb197;
handle = 0x0000906e;
} else if (pNv->dev->chipset == 0x130) {
class = 0xc097;
handle = 0x0000906e;
} else if (pNv->dev->chipset < 0x140) {
class = 0xc197;
handle = 0x0000906e;
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"No 3D acceleration support for NV%X\n",
pNv->dev->chipset);
return FALSE;
}
ret = nouveau_object_new(pNv->channel, class, class,
NULL, 0, &pNv->Nv3D);
if (ret)
return FALSE;
ret = nouveau_object_new(pNv->channel, handle, 0x906e,
NULL, 0, &pNv->NvSW);
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"DRM doesn't support sync-to-vblank\n");
}
if (nouveau_pushbuf_space(push, 512, 0, 0) ||
nouveau_pushbuf_refn (push, &(struct nouveau_pushbuf_refn) {
pNv->scratch, NOUVEAU_BO_VRAM |
NOUVEAU_BO_WR }, 1))
return FALSE;
BEGIN_NVC0(push, NV01_SUBC(3D, OBJECT), 1);
PUSH_DATA (push, pNv->Nv3D->handle);
BEGIN_NVC0(push, NVC0_3D(COND_MODE), 1);
PUSH_DATA (push, NVC0_3D_COND_MODE_ALWAYS);
BEGIN_NVC0(push, SUBC_3D(NVC0_GRAPH_NOTIFY_ADDRESS_HIGH), 3);
PUSH_DATA (push, (pNv->scratch->offset + NTFY_OFFSET) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + NTFY_OFFSET));
PUSH_DATA (push, 0);
BEGIN_NVC0(push, NVC0_3D(CSAA_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NVC0(push, NVC0_3D(ZETA_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NVC0(push, NVC0_3D(RT_SEPARATE_FRAG_DATA), 1);
PUSH_DATA (push, 0);
BEGIN_NVC0(push, NVC0_3D(VIEWPORT_HORIZ(0)), 2);
PUSH_DATA (push, (8192 << 16) | 0);
PUSH_DATA (push, (8192 << 16) | 0);
BEGIN_NVC0(push, NVC0_3D(SCREEN_SCISSOR_HORIZ), 2);
PUSH_DATA (push, (8192 << 16) | 0);
PUSH_DATA (push, (8192 << 16) | 0);
BEGIN_NVC0(push, NVC0_3D(SCISSOR_ENABLE(0)), 1);
PUSH_DATA (push, 1);
BEGIN_NVC0(push, NVC0_3D(VIEWPORT_TRANSFORM_EN), 1);
PUSH_DATA (push, 0);
BEGIN_NVC0(push, NVC0_3D(VIEW_VOLUME_CLIP_CTRL), 1);
PUSH_DATA (push, 0);
BEGIN_NVC0(push, NVC0_3D(TIC_ADDRESS_HIGH), 3);
PUSH_DATA (push, (bo->offset + TIC_OFFSET) >> 32);
PUSH_DATA (push, (bo->offset + TIC_OFFSET));
PUSH_DATA (push, 15);
BEGIN_NVC0(push, NVC0_3D(TSC_ADDRESS_HIGH), 3);
PUSH_DATA (push, (bo->offset + TSC_OFFSET) >> 32);
PUSH_DATA (push, (bo->offset + TSC_OFFSET));
PUSH_DATA (push, 0);
BEGIN_NVC0(push, NVC0_3D(LINKED_TSC), 1);
PUSH_DATA (push, 1);
if (pNv->Architecture < NV_KEPLER) {
BEGIN_NVC0(push, NVC0_3D(TEX_LIMITS(4)), 1);
PUSH_DATA (push, 0x54);
BEGIN_NIC0(push, NVC0_3D(BIND_TIC(4)), 2);
PUSH_DATA (push, (0 << 9) | (0 << 1) | NVC0_3D_BIND_TIC_ACTIVE);
PUSH_DATA (push, (1 << 9) | (1 << 1) | NVC0_3D_BIND_TIC_ACTIVE);
} else {
BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 6);
PUSH_DATA (push, 256);
PUSH_DATA (push, (bo->offset + TB_OFFSET) >> 32);
PUSH_DATA (push, (bo->offset + TB_OFFSET));
PUSH_DATA (push, 0);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000001);
BEGIN_NVC0(push, NVC0_3D(CB_BIND(4)), 1);
PUSH_DATA (push, 0x11);
BEGIN_NVC0(push, NVE4_3D(TEX_CB_INDEX), 1);
PUSH_DATA (push, 1);
}
if (pNv->Architecture < NV_MAXWELL) {
BEGIN_NVC0(push, NVC0_3D(VERTEX_QUARANTINE_ADDRESS_HIGH), 3);
PUSH_DATA (push, (bo->offset + MISC_OFFSET) >> 32);
PUSH_DATA (push, (bo->offset + MISC_OFFSET));
PUSH_DATA (push, 1);
} else {
/* Use new TIC format. Not strictly necessary for GM20x+ */
IMMED_NVC0(push, SUBC_3D(0x0f10), 1);
if (pNv->dev->chipset >= 0x120) {
/* Use center sample locations. */
BEGIN_NVC0(push, SUBC_3D(0x11e0), 4);
PUSH_DATA (push, 0x88888888);
PUSH_DATA (push, 0x88888888);
PUSH_DATA (push, 0x88888888);
PUSH_DATA (push, 0x88888888);
}
}
BEGIN_NVC0(push, NVC0_3D(CODE_ADDRESS_HIGH), 2);
PUSH_DATA (push, (bo->offset + CODE_OFFSET) >> 32);
PUSH_DATA (push, (bo->offset + CODE_OFFSET));
if (pNv->Architecture < NV_KEPLER) {
NVC0PushProgram(pNv, PVP_PASS, NVC0VP_Transform2);
NVC0PushProgram(pNv, PFP_S, NVC0FP_Source);
NVC0PushProgram(pNv, PFP_C, NVC0FP_Composite);
NVC0PushProgram(pNv, PFP_CCA, NVC0FP_CAComposite);
NVC0PushProgram(pNv, PFP_CCASA, NVC0FP_CACompositeSrcAlpha);
NVC0PushProgram(pNv, PFP_S_A8, NVC0FP_Source_A8);
NVC0PushProgram(pNv, PFP_C_A8, NVC0FP_Composite_A8);
NVC0PushProgram(pNv, PFP_NV12, NVC0FP_NV12);
BEGIN_NVC0(push, NVC0_3D(MEM_BARRIER), 1);
PUSH_DATA (push, 0x1111);
} else
if (pNv->dev->chipset < 0xf0 && pNv->dev->chipset != 0xea) {
NVC0PushProgram(pNv, PVP_PASS, NVE0VP_Transform2);
NVC0PushProgram(pNv, PFP_S, NVE0FP_Source);
NVC0PushProgram(pNv, PFP_C, NVE0FP_Composite);
NVC0PushProgram(pNv, PFP_CCA, NVE0FP_CAComposite);
NVC0PushProgram(pNv, PFP_CCASA, NVE0FP_CACompositeSrcAlpha);
NVC0PushProgram(pNv, PFP_S_A8, NVE0FP_Source_A8);
NVC0PushProgram(pNv, PFP_C_A8, NVE0FP_Composite_A8);
NVC0PushProgram(pNv, PFP_NV12, NVE0FP_NV12);
} else
if (pNv->dev->chipset < 0x110) {
NVC0PushProgram(pNv, PVP_PASS, NVF0VP_Transform2);
NVC0PushProgram(pNv, PFP_S, NVF0FP_Source);
NVC0PushProgram(pNv, PFP_C, NVF0FP_Composite);
NVC0PushProgram(pNv, PFP_CCA, NVF0FP_CAComposite);
NVC0PushProgram(pNv, PFP_CCASA, NVF0FP_CACompositeSrcAlpha);
NVC0PushProgram(pNv, PFP_S_A8, NVF0FP_Source_A8);
NVC0PushProgram(pNv, PFP_C_A8, NVF0FP_Composite_A8);
NVC0PushProgram(pNv, PFP_NV12, NVF0FP_NV12);
} else {
NVC0PushProgram(pNv, PVP_PASS, NV110VP_Transform2);
NVC0PushProgram(pNv, PFP_S, NV110FP_Source);
NVC0PushProgram(pNv, PFP_C, NV110FP_Composite);
NVC0PushProgram(pNv, PFP_CCA, NV110FP_CAComposite);
NVC0PushProgram(pNv, PFP_CCASA, NV110FP_CACompositeSrcAlpha);
NVC0PushProgram(pNv, PFP_S_A8, NV110FP_Source_A8);
NVC0PushProgram(pNv, PFP_C_A8, NV110FP_Composite_A8);
NVC0PushProgram(pNv, PFP_NV12, NV110FP_NV12);
}
BEGIN_NVC0(push, NVC0_3D(SP_SELECT(1)), 4);
PUSH_DATA (push, NVC0_3D_SP_SELECT_PROGRAM_VP_B |
NVC0_3D_SP_SELECT_ENABLE);
PUSH_DATA (push, PVP_PASS);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 8);
BEGIN_NVC0(push, NVC0_3D(VERT_COLOR_CLAMP_EN), 1);
PUSH_DATA (push, 1);
BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
PUSH_DATA (push, 256);
PUSH_DATA (push, (bo->offset + PVP_DATA) >> 32);
PUSH_DATA (push, (bo->offset + PVP_DATA));
BEGIN_NVC0(push, NVC0_3D(CB_BIND(0)), 1);
PUSH_DATA (push, 0x01);
BEGIN_NVC0(push, NVC0_3D(SP_SELECT(5)), 4);
PUSH_DATA (push, NVC0_3D_SP_SELECT_PROGRAM_FP |
NVC0_3D_SP_SELECT_ENABLE);
PUSH_DATA (push, PFP_S);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 8);
BEGIN_NVC0(push, NVC0_3D(FRAG_COLOR_CLAMP_EN), 1);
PUSH_DATA (push, 0x11111111);
BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
PUSH_DATA (push, 256);
PUSH_DATA (push, (bo->offset + PFP_DATA) >> 32);
PUSH_DATA (push, (bo->offset + PFP_DATA));
BEGIN_NVC0(push, NVC0_3D(CB_BIND(4)), 1);
PUSH_DATA (push, 0x01);
return TRUE;
}
xf86-video-nouveau-1.0.16/src/nv30_exa.c 0000644 0001750 0001756 00000076127 13423754626 014514 0000000 0000000 /*
* Copyright 2007 Ben Skeggs
* Copyright 2007 Stephane Marchesin
* Copyright 2007 Jeremy Kolb
* Copyright 2007 Patrice Mandin
*
* 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.
*/
#include "nv_include.h"
#include "hwdefs/nv_object.xml.h"
#include "hwdefs/nv30-40_3d.xml.h"
#include "nv04_accel.h"
typedef struct nv_pict_surface_format {
int pict_fmt;
uint32_t card_fmt;
} nv_pict_surface_format_t;
typedef struct nv_pict_texture_format {
int pict_fmt;
uint32_t card_fmt;
uint32_t card_swz;
} nv_pict_texture_format_t;
typedef struct nv_pict_op {
Bool src_alpha;
Bool dst_alpha;
uint32_t src_card_op;
uint32_t dst_card_op;
} nv_pict_op_t;
static nv_pict_surface_format_t
NV30SurfaceFormat[] = {
{ PICT_a8r8g8b8 , 0x148 },
{ PICT_a8b8g8r8 , 0x150 },
{ PICT_x8r8g8b8 , 0x145 },
{ PICT_x8b8g8r8 , 0x14f },
{ PICT_r5g6b5 , 0x143 },
{ PICT_a8 , 0x149 },
{ PICT_x1r5g5b5 , 0x142 },
};
static nv_pict_surface_format_t *
NV30_GetPictSurfaceFormat(int format)
{
int i;
for(i=0;i= PictOpSaturate)
return NULL;
#if 0
switch(op)
{
case 0:ErrorF("Op Clear\n");break;
case 1:ErrorF("Op Src\n");break;
case 2:ErrorF("Op Dst\n");break;
case 3:ErrorF("Op Over\n");break;
case 4:ErrorF("Op OverReverse\n");break;
case 5:ErrorF("Op In\n");break;
case 6:ErrorF("Op InReverse\n");break;
case 7:ErrorF("Op Out\n");break;
case 8:ErrorF("Op OutReverse\n");break;
case 9:ErrorF("Op Atop\n");break;
case 10:ErrorF("Op AtopReverse\n");break;
case 11:ErrorF("Op Xor\n");break;
case 12:ErrorF("Op Add\n");break;
}
#endif
return &NV30PictOp[op];
}
static void
NV30_SetupBlend(ScrnInfoPtr pScrn, nv_pict_op_t *blend,
PictFormatShort dest_format, Bool component_alpha)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
uint32_t sblend, dblend;
sblend = blend->src_card_op;
dblend = blend->dst_card_op;
if (blend->dst_alpha) {
if (!PICT_FORMAT_A(dest_format)) {
if (sblend == BF(DST_ALPHA)) {
sblend = BF(ONE);
} else if (sblend == BF(ONE_MINUS_DST_ALPHA)) {
sblend = BF(ZERO);
}
} else if (dest_format == PICT_a8) {
if (sblend == BF(DST_ALPHA)) {
sblend = BF(DST_COLOR);
} else if (sblend == BF(ONE_MINUS_DST_ALPHA)) {
sblend = BF(ONE_MINUS_DST_COLOR);
}
}
}
if (blend->src_alpha && (component_alpha || dest_format == PICT_a8)) {
if (dblend == BF(SRC_ALPHA)) {
dblend = BF(SRC_COLOR);
} else if (dblend == BF(ONE_MINUS_SRC_ALPHA)) {
dblend = BF(ONE_MINUS_SRC_COLOR);
}
}
if (sblend == BF(ONE) && dblend == BF(ZERO)) {
BEGIN_NV04(push, NV30_3D(BLEND_FUNC_ENABLE), 1);
PUSH_DATA (push, 0);
} else {
BEGIN_NV04(push, NV30_3D(BLEND_FUNC_ENABLE), 3);
PUSH_DATA (push, 1);
PUSH_DATA (push, (sblend << 16) | sblend);
PUSH_DATA (push, (dblend << 16) | dblend);
}
}
static Bool
NV30EXATexture(ScrnInfoPtr pScrn, PixmapPtr pPix, PicturePtr pPict, int unit)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_bo *bo = nouveau_pixmap_bo(pPix);
nv_pict_texture_format_t *fmt;
unsigned reloc = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD;
uint32_t pitch = exaGetPixmapPitch(pPix);
uint32_t log2h = log2i(pPix->drawable.height);
uint32_t log2w = log2i(pPix->drawable.width);
uint32_t card_filter, card_repeat;
fmt = NV30_GetPictTextureFormat(pPict->format);
if (!fmt)
return FALSE;
card_repeat = 3; /* repeatNone */
if (pPict->filter == PictFilterBilinear)
card_filter = 2;
else
card_filter = 1;
BEGIN_NV04(push, NV30_3D(TEX_OFFSET(unit)), 8);
PUSH_MTHDl(push, NV30_3D(TEX_OFFSET(unit)), bo, 0, reloc);
PUSH_MTHDs(push, NV30_3D(TEX_FORMAT(unit)), bo, (1 << 16) | 8 |
NV30_3D_TEX_FORMAT_DIMS_2D |
(fmt->card_fmt << NV30_3D_TEX_FORMAT_FORMAT__SHIFT) |
(log2w << NV30_3D_TEX_FORMAT_BASE_SIZE_U__SHIFT) |
(log2h << NV30_3D_TEX_FORMAT_BASE_SIZE_V__SHIFT),
reloc, NV30_3D_TEX_FORMAT_DMA0,
NV30_3D_TEX_FORMAT_DMA1);
PUSH_DATA (push, (card_repeat << NV30_3D_TEX_WRAP_S__SHIFT) |
(card_repeat << NV30_3D_TEX_WRAP_T__SHIFT) |
(card_repeat << NV30_3D_TEX_WRAP_R__SHIFT));
PUSH_DATA (push, NV30_3D_TEX_ENABLE_ENABLE);
PUSH_DATA (push, (pitch << NV30_3D_TEX_SWIZZLE_RECT_PITCH__SHIFT ) |
fmt->card_swz);
PUSH_DATA (push, (card_filter << NV30_3D_TEX_FILTER_MIN__SHIFT) |
(card_filter << NV30_3D_TEX_FILTER_MAG__SHIFT) |
0x2000 /* engine lock */);
PUSH_DATA (push, (pPix->drawable.width <<
NV30_3D_TEX_NPOT_SIZE_W__SHIFT) |
pPix->drawable.height);
PUSH_DATA (push, 0x00000000); /* border ARGB */
if (pPict->transform) {
BEGIN_NV04(push, NV30_3D(TEX_MATRIX_ENABLE(unit)), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV30_3D(TEX_MATRIX(unit, 0)), 16);
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[0][0]));
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[0][1]));
PUSH_DATAf(push, 0.f);
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[0][2]));
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[1][0]));
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[1][1]));
PUSH_DATAf(push, 0.f);
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[1][2]));
PUSH_DATAf(push, 0.0f);
PUSH_DATAf(push, 0.0f);
PUSH_DATAf(push, 0.0f);
PUSH_DATAf(push, 0.0f);
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[2][0]));
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[2][1]));
PUSH_DATAf(push, 0.0f);
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[2][2]));
} else {
BEGIN_NV04(push, NV30_3D(TEX_MATRIX_ENABLE(unit)), 1);
PUSH_DATA (push, 0);
}
return TRUE;
}
#define RCSRC_COL(i) (0x01 + (unit))
#define RCSRC_TEX(i) (0x08 + (unit)) /* fragprog register */
#define RCSEL_COLOR (0x00)
#define RCSEL_ALPHA (0x10)
#define RCINP_ZERO (0x00)
#define RCINP_ONE (0x20)
#define RCINP_A__SHIFT 24
#define RCINP_B__SHIFT 16
static Bool
NV30EXAPicture(ScrnInfoPtr pScrn, PixmapPtr pPix, PicturePtr pPict, int unit,
uint32_t *color, uint32_t *alpha, uint32_t *solid)
{
uint32_t shift, source;
if (pPict && pPict->pDrawable) {
if (!NV30EXATexture(pScrn, pPix, pPict, unit))
return FALSE;
*solid = 0x00000000;
source = RCSRC_TEX(unit);
} else
if (pPict) {
*solid = pPict->pSourcePict->solidFill.color;
source = RCSRC_COL(unit);
}
if (pPict && PICT_FORMAT_RGB(pPict->format))
*color = RCSEL_COLOR | source;
else
*color = RCSEL_ALPHA | RCINP_ZERO;
if (pPict && PICT_FORMAT_A(pPict->format))
*alpha = RCSEL_ALPHA | source;
else
*alpha = RCSEL_ALPHA | RCINP_ONE;
if (unit)
shift = RCINP_B__SHIFT;
else
shift = RCINP_A__SHIFT;
*color <<= shift;
*alpha <<= shift;
return TRUE;
}
static Bool
NV30_SetupSurface(ScrnInfoPtr pScrn, PixmapPtr pPix, PicturePtr pPict)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_bo *bo = nouveau_pixmap_bo(pPix);
uint32_t pitch = exaGetPixmapPitch(pPix);
nv_pict_surface_format_t *fmt;
fmt = NV30_GetPictSurfaceFormat(pPict->format);
if (!fmt) {
ErrorF("AIII no format\n");
return FALSE;
}
BEGIN_NV04(push, NV30_3D(RT_FORMAT), 3);
PUSH_DATA (push, fmt->card_fmt); /* format */
PUSH_DATA (push, pitch << 16 | pitch);
PUSH_MTHDl(push, NV30_3D(COLOR0_OFFSET), bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
return TRUE;
}
static Bool
NV30EXACheckCompositeTexture(PicturePtr pPict, PicturePtr pdPict, int op)
{
nv_pict_texture_format_t *fmt;
int w = 1, h = 1;
if (pPict->pDrawable) {
w = pPict->pDrawable->width;
h = pPict->pDrawable->height;
} else {
if (pPict->pSourcePict->type != SourcePictTypeSolidFill)
NOUVEAU_FALLBACK("gradient pictures unsupported\n");
}
if ((w > 4096) || (h > 4096))
NOUVEAU_FALLBACK("picture too large, %dx%d\n", w, h);
fmt = NV30_GetPictTextureFormat(pPict->format);
if (!fmt)
NOUVEAU_FALLBACK("picture format 0x%08x not supported\n",
pPict->format);
if (pPict->filter != PictFilterNearest &&
pPict->filter != PictFilterBilinear)
NOUVEAU_FALLBACK("filter 0x%x not supported\n", pPict->filter);
if (!(w==1 && h==1) && pPict->repeat && pPict->repeatType != RepeatNone)
NOUVEAU_FALLBACK("repeat 0x%x not supported (surface %dx%d)\n",
pPict->repeatType,w,h);
/* Opengl and Render disagree on what should be sampled outside an XRGB
* texture (with no repeating). Opengl has a hardcoded alpha value of
* 1.0, while render expects 0.0. We assume that clipping is done for
* untranformed sources.
*/
if (NV30PictOp[op].src_alpha && !pPict->repeat &&
pPict->transform && (PICT_FORMAT_A(pPict->format) == 0)
&& (PICT_FORMAT_A(pdPict->format) != 0))
NOUVEAU_FALLBACK("REPEAT_NONE unsupported for XRGB source\n");
return TRUE;
}
Bool
NV30EXACheckComposite(int op, PicturePtr psPict,
PicturePtr pmPict,
PicturePtr pdPict)
{
nv_pict_surface_format_t *fmt;
nv_pict_op_t *opr;
opr = NV30_GetPictOpRec(op);
if (!opr)
NOUVEAU_FALLBACK("unsupported blend op 0x%x\n", op);
fmt = NV30_GetPictSurfaceFormat(pdPict->format);
if (!fmt)
NOUVEAU_FALLBACK("dst picture format 0x%08x not supported\n",
pdPict->format);
if (!NV30EXACheckCompositeTexture(psPict, pdPict, op))
NOUVEAU_FALLBACK("src picture\n");
if (pmPict) {
if (pmPict->componentAlpha &&
PICT_FORMAT_RGB(pmPict->format) &&
opr->src_alpha && opr->src_card_op != BF(ZERO))
NOUVEAU_FALLBACK("mask CA + SA\n");
if (!NV30EXACheckCompositeTexture(pmPict, pdPict, op))
NOUVEAU_FALLBACK("mask picture\n");
}
return TRUE;
}
Bool
NV30EXAPrepareComposite(int op, PicturePtr psPict,
PicturePtr pmPict,
PicturePtr pdPict,
PixmapPtr psPix,
PixmapPtr pmPix,
PixmapPtr pdPix)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
nv_pict_op_t *blend = NV30_GetPictOpRec(op);
struct nouveau_pushbuf *push = pNv->pushbuf;
uint32_t sc, sa, mc, ma, solid[2];
if (!PUSH_SPACE(push, 128))
return FALSE;
PUSH_RESET(push);
/* setup render target and blending */
if (!NV30_SetupSurface(pScrn, pdPix, pdPict))
return FALSE;
NV30_SetupBlend(pScrn, blend, pdPict->format,
(pmPict && pmPict->componentAlpha &&
PICT_FORMAT_RGB(pmPict->format)));
/* select picture sources */
if (!NV30EXAPicture(pScrn, psPix, psPict, 0, &sc, &sa, &solid[0]))
return FALSE;
if (!NV30EXAPicture(pScrn, pmPix, pmPict, 1, &mc, &ma, &solid[1]))
return FALSE;
/* configure register combiners */
BEGIN_NV04(push, NV30_3D(RC_IN_ALPHA(0)), 6);
PUSH_DATA (push, sa | ma);
if (pmPict &&
pmPict->componentAlpha && PICT_FORMAT_RGB(pmPict->format)) {
if (blend->src_alpha)
PUSH_DATA(push, sa | mc);
else
PUSH_DATA(push, sc | mc);
} else {
PUSH_DATA(push, sc | ma);
}
PUSH_DATA (push, solid[0]);
PUSH_DATA (push, solid[1]);
PUSH_DATA (push, 0x00000c00);
PUSH_DATA (push, 0x00000c00);
BEGIN_NV04(push, NV30_3D(RC_FINAL0), 3);
if (pdPict->format != PICT_a8)
PUSH_DATA (push, 0x0000000c);
else
PUSH_DATA (push, 0x0000001c);
PUSH_DATA (push, 0x00001c00);
PUSH_DATA (push, 0x01000101);
/* select fragprog which just sources textures for combiners */
BEGIN_NV04(push, NV30_3D(FP_ACTIVE_PROGRAM), 1);
PUSH_MTHD (push, NV30_3D(FP_ACTIVE_PROGRAM), pNv->scratch, PFP_PASS,
NOUVEAU_BO_VRAM | NOUVEAU_BO_RD | NOUVEAU_BO_LOW |
NOUVEAU_BO_OR,
NV30_3D_FP_ACTIVE_PROGRAM_DMA0,
NV30_3D_FP_ACTIVE_PROGRAM_DMA1);
BEGIN_NV04(push, NV30_3D(FP_REG_CONTROL), 1);
PUSH_DATA (push, 0x0001000f);
BEGIN_NV04(push, NV30_3D(FP_CONTROL), 1);
PUSH_DATA (push, 0x00000000);
BEGIN_NV04(push, NV30_3D(TEX_UNITS_ENABLE), 1);
PUSH_DATA (push, 3);
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push)) {
nouveau_pushbuf_bufctx(push, NULL);
return FALSE;
}
return TRUE;
}
static __inline__ void
PUSH_VTX2s(struct nouveau_pushbuf *push,
int x1, int y1, int x2, int y2, int dx, int dy)
{
BEGIN_NV04(push, NV30_3D(VTX_ATTR_2I(8)), 2);
PUSH_DATA (push, ((y1 & 0xffff) << 16) | (x1 & 0xffff));
PUSH_DATA (push, ((y2 & 0xffff) << 16) | (x2 & 0xffff));
BEGIN_NV04(push, NV30_3D(VTX_ATTR_2I(0)), 1);
PUSH_DATA (push, ((dy & 0xffff) << 16) | (dx & 0xffff));
}
void
NV30EXAComposite(PixmapPtr pdPix,
int sx, int sy, int mx, int my, int dx, int dy, int w, int h)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
if (!PUSH_SPACE(push, 64))
return;
/* We're drawing a triangle, we need to scissor it to a quad. */
/* The scissors are here for a good reason, we don't get the full
* image, but just a part.
*/
/* Handling the cliprects is done for us already. */
BEGIN_NV04(push, NV30_3D(SCISSOR_HORIZ), 2);
PUSH_DATA (push, (w << 16) | dx);
PUSH_DATA (push, (h << 16) | dy);
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
PUSH_DATA (push, NV30_3D_VERTEX_BEGIN_END_TRIANGLES);
PUSH_VTX2s(push, sx, sy + (h * 2), mx, my + (h * 2), dx, dy + (h * 2));
PUSH_VTX2s(push, sx, sy, mx, my, dx, dy);
PUSH_VTX2s(push, sx + (w * 2), sy, mx + (w * 2), my, dx + (w * 2), dy);
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
PUSH_DATA (push, NV30_3D_VERTEX_BEGIN_END_STOP);
}
void
NV30EXADoneComposite(PixmapPtr pdPix)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
nouveau_pushbuf_bufctx(NVPTR(pScrn)->pushbuf, NULL);
}
Bool
NVAccelInitNV30TCL(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nv04_fifo *fifo = pNv->channel->data;
uint32_t class = 0, chipset;
int i;
NVXVComputeBicubicFilter(pNv->scratch, XV_TABLE, XV_TABLE_SIZE);
#define NV30TCL_CHIPSET_3X_MASK 0x00000003
#define NV35TCL_CHIPSET_3X_MASK 0x000001e0
#define NV30_3D_CHIPSET_3X_MASK 0x00000010
chipset = pNv->dev->chipset;
if ((chipset & 0xf0) != NV_ARCH_30)
return TRUE;
chipset &= 0xf;
if (NV30TCL_CHIPSET_3X_MASK & (1<scrnIndex, X_ERROR,
"NV30EXA: Unknown chipset NV3%1x\n", chipset);
return FALSE;
}
if (nouveau_object_new(pNv->channel, Nv3D, class, NULL, 0, &pNv->Nv3D))
return FALSE;
if (!PUSH_SPACE(push, 256))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(3D, OBJECT), 1);
PUSH_DATA (push, pNv->Nv3D->handle);
BEGIN_NV04(push, NV30_3D(DMA_TEXTURE0), 3);
PUSH_DATA (push, fifo->vram);
PUSH_DATA (push, fifo->gart);
PUSH_DATA (push, fifo->vram);
BEGIN_NV04(push, NV30_3D(DMA_UNK1AC), 1);
PUSH_DATA (push, fifo->vram);
BEGIN_NV04(push, NV30_3D(DMA_COLOR0), 2);
PUSH_DATA (push, fifo->vram);
PUSH_DATA (push, fifo->vram);
BEGIN_NV04(push, NV30_3D(DMA_UNK1B0), 1);
PUSH_DATA (push, fifo->vram);
for (i=1; i<8; i++) {
BEGIN_NV04(push, NV30_3D(VIEWPORT_CLIP_HORIZ(i)), 2);
PUSH_DATA (push, 0);
PUSH_DATA (push, 0);
}
BEGIN_NV04(push, NV30_3D(RT_ENABLE), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV40_3D(MIPMAP_ROUNDING), 1);
PUSH_DATA (push, NV40_3D_MIPMAP_ROUNDING_MODE_DOWN);
BEGIN_NV04(push, NV30_3D(FLATSHADE_FIRST), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, SUBC_3D(0x1d80), 1);
PUSH_DATA (push, 3);
BEGIN_NV04(push, NV30_3D(FP_REG_CONTROL), 1);
PUSH_DATA (push, 0x00030004);
/* NEW */
BEGIN_NV04(push, SUBC_3D(0x1e98), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, SUBC_3D(0x17e0), 3);
PUSH_DATA (push, 0);
PUSH_DATA (push, 0);
PUSH_DATA (push, 0x3f800000);
BEGIN_NV04(push, SUBC_3D(0x1f80), 16);
PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0);
PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0);
PUSH_DATA (push, 0x0000ffff);
PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0);
PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(FLIP_SET_READ), 3);
PUSH_DATA (push, 0);
PUSH_DATA (push, 1);
PUSH_DATA (push, 2);
BEGIN_NV04(push, NV15_BLIT(FLIP_SET_READ), 3);
PUSH_DATA (push, 0);
PUSH_DATA (push, 1);
PUSH_DATA (push, 2);
BEGIN_NV04(push, NV30_3D(COORD_CONVENTIONS), 1);
PUSH_DATA (push, 0x00001200);
BEGIN_NV04(push, NV30_3D(MULTISAMPLE_CONTROL), 1);
PUSH_DATA (push, 0xffff0000);
/* Attempt to setup a known state.. Probably missing a heap of
* stuff here..
*/
BEGIN_NV04(push, NV30_3D(STENCIL_ENABLE(0)), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(STENCIL_ENABLE(1)), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(ALPHA_FUNC_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(DEPTH_WRITE_ENABLE), 2);
PUSH_DATA (push, 0); /* wr disable */
PUSH_DATA (push, 0); /* test disable */
BEGIN_NV04(push, NV30_3D(COLOR_MASK), 1);
PUSH_DATA (push, 0x01010101); /* TR,TR,TR,TR */
BEGIN_NV04(push, NV30_3D(CULL_FACE_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(BLEND_FUNC_ENABLE), 5);
PUSH_DATA (push, 0); /* Blend enable */
PUSH_DATA (push, 0); /* Blend src */
PUSH_DATA (push, 0); /* Blend dst */
PUSH_DATA (push, 0x00000000); /* Blend colour */
PUSH_DATA (push, 0x8006); /* FUNC_ADD */
BEGIN_NV04(push, NV30_3D(COLOR_LOGIC_OP_ENABLE), 2);
PUSH_DATA (push, 0);
PUSH_DATA (push, 0x1503 /*GL_COPY*/);
BEGIN_NV04(push, NV30_3D(DITHER_ENABLE), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV30_3D(SHADE_MODEL), 1);
PUSH_DATA (push, 0x1d01 /*GL_SMOOTH*/);
BEGIN_NV04(push, NV30_3D(POLYGON_OFFSET_FACTOR),2);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
BEGIN_NV04(push, NV30_3D(POLYGON_MODE_FRONT), 2);
PUSH_DATA (push, 0x1b02 /*GL_FILL*/);
PUSH_DATA (push, 0x1b02 /*GL_FILL*/);
/* - Disable texture units
* - Set fragprog to MOVR result.color, fragment.color */
for (i=0;i<4;i++) {
BEGIN_NV04(push, NV30_3D(TEX_ENABLE(i)), 1);
PUSH_DATA (push, 0);
}
/* Polygon stipple */
BEGIN_NV04(push, NV30_3D(POLYGON_STIPPLE_PATTERN(0)), 0x20);
for (i=0;i<0x20;i++)
PUSH_DATA (push, 0xFFFFFFFF);
BEGIN_NV04(push, NV30_3D(DEPTH_RANGE_NEAR), 2);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
/* Ok. If you start X with the nvidia driver, kill it, and then
* start X with nouveau you will get black rendering instead of
* what you'd expect. This fixes the problem, and it seems that
* it's not needed between nouveau restarts - which suggests that
* the 3D context (wherever it's stored?) survives somehow.
*/
//BEGIN_NV04(push, NV30_3D(FP_CONTROL),1);
//PUSH_DATA (push, 0x03008000);
int w=4096;
int h=4096;
int pitch=4096*4;
BEGIN_NV04(push, NV30_3D(RT_HORIZ), 5);
PUSH_DATA (push, w<<16);
PUSH_DATA (push, h<<16);
PUSH_DATA (push, 0x148); /* format */
PUSH_DATA (push, pitch << 16 | pitch);
PUSH_DATA (push, 0x0);
BEGIN_NV04(push, NV30_3D(VIEWPORT_TX_ORIGIN), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(VIEWPORT_HORIZ), 2);
PUSH_DATA (push, (w<<16) | 0);
PUSH_DATA (push, (h<<16) | 0);
BEGIN_NV04(push, NV30_3D(VIEWPORT_CLIP_HORIZ(0)), 2);
PUSH_DATA (push, (w-1)<<16);
PUSH_DATA (push, (h-1)<<16);
BEGIN_NV04(push, NV30_3D(SCISSOR_HORIZ), 2);
PUSH_DATA (push, w<<16);
PUSH_DATA (push, h<<16);
BEGIN_NV04(push, NV30_3D(VIEWPORT_HORIZ), 2);
PUSH_DATA (push, w<<16);
PUSH_DATA (push, h<<16);
BEGIN_NV04(push, NV30_3D(VIEWPORT_TRANSLATE_X), 8);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
BEGIN_NV04(push, NV30_3D(MODELVIEW_MATRIX(0)), 16);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
BEGIN_NV04(push, NV30_3D(PROJECTION_MATRIX(0)), 16);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
BEGIN_NV04(push, NV30_3D(SCISSOR_HORIZ), 2);
PUSH_DATA (push, 4096<<16);
PUSH_DATA (push, 4096<<16);
PUSH_DATAu(push, pNv->scratch, PFP_PASS, 2 * 4);
PUSH_DATAs(push, 0x18009e80); /* txph r0, a[tex0], t[0] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x1802be83); /* txph r1, a[tex1], t[1] */
PUSH_DATAs(push, 0x1c9dc801); /* exit */
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAu(push, pNv->scratch, PFP_NV12_BILINEAR, 8 * 4);
PUSH_DATAs(push, 0x17028200); /* texr r0.x, a[tex0], t[1] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x04000e02); /* madr r1.xyz, r0.x, imm.x, imm.yzww */
PUSH_DATAs(push, 0x1c9c0000);
PUSH_DATAs(push, 0x00000002);
PUSH_DATAs(push, 0x0001f202);
PUSH_DATAs(push, 0x3f9507c8); /* { 1.16, -0.87, 0.53, -1.08 } */
PUSH_DATAs(push, 0xbf5ee393);
PUSH_DATAs(push, 0x3f078fef);
PUSH_DATAs(push, 0xbf8a6762);
PUSH_DATAs(push, 0x1704ac80); /* texr r0.yz, a[tex1], t[2] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x04000e02); /* madr r1.xyz, r0.y, imm, r1 */
PUSH_DATAs(push, 0x1c9cab00);
PUSH_DATAs(push, 0x0001c802);
PUSH_DATAs(push, 0x0001c804);
PUSH_DATAs(push, 0x00000000); /* { 0.00, -0.39, 2.02, 0.00 } */
PUSH_DATAs(push, 0xbec890d6);
PUSH_DATAs(push, 0x40011687);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x04000e81); /* madr r0.xyz, r0.z, imm, r1 */
PUSH_DATAs(push, 0x1c9d5500);
PUSH_DATAs(push, 0x0001c802);
PUSH_DATAs(push, 0x0001c804);
PUSH_DATAs(push, 0x3fcc432d); /* { 1.60, -0.81, 0.00, 0.00 } */
PUSH_DATAs(push, 0xbf501a37);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAu(push, pNv->scratch, PFP_NV12_BICUBIC, 24 * 4);
PUSH_DATAs(push, 0x01008604); /* movr r2.xy, a[tex0] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x03000600); /* addr r0.xy, r2, imm.x */
PUSH_DATAs(push, 0x1c9dc808);
PUSH_DATAs(push, 0x00000002);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3f000000); /* { 0.50, 0.00, 0.00, 0.00 } */
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x17000e06); /* texr r3.xyz, r0, t[0] */
PUSH_DATAs(push, 0x1c9dc800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x17000e00); /* texr r0.xyz, r0.y, t[0] */
PUSH_DATAs(push, 0x1c9caa00);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x02000a02); /* mulr r1.xz, r3.xxyy, imm.xxyy */
PUSH_DATAs(push, 0x1c9ca00c);
PUSH_DATAs(push, 0x0000a002);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0xbf800000); /* { -1.00, 1.00, 0.00, 0.00 } */
PUSH_DATAs(push, 0x3f800000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x02001402); /* mulr r1.yw, r0.xxyy, imm.xxyy */
PUSH_DATAs(push, 0x1c9ca000);
PUSH_DATAs(push, 0x0000a002);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0xbf800000); /* { -1.00, 1.00, 0.00, 0.00 } */
PUSH_DATAs(push, 0x3f800000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x03001e04); /* addr r2, r2.xyxy, r1 */
PUSH_DATAs(push, 0x1c9c8808);
PUSH_DATAs(push, 0x0001c804);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x17020200); /* texr r0.x, r2, t[1] */
PUSH_DATAs(push, 0x1c9dc808);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x17020402); /* texr r1.y, r2.xwxw, t[1] */
PUSH_DATAs(push, 0x1c9d9808);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x17020202); /* texr r1.x, r2.zyxy, t[1] */
PUSH_DATAs(push, 0x1c9c8c08);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x1f400280); /* lrph r0.x, r0.z, r0, r1.y */
PUSH_DATAs(push, 0x1c9d5400);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0000aa04);
PUSH_DATAs(push, 0x17020400); /* texr r0.y, r2.zwzz, t[1] */
PUSH_DATAs(push, 0x1c9d5c08);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x1f400480); /* lrph r0.y, r0.z, r1.x, r0 */
PUSH_DATAs(push, 0x1c9d5400);
PUSH_DATAs(push, 0x00000004);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x1f400280); /* lrph r0.x, r3.z, r0, r0.y */
PUSH_DATAs(push, 0x1c9d540c);
PUSH_DATAs(push, 0x0001c900);
PUSH_DATAs(push, 0x0000ab00);
PUSH_DATAs(push, 0x04400e80); /* madh r0.xyz, r0.x, imm.x, imm.yzww */
PUSH_DATAs(push, 0x1c9c0100);
PUSH_DATAs(push, 0x00000002);
PUSH_DATAs(push, 0x0001f202);
PUSH_DATAs(push, 0x3f9507c8); /* { 1.16, -0.87, 0.53, -1.08 } */
PUSH_DATAs(push, 0xbf5ee393);
PUSH_DATAs(push, 0x3f078fef);
PUSH_DATAs(push, 0xbf8a6762);
PUSH_DATAs(push, 0x1704ac02); /* texr r1.yz, a[tex1], t[2] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x04400e80); /* madh r0.xyz, r1.y, imm, r0 */
PUSH_DATAs(push, 0x1c9caa04);
PUSH_DATAs(push, 0x0001c802);
PUSH_DATAs(push, 0x0001c900);
PUSH_DATAs(push, 0x00000000); /* { 0.00, -0.39, 2.02, 0.00 } */
PUSH_DATAs(push, 0xbec890d6);
PUSH_DATAs(push, 0x40011687);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x04400e81); /* madh r0.xyz, r1.z, imm, r0 */
PUSH_DATAs(push, 0x1c9d5404);
PUSH_DATAs(push, 0x0001c802);
PUSH_DATAs(push, 0x0001c900);
PUSH_DATAs(push, 0x3fcc432d); /* { 1.60, -0.81, 0.00, 0.00 } */
PUSH_DATAs(push, 0xbf501a37);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
return TRUE;
}
xf86-video-nouveau-1.0.16/src/nv50_accel.h 0000644 0001750 0001756 00000005652 13423754626 015010 0000000 0000000 #ifndef __NV50_ACCEL_H__
#define __NV50_ACCEL_H__
#include "hwdefs/nv50_2d.xml.h"
#include "hwdefs/nv50_3d.xml.h"
#include "hwdefs/nv50_defs.xml.h"
#include "hwdefs/nv50_texture.h"
#include "hwdefs/nv_3ddefs.xml.h"
#include "hwdefs/nv_m2mf.xml.h"
#include "hwdefs/nv_object.xml.h"
/* subchannel assignments - graphics channel */
#define SUBC_M2MF(mthd) 0, (mthd)
#define NV03_M2MF(mthd) SUBC_M2MF(NV03_M2MF_##mthd)
#define NV50_M2MF(mthd) SUBC_M2MF(NV50_M2MF_##mthd)
#define SUBC_NVSW(mthd) 1, (mthd)
#define SUBC_2D(mthd) 2, (mthd)
#define NV50_2D(mthd) SUBC_2D(NV50_2D_##mthd)
#define NVC0_2D(mthd) SUBC_2D(NVC0_2D_##mthd)
#define SUBC_3D(mthd) 7, (mthd)
#define NV50_3D(mthd) SUBC_3D(NV50_3D_##mthd)
/* subchannel assignments - copy engine channel */
#define SUBC_COPY(mthd) 2, (mthd)
/* scratch buffer offsets */
#define PVP_OFFSET 0x00000000 /* Vertex program */
#define PFP_OFFSET 0x00001000 /* Fragment program */
#define TIC_OFFSET 0x00002000 /* Texture Image Control */
#define TSC_OFFSET 0x00003000 /* Texture Sampler Control */
#define PVP_DATA 0x00004000 /* VP constbuf */
#define PFP_DATA 0x00004100 /* FP constbuf */
#define SOLID(i) (0x00006000 + (i) * 0x100)
/* Fragment programs */
#define PFP_S 0x0000 /* (src) */
#define PFP_C 0x0100 /* (src IN mask) */
#define PFP_CCA 0x0200 /* (src IN mask) component-alpha */
#define PFP_CCASA 0x0300 /* (src IN mask) component-alpha src-alpha */
#define PFP_S_A8 0x0400 /* (src) a8 rt */
#define PFP_C_A8 0x0500 /* (src IN mask) a8 rt - same for CA and CA_SA */
#define PFP_NV12 0x0600 /* NV12 YUV->RGB */
/* Constant buffer assignments */
#define CB_PSH 0
#define CB_PVP 1
#define CB_PFP 2
static __inline__ void
PUSH_VTX1s(struct nouveau_pushbuf *push, float sx, float sy, int dx, int dy)
{
BEGIN_NV04(push, NV50_3D(VTX_ATTR_2F_X(8)), 2);
PUSH_DATAf(push, sx);
PUSH_DATAf(push, sy);
BEGIN_NV04(push, NV50_3D(VTX_ATTR_2I(0)), 1);
PUSH_DATA (push, ((dy & 0xffff) << 16) | (dx & 0xffff));
}
static __inline__ void
PUSH_VTX2s(struct nouveau_pushbuf *push,
int x1, int y1, int x2, int y2, int dx, int dy)
{
BEGIN_NV04(push, NV50_3D(VTX_ATTR_2I(8)), 2);
PUSH_DATA (push, ((y1 & 0xffff) << 16) | (x1 & 0xffff));
PUSH_DATA (push, ((y2 & 0xffff) << 16) | (x2 & 0xffff));
BEGIN_NV04(push, NV50_3D(VTX_ATTR_2I(0)), 1);
PUSH_DATA (push, ((dy & 0xffff) << 16) | (dx & 0xffff));
}
static __inline__ void
PUSH_DATAu(struct nouveau_pushbuf *push, struct nouveau_bo *bo,
unsigned delta, unsigned dwords)
{
const unsigned idx = (delta & 0x000000fc) >> 2;
const unsigned off = (delta & 0xffffff00);
BEGIN_NV04(push, NV50_3D(CB_DEF_ADDRESS_HIGH), 3);
PUSH_DATA (push, (bo->offset + off) >> 32);
PUSH_DATA (push, (bo->offset + off));
PUSH_DATA (push, (CB_PSH << NV50_3D_CB_DEF_SET_BUFFER__SHIFT) | 0x2000);
BEGIN_NV04(push, NV50_3D(CB_ADDR), 1);
PUSH_DATA (push, CB_PSH | (idx << NV50_3D_CB_ADDR_ID__SHIFT));
BEGIN_NI04(push, NV50_3D(CB_DATA(0)), dwords);
}
#endif
xf86-video-nouveau-1.0.16/src/nv04_accel.h 0000644 0001750 0001756 00000006462 13423754626 015007 0000000 0000000 #ifndef __NV04_ACCEL_H__
#define __NV04_ACCEL_H__
#include "hwdefs/nv_object.xml.h"
#include "hwdefs/nv01_2d.xml.h"
#define XV_TABLE_SIZE 512
/* scratch buffer offsets */
#define PFP_PASS 0x00000000
#define PFP_S 0x00000100
#define PFP_C 0x00000200
#define PFP_CCA 0x00000300
#define PFP_CCASA 0x00000400
#define PFP_S_A8 0x00000500
#define PFP_C_A8 0x00000600
#define PFP_NV12_BILINEAR 0x00000700
#define PFP_NV12_BICUBIC 0x00000800
#define XV_TABLE 0x00001000
#define SOLID(i) (0x00002000 + (i) * 0x100)
/* subchannel assignments */
#define SUBC_M2MF(mthd) 0, (mthd)
#define NV03_M2MF(mthd) SUBC_M2MF(NV03_M2MF_##mthd)
#define SUBC_NVSW(mthd) 1, (mthd)
#define SUBC_SF2D(mthd) 2, (mthd)
#define NV04_SF2D(mthd) SUBC_SF2D(NV04_SURFACE_2D_##mthd)
#define NV10_SF2D(mthd) SUBC_SF2D(NV10_SURFACE_2D_##mthd)
#define SUBC_RECT(mthd) 3, (mthd)
#define NV04_RECT(mthd) SUBC_RECT(NV04_GDI_##mthd)
#define SUBC_BLIT(mthd) 4, (mthd)
#define NV01_BLIT(mthd) SUBC_BLIT(NV01_BLIT_##mthd)
#define NV04_BLIT(mthd) SUBC_BLIT(NV04_BLIT_##mthd)
#define NV15_BLIT(mthd) SUBC_BLIT(NV15_BLIT_##mthd)
#define SUBC_IFC(mthd) 5, (mthd)
#define NV01_IFC(mthd) SUBC_IFC(NV01_IFC_##mthd)
#define NV04_IFC(mthd) SUBC_IFC(NV04_IFC_##mthd)
#define SUBC_MISC(mthd) 6, (mthd)
#define NV03_SIFM(mthd) SUBC_MISC(NV03_SIFM_##mthd)
#define NV05_SIFM(mthd) SUBC_MISC(NV05_SIFM_##mthd)
#define NV01_BETA(mthd) SUBC_MISC(NV01_BETA_##mthd)
#define NV04_BETA4(mthd) SUBC_MISC(NV04_BETA4_##mthd)
#define NV01_PATT(mthd) SUBC_MISC(NV01_PATTERN_##mthd)
#define NV04_PATT(mthd) SUBC_MISC(NV04_PATTERN_##mthd)
#define NV01_ROP(mthd) SUBC_MISC(NV01_ROP_##mthd)
#define NV01_CLIP(mthd) SUBC_MISC(NV01_CLIP_##mthd)
#define SUBC_3D(mthd) 7, (mthd)
#define NV10_3D(mthd) SUBC_3D(NV10_3D_##mthd)
#define NV30_3D(mthd) SUBC_3D(NV30_3D_##mthd)
#define NV40_3D(mthd) SUBC_3D(NV40_3D_##mthd)
static __inline__ void
PUSH_DATAu(struct nouveau_pushbuf *push, struct nouveau_bo *bo,
unsigned delta, unsigned dwords)
{
const uint32_t domain = NOUVEAU_BO_VRAM | NOUVEAU_BO_WR;
struct nouveau_pushbuf_refn refs[] = { { bo, domain } };
unsigned pitch = ((dwords * 4) + 63) & ~63;
if (nouveau_pushbuf_space(push, 32 + dwords, 2, 0) ||
nouveau_pushbuf_refn (push, refs, 1))
return;
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, NvClipRectangle);
BEGIN_NV04(push, NV01_CLIP(POINT), 2);
PUSH_DATA (push, (0 << 16) | 0);
PUSH_DATA (push, (1 << 16) | dwords);
BEGIN_NV04(push, NV04_SF2D(FORMAT), 4);
PUSH_DATA (push, NV04_SURFACE_2D_FORMAT_A8R8G8B8);
PUSH_DATA (push, (pitch << 16) | pitch);
PUSH_RELOC(push, bo, delta, NOUVEAU_BO_LOW, 0, 0);
PUSH_RELOC(push, bo, delta, NOUVEAU_BO_LOW, 0, 0);
BEGIN_NV04(push, NV01_IFC(OPERATION), 5);
PUSH_DATA (push, NV01_IFC_OPERATION_SRCCOPY);
PUSH_DATA (push, NV01_IFC_COLOR_FORMAT_A8R8G8B8);
PUSH_DATA (push, (0 << 16) | 0);
PUSH_DATA (push, (1 << 16) | dwords);
PUSH_DATA (push, (1 << 16) | dwords);
BEGIN_NV04(push, NV01_IFC(COLOR(0)), dwords);
}
/* For NV40 FP upload, deal with the weird-arse big-endian swap */
static __inline__ void
PUSH_DATAs(struct nouveau_pushbuf *push, unsigned data)
{
#if (X_BYTE_ORDER != X_LITTLE_ENDIAN)
data = (data >> 16) | ((data & 0xffff) << 16);
#endif
PUSH_DATA(push, data);
}
#endif
xf86-video-nouveau-1.0.16/src/nv40_xv_tex.c 0000644 0001750 0001756 00000026753 13423754626 015255 0000000 0000000 /*
* Copyright 2007-2008 Maarten Maathuis
* Copyright 2008 Stephane Marchesin
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "xf86xv.h"
#include
#include "exa.h"
#include "damage.h"
#include "dixstruct.h"
#include "fourcc.h"
#include "nv_include.h"
#include "nv_dma.h"
#include "hwdefs/nv30-40_3d.xml.h"
#include "nv04_accel.h"
extern Atom xvSyncToVBlank, xvSetDefaults;
#define SWIZZLE(ts0x,ts0y,ts0z,ts0w,ts1x,ts1y,ts1z,ts1w) ( \
NV30_3D_TEX_SWIZZLE_S0_X_##ts0x | NV30_3D_TEX_SWIZZLE_S0_Y_##ts0y | \
NV30_3D_TEX_SWIZZLE_S0_Z_##ts0z | NV30_3D_TEX_SWIZZLE_S0_W_##ts0w | \
NV30_3D_TEX_SWIZZLE_S1_X_##ts1x | NV30_3D_TEX_SWIZZLE_S1_Y_##ts1y | \
NV30_3D_TEX_SWIZZLE_S1_Z_##ts1z | NV30_3D_TEX_SWIZZLE_S1_W_##ts1w \
)
/*
* Texture 0 : filter table
* Texture 1 : Y data
* Texture 2 : UV data
*/
static Bool
NV40VideoTexture(ScrnInfoPtr pScrn, struct nouveau_bo *src, int offset,
uint16_t width, uint16_t height, uint16_t src_pitch, int unit)
{
NVPtr pNv = NVPTR(pScrn);
unsigned reloc = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD;
struct nouveau_pushbuf *push = pNv->pushbuf;
uint32_t card_fmt = 0;
uint32_t card_swz = 0;
switch(unit) {
case 0:
card_fmt = NV40_3D_TEX_FORMAT_FORMAT_A8R8G8B8;
card_swz = SWIZZLE(S1, S1, S1, S1, X, Y, Z, W);
break;
case 1:
card_fmt = NV40_3D_TEX_FORMAT_FORMAT_L8;
card_swz = SWIZZLE(S1, S1, S1, S1, X, X, X, X);
break;
case 2:
card_fmt = NV40_3D_TEX_FORMAT_FORMAT_A8L8;
#if X_BYTE_ORDER == X_BIG_ENDIAN
card_swz = SWIZZLE(S1, S1, S1, S1, Z, W, X, Y);
#else
card_swz = SWIZZLE(S1, S1, S1, S1, W, Z, Y, X);
#endif
break;
}
BEGIN_NV04(push, NV30_3D(TEX_OFFSET(unit)), 8);
PUSH_MTHDl(push, NV30_3D(TEX_OFFSET(unit)), src, offset, reloc);
if (unit==0) {
PUSH_MTHDs(push, NV30_3D(TEX_FORMAT(unit)), src,
card_fmt | 0x8000 |
NV30_3D_TEX_FORMAT_DIMS_1D |
NV30_3D_TEX_FORMAT_NO_BORDER |
(1 << NV40_3D_TEX_FORMAT_MIPMAP_COUNT__SHIFT),
reloc | NOUVEAU_BO_OR,
NV30_3D_TEX_FORMAT_DMA0,
NV30_3D_TEX_FORMAT_DMA1);
PUSH_DATA (push, NV30_3D_TEX_WRAP_S_REPEAT |
NV30_3D_TEX_WRAP_T_CLAMP_TO_EDGE |
NV30_3D_TEX_WRAP_R_CLAMP_TO_EDGE);
} else {
PUSH_MTHDs(push, NV30_3D(TEX_FORMAT(unit)), src,
card_fmt | 0x8000 |
NV40_3D_TEX_FORMAT_LINEAR |
NV40_3D_TEX_FORMAT_RECT |
NV30_3D_TEX_FORMAT_DIMS_2D |
NV30_3D_TEX_FORMAT_NO_BORDER |
(1 << NV40_3D_TEX_FORMAT_MIPMAP_COUNT__SHIFT),
reloc | NOUVEAU_BO_OR,
NV30_3D_TEX_FORMAT_DMA0,
NV30_3D_TEX_FORMAT_DMA1);
PUSH_DATA (push, NV30_3D_TEX_WRAP_S_CLAMP_TO_EDGE |
NV30_3D_TEX_WRAP_T_CLAMP_TO_EDGE |
NV30_3D_TEX_WRAP_R_CLAMP_TO_EDGE);
}
PUSH_DATA (push, NV40_3D_TEX_ENABLE_ENABLE);
PUSH_DATA (push, card_swz);
if (unit == 0)
PUSH_DATA (push, NV30_3D_TEX_FILTER_SIGNED_ALPHA |
NV30_3D_TEX_FILTER_SIGNED_RED |
NV30_3D_TEX_FILTER_SIGNED_GREEN |
NV30_3D_TEX_FILTER_SIGNED_BLUE |
NV30_3D_TEX_FILTER_MIN_LINEAR |
NV30_3D_TEX_FILTER_MAG_LINEAR | 0x3fd6);
else
PUSH_DATA (push, NV30_3D_TEX_FILTER_MIN_LINEAR |
NV30_3D_TEX_FILTER_MAG_LINEAR | 0x3fd6);
PUSH_DATA (push, (width << 16) | height);
PUSH_DATA (push, 0); /* border ARGB */
BEGIN_NV04(push, NV40_3D(TEX_SIZE1(unit)), 1);
PUSH_DATA (push, (1 << NV40_3D_TEX_SIZE1_DEPTH__SHIFT) |
(uint16_t) src_pitch);
return TRUE;
}
static Bool
NV40GetSurfaceFormat(PixmapPtr ppix, int *fmt_ret)
{
switch (ppix->drawable.bitsPerPixel) {
case 32:
*fmt_ret = NV30_3D_RT_FORMAT_COLOR_A8R8G8B8;
break;
case 24:
*fmt_ret = NV30_3D_RT_FORMAT_COLOR_X8R8G8B8;
break;
case 16:
*fmt_ret = NV30_3D_RT_FORMAT_COLOR_R5G6B5;
break;
case 8:
*fmt_ret = NV30_3D_RT_FORMAT_COLOR_B8;
break;
default:
return FALSE;
}
return TRUE;
}
void
NV40StopTexturedVideo(ScrnInfoPtr pScrn, pointer data, Bool Exit)
{
}
#define VERTEX_OUT(sx,sy,dx,dy) do { \
BEGIN_NV04(push, NV30_3D(VTX_ATTR_2F_X(8)), 4); \
PUSH_DATAf(push, (sx)); PUSH_DATAf(push, (sy)); \
PUSH_DATAf(push, (sx)/2.0); PUSH_DATAf(push, (sy)/2.0); \
BEGIN_NV04(push, NV30_3D(VTX_ATTR_2I(0)), 1); \
PUSH_DATA (push, (((dy)&0xffff)<<16)|((dx)&0xffff)); \
} while(0)
int
NV40PutTextureImage(ScrnInfoPtr pScrn,
struct nouveau_bo *src, int src_offset, int src_offset2,
int id, int src_pitch, BoxPtr dstBox,
int x1, int y1, int x2, int y2,
uint16_t width, uint16_t height,
uint16_t src_w, uint16_t src_h,
uint16_t drw_w, uint16_t drw_h,
RegionPtr clipBoxes, PixmapPtr ppix,
NVPortPrivPtr pPriv)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
Bool bicubic = pPriv->bicubic;
float X1, X2, Y1, Y2;
BoxPtr pbox;
int nbox, i;
int dst_format = 0;
if (drw_w > 4096 || drw_h > 4096) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"XV: Draw size too large.\n");
return BadAlloc;
}
if (!NV40GetSurfaceFormat(ppix, &dst_format)) {
ErrorF("No surface format, bad.\n");
return BadImplementation;
}
pbox = REGION_RECTS(clipBoxes);
nbox = REGION_NUM_RECTS(clipBoxes);
if (!PUSH_SPACE(push, 128))
return BadImplementation;
PUSH_RESET(push);
BEGIN_NV04(push, NV30_3D(BLEND_FUNC_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(RT_FORMAT), 3);
PUSH_DATA (push, NV30_3D_RT_FORMAT_TYPE_LINEAR |
NV30_3D_RT_FORMAT_ZETA_Z24S8 | dst_format);
PUSH_DATA (push, exaGetPixmapPitch(ppix));
PUSH_MTHDl(push, NV30_3D(COLOR0_OFFSET), bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
if (!NV40VideoTexture(pScrn, pNv->scratch, XV_TABLE, XV_TABLE_SIZE,
1, 0, 0) ||
!NV40VideoTexture(pScrn, src, src_offset, src_w, src_h,
src_pitch, 1)) {
PUSH_RESET(push);
return BadImplementation;
}
/* We've got NV12 format, which means half width and half height
* texture of chroma channels.
*/
if (!NV40VideoTexture(pScrn, src, src_offset2, src_w/2,
src_h/2, src_pitch, 2)) {
PUSH_RESET(push);
return BadImplementation;
}
if (drw_w / 2 < src_w || drw_h / 2 < src_h)
bicubic = FALSE;
BEGIN_NV04(push, NV30_3D(FP_ACTIVE_PROGRAM), 1);
PUSH_MTHD (push, NV30_3D(FP_ACTIVE_PROGRAM), pNv->scratch,
bicubic ? PFP_NV12_BICUBIC : PFP_NV12_BILINEAR,
NOUVEAU_BO_VRAM | NOUVEAU_BO_RD | NOUVEAU_BO_LOW |
NOUVEAU_BO_OR,
NV30_3D_FP_ACTIVE_PROGRAM_DMA0,
NV30_3D_FP_ACTIVE_PROGRAM_DMA1);
BEGIN_NV04(push, NV30_3D(FP_CONTROL), 1);
PUSH_DATA (push, 0x04000000);
/* Appears to be some kind of cache flush, needed here at least
* sometimes.. funky text rendering otherwise :)
*/
BEGIN_NV04(push, NV40_3D(TEX_CACHE_CTL), 1);
PUSH_DATA (push, 2);
BEGIN_NV04(push, NV40_3D(TEX_CACHE_CTL), 1);
PUSH_DATA (push, 1);
for (i = 0; i < 2; i++) {
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_CONST_ID), 17);
PUSH_DATA (push, i * 4);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
}
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push)) {
nouveau_pushbuf_bufctx(push, NULL);
return BadAlloc;
}
/* Before rendering we wait for vblank in the non-composited case. */
if (pPriv->SyncToVBlank)
NV11SyncToVBlank(ppix, dstBox);
/* These are fixed point values in the 16.16 format. */
X1 = (float)(x1>>16)+(float)(x1&0xFFFF)/(float)0x10000;
Y1 = (float)(y1>>16)+(float)(y1&0xFFFF)/(float)0x10000;
X2 = (float)(x2>>16)+(float)(x2&0xFFFF)/(float)0x10000;
Y2 = (float)(y2>>16)+(float)(y2&0xFFFF)/(float)0x10000;
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
PUSH_DATA (push, NV30_3D_VERTEX_BEGIN_END_TRIANGLES);
while(nbox--) {
float tx1=X1+(float)(pbox->x1 - dstBox->x1)*(X2-X1)/(float)(drw_w);
float tx2=X1+(float)(pbox->x2 - dstBox->x1)*(src_w)/(float)(drw_w);
float ty1=Y1+(float)(pbox->y1 - dstBox->y1)*(Y2-Y1)/(float)(drw_h);
float ty2=Y1+(float)(pbox->y2 - dstBox->y1)*(src_h)/(float)(drw_h);
int sx1=pbox->x1;
int sx2=pbox->x2;
int sy1=pbox->y1;
int sy2=pbox->y2;
if (!PUSH_SPACE(push, 64)) {
nouveau_pushbuf_bufctx(push, NULL);
return BadImplementation;
}
BEGIN_NV04(push, NV30_3D(SCISSOR_HORIZ), 2);
PUSH_DATA (push, (sx2 << 16) | 0);
PUSH_DATA (push, (sy2 << 16) | 0);
VERTEX_OUT(tx1, ty1, sx1, sy1);
VERTEX_OUT(tx2+(tx2-tx1), ty1, sx2+(sx2-sx1), sy1);
VERTEX_OUT(tx1, ty2+(ty2-ty1), sx1, sy2+(sy2-sy1));
pbox++;
}
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
PUSH_DATA (push, NV30_3D_VERTEX_BEGIN_END_STOP);
nouveau_pushbuf_bufctx(push, NULL);
PUSH_KICK(push);
return Success;
}
/**
* NV40SetTexturePortAttribute
* sets the attribute "attribute" of port "data" to value "value"
* supported attributes:
* Sync to vblank.
*
* @param pScrenInfo
* @param attribute attribute to set
* @param value value to which attribute is to be set
* @param data port from which the attribute is to be set
*
* @return Success, if setting is successful
* BadValue/BadMatch, if value/attribute are invalid
*/
int
NV40SetTexturePortAttribute(ScrnInfoPtr pScrn, Atom attribute,
INT32 value, pointer data)
{
NVPortPrivPtr pPriv = (NVPortPrivPtr)data;
if (attribute == xvSyncToVBlank) {
if ((value < 0) || (value > 1))
return BadValue;
pPriv->SyncToVBlank = value;
} else
if (attribute == xvSetDefaults) {
pPriv->SyncToVBlank = TRUE;
} else
return BadMatch;
return Success;
}
/**
* NV40GetTexturePortAttribute
* reads the value of attribute "attribute" from port "data" into INT32 "*value"
* Sync to vblank.
*
* @param pScrn unused
* @param attribute attribute to be read
* @param value value of attribute will be stored here
* @param data port from which attribute will be read
* @return Success, if queried attribute exists
*/
int
NV40GetTexturePortAttribute(ScrnInfoPtr pScrn, Atom attribute,
INT32 *value, pointer data)
{
NVPortPrivPtr pPriv = (NVPortPrivPtr)data;
if(attribute == xvSyncToVBlank)
*value = (pPriv->SyncToVBlank) ? 1 : 0;
else
return BadMatch;
return Success;
}
xf86-video-nouveau-1.0.16/src/nv40_exa.c 0000644 0001750 0001756 00000102036 13423754626 014502 0000000 0000000 /*
* Copyright 2007 Ben Skeggs
*
* 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.
*/
#include "nv_include.h"
#include "hwdefs/nv_object.xml.h"
#include "hwdefs/nv30-40_3d.xml.h"
#include "nv04_accel.h"
typedef struct nv_pict_surface_format {
int pict_fmt;
uint32_t card_fmt;
} nv_pict_surface_format_t;
typedef struct nv_pict_texture_format {
int pict_fmt;
uint32_t card_fmt;
uint32_t card_swz;
} nv_pict_texture_format_t;
typedef struct nv_pict_op {
Bool src_alpha;
Bool dst_alpha;
uint32_t src_card_op;
uint32_t dst_card_op;
} nv_pict_op_t;
static nv_pict_surface_format_t
NV40SurfaceFormat[] = {
{ PICT_a8r8g8b8 , NV30_3D_RT_FORMAT_COLOR_A8R8G8B8 },
{ PICT_x8r8g8b8 , NV30_3D_RT_FORMAT_COLOR_X8R8G8B8 },
{ PICT_r5g6b5 , NV30_3D_RT_FORMAT_COLOR_R5G6B5 },
{ PICT_a8 , NV30_3D_RT_FORMAT_COLOR_B8 },
{ -1, ~0 }
};
static nv_pict_surface_format_t *
NV40_GetPictSurfaceFormat(int format)
{
int i = 0;
while (NV40SurfaceFormat[i].pict_fmt != -1) {
if (NV40SurfaceFormat[i].pict_fmt == format)
return &NV40SurfaceFormat[i];
i++;
}
return NULL;
}
#define _(r,tf,ts0x,ts0y,ts0z,ts0w,ts1x,ts1y,ts1z,ts1w) \
{ \
PICT_##r, NV40_3D_TEX_FORMAT_FORMAT_##tf, \
NV30_3D_TEX_SWIZZLE_S0_X_##ts0x | NV30_3D_TEX_SWIZZLE_S0_Y_##ts0y | \
NV30_3D_TEX_SWIZZLE_S0_Z_##ts0z | NV30_3D_TEX_SWIZZLE_S0_W_##ts0w | \
NV30_3D_TEX_SWIZZLE_S1_X_##ts1x | NV30_3D_TEX_SWIZZLE_S1_Y_##ts1y | \
NV30_3D_TEX_SWIZZLE_S1_Z_##ts1z | NV30_3D_TEX_SWIZZLE_S1_W_##ts1w, \
}
static nv_pict_texture_format_t
NV40TextureFormat[] = {
_(a8r8g8b8, A8R8G8B8, S1, S1, S1, S1, X, Y, Z, W),
_(x8r8g8b8, A8R8G8B8, S1, S1, S1, ONE, X, Y, Z, W),
_(x8b8g8r8, A8R8G8B8, S1, S1, S1, ONE, Z, Y, X, W),
_(a1r5g5b5, A1R5G5B5, S1, S1, S1, S1, X, Y, Z, W),
_(x1r5g5b5, A1R5G5B5, S1, S1, S1, ONE, X, Y, Z, W),
_( r5g6b5, R5G6B5, S1, S1, S1, S1, X, Y, Z, W),
_( a8, L8, ZERO, ZERO, ZERO, S1, X, X, X, X),
{ -1, ~0, ~0 }
};
#undef _
static nv_pict_texture_format_t *
NV40_GetPictTextureFormat(int format)
{
int i = 0;
while (NV40TextureFormat[i].pict_fmt != -1) {
if (NV40TextureFormat[i].pict_fmt == format)
return &NV40TextureFormat[i];
i++;
}
return NULL;
}
#define SF(bf) (NV30_3D_BLEND_FUNC_SRC_RGB_##bf | \
NV30_3D_BLEND_FUNC_SRC_ALPHA_##bf)
#define DF(bf) (NV30_3D_BLEND_FUNC_DST_RGB_##bf | \
NV30_3D_BLEND_FUNC_DST_ALPHA_##bf)
static nv_pict_op_t
NV40PictOp[] = {
/* Clear */ { 0, 0, SF( ZERO), DF( ZERO) },
/* Src */ { 0, 0, SF( ONE), DF( ZERO) },
/* Dst */ { 0, 0, SF( ZERO), DF( ONE) },
/* Over */ { 1, 0, SF( ONE), DF(ONE_MINUS_SRC_ALPHA) },
/* OverReverse */ { 0, 1, SF(ONE_MINUS_DST_ALPHA), DF( ONE) },
/* In */ { 0, 1, SF( DST_ALPHA), DF( ZERO) },
/* InReverse */ { 1, 0, SF( ZERO), DF( SRC_ALPHA) },
/* Out */ { 0, 1, SF(ONE_MINUS_DST_ALPHA), DF( ZERO) },
/* OutReverse */ { 1, 0, SF( ZERO), DF(ONE_MINUS_SRC_ALPHA) },
/* Atop */ { 1, 1, SF( DST_ALPHA), DF(ONE_MINUS_SRC_ALPHA) },
/* AtopReverse */ { 1, 1, SF(ONE_MINUS_DST_ALPHA), DF( SRC_ALPHA) },
/* Xor */ { 1, 1, SF(ONE_MINUS_DST_ALPHA), DF(ONE_MINUS_SRC_ALPHA) },
/* Add */ { 0, 0, SF( ONE), DF( ONE) }
};
static nv_pict_op_t *
NV40_GetPictOpRec(int op)
{
if (op >= PictOpSaturate)
return NULL;
return &NV40PictOp[op];
}
static void
NV40_SetupBlend(ScrnInfoPtr pScrn, nv_pict_op_t *blend,
PictFormatShort dest_format, Bool component_alpha)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
uint32_t sblend, dblend;
sblend = blend->src_card_op;
dblend = blend->dst_card_op;
if (blend->dst_alpha) {
if (!PICT_FORMAT_A(dest_format)) {
if (sblend == SF(DST_ALPHA)) {
sblend = SF(ONE);
} else if (sblend == SF(ONE_MINUS_DST_ALPHA)) {
sblend = SF(ZERO);
}
} else if (dest_format == PICT_a8) {
if (sblend == SF(DST_ALPHA)) {
sblend = SF(DST_COLOR);
} else if (sblend == SF(ONE_MINUS_DST_ALPHA)) {
sblend = SF(ONE_MINUS_DST_COLOR);
}
}
}
if (blend->src_alpha && (component_alpha || dest_format == PICT_a8)) {
if (dblend == DF(SRC_ALPHA)) {
dblend = DF(SRC_COLOR);
} else if (dblend == DF(ONE_MINUS_SRC_ALPHA)) {
dblend = DF(ONE_MINUS_SRC_COLOR);
}
}
if (sblend == SF(ONE) && dblend == DF(ZERO)) {
BEGIN_NV04(push, NV30_3D(BLEND_FUNC_ENABLE), 1);
PUSH_DATA (push, 0);
} else {
BEGIN_NV04(push, NV30_3D(BLEND_FUNC_ENABLE), 5);
PUSH_DATA (push, 1);
PUSH_DATA (push, sblend);
PUSH_DATA (push, dblend);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, NV40_3D_BLEND_EQUATION_ALPHA_FUNC_ADD |
NV40_3D_BLEND_EQUATION_RGB_FUNC_ADD);
}
}
static Bool
NV40EXAPictSolid(NVPtr pNv, PicturePtr pPict, int unit)
{
struct nouveau_pushbuf *push = pNv->pushbuf;
PUSH_DATAu(push, pNv->scratch, SOLID(unit), 2);
PUSH_DATA (push, pPict->pSourcePict->solidFill.color);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(TEX_OFFSET(unit)), 8);
PUSH_MTHDl(push, NV30_3D(TEX_OFFSET(unit)), pNv->scratch, SOLID(unit),
NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
PUSH_DATA (push, NV40_3D_TEX_FORMAT_FORMAT_A8R8G8B8 | 0x8000 |
NV40_3D_TEX_FORMAT_LINEAR |
NV30_3D_TEX_FORMAT_DIMS_2D |
NV30_3D_TEX_FORMAT_NO_BORDER |
(1 << NV40_3D_TEX_FORMAT_MIPMAP_COUNT__SHIFT) |
NV30_3D_TEX_FORMAT_DMA0);
PUSH_DATA (push, NV30_3D_TEX_WRAP_S_REPEAT |
NV30_3D_TEX_WRAP_T_REPEAT |
NV30_3D_TEX_WRAP_R_REPEAT);
PUSH_DATA (push, NV40_3D_TEX_ENABLE_ENABLE);
PUSH_DATA (push, 0x0000aae4);
PUSH_DATA (push, NV30_3D_TEX_FILTER_MIN_NEAREST |
NV30_3D_TEX_FILTER_MAG_NEAREST | 0x3fd6);
PUSH_DATA (push, 0x00010001);
PUSH_DATA (push, 0x00000000);
BEGIN_NV04(push, NV40_3D(TEX_SIZE1(unit)), 1);
PUSH_DATA (push, 0x00100040);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_CONST_ID), 17);
PUSH_DATA (push, unit * 4);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
return TRUE;
}
static Bool
NV40EXAPictGradient(NVPtr pNv, PicturePtr pPict, int unit)
{
return FALSE;
}
static Bool
NV40EXAPictTexture(NVPtr pNv, PixmapPtr pPix, PicturePtr pPict, int unit)
{
unsigned reloc = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_WR;
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_bo *bo = nouveau_pixmap_bo(pPix);
nv_pict_texture_format_t *fmt;
fmt = NV40_GetPictTextureFormat(pPict->format);
if (!fmt)
return FALSE;
BEGIN_NV04(push, NV30_3D(TEX_OFFSET(unit)), 8);
PUSH_MTHDl(push, NV30_3D(TEX_OFFSET(unit)), bo, 0, reloc);
PUSH_MTHDs(push, NV30_3D(TEX_FORMAT(unit)), bo, fmt->card_fmt |
NV40_3D_TEX_FORMAT_LINEAR |
NV30_3D_TEX_FORMAT_DIMS_2D | 0x8000 |
NV30_3D_TEX_FORMAT_NO_BORDER |
(1 << NV40_3D_TEX_FORMAT_MIPMAP_COUNT__SHIFT),
reloc | NOUVEAU_BO_OR,
NV30_3D_TEX_FORMAT_DMA0, NV30_3D_TEX_FORMAT_DMA1);
if (pPict->repeat) {
switch(pPict->repeatType) {
case RepeatPad:
PUSH_DATA (push, NV30_3D_TEX_WRAP_S_CLAMP_TO_EDGE |
NV30_3D_TEX_WRAP_T_CLAMP_TO_EDGE |
NV30_3D_TEX_WRAP_R_CLAMP_TO_EDGE);
break;
case RepeatReflect:
PUSH_DATA (push, NV30_3D_TEX_WRAP_S_MIRRORED_REPEAT |
NV30_3D_TEX_WRAP_T_MIRRORED_REPEAT |
NV30_3D_TEX_WRAP_R_MIRRORED_REPEAT);
break;
case RepeatNormal:
default:
PUSH_DATA (push, NV30_3D_TEX_WRAP_S_REPEAT |
NV30_3D_TEX_WRAP_T_REPEAT |
NV30_3D_TEX_WRAP_R_REPEAT);
break;
}
} else {
PUSH_DATA (push, NV30_3D_TEX_WRAP_S_CLAMP_TO_BORDER |
NV30_3D_TEX_WRAP_T_CLAMP_TO_BORDER |
NV30_3D_TEX_WRAP_R_CLAMP_TO_BORDER);
}
PUSH_DATA (push, NV40_3D_TEX_ENABLE_ENABLE);
PUSH_DATA (push, fmt->card_swz);
if (pPict->filter == PictFilterBilinear) {
PUSH_DATA (push, NV30_3D_TEX_FILTER_MIN_LINEAR |
NV30_3D_TEX_FILTER_MAG_LINEAR | 0x3fd6);
} else {
PUSH_DATA (push, NV30_3D_TEX_FILTER_MIN_NEAREST |
NV30_3D_TEX_FILTER_MAG_NEAREST | 0x3fd6);
}
PUSH_DATA (push, (pPix->drawable.width << 16) | pPix->drawable.height);
PUSH_DATA (push, 0); /* border ARGB */
BEGIN_NV04(push, NV40_3D(TEX_SIZE1(unit)), 1);
PUSH_DATA (push, (1 << NV40_3D_TEX_SIZE1_DEPTH__SHIFT) |
(uint32_t)exaGetPixmapPitch(pPix));
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_CONST_ID), 17);
PUSH_DATA (push, unit * 4);
if (pPict->transform) {
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[0][0]));
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[0][1]));
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[0][2]));
PUSH_DATAf(push, 0);
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[1][0]));
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[1][1]));
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[1][2]));
PUSH_DATAf(push, 0);
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[2][0]));
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[2][1]));
PUSH_DATAf(push, xFixedToFloat(pPict->transform->matrix[2][2]));
PUSH_DATAf(push, 0);
} else {
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
}
PUSH_DATAf(push, 1.0 / pPix->drawable.width);
PUSH_DATAf(push, 1.0 / pPix->drawable.height);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
return TRUE;
}
static Bool
NV40EXAPicture(NVPtr pNv, PixmapPtr ppix, PicturePtr ppict, int unit)
{
if (ppict->pDrawable)
return NV40EXAPictTexture(pNv, ppix, ppict, unit);
switch (ppict->pSourcePict->type) {
case SourcePictTypeSolidFill:
return NV40EXAPictSolid(pNv, ppict, unit);
case SourcePictTypeLinear:
return NV40EXAPictGradient(pNv, ppict, unit);
default:
break;
}
return FALSE;
}
static Bool
NV40_SetupSurface(ScrnInfoPtr pScrn, PixmapPtr pPix, PictFormatShort format)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_bo *bo = nouveau_pixmap_bo(pPix);
nv_pict_surface_format_t *fmt;
fmt = NV40_GetPictSurfaceFormat(format);
if (!fmt) {
ErrorF("AIII no format\n");
return FALSE;
}
BEGIN_NV04(push, NV30_3D(RT_FORMAT), 3);
PUSH_DATA (push, NV30_3D_RT_FORMAT_TYPE_LINEAR |
NV30_3D_RT_FORMAT_ZETA_Z24S8 | fmt->card_fmt);
PUSH_DATA (push, exaGetPixmapPitch(pPix));
PUSH_MTHDl(push, NV30_3D(COLOR0_OFFSET), bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
return TRUE;
}
static Bool
NV40EXACheckCompositeTexture(PicturePtr pPict, PicturePtr pdPict, int op)
{
nv_pict_texture_format_t *fmt;
int w = 1, h = 1;
if (pPict->pDrawable) {
w = pPict->pDrawable->width;
h = pPict->pDrawable->height;
} else {
switch (pPict->pSourcePict->type) {
case SourcePictTypeSolidFill:
break;
default:
NOUVEAU_FALLBACK("gradient\n");
}
}
if ((w > 4096) || (h > 4096))
NOUVEAU_FALLBACK("picture too large, %dx%d\n", w, h);
fmt = NV40_GetPictTextureFormat(pPict->format);
if (!fmt)
NOUVEAU_FALLBACK("picture format 0x%08x not supported\n",
pPict->format);
if (pPict->filter != PictFilterNearest &&
pPict->filter != PictFilterBilinear)
NOUVEAU_FALLBACK("filter 0x%x not supported\n", pPict->filter);
/* Opengl and Render disagree on what should be sampled outside an XRGB
* texture (with no repeating). Opengl has a hardcoded alpha value of
* 1.0, while render expects 0.0. We assume that clipping is done for
* untranformed sources.
*/
if (NV40PictOp[op].src_alpha && !pPict->repeat &&
pPict->transform && (PICT_FORMAT_A(pPict->format) == 0)
&& (PICT_FORMAT_A(pdPict->format) != 0))
NOUVEAU_FALLBACK("REPEAT_NONE unsupported for XRGB source\n");
return TRUE;
}
Bool
NV40EXACheckComposite(int op, PicturePtr psPict,
PicturePtr pmPict,
PicturePtr pdPict)
{
nv_pict_surface_format_t *fmt;
nv_pict_op_t *opr;
opr = NV40_GetPictOpRec(op);
if (!opr)
NOUVEAU_FALLBACK("unsupported blend op 0x%x\n", op);
fmt = NV40_GetPictSurfaceFormat(pdPict->format);
if (!fmt)
NOUVEAU_FALLBACK("dst picture format 0x%08x not supported\n",
pdPict->format);
if (!NV40EXACheckCompositeTexture(psPict, pdPict, op))
NOUVEAU_FALLBACK("src picture\n");
if (pmPict) {
if (pmPict->componentAlpha &&
PICT_FORMAT_RGB(pmPict->format) &&
opr->src_alpha && opr->src_card_op != SF(ZERO))
NOUVEAU_FALLBACK("mask CA + SA\n");
if (!NV40EXACheckCompositeTexture(pmPict, pdPict, op))
NOUVEAU_FALLBACK("mask picture\n");
}
return TRUE;
}
Bool
NV40EXAPrepareComposite(int op, PicturePtr psPict,
PicturePtr pmPict,
PicturePtr pdPict,
PixmapPtr psPix,
PixmapPtr pmPix,
PixmapPtr pdPix)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
nv_pict_op_t *blend = NV40_GetPictOpRec(op);
struct nouveau_pushbuf *push = pNv->pushbuf;
uint32_t fragprog;
if (!PUSH_SPACE(push, 128))
NOUVEAU_FALLBACK("space\n");
PUSH_RESET(push);
NV40_SetupBlend(pScrn, blend, pdPict->format,
(pmPict && pmPict->componentAlpha &&
PICT_FORMAT_RGB(pmPict->format)));
if (!NV40_SetupSurface(pScrn, pdPix, pdPict->format) ||
!NV40EXAPicture(pNv, psPix, psPict, 0))
return FALSE;
if (pmPict) {
if (!NV40EXAPicture(pNv, pmPix, pmPict, 1))
return FALSE;
if (pdPict->format == PICT_a8) {
fragprog = PFP_C_A8;
} else
if (pmPict->componentAlpha && PICT_FORMAT_RGB(pmPict->format)) {
if (blend->src_alpha)
fragprog = PFP_CCASA;
else
fragprog = PFP_CCA;
} else {
fragprog = PFP_C;
}
} else {
if (pdPict->format == PICT_a8)
fragprog = PFP_S_A8;
else
fragprog = PFP_S;
}
BEGIN_NV04(push, NV30_3D(FP_ACTIVE_PROGRAM), 1);
PUSH_MTHD (push, NV30_3D(FP_ACTIVE_PROGRAM), pNv->scratch, fragprog,
NOUVEAU_BO_VRAM | NOUVEAU_BO_RD | NOUVEAU_BO_LOW |
NOUVEAU_BO_OR,
NV30_3D_FP_ACTIVE_PROGRAM_DMA0,
NV30_3D_FP_ACTIVE_PROGRAM_DMA1);
BEGIN_NV04(push, NV30_3D(FP_CONTROL), 1);
PUSH_DATA (push, 0x02000000);
/* Appears to be some kind of cache flush, needed here at least
* sometimes.. funky text rendering otherwise :)
*/
BEGIN_NV04(push, NV40_3D(TEX_CACHE_CTL), 1);
PUSH_DATA (push, 2);
BEGIN_NV04(push, NV40_3D(TEX_CACHE_CTL), 1);
PUSH_DATA (push, 1);
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push)) {
nouveau_pushbuf_bufctx(push, NULL);
return FALSE;
}
return TRUE;
}
static __inline__ void
PUSH_VTX2s(struct nouveau_pushbuf *push,
int x1, int y1, int x2, int y2, int dx, int dy)
{
BEGIN_NV04(push, NV30_3D(VTX_ATTR_2I(8)), 2);
PUSH_DATA (push, ((y1 & 0xffff) << 16) | (x1 & 0xffff));
PUSH_DATA (push, ((y2 & 0xffff) << 16) | (x2 & 0xffff));
BEGIN_NV04(push, NV30_3D(VTX_ATTR_2I(0)), 1);
PUSH_DATA (push, ((dy & 0xffff) << 16) | (dx & 0xffff));
}
void
NV40EXAComposite(PixmapPtr pdPix,
int sx, int sy, int mx, int my, int dx, int dy, int w, int h)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
if (!PUSH_SPACE(push, 64))
return;
/* We're drawing a triangle, we need to scissor it to a quad. */
/* The scissors are here for a good reason, we don't get the full
* image, but just a part.
*/
/* Handling the cliprects is done for us already. */
BEGIN_NV04(push, NV30_3D(SCISSOR_HORIZ), 2);
PUSH_DATA (push, (w << 16) | dx);
PUSH_DATA (push, (h << 16) | dy);
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
PUSH_DATA (push, NV30_3D_VERTEX_BEGIN_END_TRIANGLES);
PUSH_VTX2s(push, sx, sy + (h * 2), mx, my + (h * 2), dx, dy + (h * 2));
PUSH_VTX2s(push, sx, sy, mx, my, dx, dy);
PUSH_VTX2s(push, sx + (w * 2), sy, mx + (w * 2), my, dx + (w * 2), dy);
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
PUSH_DATA (push, NV30_3D_VERTEX_BEGIN_END_STOP);
}
void
NV40EXADoneComposite(PixmapPtr pdPix)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
nouveau_pushbuf_bufctx(NVPTR(pScrn)->pushbuf, NULL);
}
#define NV30_3D_CHIPSET_4X_MASK 0x00000baf
#define NV44TCL_CHIPSET_4X_MASK 0x00005450
Bool
NVAccelInitNV40TCL(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nv04_fifo *fifo = pNv->channel->data;
uint32_t class = 0, chipset;
int i;
NVXVComputeBicubicFilter(pNv->scratch, XV_TABLE, XV_TABLE_SIZE);
chipset = pNv->dev->chipset;
if ((chipset & 0xf0) == NV_ARCH_40) {
chipset &= 0xf;
if (NV30_3D_CHIPSET_4X_MASK & (1<scrnIndex, X_ERROR,
"NV40EXA: Unknown chipset NV4%1x\n", chipset);
return FALSE;
}
} else if ( (chipset & 0xf0) == 0x60) {
class = NV44_3D_CLASS;
} else
return TRUE;
if (nouveau_object_new(pNv->channel, Nv3D, class, NULL, 0, &pNv->Nv3D))
return FALSE;
if (!PUSH_SPACE(push, 256))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(3D, OBJECT), 1);
PUSH_DATA (push, pNv->Nv3D->handle);
BEGIN_NV04(push, NV30_3D(DMA_NOTIFY), 1);
PUSH_DATA (push, pNv->notify0->handle);
BEGIN_NV04(push, NV30_3D(DMA_TEXTURE0), 2);
PUSH_DATA (push, fifo->vram);
PUSH_DATA (push, fifo->gart);
BEGIN_NV04(push, NV30_3D(DMA_COLOR0), 2);
PUSH_DATA (push, fifo->vram);
PUSH_DATA (push, fifo->vram);
/* voodoo */
BEGIN_NV04(push, SUBC_3D(0x1ea4), 3);
PUSH_DATA (push, 0x00000010);
PUSH_DATA (push, 0x01000100);
PUSH_DATA (push, 0xff800006);
BEGIN_NV04(push, SUBC_3D(0x1fc4), 1);
PUSH_DATA (push, 0x06144321);
BEGIN_NV04(push, SUBC_3D(0x1fc8), 2);
PUSH_DATA (push, 0xedcba987);
PUSH_DATA (push, 0x00000021);
BEGIN_NV04(push, SUBC_3D(0x1fd0), 1);
PUSH_DATA (push, 0x00171615);
BEGIN_NV04(push, SUBC_3D(0x1fd4), 1);
PUSH_DATA (push, 0x001b1a19);
BEGIN_NV04(push, SUBC_3D(0x1ef8), 1);
PUSH_DATA (push, 0x0020ffff);
BEGIN_NV04(push, SUBC_3D(0x1d64), 1);
PUSH_DATA (push, 0x00d30000);
BEGIN_NV04(push, NV30_3D(ENGINE), 1);
PUSH_DATA (push, NV30_3D_ENGINE_FP);
/* This removes the the stair shaped tearing that i get. */
/* Verified on one G70 card that it doesn't cause regressions for people without the problem. */
/* The blob sets this up by default for NV43. */
BEGIN_NV04(push, NV30_3D(FP_REG_CONTROL), 1);
PUSH_DATA (push, 0x0000000F);
BEGIN_NV04(push, NV30_3D(VIEWPORT_TRANSLATE_X), 8);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
/* default 3D state */
/*XXX: replace with the same state that the DRI emits on startup */
BEGIN_NV04(push, NV30_3D(STENCIL_ENABLE(0)), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(STENCIL_ENABLE(1)), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(ALPHA_FUNC_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(DEPTH_WRITE_ENABLE), 2);
PUSH_DATA (push, 0);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(COLOR_MASK), 1);
PUSH_DATA (push, 0x01010101); /* TR,TR,TR,TR */
BEGIN_NV04(push, NV30_3D(CULL_FACE_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(BLEND_FUNC_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(COLOR_LOGIC_OP_ENABLE), 2);
PUSH_DATA (push, 0);
PUSH_DATA (push, NV30_3D_COLOR_LOGIC_OP_OP_COPY);
BEGIN_NV04(push, NV30_3D(DITHER_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(SHADE_MODEL), 1);
PUSH_DATA (push, NV30_3D_SHADE_MODEL_SMOOTH);
BEGIN_NV04(push, NV30_3D(POLYGON_OFFSET_FACTOR),2);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
BEGIN_NV04(push, NV30_3D(POLYGON_MODE_FRONT), 2);
PUSH_DATA (push, NV30_3D_POLYGON_MODE_FRONT_FILL);
PUSH_DATA (push, NV30_3D_POLYGON_MODE_BACK_FILL);
BEGIN_NV04(push, NV30_3D(POLYGON_STIPPLE_PATTERN(0)), 0x20);
for (i=0;i<0x20;i++)
PUSH_DATA (push, 0xFFFFFFFF);
for (i=0;i<16;i++) {
BEGIN_NV04(push, NV30_3D(TEX_ENABLE(i)), 1);
PUSH_DATA (push, 0);
}
BEGIN_NV04(push, NV30_3D(DEPTH_CONTROL), 1);
PUSH_DATA (push, 0x110);
BEGIN_NV04(push, NV30_3D(RT_ENABLE), 1);
PUSH_DATA (push, NV30_3D_RT_ENABLE_COLOR0);
BEGIN_NV04(push, NV30_3D(RT_HORIZ), 2);
PUSH_DATA (push, (4096 << 16));
PUSH_DATA (push, (4096 << 16));
BEGIN_NV04(push, NV30_3D(SCISSOR_HORIZ), 2);
PUSH_DATA (push, (4096 << 16));
PUSH_DATA (push, (4096 << 16));
BEGIN_NV04(push, NV30_3D(VIEWPORT_HORIZ), 2);
PUSH_DATA (push, (4096 << 16));
PUSH_DATA (push, (4096 << 16));
BEGIN_NV04(push, NV30_3D(VIEWPORT_CLIP_HORIZ(0)), 2);
PUSH_DATA (push, (4095 << 16));
PUSH_DATA (push, (4095 << 16));
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_FROM_ID), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x401f9c6c); /* mov o[hpos], a[0] */
PUSH_DATA (push, 0x0040000d);
PUSH_DATA (push, 0x8106c083);
PUSH_DATA (push, 0x6041ef80);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x00001c6c); /* mov r0.xyw, a[8].xyww */
PUSH_DATA (push, 0x0040080f);
PUSH_DATA (push, 0x8106c083);
PUSH_DATA (push, 0x6041affc);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x00009c6c); /* dp3 r1.x, r0.xyw, c[0].xyz */
PUSH_DATA (push, 0x0140000f);
PUSH_DATA (push, 0x808680c3);
PUSH_DATA (push, 0x60410ffc);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x00009c6c); /* dp3 r1.y, r0.xyw, c[1].xyz */
PUSH_DATA (push, 0x0140100f);
PUSH_DATA (push, 0x808680c3);
PUSH_DATA (push, 0x60408ffc);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x00009c6c); /* dp3 r1.w, r0.xyw, c[2].xyz */
PUSH_DATA (push, 0x0140200f);
PUSH_DATA (push, 0x808680c3);
PUSH_DATA (push, 0x60402ffc);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x401f9c6c); /* mul o[tex0].xyw, r1, c[3] */
PUSH_DATA (push, 0x0080300d);
PUSH_DATA (push, 0x8286c0c3);
PUSH_DATA (push, 0x6041af9c);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x00001c6c); /* mov r0.xyw, a[9].xyww */
PUSH_DATA (push, 0x0040090f);
PUSH_DATA (push, 0x8106c083);
PUSH_DATA (push, 0x6041affc);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x00009c6c); /* dp3 r1.x, r0.xyw, c[4].xyz */
PUSH_DATA (push, 0x0140400f);
PUSH_DATA (push, 0x808680c3);
PUSH_DATA (push, 0x60410ffc);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x00009c6c); /* dp3 r1.y, r0.xyw, c[5].xyz */
PUSH_DATA (push, 0x0140500f);
PUSH_DATA (push, 0x808680c3);
PUSH_DATA (push, 0x60408ffc);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x00009c6c); /* dp3 r1.w, r0.xyw, c[6].xyz */
PUSH_DATA (push, 0x0140600f);
PUSH_DATA (push, 0x808680c3);
PUSH_DATA (push, 0x60402ffc);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x401f9c6c); /* exit mul o[tex1].xyw, r1, c[4] */
PUSH_DATA (push, 0x0080700d);
PUSH_DATA (push, 0x8286c0c3);
PUSH_DATA (push, 0x6041afa1);
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_INST(0)), 4);
PUSH_DATA (push, 0x00000000); /* exit */
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000001);
BEGIN_NV04(push, NV30_3D(VP_START_FROM_ID), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV40_3D(VP_ATTRIB_EN), 2);
PUSH_DATA (push, 0x00000309);
PUSH_DATA (push, 0x0000c001);
PUSH_DATAu(push, pNv->scratch, PFP_PASS, 1 * 4);
PUSH_DATAs(push, 0x01403e81); /* mov r0, a[col0] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAu(push, pNv->scratch, PFP_S, 2 * 4);
PUSH_DATAs(push, 0x18009e00); /* txp r0, a[tex0], t[0] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x01401e81); /* mov r0, r0 */
PUSH_DATAs(push, 0x1c9dc800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAu(push, pNv->scratch, PFP_S_A8, 2 * 4);
PUSH_DATAs(push, 0x18009000); /* txp r0.w, a[tex0], t[0] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x01401e81); /* mov r0, r0.w */
PUSH_DATAs(push, 0x1c9dfe00);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAu(push, pNv->scratch, PFP_C, 3 * 4);
PUSH_DATAs(push, 0x1802b102); /* txpc0 r1.w, a[tex1], t[1] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x18009e00); /* txp r0 (ne0.w), a[tex0], t[0] */
PUSH_DATAs(push, 0x1ff5c801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x02001e81); /* mul r0, r0, r1.w */
PUSH_DATAs(push, 0x1c9dc800);
PUSH_DATAs(push, 0x0001fe04);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAu(push, pNv->scratch, PFP_C_A8, 3 * 4);
PUSH_DATAs(push, 0x1802b102); /* txpc0 r1.w, a[tex1], t[1] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x18009000); /* txp r0.w (ne0.w), a[tex0], t[0] */
PUSH_DATAs(push, 0x1ff5c801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x02001e81); /* mul r0, r0.w, r1.w */
PUSH_DATAs(push, 0x1c9dfe00);
PUSH_DATAs(push, 0x0001fe04);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAu(push, pNv->scratch, PFP_CCA, 3 * 4);
PUSH_DATAs(push, 0x18009f00); /* txpc0 r0, a[tex0], t[0] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x1802be02); /* txp r1 (ne0), a[tex1], t[1] */
PUSH_DATAs(push, 0x1c95c801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x02001e81); /* mul r0, r0, r1 */
PUSH_DATAs(push, 0x1c9dc800);
PUSH_DATAs(push, 0x0001c804);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAu(push, pNv->scratch, PFP_CCASA, 3 * 4);
PUSH_DATAs(push, 0x18009102); /* txpc0 r1.w, a[tex0], t[0] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x1802be00); /* txp r0 (ne0.w), a[tex1], t[1] */
PUSH_DATAs(push, 0x1ff5c801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x02001e81); /* mul r0, r1.w, r0 */
PUSH_DATAs(push, 0x1c9dfe04);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAu(push, pNv->scratch, PFP_NV12_BILINEAR, 8 * 4);
PUSH_DATAs(push, 0x17028200); /* texr r0.x, a[tex0], t[1] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x04000e02); /* madr r1.xyz, r0.x, imm.x, imm.yzww */
PUSH_DATAs(push, 0x1c9c0000);
PUSH_DATAs(push, 0x00000002);
PUSH_DATAs(push, 0x0001f202);
PUSH_DATAs(push, 0x3f9507c8); /* { 1.16, -0.87, 0.53, -1.08 } */
PUSH_DATAs(push, 0xbf5ee393);
PUSH_DATAs(push, 0x3f078fef);
PUSH_DATAs(push, 0xbf8a6762);
PUSH_DATAs(push, 0x1704ac80); /* texr r0.yz, a[tex1], t[2] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x04000e02); /* madr r1.xyz, r0.y, imm, r1 */
PUSH_DATAs(push, 0x1c9cab00);
PUSH_DATAs(push, 0x0001c802);
PUSH_DATAs(push, 0x0001c804);
PUSH_DATAs(push, 0x00000000); /* { 0.00, -0.39, 2.02, 0.00 } */
PUSH_DATAs(push, 0xbec890d6);
PUSH_DATAs(push, 0x40011687);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x04000e81); /* madr r0.xyz, r0.z, imm, r1 */
PUSH_DATAs(push, 0x1c9d5500);
PUSH_DATAs(push, 0x0001c802);
PUSH_DATAs(push, 0x0001c804);
PUSH_DATAs(push, 0x3fcc432d); /* { 1.60, -0.81, 0.00, 0.00 } */
PUSH_DATAs(push, 0xbf501a37);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAu(push, pNv->scratch, PFP_NV12_BICUBIC, 29 * 4);
PUSH_DATAs(push, 0x01008600); /* movr r0.xy, a[tex0] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x03000800); /* addr r0.z, r0.y, imm.x */
PUSH_DATAs(push, 0x1c9caa00);
PUSH_DATAs(push, 0x00000002);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3f000000); /* { 0.50, 0.00, 0.00, 0.00 } */
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x03000202); /* addr r1.x, r0, imm.x */
PUSH_DATAs(push, 0x1c9dc800);
PUSH_DATAs(push, 0x00000002);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3f000000); /* { 0.50, 0.00, 0.00, 0.00 } */
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x17000f82); /* texrc0 r1.xyz, r0.z, t[0] */
PUSH_DATAs(push, 0x1c9d5400);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x02001404); /* mulr r2.yw, r1.xxyy, imm.xxyy */
PUSH_DATAs(push, 0x1c9ca104);
PUSH_DATAs(push, 0x0000a002);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0xbf800000); /* { -1.00, 1.00, 0.00, 0.00 } */
PUSH_DATAs(push, 0x3f800000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x17000e86); /* texr r3.xyz, r1, t[0] */
PUSH_DATAs(push, 0x1c9dc804);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x02000a04); /* mulr r2.xz, r3.xxyy, imm.xxyy */
PUSH_DATAs(push, 0x1c9ca10c);
PUSH_DATAs(push, 0x0000a002);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0xbf800000); /* { -1.00, 1.00, 0.00, 0.00 } */
PUSH_DATAs(push, 0x3f800000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x03001e04); /* addr r2, r0.xyxy, r2 */
PUSH_DATAs(push, 0x1c9c8800);
PUSH_DATAs(push, 0x0001c808);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x17020402); /* texr r1.y, r2.zwzz, -t[1] */
PUSH_DATAs(push, 0x1c9d5c08);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x04400282); /* madh r1.x, -r1.z, r1.y, r1.y */
PUSH_DATAs(push, 0x1c9f5504);
PUSH_DATAs(push, 0x0000aa04);
PUSH_DATAs(push, 0x0000aa04);
PUSH_DATAs(push, 0x17020400); /* texr r0.y, r2.xwxw, -t[1] */
PUSH_DATAs(push, 0x1c9d9808);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x04401080); /* madh r0.w, -r1.z, r0.y, r0.y */
PUSH_DATAs(push, 0x1c9f5504);
PUSH_DATAs(push, 0x0000aa00);
PUSH_DATAs(push, 0x0000aa00);
PUSH_DATAs(push, 0x17020200); /* texr r0.x, r2.zyxy, t[1] */
PUSH_DATAs(push, 0x1c9c8c08);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x04400282); /* madh r1.x, r1.z, r0, r1 */
PUSH_DATAs(push, 0x1c9d5504);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c904);
PUSH_DATAs(push, 0x17020200); /* texr r0.x (NE0.z), r2, t[1] */
PUSH_DATAs(push, 0x1555c808);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x04400280); /* madh r0.x, r1.z, r0, r0.w */
PUSH_DATAs(push, 0x1c9d5504);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x0001ff00);
PUSH_DATAs(push, 0x04401080); /* madh r0.w, -r3.z, r1.x, r1.x */
PUSH_DATAs(push, 0x1c9f550c);
PUSH_DATAs(push, 0x00000104);
PUSH_DATAs(push, 0x00000104);
PUSH_DATAs(push, 0x1704ac80); /* texr r0.yz, a[tex1], t[2] */
PUSH_DATAs(push, 0x1c9dc801);
PUSH_DATAs(push, 0x0001c800);
PUSH_DATAs(push, 0x3fe1c800);
PUSH_DATAs(push, 0x04400280); /* madh r0.x, r3.z, r0, r0.w */
PUSH_DATAs(push, 0x1c9d550c);
PUSH_DATAs(push, 0x0001c900);
PUSH_DATAs(push, 0x0001ff00);
PUSH_DATAs(push, 0x04400e82); /* madh r1.xyz, r0.x, imm.x, imm.yzww */
PUSH_DATAs(push, 0x1c9c0100);
PUSH_DATAs(push, 0x00000002);
PUSH_DATAs(push, 0x0001f202);
PUSH_DATAs(push, 0x3f9507c8); /* { 1.16, -0.87, 0.53, -1.08 } */
PUSH_DATAs(push, 0xbf5ee393);
PUSH_DATAs(push, 0x3f078fef);
PUSH_DATAs(push, 0xbf8a6762);
PUSH_DATAs(push, 0x04400e82); /* madh r1.xyz, r0.y, imm, r1 */
PUSH_DATAs(push, 0x1c9cab00);
PUSH_DATAs(push, 0x0001c802);
PUSH_DATAs(push, 0x0001c904);
PUSH_DATAs(push, 0x00000000); /* { 0.00, -0.39, 2.02, 0.00 } */
PUSH_DATAs(push, 0xbec890d6);
PUSH_DATAs(push, 0x40011687);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x04400e81); /* madh r0.xyz, r0.z, imm, r1 */
PUSH_DATAs(push, 0x1c9d5500);
PUSH_DATAs(push, 0x0001c802);
PUSH_DATAs(push, 0x0001c904);
PUSH_DATAs(push, 0x3fcc432d); /* { 1.60, -0.81, 0.00, 0.00 } */
PUSH_DATAs(push, 0xbf501a37);
PUSH_DATAs(push, 0x00000000);
PUSH_DATAs(push, 0x00000000);
return TRUE;
}
xf86-video-nouveau-1.0.16/src/nvc0_accel.h 0000644 0001750 0001756 00000013402 13423754626 015056 0000000 0000000 #ifndef __NVC0_ACCEL_H__
#define __NVC0_ACCEL_H__
#include "hwdefs/nv_object.xml.h"
#include "hwdefs/nv50_2d.xml.h"
#include "hwdefs/nvc0_3d.xml.h"
#include "hwdefs/nvc0_m2mf.xml.h"
#include "hwdefs/nv50_defs.xml.h"
#include "hwdefs/nv50_texture.h"
#include "hwdefs/gm107_texture.xml.h"
#include "hwdefs/nv_3ddefs.xml.h"
/* subchannel assignments, compatible with kepler's fixed layout */
#define SUBC_3D(mthd) 0, (mthd)
#define NVC0_3D(mthd) SUBC_3D(NVC0_3D_##mthd)
#define NVE4_3D(mthd) SUBC_3D(NVE4_3D_##mthd)
#define SUBC_M2MF(mthd) 2, (mthd)
#define SUBC_P2MF(mthd) 2, (mthd)
#define NVC0_M2MF(mthd) SUBC_M2MF(NVC0_M2MF_##mthd)
#define SUBC_2D(mthd) 3, (mthd)
#define NV50_2D(mthd) SUBC_2D(NV50_2D_##mthd)
#define NVC0_2D(mthd) SUBC_2D(NVC0_2D_##mthd)
#define SUBC_COPY(mthd) 4, (mthd)
#define SUBC_NVSW(mthd) 5, (mthd)
/* scratch buffer offsets */
#define CODE_OFFSET 0x00000 /* Code */
#define PVP_DATA 0x01000 /* VP constants */
#define PFP_DATA 0x01100 /* FP constants */
#define TB_OFFSET 0x01800 /* Texture bindings (kepler) */
#define TIC_OFFSET 0x02000 /* Texture Image Control */
#define TSC_OFFSET 0x03000 /* Texture Sampler Control */
#define SOLID(i) (0x04000 + (i) * 0x100)
#define NTFY_OFFSET 0x08000
#define SEMA_OFFSET 0x08100
#define MISC_OFFSET 0x10000
/* vertex/fragment programs */
#define SPO ((pNv->Architecture < NV_KEPLER) ? 0x0000 : 0x0030)
#define PVP_PASS (0x0000 + SPO) /* vertex pass-through shader */
#define PFP_S (0x0200 + SPO) /* (src) */
#define PFP_C (0x0400 + SPO) /* (src IN mask) */
#define PFP_CCA (0x0600 + SPO) /* (src IN mask) component-alpha */
#define PFP_CCASA (0x0800 + SPO) /* (src IN mask) component-alpha src-alpha */
#define PFP_S_A8 (0x0a00 + SPO) /* (src) a8 rt */
#define PFP_C_A8 (0x0c00 + SPO) /* (src IN mask) a8 rt - same for CCA/CCASA */
#define PFP_NV12 (0x0e00 + SPO) /* NV12 YUV->RGB */
#define VTX_ATTR(a, c, t, s) \
((NVC0_3D_VTX_ATTR_DEFINE_TYPE_##t) | \
((a) << NVC0_3D_VTX_ATTR_DEFINE_ATTR__SHIFT) | \
((c) << NVC0_3D_VTX_ATTR_DEFINE_COMP__SHIFT) | \
((s) << NVC0_3D_VTX_ATTR_DEFINE_SIZE__SHIFT))
static __inline__ void
PUSH_VTX1s(struct nouveau_pushbuf *push, float sx, float sy, int dx, int dy)
{
BEGIN_NVC0(push, NVC0_3D(VTX_ATTR_DEFINE), 3);
PUSH_DATA (push, VTX_ATTR(1, 2, FLOAT, 4));
PUSH_DATAf(push, sx);
PUSH_DATAf(push, sy);
BEGIN_NVC0(push, NVC0_3D(VTX_ATTR_DEFINE), 3);
PUSH_DATA (push, VTX_ATTR(0, 2, SSCALED, 4));
PUSH_DATA (push, dx);
PUSH_DATA (push, dy);
}
static __inline__ void
PUSH_VTX2s(struct nouveau_pushbuf *push,
int x0, int y0, int x1, int y1, int dx, int dy)
{
BEGIN_NVC0(push, NVC0_3D(VTX_ATTR_DEFINE), 3);
PUSH_DATA (push, VTX_ATTR(1, 2, SSCALED, 4));
PUSH_DATA (push, x0);
PUSH_DATA (push, y0);
BEGIN_NVC0(push, NVC0_3D(VTX_ATTR_DEFINE), 3);
PUSH_DATA (push, VTX_ATTR(2, 2, SSCALED, 4));
PUSH_DATA (push, x1);
PUSH_DATA (push, y1);
BEGIN_NVC0(push, NVC0_3D(VTX_ATTR_DEFINE), 3);
PUSH_DATA (push, VTX_ATTR(0, 2, SSCALED, 4));
PUSH_DATA (push, dx);
PUSH_DATA (push, dy);
}
static __inline__ void
PUSH_DATAu(struct nouveau_pushbuf *push, struct nouveau_bo *bo,
unsigned delta, unsigned dwords)
{
if (push->client->device->chipset < 0xe0) {
BEGIN_NVC0(push, NVC0_M2MF(OFFSET_OUT_HIGH), 2);
PUSH_DATA (push, (bo->offset + delta) >> 32);
PUSH_DATA (push, (bo->offset + delta));
BEGIN_NVC0(push, NVC0_M2MF(LINE_LENGTH_IN), 2);
PUSH_DATA (push, dwords * 4);
PUSH_DATA (push, 1);
BEGIN_NVC0(push, NVC0_M2MF(EXEC), 1);
PUSH_DATA (push, 0x100111);
BEGIN_NIC0(push, NVC0_M2MF(DATA), dwords);
} else {
BEGIN_NVC0(push, SUBC_P2MF(0x0180), 4);
PUSH_DATA (push, dwords * 4);
PUSH_DATA (push, 1);
PUSH_DATA (push, (bo->offset + delta) >> 32);
PUSH_DATA (push, (bo->offset + delta));
BEGIN_1IC0(push, SUBC_P2MF(0x01b0), 1 + dwords);
PUSH_DATA (push, 0x001001);
}
}
static __inline__ void
PUSH_TIC(struct nouveau_pushbuf *push, struct nouveau_bo *bo, unsigned offset,
unsigned width, unsigned height, unsigned pitch, unsigned format)
{
if (push->client->device->chipset < 0x110) {
unsigned tic2 = 0xd0001000;
if (pitch == 0)
tic2 |= 0x00004000;
else
tic2 |= 0x0005c000;
PUSH_DATA(push, format);
PUSH_DATA(push, bo->offset + offset);
PUSH_DATA(push, ((bo->offset + offset) >> 32) |
(bo->config.nvc0.tile_mode << 18) |
tic2);
PUSH_DATA(push, 0x00300000);
PUSH_DATA(push, 0x80000000 | width);
PUSH_DATA(push, 0x00010000 | height);
PUSH_DATA(push, 0x03000000);
PUSH_DATA(push, 0x00000000);
} else {
unsigned tile_mode = bo->config.nvc0.tile_mode;
PUSH_DATA(push, (format & 0x3f) | ((format & ~0x3f) << 1));
PUSH_DATA(push, bo->offset + offset);
if (pitch == 0) {
PUSH_DATA(push, ((bo->offset + offset) >> 32) |
GM107_TIC2_2_HEADER_VERSION_BLOCKLINEAR);
PUSH_DATA(push, GM107_TIC2_3_LOD_ANISO_QUALITY_2 |
((tile_mode & 0x007)) |
((tile_mode & 0x070) >> (4 - 3)) |
((tile_mode & 0x700) >> (8 - 6)));
PUSH_DATA(push, GM107_TIC2_4_SECTOR_PROMOTION_PROMOTE_TO_2_V |
GM107_TIC2_4_BORDER_SIZE_SAMPLER_COLOR |
GM107_TIC2_4_TEXTURE_TYPE_TWO_D |
(width - 1));
PUSH_DATA(push, GM107_TIC2_5_NORMALIZED_COORDS |
((height - 1) & 0xffff));
PUSH_DATA(push, GM107_TIC2_6_ANISO_FINE_SPREAD_FUNC_TWO |
GM107_TIC2_6_ANISO_COARSE_SPREAD_FUNC_ONE);
PUSH_DATA(push, 0x00000000);
} else {
PUSH_DATA(push, ((bo->offset + offset) >> 32) |
GM107_TIC2_2_HEADER_VERSION_PITCH);
PUSH_DATA(push, GM107_TIC2_3_LOD_ANISO_QUALITY_2 |
(pitch >> 5));
PUSH_DATA(push, GM107_TIC2_4_BORDER_SIZE_SAMPLER_COLOR |
GM107_TIC2_4_TEXTURE_TYPE_TWO_D_NO_MIPMAP |
(width - 1));
PUSH_DATA(push, GM107_TIC2_5_NORMALIZED_COORDS | (height - 1));
PUSH_DATA(push, 0x000000000);
PUSH_DATA(push, 0x000000000);
}
}
}
#endif
xf86-video-nouveau-1.0.16/src/nv_driver.c 0000644 0001750 0001756 00000116334 13423754626 015062 0000000 0000000 /*
* Copyright 1996-1997 David J. McKay
*
* 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.
*/
#include
#include
#include "nv_include.h"
#include "xorg-server.h"
#include "xf86drm.h"
#include "xf86drmMode.h"
#include "nouveau_drm.h"
#ifdef DRI2
#include "dri2.h"
#endif
#include "nouveau_copy.h"
#include "nouveau_present.h"
#include "nouveau_sync.h"
#if !HAVE_XORG_LIST
#define xorg_list_is_empty list_is_empty
#define xorg_list_for_each_entry list_for_each_entry
#endif
/*
* Forward definitions for the functions that make up the driver.
*/
/* Mandatory functions */
static const OptionInfoRec * NVAvailableOptions(int chipid, int busid);
static void NVIdentify(int flags);
static Bool NVPreInit(ScrnInfoPtr pScrn, int flags);
static Bool NVScreenInit(SCREEN_INIT_ARGS_DECL);
static Bool NVEnterVT(VT_FUNC_ARGS_DECL);
static void NVLeaveVT(VT_FUNC_ARGS_DECL);
static Bool NVCloseScreen(CLOSE_SCREEN_ARGS_DECL);
static Bool NVSaveScreen(ScreenPtr pScreen, int mode);
static void NVCloseDRM(ScrnInfoPtr);
/* Optional functions */
static Bool NVDriverFunc(ScrnInfoPtr scrn, xorgDriverFuncOp op,
void *data);
static Bool NVSwitchMode(SWITCH_MODE_ARGS_DECL);
static void NVAdjustFrame(ADJUST_FRAME_ARGS_DECL);
static void NVFreeScreen(FREE_SCREEN_ARGS_DECL);
/* Internally used functions */
static Bool NVMapMem(ScrnInfoPtr pScrn);
static Bool NVUnmapMem(ScrnInfoPtr pScrn);
#define NOUVEAU_PCI_DEVICE(_vendor_id, _device_id) \
{ (_vendor_id), (_device_id), PCI_MATCH_ANY, PCI_MATCH_ANY, \
0x00030000, 0x00ff0000, 0 }
static const struct pci_id_match nouveau_device_match[] = {
NOUVEAU_PCI_DEVICE(0x12d2, PCI_MATCH_ANY),
NOUVEAU_PCI_DEVICE(0x10de, PCI_MATCH_ANY),
{ 0, 0, 0 },
};
static Bool NVPciProbe ( DriverPtr drv,
int entity_num,
struct pci_device *dev,
intptr_t match_data );
#ifdef XSERVER_PLATFORM_BUS
static Bool NVPlatformProbe(DriverPtr driver,
int entity_num, int flags,
struct xf86_platform_device *dev,
intptr_t dev_match_data);
#endif
_X_EXPORT int NVEntityIndex = -1;
static int getNVEntityIndex(void)
{
return NVEntityIndex;
}
/*
* This contains the functions needed by the server after loading the
* driver module. It must be supplied, and gets added the driver list by
* the Module Setup funtion in the dynamic case. In the static case a
* reference to this is compiled in, and this requires that the name of
* this DriverRec be an upper-case version of the driver name.
*/
_X_EXPORT DriverRec NV = {
NV_VERSION,
NV_DRIVER_NAME,
NVIdentify,
NULL,
NVAvailableOptions,
NULL,
0,
NVDriverFunc,
nouveau_device_match,
NVPciProbe,
#ifdef XSERVER_PLATFORM_BUS
NVPlatformProbe,
#endif
};
struct NvFamily
{
char *name;
char *chipset;
};
static struct NvFamily NVKnownFamilies[] =
{
{ "RIVA TNT", "NV04" },
{ "RIVA TNT2", "NV05" },
{ "GeForce 256", "NV10" },
{ "GeForce 2", "NV11, NV15" },
{ "GeForce 4MX", "NV17, NV18" },
{ "GeForce 3", "NV20" },
{ "GeForce 4Ti", "NV25, NV28" },
{ "GeForce FX", "NV3x" },
{ "GeForce 6", "NV4x" },
{ "GeForce 7", "G7x" },
{ "GeForce 8", "G8x" },
{ "GeForce 9", "G9x" },
{ "GeForce GTX 2xx/3xx", "GT2xx" },
{ "GeForce GTX 4xx/5xx", "GFxxx" },
{ "GeForce GTX 6xx/7xx", "GKxxx" },
{ "GeForce GTX 9xx", "GMxxx" },
{ "GeForce GTX 10xx", "GPxxx" },
{ NULL, NULL}
};
static MODULESETUPPROTO(nouveauSetup);
static XF86ModuleVersionInfo nouveauVersRec =
{
"nouveau",
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
ABI_CLASS_VIDEODRV, /* This is a video driver */
ABI_VIDEODRV_VERSION,
MOD_CLASS_VIDEODRV,
{0,0,0,0}
};
_X_EXPORT XF86ModuleData nouveauModuleData = { &nouveauVersRec, nouveauSetup, NULL };
static pointer
nouveauSetup(pointer module, pointer opts, int *errmaj, int *errmin)
{
static Bool setupDone = FALSE;
/* This module should be loaded only once, but check to be sure. */
if (!setupDone) {
setupDone = TRUE;
/* The 1 here is needed to turn off a backwards compatibility mode */
/* Otherwise NVPciProbe() is not called */
xf86AddDriver(&NV, module, 1);
/*
* The return value must be non-NULL on success even though there
* is no TearDownProc.
*/
return (pointer)1;
} else {
if (errmaj) *errmaj = LDR_ONCEONLY;
return NULL;
}
}
static const OptionInfoRec *
NVAvailableOptions(int chipid, int busid)
{
return NVOptions;
}
/* Mandatory */
static void
NVIdentify(int flags)
{
struct NvFamily *family;
size_t maxLen=0;
xf86DrvMsg(0, X_INFO, NV_NAME " driver " NV_DRIVER_DATE "\n");
xf86DrvMsg(0, X_INFO, NV_NAME " driver for NVIDIA chipset families :\n");
/* maximum length for alignment */
family = NVKnownFamilies;
while(family->name && family->chipset)
{
maxLen = max(maxLen, strlen(family->name));
family++;
}
/* display */
family = NVKnownFamilies;
while(family->name && family->chipset)
{
size_t len = strlen(family->name);
xf86ErrorF("\t%s", family->name);
while(lenchipset);
family++;
}
}
static Bool
NVDriverFunc(ScrnInfoPtr scrn, xorgDriverFuncOp op, void *data)
{
xorgHWFlags *flag;
switch (op) {
case GET_REQUIRED_HW_INTERFACES:
flag = (CARD32 *)data;
(*flag) = 0;
return TRUE;
#if XORG_VERSION_CURRENT > XORG_VERSION_NUMERIC(1,15,99,0,0)
case SUPPORTS_SERVER_FDS:
return TRUE;
#endif
default:
return FALSE;
}
}
static void
NVInitScrn(ScrnInfoPtr pScrn, struct xf86_platform_device *platform_dev,
int entity_num)
{
DevUnion *pPriv;
NVEntPtr pNVEnt;
pScrn->driverVersion = NV_VERSION;
pScrn->driverName = NV_DRIVER_NAME;
pScrn->name = NV_NAME;
pScrn->Probe = NULL;
pScrn->PreInit = NVPreInit;
pScrn->ScreenInit = NVScreenInit;
pScrn->SwitchMode = NVSwitchMode;
pScrn->AdjustFrame = NVAdjustFrame;
pScrn->EnterVT = NVEnterVT;
pScrn->LeaveVT = NVLeaveVT;
pScrn->FreeScreen = NVFreeScreen;
xf86SetEntitySharable(entity_num);
if (NVEntityIndex == -1)
NVEntityIndex = xf86AllocateEntityPrivateIndex();
pPriv = xf86GetEntityPrivate(entity_num,
NVEntityIndex);
if (!pPriv->ptr) {
pPriv->ptr = xnfcalloc(sizeof(NVEntRec), 1);
pNVEnt = pPriv->ptr;
pNVEnt->platform_dev = platform_dev;
}
else
pNVEnt = pPriv->ptr;
/* Reset settings which must not persist across server regeneration */
if (pNVEnt->reinitGeneration != serverGeneration) {
pNVEnt->reinitGeneration = serverGeneration;
/* Clear mask of assigned crtc's in this generation to "none" */
pNVEnt->assigned_crtcs = 0;
}
xf86SetEntityInstanceForScreen(pScrn, entity_num,
xf86GetNumEntityInstances(entity_num) - 1);
}
static struct nouveau_device *
NVOpenNouveauDevice(struct pci_device *pci_dev,
struct xf86_platform_device *platform_dev, int scrnIndex, Bool probe)
{
struct nouveau_device *dev = NULL;
char *busid;
int ret, fd = -1;
#ifdef ODEV_ATTRIB_PATH
if (platform_dev)
busid = NULL;
else
#endif
{
#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,9,99,901,0)
XNFasprintf(&busid, "pci:%04x:%02x:%02x.%d",
pci_dev->domain, pci_dev->bus,
pci_dev->dev, pci_dev->func);
#else
busid = XNFprintf("pci:%04x:%02x:%02x.%d",
pci_dev->domain, pci_dev->bus,
pci_dev->dev, pci_dev->func);
#endif
}
#if defined(ODEV_ATTRIB_FD)
if (platform_dev)
fd = xf86_get_platform_device_int_attrib(platform_dev,
ODEV_ATTRIB_FD, -1);
#endif
if (fd != -1)
ret = nouveau_device_wrap(fd, 0, &dev);
#ifdef ODEV_ATTRIB_PATH
else if (platform_dev) {
const char *path;
path = xf86_get_platform_device_attrib(platform_dev,
ODEV_ATTRIB_PATH);
fd = open(path, O_RDWR | O_CLOEXEC);
ret = nouveau_device_wrap(fd, 1, &dev);
if (ret)
close(fd);
}
#endif
else
ret = nouveau_device_open(busid, &dev);
if (ret)
xf86DrvMsg(scrnIndex, X_ERROR,
"[drm] Failed to open DRM device for %s: %d\n",
busid, ret);
free(busid);
return dev;
}
static Bool
NVHasKMS(struct pci_device *pci_dev, struct xf86_platform_device *platform_dev)
{
struct nouveau_device *dev = NULL;
drmVersion *version;
int chipset;
dev = NVOpenNouveauDevice(pci_dev, platform_dev, -1, TRUE);
if (!dev)
return FALSE;
/* Check the version reported by the kernel module. In theory we
* shouldn't have to do this, as libdrm_nouveau will do its own checks.
* But, we're currently using the kernel patchlevel to also version
* the DRI interface.
*/
version = drmGetVersion(dev->fd);
xf86DrvMsg(-1, X_INFO, "[drm] nouveau interface version: %d.%d.%d\n",
version->version_major, version->version_minor,
version->version_patchlevel);
drmFree(version);
chipset = dev->chipset;
nouveau_device_del(&dev);
switch (chipset & ~0xf) {
case 0x00:
case 0x10:
case 0x20:
case 0x30:
case 0x40:
case 0x60:
case 0x50:
case 0x80:
case 0x90:
case 0xa0:
case 0xc0:
case 0xd0:
case 0xe0:
case 0xf0:
case 0x100:
case 0x110:
case 0x120:
case 0x130:
break;
default:
xf86DrvMsg(-1, X_ERROR, "Unknown chipset: NV%02X\n", chipset);
return FALSE;
}
return TRUE;
}
static Bool
NVPciProbe(DriverPtr drv, int entity_num, struct pci_device *pci_dev,
intptr_t match_data)
{
PciChipsets NVChipsets[] = {
{ pci_dev->device_id,
(pci_dev->vendor_id << 16) | pci_dev->device_id, NULL },
{ -1, -1, NULL }
};
ScrnInfoPtr pScrn = NULL;
if (!NVHasKMS(pci_dev, NULL))
return FALSE;
pScrn = xf86ConfigPciEntity(pScrn, 0, entity_num, NVChipsets,
NULL, NULL, NULL, NULL, NULL);
if (!pScrn)
return FALSE;
NVInitScrn(pScrn, NULL, entity_num);
return TRUE;
}
#ifdef XSERVER_PLATFORM_BUS
static Bool
NVPlatformProbe(DriverPtr driver,
int entity_num, int flags, struct xf86_platform_device *dev, intptr_t dev_match_data)
{
ScrnInfoPtr scrn = NULL;
uint32_t scr_flags = 0;
if (!NVHasKMS(dev->pdev, dev))
return FALSE;
if (flags & PLATFORM_PROBE_GPU_SCREEN)
scr_flags = XF86_ALLOCATE_GPU_SCREEN;
scrn = xf86AllocateScreen(driver, scr_flags);
if (!scrn)
return FALSE;
if (xf86IsEntitySharable(entity_num))
xf86SetEntityShared(entity_num);
xf86AddEntityToScreen(scrn, entity_num);
NVInitScrn(scrn, dev, entity_num);
return TRUE;
}
#endif
#define MAX_CHIPS MAXSCREENS
Bool
NVSwitchMode(SWITCH_MODE_ARGS_DECL)
{
SCRN_INFO_PTR(arg);
return xf86SetSingleMode(pScrn, mode, RR_Rotate_0);
}
/*
* This function is used to initialize the Start Address - the first
* displayed location in the video memory.
*/
/* Usually mandatory */
void
NVAdjustFrame(ADJUST_FRAME_ARGS_DECL)
{
SCRN_INFO_PTR(arg);
drmmode_adjust_frame(pScrn, x, y);
}
/*
* This is called when VT switching back to the X server. Its job is
* to reinitialise the video mode.
*/
/* Mandatory */
static Bool
NVEnterVT(VT_FUNC_ARGS_DECL)
{
SCRN_INFO_PTR(arg);
NVPtr pNv = NVPTR(pScrn);
#ifdef XF86_PDEV_SERVER_FD
NVEntPtr pNVEnt = NVEntPriv(pScrn);
#endif
int ret;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "NVEnterVT is called.\n");
#ifdef XF86_PDEV_SERVER_FD
if (!(pNVEnt->platform_dev &&
(pNVEnt->platform_dev->flags & XF86_PDEV_SERVER_FD)))
#endif
{
ret = drmSetMaster(pNv->dev->fd);
if (ret)
ErrorF("Unable to get master: %s\n", strerror(errno));
}
if (XF86_CRTC_CONFIG_PTR(pScrn)->num_crtc && !xf86SetDesiredModes(pScrn))
return FALSE;
if (pNv->overlayAdaptor && pNv->Architecture != NV_ARCH_04)
NV10WriteOverlayParameters(pScrn);
return TRUE;
}
/*
* This is called when VT switching away from the X server. Its job is
* to restore the previous (text) mode.
*/
/* Mandatory */
static void
NVLeaveVT(VT_FUNC_ARGS_DECL)
{
SCRN_INFO_PTR(arg);
NVPtr pNv = NVPTR(pScrn);
#ifdef XF86_PDEV_SERVER_FD
NVEntPtr pNVEnt = NVEntPriv(pScrn);
#endif
int ret;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "NVLeaveVT is called.\n");
#ifdef XF86_PDEV_SERVER_FD
if (pNVEnt->platform_dev &&
(pNVEnt->platform_dev->flags & XF86_PDEV_SERVER_FD))
return;
#endif
ret = drmDropMaster(pNv->dev->fd);
if (ret && errno != EIO && errno != ENODEV)
ErrorF("Error dropping master: %i(%m)\n", -errno);
}
static void
NVFlushCallback(CallbackListPtr *list, pointer user_data, pointer call_data)
{
ScrnInfoPtr pScrn = user_data;
NVPtr pNv = NVPTR(pScrn);
if (pScrn->vtSema && pNv->Flush)
pNv->Flush(pScrn);
}
#ifdef NOUVEAU_PIXMAP_SHARING
static void
redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
{
RegionRec pixregion;
PixmapRegionInit(&pixregion, dirty->slave_dst);
DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
#ifdef HAS_DIRTYTRACKING_ROTATION
PixmapSyncDirtyHelper(dirty);
#else
PixmapSyncDirtyHelper(dirty, &pixregion);
#endif
DamageRegionProcessPending(&dirty->slave_dst->drawable);
RegionUninit(&pixregion);
}
static void
nouveau_dirty_update(ScreenPtr screen)
{
RegionPtr region;
PixmapDirtyUpdatePtr ent;
if (xorg_list_is_empty(&screen->pixmap_dirty_list))
return;
xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) {
region = DamageRegion(ent->damage);
if (RegionNotEmpty(region)) {
redisplay_dirty(screen, ent);
DamageEmpty(ent->damage);
}
}
}
#endif
static void
NVBlockHandler (BLOCKHANDLER_ARGS_DECL)
{
SCREEN_PTR(arg);
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
pScreen->BlockHandler = pNv->BlockHandler;
(*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
pScreen->BlockHandler = NVBlockHandler;
#ifdef NOUVEAU_PIXMAP_SHARING
nouveau_dirty_update(pScreen);
#endif
NVFlushCallback(NULL, pScrn, NULL);
if (pNv->VideoTimerCallback)
(*pNv->VideoTimerCallback)(pScrn, currentTime.milliseconds);
}
static Bool
NVCreateScreenResources(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
pScreen->CreateScreenResources = pNv->CreateScreenResources;
if (!(*pScreen->CreateScreenResources)(pScreen))
return FALSE;
pScreen->CreateScreenResources = NVCreateScreenResources;
drmmode_fbcon_copy(pScreen);
if (!NVEnterVT(VT_FUNC_ARGS(0)))
return FALSE;
if (pNv->AccelMethod == EXA) {
PixmapPtr ppix = pScreen->GetScreenPixmap(pScreen);
nouveau_bo_ref(pNv->scanout, &nouveau_pixmap(ppix)->bo);
}
return TRUE;
}
/*
* This is called at the end of each server generation. It restores the
* original (text) mode. It should also unmap the video memory, and free
* any per-generation data allocated by the driver. It should finish
* by unwrapping and calling the saved CloseScreen function.
*/
/* Mandatory */
static Bool
NVCloseScreen(CLOSE_SCREEN_ARGS_DECL)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
if (XF86_CRTC_CONFIG_PTR(pScrn)->num_crtc)
drmmode_screen_fini(pScreen);
nouveau_present_fini(pScreen);
nouveau_dri2_fini(pScreen);
nouveau_sync_fini(pScreen);
nouveau_copy_fini(pScreen);
if (pScrn->vtSema) {
NVLeaveVT(VT_FUNC_ARGS(0));
pScrn->vtSema = FALSE;
}
NVTakedownVideo(pScrn);
NVAccelCommonFini(pScrn);
NVUnmapMem(pScrn);
xf86_cursors_fini(pScreen);
DeleteCallback(&FlushCallback, NVFlushCallback, pScrn);
if (pNv->ShadowPtr) {
free(pNv->ShadowPtr);
pNv->ShadowPtr = NULL;
}
if (pNv->overlayAdaptor) {
free(pNv->overlayAdaptor);
pNv->overlayAdaptor = NULL;
}
if (pNv->blitAdaptor) {
free(pNv->blitAdaptor);
pNv->blitAdaptor = NULL;
}
if (pNv->textureAdaptor[0]) {
free(pNv->textureAdaptor[0]);
pNv->textureAdaptor[0] = NULL;
}
if (pNv->textureAdaptor[1]) {
free(pNv->textureAdaptor[1]);
pNv->textureAdaptor[1] = NULL;
}
if (pNv->EXADriverPtr) {
exaDriverFini(pScreen);
free(pNv->EXADriverPtr);
pNv->EXADriverPtr = NULL;
}
pScrn->vtSema = FALSE;
pScreen->CloseScreen = pNv->CloseScreen;
pScreen->BlockHandler = pNv->BlockHandler;
return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
}
/* Free up any persistent data structures */
/* Optional */
static void
NVFreeScreen(FREE_SCREEN_ARGS_DECL)
{
/*
* This only gets called when a screen is being deleted. It does not
* get called routinely at the end of a server generation.
*/
SCRN_INFO_PTR(arg);
NVPtr pNv = NVPTR(pScrn);
if (!pNv)
return;
NVCloseDRM(pScrn);
free(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
}
#define NVPreInitFail(fmt, args...) do { \
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%d: "fmt, __LINE__, ##args); \
NVFreeScreen(FREE_SCREEN_ARGS(pScrn)); \
return FALSE; \
} while(0)
static void
NVCloseDRM(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
drmFree(pNv->drm_device_name);
nouveau_client_del(&pNv->client);
nouveau_device_del(&pNv->dev);
free(pNv->render_node);
}
static void
nouveau_setup_capabilities(ScrnInfoPtr pScrn)
{
#ifdef NOUVEAU_PIXMAP_SHARING
NVPtr pNv = NVPTR(pScrn);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
uint64_t value;
int ret;
pScrn->capabilities = 0;
ret = drmGetCap(pNv->dev->fd, DRM_CAP_PRIME, &value);
if (ret == 0) {
if (value & DRM_PRIME_CAP_EXPORT)
pScrn->capabilities |= RR_Capability_SourceOutput;
if (value & DRM_PRIME_CAP_IMPORT) {
pScrn->capabilities |= RR_Capability_SourceOffload;
if (xf86_config->num_crtc)
pScrn->capabilities |= RR_Capability_SinkOutput;
}
}
#endif
}
NVEntPtr NVEntPriv(ScrnInfoPtr pScrn)
{
DevUnion *pPriv;
NVPtr pNv = NVPTR(pScrn);
pPriv = xf86GetEntityPrivate(pNv->pEnt->index,
getNVEntityIndex());
return pPriv->ptr;
}
static Bool NVOpenDRMMaster(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
NVEntPtr pNVEnt = NVEntPriv(pScrn);
drmSetVersion sv;
int err;
int ret;
if (pNVEnt->fd) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
" reusing fd for second head\n");
ret = nouveau_device_wrap(pNVEnt->fd, 0, &pNv->dev);
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[drm] error creating device\n");
return FALSE;
}
return TRUE;
}
pNv->dev = NVOpenNouveauDevice(pNv->PciInfo, pNVEnt->platform_dev,
pScrn->scrnIndex, FALSE);
if (!pNv->dev)
return FALSE;
sv.drm_di_major = 1;
sv.drm_di_minor = 1;
sv.drm_dd_major = -1;
sv.drm_dd_minor = -1;
err = drmSetInterfaceVersion(pNv->dev->fd, &sv);
if (err != 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[drm] failed to set drm interface version.\n");
nouveau_device_del(&pNv->dev);
return FALSE;
}
pNVEnt->fd = pNv->dev->fd;
return TRUE;
}
static Bool
NVPreInitDRM(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
int ret;
if (!xf86LoadSubModule(pScrn, "dri2"))
return FALSE;
/* Load the kernel module, and open the DRM */
ret = NVOpenDRMMaster(pScrn);
if (!ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[drm] error opening the drm\n");
return FALSE;
}
ret = nouveau_client_new(pNv->dev, &pNv->client);
if (ret)
return FALSE;
pNv->drm_device_name = drmGetDeviceNameFromFd(pNv->dev->fd);
return TRUE;
}
/* Mandatory */
Bool
NVPreInit(ScrnInfoPtr pScrn, int flags)
{
struct nouveau_device *dev;
NVPtr pNv;
MessageType from;
const char *reason, *string;
uint64_t v;
int ret;
int defaultDepth = 0;
if (flags & PROBE_DETECT) {
EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if (!pEnt)
return FALSE;
free(pEnt);
return TRUE;
}
/*
* Note: This function is only called once at server startup, and
* not at the start of each server generation. This means that
* only things that are persistent across server generations can
* be initialised here. xf86Screens[] is (pScrn is a pointer to one
* of these). Privates allocated using xf86AllocateScrnInfoPrivateIndex()
* are too, and should be used for data that must persist across
* server generations.
*
* Per-generation data should be allocated with
* AllocateScreenPrivateIndex() from the ScreenInit() function.
*/
/* Check the number of entities, and fail if it isn't one. */
if (pScrn->numEntities != 1)
return FALSE;
/* Allocate the NVRec driverPrivate */
if (!(pScrn->driverPrivate = xnfcalloc(1, sizeof(NVRec))))
return FALSE;
pNv = NVPTR(pScrn);
/* Get the entity, and make sure it is PCI. */
pNv->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if (pNv->pEnt->location.type != BUS_PCI
#ifdef XSERVER_PLATFORM_BUS
&& pNv->pEnt->location.type != BUS_PLATFORM
#endif
)
return FALSE;
if (xf86IsEntityShared(pScrn->entityList[0])) {
if(!xf86IsPrimInitDone(pScrn->entityList[0])) {
pNv->Primary = TRUE;
xf86SetPrimInitDone(pScrn->entityList[0]);
} else {
pNv->Secondary = TRUE;
}
}
/* Find the PCI info for this screen */
pNv->PciInfo = xf86GetPciInfoForEntity(pNv->pEnt->index);
/* Initialise the kernel module */
if (!NVPreInitDRM(pScrn))
NVPreInitFail("\n");
dev = pNv->dev;
pScrn->chipset = malloc(sizeof(char) * 25);
sprintf((char *)pScrn->chipset, "NVIDIA NV%02X", dev->chipset);
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Chipset: \"%s\"\n", pScrn->chipset);
switch (dev->chipset & ~0xf) {
case 0x00:
pNv->Architecture = NV_ARCH_04;
break;
case 0x10:
pNv->Architecture = NV_ARCH_10;
break;
case 0x20:
pNv->Architecture = NV_ARCH_20;
break;
case 0x30:
pNv->Architecture = NV_ARCH_30;
break;
case 0x40:
case 0x60:
pNv->Architecture = NV_ARCH_40;
break;
case 0x50:
case 0x80:
case 0x90:
case 0xa0:
pNv->Architecture = NV_TESLA;
break;
case 0xc0:
case 0xd0:
pNv->Architecture = NV_FERMI;
break;
case 0xe0:
case 0xf0:
case 0x100:
pNv->Architecture = NV_KEPLER;
break;
case 0x110:
case 0x120:
pNv->Architecture = NV_MAXWELL;
break;
case 0x130:
pNv->Architecture = NV_PASCAL;
break;
default:
return FALSE;
}
/* Set pScrn->monitor */
pScrn->monitor = pScrn->confScreen->monitor;
/*
* The first thing we should figure out is the depth, bpp, etc.
*/
if (dev->vram_size <= 16 * 1024 * 1024)
defaultDepth = 16;
if (!xf86SetDepthBpp(pScrn, defaultDepth, 0, 0, Support32bppFb)) {
NVPreInitFail("\n");
} else {
/* Check that the returned depth is one we support */
switch (pScrn->depth) {
case 16:
case 24:
/* OK */
break;
case 30:
/* OK on NV50 KMS */
if (pNv->Architecture < NV_TESLA)
NVPreInitFail("Depth 30 supported on G80+ only\n");
break;
case 15: /* 15 may get done one day, so leave any code for it in place */
default:
NVPreInitFail("Given depth (%d) is not supported by this driver\n",
pScrn->depth);
}
}
xf86PrintDepthBpp(pScrn);
/*
* This must happen after pScrn->display has been set because
* xf86SetWeight references it.
*/
rgb rgbzeros = {0, 0, 0};
if (pScrn->depth == 30) {
rgb rgbmask;
rgbmask.red = 0x000003ff;
rgbmask.green = 0x000ffc00;
rgbmask.blue = 0x3ff00000;
if (!xf86SetWeight(pScrn, rgbzeros, rgbmask))
NVPreInitFail("\n");
/* xf86SetWeight() seems to think ffs(1) == 0... */
pScrn->offset.red--;
pScrn->offset.green--;
pScrn->offset.blue--;
} else {
if (!xf86SetWeight(pScrn, rgbzeros, rgbzeros))
NVPreInitFail("\n");
}
if (!xf86SetDefaultVisual(pScrn, -1))
NVPreInitFail("\n");
/* We don't support DirectColor */
if (pScrn->defaultVisual != TrueColor) {
NVPreInitFail("Given default visual (%s) is not supported at depth %d\n",
xf86GetVisualName(pScrn->defaultVisual), pScrn->depth);
}
/* We use a programmable clock */
pScrn->progClock = TRUE;
/* Collect all of the relevant option flags (fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
/* Process the options */
if (!(pNv->Options = malloc(sizeof(NVOptions))))
return FALSE;
memcpy(pNv->Options, NVOptions, sizeof(NVOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pNv->Options);
from = X_DEFAULT;
pNv->HWCursor = TRUE;
/*
* The preferred method is to use the "hw cursor" option as a tri-state
* option, with the default set above.
*/
if (xf86GetOptValBool(pNv->Options, OPTION_HW_CURSOR, &pNv->HWCursor)) {
from = X_CONFIG;
}
/* For compatibility, accept this too (as an override) */
if (xf86ReturnOptValBool(pNv->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pNv->HWCursor = FALSE;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pNv->HWCursor ? "HW" : "SW");
string = xf86GetOptValString(pNv->Options, OPTION_ACCELMETHOD);
if (string) {
if (!strcmp(string, "none")) pNv->AccelMethod = NONE;
else if (!strcmp(string, "exa")) pNv->AccelMethod = EXA;
else {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Invalid AccelMethod specified\n");
}
}
if (pNv->AccelMethod == UNKNOWN) {
pNv->AccelMethod = EXA;
}
if (xf86ReturnOptValBool(pNv->Options, OPTION_NOACCEL, FALSE)) {
pNv->AccelMethod = NONE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
if (xf86ReturnOptValBool(pNv->Options, OPTION_SHADOW_FB, FALSE)) {
pNv->ShadowFB = TRUE;
pNv->AccelMethod = NONE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Using \"Shadow Framebuffer\" - acceleration disabled\n");
}
if (pNv->AccelMethod > NONE) {
if (pNv->Architecture >= NV_TESLA)
pNv->wfb_enabled = xf86ReturnOptValBool(
pNv->Options, OPTION_WFB, FALSE);
pNv->tiled_scanout = TRUE;
}
pNv->ce_enabled =
xf86ReturnOptValBool(pNv->Options, OPTION_ASYNC_COPY, FALSE);
/* Define maximum allowed level of DRI implementation to use.
* We default to DRI2 on EXA for now, as DRI3 still has some
* problems.
*/
pNv->max_dri_level = 2;
from = X_DEFAULT;
if (xf86GetOptValInteger(pNv->Options, OPTION_DRI,
&pNv->max_dri_level)) {
from = X_CONFIG;
if (pNv->max_dri_level < 2)
pNv->max_dri_level = 2;
if (pNv->max_dri_level > 3)
pNv->max_dri_level = 3;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Allowed maximum DRI level %i.\n",
pNv->max_dri_level);
if (pNv->AccelMethod > NONE && pNv->dev->chipset >= 0x11) {
from = X_DEFAULT;
pNv->glx_vblank = TRUE;
if (xf86GetOptValBool(pNv->Options, OPTION_GLX_VBLANK,
&pNv->glx_vblank))
from = X_CONFIG;
xf86DrvMsg(pScrn->scrnIndex, from, "GLX sync to VBlank %s.\n",
pNv->glx_vblank ? "enabled" : "disabled");
}
#ifdef NOUVEAU_GETPARAM_HAS_PAGEFLIP
reason = ": no kernel support";
from = X_DEFAULT;
ret = nouveau_getparam(pNv->dev, NOUVEAU_GETPARAM_HAS_PAGEFLIP, &v);
if (ret == 0 && v == 1) {
pNv->has_pageflip = TRUE;
if (xf86GetOptValBool(pNv->Options, OPTION_PAGE_FLIP, &pNv->has_pageflip))
from = X_CONFIG;
reason = "";
}
#else
reason = ": not available at build time";
#endif
xf86DrvMsg(pScrn->scrnIndex, from, "Page flipping %sabled%s\n",
pNv->has_pageflip ? "en" : "dis", reason);
if(xf86GetOptValInteger(pNv->Options, OPTION_VIDEO_KEY, &(pNv->videoKey))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
pNv->videoKey);
} else {
pNv->videoKey = (1 << pScrn->offset.red) |
(1 << pScrn->offset.green) |
(((pScrn->mask.blue >> pScrn->offset.blue) - 1) << pScrn->offset.blue);
}
/* Limit to max 2 pending swaps - we can't handle more than triple-buffering: */
pNv->max_swap_limit = 2;
if(xf86GetOptValInteger(pNv->Options, OPTION_SWAP_LIMIT, &(pNv->swap_limit))) {
if (pNv->swap_limit < 1)
pNv->swap_limit = 1;
if (pNv->swap_limit > pNv->max_swap_limit)
pNv->swap_limit = pNv->max_swap_limit;
reason = "";
from = X_CONFIG;
if ((DRI2INFOREC_VERSION < 6) && (pNv->swap_limit > 1)) {
/* No swap limit api in server. A value > 1 requires use
* of problematic hacks.
*/
from = X_WARNING;
reason = ": Caution: Use of this swap limit > 1 violates OML_sync_control spec on this X-Server!\n";
}
} else {
/* Always default to double-buffering, because it avoids artifacts like
* unthrottled rendering of non-fullscreen clients under desktop composition.
*/
pNv->swap_limit = 1;
reason = "";
from = X_DEFAULT;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Swap limit set to %d [Max allowed %d]%s\n",
pNv->swap_limit, pNv->max_swap_limit, reason);
/* Does kernel do the sync of pageflips to vblank? */
pNv->has_async_pageflip = FALSE;
#ifdef DRM_CAP_ASYNC_PAGE_FLIP
ret = drmGetCap(pNv->dev->fd, DRM_CAP_ASYNC_PAGE_FLIP, &v);
if (ret == 0 && v == 1) {
pNv->has_async_pageflip = TRUE;
}
xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Page flipping synced to vblank by %s.\n",
pNv->has_async_pageflip ? "kernel" : "ddx");
#endif
ret = drmmode_pre_init(pScrn, pNv->dev->fd, pScrn->bitsPerPixel >> 3);
if (ret == FALSE)
NVPreInitFail("Kernel modesetting failed to initialize\n");
/*
* If the driver can do gamma correction, it should call xf86SetGamma()
* here.
*/
Gamma gammazeros = {0.0, 0.0, 0.0};
if (!xf86SetGamma(pScrn, gammazeros))
NVPreInitFail("\n");
#ifdef NOUVEAU_PIXMAP_SHARING
/*
* The driver will not work as gpu screen without acceleration enabled.
* To support this usecase modesetting ddx can be used instead.
*/
if (pNv->AccelMethod <= NONE || pNv->ShadowFB) {
/*
* Optimus mode requires acceleration enabled.
* So if no mode is found, or the screen is created
* as a gpu screen the pre init should fail.
*/
if (pScrn->is_gpu || !pScrn->modes)
return FALSE;
}
#else
/* No usable mode, no optimus config possible */
if (!pScrn->modes)
return FALSE;
#endif
nouveau_setup_capabilities(pScrn);
if (!pScrn->modes) {
pScrn->modes = xf86ModesAdd(pScrn->modes,
xf86CVTMode(pScrn->display->virtualX,
pScrn->display->virtualY,
60, 0, 0));
}
/* Set the current mode to the first in the list */
pScrn->currentMode = pScrn->modes;
/* Print the list of modes being used */
xf86PrintModes(pScrn);
/* Set display resolution */
xf86SetDpi(pScrn, 0, 0);
if (pNv->wfb_enabled) {
if (xf86LoadSubModule(pScrn, "wfb") == NULL)
NVPreInitFail("\n");
}
if (xf86LoadSubModule(pScrn, "fb") == NULL)
NVPreInitFail("\n");
/* Load shadowfb */
if (!xf86LoadSubModule(pScrn, "shadowfb"))
NVPreInitFail("\n");
return TRUE;
}
static Bool
NVMapMem(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
int ret, pitch;
ret = nouveau_allocate_surface(pScrn, pScrn->virtualX, pScrn->virtualY,
pScrn->bitsPerPixel,
NOUVEAU_CREATE_PIXMAP_SCANOUT,
&pitch, &pNv->scanout);
if (!ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Error allocating scanout buffer: %d\n", ret);
return FALSE;
}
pScrn->displayWidth = pitch / (pScrn->bitsPerPixel / 8);
return TRUE;
}
/*
* Unmap the framebuffer and offscreen memory.
*/
static Bool
NVUnmapMem(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
drmmode_remove_fb(pScrn);
nouveau_bo_ref(NULL, &pNv->transfer);
nouveau_bo_ref(NULL, &pNv->scanout);
return TRUE;
}
static void
NVLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO * colors, VisualPtr pVisual)
{
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
int c;
int i, j, index;
CARD16 lut_r[256], lut_g[256], lut_b[256];
for (c = 0; c < xf86_config->num_crtc; c++) {
xf86CrtcPtr crtc = xf86_config->crtc[c];
/* code borrowed from intel driver */
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 (i <= 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;
}
if (crtc->randr_crtc)
/* Make the change through RandR */
RRCrtcGammaSet(crtc->randr_crtc, lut_r, lut_g, lut_b);
}
}
/* Mandatory */
/* This gets called at the start of each server generation */
static Bool
NVScreenInit(SCREEN_INIT_ARGS_DECL)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
int ret;
VisualPtr visual;
unsigned char *FBStart;
int displayWidth;
if (pNv->AccelMethod == EXA) {
if (!NVAccelCommonInit(pScrn)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Error initialising acceleration. "
"Falling back to NoAccel\n");
pNv->AccelMethod = NONE;
pNv->ShadowFB = TRUE;
pNv->wfb_enabled = FALSE;
pNv->tiled_scanout = FALSE;
pScrn->displayWidth = nv_pitch_align(pNv,
pScrn->virtualX,
pScrn->depth);
}
}
nouveau_copy_init(pScreen);
/* Allocate and map memory areas we need */
if (!NVMapMem(pScrn))
return FALSE;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
int i;
/* need to point to new screen on server regeneration */
for (i = 0; i < xf86_config->num_crtc; i++)
xf86_config->crtc[i]->scrn = pScrn;
for (i = 0; i < xf86_config->num_output; i++)
xf86_config->output[i]->scrn = pScrn;
/*
* The next step is to setup the screen's visuals, and initialise the
* framebuffer code. In cases where the framebuffer's default
* choices for things like visual layouts and bits per RGB are OK,
* this may be as simple as calling the framebuffer's ScreenInit()
* function. If not, the visuals will need to be setup before calling
* a fb ScreenInit() function and fixed up after.
*
* For most PC hardware at depths >= 8, the defaults that fb uses
* are not appropriate. In this driver, we fixup the visuals after.
*/
/*
* Reset the visual list.
*/
miClearVisualTypes();
/* Setup the visuals we support. */
if (!miSetVisualTypes(pScrn->depth,
miGetDefaultVisualMask(pScrn->depth),
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
if (!miSetPixmapDepths ())
return FALSE;
/*
* Call the framebuffer layer's ScreenInit function, and fill in other
* pScreen fields.
*/
if (pNv->ShadowFB) {
pNv->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * pScrn->virtualX);
pNv->ShadowPtr = malloc(pNv->ShadowPitch * pScrn->virtualY);
displayWidth = pNv->ShadowPitch / (pScrn->bitsPerPixel >> 3);
FBStart = pNv->ShadowPtr;
} else
if (pNv->AccelMethod <= NONE) {
pNv->ShadowPtr = NULL;
displayWidth = pScrn->displayWidth;
nouveau_bo_map(pNv->scanout, NOUVEAU_BO_RDWR, pNv->client);
FBStart = pNv->scanout->map;
} else {
pNv->ShadowPtr = NULL;
displayWidth = pScrn->displayWidth;
FBStart = NULL;
}
switch (pScrn->bitsPerPixel) {
case 16:
case 32:
if (pNv->wfb_enabled) {
ret = wfbScreenInit(pScreen, FBStart, pScrn->virtualX,
pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
displayWidth, pScrn->bitsPerPixel,
nouveau_wfb_setup_wrap,
nouveau_wfb_finish_wrap);
} else {
ret = fbScreenInit(pScreen, FBStart, pScrn->virtualX,
pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
displayWidth, pScrn->bitsPerPixel);
}
break;
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Internal error: invalid bpp (%d) in NVScreenInit\n",
pScrn->bitsPerPixel);
ret = FALSE;
break;
}
if (!ret)
return FALSE;
/* Fixup RGB ordering */
visual = pScreen->visuals + pScreen->numVisuals;
while (--visual >= pScreen->visuals) {
if ((visual->class | DynamicClass) == DirectColor) {
visual->offsetRed = pScrn->offset.red;
visual->offsetGreen = pScrn->offset.green;
visual->offsetBlue = pScrn->offset.blue;
visual->redMask = pScrn->mask.red;
visual->greenMask = pScrn->mask.green;
visual->blueMask = pScrn->mask.blue;
}
}
if (pNv->wfb_enabled)
wfbPictureInit (pScreen, 0, 0);
else
fbPictureInit (pScreen, 0, 0);
xf86SetBlackWhitePixels(pScreen);
if (nouveau_present_init(pScreen))
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Hardware support for Present enabled\n");
else
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Hardware support for Present disabled\n");
nouveau_sync_init(pScreen);
nouveau_dri2_init(pScreen);
if (pNv->AccelMethod == EXA) {
if (pNv->max_dri_level >= 3 &&
!nouveau_dri3_screen_init(pScreen))
return FALSE;
if (!nouveau_exa_init(pScreen))
return FALSE;
}
xf86SetBackingStore(pScreen);
xf86SetSilkenMouse(pScreen);
/*
* Initialize software cursor.
* Must precede creation of the default colormap.
*/
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
/*
* Initialize HW cursor layer.
* Must follow software cursor initialization.
*/
if (xf86_config->num_crtc && pNv->HWCursor) {
ret = drmmode_cursor_init(pScreen);
if (ret != TRUE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Hardware cursor initialization failed\n");
pNv->HWCursor = FALSE;
}
}
if (pNv->ShadowFB)
ShadowFBInit(pScreen, NVRefreshArea);
pScrn->fbOffset = 0;
NVInitVideo(pScreen);
/* Wrap the block handler here, if we do it after the EnterVT we
* can end up in the unfortunate case where we've wrapped the
* xf86RotateBlockHandler which sometimes is not expecting to
* be in the wrap chain and calls a NULL pointer...
*/
pNv->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = NVBlockHandler;
if (!AddCallback(&FlushCallback, NVFlushCallback, pScrn))
return FALSE;
pScrn->vtSema = TRUE;
pScrn->pScreen = pScreen;
xf86DPMSInit(pScreen, xf86DPMSSet, 0);
/* Wrap the current CloseScreen function */
pScreen->SaveScreen = NVSaveScreen;
pNv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = NVCloseScreen;
pNv->CreateScreenResources = pScreen->CreateScreenResources;
pScreen->CreateScreenResources = NVCreateScreenResources;
#ifdef NOUVEAU_PIXMAP_SHARING
pScreen->StartPixmapTracking = PixmapStartDirtyTracking;
pScreen->StopPixmapTracking = PixmapStopDirtyTracking;
#endif
if (!xf86CrtcScreenInit(pScreen))
return FALSE;
/* Initialise default colourmap */
if (!miCreateDefColormap(pScreen))
return FALSE;
/*
* Initialize colormap layer.
* Must follow initialization of the default colormap.
* X-Server < 1.20 mishandles > 256 slots / > 8 bpc color maps, so skip
* color map setup on old servers at > 8 bpc. Gamma luts still work.
*/
if (xf86_config->num_crtc && (pScrn->rgbBits <= 8 ||
XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,20,0,0,0)) &&
!xf86HandleColormaps(pScreen, 1 << pScrn->rgbBits, pScrn->rgbBits,
NVLoadPalette, NULL, CMAP_PALETTED_TRUECOLOR))
return FALSE;
/* Report any unused options (only for the first generation) */
if (serverGeneration == 1)
xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
if (xf86_config->num_crtc)
drmmode_screen_init(pScreen);
else
pNv->glx_vblank = FALSE;
return TRUE;
}
static Bool
NVSaveScreen(ScreenPtr pScreen, int mode)
{
return TRUE;
}
xf86-video-nouveau-1.0.16/src/nouveau_copya0b5.c 0000644 0001750 0001756 00000006321 13423754626 016242 0000000 0000000 /*
* Copyright 2014 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 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.
*
* Authors: Ben Skeggs
*/
#include "nouveau_copy.h"
#include "hwdefs/nv_object.xml.h"
#include "nvc0_accel.h"
Bool
nouveau_copya0b5_rect(struct nouveau_pushbuf *push, struct nouveau_object *copy,
int w, int h, int cpp,
struct nouveau_bo *src, uint32_t src_off, int src_dom,
int src_pitch, int src_h, int src_x, int src_y,
struct nouveau_bo *dst, uint32_t dst_off, int dst_dom,
int dst_pitch, int dst_h, int dst_x, int dst_y)
{
struct nouveau_pushbuf_refn refs[] = {
{ src, src_dom | NOUVEAU_BO_RD },
{ dst, dst_dom | NOUVEAU_BO_WR },
};
unsigned exec;
if (nouveau_pushbuf_space(push, 64, 0, 0) ||
nouveau_pushbuf_refn (push, refs, 2))
return FALSE;
exec = 0x00000206;
if (!src->config.nvc0.memtype) {
src_off += src_y * src_pitch + src_x * cpp;
exec |= 0x00000080;
}
if (!dst->config.nvc0.memtype) {
dst_off += dst_y * dst_pitch + dst_x * cpp;
exec |= 0x00000100;
}
BEGIN_NVC0(push, SUBC_COPY(0x0728), 6);
PUSH_DATA (push, 0x00001000 | src->config.nvc0.tile_mode);
PUSH_DATA (push, src_pitch);
PUSH_DATA (push, src_h);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
PUSH_DATA (push, (src_y << 16) | src_x * cpp);
BEGIN_NVC0(push, SUBC_COPY(0x070c), 6);
PUSH_DATA (push, 0x000001000 | dst->config.nvc0.tile_mode);
PUSH_DATA (push, dst_pitch);
PUSH_DATA (push, dst_h);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
PUSH_DATA (push, (dst_y << 16) | dst_x * cpp);
BEGIN_NVC0(push, SUBC_COPY(0x0400), 8);
PUSH_DATA (push, (src->offset + src_off) >> 32);
PUSH_DATA (push, (src->offset + src_off));
PUSH_DATA (push, (dst->offset + dst_off) >> 32);
PUSH_DATA (push, (dst->offset + dst_off));
PUSH_DATA (push, src_pitch);
PUSH_DATA (push, dst_pitch);
PUSH_DATA (push, w * cpp);
PUSH_DATA (push, h);
BEGIN_NVC0(push, SUBC_COPY(0x0300), 1);
PUSH_DATA (push, exec);
return TRUE;
}
Bool
nouveau_copya0b5_init(NVPtr pNv)
{
struct nouveau_pushbuf *push = pNv->ce_pushbuf;
if (PUSH_SPACE(push, 8)) {
BEGIN_NVC0(push, NV01_SUBC(COPY, OBJECT), 1);
PUSH_DATA (push, pNv->NvCopy->handle);
pNv->ce_rect = nouveau_copya0b5_rect;
return TRUE;
}
return FALSE;
}
xf86-video-nouveau-1.0.16/src/nouveau_copy.c 0000644 0001750 0001756 00000007655 13423754626 015605 0000000 0000000 /*
* Copyright 2014 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 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.
*
* Authors: Ben Skeggs
*/
#include "nouveau_copy.h"
void
nouveau_copy_fini(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
nouveau_object_del(&pNv->NvCopy);
nouveau_pushbuf_del(&pNv->ce_pushbuf);
nouveau_object_del(&pNv->ce_channel);
}
Bool
nouveau_copy_init(ScreenPtr pScreen)
{
static const struct {
CARD32 oclass;
int engine;
Bool (*init)(NVPtr);
} methods[] = {
{ 0xc1b5, 0, nouveau_copya0b5_init },
{ 0xc0b5, 0, nouveau_copya0b5_init },
{ 0xb0b5, 0, nouveau_copya0b5_init },
{ 0xa0b5, 0, nouveau_copya0b5_init },
{ 0x90b8, 5, nouveau_copy90b5_init },
{ 0x90b5, 4, nouveau_copy90b5_init },
{ 0x85b5, 0, nouveau_copy85b5_init },
{}
}, *method = methods;
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
int ret;
if (pNv->AccelMethod == NONE) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"[COPY] acceleration disabled\n");
return FALSE;
}
switch (pNv->Architecture) {
case NV_TESLA:
if (pNv->dev->chipset < 0xa3 ||
pNv->dev->chipset == 0xaa ||
pNv->dev->chipset == 0xac)
return FALSE;
ret = nouveau_object_new(&pNv->dev->object, 0,
NOUVEAU_FIFO_CHANNEL_CLASS,
&(struct nv04_fifo) {
.vram = NvDmaFB,
.gart = NvDmaTT,
}, sizeof(struct nv04_fifo),
&pNv->ce_channel);
break;
case NV_FERMI:
ret = nouveau_object_new(&pNv->dev->object, 0,
NOUVEAU_FIFO_CHANNEL_CLASS,
&(struct nvc0_fifo) {
}, sizeof(struct nvc0_fifo),
&pNv->ce_channel);
break;
case NV_KEPLER:
case NV_MAXWELL:
case NV_PASCAL:
ret = nouveau_object_new(&pNv->dev->object, 0,
NOUVEAU_FIFO_CHANNEL_CLASS,
&(struct nve0_fifo) {
.engine = NVE0_FIFO_ENGINE_CE0 |
NVE0_FIFO_ENGINE_CE1,
}, sizeof(struct nve0_fifo),
&pNv->ce_channel);
break;
default:
return FALSE;
}
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[COPY] error allocating channel: %d\n", ret);
return FALSE;
}
ret = nouveau_pushbuf_new(pNv->client, pNv->ce_channel, 4,
32 * 1024, true, &pNv->ce_pushbuf);
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[COPY] error allocating pushbuf: %d\n", ret);
nouveau_copy_fini(pScreen);
return FALSE;
}
while (method->init) {
ret = nouveau_object_new(pNv->ce_channel,
method->engine << 16 | method->oclass,
method->oclass, NULL, 0,
&pNv->NvCopy);
if (ret == 0) {
if (!method->init(pNv)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[COPY] failed to initialise.\n");
nouveau_copy_fini(pScreen);
return FALSE;
}
break;
}
method++;
}
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[COPY] failed to allocate class.\n");
nouveau_copy_fini(pScreen);
return FALSE;
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[COPY] async initialised.\n");
return TRUE;
}
xf86-video-nouveau-1.0.16/src/nv04_xv_blit.c 0000644 0001750 0001756 00000015210 13423754626 015371 0000000 0000000 /*
* Copyright 2007 Arthur Huillet
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "xf86xv.h"
#include
#include "exa.h"
#include "damage.h"
#include "dixstruct.h"
#include "fourcc.h"
#include "nv_include.h"
#include "nv_dma.h"
#include "hwdefs/nv_object.xml.h"
#include "hwdefs/nv01_2d.xml.h"
#include "nv04_accel.h"
#define FOURCC_RGB 0x0000003
#define VSYNC_POSSIBLE (pNv->dev->chipset >= 0x11)
extern Atom xvSetDefaults, xvSyncToVBlank;
Bool
NVPutBlitImage(ScrnInfoPtr pScrn, struct nouveau_bo *src, int src_offset,
int id, int src_pitch, BoxPtr dstBox,
int x1, int y1, int x2, int y2,
short width, short height,
short src_w, short src_h,
short drw_w, short drw_h,
RegionPtr clipBoxes, PixmapPtr ppix)
{
NVPtr pNv = NVPTR(pScrn);
NVPortPrivPtr pPriv = GET_BLIT_PRIVATE(pNv);
BoxPtr pbox;
int nbox;
CARD32 dsdx, dtdy;
CARD32 dst_size, dst_point;
CARD32 src_point, src_format;
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
struct nv04_fifo *fifo = pNv->channel->data;
int dst_format;
if (!NVAccelGetCtxSurf2DFormatFromPixmap(ppix, &dst_format))
return BadImplementation;
pbox = REGION_RECTS(clipBoxes);
nbox = REGION_NUM_RECTS(clipBoxes);
dsdx = (src_w << 20) / drw_w;
dtdy = (src_h << 20) / drw_h;
dst_size = ((dstBox->y2 - dstBox->y1) << 16) |
(dstBox->x2 - dstBox->x1);
dst_point = (dstBox->y1 << 16) | dstBox->x1;
src_point = ((y1 << 4) & 0xffff0000) | (x1 >> 12);
switch(id) {
case FOURCC_RGB:
src_format = NV03_SIFM_COLOR_FORMAT_X8R8G8B8;
break;
case FOURCC_UYVY:
src_format = NV03_SIFM_COLOR_FORMAT_YB8V8YA8U8;
break;
default:
src_format = NV03_SIFM_COLOR_FORMAT_V8YB8U8YA8;
break;
}
if (!PUSH_SPACE(push, 128))
return BadImplementation;
PUSH_RESET(push);
BEGIN_NV04(push, NV04_SF2D(FORMAT), 4);
PUSH_DATA (push, dst_format);
PUSH_DATA (push, (exaGetPixmapPitch(ppix) << 16) |
exaGetPixmapPitch(ppix));
PUSH_MTHDl(push, NV04_SF2D(OFFSET_SOURCE), bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
PUSH_MTHDl(push, NV04_SF2D(OFFSET_DESTIN), bo, 0,
NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, pNv->NvScaledImage->handle);
BEGIN_NV04(push, NV03_SIFM(DMA_IMAGE), 1);
PUSH_MTHDo(push, NV03_SIFM(DMA_IMAGE), src, NOUVEAU_BO_RD |
NOUVEAU_BO_VRAM | NOUVEAU_BO_GART,
fifo->vram, fifo->gart);
if (pNv->dev->chipset >= 0x05) {
BEGIN_NV04(push, NV03_SIFM(COLOR_FORMAT), 2);
PUSH_DATA (push, src_format);
PUSH_DATA (push, NV03_SIFM_OPERATION_SRCCOPY);
} else {
BEGIN_NV04(push, NV03_SIFM(COLOR_FORMAT), 1);
PUSH_DATA (push, src_format);
}
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push)) {
nouveau_pushbuf_bufctx(push, NULL);
return BadAlloc;
}
if (pPriv->SyncToVBlank)
NV11SyncToVBlank(ppix, dstBox);
while (nbox--) {
if (!PUSH_SPACE(push, 16)) {
nouveau_pushbuf_bufctx(push, NULL);
return BadImplementation;
}
BEGIN_NV04(push, NV04_RECT(COLOR1_A), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV03_SIFM(CLIP_POINT), 6);
PUSH_DATA (push, (pbox->y1 << 16) | pbox->x1);
PUSH_DATA (push, (pbox->y2 - pbox->y1) << 16 |
(pbox->x2 - pbox->x1));
PUSH_DATA (push, dst_point);
PUSH_DATA (push, dst_size);
PUSH_DATA (push, dsdx);
PUSH_DATA (push, dtdy);
BEGIN_NV04(push, NV03_SIFM(SIZE), 4);
PUSH_DATA (push, (height << 16) | width);
PUSH_DATA (push, NV03_SIFM_FORMAT_FILTER_BILINEAR |
NV03_SIFM_FORMAT_ORIGIN_CENTER | src_pitch);
PUSH_RELOC(push, src, src_offset, NOUVEAU_BO_LOW, 0, 0);
PUSH_DATA (push, src_point);
pbox++;
}
nouveau_pushbuf_bufctx(push, NULL);
PUSH_KICK(push);
exaMarkSync(pScrn->pScreen);
pPriv->videoStatus = FREE_TIMER;
pPriv->videoTime = currentTime.milliseconds + FREE_DELAY;
extern void NVVideoTimerCallback(ScrnInfoPtr, Time);
pNv->VideoTimerCallback = NVVideoTimerCallback;
return Success;
}
/**
* NVSetBlitPortAttribute
* sets the attribute "attribute" of port "data" to value "value"
* supported attributes:
* - xvSyncToVBlank (values: 0,1)
* - xvSetDefaults (values: NA; SyncToVBlank will be set, if hardware supports it)
*
* @param pScrenInfo
* @param attribute attribute to set
* @param value value to which attribute is to be set
* @param data port from which the attribute is to be set
*
* @return Success, if setting is successful
* BadValue/BadMatch, if value/attribute are invalid
*/
int
NVSetBlitPortAttribute(ScrnInfoPtr pScrn, Atom attribute,
INT32 value, pointer data)
{
NVPortPrivPtr pPriv = (NVPortPrivPtr)data;
NVPtr pNv = NVPTR(pScrn);
if ((attribute == xvSyncToVBlank) && VSYNC_POSSIBLE) {
if ((value < 0) || (value > 1))
return BadValue;
pPriv->SyncToVBlank = value;
} else
if (attribute == xvSetDefaults) {
pPriv->SyncToVBlank = VSYNC_POSSIBLE;
} else
return BadMatch;
return Success;
}
/**
* NVGetBlitPortAttribute
* reads the value of attribute "attribute" from port "data" into INT32 "*value"
* currently only one attribute supported: xvSyncToVBlank
*
* @param pScrn unused
* @param attribute attribute to be read
* @param value value of attribute will be stored here
* @param data port from which attribute will be read
* @return Success, if queried attribute exists
*/
int
NVGetBlitPortAttribute(ScrnInfoPtr pScrn, Atom attribute,
INT32 *value, pointer data)
{
NVPortPrivPtr pPriv = (NVPortPrivPtr)data;
if(attribute == xvSyncToVBlank)
*value = (pPriv->SyncToVBlank) ? 1 : 0;
else
return BadMatch;
return Success;
}
/**
* NVStopBlitVideo
*/
void
NVStopBlitVideo(ScrnInfoPtr pScrn, pointer data, Bool Exit)
{
}
xf86-video-nouveau-1.0.16/src/shader/ 0000755 0001750 0001756 00000000000 13423754654 014237 5 0000000 0000000 xf86-video-nouveau-1.0.16/src/shader/videonvc0.fpc 0000644 0001750 0001756 00000000674 13423754626 016554 0000000 0000000 0xfff09c00,
0xc07e007c,
0x10209c00,
0xc8000000,
0x0bf01c40,
0xc07e0080,
0x0bf05c40,
0xc07e0084,
0x00001e86,
0x80120000,
0x00015c40,
0x58004000,
0x1050dc20,
0x50004000,
0x20511c20,
0x50004000,
0x30515c20,
0x50004000,
0x0bf01c40,
0xc07e0080,
0x0bf05c40,
0xc07e0084,
0x00001e86,
0x80130001,
0x4000dc40,
0x30064000,
0x50011c40,
0x30084000,
0x60015c40,
0x300a4000,
0x70101c40,
0x30064000,
0x90109c40,
0x300a4000,
0x80105c40,
0x30084000,
0x88001dff,
xf86-video-nouveau-1.0.16/src/shader/exacmnve0.fp 0000644 0001750 0001756 00000001427 13423754626 016377 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVE0FP_Composite[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exacmnve0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x94] $r0 0x0
interp mul f32 $r2 a[0x90] $r0 0x0
tex t lauto live dfp #:#:#:$r4 t2d $t1 $s0 $r2:$r3 ()
interp mul f32 $r1 a[0x84] $r0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t0 $s0 $r0:$r1 ()
texbar 0x0
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r1 $r1 $r4
mul ftz rn f32 $r0 $r0 $r4
long exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exasanvc0.fp 0000644 0001750 0001756 00000001421 13423754626 016373 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVC0FP_CACompositeSrcAlpha[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exasanvc0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x84] $r0 0x0
interp mul f32 $r2 a[0x80] $r0 0x0
tex t lauto live dfp #:#:#:$r4 t2d $t0 $s0 $r2:$r3 ()
interp mul f32 $r1 a[0x94] $r0 0x0
interp mul f32 $r0 a[0x90] $r0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t1 $s0 $r0:$r1 ()
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r1 $r1 $r4
mul ftz rn f32 $r0 $r0 $r4
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exacanvf0.fpc 0000644 0001750 0001756 00000000520 13423754626 016520 0000000 0000000 0x7f9ffc02,
0x7483fc3e,
0x021c0002,
0x84000000,
0x001ffc0e,
0x74a3fc4a,
0x001ffc0a,
0x74a3fc48,
0xff9c0811,
0x600080bd,
0x001ffc06,
0x74a3fc42,
0x001ffc02,
0x74a3fc40,
0xff9c0001,
0x600000bd,
0x001c0002,
0x77000000,
0x039c0c0e,
0xe3408000,
0x031c080a,
0xe3408000,
0x029c0406,
0xe3408000,
0x021c0002,
0xe3408000,
0x001c003c,
0x18000000,
xf86-video-nouveau-1.0.16/src/shader/exascnvf0.fpc 0000644 0001750 0001756 00000000250 13423754626 016542 0000000 0000000 0x7f9ffc02,
0x7483fc3e,
0x021c0002,
0x84000000,
0x001ffc06,
0x74a3fc42,
0x001ffc02,
0x74a3fc40,
0xff9c0001,
0x600000bd,
0x001c0002,
0x77000000,
0x001c003c,
0x18000000,
xf86-video-nouveau-1.0.16/src/shader/exascnvf0.fp 0000644 0001750 0001756 00000001070 13423754626 016400 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVF0FP_Source[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x0000000a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exascnvf0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r1 a[0x84] $r0 0x0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d c[0x0] xy__ $r0:$r1 0x0
texbar 0x0
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/xfrm2nvc0.vp 0000644 0001750 0001756 00000003150 13423754626 016351 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVC0VP_Transform2[] = {
0x00020461,
0x00000000,
0x00000000,
0x00000000,
0x000ff000,
0x00000000, /* VP_ATTR_EN[0x000] */
0x0001033f, /* VP_ATTR_EN[0x080] */
0x00000000, /* VP_ATTR_EN[0x100] */
0x00000000,
0x00000000, /* VP_ATTR_EN[0x200] */
0x00000000,
0x00000000, /* VP_ATTR_EN[0x300] */
0x00000000,
0x0033f000, /* VP_EXPORT_EN[0x040] */
0x00000000, /* VP_EXPORT_EN[0x0c0] */
0x00000000,
0x00000000,
0x00000000,
0x00000000, /* VP_EXPORT_EN[0x2c0] */
0x00000000,
#include "xfrm2nvc0.vpc"
};
#else
ld b128 $r0:$r1:$r2:$r3 a[0x80] 0x0 unk39
st b128 a[0x70] $r0:$r1:$r2:$r3 0x0 unk39
ld b64 $r0:$r1 a[0x90] 0x0 unk39
mul ftz rn f32 $r2 $r0 c0[0x0]
mul ftz rn f32 $r3 $r0 c0[0xc]
mul ftz rn f32 $r4 $r0 c0[0x18]
fma ftz rn f32 $r2 $r1 c0[0x4] $r2
fma ftz rn f32 $r3 $r1 c0[0x10] $r3
fma ftz rn f32 $r4 $r1 c0[0x1c] $r4
add ftz rn f32 $r2 $r2 c0[0x8]
add ftz rn f32 $r3 $r3 c0[0x14]
add ftz rn f32 $r4 $r4 c0[0x20]
rcp f32 $r4 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r0 $r2 c0[0x24]
mul ftz rn f32 $r1 $r3 c0[0x28]
st b64 a[0x80] $r0:$r1 0x0 unk39
ld b64 $r0:$r1 a[0xa0] 0x0 unk39
mul ftz rn f32 $r2 $r0 c0[0x2c]
mul ftz rn f32 $r3 $r0 c0[0x38]
mul ftz rn f32 $r4 $r0 c0[0x44]
fma ftz rn f32 $r2 $r1 c0[0x30] $r2
fma ftz rn f32 $r3 $r1 c0[0x3c] $r3
fma ftz rn f32 $r4 $r1 c0[0x48] $r4
add ftz rn f32 $r2 $r2 c0[0x34]
add ftz rn f32 $r3 $r3 c0[0x40]
add ftz rn f32 $r4 $r4 c0[0x4c]
rcp f32 $r4 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r0 $r2 c0[0x50]
mul ftz rn f32 $r1 $r3 c0[0x54]
st b64 a[0x90] $r0:$r1 0x0 unk39
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exascnve0.fp 0000644 0001750 0001756 00000001054 13423754626 016401 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVE0FP_Source[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x0000000a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exascnve0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r1 a[0x84] $r0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t0 $s0 $r0:$r1 ()
texbar 0x0
long exit
#endif
xf86-video-nouveau-1.0.16/src/shader/xfrm2nvf0.vpc 0000644 0001750 0001756 00000002070 13423754626 016517 0000000 0000000 0x401ffc02,
0x7ec3fc00,
0x421ffc06,
0x7ec3fc00,
0x441ffc0a,
0x7ec3fc00,
0x461ffc0e,
0x7ec3fc00,
0x381ffc02,
0x7f03fc00,
0x3a1ffc06,
0x7f03fc00,
0x3c1ffc0a,
0x7f03fc00,
0x3e1ffc0e,
0x7f03fc00,
0x481ffc02,
0x7ec3fc00,
0x4a1ffc06,
0x7ec3fc00,
0x001c000a,
0x63408000,
0x019c000e,
0x63408000,
0x031c0012,
0x63408000,
0x009c040a,
0x4d000800,
0x021c040e,
0x4d000c00,
0x039c0412,
0x4d001000,
0x011c080a,
0x62c08000,
0x029c0c0e,
0x62c08000,
0x041c1012,
0x62c08000,
0x021c1012,
0x84000000,
0x021c080a,
0xe3408000,
0x021c0c0e,
0xe3408000,
0x049c0802,
0x63408000,
0x051c0c06,
0x63408000,
0x401ffc02,
0x7f03fc00,
0x421ffc06,
0x7f03fc00,
0x501ffc02,
0x7ec3fc00,
0x521ffc06,
0x7ec3fc00,
0x059c000a,
0x63408000,
0x071c000e,
0x63408000,
0x089c0012,
0x63408000,
0x061c040a,
0x4d000800,
0x079c040e,
0x4d000c00,
0x091c0412,
0x4d001000,
0x069c080a,
0x62c08000,
0x081c0c0e,
0x62c08000,
0x099c1012,
0x62c08000,
0x021c1012,
0x84000000,
0x021c080a,
0xe3408000,
0x021c0c0e,
0xe3408000,
0x0a1c0802,
0x63408000,
0x0a9c0c06,
0x63408000,
0x481ffc02,
0x7f03fc00,
0x4a1ffc06,
0x7f03fc00,
0x001c003c,
0x18000000,
xf86-video-nouveau-1.0.16/src/shader/exacanvc0.fp 0000644 0001750 0001756 00000002333 13423754626 016356 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVC0FP_CAComposite[] = {
0x00021462, /* 0x0000c000 = USES_KIL, MULTI_COLORS */
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000, /* FRAG_COORD_UMASK = 0x8 */
0x00000a0a, /* FP_INTERP[0x080], 0022 0022 */
0x00000000, /* FP_INTERP[0x0c0], 0 = OFF */
0x00000000, /* FP_INTERP[0x100], 1 = FLAT */
0x00000000, /* FP_INTERP[0x140], 2 = PERSPECTIVE */
0x00000000, /* FP_INTERP[0x180], 3 = LINEAR */
0x00000000, /* FP_INTERP[0x1c0] */
0x00000000, /* FP_INTERP[0x200] */
0x00000000, /* FP_INTERP[0x240] */
0x00000000, /* FP_INTERP[0x280] */
0x00000000, /* FP_INTERP[0x2c0] */
0x00000000, /* FP_INTERP[0x300] */
0x00000000,
0x0000000f, /* FP_RESULT_MASK (0x8000 Face ?) */
0x00000000, /* 0x2 = FragDepth, 0x1 = SampleMask */
#include "exacanvc0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x94] $r0 0x0
interp mul f32 $r2 a[0x90] $r0 0x0
tex t lauto live dfp $r4:$r5:$r6:$r7 t2d $t1 $s0 $r2:$r3 ()
interp mul f32 $r1 a[0x84] $r0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t0 $s0 $r0:$r1 ()
mul ftz rn f32 $r3 $r3 $r7
mul ftz rn f32 $r2 $r2 $r6
mul ftz rn f32 $r1 $r1 $r5
mul ftz rn f32 $r0 $r0 $r4
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exas8nvc0.fp 0000644 0001750 0001756 00000001111 13423754626 016316 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVC0FP_Source_A8[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x0000000a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exas8nvc0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r1 a[0x84] $r0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0
tex t lauto live dfp #:#:#:$r0 t2d $t0 $s0 $r0:$r1 ()
mov b32 $r3 $r0
mov b32 $r2 $r0
mov b32 $r1 $r0
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exacmnvf0.fpc 0000644 0001750 0001756 00000000520 13423754626 016534 0000000 0000000 0x7f9ffc02,
0x7483fc3e,
0x021c0002,
0x84000000,
0x001ffc0e,
0x74a3fc4a,
0x001ffc0a,
0x74a3fc48,
0xff9c0811,
0x600080a1,
0x001ffc06,
0x74a3fc42,
0x001ffc02,
0x74a3fc40,
0xff9c0001,
0x600000bd,
0x001c0002,
0x77000000,
0x021c0c0e,
0xe3408000,
0x021c080a,
0xe3408000,
0x021c0406,
0xe3408000,
0x021c0002,
0xe3408000,
0x001c003c,
0x18000000,
xf86-video-nouveau-1.0.16/src/shader/xfrm2nvf0.vp 0000644 0001750 0001756 00000004047 13423754626 016362 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVF0VP_Transform2[] = {
0x02000461,
0x00000000,
0x00000000,
0x00000000,
0x000ff000,
0x00000000, /* VP_ATTR_EN[0x000] */
0x0001033f, /* VP_ATTR_EN[0x080] */
0x00000000, /* VP_ATTR_EN[0x100] */
0x00000000,
0x00000000, /* VP_ATTR_EN[0x200] */
0x00000000,
0x00000000, /* VP_ATTR_EN[0x300] */
0x00000000,
0x0033f000, /* VP_EXPORT_EN[0x040] */
0x00000000, /* VP_EXPORT_EN[0x0c0] */
0x00000000,
0x00000000,
0x00000000,
0x00000000, /* VP_EXPORT_EN[0x2c0] */
0x00000000,
#include "xfrm2nvf0.vpc"
};
#else
//ld b128 $r0:$r1:$r2:$r3 a[0x80] 0x0 unk39
ld b32 $r0 a[0x80] 0x0 0x0
ld b32 $r1 a[0x84] 0x0 0x0
ld b32 $r2 a[0x88] 0x0 0x0
ld b32 $r3 a[0x8c] 0x0 0x0
//st b128 a[0x70] $r0:$r1:$r2:$r3 0x0 unk39
st b32 a[0x70] $r0 0x0 0x0
st b32 a[0x74] $r1 0x0 0x0
st b32 a[0x78] $r2 0x0 0x0
st b32 a[0x7c] $r3 0x0 0x0
//ld b64 $r0:$r1 a[0x90] 0x0 unk39
ld b32 $r0 a[0x90] 0x0 0x0
ld b32 $r1 a[0x94] 0x0 0x0
mul ftz rn f32 $r2 $r0 c0[0x0]
mul ftz rn f32 $r3 $r0 c0[0xc]
mul ftz rn f32 $r4 $r0 c0[0x18]
fma ftz rn f32 $r2 $r1 c0[0x4] $r2
fma ftz rn f32 $r3 $r1 c0[0x10] $r3
fma ftz rn f32 $r4 $r1 c0[0x1c] $r4
add ftz rn f32 $r2 $r2 c0[0x8]
add ftz rn f32 $r3 $r3 c0[0x14]
add ftz rn f32 $r4 $r4 c0[0x20]
rcp f32 $r4 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r0 $r2 c0[0x24]
mul ftz rn f32 $r1 $r3 c0[0x28]
//st b64 a[0x80] $r0:$r1 0x0 unk39
st b32 a[0x80] $r0 0x0 0x0
st b32 a[0x84] $r1 0x0 0x0
//ld b64 $r0:$r1 a[0xa0] 0x0 unk39
ld b32 $r0 a[0xa0] 0x0 0x0
ld b32 $r1 a[0xa4] 0x0 0x0
mul ftz rn f32 $r2 $r0 c0[0x2c]
mul ftz rn f32 $r3 $r0 c0[0x38]
mul ftz rn f32 $r4 $r0 c0[0x44]
fma ftz rn f32 $r2 $r1 c0[0x30] $r2
fma ftz rn f32 $r3 $r1 c0[0x3c] $r3
fma ftz rn f32 $r4 $r1 c0[0x48] $r4
add ftz rn f32 $r2 $r2 c0[0x34]
add ftz rn f32 $r3 $r3 c0[0x40]
add ftz rn f32 $r4 $r4 c0[0x4c]
rcp f32 $r4 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r0 $r2 c0[0x50]
mul ftz rn f32 $r1 $r3 c0[0x54]
//st b64 a[0x90] $r0:$r1 0x0 unk39
st b32 a[0x90] $r0 0x0 0x0
st b32 a[0x94] $r1 0x0 0x0
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/xfrm2nv110.vpc 0000644 0001750 0001756 00000002310 13423754626 016510 0000000 0000000 0xfc0007e0,
0x001f8000,
0x2fc7ff05,
0xefd87f80,
0x00570505,
0x38480000,
0x08070500,
0xef950000,
0xfc0007e0,
0x001f8000,
0x08870502,
0xef950000,
0x0707ff00,
0xeff1ff80,
0x09070500,
0xef950000,
0xfc0007e0,
0x001f8000,
0x00070002,
0x4c681000,
0x00370003,
0x4c681000,
0x00670004,
0x4c681000,
0xfc0007e0,
0x001f8000,
0x00170102,
0x49a00100,
0x00470103,
0x49a00180,
0x00770104,
0x49a00200,
0xfc0007e0,
0x001f8000,
0x00270202,
0x4c581000,
0x00570303,
0x4c581000,
0x00870404,
0x4c581000,
0xfc0007e0,
0x001f8000,
0x00470404,
0x50800000,
0x00470202,
0x5c681000,
0x00470303,
0x5c681000,
0xfc0007e0,
0x001f8000,
0x00970200,
0x4c681000,
0x00a70301,
0x4c681000,
0x0807ff00,
0xeff0ff80,
0xfc0007e0,
0x001f8000,
0x09870500,
0xef950000,
0x00b70002,
0x4c681000,
0x00e70003,
0x4c681000,
0xfc0007e0,
0x001f8000,
0x01170004,
0x4c681000,
0x00c70102,
0x49a00100,
0x00f70103,
0x49a00180,
0xfc0007e0,
0x001f8000,
0x01270104,
0x49a00200,
0x00d70202,
0x4c581000,
0x01070303,
0x4c581000,
0xfc0007e0,
0x001f8000,
0x01370404,
0x4c581000,
0x00470404,
0x50800000,
0x00470202,
0x5c681000,
0xfc0007e0,
0x001f8000,
0x00470303,
0x5c681000,
0x01470200,
0x4c681000,
0x01570301,
0x4c681000,
0xfc0007e0,
0x001f8000,
0x0907ff00,
0xeff0ff80,
0x0007000f,
0xe3000000,
xf86-video-nouveau-1.0.16/src/shader/exac8nv110.fp 0000644 0001750 0001756 00000001524 13423754626 016305 0000000 0000000 #ifndef ENVYAS
static uint32_t
NV110FP_Composite_A8[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exac8nv110.fpc"
};
#else
sched (st 0x0) (st 0x0) (st 0x0)
ipa pass $r0 a[0x7c] 0x0 0x0 0x1
mufu rcp $r0 $r0
ipa $r3 a[0x94] $r0 0x0 0x1
sched (st 0x0) (st 0x0) (st 0x0)
ipa $r2 a[0x90] $r0 0x0 0x1
tex nodep $r1 $r2 0x0 0x1 t2d 0x8
ipa $r3 a[0x84] $r0 0x0 0x1
sched (st 0x0) (st 0x0) (st 0x0)
ipa $r2 a[0x80] $r0 0x0 0x1
tex nodep $r0 $r2 0x0 0x0 t2d 0x8
depbar le 0x5 0x0 0x0
sched (st 0x0) (st 0x0) (st 0x0)
fmul ftz $r3 $r0 $r1
mov $r2 $r3 0xf
mov $r1 $r3 0xf
sched (st 0x0) (st 0x0) (st 0x0)
mov $r0 $r3 0xf
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/videonv110.fp 0000644 0001750 0001756 00000002077 13423754626 016407 0000000 0000000 #ifndef ENVYAS
static uint32_t
NV110FP_NV12[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x0000000a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "videonv110.fpc"
};
#else
sched (st 0x0) (st 0x0) (st 0x0)
ipa pass $r2 a[0x7c] 0x0 0x0 0x1
mufu rcp $r2 $r2
ipa $r0 a[0x80] $r2 0x0 0x1
sched (st 0x0) (st 0x0) (st 0x0)
ipa $r1 a[0x84] $r2 0x0 0x1
tex nodep $r4 $r0 0x0 0x0 t2d 0x8
tex nodep $r0 $r0 0x0 0x1 t2d 0xc
sched (st 0x0) (st 0x0) (st 0x0)
depbar le 0x5 0x1 0x1
fmul ftz $r5 $r4 c0[0x0]
fadd ftz $r3 $r5 c0[0x4]
sched (st 0x0) (st 0x0) (st 0x0)
fadd ftz $r4 $r5 c0[0x8]
fadd ftz $r5 $r5 c0[0xc]
depbar le 0x5 0x0 0x0
sched (st 0x0) (st 0x0) (st 0x0)
ffma ftz $r3 $r0 c0[0x10] $r3
ffma ftz $r4 $r0 c0[0x14] $r4
ffma ftz $r5 $r0 c0[0x18] $r5
sched (st 0x0) (st 0x0) (st 0x0)
ffma ftz $r0 $r1 c0[0x1c] $r3
ffma ftz $r2 $r1 c0[0x24] $r5
ffma ftz $r1 $r1 c0[0x20] $r4
sched (st 0x0) (st 0x0) (st 0x0)
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exas8nv110.fp 0000644 0001750 0001756 00000001301 13423754626 016316 0000000 0000000 #ifndef ENVYAS
static uint32_t
NV110FP_Source_A8[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x0000000a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exas8nv110.fpc"
};
#else
sched (st 0x0) (st 0x0) (st 0x0)
ipa pass $r0 a[0x7c] 0x0 0x0 0x1
mufu rcp $r0 $r0
ipa $r1 a[0x84] $r0 0x0 0x1
sched (st 0x0) (st 0x0) (st 0x0)
ipa $r0 a[0x80] $r0 0x0 0x1
tex nodep $r0 $r0 0x0 0x0 t2d 0x8
depbar le 0x5 0x0 0x0
sched (st 0x0) (st 0x0) (st 0x0)
mov $r3 $r0 0xf
mov $r2 $r0 0xf
mov $r1 $r0 0xf
sched (st 0x0) (st 0x0) (st 0x0)
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/xfrm2nvc0.vpc 0000644 0001750 0001756 00000001474 13423754626 016523 0000000 0000000 0xfff01c66,
0x06000080,
0x03f01c66,
0x0a7e0070,
0xfff01c26,
0x06000090,
0x00009c40,
0x58004000,
0x3000dc40,
0x58004000,
0x60011c40,
0x58004000,
0x10109c40,
0x30044000,
0x4010dc40,
0x30064000,
0x70111c40,
0x30084000,
0x20209c20,
0x50004000,
0x5030dc20,
0x50004000,
0x80411c20,
0x50004000,
0x10411c00,
0xc8000000,
0x10209c40,
0x58000000,
0x1030dc40,
0x58000000,
0x90201c40,
0x58004000,
0xa0305c40,
0x58004000,
0x03f01c26,
0x0a7e0080,
0xfff01c26,
0x060000a0,
0xb0009c40,
0x58004000,
0xe000dc40,
0x58004000,
0x10011c40,
0x58004001,
0xc0109c40,
0x30044000,
0xf010dc40,
0x30064000,
0x20111c40,
0x30084001,
0xd0209c20,
0x50004000,
0x0030dc20,
0x50004001,
0x30411c20,
0x50004001,
0x10411c00,
0xc8000000,
0x10209c40,
0x58000000,
0x1030dc40,
0x58000000,
0x40201c40,
0x58004001,
0x50305c40,
0x58004001,
0x03f01c26,
0x0a7e0090,
0x88001dff,
xf86-video-nouveau-1.0.16/src/shader/exas8nve0.fpc 0000644 0001750 0001756 00000000360 13423754626 016470 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f05c40,
0xc07e0084,
0x03f01c40,
0xc07e0080,
0x00001e86,
0x80120000,
0x00001de6,
0xf0000000,
0x0000dde4,
0x28000000,
0x00009de4,
0x28000000,
0x00005de4,
0x28000000,
0x00001de7,
0x80000000,
xf86-video-nouveau-1.0.16/src/shader/Makefile 0000644 0001750 0001756 00000003425 13423754626 015622 0000000 0000000 NVC0_SHADERS = xfrm2nvc0.vpc \
exascnvc0.fpc \
exacmnvc0.fpc \
exacanvc0.fpc \
exasanvc0.fpc \
exas8nvc0.fpc \
exac8nvc0.fpc \
videonvc0.fpc
NVE0_SHADERS = xfrm2nve0.vpc \
exascnve0.fpc \
exacmnve0.fpc \
exacanve0.fpc \
exasanve0.fpc \
exas8nve0.fpc \
exac8nve0.fpc \
videonve0.fpc
NVF0_SHADERS = xfrm2nvf0.vpc \
exascnvf0.fpc \
exacmnvf0.fpc \
exacanvf0.fpc \
exasanvf0.fpc \
exas8nvf0.fpc \
exac8nvf0.fpc \
videonvf0.fpc
NV110_SHADERS = xfrm2nv110.vpc \
exascnv110.fpc \
exacmnv110.fpc \
exacanv110.fpc \
exasanv110.fpc \
exas8nv110.fpc \
exac8nv110.fpc \
videonv110.fpc
SHADERS = $(NVC0_SHADERS) $(NVE0_SHADERS) $(NVF0_SHADERS) $(NV110_SHADERS)
ENVYAS ?= envyas
all: $(SHADERS)
$(filter %nvc0.vpc,$(SHADERS)): %.vpc: %.vp
cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gf100 -o $@
$(filter %nvc0.fpc,$(SHADERS)): %.fpc: %.fp
cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gf100 -o $@
$(filter %nve0.vpc,$(SHADERS)): %.vpc: %.vp
cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gk104 -o $@
$(filter %nve0.fpc,$(SHADERS)): %.fpc: %.fp
cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gk104 -o $@
$(filter %nvf0.vpc,$(SHADERS)): %.vpc: %.vp
cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gk110 -o $@
$(filter %nvf0.fpc,$(SHADERS)): %.fpc: %.fp
cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gk110 -o $@
$(filter %nv110.vpc,$(SHADERS)): %.vpc: %.vp
cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gm107 -o $@
$(filter %nv110.fpc,$(SHADERS)): %.fpc: %.fp
cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gm107 -o $@
xf86-video-nouveau-1.0.16/src/shader/exas8nv110.fpc 0000644 0001750 0001756 00000000520 13423754626 016463 0000000 0000000 0xfc0007e0,
0x001f8000,
0xcff7ff00,
0xe003ff87,
0x00470000,
0x50800000,
0x4007ff01,
0xe043ff88,
0xfc0007e0,
0x001f8000,
0x0007ff00,
0xe043ff88,
0x2ff70000,
0xc03a0004,
0x34070000,
0xf0f00000,
0xfc0007e0,
0x001f8000,
0x00070003,
0x5c980780,
0x00070002,
0x5c980780,
0x00070001,
0x5c980780,
0xfc0007e0,
0x001f8000,
0x0007000f,
0xe3000000,
xf86-video-nouveau-1.0.16/src/shader/exasanv110.fp 0000644 0001750 0001756 00000001552 13423754626 016377 0000000 0000000 #ifndef ENVYAS
static uint32_t
NV110FP_CACompositeSrcAlpha[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exasanv110.fpc"
};
#else
sched (st 0x0) (st 0x0) (st 0x0)
ipa pass $r0 a[0x7c] 0x0 0x0 0x1
mufu rcp $r0 $r0
ipa $r3 a[0x84] $r0 0x0 0x1
sched (st 0x0) (st 0x0) (st 0x0)
ipa $r2 a[0x80] $r0 0x0 0x1
tex nodep $r4 $r2 0x0 0x0 t2d 0x8
ipa $r1 a[0x94] $r0 0x0 0x1
sched (st 0x0) (st 0x0) (st 0x0)
ipa $r0 a[0x90] $r0 0x0 0x1
tex nodep $r0 $r0 0x0 0x1 t2d 0xf
depbar le 0x5 0x0 0x0
sched (st 0x0) (st 0x0) (st 0x0)
fmul ftz $r3 $r3 $r4
fmul ftz $r2 $r2 $r4
fmul ftz $r1 $r1 $r4
sched (st 0x0) (st 0x0) (st 0x0)
fmul ftz $r0 $r0 $r4
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exac8nvf0.fp 0000644 0001750 0001756 00000001414 13423754626 016307 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVF0FP_Composite_A8[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exac8nvf0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x94] $r0 0x0 0x0
interp mul f32 $r2 a[0x90] $r0 0x0 0x0
tex t lauto live dfp #:#:#:$r1 t2d c[0x4] xy__ $r2:$r3 0x0
interp mul f32 $r3 a[0x84] $r0 0x0 0x0
interp mul f32 $r2 a[0x80] $r0 0x0 0x0
tex t lauto live dfp #:#:#:$r0 t2d c[0x0] xy__ $r2:$r3 0x0
texbar 0x0
mul ftz rn f32 $r3 $r0 $r1
mov b32 $r2 $r3
mov b32 $r1 $r3
mov b32 $r0 $r3
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/xfrm2nve0.vpc 0000644 0001750 0001756 00000001510 13423754626 016514 0000000 0000000 0xfff01c66,
0x06000080,
0x03f01c66,
0x0a7e0070,
0xfff01c26,
0x06000090,
0x00009c40,
0x58004000,
0x3000dc40,
0x58004000,
0x60011c40,
0x58004000,
0x10109c40,
0x30044000,
0x4010dc40,
0x30064000,
0x70111c40,
0x30084000,
0x20209c20,
0x50004000,
0x5030dc20,
0x50004000,
0x80411c20,
0x50004000,
0x10411c00,
0xc8000000,
0x10209c40,
0x58000000,
0x1030dc40,
0x58000000,
0x90201c40,
0x58004000,
0xa0305c40,
0x58004000,
0x03f01c26,
0x0a7e0080,
0xfff01c26,
0x060000a0,
0xb0009c40,
0x58004000,
0xe000dc40,
0x58004000,
0x10011c40,
0x58004001,
0xc0109c40,
0x30044000,
0xf010dc40,
0x30064000,
0x20111c40,
0x30084001,
0xd0209c20,
0x50004000,
0x0030dc20,
0x50004001,
0x30411c20,
0x50004001,
0x10411c00,
0xc8000000,
0x10209c40,
0x58000000,
0x1030dc40,
0x58000000,
0x40201c40,
0x58004001,
0x50305c40,
0x58004001,
0x03f01c26,
0x0a7e0090,
0x00001de7,
0x80000000,
xf86-video-nouveau-1.0.16/src/shader/exacmnv110.fp 0000644 0001750 0001756 00000001540 13423754626 016370 0000000 0000000 #ifndef ENVYAS
static uint32_t
NV110FP_Composite[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exacmnv110.fpc"
};
#else
sched (st 0x0) (st 0x0) (st 0x0)
ipa pass $r0 a[0x7c] 0x0 0x0 0x1
mufu rcp $r0 $r0
ipa $r3 a[0x94] $r0 0x0 0x1
sched (st 0x0) (st 0x0) (st 0x0)
ipa $r2 a[0x90] $r0 0x0 0x1
tex nodep $r4 $r2 0x0 0x1 t2d 0x8
ipa $r1 a[0x84] $r0 0x0 0x1
sched (st 0x0) (st 0x0) (st 0x0)
ipa $r0 a[0x80] $r0 0x0 0x1
tex nodep $r0 $r0 0x0 0x0 t2d 0xf
depbar le 0x5 0x0 0x0
sched (st 0x0) (st 0x0) (st 0x0)
fmul ftz $r3 $r3 $r4
fmul ftz $r2 $r2 $r4
fmul ftz $r1 $r1 $r4
sched (st 0x0) (st 0x0) (st 0x0)
fmul ftz $r0 $r0 $r4
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exacanve0.fp 0000644 0001750 0001756 00000002353 13423754626 016362 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVE0FP_CAComposite[] = {
0x00021462, /* 0x0000c000 = USES_KIL, MULTI_COLORS */
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000, /* FRAG_COORD_UMASK = 0x8 */
0x00000a0a, /* FP_INTERP[0x080], 0022 0022 */
0x00000000, /* FP_INTERP[0x0c0], 0 = OFF */
0x00000000, /* FP_INTERP[0x100], 1 = FLAT */
0x00000000, /* FP_INTERP[0x140], 2 = PERSPECTIVE */
0x00000000, /* FP_INTERP[0x180], 3 = LINEAR */
0x00000000, /* FP_INTERP[0x1c0] */
0x00000000, /* FP_INTERP[0x200] */
0x00000000, /* FP_INTERP[0x240] */
0x00000000, /* FP_INTERP[0x280] */
0x00000000, /* FP_INTERP[0x2c0] */
0x00000000, /* FP_INTERP[0x300] */
0x00000000,
0x0000000f, /* FP_RESULT_MASK (0x8000 Face ?) */
0x00000000, /* 0x2 = FragDepth, 0x1 = SampleMask */
#include "exacanve0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x94] $r0 0x0
interp mul f32 $r2 a[0x90] $r0 0x0
tex t lauto live dfp $r4:$r5:$r6:$r7 t2d $t1 $s0 $r2:$r3 ()
interp mul f32 $r1 a[0x84] $r0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t0 $s0 $r0:$r1 ()
texbar 0x0
mul ftz rn f32 $r3 $r3 $r7
mul ftz rn f32 $r2 $r2 $r6
mul ftz rn f32 $r1 $r1 $r5
mul ftz rn f32 $r0 $r0 $r4
long exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exasanv110.fpc 0000644 0001750 0001756 00000000710 13423754626 016535 0000000 0000000 0xfc0007e0,
0x001f8000,
0xcff7ff00,
0xe003ff87,
0x00470000,
0x50800000,
0x4007ff03,
0xe043ff88,
0xfc0007e0,
0x001f8000,
0x0007ff02,
0xe043ff88,
0x2ff70204,
0xc03a0004,
0x4007ff01,
0xe043ff89,
0xfc0007e0,
0x001f8000,
0x0007ff00,
0xe043ff89,
0xaff70000,
0xc03a0017,
0x34070000,
0xf0f00000,
0xfc0007e0,
0x001f8000,
0x00470303,
0x5c681000,
0x00470202,
0x5c681000,
0x00470101,
0x5c681000,
0xfc0007e0,
0x001f8000,
0x00470000,
0x5c681000,
0x0007000f,
0xe3000000,
xf86-video-nouveau-1.0.16/src/shader/exasanvc0.fpc 0000644 0001750 0001756 00000000454 13423754626 016543 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f0dc40,
0xc07e0084,
0x03f09c40,
0xc07e0080,
0x00211e86,
0x80120000,
0x03f05c40,
0xc07e0094,
0x03f01c40,
0xc07e0090,
0x00001e86,
0x8013c001,
0x1030dc40,
0x58000000,
0x10209c40,
0x58000000,
0x10105c40,
0x58000000,
0x10001c40,
0x58000000,
0x88001dff,
xf86-video-nouveau-1.0.16/src/shader/exascnve0.fpc 0000644 0001750 0001756 00000000250 13423754626 016541 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f05c40,
0xc07e0084,
0x03f01c40,
0xc07e0080,
0x00001e86,
0x8013c000,
0x00001de6,
0xf0000000,
0x00001de7,
0x80000000,
xf86-video-nouveau-1.0.16/src/shader/exasanve0.fpc 0000644 0001750 0001756 00000000520 13423754626 016537 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f0dc40,
0xc07e0084,
0x03f09c40,
0xc07e0080,
0x00211e86,
0x80120000,
0x03f05c40,
0xc07e0094,
0x03f01c40,
0xc07e0090,
0x00001e86,
0x8013c001,
0x00001de6,
0xf0000000,
0x1030dc40,
0x58000000,
0x10209c40,
0x58000000,
0x10105c40,
0x58000000,
0x10001c40,
0x58000000,
0x00001de7,
0x80000000,
xf86-video-nouveau-1.0.16/src/shader/exascnvc0.fpc 0000644 0001750 0001756 00000000204 13423754626 016536 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f05c40,
0xc07e0084,
0x03f01c40,
0xc07e0080,
0x00001e86,
0x8013c000,
0x88001dff,
xf86-video-nouveau-1.0.16/src/shader/exacanvf0.fp 0000644 0001750 0001756 00000002404 13423754626 016360 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVF0FP_CAComposite[] = {
0x00001462, /* 0x0000c000 = USES_KIL, MULTI_COLORS */
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000, /* FRAG_COORD_UMASK = 0x8 */
0x00000a0a, /* FP_INTERP[0x080], 0022 0022 */
0x00000000, /* FP_INTERP[0x0c0], 0 = OFF */
0x00000000, /* FP_INTERP[0x100], 1 = FLAT */
0x00000000, /* FP_INTERP[0x140], 2 = PERSPECTIVE */
0x00000000, /* FP_INTERP[0x180], 3 = LINEAR */
0x00000000, /* FP_INTERP[0x1c0] */
0x00000000, /* FP_INTERP[0x200] */
0x00000000, /* FP_INTERP[0x240] */
0x00000000, /* FP_INTERP[0x280] */
0x00000000, /* FP_INTERP[0x2c0] */
0x00000000, /* FP_INTERP[0x300] */
0x00000000,
0x0000000f, /* FP_RESULT_MASK (0x8000 Face ?) */
0x00000000, /* 0x2 = FragDepth, 0x1 = SampleMask */
#include "exacanvf0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x94] $r0 0x0 0x0
interp mul f32 $r2 a[0x90] $r0 0x0 0x0
tex t lauto live dfp $r4:$r5:$r6:$r7 t2d c[0x4] xy__ $r2:$r3 0x0
interp mul f32 $r1 a[0x84] $r0 0x0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d c[0x0] xy__ $r0:$r1 0x0
texbar 0x0
mul ftz rn f32 $r3 $r3 $r7
mul ftz rn f32 $r2 $r2 $r6
mul ftz rn f32 $r1 $r1 $r5
mul ftz rn f32 $r0 $r0 $r4
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exas8nve0.fp 0000644 0001750 0001756 00000001150 13423754626 016323 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVE0FP_Source_A8[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x0000000a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exas8nve0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r1 a[0x84] $r0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0
tex t lauto live dfp #:#:#:$r0 t2d $t0 $s0 $r0:$r1 ()
texbar 0x0
long mov b32 $r3 $r0
long mov b32 $r2 $r0
long mov b32 $r1 $r0
long exit
#endif
xf86-video-nouveau-1.0.16/src/shader/xfrm2nv110.vp 0000644 0001750 0001756 00000003605 13423754626 016355 0000000 0000000 #ifndef ENVYAS
static uint32_t
NV110VP_Transform2[] = {
0x02000461,
0x00000000,
0x00000000,
0x00000000,
0x000ff000,
0x00000000, /* VP_ATTR_EN[0x000] */
0x00000000, /* VP_ATTR_EN[0x080] */
0x00000000, /* VP_ATTR_EN[0x100] */
0x00000000,
0x00000000, /* VP_ATTR_EN[0x200] */
0x80000000, /* VERTEXID */
0x00000000, /* VP_ATTR_EN[0x300] */
0x00000000,
0x0033f000, /* VP_EXPORT_EN[0x040] */
0x00000000, /* VP_EXPORT_EN[0x0c0] */
0x00000000,
0x00000000,
0x00000000,
0x00000000, /* VP_EXPORT_EN[0x2c0] */
0x00000000,
#include "xfrm2nv110.vpc"
};
#else
sched (st 0x0) (st 0x0) (st 0x0)
ld b32 $r5 a[0x2fc] 0x0
shl $r5 $r5 0x5
ld b64 $r0 c0[$r5+0x80]
sched (st 0x0) (st 0x0) (st 0x0)
ld b64 $r2 c0[$r5+0x88]
st b128 a[0x70] $r0 0x0
ld b64 $r0 c0[$r5+0x90]
sched (st 0x0) (st 0x0) (st 0x0)
fmul ftz $r2 $r0 c0[0x0]
fmul ftz $r3 $r0 c0[0xc]
fmul ftz $r4 $r0 c0[0x18]
sched (st 0x0) (st 0x0) (st 0x0)
ffma ftz $r2 $r1 c0[0x4] $r2
ffma ftz $r3 $r1 c0[0x10] $r3
ffma ftz $r4 $r1 c0[0x1c] $r4
sched (st 0x0) (st 0x0) (st 0x0)
fadd ftz $r2 $r2 c0[0x8]
fadd ftz $r3 $r3 c0[0x14]
fadd ftz $r4 $r4 c0[0x20]
sched (st 0x0) (st 0x0) (st 0x0)
mufu rcp $r4 $r4
fmul ftz $r2 $r2 $r4
fmul ftz $r3 $r3 $r4
sched (st 0x0) (st 0x0) (st 0x0)
fmul ftz $r0 $r2 c0[0x24]
fmul ftz $r1 $r3 c0[0x28]
st b64 a[0x80] $r0 0x0
sched (st 0x0) (st 0x0) (st 0x0)
ld b64 $r0 c0[$r5+0x98]
fmul ftz $r2 $r0 c0[0x2c]
fmul ftz $r3 $r0 c0[0x38]
sched (st 0x0) (st 0x0) (st 0x0)
fmul ftz $r4 $r0 c0[0x44]
ffma ftz $r2 $r1 c0[0x30] $r2
ffma ftz $r3 $r1 c0[0x3c] $r3
sched (st 0x0) (st 0x0) (st 0x0)
ffma ftz $r4 $r1 c0[0x48] $r4
fadd ftz $r2 $r2 c0[0x34]
fadd ftz $r3 $r3 c0[0x40]
sched (st 0x0) (st 0x0) (st 0x0)
fadd ftz $r4 $r4 c0[0x4c]
mufu rcp $r4 $r4
fmul ftz $r2 $r2 $r4
sched (st 0x0) (st 0x0) (st 0x0)
fmul ftz $r3 $r3 $r4
fmul ftz $r0 $r2 c0[0x50]
fmul ftz $r1 $r3 c0[0x54]
sched (st 0x0) (st 0x0) (st 0x0)
st b64 a[0x90] $r0 0x0
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exacanve0.fpc 0000644 0001750 0001756 00000000520 13423754626 016517 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f0dc40,
0xc07e0094,
0x03f09c40,
0xc07e0090,
0x00211e86,
0x8013c001,
0x03f05c40,
0xc07e0084,
0x03f01c40,
0xc07e0080,
0x00001e86,
0x8013c000,
0x00001de6,
0xf0000000,
0x1c30dc40,
0x58000000,
0x18209c40,
0x58000000,
0x14105c40,
0x58000000,
0x10001c40,
0x58000000,
0x00001de7,
0x80000000,
xf86-video-nouveau-1.0.16/src/shader/exasanvf0.fp 0000644 0001750 0001756 00000001472 13423754626 016404 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVF0FP_CACompositeSrcAlpha[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exasanvf0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x84] $r0 0x0 0x0
interp mul f32 $r2 a[0x80] $r0 0x0 0x0
tex t lauto live dfp #:#:#:$r4 t2d c[0x0] xy__ $r2:$r3 0x0
interp mul f32 $r1 a[0x94] $r0 0x0 0x0
interp mul f32 $r0 a[0x90] $r0 0x0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d c[0x4] xy__ $r0:$r1 0x0
texbar 0x0
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r1 $r1 $r4
mul ftz rn f32 $r0 $r0 $r4
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/videonvc0.fp 0000644 0001750 0001756 00000001746 13423754626 016412 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVC0FP_NV12[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "videonvc0.fpc"
};
#else
interp pass f32 $r2 a[0x7c] 0x0 0x0
rcp f32 $r2 $r2
interp mul f32 $r0 a[0x80] $r2 0x0
interp mul f32 $r1 a[0x84] $r2 0x0
tex t lauto live dfp #:#:#:$r0 t2d $t0 $s0 $r0:$r1 ()
mul ftz rn f32 $r5 $r0 c0[0x0]
add ftz rn f32 $r3 $r5 c0[0x4]
add ftz rn f32 $r4 $r5 c0[0x8]
add ftz rn f32 $r5 $r5 c0[0xc]
interp mul f32 $r0 a[0x80] $r2 0x0
interp mul f32 $r1 a[0x84] $r2 0x0
tex t lauto live dfp #:#:$r0:$r1 t2d $t1 $s0 $r0:$r1 ()
fma ftz rn f32 $r3 $r0 c0[0x10] $r3
fma ftz rn f32 $r4 $r0 c0[0x14] $r4
fma ftz rn f32 $r5 $r0 c0[0x18] $r5
fma ftz rn f32 $r0 $r1 c0[0x1c] $r3
fma ftz rn f32 $r2 $r1 c0[0x24] $r5
fma ftz rn f32 $r1 $r1 c0[0x20] $r4
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exac8nv110.fpc 0000644 0001750 0001756 00000000710 13423754626 016444 0000000 0000000 0xfc0007e0,
0x001f8000,
0xcff7ff00,
0xe003ff87,
0x00470000,
0x50800000,
0x4007ff03,
0xe043ff89,
0xfc0007e0,
0x001f8000,
0x0007ff02,
0xe043ff89,
0x2ff70201,
0xc03a0014,
0x4007ff03,
0xe043ff88,
0xfc0007e0,
0x001f8000,
0x0007ff02,
0xe043ff88,
0x2ff70200,
0xc03a0004,
0x34070000,
0xf0f00000,
0xfc0007e0,
0x001f8000,
0x00170003,
0x5c681000,
0x00370002,
0x5c980780,
0x00370001,
0x5c980780,
0xfc0007e0,
0x001f8000,
0x00370000,
0x5c980780,
0x0007000f,
0xe3000000,
xf86-video-nouveau-1.0.16/src/shader/exacanv110.fp 0000644 0001750 0001756 00000002456 13423754626 016363 0000000 0000000 #ifndef ENVYAS
static uint32_t
NV110FP_CAComposite[] = {
0x00001462, /* 0x0000c000 = USES_KIL, MULTI_COLORS */
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000, /* FRAG_COORD_UMASK = 0x8 */
0x00000a0a, /* FP_INTERP[0x080], 0022 0022 */
0x00000000, /* FP_INTERP[0x0c0], 0 = OFF */
0x00000000, /* FP_INTERP[0x100], 1 = FLAT */
0x00000000, /* FP_INTERP[0x140], 2 = PERSPECTIVE */
0x00000000, /* FP_INTERP[0x180], 3 = LINEAR */
0x00000000, /* FP_INTERP[0x1c0] */
0x00000000, /* FP_INTERP[0x200] */
0x00000000, /* FP_INTERP[0x240] */
0x00000000, /* FP_INTERP[0x280] */
0x00000000, /* FP_INTERP[0x2c0] */
0x00000000, /* FP_INTERP[0x300] */
0x00000000,
0x0000000f, /* FP_RESULT_MASK (0x8000 Face ?) */
0x00000000, /* 0x2 = FragDepth, 0x1 = SampleMask */
#include "exacanv110.fpc"
};
#else
sched (st 0x0) (st 0x0) (st 0x0)
ipa pass $r0 a[0x7c] 0x0 0x0 0x1
mufu rcp $r0 $r0
ipa $r3 a[0x94] $r0 0x0 0x1
sched (st 0x0) (st 0x0) (st 0x0)
ipa $r2 a[0x90] $r0 0x0 0x1
tex nodep $r4 $r2 0x0 0x1 t2d 0xf
ipa $r1 a[0x84] $r0 0x0 0x1
sched (st 0x0) (st 0x0) (st 0x0)
ipa $r0 a[0x80] $r0 0x0 0x1
tex nodep $r0 $r0 0x0 0x0 t2d 0xf
depbar le 0x5 0x0 0x0
sched (st 0x0) (st 0x0) (st 0x0)
fmul ftz $r3 $r3 $r7
fmul ftz $r2 $r2 $r6
fmul ftz $r1 $r1 $r5
sched (st 0x0) (st 0x0) (st 0x0)
fmul ftz $r0 $r0 $r4
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/videonve0.fp 0000644 0001750 0001756 00000002060 13423754626 016402 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVE0FP_NV12[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x0000000a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "videonve0.fpc"
};
#else
sched 0x2e 0x28 0x23 0x2e 0x20 0x20 0xc2
interp pass f32 $r2 a[0x7c] 0x0 0x0
rcp f32 $r2 $r2
interp mul f32 $r0 a[0x80] $r2 0x0
interp mul f32 $r1 a[0x84] $r2 0x0
tex t lauto live dfp #:#:#:$r4 t2d $t0 $s0 $r0:$r1 ()
tex p lauto live dfp #:#:$r0:$r1 t2d $t1 $s0 $r0:$r1 ()
texbar 0x1
sched 0x28 0x4 0x20 0x20 0xa2 0x4 0x20
mul ftz rn f32 $r5 $r4 c0[0x0]
add ftz rn f32 $r3 $r5 c0[0x4]
add ftz rn f32 $r4 $r5 c0[0x8]
add ftz rn f32 $r5 $r5 c0[0xc]
texbar 0x0
fma ftz rn f32 $r3 $r0 c0[0x10] $r3
fma ftz rn f32 $r4 $r0 c0[0x14] $r4
sched 0x28 0x4 0x20 0x4 0x2e 0x0 0x0
fma ftz rn f32 $r5 $r0 c0[0x18] $r5
fma ftz rn f32 $r0 $r1 c0[0x1c] $r3
fma ftz rn f32 $r2 $r1 c0[0x24] $r5
fma ftz rn f32 $r1 $r1 c0[0x20] $r4
long exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exas8nvf0.fp 0000644 0001750 0001756 00000001145 13423754626 016330 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVF0FP_Source_A8[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x0000000a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exas8nvf0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r1 a[0x84] $r0 0x0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0 0x0
tex t lauto live dfp #:#:#:$r0 t2d c[0x0] xy__ $r0:$r1 0x0
texbar 0x0
mov b32 $r3 $r0
mov b32 $r2 $r0
mov b32 $r1 $r0
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exascnv110.fpc 0000644 0001750 0001756 00000000360 13423754626 016540 0000000 0000000 0xfc0007e0,
0x001f8000,
0xcff7ff00,
0xe003ff87,
0x00470000,
0x50800000,
0x4007ff01,
0xe043ff88,
0xfc0007e0,
0x001f8000,
0x0007ff00,
0xe043ff88,
0xaff70000,
0xc03a0007,
0x34070000,
0xf0f00000,
0xfc0007e0,
0x001f8000,
0x0007000f,
0xe3000000,
xf86-video-nouveau-1.0.16/src/shader/exacmnve0.fpc 0000644 0001750 0001756 00000000520 13423754626 016533 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f0dc40,
0xc07e0094,
0x03f09c40,
0xc07e0090,
0x00211e86,
0x80120001,
0x03f05c40,
0xc07e0084,
0x03f01c40,
0xc07e0080,
0x00001e86,
0x8013c000,
0x00001de6,
0xf0000000,
0x1030dc40,
0x58000000,
0x10209c40,
0x58000000,
0x10105c40,
0x58000000,
0x10001c40,
0x58000000,
0x00001de7,
0x80000000,
xf86-video-nouveau-1.0.16/src/shader/exascnv110.fp 0000644 0001750 0001756 00000001155 13423754626 016400 0000000 0000000 #ifndef ENVYAS
static uint32_t
NV110FP_Source[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x0000000a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exascnv110.fpc"
};
#else
sched (st 0x0) (st 0x0) (st 0x0)
ipa pass $r0 a[0x7c] 0x0 0x0 0x1
mufu rcp $r0 $r0
ipa $r1 a[0x84] $r0 0x0 0x1
sched (st 0x0) (st 0x0) (st 0x0)
ipa $r0 a[0x80] $r0 0x0 0x1
tex nodep $r0 $r0 0x0 0x0 t2d 0xf
depbar le 0x5 0x0 0x0
sched (st 0x0) (st 0x0) (st 0x0)
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exascnvc0.fp 0000644 0001750 0001756 00000001034 13423754626 016375 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVC0FP_Source[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x0000000a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exascnvc0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r1 a[0x84] $r0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t0 $s0 $r0:$r1 ()
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exacmnvc0.fp 0000644 0001750 0001756 00000001407 13423754626 016373 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVC0FP_Composite[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exacmnvc0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x94] $r0 0x0
interp mul f32 $r2 a[0x90] $r0 0x0
tex t lauto live dfp #:#:#:$r4 t2d $t1 $s0 $r2:$r3 ()
interp mul f32 $r1 a[0x84] $r0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t0 $s0 $r0:$r1 ()
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r1 $r1 $r4
mul ftz rn f32 $r0 $r0 $r4
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/videonvf0.fpc 0000644 0001750 0001756 00000000710 13423754626 016546 0000000 0000000 0x7f9ffc0a,
0x7483fc3e,
0x021c080a,
0x84000000,
0x011ffc02,
0x74a3fc40,
0x011ffc06,
0x74a3fc42,
0xff9c0011,
0x600000a1,
0xff9c0001,
0x600080b2,
0x009c0002,
0x77000000,
0x001c1016,
0x63408000,
0x009c140e,
0x62c08000,
0x011c1412,
0x62c08000,
0x019c1416,
0x62c08000,
0x001c0002,
0x77000000,
0x021c000e,
0x4d000c00,
0x029c0012,
0x4d001000,
0x031c0016,
0x4d001400,
0x039c0402,
0x4d000c00,
0x049c040a,
0x4d001400,
0x041c0406,
0x4d001000,
0x001c003c,
0x18000000,
xf86-video-nouveau-1.0.16/src/shader/videonvf0.fp 0000644 0001750 0001756 00000001714 13423754626 016410 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVF0FP_NV12[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x0000000a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "videonvf0.fpc"
};
#else
interp pass f32 $r2 a[0x7c] 0x0 0x0 0x0
rcp f32 $r2 $r2
interp mul f32 $r0 a[0x80] $r2 0x0 0x0
interp mul f32 $r1 a[0x84] $r2 0x0 0x0
tex t lauto live dfp #:#:#:$r4 t2d c[0x0] xy__ $r0:$r1 0x0
tex p lauto live dfp #:#:$r0:$r1 t2d c[0x4] xy__ $r0:$r1 0x0
texbar 0x1
mul ftz rn f32 $r5 $r4 c0[0x0]
add ftz rn f32 $r3 $r5 c0[0x4]
add ftz rn f32 $r4 $r5 c0[0x8]
add ftz rn f32 $r5 $r5 c0[0xc]
texbar 0x0
fma ftz rn f32 $r3 $r0 c0[0x10] $r3
fma ftz rn f32 $r4 $r0 c0[0x14] $r4
fma ftz rn f32 $r5 $r0 c0[0x18] $r5
fma ftz rn f32 $r0 $r1 c0[0x1c] $r3
fma ftz rn f32 $r2 $r1 c0[0x24] $r5
fma ftz rn f32 $r1 $r1 c0[0x20] $r4
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exacmnvc0.fpc 0000644 0001750 0001756 00000000454 13423754626 016537 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f0dc40,
0xc07e0094,
0x03f09c40,
0xc07e0090,
0x00211e86,
0x80120001,
0x03f05c40,
0xc07e0084,
0x03f01c40,
0xc07e0080,
0x00001e86,
0x8013c000,
0x1030dc40,
0x58000000,
0x10209c40,
0x58000000,
0x10105c40,
0x58000000,
0x10001c40,
0x58000000,
0x88001dff,
xf86-video-nouveau-1.0.16/src/shader/exacanvc0.fpc 0000644 0001750 0001756 00000000454 13423754626 016523 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f0dc40,
0xc07e0094,
0x03f09c40,
0xc07e0090,
0x00211e86,
0x8013c001,
0x03f05c40,
0xc07e0084,
0x03f01c40,
0xc07e0080,
0x00001e86,
0x8013c000,
0x1c30dc40,
0x58000000,
0x18209c40,
0x58000000,
0x14105c40,
0x58000000,
0x10001c40,
0x58000000,
0x88001dff,
xf86-video-nouveau-1.0.16/src/shader/exasanvf0.fpc 0000644 0001750 0001756 00000000520 13423754626 016540 0000000 0000000 0x7f9ffc02,
0x7483fc3e,
0x021c0002,
0x84000000,
0x001ffc0e,
0x74a3fc42,
0x001ffc0a,
0x74a3fc40,
0xff9c0811,
0x600000a1,
0x001ffc06,
0x74a3fc4a,
0x001ffc02,
0x74a3fc48,
0xff9c0001,
0x600080bd,
0x001c0002,
0x77000000,
0x021c0c0e,
0xe3408000,
0x021c080a,
0xe3408000,
0x021c0406,
0xe3408000,
0x021c0002,
0xe3408000,
0x001c003c,
0x18000000,
xf86-video-nouveau-1.0.16/src/shader/exac8nve0.fp 0000644 0001750 0001756 00000001402 13423754626 016303 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVE0FP_Composite_A8[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exac8nve0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x94] $r0 0x0
interp mul f32 $r2 a[0x90] $r0 0x0
tex t lauto live dfp #:#:#:$r1 t2d $t1 $s0 $r2:$r3 ()
interp mul f32 $r3 a[0x84] $r0 0x0
interp mul f32 $r2 a[0x80] $r0 0x0
tex t lauto live dfp #:#:#:$r0 t2d $t0 $s0 $r2:$r3 ()
texbar 0x0
mul ftz rn f32 $r3 $r0 $r1
long mov b32 $r2 $r3
long mov b32 $r1 $r3
long mov b32 $r0 $r3
long exit
#endif
xf86-video-nouveau-1.0.16/src/shader/videonve0.fpc 0000644 0001750 0001756 00000001020 13423754626 016540 0000000 0000000 0xe23282e7,
0x2c220202,
0xfff09c00,
0xc07e007c,
0x10209c00,
0xc8000000,
0x0bf01c40,
0xc07e0080,
0x0bf05c40,
0xc07e0084,
0x00011e86,
0x80120000,
0x00001f06,
0x80130001,
0x04001de6,
0xf0000000,
0x02004287,
0x22004a22,
0x00415c40,
0x58004000,
0x1050dc20,
0x50004000,
0x20511c20,
0x50004000,
0x30515c20,
0x50004000,
0x00001de6,
0xf0000000,
0x4000dc40,
0x30064000,
0x50011c40,
0x30084000,
0x42004287,
0x200002e0,
0x60015c40,
0x300a4000,
0x70101c40,
0x30064000,
0x90109c40,
0x300a4000,
0x80105c40,
0x30084000,
0x00001de7,
0x80000000,
xf86-video-nouveau-1.0.16/src/shader/exasanve0.fp 0000644 0001750 0001756 00000001441 13423754626 016377 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVE0FP_CACompositeSrcAlpha[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exasanve0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x84] $r0 0x0
interp mul f32 $r2 a[0x80] $r0 0x0
tex t lauto live dfp #:#:#:$r4 t2d $t0 $s0 $r2:$r3 ()
interp mul f32 $r1 a[0x94] $r0 0x0
interp mul f32 $r0 a[0x90] $r0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t1 $s0 $r0:$r1 ()
texbar 0x0
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r1 $r1 $r4
mul ftz rn f32 $r0 $r0 $r4
long exit
#endif
xf86-video-nouveau-1.0.16/src/shader/videonv110.fpc 0000644 0001750 0001756 00000001160 13423754626 016542 0000000 0000000 0xfc0007e0,
0x001f8000,
0xcff7ff02,
0xe003ff87,
0x00470202,
0x50800000,
0x0027ff00,
0xe043ff88,
0xfc0007e0,
0x001f8000,
0x4027ff01,
0xe043ff88,
0x2ff70004,
0xc03a0004,
0x2ff70000,
0xc03a0016,
0xfc0007e0,
0x001f8000,
0x34170001,
0xf0f00000,
0x00070405,
0x4c681000,
0x00170503,
0x4c581000,
0xfc0007e0,
0x001f8000,
0x00270504,
0x4c581000,
0x00370505,
0x4c581000,
0x34070000,
0xf0f00000,
0xfc0007e0,
0x001f8000,
0x00470003,
0x49a00180,
0x00570004,
0x49a00200,
0x00670005,
0x49a00280,
0xfc0007e0,
0x001f8000,
0x00770100,
0x49a00180,
0x00970102,
0x49a00280,
0x00870101,
0x49a00200,
0xfc0007e0,
0x001f8000,
0x0007000f,
0xe3000000,
xf86-video-nouveau-1.0.16/src/shader/exac8nvc0.fpc 0000644 0001750 0001756 00000000410 13423754626 016442 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f0dc40,
0xc07e0094,
0x03f09c40,
0xc07e0090,
0x00205e86,
0x80120001,
0x03f0dc40,
0xc07e0084,
0x03f09c40,
0xc07e0080,
0x00201e86,
0x80120000,
0x0400dc40,
0x58000000,
0x00309c28,
0x00305c28,
0x00301c28,
0x88001dff,
xf86-video-nouveau-1.0.16/src/shader/exacanv110.fpc 0000644 0001750 0001756 00000000710 13423754626 016515 0000000 0000000 0xfc0007e0,
0x001f8000,
0xcff7ff00,
0xe003ff87,
0x00470000,
0x50800000,
0x4007ff03,
0xe043ff89,
0xfc0007e0,
0x001f8000,
0x0007ff02,
0xe043ff89,
0xaff70204,
0xc03a0017,
0x4007ff01,
0xe043ff88,
0xfc0007e0,
0x001f8000,
0x0007ff00,
0xe043ff88,
0xaff70000,
0xc03a0007,
0x34070000,
0xf0f00000,
0xfc0007e0,
0x001f8000,
0x00770303,
0x5c681000,
0x00670202,
0x5c681000,
0x00570101,
0x5c681000,
0xfc0007e0,
0x001f8000,
0x00470000,
0x5c681000,
0x0007000f,
0xe3000000,
xf86-video-nouveau-1.0.16/src/shader/exacmnvf0.fp 0000644 0001750 0001756 00000001460 13423754626 016375 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVF0FP_Composite[] = {
0x00001462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exacmnvf0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x94] $r0 0x0 0x0
interp mul f32 $r2 a[0x90] $r0 0x0 0x0
tex t lauto live dfp #:#:#:$r4 t2d c[0x4] xy__ $r2:$r3 0x0
interp mul f32 $r1 a[0x84] $r0 0x0 0x0
interp mul f32 $r0 a[0x80] $r0 0x0 0x0
tex t lauto live dfp $r0:$r1:$r2:$r3 t2d c[0x0] xy__ $r0:$r1 0x0
texbar 0x0
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r1 $r1 $r4
mul ftz rn f32 $r0 $r0 $r4
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exacmnv110.fpc 0000644 0001750 0001756 00000000710 13423754626 016531 0000000 0000000 0xfc0007e0,
0x001f8000,
0xcff7ff00,
0xe003ff87,
0x00470000,
0x50800000,
0x4007ff03,
0xe043ff89,
0xfc0007e0,
0x001f8000,
0x0007ff02,
0xe043ff89,
0x2ff70204,
0xc03a0014,
0x4007ff01,
0xe043ff88,
0xfc0007e0,
0x001f8000,
0x0007ff00,
0xe043ff88,
0xaff70000,
0xc03a0007,
0x34070000,
0xf0f00000,
0xfc0007e0,
0x001f8000,
0x00470303,
0x5c681000,
0x00470202,
0x5c681000,
0x00470101,
0x5c681000,
0xfc0007e0,
0x001f8000,
0x00470000,
0x5c681000,
0x0007000f,
0xe3000000,
xf86-video-nouveau-1.0.16/src/shader/exas8nvc0.fpc 0000644 0001750 0001756 00000000250 13423754626 016464 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f05c40,
0xc07e0084,
0x03f01c40,
0xc07e0080,
0x00001e86,
0x80120000,
0x0000dc28,
0x00009c28,
0x00005c28,
0x88001dff,
xf86-video-nouveau-1.0.16/src/shader/xfrm2nve0.vp 0000644 0001750 0001756 00000003155 13423754626 016360 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVE0VP_Transform2[] = {
0x00020461,
0x00000000,
0x00000000,
0x00000000,
0x000ff000,
0x00000000, /* VP_ATTR_EN[0x000] */
0x0001033f, /* VP_ATTR_EN[0x080] */
0x00000000, /* VP_ATTR_EN[0x100] */
0x00000000,
0x00000000, /* VP_ATTR_EN[0x200] */
0x00000000,
0x00000000, /* VP_ATTR_EN[0x300] */
0x00000000,
0x0033f000, /* VP_EXPORT_EN[0x040] */
0x00000000, /* VP_EXPORT_EN[0x0c0] */
0x00000000,
0x00000000,
0x00000000,
0x00000000, /* VP_EXPORT_EN[0x2c0] */
0x00000000,
#include "xfrm2nve0.vpc"
};
#else
ld b128 $r0:$r1:$r2:$r3 a[0x80] 0x0 unk39
st b128 a[0x70] $r0:$r1:$r2:$r3 0x0 unk39
ld b64 $r0:$r1 a[0x90] 0x0 unk39
mul ftz rn f32 $r2 $r0 c0[0x0]
mul ftz rn f32 $r3 $r0 c0[0xc]
mul ftz rn f32 $r4 $r0 c0[0x18]
fma ftz rn f32 $r2 $r1 c0[0x4] $r2
fma ftz rn f32 $r3 $r1 c0[0x10] $r3
fma ftz rn f32 $r4 $r1 c0[0x1c] $r4
add ftz rn f32 $r2 $r2 c0[0x8]
add ftz rn f32 $r3 $r3 c0[0x14]
add ftz rn f32 $r4 $r4 c0[0x20]
rcp f32 $r4 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r0 $r2 c0[0x24]
mul ftz rn f32 $r1 $r3 c0[0x28]
st b64 a[0x80] $r0:$r1 0x0 unk39
ld b64 $r0:$r1 a[0xa0] 0x0 unk39
mul ftz rn f32 $r2 $r0 c0[0x2c]
mul ftz rn f32 $r3 $r0 c0[0x38]
mul ftz rn f32 $r4 $r0 c0[0x44]
fma ftz rn f32 $r2 $r1 c0[0x30] $r2
fma ftz rn f32 $r3 $r1 c0[0x3c] $r3
fma ftz rn f32 $r4 $r1 c0[0x48] $r4
add ftz rn f32 $r2 $r2 c0[0x34]
add ftz rn f32 $r3 $r3 c0[0x40]
add ftz rn f32 $r4 $r4 c0[0x4c]
rcp f32 $r4 $r4
mul ftz rn f32 $r2 $r2 $r4
mul ftz rn f32 $r3 $r3 $r4
mul ftz rn f32 $r0 $r2 c0[0x50]
mul ftz rn f32 $r1 $r3 c0[0x54]
st b64 a[0x90] $r0:$r1 0x0 unk39
long exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exac8nvc0.fp 0000644 0001750 0001756 00000001343 13423754626 016305 0000000 0000000 #ifndef ENVYAS
static uint32_t
NVC0FP_Composite_A8[] = {
0x00021462,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x80000000,
0x00000a0a,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x0000000f,
0x00000000,
#include "exac8nvc0.fpc"
};
#else
interp pass f32 $r0 a[0x7c] 0x0 0x0
rcp f32 $r0 $r0
interp mul f32 $r3 a[0x94] $r0 0x0
interp mul f32 $r2 a[0x90] $r0 0x0
tex t lauto live dfp #:#:#:$r1 t2d $t1 $s0 $r2:$r3 ()
interp mul f32 $r3 a[0x84] $r0 0x0
interp mul f32 $r2 a[0x80] $r0 0x0
tex t lauto live dfp #:#:#:$r0 t2d $t0 $s0 $r2:$r3 ()
mul ftz rn f32 $r3 $r0 $r1
mov b32 $r2 $r3
mov b32 $r1 $r3
mov b32 $r0 $r3
exit
#endif
xf86-video-nouveau-1.0.16/src/shader/exas8nvf0.fpc 0000644 0001750 0001756 00000000360 13423754626 016471 0000000 0000000 0x7f9ffc02,
0x7483fc3e,
0x021c0002,
0x84000000,
0x001ffc06,
0x74a3fc42,
0x001ffc02,
0x74a3fc40,
0xff9c0001,
0x600000a1,
0x001c0002,
0x77000000,
0x001c000e,
0xe4c03c00,
0x001c000a,
0xe4c03c00,
0x001c0006,
0xe4c03c00,
0x001c003c,
0x18000000,
xf86-video-nouveau-1.0.16/src/shader/exac8nve0.fpc 0000644 0001750 0001756 00000000520 13423754626 016446 0000000 0000000 0xfff01c00,
0xc07e007c,
0x10001c00,
0xc8000000,
0x03f0dc40,
0xc07e0094,
0x03f09c40,
0xc07e0090,
0x00205e86,
0x80120001,
0x03f0dc40,
0xc07e0084,
0x03f09c40,
0xc07e0080,
0x00201e86,
0x80120000,
0x00001de6,
0xf0000000,
0x0400dc40,
0x58000000,
0x0c009de4,
0x28000000,
0x0c005de4,
0x28000000,
0x0c001de4,
0x28000000,
0x00001de7,
0x80000000,
xf86-video-nouveau-1.0.16/src/shader/exac8nvf0.fpc 0000644 0001750 0001756 00000000520 13423754626 016447 0000000 0000000 0x7f9ffc02,
0x7483fc3e,
0x021c0002,
0x84000000,
0x001ffc0e,
0x74a3fc4a,
0x001ffc0a,
0x74a3fc48,
0xff9c0805,
0x600080a1,
0x001ffc0e,
0x74a3fc42,
0x001ffc0a,
0x74a3fc40,
0xff9c0801,
0x600000a1,
0x001c0002,
0x77000000,
0x009c000e,
0xe3408000,
0x019c000a,
0xe4c03c00,
0x019c0006,
0xe4c03c00,
0x019c0002,
0xe4c03c00,
0x001c003c,
0x18000000,
xf86-video-nouveau-1.0.16/src/nv_const.h 0000644 0001750 0001756 00000002727 13423754626 014722 0000000 0000000 #ifndef __NV_CONST_H__
#define __NV_CONST_H__
#define NV_VERSION 4000
#define NV_NAME "NOUVEAU"
#define NV_DRIVER_NAME "nouveau"
typedef enum {
OPTION_SW_CURSOR,
OPTION_HW_CURSOR,
OPTION_NOACCEL,
OPTION_SHADOW_FB,
OPTION_VIDEO_KEY,
OPTION_WFB,
OPTION_GLX_VBLANK,
OPTION_ZAPHOD_HEADS,
OPTION_PAGE_FLIP,
OPTION_SWAP_LIMIT,
OPTION_ASYNC_COPY,
OPTION_ACCELMETHOD,
OPTION_DRI,
} NVOpts;
static const OptionInfoRec NVOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE },
{ OPTION_WFB, "WrappedFB", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_GLX_VBLANK, "GLXVBlank", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE },
{ OPTION_PAGE_FLIP, "PageFlip", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SWAP_LIMIT, "SwapLimit", OPTV_INTEGER, {0}, FALSE },
{ OPTION_ASYNC_COPY, "AsyncUTSDFS", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_ACCELMETHOD, "AccelMethod", OPTV_STRING, {0}, FALSE },
{ OPTION_DRI, "DRI", OPTV_INTEGER, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
#endif /* __NV_CONST_H__ */
xf86-video-nouveau-1.0.16/src/nv50_accel.c 0000644 0001750 0001756 00000043725 13423754626 015006 0000000 0000000 /*
* Copyright 2008 Ben Skeggs
*
* 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.
*/
#include "nv_include.h"
#include "nv50_accel.h"
#include "hwdefs/nv_object.xml.h"
#include "hwdefs/nv50_2d.xml.h"
#include "hwdefs/nv50_3d.xml.h"
void
NV50SyncToVBlank(PixmapPtr ppix, BoxPtr box)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
int head;
xf86CrtcPtr crtc;
if (!nouveau_exa_pixmap_is_onscreen(ppix))
return;
crtc = nouveau_pick_best_crtc(pScrn, FALSE, box->x1, box->y1,
box->x2 - box->x1,
box->y2 - box->y1);
if (!crtc)
return;
if (!PUSH_SPACE(push, 10))
return;
head = drmmode_head(crtc);
BEGIN_NV04(push, SUBC_NVSW(0x0060), 2);
PUSH_DATA (push, pNv->vblank_sem->handle);
PUSH_DATA (push, 0);
BEGIN_NV04(push, SUBC_NVSW(0x006c), 1);
PUSH_DATA (push, 0x22222222);
BEGIN_NV04(push, SUBC_NVSW(0x0404), 2);
PUSH_DATA (push, 0x11111111);
PUSH_DATA (push, head);
BEGIN_NV04(push, SUBC_NVSW(0x0068), 1);
PUSH_DATA (push, 0x11111111);
}
Bool
NVAccelInitM2MF_NV50(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nv04_fifo *fifo = pNv->channel->data;
if (nouveau_object_new(pNv->channel, NvMemFormat, NV50_M2MF_CLASS,
NULL, 0, &pNv->NvMemFormat))
return FALSE;
if (!PUSH_SPACE(push, 8))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(M2MF, OBJECT), 1);
PUSH_DATA (push, pNv->NvMemFormat->handle);
BEGIN_NV04(push, NV03_M2MF(DMA_NOTIFY), 1);
PUSH_DATA (push, pNv->notify0->handle);
BEGIN_NV04(push, NV03_M2MF(DMA_BUFFER_IN), 2);
PUSH_DATA (push, fifo->vram);
PUSH_DATA (push, fifo->vram);
return TRUE;
}
Bool
NVAccelInit2D_NV50(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nv04_fifo *fifo = pNv->channel->data;
if (nouveau_object_new(pNv->channel, Nv2D, NV50_2D_CLASS,
NULL, 0, &pNv->Nv2D))
return FALSE;
if (!PUSH_SPACE(push, 64))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(2D, OBJECT), 1);
PUSH_DATA (push, pNv->Nv2D->handle);
BEGIN_NV04(push, NV50_2D(DMA_NOTIFY), 3);
PUSH_DATA (push, pNv->notify0->handle);
PUSH_DATA (push, fifo->vram);
PUSH_DATA (push, fifo->vram);
/* Magics from nv, no clue what they do, but at least some
* of them are needed to avoid crashes.
*/
BEGIN_NV04(push, NV50_2D(UNK260), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV50_2D(CLIP_ENABLE), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV50_2D(COLOR_KEY_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV50_2D(UNK58C), 1);
PUSH_DATA (push, 0x111);
pNv->currentRop = 0xfffffffa;
return TRUE;
}
Bool
NVAccelInitNV50TCL(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nv04_fifo *fifo = pNv->channel->data;
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nv04_notify ntfy = { .length = 32 };
unsigned class;
int i;
switch (pNv->dev->chipset & 0xf0) {
case 0x50:
class = NV50_3D_CLASS;
break;
case 0x80:
case 0x90:
class = NV84_3D_CLASS;
break;
case 0xa0:
switch (pNv->dev->chipset) {
case 0xa0:
case 0xaa:
case 0xac:
class = NVA0_3D_CLASS;
break;
case 0xaf:
class = NVAF_3D_CLASS;
break;
default:
class = NVA3_3D_CLASS;
break;
}
break;
default:
return FALSE;
}
if (nouveau_object_new(pNv->channel, Nv3D, class, NULL, 0, &pNv->Nv3D))
return FALSE;
if (nouveau_object_new(pNv->channel, NvSW, 0x506e, NULL, 0, &pNv->NvSW)) {
nouveau_object_del(&pNv->Nv3D);
return FALSE;
}
if (nouveau_object_new(pNv->channel, NvVBlankSem, NOUVEAU_NOTIFIER_CLASS,
&ntfy, sizeof(ntfy), &pNv->vblank_sem)) {
nouveau_object_del(&pNv->NvSW);
nouveau_object_del(&pNv->Nv3D);
return FALSE;
}
if (nouveau_pushbuf_space(push, 512, 0, 0) ||
nouveau_pushbuf_refn (push, &(struct nouveau_pushbuf_refn) {
pNv->scratch, NOUVEAU_BO_VRAM |
NOUVEAU_BO_WR }, 1))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(NVSW, OBJECT), 1);
PUSH_DATA (push, pNv->NvSW->handle);
BEGIN_NV04(push, SUBC_NVSW(0x018c), 1);
PUSH_DATA (push, pNv->vblank_sem->handle);
BEGIN_NV04(push, SUBC_NVSW(0x0400), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV01_SUBC(3D, OBJECT), 1);
PUSH_DATA (push, pNv->Nv3D->handle);
BEGIN_NV04(push, NV50_3D(COND_MODE), 1);
PUSH_DATA (push, NV50_3D_COND_MODE_ALWAYS);
BEGIN_NV04(push, NV50_3D(DMA_NOTIFY), 1);
PUSH_DATA (push, pNv->NvNull->handle);
BEGIN_NV04(push, NV50_3D(DMA_ZETA), 11);
for (i = 0; i < 11; i++)
PUSH_DATA (push, fifo->vram);
BEGIN_NV04(push, NV50_3D(DMA_COLOR(0)), NV50_3D_DMA_COLOR__LEN);
for (i = 0; i < NV50_3D_DMA_COLOR__LEN; i++)
PUSH_DATA (push, fifo->vram);
BEGIN_NV04(push, NV50_3D(RT_CONTROL), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV50_3D(VIEWPORT_TRANSFORM_EN), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV50_3D(COLOR_MASK_COMMON), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV50_3D(ZETA_ENABLE), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV50_3D(TIC_ADDRESS_HIGH), 3);
PUSH_DATA (push, (pNv->scratch->offset + TIC_OFFSET) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + TIC_OFFSET));
PUSH_DATA (push, 0x00000800);
BEGIN_NV04(push, NV50_3D(TSC_ADDRESS_HIGH), 3);
PUSH_DATA (push, (pNv->scratch->offset + TSC_OFFSET) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + TSC_OFFSET));
PUSH_DATA (push, 0x00000000);
BEGIN_NV04(push, NV50_3D(LINKED_TSC), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV50_3D(TEX_LIMITS(2)), 1);
PUSH_DATA (push, 0x54);
PUSH_DATAu(push, pNv->scratch, PVP_OFFSET, 30 * 2);
PUSH_DATA (push, 0x10000001);
PUSH_DATA (push, 0x0423c788); /* mov b32 o[0x0] a[0x0] */
PUSH_DATA (push, 0x10000205);
PUSH_DATA (push, 0x0423c788); /* mov b32 o[0x4] a[0x4] */
PUSH_DATA (push, 0xc0800401);
PUSH_DATA (push, 0x00200780); /* mul rn f32 $r0 a[0x8] c0[0x0] */
PUSH_DATA (push, 0xc0830405);
PUSH_DATA (push, 0x00200780); /* mul rn f32 $r1 a[0x8] c0[0xc] */
PUSH_DATA (push, 0xc0860409);
PUSH_DATA (push, 0x00200780); /* mul rn f32 $r2 a[0x8] c0[0x18] */
PUSH_DATA (push, 0xe0810601);
PUSH_DATA (push, 0x00200780); /* add f32 $r0 (mul a[0xc] c0[0x4]) $r0 */
PUSH_DATA (push, 0xe0840605);
PUSH_DATA (push, 0x00204780); /* add f32 $r1 (mul a[0xc] c0[0x10]) $r1 */
PUSH_DATA (push, 0xe0870609);
PUSH_DATA (push, 0x00208780); /* add f32 $r2 (mul a[0xc] c0[0x1c]) $r2 */
PUSH_DATA (push, 0xb1000001);
PUSH_DATA (push, 0x00008780); /* add rn f32 $r0 $r0 c0[0x8] */
PUSH_DATA (push, 0xb1000205);
PUSH_DATA (push, 0x00014780); /* add rn f32 $r1 $r1 c0[0x14] */
PUSH_DATA (push, 0xb1000409);
PUSH_DATA (push, 0x00020780); /* add rn f32 $r2 $r2 c0[0x20] */
PUSH_DATA (push, 0x90000409);
PUSH_DATA (push, 0x00000780); /* rcp f32 $r2 $r2 */
PUSH_DATA (push, 0xc0020001);
PUSH_DATA (push, 0x00000780); /* mul rn f32 $r0 $r0 $r2 */
PUSH_DATA (push, 0xc0020205);
PUSH_DATA (push, 0x00000780); /* mul rn f32 $r1 $r1 $r2 */
PUSH_DATA (push, 0xc0890009);
PUSH_DATA (push, 0x00000788); /* mul rn f32 o[0x8] $r0 c0[0x24] */
PUSH_DATA (push, 0xc08a020d);
PUSH_DATA (push, 0x00000788); /* mul rn f32 o[0xc] $r1 c0[0x28] */
PUSH_DATA (push, 0xc08b0801);
PUSH_DATA (push, 0x00200780); /* mul rn f32 $r0 a[0x10] c0[0x2c] */
PUSH_DATA (push, 0xc08e0805);
PUSH_DATA (push, 0x00200780); /* mul rn f32 $r1 a[0x10] c0[0x38] */
PUSH_DATA (push, 0xc0910809);
PUSH_DATA (push, 0x00200780); /* mul rn f32 $r2 a[0x10] c0[0x44] */
PUSH_DATA (push, 0xe08c0a01);
PUSH_DATA (push, 0x00200780); /* add f32 $r0 (mul a[0x14] c0[0x30]) $r0 */
PUSH_DATA (push, 0xe08f0a05);
PUSH_DATA (push, 0x00204780); /* add f32 $r1 (mul a[0x14] c0[0x3c]) $r1 */
PUSH_DATA (push, 0xe0920a09);
PUSH_DATA (push, 0x00208780); /* add f32 $r2 (mul a[0x14] c0[0x48]) $r2 */
PUSH_DATA (push, 0xb1000001);
PUSH_DATA (push, 0x00034780); /* add rn f32 $r0 $r0 c0[0x34] */
PUSH_DATA (push, 0xb1000205);
PUSH_DATA (push, 0x00040780); /* add rn f32 $r1 $r1 c0[0x40] */
PUSH_DATA (push, 0xb1000409);
PUSH_DATA (push, 0x0004c780); /* add rn f32 $r2 $r2 c0[0x4c] */
PUSH_DATA (push, 0x90000409);
PUSH_DATA (push, 0x00000780); /* rcp f32 $r2 $r2 */
PUSH_DATA (push, 0xc0020001);
PUSH_DATA (push, 0x00000780); /* mul rn f32 $r0 $r0 $r2 */
PUSH_DATA (push, 0xc0020205);
PUSH_DATA (push, 0x00000780); /* mul rn f32 $r1 $r1 $r2 */
PUSH_DATA (push, 0xc0940011);
PUSH_DATA (push, 0x00000788); /* mul rn f32 o[0x10] $r0 c0[0x50] */
PUSH_DATA (push, 0xc0950215);
PUSH_DATA (push, 0x00000789); /* exit mul rn f32 o[0x14] $r1 c0[0x54] */
/* fetch only VTX_ATTR[0,8,9].xy */
BEGIN_NV04(push, NV50_3D(VP_ATTR_EN(0)), 2);
PUSH_DATA (push, 0x00000003);
PUSH_DATA (push, 0x00000033);
BEGIN_NV04(push, NV50_3D(VP_REG_ALLOC_RESULT), 1);
PUSH_DATA (push, 6);
BEGIN_NV04(push, NV50_3D(VP_RESULT_MAP_SIZE), 2);
PUSH_DATA (push, 8);
PUSH_DATA (push, 4); /* NV50_3D_VP_REG_ALLOC_TEMP */
BEGIN_NV04(push, NV50_3D(VP_ADDRESS_HIGH), 2);
PUSH_DATA (push, (pNv->scratch->offset + PVP_OFFSET) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + PVP_OFFSET));
BEGIN_NV04(push, NV50_3D(CB_DEF_ADDRESS_HIGH), 3);
PUSH_DATA (push, (pNv->scratch->offset + PVP_DATA) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + PVP_DATA));
PUSH_DATA (push, (CB_PVP << NV50_3D_CB_DEF_SET_BUFFER__SHIFT) | 256);
BEGIN_NV04(push, NV50_3D(SET_PROGRAM_CB), 1);
PUSH_DATA (push, 0x00000001 | (CB_PVP << 12));
BEGIN_NV04(push, NV50_3D(VP_START_ID), 1);
PUSH_DATA (push, 0);
PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_S, 6);
PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */
PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */
PUSH_DATA (push, 0x82010200); /* interp $r0 v[0x4] $r1 */
PUSH_DATA (push, 0x82020204); /* interp $r1 v[0x8] $r1 */
PUSH_DATA (push, 0xf6400001);
PUSH_DATA (push, 0x0000c785); /* exit texauto live $r0:$r1:$r2:$r3 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */
PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_C, 16);
PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */
PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */
PUSH_DATA (push, 0x82030210); /* interp $r4 v[0xc] $r1 */
PUSH_DATA (push, 0x82040214); /* interp $r5 v[0x10] $r1 */
PUSH_DATA (push, 0x82010200); /* interp $r0 v[0x4] $r1 */
PUSH_DATA (push, 0x82020204); /* interp $r1 v[0x8] $r1 */
PUSH_DATA (push, 0xf6400001);
PUSH_DATA (push, 0x0000c784); /* texauto live $r0:$r1:$r2:$r3 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */
PUSH_DATA (push, 0xf0400211);
PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r4 $t1 $s0 $r4:$r5 0x0 0x0 0x0 */
PUSH_DATA (push, 0xc0040000); /* mul f32 $r0 $r0 $r4 */
PUSH_DATA (push, 0xc0040204); /* mul f32 $r1 $r1 $r4 */
PUSH_DATA (push, 0xc0040409);
PUSH_DATA (push, 0x00000780); /* mul rn f32 $r2 $r2 $r4 */
PUSH_DATA (push, 0xc004060d);
PUSH_DATA (push, 0x00000781); /* exit mul rn f32 $r3 $r3 $r4 */
PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_CCA, 16);
PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */
PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */
PUSH_DATA (push, 0x82030210); /* interp $r4 v[0xc] $r1 */
PUSH_DATA (push, 0x82040214); /* interp $r5 v[0x10] $r1 */
PUSH_DATA (push, 0x82010200); /* interp $r0 v[0x4] $r1 */
PUSH_DATA (push, 0x82020204); /* interp $r1 v[0x8] $r1 */
PUSH_DATA (push, 0xf6400001);
PUSH_DATA (push, 0x0000c784); /* texauto live $r0:$r1:$r2:$r3 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */
PUSH_DATA (push, 0xf6400211);
PUSH_DATA (push, 0x0000c784); /* texauto live $r4:$r5:$r6:$r7 $t1 $s0 $r4:$r5 0x0 0x0 0x0 */
PUSH_DATA (push, 0xc0040000); /* mul f32 $r0 $r0 $r4 */
PUSH_DATA (push, 0xc0050204); /* mul f32 $r1 $r1 $r5 */
PUSH_DATA (push, 0xc0060409);
PUSH_DATA (push, 0x00000780); /* mul rn f32 $r2 $r2 $r6 */
PUSH_DATA (push, 0xc007060d);
PUSH_DATA (push, 0x00000781); /* exit mul rn f32 $r3 $r3 $r7 */
PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_CCASA, 16);
PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */
PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */
PUSH_DATA (push, 0x82030200); /* interp $r0 v[0xc] $r1 */
PUSH_DATA (push, 0x82040204); /* interp $r1 v[0x10] $r1 */
PUSH_DATA (push, 0x82010210); /* interp $r4 v[0x4] $r1 */
PUSH_DATA (push, 0x82020214); /* interp $r5 v[0x8] $r1 */
PUSH_DATA (push, 0xf6400201);
PUSH_DATA (push, 0x0000c784); /* texauto live $r0:$r1:$r2:$r3 $t1 $s0 $r0:$r1 0x0 0x0 0x0 */
PUSH_DATA (push, 0xf0400011);
PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r4 $t0 $s0 $r4:$r5 0x0 0x0 0x0 */
PUSH_DATA (push, 0xc0040000); /* mul f32 $r0 $r0 $r4 */
PUSH_DATA (push, 0xc0040204); /* mul f32 $r1 $r1 $r4 */
PUSH_DATA (push, 0xc0040409);
PUSH_DATA (push, 0x00000780); /* mul rn f32 $r2 $r2 $r4 */
PUSH_DATA (push, 0xc004060d);
PUSH_DATA (push, 0x00000781); /* exit mul rn f32 $r3 $r3 $r4 */
PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_S_A8, 10);
PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */
PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */
PUSH_DATA (push, 0x82010200); /* interp $r0 v[0x4] $r1 */
PUSH_DATA (push, 0x82020204); /* interp $r1 v[0x8] $r1 */
PUSH_DATA (push, 0xf0400001);
PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r0 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */
PUSH_DATA (push, 0x10008004); /* mov b32 $r1 $r0 */
PUSH_DATA (push, 0x10008008); /* mov b32 $r2 $r0 */
PUSH_DATA (push, 0x1000000d);
PUSH_DATA (push, 0x0403c781); /* exit mov b32 $r3 $r0 */
PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_C_A8, 16);
PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */
PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */
PUSH_DATA (push, 0x82030208); /* interp $r2 v[0xc] $r1 */
PUSH_DATA (push, 0x8204020c); /* interp $r3 v[0x10] $r1 */
PUSH_DATA (push, 0x82010200); /* interp $r0 v[0x4] $r1 */
PUSH_DATA (push, 0x82020204); /* interp $r1 v[0x8] $r1 */
PUSH_DATA (push, 0xf0400001);
PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r0 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */
PUSH_DATA (push, 0xf0400209);
PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r2 $t1 $s0 $r2:$r3 0x0 0x0 0x0 */
PUSH_DATA (push, 0xc002000d);
PUSH_DATA (push, 0x00000780); /* mul rn f32 $r3 $r0 $r2 */
PUSH_DATA (push, 0x10008600); /* mov b32 $r0 $r3 */
PUSH_DATA (push, 0x10008604); /* mov b32 $r1 $r3 */
PUSH_DATA (push, 0x10000609);
PUSH_DATA (push, 0x0403c781); /* exit mov b32 $r2 $r3 */
PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_NV12, 24);
PUSH_DATA (push, 0x80000008); /* interp $r2 v[0x0] */
PUSH_DATA (push, 0x90000408); /* rcp f32 $r2 $r2 */
PUSH_DATA (push, 0x82010400); /* interp $r0 v[0x4] $r2 */
PUSH_DATA (push, 0x82020404); /* interp $r1 v[0x8] $r2 */
PUSH_DATA (push, 0xf0400001);
PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r0 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */
PUSH_DATA (push, 0xc0800014); /* mul f32 $r5 $r0 c0[0x0] */
PUSH_DATA (push, 0xb0810a0c); /* add f32 $r3 $r5 c0[0x4] */
PUSH_DATA (push, 0xb0820a10); /* add f32 $r4 $r5 c0[0x8] */
PUSH_DATA (push, 0xb0830a14); /* add f32 $r5 $r5 c0[0xc] */
PUSH_DATA (push, 0x82010400); /* interp $r0 v[0x4] $r2 */
PUSH_DATA (push, 0x82020404); /* interp $r1 v[0x8] $r2 */
PUSH_DATA (push, 0xf0400201);
PUSH_DATA (push, 0x0000c784); /* texauto live #:#:$r0:$r1 $t1 $s0 $r0:$r1 0x0 0x0 0x0 */
PUSH_DATA (push, 0xe084000c); /* add f32 $r3 (mul $r0 c0[0x10]) $r3 */
PUSH_DATA (push, 0xe0850010); /* add f32 $r4 (mul $r0 c0[0x14]) $r4 */
PUSH_DATA (push, 0xe0860015);
PUSH_DATA (push, 0x00014780); /* add f32 $r5 (mul $r0 c0[0x18]) $r5 */
PUSH_DATA (push, 0xe0870201);
PUSH_DATA (push, 0x0000c780); /* add f32 $r0 (mul $r1 c0[0x1c]) $r3 */
PUSH_DATA (push, 0xe0890209);
PUSH_DATA (push, 0x00014780); /* add f32 $r2 (mul $r1 c0[0x24]) $r5 */
PUSH_DATA (push, 0xe0880205);
PUSH_DATA (push, 0x00010781); /* exit add f32 $r1 (mul $r1 c0[0x20]) $r4 */
/* HPOS.xy = ($o0, $o1), HPOS.zw = (0.0, 1.0), then map $o2 - $o5 */
BEGIN_NV04(push, NV50_3D(VP_RESULT_MAP(0)), 2);
PUSH_DATA (push, 0x41400100);
PUSH_DATA (push, 0x05040302);
BEGIN_NV04(push, NV50_3D(POINT_SPRITE_ENABLE), 1);
PUSH_DATA (push, 0x00000000);
BEGIN_NV04(push, NV50_3D(FP_INTERPOLANT_CTRL), 2);
PUSH_DATA (push, 0x08040404);
PUSH_DATA (push, 0x00000008); /* NV50_3D_FP_REG_ALLOC_TEMP */
BEGIN_NV04(push, NV50_3D(FP_ADDRESS_HIGH), 2);
PUSH_DATA (push, (pNv->scratch->offset + PFP_OFFSET) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + PFP_OFFSET));
BEGIN_NV04(push, NV50_3D(CB_DEF_ADDRESS_HIGH), 3);
PUSH_DATA (push, (pNv->scratch->offset + PFP_DATA) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + PFP_DATA));
PUSH_DATA (push, (CB_PFP << NV50_3D_CB_DEF_SET_BUFFER__SHIFT) | 256);
BEGIN_NV04(push, NV50_3D(SET_PROGRAM_CB), 1);
PUSH_DATA (push, 0x00000031 | (CB_PFP << 12));
BEGIN_NV04(push, NV50_3D(SCISSOR_ENABLE(0)), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV50_3D(VIEWPORT_HORIZ(0)), 2);
PUSH_DATA (push, 8192 << NV50_3D_VIEWPORT_HORIZ_W__SHIFT);
PUSH_DATA (push, 8192 << NV50_3D_VIEWPORT_VERT_H__SHIFT);
/* NV50_3D_SCISSOR_VERT_T_SHIFT is wrong, because it was deducted with
* origin lying at the bottom left. This will be changed to _MIN_ and _MAX_
* later, because it is origin dependent.
*/
BEGIN_NV04(push, NV50_3D(SCISSOR_HORIZ(0)), 2);
PUSH_DATA (push, 8192 << NV50_3D_SCISSOR_HORIZ_MAX__SHIFT);
PUSH_DATA (push, 8192 << NV50_3D_SCISSOR_VERT_MAX__SHIFT);
BEGIN_NV04(push, NV50_3D(SCREEN_SCISSOR_HORIZ), 2);
PUSH_DATA (push, 8192 << NV50_3D_SCREEN_SCISSOR_HORIZ_W__SHIFT);
PUSH_DATA (push, 8192 << NV50_3D_SCREEN_SCISSOR_VERT_H__SHIFT);
return TRUE;
}
xf86-video-nouveau-1.0.16/src/nv_accel_common.c 0000644 0001750 0001756 00000047361 13423754626 016211 0000000 0000000 /*
* Copyright 2007 Ben Skeggs
*
* 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.
*/
#include "nv_include.h"
#include "hwdefs/nv_object.xml.h"
#include "hwdefs/nv_m2mf.xml.h"
#include "hwdefs/nv01_2d.xml.h"
#include "hwdefs/nv50_2d.xml.h"
#include "nv04_accel.h"
Bool
nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
int usage_hint, int *pitch, struct nouveau_bo **bo)
{
NVPtr pNv = NVPTR(scrn);
Bool scanout = (usage_hint & NOUVEAU_CREATE_PIXMAP_SCANOUT);
Bool tiled = (usage_hint & NOUVEAU_CREATE_PIXMAP_TILED);
Bool shared = FALSE;
union nouveau_bo_config cfg = {};
int flags = NOUVEAU_BO_MAP | (bpp >= 8 ? NOUVEAU_BO_VRAM : 0);
int cpp = bpp / 8, ret;
#ifdef NOUVEAU_PIXMAP_SHARING
shared = ((usage_hint & 0xffff) == CREATE_PIXMAP_USAGE_SHARED);
#endif
flags = NOUVEAU_BO_MAP;
if (bpp >= 8)
flags |= shared ? NOUVEAU_BO_GART : NOUVEAU_BO_VRAM;
if (scanout && pNv->tiled_scanout)
tiled = TRUE;
if (pNv->Architecture >= NV_TESLA) {
if (!scanout && bpp >= 8 && !shared)
tiled = TRUE;
*pitch = NOUVEAU_ALIGN(width * cpp, !tiled ? 256 : 64);
} else {
*pitch = NOUVEAU_ALIGN(width * cpp, 64);
}
if (tiled) {
if (pNv->Architecture >= NV_FERMI) {
if (height > 64) cfg.nvc0.tile_mode = 0x040;
else if (height > 32) cfg.nvc0.tile_mode = 0x030;
else if (height > 16) cfg.nvc0.tile_mode = 0x020;
else if (height > 8) cfg.nvc0.tile_mode = 0x010;
else cfg.nvc0.tile_mode = 0x000;
if (usage_hint & NOUVEAU_CREATE_PIXMAP_ZETA)
cfg.nvc0.memtype = (bpp == 16) ? 0x01 : 0x11;
else
cfg.nvc0.memtype = 0xfe;
height = NOUVEAU_ALIGN(height,
NVC0_TILE_HEIGHT(cfg.nvc0.tile_mode));
} else if (pNv->Architecture >= NV_TESLA) {
if (height > 32) cfg.nv50.tile_mode = 0x040;
else if (height > 16) cfg.nv50.tile_mode = 0x030;
else if (height > 8) cfg.nv50.tile_mode = 0x020;
else if (height > 4) cfg.nv50.tile_mode = 0x010;
else cfg.nv50.tile_mode = 0x000;
if (usage_hint & NOUVEAU_CREATE_PIXMAP_ZETA)
cfg.nv50.memtype = (bpp == 16) ? 0x16c : 0x128;
else if (usage_hint & NOUVEAU_CREATE_PIXMAP_SCANOUT)
cfg.nv50.memtype = (bpp == 16) ? 0x070 : 0x07a;
else
cfg.nv50.memtype = 0x070;
height = NOUVEAU_ALIGN(height,
NV50_TILE_HEIGHT(cfg.nv50.tile_mode));
} else {
int pitch_align = max(
pNv->dev->chipset >= 0x40 ? 1024 : 256,
round_down_pow2(*pitch / 4));
*pitch = NOUVEAU_ALIGN(*pitch, pitch_align);
cfg.nv04.surf_pitch = *pitch;
}
}
if (pNv->Architecture < NV_TESLA) {
if (bpp == 16)
cfg.nv04.surf_flags |= NV04_BO_16BPP;
if (bpp == 32)
cfg.nv04.surf_flags |= NV04_BO_32BPP;
if (usage_hint & NOUVEAU_CREATE_PIXMAP_ZETA)
cfg.nv04.surf_flags |= NV04_BO_ZETA;
}
if (usage_hint & NOUVEAU_CREATE_PIXMAP_SCANOUT)
flags |= NOUVEAU_BO_CONTIG;
ret = nouveau_bo_new(pNv->dev, flags, 0, *pitch * height, &cfg, bo);
if (ret) {
ErrorF("%d\n", ret);
return FALSE;
}
return TRUE;
}
void
NV11SyncToVBlank(PixmapPtr ppix, BoxPtr box)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
int head;
xf86CrtcPtr crtc;
if (!nouveau_exa_pixmap_is_onscreen(ppix))
return;
crtc = nouveau_pick_best_crtc(pScrn, FALSE, box->x1, box->y1,
box->x2 - box->x1,
box->y2 - box->y1);
if (!crtc)
return;
if (!PUSH_SPACE(push, 8))
return;
head = drmmode_head(crtc);
BEGIN_NV04(push, NV15_BLIT(FLIP_INCR_WRITE), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV15_BLIT(FLIP_CRTC_INCR_READ), 1);
PUSH_DATA (push, head);
BEGIN_NV04(push, SUBC_BLIT(0x00000100), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV15_BLIT(FLIP_WAIT), 1);
PUSH_DATA (push, 0);
}
static Bool
NVAccelInitDmaNotifier0(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_object *chan = pNv->channel;
struct nv04_notify ntfy = { .length = 32 };
if (nouveau_object_new(chan, NvDmaNotifier0, NOUVEAU_NOTIFIER_CLASS,
&ntfy, sizeof(ntfy), &pNv->notify0))
return FALSE;
return TRUE;
}
static Bool
NVAccelInitNull(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
if (nouveau_object_new(pNv->channel, NvNullObject, NV01_NULL_CLASS,
NULL, 0, &pNv->NvNull))
return FALSE;
return TRUE;
}
static Bool
NVAccelInitContextSurfaces(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nv04_fifo *fifo = pNv->channel->data;
uint32_t class;
class = (pNv->Architecture >= NV_ARCH_10) ? NV10_SURFACE_2D_CLASS :
NV04_SURFACE_2D_CLASS;
if (nouveau_object_new(pNv->channel, NvContextSurfaces, class,
NULL, 0, &pNv->NvContextSurfaces))
return FALSE;
if (!PUSH_SPACE(push, 8))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(SF2D, OBJECT), 1);
PUSH_DATA (push, pNv->NvContextSurfaces->handle);
BEGIN_NV04(push, NV04_SF2D(DMA_NOTIFY), 1);
PUSH_DATA (push, pNv->NvNull->handle);
BEGIN_NV04(push, NV04_SF2D(DMA_IMAGE_SOURCE), 2);
PUSH_DATA (push, fifo->vram);
PUSH_DATA (push, fifo->vram);
return TRUE;
}
static Bool
NVAccelInitContextBeta1(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
if (nouveau_object_new(pNv->channel, NvContextBeta1, NV01_BETA_CLASS,
NULL, 0, &pNv->NvContextBeta1))
return FALSE;
if (!PUSH_SPACE(push, 4))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, pNv->NvContextBeta1->handle);
BEGIN_NV04(push, NV01_BETA(BETA_1D31), 1); /*alpha factor*/
PUSH_DATA (push, 0xff << 23);
return TRUE;
}
static Bool
NVAccelInitContextBeta4(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
if (nouveau_object_new(pNv->channel, NvContextBeta4, NV04_BETA4_CLASS,
NULL, 0, &pNv->NvContextBeta4))
return FALSE;
if (!PUSH_SPACE(push, 4))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, pNv->NvContextBeta4->handle);
BEGIN_NV04(push, NV04_BETA4(BETA_FACTOR), 1); /*RGBA factor*/
PUSH_DATA (push, 0xffff0000);
return TRUE;
}
Bool
NVAccelGetCtxSurf2DFormatFromPixmap(PixmapPtr pPix, int *fmt_ret)
{
switch (pPix->drawable.bitsPerPixel) {
case 32:
*fmt_ret = NV04_SURFACE_2D_FORMAT_A8R8G8B8;
break;
case 24:
*fmt_ret = NV04_SURFACE_2D_FORMAT_X8R8G8B8_Z8R8G8B8;
break;
case 16:
if (pPix->drawable.depth == 16)
*fmt_ret = NV04_SURFACE_2D_FORMAT_R5G6B5;
else
*fmt_ret = NV04_SURFACE_2D_FORMAT_X1R5G5B5_Z1R5G5B5;
break;
case 8:
*fmt_ret = NV04_SURFACE_2D_FORMAT_Y8;
break;
default:
return FALSE;
}
return TRUE;
}
Bool
NVAccelGetCtxSurf2DFormatFromPicture(PicturePtr pPict, int *fmt_ret)
{
switch (pPict->format) {
case PICT_a8r8g8b8:
*fmt_ret = NV04_SURFACE_2D_FORMAT_A8R8G8B8;
break;
case PICT_x8r8g8b8:
*fmt_ret = NV04_SURFACE_2D_FORMAT_X8R8G8B8_Z8R8G8B8;
break;
case PICT_r5g6b5:
*fmt_ret = NV04_SURFACE_2D_FORMAT_R5G6B5;
break;
case PICT_a8:
*fmt_ret = NV04_SURFACE_2D_FORMAT_Y8;
break;
default:
return FALSE;
}
return TRUE;
}
/* A copy of exaGetOffscreenPixmap(), since it's private. */
PixmapPtr
NVGetDrawablePixmap(DrawablePtr pDraw)
{
if (pDraw->type == DRAWABLE_WINDOW)
return pDraw->pScreen->GetWindowPixmap ((WindowPtr) pDraw);
else
return (PixmapPtr) pDraw;
}
static Bool
NVAccelInitImagePattern(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
if (nouveau_object_new(pNv->channel, NvImagePattern, NV04_PATTERN_CLASS,
NULL, 0, &pNv->NvImagePattern))
return FALSE;
if (!PUSH_SPACE(push, 8))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, pNv->NvImagePattern->handle);
BEGIN_NV04(push, NV01_PATT(DMA_NOTIFY), 1);
PUSH_DATA (push, pNv->NvNull->handle);
BEGIN_NV04(push, NV01_PATT(MONOCHROME_FORMAT), 3);
#if X_BYTE_ORDER == X_BIG_ENDIAN
PUSH_DATA (push, NV01_PATTERN_MONOCHROME_FORMAT_LE);
#else
PUSH_DATA (push, NV01_PATTERN_MONOCHROME_FORMAT_CGA6);
#endif
PUSH_DATA (push, NV01_PATTERN_MONOCHROME_SHAPE_8X8);
PUSH_DATA (push, NV04_PATTERN_PATTERN_SELECT_MONO);
return TRUE;
}
static Bool
NVAccelInitRasterOp(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
if (nouveau_object_new(pNv->channel, NvRop, NV03_ROP_CLASS,
NULL, 0, &pNv->NvRop))
return FALSE;
if (!PUSH_SPACE(push, 4))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, pNv->NvRop->handle);
BEGIN_NV04(push, NV01_ROP(DMA_NOTIFY), 1);
PUSH_DATA (push, pNv->NvNull->handle);
pNv->currentRop = ~0;
return TRUE;
}
static Bool
NVAccelInitRectangle(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
if (nouveau_object_new(pNv->channel, NvRectangle, NV04_GDI_CLASS,
NULL, 0, &pNv->NvRectangle))
return FALSE;
if (!PUSH_SPACE(push, 16))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(RECT, OBJECT), 1);
PUSH_DATA (push, pNv->NvRectangle->handle);
BEGIN_NV04(push, NV04_RECT(DMA_NOTIFY), 1);
PUSH_DATA (push, pNv->notify0->handle);
BEGIN_NV04(push, NV04_RECT(DMA_FONTS), 1);
PUSH_DATA (push, pNv->NvNull->handle);
BEGIN_NV04(push, NV04_RECT(SURFACE), 1);
PUSH_DATA (push, pNv->NvContextSurfaces->handle);
BEGIN_NV04(push, NV04_RECT(ROP), 1);
PUSH_DATA (push, pNv->NvRop->handle);
BEGIN_NV04(push, NV04_RECT(PATTERN), 1);
PUSH_DATA (push, pNv->NvImagePattern->handle);
BEGIN_NV04(push, NV04_RECT(OPERATION), 1);
PUSH_DATA (push, NV04_GDI_OPERATION_ROP_AND);
BEGIN_NV04(push, NV04_RECT(MONOCHROME_FORMAT), 1);
/* XXX why putting 1 like renouveau dump, swap the text */
#if 1 || X_BYTE_ORDER == X_BIG_ENDIAN
PUSH_DATA (push, NV04_GDI_MONOCHROME_FORMAT_LE);
#else
PUSH_DATA (push, NV04_GDI_MONOCHROME_FORMAT_CGA6);
#endif
return TRUE;
}
static Bool
NVAccelInitImageBlit(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
uint32_t class;
class = (pNv->dev->chipset >= 0x11) ? NV15_BLIT_CLASS : NV04_BLIT_CLASS;
if (nouveau_object_new(pNv->channel, NvImageBlit, class,
NULL, 0, &pNv->NvImageBlit))
return FALSE;
if (!PUSH_SPACE(push, 16))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(BLIT, OBJECT), 1);
PUSH_DATA (push, pNv->NvImageBlit->handle);
BEGIN_NV04(push, NV01_BLIT(DMA_NOTIFY), 1);
PUSH_DATA (push, pNv->notify0->handle);
BEGIN_NV04(push, NV01_BLIT(COLOR_KEY), 1);
PUSH_DATA (push, pNv->NvNull->handle);
BEGIN_NV04(push, NV04_BLIT(SURFACES), 1);
PUSH_DATA (push, pNv->NvContextSurfaces->handle);
BEGIN_NV04(push, NV01_BLIT(CLIP), 3);
PUSH_DATA (push, pNv->NvNull->handle);
PUSH_DATA (push, pNv->NvImagePattern->handle);
PUSH_DATA (push, pNv->NvRop->handle);
BEGIN_NV04(push, NV01_BLIT(OPERATION), 1);
PUSH_DATA (push, NV01_BLIT_OPERATION_ROP_AND);
if (pNv->NvImageBlit->oclass == NV15_BLIT_CLASS) {
BEGIN_NV04(push, NV15_BLIT(FLIP_SET_READ), 3);
PUSH_DATA (push, 0);
PUSH_DATA (push, 1);
PUSH_DATA (push, 2);
}
return TRUE;
}
static Bool
NVAccelInitScaledImage(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nv04_fifo *fifo = pNv->channel->data;
uint32_t class;
switch (pNv->Architecture) {
case NV_ARCH_04:
class = NV04_SIFM_CLASS;
break;
case NV_ARCH_10:
case NV_ARCH_20:
case NV_ARCH_30:
class = NV10_SIFM_CLASS;
break;
case NV_ARCH_40:
default:
class = NV40_SIFM_CLASS;
break;
}
if (nouveau_object_new(pNv->channel, NvScaledImage, class,
NULL, 0, &pNv->NvScaledImage))
return FALSE;
if (!PUSH_SPACE(push, 16))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, pNv->NvScaledImage->handle);
BEGIN_NV04(push, NV03_SIFM(DMA_NOTIFY), 7);
PUSH_DATA (push, pNv->notify0->handle);
PUSH_DATA (push, fifo->vram);
PUSH_DATA (push, pNv->NvNull->handle);
PUSH_DATA (push, pNv->NvNull->handle);
PUSH_DATA (push, pNv->NvContextBeta1->handle);
PUSH_DATA (push, pNv->NvContextBeta4->handle);
PUSH_DATA (push, pNv->NvContextSurfaces->handle);
if (pNv->Architecture>=NV_ARCH_10) {
BEGIN_NV04(push, NV05_SIFM(COLOR_CONVERSION), 1);
PUSH_DATA (push, NV05_SIFM_COLOR_CONVERSION_DITHER);
}
BEGIN_NV04(push, NV03_SIFM(OPERATION), 1);
PUSH_DATA (push, NV03_SIFM_OPERATION_SRCCOPY);
return TRUE;
}
static Bool
NVAccelInitClipRectangle(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
if (nouveau_object_new(pNv->channel, NvClipRectangle, NV01_CLIP_CLASS,
NULL, 0, &pNv->NvClipRectangle))
return FALSE;
if (!PUSH_SPACE(push, 4))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(MISC, OBJECT), 1);
PUSH_DATA (push, pNv->NvClipRectangle->handle);
BEGIN_NV04(push, NV01_CLIP(DMA_NOTIFY), 1);
PUSH_DATA (push, pNv->NvNull->handle);
return TRUE;
}
static Bool
NVAccelInitMemFormat(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
if (nouveau_object_new(pNv->channel, NvMemFormat, NV03_M2MF_CLASS,
NULL, 0, &pNv->NvMemFormat))
return FALSE;
if (!PUSH_SPACE(push, 4))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(M2MF, OBJECT), 1);
PUSH_DATA (push, pNv->NvMemFormat->handle);
BEGIN_NV04(push, NV03_M2MF(DMA_NOTIFY), 1);
PUSH_DATA (push, pNv->notify0->handle);
return TRUE;
}
static Bool
NVAccelInitImageFromCpu(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
uint32_t class;
switch (pNv->Architecture) {
case NV_ARCH_04:
class = NV04_IFC_CLASS;
break;
case NV_ARCH_10:
case NV_ARCH_20:
case NV_ARCH_30:
case NV_ARCH_40:
default:
class = NV10_IFC_CLASS;
break;
}
if (nouveau_object_new(pNv->channel, NvImageFromCpu, class,
NULL, 0, &pNv->NvImageFromCpu))
return FALSE;
if (!PUSH_SPACE(push, 16))
return FALSE;
BEGIN_NV04(push, NV01_SUBC(IFC, OBJECT), 1);
PUSH_DATA (push, pNv->NvImageFromCpu->handle);
BEGIN_NV04(push, NV01_IFC(DMA_NOTIFY), 1);
PUSH_DATA (push, pNv->notify0->handle);
BEGIN_NV04(push, NV01_IFC(CLIP), 1);
PUSH_DATA (push, pNv->NvNull->handle);
BEGIN_NV04(push, NV01_IFC(PATTERN), 1);
PUSH_DATA (push, pNv->NvNull->handle);
BEGIN_NV04(push, NV01_IFC(ROP), 1);
PUSH_DATA (push, pNv->NvNull->handle);
if (pNv->Architecture >= NV_ARCH_10) {
BEGIN_NV04(push, NV01_IFC(BETA), 1);
PUSH_DATA (push, pNv->NvNull->handle);
BEGIN_NV04(push, NV04_IFC(BETA4), 1);
PUSH_DATA (push, pNv->NvNull->handle);
}
BEGIN_NV04(push, NV04_IFC(SURFACE), 1);
PUSH_DATA (push, pNv->NvContextSurfaces->handle);
BEGIN_NV04(push, NV01_IFC(OPERATION), 1);
PUSH_DATA (push, NV01_IFC_OPERATION_SRCCOPY);
return TRUE;
}
#define INIT_CONTEXT_OBJECT(name) do { \
ret = NVAccelInit##name(pScrn); \
if (!ret) { \
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, \
"Failed to initialise context object: "#name \
" (%d)\n", ret); \
return FALSE; \
} \
} while(0)
void
NVAccelCommonFini(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
nouveau_object_del(&pNv->notify0);
nouveau_object_del(&pNv->vblank_sem);
nouveau_object_del(&pNv->NvContextSurfaces);
nouveau_object_del(&pNv->NvContextBeta1);
nouveau_object_del(&pNv->NvContextBeta4);
nouveau_object_del(&pNv->NvImagePattern);
nouveau_object_del(&pNv->NvRop);
nouveau_object_del(&pNv->NvRectangle);
nouveau_object_del(&pNv->NvImageBlit);
nouveau_object_del(&pNv->NvScaledImage);
nouveau_object_del(&pNv->NvClipRectangle);
nouveau_object_del(&pNv->NvImageFromCpu);
nouveau_object_del(&pNv->Nv2D);
nouveau_object_del(&pNv->NvMemFormat);
nouveau_object_del(&pNv->NvSW);
nouveau_object_del(&pNv->Nv3D);
nouveau_object_del(&pNv->NvCOPY);
nouveau_bo_ref(NULL, &pNv->scratch);
nouveau_bufctx_del(&pNv->bufctx);
nouveau_pushbuf_del(&pNv->pushbuf);
nouveau_object_del(&pNv->channel);
}
Bool
NVAccelCommonInit(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
struct nv04_fifo nv04_data = { .vram = NvDmaFB,
.gart = NvDmaTT };
struct nvc0_fifo nvc0_data = { };
struct nouveau_object *device = &pNv->dev->object;
int size, ret;
void *data;
if (pNv->dev->drm_version < 0x01000000 && pNv->dev->chipset >= 0xc0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Fermi acceleration not supported on old kernel\n");
return FALSE;
}
if (pNv->Architecture < NV_FERMI) {
data = &nv04_data;
size = sizeof(nv04_data);
} else {
data = &nvc0_data;
size = sizeof(nvc0_data);
}
ret = nouveau_object_new(device, 0, NOUVEAU_FIFO_CHANNEL_CLASS,
data, size, &pNv->channel);
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Error creating GPU channel: %d\n", ret);
return FALSE;
}
ret = nouveau_pushbuf_new(pNv->client, pNv->channel, 4, 32 * 1024,
true, &pNv->pushbuf);
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Error allocating DMA push buffer: %d\n",ret);
NVAccelCommonFini(pScrn);
return FALSE;
}
ret = nouveau_bufctx_new(pNv->client, 1, &pNv->bufctx);
if (ret) {
NVAccelCommonFini(pScrn);
return FALSE;
}
pNv->pushbuf->user_priv = pNv->bufctx;
/* Scratch buffer */
ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_MAP,
128 * 1024, 128 * 1024, NULL, &pNv->scratch);
if (!ret)
ret = nouveau_bo_map(pNv->scratch, 0, pNv->client);
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to allocate scratch buffer: %d\n", ret);
return FALSE;
}
/* General engine objects */
if (pNv->Architecture < NV_FERMI) {
INIT_CONTEXT_OBJECT(DmaNotifier0);
INIT_CONTEXT_OBJECT(Null);
}
/* 2D engine */
if (pNv->Architecture < NV_TESLA) {
INIT_CONTEXT_OBJECT(ContextSurfaces);
INIT_CONTEXT_OBJECT(ContextBeta1);
INIT_CONTEXT_OBJECT(ContextBeta4);
INIT_CONTEXT_OBJECT(ImagePattern);
INIT_CONTEXT_OBJECT(RasterOp);
INIT_CONTEXT_OBJECT(Rectangle);
INIT_CONTEXT_OBJECT(ImageBlit);
INIT_CONTEXT_OBJECT(ScaledImage);
INIT_CONTEXT_OBJECT(ClipRectangle);
INIT_CONTEXT_OBJECT(ImageFromCpu);
} else
if (pNv->Architecture < NV_FERMI) {
INIT_CONTEXT_OBJECT(2D_NV50);
} else {
INIT_CONTEXT_OBJECT(2D_NVC0);
}
if (pNv->Architecture < NV_TESLA)
INIT_CONTEXT_OBJECT(MemFormat);
else
if (pNv->Architecture < NV_FERMI)
INIT_CONTEXT_OBJECT(M2MF_NV50);
else
if (pNv->Architecture < NV_KEPLER)
INIT_CONTEXT_OBJECT(M2MF_NVC0);
else {
INIT_CONTEXT_OBJECT(P2MF_NVE0);
INIT_CONTEXT_OBJECT(COPY_NVE0);
}
/* 3D init */
switch (pNv->Architecture) {
case NV_FERMI:
case NV_KEPLER:
case NV_MAXWELL:
case NV_PASCAL:
INIT_CONTEXT_OBJECT(3D_NVC0);
break;
case NV_TESLA:
INIT_CONTEXT_OBJECT(NV50TCL);
break;
case NV_ARCH_40:
INIT_CONTEXT_OBJECT(NV40TCL);
break;
case NV_ARCH_30:
INIT_CONTEXT_OBJECT(NV30TCL);
break;
case NV_ARCH_20:
case NV_ARCH_10:
INIT_CONTEXT_OBJECT(NV10TCL);
break;
default:
break;
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Channel setup complete.\n");
return TRUE;
}
xf86-video-nouveau-1.0.16/src/nvc0_xv.c 0000644 0001750 0001756 00000023415 13423754626 014444 0000000 0000000 /*
* Copyright 2008 Ben Skeggs
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "xf86xv.h"
#include
#include "exa.h"
#include "damage.h"
#include "dixstruct.h"
#include "fourcc.h"
#include "nv_include.h"
#include "nvc0_accel.h"
extern Atom xvSyncToVBlank, xvSetDefaults;
static Bool
nvc0_xv_check_image_put(PixmapPtr ppix)
{
switch (ppix->drawable.bitsPerPixel) {
case 32:
case 24:
case 16:
case 15:
break;
default:
return FALSE;
}
if (!nv50_style_tiled_pixmap(ppix))
return FALSE;
return TRUE;
}
int
nvc0_xv_image_put(ScrnInfoPtr pScrn,
struct nouveau_bo *src, int packed_y, int uv,
int id, int src_pitch, BoxPtr dstBox,
int x1, int y1, int x2, int y2,
uint16_t width, uint16_t height,
uint16_t src_w, uint16_t src_h,
uint16_t drw_w, uint16_t drw_h,
RegionPtr clipBoxes, PixmapPtr ppix,
NVPortPrivPtr pPriv)
{
NVPtr pNv = NVPTR(pScrn);
struct nouveau_bo *dst = nouveau_pixmap_bo(ppix);
struct nouveau_pushbuf_refn refs[] = {
{ pNv->scratch, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR },
{ src, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD },
{ dst, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR },
};
struct nouveau_pushbuf *push = pNv->pushbuf;
float X1, X2, Y1, Y2;
BoxPtr pbox;
int nbox;
if (!nvc0_xv_check_image_put(ppix))
return BadMatch;
if (!PUSH_SPACE(push, 256))
return BadImplementation;
BEGIN_NVC0(push, NVC0_3D(RT_ADDRESS_HIGH(0)), 8);
PUSH_DATA (push, dst->offset >> 32);
PUSH_DATA (push, dst->offset);
PUSH_DATA (push, ppix->drawable.width);
PUSH_DATA (push, ppix->drawable.height);
switch (ppix->drawable.depth) {
case 32: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGRA8_UNORM); break;
case 30: PUSH_DATA (push, NV50_SURFACE_FORMAT_RGB10_A2_UNORM); break;
case 24: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGRX8_UNORM); break;
case 16: PUSH_DATA (push, NV50_SURFACE_FORMAT_B5G6R5_UNORM); break;
case 15: PUSH_DATA (push, NV50_SURFACE_FORMAT_BGR5_X1_UNORM); break;
}
PUSH_DATA (push, dst->config.nvc0.tile_mode);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
BEGIN_NVC0(push, NVC0_3D(BLEND_ENABLE(0)), 1);
PUSH_DATA (push, 0);
PUSH_DATAu(push, pNv->scratch, TIC_OFFSET, 16);
if (id == FOURCC_YV12 || id == FOURCC_I420) {
PUSH_TIC(push, src, packed_y, width, height, 0,
NV50TIC_0_0_MAPA_C0 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_ZERO | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8);
PUSH_TIC(push, src, uv, width >> 1, height >> 1, 0,
NV50TIC_0_0_MAPA_C1 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_C0 | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8_8);
} else {
unsigned format;
if (id == FOURCC_UYVY) {
format = NV50TIC_0_0_MAPA_C1 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_ZERO | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8_8;
} else {
format = NV50TIC_0_0_MAPA_C0 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_ZERO | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8_8;
}
PUSH_TIC(push, src, packed_y, width, height, 0, format);
if (id == FOURCC_UYVY) {
format = NV50TIC_0_0_MAPA_C2 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_C0 | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8_8_8_8;
} else {
format = NV50TIC_0_0_MAPA_C3 | NV50TIC_0_0_TYPEA_UNORM |
NV50TIC_0_0_MAPB_C1 | NV50TIC_0_0_TYPEB_UNORM |
NV50TIC_0_0_MAPG_ZERO | NV50TIC_0_0_TYPEG_UNORM |
NV50TIC_0_0_MAPR_ZERO | NV50TIC_0_0_TYPER_UNORM |
NV50TIC_0_0_FMT_8_8_8_8;
}
PUSH_TIC(push, src, packed_y, width >> 1, height, 0, format);
}
PUSH_DATAu(push, pNv->scratch, TSC_OFFSET, 16);
PUSH_DATA (push, NV50TSC_1_0_WRAPS_CLAMP_TO_EDGE |
NV50TSC_1_0_WRAPT_CLAMP_TO_EDGE |
NV50TSC_1_0_WRAPR_CLAMP_TO_EDGE);
PUSH_DATA (push, NV50TSC_1_1_MAGF_LINEAR |
NV50TSC_1_1_MINF_LINEAR |
NV50TSC_1_1_MIPF_NONE);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, NV50TSC_1_0_WRAPS_CLAMP_TO_EDGE |
NV50TSC_1_0_WRAPT_CLAMP_TO_EDGE |
NV50TSC_1_0_WRAPR_CLAMP_TO_EDGE);
PUSH_DATA (push, NV50TSC_1_1_MAGF_LINEAR |
NV50TSC_1_1_MINF_LINEAR |
NV50TSC_1_1_MIPF_NONE);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
BEGIN_NVC0(push, NVC0_3D(SP_START_ID(5)), 1);
PUSH_DATA (push, PFP_NV12);
BEGIN_NVC0(push, NVC0_3D(TSC_FLUSH), 1);
PUSH_DATA (push, 0);
BEGIN_NVC0(push, NVC0_3D(TIC_FLUSH), 1);
PUSH_DATA (push, 0);
BEGIN_NVC0(push, NVC0_3D(TEX_CACHE_CTL), 1);
PUSH_DATA (push, 0);
PUSH_DATAu(push, pNv->scratch, PVP_DATA, 11);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 1.0 / width);
PUSH_DATAf(push, 1.0 / height);
if (pPriv->SyncToVBlank) {
NVC0SyncToVBlank(ppix, dstBox);
}
/* These are fixed point values in the 16.16 format. */
X1 = (float)(x1>>16)+(float)(x1&0xFFFF)/(float)0x10000;
Y1 = (float)(y1>>16)+(float)(y1&0xFFFF)/(float)0x10000;
X2 = (float)(x2>>16)+(float)(x2&0xFFFF)/(float)0x10000;
Y2 = (float)(y2>>16)+(float)(y2&0xFFFF)/(float)0x10000;
pbox = REGION_RECTS(clipBoxes);
nbox = REGION_NUM_RECTS(clipBoxes);
while(nbox--) {
float tx1=X1+(float)(pbox->x1 - dstBox->x1)*(X2-X1)/(float)(drw_w);
float tx2=X1+(float)(pbox->x2 - dstBox->x1)*(src_w)/(float)(drw_w);
float ty1=Y1+(float)(pbox->y1 - dstBox->y1)*(Y2-Y1)/(float)(drw_h);
float ty2=Y1+(float)(pbox->y2 - dstBox->y1)*(src_h)/(float)(drw_h);
int sx1=pbox->x1;
int sx2=pbox->x2;
int sy1=pbox->y1;
int sy2=pbox->y2;
if (nouveau_pushbuf_space(push, 64, 0, 0) ||
nouveau_pushbuf_refn (push, refs, 3))
return BadImplementation;
if (pNv->dev->chipset >= 0x110) {
BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
PUSH_DATA (push, 256);
PUSH_DATA (push, (pNv->scratch->offset + PVP_DATA) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + PVP_DATA));
BEGIN_1IC0(push, NVC0_3D(CB_POS), 24 + 1);
PUSH_DATA (push, 0x80);
PUSH_DATAf(push, sx1);
PUSH_DATAf(push, sy1);
PUSH_DATAf(push, 0);
PUSH_DATAf(push, 1);
PUSH_DATAf(push, tx1);
PUSH_DATAf(push, ty1);
PUSH_DATAf(push, 0);
PUSH_DATAf(push, 0);
PUSH_DATAf(push, sx2+(sx2-sx1));
PUSH_DATAf(push, sy1);
PUSH_DATAf(push, 0);
PUSH_DATAf(push, 1);
PUSH_DATAf(push, tx2+(tx2-tx1));
PUSH_DATAf(push, ty1);
PUSH_DATAf(push, 0);
PUSH_DATAf(push, 0);
PUSH_DATAf(push, sx1);
PUSH_DATAf(push, sy2+(sy2-sy1));
PUSH_DATAf(push, 0);
PUSH_DATAf(push, 1);
PUSH_DATAf(push, tx1);
PUSH_DATAf(push, ty2+(ty2-ty1));
PUSH_DATAf(push, 0);
PUSH_DATAf(push, 0);
}
BEGIN_NVC0(push, NVC0_3D(SCISSOR_HORIZ(0)), 2);
PUSH_DATA (push, sx2 << NVC0_3D_SCISSOR_HORIZ_MAX__SHIFT | sx1);
PUSH_DATA (push, sy2 << NVC0_3D_SCISSOR_VERT_MAX__SHIFT | sy1 );
BEGIN_NVC0(push, NVC0_3D(VERTEX_BEGIN_GL), 1);
PUSH_DATA (push, NVC0_3D_VERTEX_BEGIN_GL_PRIMITIVE_TRIANGLES);
if (pNv->dev->chipset < 0x110) {
PUSH_VTX1s(push, tx1, ty1, sx1, sy1);
PUSH_VTX1s(push, tx2+(tx2-tx1), ty1, sx2+(sx2-sx1), sy1);
PUSH_VTX1s(push, tx1, ty2+(ty2-ty1), sx1, sy2+(sy2-sy1));
} else {
BEGIN_NVC0(push, NVC0_3D(VERTEX_BUFFER_FIRST), 2);
PUSH_DATA (push, 0);
PUSH_DATA (push, 3);
}
BEGIN_NVC0(push, NVC0_3D(VERTEX_END_GL), 1);
PUSH_DATA (push, 0);
pbox++;
}
PUSH_KICK(push);
return Success;
}
void
nvc0_xv_csc_update(NVPtr pNv, float yco, float *off, float *uco, float *vco)
{
struct nouveau_pushbuf *push = pNv->pushbuf;
if (nouveau_pushbuf_space(push, 64, 0, 0) ||
nouveau_pushbuf_refn (push, &(struct nouveau_pushbuf_refn) {
pNv->scratch, NOUVEAU_BO_WR |
NOUVEAU_BO_VRAM }, 1))
return;
BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
PUSH_DATA (push, 256);
PUSH_DATA (push, (pNv->scratch->offset + PFP_DATA) >> 32);
PUSH_DATA (push, (pNv->scratch->offset + PFP_DATA));
BEGIN_NVC0(push, NVC0_3D(CB_POS), 11);
PUSH_DATA (push, 0);
PUSH_DATAf(push, yco);
PUSH_DATAf(push, off[0]);
PUSH_DATAf(push, off[1]);
PUSH_DATAf(push, off[2]);
PUSH_DATAf(push, uco[0]);
PUSH_DATAf(push, uco[1]);
PUSH_DATAf(push, uco[2]);
PUSH_DATAf(push, vco[0]);
PUSH_DATAf(push, vco[1]);
PUSH_DATAf(push, vco[2]);
}
xf86-video-nouveau-1.0.16/src/nv_proto.h 0000644 0001750 0001756 00000023767 13423754626 014746 0000000 0000000 #ifndef __NV_PROTO_H__
#define __NV_PROTO_H__
/* in drmmode_display.c */
Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp);
void drmmode_adjust_frame(ScrnInfoPtr pScrn, int x, int y);
void drmmode_remove_fb(ScrnInfoPtr pScrn);
Bool drmmode_cursor_init(ScreenPtr pScreen);
void drmmode_fbcon_copy(ScreenPtr pScreen);
Bool drmmode_page_flip(DrawablePtr draw, PixmapPtr back, void *priv,
unsigned int ref_crtc_hw_id);
void drmmode_screen_init(ScreenPtr pScreen);
void drmmode_screen_fini(ScreenPtr pScreen);
int drmmode_crtc(xf86CrtcPtr crtc);
Bool drmmode_crtc_on(xf86CrtcPtr crtc);
int drmmode_head(xf86CrtcPtr crtc);
void drmmode_swap(ScrnInfoPtr, uint32_t, uint32_t *);
void *drmmode_event_queue(ScrnInfoPtr, uint64_t name, unsigned size,
void (*)(void *, uint64_t, uint64_t, uint32_t),
void **token);
void drmmode_event_abort(ScrnInfoPtr, uint64_t name, bool pending);
int drmmode_event_flush(ScrnInfoPtr);
/* in nv_accel_common.c */
Bool NVAccelCommonInit(ScrnInfoPtr pScrn);
void NVAccelCommonFini(ScrnInfoPtr pScrn);
Bool NVAccelGetCtxSurf2DFormatFromPixmap(PixmapPtr pPix, int *fmt_ret);
Bool NVAccelGetCtxSurf2DFormatFromPicture(PicturePtr pPix, int *fmt_ret);
PixmapPtr NVGetDrawablePixmap(DrawablePtr pDraw);
void NV11SyncToVBlank(PixmapPtr ppix, BoxPtr box);
Bool nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height,
int bpp, int usage_hint, int *pitch,
struct nouveau_bo **bo);
/* in nouveau_dri2.c */
Bool nouveau_dri2_init(ScreenPtr pScreen);
void nouveau_dri2_fini(ScreenPtr pScreen);
Bool nouveau_dri3_screen_init(ScreenPtr pScreen);
/* in nouveau_xv.c */
void NVInitVideo(ScreenPtr);
void NVTakedownVideo(ScrnInfoPtr);
void NVSetPortDefaults (ScrnInfoPtr pScrn, NVPortPrivPtr pPriv);
void NVXVComputeBicubicFilter(struct nouveau_bo *, unsigned, unsigned);
unsigned int nv_window_belongs_to_crtc(ScrnInfoPtr, int, int, int, int);
xf86CrtcPtr nouveau_pick_best_crtc(ScrnInfoPtr pScrn, Bool consider_disabled,
int x, int y, int w, int h);
/* in nouveau_exa.c */
Bool nouveau_exa_init(ScreenPtr pScreen);
Bool nouveau_exa_pixmap_is_onscreen(PixmapPtr pPixmap);
bool nv50_style_tiled_pixmap(PixmapPtr ppix);
Bool NVAccelM2MF(NVPtr pNv, int w, int h, int cpp, uint32_t srco, uint32_t dsto,
struct nouveau_bo *s, int sd, int sp, int sh, int sx, int sy,
struct nouveau_bo *d, int dd, int dp, int dh, int dx, int dy);
/* in nouveau_wfb.c */
void nouveau_wfb_setup_wrap(ReadMemoryProcPtr *, WriteMemoryProcPtr *,
DrawablePtr);
void nouveau_wfb_finish_wrap(DrawablePtr);
/* in nv_shadow.c */
void NVRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
/* in nv04_video_overlay.c */
void NV04PutOverlayImage(ScrnInfoPtr, struct nouveau_bo *, int, int, int,
BoxPtr, int, int, int, int, short, short, short,
short, short, short, RegionPtr clipBoxes);
int NV04SetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
int NV04GetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
void NV04StopOverlay(ScrnInfoPtr);
/* in nv04_video_blitter.c */
Bool NVPutBlitImage(ScrnInfoPtr, struct nouveau_bo *, int, int, int, BoxPtr,
int, int, int, int, short, short, short, short, short,
short, RegionPtr, PixmapPtr);
int NVSetBlitPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
int NVGetBlitPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
void NVStopBlitVideo(ScrnInfoPtr, pointer, Bool);
/* in nv04_exa.c */
Bool NV04EXAPrepareSolid(PixmapPtr, int, Pixel, Pixel);
void NV04EXASolid(PixmapPtr, int, int, int, int);
void NV04EXADoneSolid(PixmapPtr);
Bool NV04EXAPrepareCopy(PixmapPtr, PixmapPtr, int, int, int, Pixel);
void NV04EXACopy(PixmapPtr, int, int, int, int, int, int);
void NV04EXADoneCopy(PixmapPtr);
Bool NV04EXAUploadIFC(ScrnInfoPtr, const char *src, int src_pitch,
PixmapPtr pdPix, int x, int y, int w, int h, int cpp);
Bool NV04EXARectM2MF(NVPtr pNv, int, int, int,
struct nouveau_bo *, uint32_t, int, int, int, int, int,
struct nouveau_bo *, uint32_t, int, int, int, int, int);
/* in nv10_exa.c */
Bool NVAccelInitNV10TCL(ScrnInfoPtr pScrn);
Bool NV10EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
Bool NV10EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
PixmapPtr, PixmapPtr, PixmapPtr);
void NV10EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
void NV10EXADoneComposite(PixmapPtr);
/* in nv10_video_overlay.c */
void NV10PutOverlayImage(ScrnInfoPtr, struct nouveau_bo *, int, int, int, int,
BoxPtr, int, int, int, int, short, short, short,
short, short, short, RegionPtr clipBoxes);
int NV10SetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
int NV10GetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
void NV10StopOverlay(ScrnInfoPtr);
void NV10WriteOverlayParameters(ScrnInfoPtr);
/* in nv30_exa.c */
Bool NVAccelInitNV30TCL(ScrnInfoPtr pScrn);
Bool NV30EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
Bool NV30EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
PixmapPtr, PixmapPtr, PixmapPtr);
void NV30EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
void NV30EXADoneComposite(PixmapPtr);
/* in nv30_video_texture.c */
int NV30PutTextureImage(ScrnInfoPtr, struct nouveau_bo *, int, int, int, int,
BoxPtr, int, int, int, int, uint16_t, uint16_t,
uint16_t, uint16_t, uint16_t, uint16_t,
RegionPtr, PixmapPtr, NVPortPrivPtr);
void NV30StopTexturedVideo(ScrnInfoPtr, pointer, Bool);
int NV30GetTexturePortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
int NV30SetTexturePortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
/* in nv40_exa.c */
Bool NVAccelInitNV40TCL(ScrnInfoPtr pScrn);
Bool NV40EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
Bool NV40EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
PixmapPtr, PixmapPtr, PixmapPtr);
void NV40EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
void NV40EXADoneComposite(PixmapPtr);
/* in nv40_video_texture.c */
int NV40PutTextureImage(ScrnInfoPtr, struct nouveau_bo *, int, int, int, int,
BoxPtr, int, int, int, int, uint16_t, uint16_t,
uint16_t, uint16_t, uint16_t, uint16_t,
RegionPtr, PixmapPtr, NVPortPrivPtr);
void NV40StopTexturedVideo(ScrnInfoPtr, pointer, Bool);
int NV40GetTexturePortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
int NV40SetTexturePortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
/* in nv50_accel.c */
void NV50SyncToVBlank(PixmapPtr ppix, BoxPtr box);
Bool NVAccelInitM2MF_NV50(ScrnInfoPtr pScrn);
Bool NVAccelInit2D_NV50(ScrnInfoPtr pScrn);
Bool NVAccelInitNV50TCL(ScrnInfoPtr pScrn);
/* in nvc0_accel.c */
void NVC0SyncToVBlank(PixmapPtr ppix, BoxPtr box);
Bool NVAccelInitM2MF_NVC0(ScrnInfoPtr pScrn);
Bool NVAccelInitP2MF_NVE0(ScrnInfoPtr pScrn);
Bool NVAccelInitCOPY_NVE0(ScrnInfoPtr pScrn);
Bool NVAccelInit2D_NVC0(ScrnInfoPtr pScrn);
Bool NVAccelInit3D_NVC0(ScrnInfoPtr pScrn);
/* in nv50_exa.c */
Bool NV50EXAPrepareSolid(PixmapPtr, int, Pixel, Pixel);
void NV50EXASolid(PixmapPtr, int, int, int, int);
void NV50EXADoneSolid(PixmapPtr);
Bool NV50EXAPrepareCopy(PixmapPtr, PixmapPtr, int, int, int, Pixel);
void NV50EXACopy(PixmapPtr, int, int, int, int, int, int);
void NV50EXADoneCopy(PixmapPtr);
Bool NV50EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
Bool NV50EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
PixmapPtr, PixmapPtr, PixmapPtr);
void NV50EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
void NV50EXADoneComposite(PixmapPtr);
Bool NV50EXAUploadSIFC(const char *src, int src_pitch,
PixmapPtr pdPix, int x, int y, int w, int h, int cpp);
Bool NV50EXARectM2MF(NVPtr pNv, int, int, int,
struct nouveau_bo *, uint32_t, int, int, int, int, int,
struct nouveau_bo *, uint32_t, int, int, int, int, int);
/* in nvc0_exa.c */
Bool NVC0AccelUploadM2MF(PixmapPtr pdpix, int x, int y, int w, int h,
const char *src, int src_pitch);
Bool NVC0AccelDownloadM2MF(PixmapPtr pspix, int x, int y, int w, int h,
char *dst, unsigned dst_pitch);
Bool NVC0EXAPrepareSolid(PixmapPtr, int, Pixel, Pixel);
void NVC0EXASolid(PixmapPtr, int, int, int, int);
void NVC0EXADoneSolid(PixmapPtr);
Bool NVC0EXAPrepareCopy(PixmapPtr, PixmapPtr, int, int, int, Pixel);
void NVC0EXACopy(PixmapPtr, int, int, int, int, int, int);
void NVC0EXADoneCopy(PixmapPtr);
Bool NVC0EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
Bool NVC0EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
PixmapPtr, PixmapPtr, PixmapPtr);
void NVC0EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
void NVC0EXADoneComposite(PixmapPtr);
Bool NVC0EXAUploadSIFC(const char *src, int src_pitch,
PixmapPtr pdPix, int x, int y, int w, int h, int cpp);
Bool NVC0EXARectM2MF(NVPtr pNv, int, int, int,
struct nouveau_bo *, uint32_t, int, int, int, int, int,
struct nouveau_bo *, uint32_t, int, int, int, int, int);
Bool NVE0EXARectCopy(NVPtr pNv, int, int, int,
struct nouveau_bo *, uint32_t, int, int, int, int, int,
struct nouveau_bo *, uint32_t, int, int, int, int, int);
/* nv50_xv.c */
int nv50_xv_image_put(ScrnInfoPtr, struct nouveau_bo *, int, int, int, int,
BoxPtr, int, int, int, int, uint16_t, uint16_t,
uint16_t, uint16_t, uint16_t, uint16_t,
RegionPtr, PixmapPtr, NVPortPrivPtr);
void nv50_xv_video_stop(ScrnInfoPtr, pointer, Bool);
int nv50_xv_port_attribute_set(ScrnInfoPtr, Atom, INT32, pointer);
int nv50_xv_port_attribute_get(ScrnInfoPtr, Atom, INT32 *, pointer);
void nv50_xv_set_port_defaults(ScrnInfoPtr, NVPortPrivPtr);
void nv50_xv_csc_update(ScrnInfoPtr, NVPortPrivPtr);
/* nvc0_xv.c */
int nvc0_xv_image_put(ScrnInfoPtr, struct nouveau_bo *, int, int, int, int,
BoxPtr, int, int, int, int, uint16_t, uint16_t,
uint16_t, uint16_t, uint16_t, uint16_t,
RegionPtr, PixmapPtr, NVPortPrivPtr);
void nvc0_xv_csc_update(NVPtr, float, float *, float *, float *);
/* To support EXA 2.0, 2.1 has this in the header */
#ifndef exaMoveInPixmap
extern void exaMoveInPixmap(PixmapPtr pPixmap);
#endif
extern Bool wfbPictureInit(ScreenPtr, PictFormatPtr, int);
#endif /* __NV_PROTO_H__ */
xf86-video-nouveau-1.0.16/src/nouveau_sync.c 0000644 0001750 0001756 00000007076 13423754626 015604 0000000 0000000 /*
* Copyright © 2013-2014 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#include "nouveau_sync.h"
#ifdef DRI3
#include "nv_include.h"
static DevPrivateKeyRec nouveau_syncobj_key;
struct nouveau_syncobj {
SyncFenceSetTriggeredFunc SetTriggered;
};
#define nouveau_syncobj(fence) \
dixLookupPrivate(&(fence)->devPrivates, &nouveau_syncobj_key)
struct nouveau_syncctx {
SyncScreenCreateFenceFunc CreateFence;
};
#define nouveau_syncctx(screen) ({ \
ScrnInfoPtr scrn = xf86ScreenToScrn(screen); \
NVPtr pNv = NVPTR(scrn); \
pNv->sync; \
})
static void
nouveau_syncobj_flush(SyncFence *fence)
{
struct nouveau_syncobj *pobj = nouveau_syncobj(fence);
ScrnInfoPtr scrn = xf86ScreenToScrn(fence->pScreen);
NVPtr pNv = NVPTR(scrn);
SyncFenceFuncsPtr func = &fence->funcs;
if (pNv->Flush)
pNv->Flush(scrn);
swap(pobj, func, SetTriggered);
func->SetTriggered(fence);
swap(pobj, func, SetTriggered);
}
static void
nouveau_syncobj_new(ScreenPtr screen, SyncFence *fence, Bool triggered)
{
struct nouveau_syncctx *priv = nouveau_syncctx(screen);
struct nouveau_syncobj *pobj = nouveau_syncobj(fence);
SyncScreenFuncsPtr sync = miSyncGetScreenFuncs(screen);
SyncFenceFuncsPtr func = &fence->funcs;
swap(priv, sync, CreateFence);
sync->CreateFence(screen, fence, triggered);
swap(priv, sync, CreateFence);
wrap(pobj, func, SetTriggered, nouveau_syncobj_flush);
}
void
nouveau_sync_fini(ScreenPtr screen)
{
struct nouveau_syncctx *priv = nouveau_syncctx(screen);
SyncScreenFuncsPtr sync = miSyncGetScreenFuncs(screen);
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
NVPtr pNv = NVPTR(scrn);
unwrap(priv, sync, CreateFence);
pNv->sync = NULL;
free(priv);
}
Bool
nouveau_sync_init(ScreenPtr screen)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
NVPtr pNv = NVPTR(scrn);
struct nouveau_syncctx *priv;
SyncScreenFuncsPtr sync;
priv = pNv->sync = calloc(1, sizeof(*priv));
if (!priv)
return FALSE;
if (!miSyncShmScreenInit(screen))
return FALSE;
if (!dixPrivateKeyRegistered(&nouveau_syncobj_key)) {
if (!dixRegisterPrivateKey(&nouveau_syncobj_key,
PRIVATE_SYNC_FENCE,
sizeof(struct nouveau_syncobj)))
return FALSE;
}
sync = miSyncGetScreenFuncs(screen);
wrap(priv, sync, CreateFence, nouveau_syncobj_new);
return TRUE;
}
#endif
xf86-video-nouveau-1.0.16/src/nv_include.h 0000644 0001750 0001756 00000002344 13423754626 015212 0000000 0000000 #ifndef __NV_INCLUDE_H__
#define __NV_INCLUDE_H__
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
#include
#include
#include
#include
/* All drivers should typically include these */
#include "xf86.h"
#include "xf86_OSproc.h"
#define PPC_MMIO_IS_BE
#include "compiler.h"
/* Drivers that need to access the PCI config space directly need this */
#include "xf86Pci.h"
#ifdef XSERVER_PLATFORM_BUS
#include "xf86platformBus.h"
#endif
/* All drivers initialising the SW cursor need this */
#include "mipointer.h"
#include "micmap.h"
#include "xf86DDC.h"
#include "xf86RandR12.h"
#include "nv_const.h"
#include "dixstruct.h"
#include "scrnintstr.h"
#include "fb.h"
#include "xf86cmap.h"
#include "shadowfb.h"
#include "xf86xv.h"
#include
#include "xf86Cursor.h"
#include "xf86DDC.h"
#include "region.h"
#include
#ifdef HAVE_XEXTPROTO_71
#include
#else
#define DPMS_SERVER
#include
#endif
#define NV_DMA_DEBUG 0
#include "compat-api.h"
#include "nouveau_local.h"
#include "nv_type.h"
#include "nv_proto.h"
#include "nv_dma.h"
#include "sarea.h"
#endif /* __NV_INCLUDE_H__ */
xf86-video-nouveau-1.0.16/src/nv50_exa.c 0000644 0001750 0001756 00000066242 13423754626 014513 0000000 0000000 /*
* Copyright 2007 NVIDIA, Corporation
* Copyright 2008 Ben Skeggs
*
* 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.
*/
#include "nv_include.h"
#include "nv_rop.h"
#include "nv50_accel.h"
#define NV50EXA_LOCALS(p) \
ScrnInfoPtr pScrn = xf86ScreenToScrn((p)->drawable.pScreen); \
NVPtr pNv = NVPTR(pScrn); \
struct nouveau_pushbuf *push = pNv->pushbuf; (void)push;
#define BF(f) NV50_BLEND_FACTOR_##f
struct nv50_blend_op {
unsigned src_alpha;
unsigned dst_alpha;
unsigned src_blend;
unsigned dst_blend;
};
static struct nv50_blend_op
NV50EXABlendOp[] = {
/* Clear */ { 0, 0, BF( ZERO), BF( ZERO) },
/* Src */ { 0, 0, BF( ONE), BF( ZERO) },
/* Dst */ { 0, 0, BF( ZERO), BF( ONE) },
/* Over */ { 1, 0, BF( ONE), BF(ONE_MINUS_SRC_ALPHA) },
/* OverReverse */ { 0, 1, BF(ONE_MINUS_DST_ALPHA), BF( ONE) },
/* In */ { 0, 1, BF( DST_ALPHA), BF( ZERO) },
/* InReverse */ { 1, 0, BF( ZERO), BF( SRC_ALPHA) },
/* Out */ { 0, 1, BF(ONE_MINUS_DST_ALPHA), BF( ZERO) },
/* OutReverse */ { 1, 0, BF( ZERO), BF(ONE_MINUS_SRC_ALPHA) },
/* Atop */ { 1, 1, BF( DST_ALPHA), BF(ONE_MINUS_SRC_ALPHA) },
/* AtopReverse */ { 1, 1, BF(ONE_MINUS_DST_ALPHA), BF( SRC_ALPHA) },
/* Xor */ { 1, 1, BF(ONE_MINUS_DST_ALPHA), BF(ONE_MINUS_SRC_ALPHA) },
/* Add */ { 0, 0, BF( ONE), BF( ONE) },
};
static Bool
NV50EXA2DSurfaceFormat(PixmapPtr ppix, uint32_t *fmt)
{
NV50EXA_LOCALS(ppix);
switch (ppix->drawable.bitsPerPixel) {
case 8 : *fmt = NV50_SURFACE_FORMAT_R8_UNORM; break;
case 15: *fmt = NV50_SURFACE_FORMAT_BGR5_X1_UNORM; break;
case 16: *fmt = NV50_SURFACE_FORMAT_B5G6R5_UNORM; break;
case 24: *fmt = NV50_SURFACE_FORMAT_BGRX8_UNORM; break;
case 30: *fmt = NV50_SURFACE_FORMAT_RGB10_A2_UNORM; break;
case 32: *fmt = NV50_SURFACE_FORMAT_BGRA8_UNORM; break;
default:
NOUVEAU_FALLBACK("Unknown surface format for bpp=%d\n",
ppix->drawable.bitsPerPixel);
return FALSE;
}
return TRUE;
}
static void NV50EXASetClip(PixmapPtr ppix, int x, int y, int w, int h)
{
NV50EXA_LOCALS(ppix);
BEGIN_NV04(push, NV50_2D(CLIP_X), 4);
PUSH_DATA (push, x);
PUSH_DATA (push, y);
PUSH_DATA (push, w);
PUSH_DATA (push, h);
}
static void
NV50EXAAcquireSurface2D(PixmapPtr ppix, int is_src, uint32_t fmt)
{
NV50EXA_LOCALS(ppix);
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
int mthd = is_src ? NV50_2D_SRC_FORMAT : NV50_2D_DST_FORMAT;
uint32_t bo_flags;
bo_flags = nvpix->shared ? NOUVEAU_BO_GART : NOUVEAU_BO_VRAM;
bo_flags |= is_src ? NOUVEAU_BO_RD : NOUVEAU_BO_WR;
if (!nv50_style_tiled_pixmap(ppix)) {
BEGIN_NV04(push, SUBC_2D(mthd), 2);
PUSH_DATA (push, fmt);
PUSH_DATA (push, 1);
BEGIN_NV04(push, SUBC_2D(mthd + 0x14), 1);
PUSH_DATA (push, (uint32_t)exaGetPixmapPitch(ppix));
} else {
BEGIN_NV04(push, SUBC_2D(mthd), 5);
PUSH_DATA (push, fmt);
PUSH_DATA (push, 0);
PUSH_DATA (push, bo->config.nv50.tile_mode);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
}
BEGIN_NV04(push, SUBC_2D(mthd + 0x18), 4);
PUSH_DATA (push, ppix->drawable.width);
PUSH_DATA (push, ppix->drawable.height);
PUSH_DATA (push, bo->offset >> 32);
PUSH_DATA (push, bo->offset);
if (is_src == 0)
NV50EXASetClip(ppix, 0, 0, ppix->drawable.width, ppix->drawable.height);
PUSH_REFN (push, bo, bo_flags);
}
static void
NV50EXASetPattern(PixmapPtr pdpix, int col0, int col1, int pat0, int pat1)
{
NV50EXA_LOCALS(pdpix);
BEGIN_NV04(push, NV50_2D(PATTERN_COLOR(0)), 4);
PUSH_DATA (push, col0);
PUSH_DATA (push, col1);
PUSH_DATA (push, pat0);
PUSH_DATA (push, pat1);
}
static void
NV50EXASetROP(PixmapPtr pdpix, int alu, Pixel planemask)
{
NV50EXA_LOCALS(pdpix);
int rop;
if (planemask != ~0)
rop = NVROP[alu].copy_planemask;
else
rop = NVROP[alu].copy;
BEGIN_NV04(push, NV50_2D(OPERATION), 1);
if (alu == GXcopy && EXA_PM_IS_SOLID(&pdpix->drawable, planemask)) {
PUSH_DATA (push, NV50_2D_OPERATION_SRCCOPY);
return;
} else {
PUSH_DATA (push, NV50_2D_OPERATION_ROP);
}
BEGIN_NV04(push, NV50_2D(PATTERN_COLOR_FORMAT), 2);
switch (pdpix->drawable.bitsPerPixel) {
case 8: PUSH_DATA (push, 3); break;
case 15: PUSH_DATA (push, 1); break;
case 16: PUSH_DATA (push, 0); break;
case 24:
case 32:
default:
PUSH_DATA (push, 2);
break;
}
PUSH_DATA (push, 1);
/* There are 16 alu's.
* 0-15: copy
* 16-31: copy_planemask
*/
if (!EXA_PM_IS_SOLID(&pdpix->drawable, planemask)) {
alu += 16;
NV50EXASetPattern(pdpix, 0, planemask, ~0, ~0);
} else {
if (pNv->currentRop > 15)
NV50EXASetPattern(pdpix, ~0, ~0, ~0, ~0);
}
if (pNv->currentRop != alu) {
BEGIN_NV04(push, NV50_2D(ROP), 1);
PUSH_DATA (push, rop);
pNv->currentRop = alu;
}
}
Bool
NV50EXAPrepareSolid(PixmapPtr pdpix, int alu, Pixel planemask, Pixel fg)
{
NV50EXA_LOCALS(pdpix);
uint32_t fmt;
if (!NV50EXA2DSurfaceFormat(pdpix, &fmt))
NOUVEAU_FALLBACK("rect format\n");
if (!PUSH_SPACE(push, 64))
NOUVEAU_FALLBACK("space\n");
PUSH_RESET(push);
NV50EXAAcquireSurface2D(pdpix, 0, fmt);
NV50EXASetROP(pdpix, alu, planemask);
BEGIN_NV04(push, NV50_2D(DRAW_SHAPE), 3);
PUSH_DATA (push, NV50_2D_DRAW_SHAPE_RECTANGLES);
PUSH_DATA (push, fmt);
PUSH_DATA (push, fg);
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push)) {
nouveau_pushbuf_bufctx(push, NULL);
NOUVEAU_FALLBACK("validate\n");
}
return TRUE;
}
void
NV50EXASolid(PixmapPtr pdpix, int x1, int y1, int x2, int y2)
{
NV50EXA_LOCALS(pdpix);
if (!PUSH_SPACE(push, 8))
return;
BEGIN_NV04(push, NV50_2D(DRAW_POINT32_X(0)), 4);
PUSH_DATA (push, x1);
PUSH_DATA (push, y1);
PUSH_DATA (push, x2);
PUSH_DATA (push, y2);
if ((x2 - x1) * (y2 - y1) >= 512)
PUSH_KICK(push);
}
void
NV50EXADoneSolid(PixmapPtr pdpix)
{
NV50EXA_LOCALS(pdpix);
nouveau_pushbuf_bufctx(push, NULL);
}
Bool
NV50EXAPrepareCopy(PixmapPtr pspix, PixmapPtr pdpix, int dx, int dy,
int alu, Pixel planemask)
{
NV50EXA_LOCALS(pdpix);
uint32_t src, dst;
if (!NV50EXA2DSurfaceFormat(pspix, &src))
NOUVEAU_FALLBACK("src format\n");
if (!NV50EXA2DSurfaceFormat(pdpix, &dst))
NOUVEAU_FALLBACK("dst format\n");
if (!PUSH_SPACE(push, 64))
NOUVEAU_FALLBACK("space\n");
PUSH_RESET(push);
NV50EXAAcquireSurface2D(pspix, 1, src);
NV50EXAAcquireSurface2D(pdpix, 0, dst);
NV50EXASetROP(pdpix, alu, planemask);
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push)) {
nouveau_pushbuf_bufctx(push, NULL);
NOUVEAU_FALLBACK("validate\n");
}
return TRUE;
}
void
NV50EXACopy(PixmapPtr pdpix, int srcX , int srcY,
int dstX , int dstY,
int width, int height)
{
NV50EXA_LOCALS(pdpix);
if (!PUSH_SPACE(push, 32))
return;
BEGIN_NV04(push, SUBC_2D(NV50_GRAPH_SERIALIZE), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV50_2D(BLIT_CONTROL), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV50_2D(BLIT_DST_X), 12);
PUSH_DATA (push, dstX);
PUSH_DATA (push, dstY);
PUSH_DATA (push, width);
PUSH_DATA (push, height);
PUSH_DATA (push, 0);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
PUSH_DATA (push, srcX);
PUSH_DATA (push, 0);
PUSH_DATA (push, srcY);
if (width * height >= 512)
PUSH_KICK(push);
}
void
NV50EXADoneCopy(PixmapPtr pdpix)
{
NV50EXA_LOCALS(pdpix);
nouveau_pushbuf_bufctx(push, NULL);
}
Bool
NV50EXAUploadSIFC(const char *src, int src_pitch,
PixmapPtr pdpix, int x, int y, int w, int h, int cpp)
{
NV50EXA_LOCALS(pdpix);
ScreenPtr pScreen = pdpix->drawable.pScreen;
int line_dwords = (w * cpp + 3) / 4;
uint32_t sifc_fmt;
Bool ret = FALSE;
if (!NV50EXA2DSurfaceFormat(pdpix, &sifc_fmt))
NOUVEAU_FALLBACK("hostdata format\n");
if (!PUSH_SPACE(push, 64))
NOUVEAU_FALLBACK("space\n");
PUSH_RESET(push);
NV50EXAAcquireSurface2D(pdpix, 0, sifc_fmt);
NV50EXASetClip(pdpix, x, y, w, h);
BEGIN_NV04(push, NV50_2D(OPERATION), 1);
PUSH_DATA (push, NV50_2D_OPERATION_SRCCOPY);
BEGIN_NV04(push, NV50_2D(SIFC_BITMAP_ENABLE), 2);
PUSH_DATA (push, 0);
PUSH_DATA (push, sifc_fmt);
BEGIN_NV04(push, NV50_2D(SIFC_WIDTH), 10);
PUSH_DATA (push, (line_dwords * 4) / cpp);
PUSH_DATA (push, h);
PUSH_DATA (push, 0);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
PUSH_DATA (push, x);
PUSH_DATA (push, 0);
PUSH_DATA (push, y);
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push))
goto out;
while (h--) {
int count = line_dwords;
const char *p = src;
while(count) {
int size = count > 1792 ? 1792 : count;
if (!PUSH_SPACE(push, size + 1))
goto out;
BEGIN_NI04(push, NV50_2D(SIFC_DATA), size);
PUSH_DATAp(push, p, size);
p += size * 4;
count -= size;
}
src += src_pitch;
}
ret = TRUE;
out:
nouveau_pushbuf_bufctx(push, NULL);
if (pdpix == pScreen->GetScreenPixmap(pScreen))
PUSH_KICK(push);
return ret;
}
static Bool
NV50EXACheckRenderTarget(PicturePtr ppict)
{
if (ppict->pDrawable->width > 8192 ||
ppict->pDrawable->height > 8192)
NOUVEAU_FALLBACK("render target dimensions exceeded %dx%d\n",
ppict->pDrawable->width,
ppict->pDrawable->height);
switch (ppict->format) {
case PICT_a8r8g8b8:
case PICT_x8r8g8b8:
case PICT_r5g6b5:
case PICT_a8:
case PICT_x1r5g5b5:
case PICT_a1r5g5b5:
case PICT_x8b8g8r8:
case PICT_a2b10g10r10:
case PICT_x2b10g10r10:
case PICT_a2r10g10b10:
case PICT_x2r10g10b10:
break;
default:
NOUVEAU_FALLBACK("picture format 0x%08x\n", ppict->format);
}
return TRUE;
}
static Bool
NV50EXARenderTarget(PixmapPtr ppix, PicturePtr ppict)
{
NV50EXA_LOCALS(ppix);
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
unsigned format;
/*XXX: Scanout buffer not tiled, someone needs to figure it out */
if (!nv50_style_tiled_pixmap(ppix))
NOUVEAU_FALLBACK("pixmap is scanout buffer\n");
switch (ppict->format) {
case PICT_a8r8g8b8: format = NV50_SURFACE_FORMAT_BGRA8_UNORM; break;
case PICT_x8r8g8b8: format = NV50_SURFACE_FORMAT_BGRX8_UNORM; break;
case PICT_r5g6b5 : format = NV50_SURFACE_FORMAT_B5G6R5_UNORM; break;
case PICT_a8 : format = NV50_SURFACE_FORMAT_A8_UNORM; break;
case PICT_x1r5g5b5:
case PICT_a1r5g5b5:
format = NV50_SURFACE_FORMAT_BGR5_A1_UNORM;
break;
case PICT_x8b8g8r8: format = NV50_SURFACE_FORMAT_RGBX8_UNORM; break;
case PICT_a2b10g10r10:
case PICT_x2b10g10r10:
format = NV50_SURFACE_FORMAT_RGB10_A2_UNORM;
break;
case PICT_a2r10g10b10:
case PICT_x2r10g10b10:
format = NV50_SURFACE_FORMAT_BGR10_A2_UNORM;
break;
default:
NOUVEAU_FALLBACK("invalid picture format\n");
}
PUSH_REFN (push, bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
BEGIN_NV04(push, NV50_3D(RT_ADDRESS_HIGH(0)), 5);
PUSH_DATA (push, bo->offset >> 32);
PUSH_DATA (push, bo->offset);
PUSH_DATA (push, format);
PUSH_DATA (push, bo->config.nv50.tile_mode);
PUSH_DATA (push, 0x00000000);
BEGIN_NV04(push, NV50_3D(RT_HORIZ(0)), 2);
PUSH_DATA (push, ppix->drawable.width);
PUSH_DATA (push, ppix->drawable.height);
BEGIN_NV04(push, NV50_3D(RT_ARRAY_MODE), 1);
PUSH_DATA (push, 0x00000001);
return TRUE;
}
static Bool
NV50EXACheckTexture(PicturePtr ppict, PicturePtr pdpict, int op)
{
if (ppict->pDrawable) {
if (ppict->pDrawable->width > 8192 ||
ppict->pDrawable->height > 8192)
NOUVEAU_FALLBACK("texture too large\n");
} else {
switch (ppict->pSourcePict->type) {
case SourcePictTypeSolidFill:
break;
default:
NOUVEAU_FALLBACK("pict %d\n", ppict->pSourcePict->type);
break;
}
}
switch (ppict->format) {
case PICT_a8r8g8b8:
case PICT_a8b8g8r8:
case PICT_x8r8g8b8:
case PICT_x8b8g8r8:
case PICT_r5g6b5:
case PICT_a8:
case PICT_x1r5g5b5:
case PICT_x1b5g5r5:
case PICT_a1r5g5b5:
case PICT_a1b5g5r5:
case PICT_b5g6r5:
case PICT_b8g8r8a8:
case PICT_b8g8r8x8:
case PICT_a2b10g10r10:
case PICT_x2b10g10r10:
case PICT_x2r10g10b10:
case PICT_a2r10g10b10:
case PICT_x4r4g4b4:
case PICT_x4b4g4r4:
case PICT_a4r4g4b4:
case PICT_a4b4g4r4:
break;
default:
NOUVEAU_FALLBACK("picture format 0x%08x\n", ppict->format);
}
switch (ppict->filter) {
case PictFilterNearest:
case PictFilterBilinear:
break;
default:
NOUVEAU_FALLBACK("picture filter %d\n", ppict->filter);
}
/* Opengl and Render disagree on what should be sampled outside an XRGB
* texture (with no repeating). Opengl has a hardcoded alpha value of
* 1.0, while render expects 0.0. We assume that clipping is done for
* untranformed sources.
*/
if (NV50EXABlendOp[op].src_alpha && !ppict->repeat &&
ppict->transform && (PICT_FORMAT_A(ppict->format) == 0)
&& (PICT_FORMAT_A(pdpict->format) != 0))
NOUVEAU_FALLBACK("REPEAT_NONE unsupported for XRGB source\n");
return TRUE;
}
#define _(X1,X2,X3,X4,FMT) (NV50TIC_0_0_TYPER_UNORM | NV50TIC_0_0_TYPEG_UNORM | NV50TIC_0_0_TYPEB_UNORM | NV50TIC_0_0_TYPEA_UNORM | \
NV50TIC_0_0_MAP##X1 | NV50TIC_0_0_MAP##X2 | NV50TIC_0_0_MAP##X3 | NV50TIC_0_0_MAP##X4 | \
NV50TIC_0_0_FMT_##FMT)
static Bool
NV50EXAPictSolid(NVPtr pNv, PicturePtr ppict, unsigned unit)
{
uint64_t offset = pNv->scratch->offset + SOLID(unit);
struct nouveau_pushbuf *push = pNv->pushbuf;
PUSH_DATAu(push, pNv->scratch, SOLID(unit), 1);
PUSH_DATA (push, ppict->pSourcePict->solidFill.color);
PUSH_DATAu(push, pNv->scratch, TIC_OFFSET + (unit * 32), 8);
PUSH_DATA (push, _(B_C0, G_C1, R_C2, A_C3, 8_8_8_8));
PUSH_DATA (push, offset);
PUSH_DATA (push, (offset >> 32) | 0xd005d000);
PUSH_DATA (push, 0x00300000);
PUSH_DATA (push, 0x00000001);
PUSH_DATA (push, 0x00010001);
PUSH_DATA (push, 0x03000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATAu(push, pNv->scratch, TSC_OFFSET + (unit * 32), 8);
PUSH_DATA (push, NV50TSC_1_0_WRAPS_REPEAT |
NV50TSC_1_0_WRAPT_REPEAT |
NV50TSC_1_0_WRAPR_REPEAT | 0x00024000);
PUSH_DATA (push, NV50TSC_1_1_MAGF_NEAREST |
NV50TSC_1_1_MINF_NEAREST |
NV50TSC_1_1_MIPF_NONE);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
return TRUE;
}
static Bool
NV50EXAPictGradient(NVPtr pNv, PicturePtr ppict, unsigned unit)
{
return FALSE;
}
static Bool
NV50EXAPictTexture(NVPtr pNv, PixmapPtr ppix, PicturePtr ppict, unsigned unit)
{
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
struct nouveau_pushbuf *push = pNv->pushbuf;
uint32_t format;
/*XXX: Scanout buffer not tiled, someone needs to figure it out */
if (!nv50_style_tiled_pixmap(ppix))
NOUVEAU_FALLBACK("pixmap is scanout buffer\n");
switch (ppict->format) {
case PICT_a8r8g8b8:
format = _(B_C0, G_C1, R_C2, A_C3, 8_8_8_8);
break;
case PICT_a8b8g8r8:
format = _(R_C0, G_C1, B_C2, A_C3, 8_8_8_8);
break;
case PICT_x8r8g8b8:
format = _(B_C0, G_C1, R_C2, A_ONE, 8_8_8_8);
break;
case PICT_x8b8g8r8:
format = _(R_C0, G_C1, B_C2, A_ONE, 8_8_8_8);
break;
case PICT_r5g6b5:
format = _(B_C0, G_C1, R_C2, A_ONE, 5_6_5);
break;
case PICT_a8:
format = _(A_C0, B_ZERO, G_ZERO, R_ZERO, 8);
break;
case PICT_x1r5g5b5:
format = _(B_C0, G_C1, R_C2, A_ONE, 1_5_5_5);
break;
case PICT_x1b5g5r5:
format = _(R_C0, G_C1, B_C2, A_ONE, 1_5_5_5);
break;
case PICT_a1r5g5b5:
format = _(B_C0, G_C1, R_C2, A_C3, 1_5_5_5);
break;
case PICT_a1b5g5r5:
format = _(R_C0, G_C1, B_C2, A_C3, 1_5_5_5);
break;
case PICT_b5g6r5:
format = _(R_C0, G_C1, B_C2, A_ONE, 5_6_5);
break;
case PICT_b8g8r8x8:
format = _(A_ONE, R_C1, G_C2, B_C3, 8_8_8_8);
break;
case PICT_b8g8r8a8:
format = _(A_C0, R_C1, G_C2, B_C3, 8_8_8_8);
break;
case PICT_a2b10g10r10:
format = _(R_C0, G_C1, B_C2, A_C3, 2_10_10_10);
break;
case PICT_x2b10g10r10:
format = _(R_C0, G_C1, B_C2, A_ONE, 2_10_10_10);
break;
case PICT_x2r10g10b10:
format = _(B_C0, G_C1, R_C2, A_ONE, 2_10_10_10);
break;
case PICT_a2r10g10b10:
format = _(B_C0, G_C1, R_C2, A_C3, 2_10_10_10);
break;
case PICT_x4r4g4b4:
format = _(B_C0, G_C1, R_C2, A_ONE, 4_4_4_4);
break;
case PICT_x4b4g4r4:
format = _(R_C0, G_C1, B_C2, A_ONE, 4_4_4_4);
break;
case PICT_a4r4g4b4:
format = _(B_C0, G_C1, R_C2, A_C3, 4_4_4_4);
break;
case PICT_a4b4g4r4:
format = _(R_C0, G_C1, B_C2, A_C3, 4_4_4_4);
break;
default:
NOUVEAU_FALLBACK("invalid picture format, this SHOULD NOT HAPPEN. Expect trouble.\n");
}
#undef _
PUSH_REFN (push, bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
PUSH_DATAu(push, pNv->scratch, TIC_OFFSET + (unit * 32), 8);
PUSH_DATA (push, format);
PUSH_DATA (push, bo->offset);
PUSH_DATA (push, (bo->offset >> 32) |
(bo->config.nv50.tile_mode << 18) |
0xd0005000);
PUSH_DATA (push, 0x00300000);
PUSH_DATA (push, ppix->drawable.width);
PUSH_DATA (push, (1 << NV50TIC_0_5_DEPTH_SHIFT) | ppix->drawable.height);
PUSH_DATA (push, 0x03000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATAu(push, pNv->scratch, TSC_OFFSET + (unit * 32), 8);
if (ppict->repeat) {
switch (ppict->repeatType) {
case RepeatPad:
PUSH_DATA (push, NV50TSC_1_0_WRAPS_CLAMP_TO_EDGE |
NV50TSC_1_0_WRAPT_CLAMP_TO_EDGE |
NV50TSC_1_0_WRAPR_CLAMP_TO_EDGE | 0x00024000);
break;
case RepeatReflect:
PUSH_DATA (push, NV50TSC_1_0_WRAPS_MIRROR_REPEAT |
NV50TSC_1_0_WRAPT_MIRROR_REPEAT |
NV50TSC_1_0_WRAPR_MIRROR_REPEAT | 0x00024000);
break;
case RepeatNormal:
default:
PUSH_DATA (push, NV50TSC_1_0_WRAPS_REPEAT |
NV50TSC_1_0_WRAPT_REPEAT |
NV50TSC_1_0_WRAPR_REPEAT | 0x00024000);
break;
}
} else {
PUSH_DATA (push, NV50TSC_1_0_WRAPS_CLAMP_TO_BORDER |
NV50TSC_1_0_WRAPT_CLAMP_TO_BORDER |
NV50TSC_1_0_WRAPR_CLAMP_TO_BORDER | 0x00024000);
}
if (ppict->filter == PictFilterBilinear) {
PUSH_DATA (push, NV50TSC_1_1_MAGF_LINEAR |
NV50TSC_1_1_MINF_LINEAR |
NV50TSC_1_1_MIPF_NONE);
} else {
PUSH_DATA (push, NV50TSC_1_1_MAGF_NEAREST |
NV50TSC_1_1_MINF_NEAREST |
NV50TSC_1_1_MIPF_NONE);
}
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATA (push, 0x00000000);
PUSH_DATAu(push, pNv->scratch, PVP_DATA + (unit * 11 * 4), 11);
if (ppict->transform) {
PUSH_DATAf(push, xFixedToFloat(ppict->transform->matrix[0][0]));
PUSH_DATAf(push, xFixedToFloat(ppict->transform->matrix[0][1]));
PUSH_DATAf(push, xFixedToFloat(ppict->transform->matrix[0][2]));
PUSH_DATAf(push, xFixedToFloat(ppict->transform->matrix[1][0]));
PUSH_DATAf(push, xFixedToFloat(ppict->transform->matrix[1][1]));
PUSH_DATAf(push, xFixedToFloat(ppict->transform->matrix[1][2]));
PUSH_DATAf(push, xFixedToFloat(ppict->transform->matrix[2][0]));
PUSH_DATAf(push, xFixedToFloat(ppict->transform->matrix[2][1]));
PUSH_DATAf(push, xFixedToFloat(ppict->transform->matrix[2][2]));
} else {
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 0.0);
PUSH_DATAf(push, 1.0);
}
PUSH_DATAf(push, 1.0 / ppix->drawable.width);
PUSH_DATAf(push, 1.0 / ppix->drawable.height);
return TRUE;
}
static Bool
NV50EXAPicture(NVPtr pNv, PixmapPtr ppix, PicturePtr ppict, int unit)
{
if (ppict->pDrawable)
return NV50EXAPictTexture(pNv, ppix, ppict, unit);
switch (ppict->pSourcePict->type) {
case SourcePictTypeSolidFill:
return NV50EXAPictSolid(pNv, ppict, unit);
case SourcePictTypeLinear:
return NV50EXAPictGradient(pNv, ppict, unit);
default:
break;
}
return FALSE;
}
static Bool
NV50EXACheckBlend(int op)
{
if (op > PictOpAdd)
NOUVEAU_FALLBACK("unsupported blend op %d\n", op);
return TRUE;
}
static void
NV50EXABlend(PixmapPtr ppix, PicturePtr ppict, int op, int component_alpha)
{
NV50EXA_LOCALS(ppix);
struct nv50_blend_op *b = &NV50EXABlendOp[op];
unsigned sblend = b->src_blend;
unsigned dblend = b->dst_blend;
if (b->dst_alpha) {
if (!PICT_FORMAT_A(ppict->format)) {
if (sblend == BF(DST_ALPHA))
sblend = BF(ONE);
else
if (sblend == BF(ONE_MINUS_DST_ALPHA))
sblend = BF(ZERO);
}
}
if (b->src_alpha && component_alpha) {
if (dblend == BF(SRC_ALPHA))
dblend = BF(SRC_COLOR);
else
if (dblend == BF(ONE_MINUS_SRC_ALPHA))
dblend = BF(ONE_MINUS_SRC_COLOR);
}
if (sblend == BF(ONE) && dblend == BF(ZERO)) {
BEGIN_NV04(push, NV50_3D(BLEND_ENABLE(0)), 1);
PUSH_DATA (push, 0);
} else {
BEGIN_NV04(push, NV50_3D(BLEND_ENABLE(0)), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV50_3D(BLEND_EQUATION_RGB), 5);
PUSH_DATA (push, NV50_3D_BLEND_EQUATION_RGB_FUNC_ADD);
PUSH_DATA (push, sblend);
PUSH_DATA (push, dblend);
PUSH_DATA (push, NV50_3D_BLEND_EQUATION_ALPHA_FUNC_ADD);
PUSH_DATA (push, sblend);
BEGIN_NV04(push, NV50_3D(BLEND_FUNC_DST_ALPHA), 1);
PUSH_DATA (push, dblend);
}
}
Bool
NV50EXACheckComposite(int op,
PicturePtr pspict, PicturePtr pmpict, PicturePtr pdpict)
{
if (!NV50EXACheckBlend(op))
NOUVEAU_FALLBACK("blend not supported\n");
if (!NV50EXACheckRenderTarget(pdpict))
NOUVEAU_FALLBACK("render target invalid\n");
if (!NV50EXACheckTexture(pspict, pdpict, op))
NOUVEAU_FALLBACK("src picture invalid\n");
if (pmpict) {
if (pmpict->componentAlpha &&
PICT_FORMAT_RGB(pmpict->format) &&
NV50EXABlendOp[op].src_alpha &&
NV50EXABlendOp[op].src_blend != BF(ZERO))
NOUVEAU_FALLBACK("component-alpha not supported\n");
if (!NV50EXACheckTexture(pmpict, pdpict, op))
NOUVEAU_FALLBACK("mask picture invalid\n");
}
return TRUE;
}
Bool
NV50EXAPrepareComposite(int op,
PicturePtr pspict, PicturePtr pmpict, PicturePtr pdpict,
PixmapPtr pspix, PixmapPtr pmpix, PixmapPtr pdpix)
{
NV50EXA_LOCALS(pdpix);
if (!PUSH_SPACE(push, 256))
NOUVEAU_FALLBACK("space\n");
PUSH_RESET(push);
PUSH_REFN (push, pNv->scratch, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
BEGIN_NV04(push, SUBC_2D(NV50_GRAPH_SERIALIZE), 1);
PUSH_DATA (push, 0);
if (!NV50EXARenderTarget(pdpix, pdpict))
NOUVEAU_FALLBACK("render target invalid\n");
NV50EXABlend(pdpix, pdpict, op, pmpict && pmpict->componentAlpha &&
PICT_FORMAT_RGB(pmpict->format));
if (!NV50EXAPicture(pNv, pspix, pspict, 0))
NOUVEAU_FALLBACK("src picture invalid\n");
if (pmpict) {
if (!NV50EXAPicture(pNv, pmpix, pmpict, 1))
NOUVEAU_FALLBACK("mask picture invalid\n");
BEGIN_NV04(push, NV50_3D(FP_START_ID), 1);
if (pdpict->format == PICT_a8) {
PUSH_DATA (push, PFP_C_A8);
} else {
if (pmpict->componentAlpha &&
PICT_FORMAT_RGB(pmpict->format)) {
if (NV50EXABlendOp[op].src_alpha)
PUSH_DATA (push, PFP_CCASA);
else
PUSH_DATA (push, PFP_CCA);
} else {
PUSH_DATA (push, PFP_C);
}
}
} else {
BEGIN_NV04(push, NV50_3D(FP_START_ID), 1);
if (pdpict->format == PICT_a8)
PUSH_DATA (push, PFP_S_A8);
else
PUSH_DATA (push, PFP_S);
}
BEGIN_NV04(push, NV50_3D(TIC_FLUSH), 1);
PUSH_DATA (push, 0);
BEGIN_NV04(push, NV50_3D(BIND_TIC(2)), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV50_3D(BIND_TIC(2)), 1);
PUSH_DATA (push, 0x203);
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push)) {
nouveau_pushbuf_bufctx(push, NULL);
NOUVEAU_FALLBACK("validate\n");
}
return TRUE;
}
void
NV50EXAComposite(PixmapPtr pdpix, int sx, int sy, int mx, int my,
int dx, int dy, int w, int h)
{
NV50EXA_LOCALS(pdpix);
if (!PUSH_SPACE(push, 64))
return;
BEGIN_NV04(push, NV50_3D(SCISSOR_HORIZ(0)), 2);
PUSH_DATA (push, (dx + w) << 16 | dx);
PUSH_DATA (push, (dy + h) << 16 | dy);
BEGIN_NV04(push, NV50_3D(VERTEX_BEGIN_GL), 1);
PUSH_DATA (push, NV50_3D_VERTEX_BEGIN_GL_PRIMITIVE_TRIANGLES);
PUSH_VTX2s(push, sx, sy + (h * 2), mx, my + (h * 2), dx, dy + (h * 2));
PUSH_VTX2s(push, sx, sy, mx, my, dx, dy);
PUSH_VTX2s(push, sx + (w * 2), sy, mx + (w * 2), my, dx + (w * 2), dy);
BEGIN_NV04(push, NV50_3D(VERTEX_END_GL), 1);
PUSH_DATA (push, 0);
}
void
NV50EXADoneComposite(PixmapPtr pdpix)
{
NV50EXA_LOCALS(pdpix);
nouveau_pushbuf_bufctx(push, NULL);
}
Bool
NV50EXARectM2MF(NVPtr pNv, int w, int h, int cpp,
struct nouveau_bo *src, uint32_t src_off, int src_dom,
int src_pitch, int src_h, int src_x, int src_y,
struct nouveau_bo *dst, uint32_t dst_off, int dst_dom,
int dst_pitch, int dst_h, int dst_x, int dst_y)
{
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_pushbuf_refn refs[] = {
{ src, src_dom | NOUVEAU_BO_RD },
{ dst, dst_dom | NOUVEAU_BO_WR },
};
if (!PUSH_SPACE(push, 64))
return FALSE;
if (src->config.nv50.memtype) {
BEGIN_NV04(push, NV50_M2MF(LINEAR_IN), 6);
PUSH_DATA (push, 0);
PUSH_DATA (push, src->config.nv50.tile_mode);
PUSH_DATA (push, src_pitch);
PUSH_DATA (push, src_h);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
} else {
BEGIN_NV04(push, NV50_M2MF(LINEAR_IN), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV03_M2MF(PITCH_IN), 1);
PUSH_DATA (push, src_pitch);
src_off += src_y * src_pitch + src_x * cpp;
}
if (dst->config.nv50.memtype) {
BEGIN_NV04(push, NV50_M2MF(LINEAR_OUT), 6);
PUSH_DATA (push, 0);
PUSH_DATA (push, dst->config.nv50.tile_mode);
PUSH_DATA (push, dst_pitch);
PUSH_DATA (push, dst_h);
PUSH_DATA (push, 1);
PUSH_DATA (push, 0);
} else {
BEGIN_NV04(push, NV50_M2MF(LINEAR_OUT), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV03_M2MF(PITCH_OUT), 1);
PUSH_DATA (push, dst_pitch);
dst_off += dst_y * dst_pitch + dst_x * cpp;
}
while (h) {
int line_count = h;
if (line_count > 2047)
line_count = 2047;
if (nouveau_pushbuf_space(push, 32, 0, 0) ||
nouveau_pushbuf_refn (push, refs, 2))
return FALSE;
BEGIN_NV04(push, NV50_M2MF(OFFSET_IN_HIGH), 2);
PUSH_DATA (push, (src->offset + src_off) >> 32);
PUSH_DATA (push, (dst->offset + dst_off) >> 32);
BEGIN_NV04(push, NV03_M2MF(OFFSET_IN), 2);
PUSH_DATA (push, (src->offset + src_off));
PUSH_DATA (push, (dst->offset + dst_off));
if (src->config.nv50.memtype) {
BEGIN_NV04(push, NV50_M2MF(TILING_POSITION_IN), 1);
PUSH_DATA (push, (src_y << 16) | (src_x * cpp));
} else {
src_off += line_count * src_pitch;
}
if (dst->config.nv50.memtype) {
BEGIN_NV04(push, NV50_M2MF(TILING_POSITION_OUT), 1);
PUSH_DATA (push, (dst_y << 16) | (dst_x * cpp));
} else {
dst_off += line_count * dst_pitch;
}
BEGIN_NV04(push, NV03_M2MF(LINE_LENGTH_IN), 4);
PUSH_DATA (push, w * cpp);
PUSH_DATA (push, line_count);
PUSH_DATA (push, 0x00000101);
PUSH_DATA (push, 0x00000000);
src_y += line_count;
dst_y += line_count;
h -= line_count;
}
return TRUE;
}
xf86-video-nouveau-1.0.16/src/nv_rop.h 0000644 0001750 0001756 00000021371 13423754626 014370 0000000 0000000 /*
* 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;
} NVROP[] = {
{ 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 */
};
xf86-video-nouveau-1.0.16/src/nouveau_sync.h 0000644 0001750 0001756 00000002324 13423754626 015600 0000000 0000000 #ifndef __NOUVEAU_SYNC_H__
#define __NOUVEAU_SYNC_H__
#include "xorg-server.h"
#include "scrnintstr.h"
#ifdef DRI3
#include "misync.h"
#include "misyncshm.h"
#include "misyncstr.h"
#define wrap(priv, parn, name, func) { \
priv->name = parn->name; \
parn->name = func; \
}
#define unwrap(priv, parn, name) { \
if (priv && priv->name) \
parn->name = priv->name; \
}
#define swap(priv, parn, name) { \
void *tmp = priv->name; \
priv->name = parn->name; \
parn->name = tmp; \
}
Bool nouveau_sync_init(ScreenPtr pScreen);
void nouveau_sync_fini(ScreenPtr pScreen);
#else
static inline Bool nouveau_sync_init(ScreenPtr pScreen) { return FALSE; }
static inline void nouveau_sync_fini(ScreenPtr pScreen) { }
#endif
#endif
xf86-video-nouveau-1.0.16/src/hwdefs/ 0000755 0001750 0001756 00000000000 13423754654 014251 5 0000000 0000000 xf86-video-nouveau-1.0.16/src/hwdefs/nv50_defs.xml.h 0000644 0001750 0001756 00000016735 13423754626 016745 0000000 0000000 #ifndef _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV50_DEFS_XML
#define _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV50_DEFS_XML
/* Autogenerated file, DO NOT EDIT manually!
This file was generated by the rules-ng-ng headergen tool in this git repository:
http://0x04.net/cgit/index.cgi/rules-ng-ng
git clone git://0x04.net/rules-ng-ng
The rules-ng-ng source files this header was generated from are:
- /home/skeggsb/git/envytools/rnndb/nv50_texture.xml ( 7947 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/copyright.xml ( 6452 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nvchipsets.xml ( 3617 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv50_defs.xml ( 5468 bytes, from 2011-10-22 08:01:09)
Copyright (C) 2006-2011 by the following authors:
- Artur Huillet (ahuillet)
- Ben Skeggs (darktama, darktama_)
- B. R. (koala_br)
- Carlos Martin (carlosmn)
- Christoph Bumiller (calim, chrisbmr)
- Dawid Gajownik (gajownik)
- Dmitry Baryshkov
- Dmitry Eremin-Solenikov (lumag)
- EdB (edb_)
- Erik Waling (erikwaling)
- Francisco Jerez (curro)
- imirkin (imirkin)
- jb17bsome (jb17bsome)
- Jeremy Kolb (kjeremy)
- Laurent Carlier (lordheavy)
- Luca Barbieri (lb, lb1)
- Maarten Maathuis (stillunknown)
- Marcin Kościelnicki (mwk, koriakin)
- Mark Carey (careym)
- Matthieu Castet (mat-c)
- nvidiaman (nvidiaman)
- Patrice Mandin (pmandin, pmdata)
- Pekka Paalanen (pq, ppaalanen)
- Peter Popov (ironpeter)
- Richard Hughes (hughsient)
- Rudi Cilibrasi (cilibrar)
- Serge Martin
- Simon Raffeiner
- Stephane Loeuillet (leroutier)
- Stephane Marchesin (marcheu)
- sturmflut (sturmflut)
- Sylvain Munaut
- Victor Stinner (haypo)
- Wladmir van der Laan (miathan6)
- Younes Manton (ymanton)
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 COPYRIGHT OWNER(S) 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.
*/
#define NV50_SURFACE_FORMAT_BITMAP 0x0000001c
#define NV50_SURFACE_FORMAT_UNK1D 0x0000001d
#define NV50_SURFACE_FORMAT_RGBA32_FLOAT 0x000000c0
#define NV50_SURFACE_FORMAT_RGBA32_SINT 0x000000c1
#define NV50_SURFACE_FORMAT_RGBA32_UINT 0x000000c2
#define NV50_SURFACE_FORMAT_RGBX32_FLOAT 0x000000c3
#define NV50_SURFACE_FORMAT_RGBX32_SINT 0x000000c4
#define NV50_SURFACE_FORMAT_RGBX32_UINT 0x000000c5
#define NV50_SURFACE_FORMAT_RGBA16_UNORM 0x000000c6
#define NV50_SURFACE_FORMAT_RGBA16_SNORM 0x000000c7
#define NV50_SURFACE_FORMAT_RGBA16_SINT 0x000000c8
#define NV50_SURFACE_FORMAT_RGBA16_UINT 0x000000c9
#define NV50_SURFACE_FORMAT_RGBA16_FLOAT 0x000000ca
#define NV50_SURFACE_FORMAT_RG32_FLOAT 0x000000cb
#define NV50_SURFACE_FORMAT_RG32_SINT 0x000000cc
#define NV50_SURFACE_FORMAT_RG32_UINT 0x000000cd
#define NV50_SURFACE_FORMAT_RGBX16_FLOAT 0x000000ce
#define NV50_SURFACE_FORMAT_BGRA8_UNORM 0x000000cf
#define NV50_SURFACE_FORMAT_BGRA8_SRGB 0x000000d0
#define NV50_SURFACE_FORMAT_RGB10_A2_UNORM 0x000000d1
#define NV50_SURFACE_FORMAT_RGB10_A2_UINT 0x000000d2
#define NV50_SURFACE_FORMAT_RGBA8_UNORM 0x000000d5
#define NV50_SURFACE_FORMAT_RGBA8_SRGB 0x000000d6
#define NV50_SURFACE_FORMAT_RGBA8_SNORM 0x000000d7
#define NV50_SURFACE_FORMAT_RGBA8_SINT 0x000000d8
#define NV50_SURFACE_FORMAT_RGBA8_UINT 0x000000d9
#define NV50_SURFACE_FORMAT_RG16_UNORM 0x000000da
#define NV50_SURFACE_FORMAT_RG16_SNORM 0x000000db
#define NV50_SURFACE_FORMAT_RG16_SINT 0x000000dc
#define NV50_SURFACE_FORMAT_RG16_UINT 0x000000dd
#define NV50_SURFACE_FORMAT_RG16_FLOAT 0x000000de
#define NV50_SURFACE_FORMAT_BGR10_A2_UNORM 0x000000df
#define NV50_SURFACE_FORMAT_R11G11B10_FLOAT 0x000000e0
#define NV50_SURFACE_FORMAT_R32_SINT 0x000000e3
#define NV50_SURFACE_FORMAT_R32_UINT 0x000000e4
#define NV50_SURFACE_FORMAT_R32_FLOAT 0x000000e5
#define NV50_SURFACE_FORMAT_BGRX8_UNORM 0x000000e6
#define NV50_SURFACE_FORMAT_BGRX8_SRGB 0x000000e7
#define NV50_SURFACE_FORMAT_B5G6R5_UNORM 0x000000e8
#define NV50_SURFACE_FORMAT_BGR5_A1_UNORM 0x000000e9
#define NV50_SURFACE_FORMAT_RG8_UNORM 0x000000ea
#define NV50_SURFACE_FORMAT_RG8_SNORM 0x000000eb
#define NV50_SURFACE_FORMAT_RG8_SINT 0x000000ec
#define NV50_SURFACE_FORMAT_RG8_UINT 0x000000ed
#define NV50_SURFACE_FORMAT_R16_UNORM 0x000000ee
#define NV50_SURFACE_FORMAT_R16_SNORM 0x000000ef
#define NV50_SURFACE_FORMAT_R16_SINT 0x000000f0
#define NV50_SURFACE_FORMAT_R16_UINT 0x000000f1
#define NV50_SURFACE_FORMAT_R16_FLOAT 0x000000f2
#define NV50_SURFACE_FORMAT_R8_UNORM 0x000000f3
#define NV50_SURFACE_FORMAT_R8_SNORM 0x000000f4
#define NV50_SURFACE_FORMAT_R8_SINT 0x000000f5
#define NV50_SURFACE_FORMAT_R8_UINT 0x000000f6
#define NV50_SURFACE_FORMAT_A8_UNORM 0x000000f7
#define NV50_SURFACE_FORMAT_BGR5_X1_UNORM 0x000000f8
#define NV50_SURFACE_FORMAT_RGBX8_UNORM 0x000000f9
#define NV50_SURFACE_FORMAT_RGBX8_SRGB 0x000000fa
#define NV50_SURFACE_FORMAT_BGR5_X1_UNORM_UNKFB 0x000000fb
#define NV50_SURFACE_FORMAT_BGR5_X1_UNORM_UNKFC 0x000000fc
#define NV50_SURFACE_FORMAT_BGRX8_UNORM_UNKFD 0x000000fd
#define NV50_SURFACE_FORMAT_BGRX8_UNORM_UNKFE 0x000000fe
#define NV50_SURFACE_FORMAT_Y32_UINT_UNKFF 0x000000ff
#define NV50_ZETA_FORMAT_Z32_FLOAT 0x0000000a
#define NV50_ZETA_FORMAT_Z16_UNORM 0x00000013
#define NV50_ZETA_FORMAT_S8_Z24_UNORM 0x00000014
#define NV50_ZETA_FORMAT_Z24_X8_UNORM 0x00000015
#define NV50_ZETA_FORMAT_Z24_S8_UNORM 0x00000016
#define NV50_ZETA_FORMAT_Z24_C8_UNORM 0x00000018
#define NV50_ZETA_FORMAT_Z32_S8_X24_FLOAT 0x00000019
#define NV50_ZETA_FORMAT_Z24_X8_S8_C8_X16_UNORM 0x0000001d
#define NV50_ZETA_FORMAT_Z32_X8_C8_X16_FLOAT 0x0000001e
#define NV50_ZETA_FORMAT_Z32_S8_C8_X16_FLOAT 0x0000001f
#define NV50_QUERY__SIZE 0x00000010
#define NV50_QUERY_COUNTER 0x00000000
#define NV50_QUERY_RES 0x00000004
#define NV50_QUERY_TIME 0x00000008
#endif /* _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV50_DEFS_XML */
xf86-video-nouveau-1.0.16/src/hwdefs/gm107_texture.xml.h 0000644 0001750 0001756 00000046454 13423754626 017570 0000000 0000000 #ifndef GM107_TEXTURE_XML
#define GM107_TEXTURE_XML
/* Autogenerated file, DO NOT EDIT manually!
This file was generated by the rules-ng-ng headergen tool in this git repository:
http://github.com/envytools/envytools/
git clone https://github.com/envytools/envytools.git
The rules-ng-ng source files this header was generated from are:
- /home/skeggsb/git/envytools/rnndb/../rnndb/graph/gm107_texture.xml ( 22057 bytes, from 2016-02-12 03:01:43)
- /home/skeggsb/git/envytools/rnndb/copyright.xml ( 6456 bytes, from 2015-09-10 02:57:40)
- /home/skeggsb/git/envytools/rnndb/nvchipsets.xml ( 2908 bytes, from 2016-02-04 22:19:11)
- /home/skeggsb/git/envytools/rnndb/g80_defs.xml ( 21739 bytes, from 2016-02-04 00:29:42)
Copyright (C) 2006-2016 by the following authors:
- Artur Huillet (ahuillet)
- Ben Skeggs (darktama, darktama_)
- B. R. (koala_br)
- Carlos Martin (carlosmn)
- Christoph Bumiller (calim, chrisbmr)
- Dawid Gajownik (gajownik)
- Dmitry Baryshkov
- Dmitry Eremin-Solenikov (lumag)
- EdB (edb_)
- Erik Waling (erikwaling)
- Francisco Jerez (curro)
- Ilia Mirkin (imirkin)
- jb17bsome (jb17bsome)
- Jeremy Kolb (kjeremy)
- Laurent Carlier (lordheavy)
- Luca Barbieri (lb, lb1)
- Maarten Maathuis (stillunknown)
- Marcin Kościelnicki (mwk, koriakin)
- Mark Carey (careym)
- Matthieu Castet (mat-c)
- nvidiaman (nvidiaman)
- Patrice Mandin (pmandin, pmdata)
- Pekka Paalanen (pq, ppaalanen)
- Peter Popov (ironpeter)
- Richard Hughes (hughsient)
- Rudi Cilibrasi (cilibrar)
- Serge Martin
- Simon Raffeiner
- Stephane Loeuillet (leroutier)
- Stephane Marchesin (marcheu)
- sturmflut (sturmflut)
- Sylvain Munaut
- Victor Stinner (haypo)
- Wladmir van der Laan (miathan6)
- Younes Manton (ymanton)
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 COPYRIGHT OWNER(S) 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.
*/
#define GM107_TIC2__SIZE 0x00000020
#define GM107_TIC2_0 0x00000000
#define GM107_TIC2_0_COMPONENTS_SIZES__MASK 0x0000007f
#define GM107_TIC2_0_COMPONENTS_SIZES__SHIFT 0
#define GM107_TIC2_0_COMPONENTS_SIZES_R32_G32_B32_A32 0x00000001
#define GM107_TIC2_0_COMPONENTS_SIZES_R32_G32_B32 0x00000002
#define GM107_TIC2_0_COMPONENTS_SIZES_R16_G16_B16_A16 0x00000003
#define GM107_TIC2_0_COMPONENTS_SIZES_R32_G32 0x00000004
#define GM107_TIC2_0_COMPONENTS_SIZES_R32_B24G8 0x00000005
#define GM107_TIC2_0_COMPONENTS_SIZES_X8B8G8R8 0x00000007
#define GM107_TIC2_0_COMPONENTS_SIZES_A8B8G8R8 0x00000008
#define GM107_TIC2_0_COMPONENTS_SIZES_A2B10G10R10 0x00000009
#define GM107_TIC2_0_COMPONENTS_SIZES_R16_G16 0x0000000c
#define GM107_TIC2_0_COMPONENTS_SIZES_G8R24 0x0000000d
#define GM107_TIC2_0_COMPONENTS_SIZES_G24R8 0x0000000e
#define GM107_TIC2_0_COMPONENTS_SIZES_R32 0x0000000f
#define GM107_TIC2_0_COMPONENTS_SIZES_A4B4G4R4 0x00000012
#define GM107_TIC2_0_COMPONENTS_SIZES_A5B5G5R1 0x00000013
#define GM107_TIC2_0_COMPONENTS_SIZES_A1B5G5R5 0x00000014
#define GM107_TIC2_0_COMPONENTS_SIZES_B5G6R5 0x00000015
#define GM107_TIC2_0_COMPONENTS_SIZES_B6G5R5 0x00000016
#define GM107_TIC2_0_COMPONENTS_SIZES_G8R8 0x00000018
#define GM107_TIC2_0_COMPONENTS_SIZES_R16 0x0000001b
#define GM107_TIC2_0_COMPONENTS_SIZES_Y8_VIDEO 0x0000001c
#define GM107_TIC2_0_COMPONENTS_SIZES_R8 0x0000001d
#define GM107_TIC2_0_COMPONENTS_SIZES_G4R4 0x0000001e
#define GM107_TIC2_0_COMPONENTS_SIZES_R1 0x0000001f
#define GM107_TIC2_0_COMPONENTS_SIZES_E5B9G9R9_SHAREDEXP 0x00000020
#define GM107_TIC2_0_COMPONENTS_SIZES_BF10GF11RF11 0x00000021
#define GM107_TIC2_0_COMPONENTS_SIZES_G8B8G8R8 0x00000022
#define GM107_TIC2_0_COMPONENTS_SIZES_B8G8R8G8 0x00000023
#define GM107_TIC2_0_COMPONENTS_SIZES_DXT1 0x00000024
#define GM107_TIC2_0_COMPONENTS_SIZES_DXT23 0x00000025
#define GM107_TIC2_0_COMPONENTS_SIZES_DXT45 0x00000026
#define GM107_TIC2_0_COMPONENTS_SIZES_DXN1 0x00000027
#define GM107_TIC2_0_COMPONENTS_SIZES_DXN2 0x00000028
#define GM107_TIC2_0_COMPONENTS_SIZES_BC6H_SF16 0x00000010
#define GM107_TIC2_0_COMPONENTS_SIZES_BC6H_UF16 0x00000011
#define GM107_TIC2_0_COMPONENTS_SIZES_BC7U 0x00000017
#define GM107_TIC2_0_COMPONENTS_SIZES_ETC2_RGB 0x00000006
#define GM107_TIC2_0_COMPONENTS_SIZES_ETC2_RGB_PTA 0x0000000a
#define GM107_TIC2_0_COMPONENTS_SIZES_ETC2_RGBA 0x0000000b
#define GM107_TIC2_0_COMPONENTS_SIZES_EAC 0x00000019
#define GM107_TIC2_0_COMPONENTS_SIZES_EACX2 0x0000001a
#define GM107_TIC2_0_COMPONENTS_SIZES_Z24S8 0x00000029
#define GM107_TIC2_0_COMPONENTS_SIZES_X8Z24 0x0000002a
#define GM107_TIC2_0_COMPONENTS_SIZES_S8Z24 0x0000002b
#define GM107_TIC2_0_COMPONENTS_SIZES_X4V4Z24__COV4R4V 0x0000002c
#define GM107_TIC2_0_COMPONENTS_SIZES_X4V4Z24__COV8R8V 0x0000002d
#define GM107_TIC2_0_COMPONENTS_SIZES_V8Z24__COV4R12V 0x0000002e
#define GM107_TIC2_0_COMPONENTS_SIZES_ZF32 0x0000002f
#define GM107_TIC2_0_COMPONENTS_SIZES_ZF32_X24S8 0x00000030
#define GM107_TIC2_0_COMPONENTS_SIZES_X8Z24_X20V4S8__COV4R4V 0x00000031
#define GM107_TIC2_0_COMPONENTS_SIZES_X8Z24_X20V4S8__COV8R8V 0x00000032
#define GM107_TIC2_0_COMPONENTS_SIZES_ZF32_X20V4X8__COV4R4V 0x00000033
#define GM107_TIC2_0_COMPONENTS_SIZES_ZF32_X20V4X8__COV8R8V 0x00000034
#define GM107_TIC2_0_COMPONENTS_SIZES_ZF32_X20V4S8__COV4R4V 0x00000035
#define GM107_TIC2_0_COMPONENTS_SIZES_ZF32_X20V4S8__COV8R8V 0x00000036
#define GM107_TIC2_0_COMPONENTS_SIZES_X8Z24_X16V8S8__COV4R12V 0x00000037
#define GM107_TIC2_0_COMPONENTS_SIZES_ZF32_X16V8X8__COV4R12V 0x00000038
#define GM107_TIC2_0_COMPONENTS_SIZES_ZF32_X16V8S8__COV4R12V 0x00000039
#define GM107_TIC2_0_COMPONENTS_SIZES_Z16 0x0000003a
#define GM107_TIC2_0_COMPONENTS_SIZES_V8Z24__COV8R24V 0x0000003b
#define GM107_TIC2_0_COMPONENTS_SIZES_X8Z24_X16V8S8__COV8R24V 0x0000003c
#define GM107_TIC2_0_COMPONENTS_SIZES_ZF32_X16V8X8__COV8R24V 0x0000003d
#define GM107_TIC2_0_COMPONENTS_SIZES_ZF32_X16V8S8__COV8R24V 0x0000003e
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_4X4 0x00000040
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_5X4 0x00000050
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_5X5 0x00000041
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_6X5 0x00000051
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_6X6 0x00000042
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_8X5 0x00000055
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_8X6 0x00000052
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_8X8 0x00000044
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_10X5 0x00000056
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_10X6 0x00000057
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_10X8 0x00000053
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_10X10 0x00000045
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_12X10 0x00000054
#define GM107_TIC2_0_COMPONENTS_SIZES_ASTC_2D_12X12 0x00000046
#define GM107_TIC2_0_R_DATA_TYPE__MASK 0x00000380
#define GM107_TIC2_0_R_DATA_TYPE__SHIFT 7
#define GM107_TIC2_0_G_DATA_TYPE__MASK 0x00001c00
#define GM107_TIC2_0_G_DATA_TYPE__SHIFT 10
#define GM107_TIC2_0_B_DATA_TYPE__MASK 0x0000e000
#define GM107_TIC2_0_B_DATA_TYPE__SHIFT 13
#define GM107_TIC2_0_A_DATA_TYPE__MASK 0x00070000
#define GM107_TIC2_0_A_DATA_TYPE__SHIFT 16
#define GM107_TIC2_0_X_SOURCE__MASK 0x00380000
#define GM107_TIC2_0_X_SOURCE__SHIFT 19
#define GM107_TIC2_0_Y_SOURCE__MASK 0x01c00000
#define GM107_TIC2_0_Y_SOURCE__SHIFT 22
#define GM107_TIC2_0_Z_SOURCE__MASK 0x0e000000
#define GM107_TIC2_0_Z_SOURCE__SHIFT 25
#define GM107_TIC2_0_W_SOURCE__MASK 0x70000000
#define GM107_TIC2_0_W_SOURCE__SHIFT 28
#define GM107_TIC2_0_PACK_COMPONENTS 0x80000000
#define GM107_TIC2_1 0x00000004
#define GM107_TIC2_1_ADDRESS_BITS_31_TO_0__MASK 0xffffffff
#define GM107_TIC2_1_ADDRESS_BITS_31_TO_0__SHIFT 0
#define GM107_TIC2_1_ADDRESS_BITS_31_TO_5__MASK 0xffffffe0
#define GM107_TIC2_1_ADDRESS_BITS_31_TO_5__SHIFT 5
#define GM107_TIC2_1_ADDRESS_BITS_31_TO_5__SHR 5
#define GM107_TIC2_1_GOB_DEPTH_OFFSET__MASK 0x00000060
#define GM107_TIC2_1_GOB_DEPTH_OFFSET__SHIFT 5
#define GM107_TIC2_1_ADDRESS_BITS_31_TO_9__MASK 0xfffffe00
#define GM107_TIC2_1_ADDRESS_BITS_31_TO_9__SHIFT 9
#define GM107_TIC2_1_ADDRESS_BITS_31_TO_9__SHR 9
#define GM107_TIC2_2 0x00000008
#define GM107_TIC2_2_ADDRESS_BITS_47_TO_32__MASK 0x0000ffff
#define GM107_TIC2_2_ADDRESS_BITS_47_TO_32__SHIFT 0
#define GM107_TIC2_2_HEADER_VERSION__MASK 0x00e00000
#define GM107_TIC2_2_HEADER_VERSION__SHIFT 21
#define GM107_TIC2_2_HEADER_VERSION_ONE_D_BUFFER 0x00000000
#define GM107_TIC2_2_HEADER_VERSION_PITCH_COLORKEY 0x00200000
#define GM107_TIC2_2_HEADER_VERSION_PITCH 0x00400000
#define GM107_TIC2_2_HEADER_VERSION_BLOCKLINEAR 0x00600000
#define GM107_TIC2_2_HEADER_VERSION_BLOCKLINEAR_COLORKEY 0x00800000
#define GM107_TIC2_2_RESOURCE_VIEW_COHERENCY_HASH__MASK 0x1e000000
#define GM107_TIC2_2_RESOURCE_VIEW_COHERENCY_HASH__SHIFT 25
#define GM107_TIC2_3 0x0000000c
#define GM107_TIC2_3_WIDTH_MINUS_ONE_BITS_31_TO_16__MASK 0x0000ffff
#define GM107_TIC2_3_WIDTH_MINUS_ONE_BITS_31_TO_16__SHIFT 0
#define GM107_TIC2_3_PITCH_BITS_20_TO_5__MASK 0x0000ffff
#define GM107_TIC2_3_PITCH_BITS_20_TO_5__SHIFT 0
#define GM107_TIC2_3_PITCH_BITS_20_TO_5__SHR 5
#define GM107_TIC2_3_GOBS_PER_BLOCK_WIDTH__MASK 0x00000007
#define GM107_TIC2_3_GOBS_PER_BLOCK_WIDTH__SHIFT 0
#define GM107_TIC2_3_GOBS_PER_BLOCK_WIDTH__MIN 0x00000000
#define GM107_TIC2_3_GOBS_PER_BLOCK_WIDTH__MAX 0x00000000
#define GM107_TIC2_3_GOBS_PER_BLOCK_WIDTH_ONE 0x00000000
#define GM107_TIC2_3_GOBS_PER_BLOCK_WIDTH_TWO 0x00000001
#define GM107_TIC2_3_GOBS_PER_BLOCK_WIDTH_FOUR 0x00000002
#define GM107_TIC2_3_GOBS_PER_BLOCK_WIDTH_EIGHT 0x00000003
#define GM107_TIC2_3_GOBS_PER_BLOCK_WIDTH_SIXTEEN 0x00000004
#define GM107_TIC2_3_GOBS_PER_BLOCK_WIDTH_THIRTYTWO 0x00000005
#define GM107_TIC2_3_GOBS_PER_BLOCK_HEIGHT__MASK 0x00000038
#define GM107_TIC2_3_GOBS_PER_BLOCK_HEIGHT__SHIFT 3
#define GM107_TIC2_3_GOBS_PER_BLOCK_HEIGHT_ONE 0x00000000
#define GM107_TIC2_3_GOBS_PER_BLOCK_HEIGHT_TWO 0x00000008
#define GM107_TIC2_3_GOBS_PER_BLOCK_HEIGHT_FOUR 0x00000010
#define GM107_TIC2_3_GOBS_PER_BLOCK_HEIGHT_EIGHT 0x00000018
#define GM107_TIC2_3_GOBS_PER_BLOCK_HEIGHT_SIXTEEN 0x00000020
#define GM107_TIC2_3_GOBS_PER_BLOCK_HEIGHT_THIRTYTWO 0x00000028
#define GM107_TIC2_3_GOBS_PER_BLOCK_DEPTH__MASK 0x000001c0
#define GM107_TIC2_3_GOBS_PER_BLOCK_DEPTH__SHIFT 6
#define GM107_TIC2_3_GOBS_PER_BLOCK_DEPTH_ONE 0x00000000
#define GM107_TIC2_3_GOBS_PER_BLOCK_DEPTH_TWO 0x00000040
#define GM107_TIC2_3_GOBS_PER_BLOCK_DEPTH_FOUR 0x00000080
#define GM107_TIC2_3_GOBS_PER_BLOCK_DEPTH_EIGHT 0x000000c0
#define GM107_TIC2_3_GOBS_PER_BLOCK_DEPTH_SIXTEEN 0x00000100
#define GM107_TIC2_3_GOBS_PER_BLOCK_DEPTH_THIRTYTWO 0x00000140
#define GM107_TIC2_3_TILE_WIDTH_IN_GOBS__MASK 0x00001c00
#define GM107_TIC2_3_TILE_WIDTH_IN_GOBS__SHIFT 10
#define GM107_TIC2_3_TILE_WIDTH_IN_GOBS_ONE 0x00000000
#define GM107_TIC2_3_TILE_WIDTH_IN_GOBS_TWO 0x00000400
#define GM107_TIC2_3_TILE_WIDTH_IN_GOBS_FOUR 0x00000800
#define GM107_TIC2_3_TILE_WIDTH_IN_GOBS_EIGHT 0x00000c00
#define GM107_TIC2_3_TILE_WIDTH_IN_GOBS_SIXTEEN 0x00001000
#define GM107_TIC2_3_TILE_WIDTH_IN_GOBS_THIRTYTWO 0x00001400
#define GM107_TIC2_3_GOB_3D 0x00002000
#define GM107_TIC2_3_LOD_ANISO_QUALITY_2 0x00010000
#define GM107_TIC2_3_LOD_ANISO_QUALITY__MASK 0x00020000
#define GM107_TIC2_3_LOD_ANISO_QUALITY__SHIFT 17
#define GM107_TIC2_3_LOD_ANISO_QUALITY_LOW 0x00000000
#define GM107_TIC2_3_LOD_ANISO_QUALITY_HIGH 0x00020000
#define GM107_TIC2_3_LOD_ISO_QUALITY__MASK 0x00040000
#define GM107_TIC2_3_LOD_ISO_QUALITY__SHIFT 18
#define GM107_TIC2_3_LOD_ISO_QUALITY_LOW 0x00000000
#define GM107_TIC2_3_LOD_ISO_QUALITY_HIGH 0x00040000
#define GM107_TIC2_3_ANISO_COARSE_SPREAD_MODIFIER__MASK 0x00180000
#define GM107_TIC2_3_ANISO_COARSE_SPREAD_MODIFIER__SHIFT 19
#define GM107_TIC2_3_ANISO_COARSE_SPREAD_MODIFIER_NONE 0x00000000
#define GM107_TIC2_3_ANISO_COARSE_SPREAD_MODIFIER_CONST_ONE 0x00080000
#define GM107_TIC2_3_ANISO_COARSE_SPREAD_MODIFIER_CONST_TWO 0x00100000
#define GM107_TIC2_3_ANISO_COARSE_SPREAD_MODIFIER_SQRT 0x00180000
#define GM107_TIC2_3_ANISO_SPREAD_SCALE__MASK 0x03e00000
#define GM107_TIC2_3_ANISO_SPREAD_SCALE__SHIFT 21
#define GM107_TIC2_3_USE_HEADER_OPT_CONTROL 0x04000000
#define GM107_TIC2_3_DEPTH_TEXTURE 0x08000000
#define GM107_TIC2_3_MAX_MIP_LEVEL__MASK 0xf0000000
#define GM107_TIC2_3_MAX_MIP_LEVEL__SHIFT 28
#define GM107_TIC2_4 0x00000010
#define GM107_TIC2_4_WIDTH_MINUS_ONE_BITS_15_TO_0__MASK 0x0000ffff
#define GM107_TIC2_4_WIDTH_MINUS_ONE_BITS_15_TO_0__SHIFT 0
#define GM107_TIC2_4_WIDTH_MINUS_ONE__MASK 0x0000ffff
#define GM107_TIC2_4_WIDTH_MINUS_ONE__SHIFT 0
#define GM107_TIC2_4_ANISO_SPREAD_MAX_LOG2__MASK 0x00380000
#define GM107_TIC2_4_ANISO_SPREAD_MAX_LOG2__SHIFT 19
#define GM107_TIC2_4_SRGB_CONVERSION 0x00400000
#define GM107_TIC2_4_TEXTURE_TYPE__MASK 0x07800000
#define GM107_TIC2_4_TEXTURE_TYPE__SHIFT 23
#define GM107_TIC2_4_TEXTURE_TYPE_ONE_D 0x00000000
#define GM107_TIC2_4_TEXTURE_TYPE_TWO_D 0x00800000
#define GM107_TIC2_4_TEXTURE_TYPE_THREE_D 0x01000000
#define GM107_TIC2_4_TEXTURE_TYPE_CUBEMAP 0x01800000
#define GM107_TIC2_4_TEXTURE_TYPE_ONE_D_ARRAY 0x02000000
#define GM107_TIC2_4_TEXTURE_TYPE_TWO_D_ARRAY 0x02800000
#define GM107_TIC2_4_TEXTURE_TYPE_ONE_D_BUFFER 0x03000000
#define GM107_TIC2_4_TEXTURE_TYPE_TWO_D_NO_MIPMAP 0x03800000
#define GM107_TIC2_4_TEXTURE_TYPE_CUBE_ARRAY 0x04000000
#define GM107_TIC2_4_SECTOR_PROMOTION__MASK 0x18000000
#define GM107_TIC2_4_SECTOR_PROMOTION__SHIFT 27
#define GM107_TIC2_4_SECTOR_PROMOTION_NO_PROMOTION 0x00000000
#define GM107_TIC2_4_SECTOR_PROMOTION_PROMOTE_TO_2_V 0x08000000
#define GM107_TIC2_4_SECTOR_PROMOTION_PROMOTE_TO_2_H 0x10000000
#define GM107_TIC2_4_SECTOR_PROMOTION_PROMOTE_TO_4 0x18000000
#define GM107_TIC2_4_BORDER_SIZE__MASK 0xe0000000
#define GM107_TIC2_4_BORDER_SIZE__SHIFT 29
#define GM107_TIC2_4_BORDER_SIZE_ONE 0x00000000
#define GM107_TIC2_4_BORDER_SIZE_TWO 0x20000000
#define GM107_TIC2_4_BORDER_SIZE_FOUR 0x40000000
#define GM107_TIC2_4_BORDER_SIZE_EIGHT 0x60000000
#define GM107_TIC2_4_BORDER_SIZE_SAMPLER_COLOR 0xe0000000
#define GM107_TIC2_5 0x00000014
#define GM107_TIC2_5_HEIGHT_MINUS_ONE__MASK 0x0000ffff
#define GM107_TIC2_5_HEIGHT_MINUS_ONE__SHIFT 0
#define GM107_TIC2_5_DEPTH_MINUS_ONE__MASK 0x3fff0000
#define GM107_TIC2_5_DEPTH_MINUS_ONE__SHIFT 16
#define GM107_TIC2_5_NORMALIZED_COORDS 0x80000000
#define GM107_TIC2_6 0x00000018
#define GM107_TIC2_6_COLOR_KEY_OP 0x00000001
#define GM107_TIC2_6_TRILIN_OPT__MASK 0x0000003e
#define GM107_TIC2_6_TRILIN_OPT__SHIFT 1
#define GM107_TIC2_6_MIP_LOD_BIAS__MASK 0x0007ffc0
#define GM107_TIC2_6_MIP_LOD_BIAS__SHIFT 6
#define GM107_TIC2_6_MIP_LOD_BIAS__RADIX 0x00000008
#define GM107_TIC2_6_ANISO_BIAS__MASK 0x00780000
#define GM107_TIC2_6_ANISO_BIAS__SHIFT 19
#define GM107_TIC2_6_ANISO_BIAS__RADIX 0x00000004
#define GM107_TIC2_6_ANISO_FINE_SPREAD_FUNC__MASK 0x01800000
#define GM107_TIC2_6_ANISO_FINE_SPREAD_FUNC__SHIFT 23
#define GM107_TIC2_6_ANISO_FINE_SPREAD_FUNC_HALF 0x00000000
#define GM107_TIC2_6_ANISO_FINE_SPREAD_FUNC_ONE 0x00800000
#define GM107_TIC2_6_ANISO_FINE_SPREAD_FUNC_TWO 0x01000000
#define GM107_TIC2_6_ANISO_FINE_SPREAD_FUNC_MAX 0x01800000
#define GM107_TIC2_6_ANISO_COARSE_SPREAD_FUNC__MASK 0x06000000
#define GM107_TIC2_6_ANISO_COARSE_SPREAD_FUNC__SHIFT 25
#define GM107_TIC2_6_ANISO_COARSE_SPREAD_FUNC_HALF 0x00000000
#define GM107_TIC2_6_ANISO_COARSE_SPREAD_FUNC_ONE 0x02000000
#define GM107_TIC2_6_ANISO_COARSE_SPREAD_FUNC_TWO 0x04000000
#define GM107_TIC2_6_ANISO_COARSE_SPREAD_FUNC_MAX 0x06000000
#define GM107_TIC2_6_MAX_ANISOTROPY__MASK 0x38000000
#define GM107_TIC2_6_MAX_ANISOTROPY__SHIFT 27
#define GM107_TIC2_6_MAX_ANISOTROPY_1_TO_1 0x00000000
#define GM107_TIC2_6_MAX_ANISOTROPY_2_TO_1 0x08000000
#define GM107_TIC2_6_MAX_ANISOTROPY_4_TO_1 0x10000000
#define GM107_TIC2_6_MAX_ANISOTROPY_6_TO_1 0x18000000
#define GM107_TIC2_6_MAX_ANISOTROPY_8_TO_1 0x20000000
#define GM107_TIC2_6_MAX_ANISOTROPY_10_TO_1 0x28000000
#define GM107_TIC2_6_MAX_ANISOTROPY_12_TO_1 0x30000000
#define GM107_TIC2_6_MAX_ANISOTROPY_16_TO_1 0x38000000
#define GM107_TIC2_6_ANISO_FINE_SPREAD_MODIFIER__MASK 0xc0000000
#define GM107_TIC2_6_ANISO_FINE_SPREAD_MODIFIER__SHIFT 30
#define GM107_TIC2_6_ANISO_FINE_SPREAD_MODIFIER_NONE 0x00000000
#define GM107_TIC2_6_ANISO_FINE_SPREAD_MODIFIER_CONST_ONE 0x40000000
#define GM107_TIC2_6_ANISO_FINE_SPREAD_MODIFIER_CONST_TWO 0x80000000
#define GM107_TIC2_6_ANISO_FINE_SPREAD_MODIFIER_SQRT 0xc0000000
#define GM107_TIC2_7 0x0000001c
#define GM107_TIC2_7_COLOR_KEY_VALUE__MASK 0xffffffff
#define GM107_TIC2_7_COLOR_KEY_VALUE__SHIFT 0
#define GM107_TIC2_7_RES_VIEW_MIN_MIP_LEVEL__MASK 0x0000000f
#define GM107_TIC2_7_RES_VIEW_MIN_MIP_LEVEL__SHIFT 0
#define GM107_TIC2_7_RES_VIEW_MAX_MIP_LEVEL__MASK 0x000000f0
#define GM107_TIC2_7_RES_VIEW_MAX_MIP_LEVEL__SHIFT 4
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT__MASK 0x00000f00
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT__SHIFT 8
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT_1X1 0x00000000
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT_2X1 0x00000100
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT_2X2 0x00000200
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT_4X2 0x00000300
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT_4X2_D3D 0x00000400
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT_2X1_D3D 0x00000500
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT_4X4 0x00000600
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT_2X2_VC_4 0x00000800
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT_2X2_VC_12 0x00000900
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT_4X2_VC_8 0x00000a00
#define GM107_TIC2_7_MULTI_SAMPLE_COUNT_4X2_VC_24 0x00000b00
#define GM107_TIC2_7_MIN_LOD_CLAMP__MASK 0x00fff000
#define GM107_TIC2_7_MIN_LOD_CLAMP__SHIFT 12
#define GM107_TIC2_7_MIN_LOD_CLAMP__RADIX 0x00000008
#endif /* GM107_TEXTURE_XML */
xf86-video-nouveau-1.0.16/src/hwdefs/nv01_2d.xml.h 0000644 0001750 0001756 00000150462 13423754626 016321 0000000 0000000 #ifndef _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV01_2D_XML
#define _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV01_2D_XML
/* Autogenerated file, DO NOT EDIT manually!
This file was generated by the rules-ng-ng headergen tool in this git repository:
http://0x04.net/cgit/index.cgi/rules-ng-ng
git clone git://0x04.net/rules-ng-ng
The rules-ng-ng source files this header was generated from are:
- /home/skeggsb/git/envytools/rnndb/nv_objects.xml ( 794 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/copyright.xml ( 6452 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_m2mf.xml ( 2696 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_object.xml ( 12672 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nvchipsets.xml ( 3617 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_defs.xml ( 4437 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv50_defs.xml ( 5468 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nvc0_m2mf.xml ( 2687 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv01_2d.xml ( 32584 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv04_dvd.xml ( 3000 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv03_3d.xml ( 5209 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv04_3d.xml ( 17759 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_3ddefs.xml ( 16394 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv10_3d.xml ( 18437 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv20_3d.xml ( 21107 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv30-40_3d.xml ( 31987 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv50_2d.xml ( 11113 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv50_3d.xml ( 65233 bytes, from 2011-11-30 05:49:35)
- /home/skeggsb/git/envytools/rnndb/nv50_compute.xml ( 14012 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv84_crypt.xml ( 2071 bytes, from 2011-11-30 05:49:35)
- /home/skeggsb/git/envytools/rnndb/nv31_mpeg.xml ( 2269 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nvc0_3d.xml ( 52547 bytes, from 2011-11-30 05:49:35)
- /home/skeggsb/git/envytools/rnndb/nvc0_compute.xml ( 10865 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/blob_nvc0_pcopy.xml ( 4516 bytes, from 2011-10-22 08:01:09)
Copyright (C) 2006-2011 by the following authors:
- Artur Huillet (ahuillet)
- Ben Skeggs (darktama, darktama_)
- B. R. (koala_br)
- Carlos Martin (carlosmn)
- Christoph Bumiller (calim, chrisbmr)
- Dawid Gajownik (gajownik)
- Dmitry Baryshkov
- Dmitry Eremin-Solenikov (lumag)
- EdB (edb_)
- Erik Waling (erikwaling)
- Francisco Jerez (curro)
- imirkin (imirkin)
- jb17bsome (jb17bsome)
- Jeremy Kolb (kjeremy)
- Laurent Carlier (lordheavy)
- Luca Barbieri (lb, lb1)
- Maarten Maathuis (stillunknown)
- Marcin Kościelnicki (mwk, koriakin)
- Mark Carey (careym)
- Matthieu Castet (mat-c)
- nvidiaman (nvidiaman)
- Patrice Mandin (pmandin, pmdata)
- Pekka Paalanen (pq, ppaalanen)
- Peter Popov (ironpeter)
- Richard Hughes (hughsient)
- Rudi Cilibrasi (cilibrar)
- Serge Martin
- Simon Raffeiner
- Stephane Loeuillet (leroutier)
- Stephane Marchesin (marcheu)
- sturmflut (sturmflut)
- Sylvain Munaut
- Victor Stinner (haypo)
- Wladmir van der Laan (miathan6)
- Younes Manton (ymanton)
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 COPYRIGHT OWNER(S) 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.
*/
#define NV01_BETA_DMA_NOTIFY 0x00000180
#define NV01_BETA_BETA_1D31 0x00000300
#define NV04_BETA4_DMA_NOTIFY 0x00000180
#define NV04_BETA4_BETA_FACTOR 0x00000300
#define NV01_CHROMA_DMA_NOTIFY 0x00000180
#define NV01_CHROMA_COLOR_FORMAT 0x00000300
#define NV01_CHROMA_COLOR_FORMAT_A16R5G6B5 0x00000001
#define NV01_CHROMA_COLOR_FORMAT_X16A1R5G5B5 0x00000002
#define NV01_CHROMA_COLOR_FORMAT_A8R8G8B8 0x00000003
#define NV01_CHROMA_COLOR 0x00000304
#define NV01_PATTERN_DMA_NOTIFY 0x00000180
#define NV01_PATTERN_COLOR_FORMAT 0x00000300
#define NV01_PATTERN_COLOR_FORMAT_A16R5G6B5 0x00000001
#define NV01_PATTERN_COLOR_FORMAT_X16A1R5G5B5 0x00000002
#define NV01_PATTERN_COLOR_FORMAT_A8R8G8B8 0x00000003
#define NV01_PATTERN_MONOCHROME_FORMAT 0x00000304
#define NV01_PATTERN_MONOCHROME_FORMAT_CGA6 0x00000001
#define NV01_PATTERN_MONOCHROME_FORMAT_LE 0x00000002
#define NV01_PATTERN_MONOCHROME_SHAPE 0x00000308
#define NV01_PATTERN_MONOCHROME_SHAPE_8X8 0x00000000
#define NV01_PATTERN_MONOCHROME_SHAPE_64X1 0x00000001
#define NV01_PATTERN_MONOCHROME_SHAPE_1X64 0x00000002
#define NV04_PATTERN_PATTERN_SELECT 0x0000030c
#define NV04_PATTERN_PATTERN_SELECT_MONO 0x00000001
#define NV04_PATTERN_PATTERN_SELECT_COLOR 0x00000002
#define NV01_PATTERN_MONOCHROME_COLOR(i0) (0x00000310 + 0x4*(i0))
#define NV01_PATTERN_MONOCHROME_COLOR__ESIZE 0x00000004
#define NV01_PATTERN_MONOCHROME_COLOR__LEN 0x00000002
#define NV01_PATTERN_MONOCHROME_PATTERN(i0) (0x00000318 + 0x4*(i0))
#define NV01_PATTERN_MONOCHROME_PATTERN__ESIZE 0x00000004
#define NV01_PATTERN_MONOCHROME_PATTERN__LEN 0x00000002
#define NV04_PATTERN_PATTERN_Y8(i0) (0x00000400 + 0x4*(i0))
#define NV04_PATTERN_PATTERN_Y8__ESIZE 0x00000004
#define NV04_PATTERN_PATTERN_Y8__LEN 0x00000010
#define NV04_PATTERN_PATTERN_Y8_Y0__MASK 0x000000ff
#define NV04_PATTERN_PATTERN_Y8_Y0__SHIFT 0
#define NV04_PATTERN_PATTERN_Y8_Y1__MASK 0x0000ff00
#define NV04_PATTERN_PATTERN_Y8_Y1__SHIFT 8
#define NV04_PATTERN_PATTERN_Y8_Y2__MASK 0x00ff0000
#define NV04_PATTERN_PATTERN_Y8_Y2__SHIFT 16
#define NV04_PATTERN_PATTERN_Y8_Y3__MASK 0xff000000
#define NV04_PATTERN_PATTERN_Y8_Y3__SHIFT 24
#define NV04_PATTERN_PATTERN_R5G6B5(i0) (0x00000500 + 0x4*(i0))
#define NV04_PATTERN_PATTERN_R5G6B5__ESIZE 0x00000004
#define NV04_PATTERN_PATTERN_R5G6B5__LEN 0x00000020
#define NV04_PATTERN_PATTERN_R5G6B5_B0__MASK 0x0000001f
#define NV04_PATTERN_PATTERN_R5G6B5_B0__SHIFT 0
#define NV04_PATTERN_PATTERN_R5G6B5_G0__MASK 0x000007e0
#define NV04_PATTERN_PATTERN_R5G6B5_G0__SHIFT 5
#define NV04_PATTERN_PATTERN_R5G6B5_R0__MASK 0x0000f800
#define NV04_PATTERN_PATTERN_R5G6B5_R0__SHIFT 11
#define NV04_PATTERN_PATTERN_R5G6B5_B1__MASK 0x001f0000
#define NV04_PATTERN_PATTERN_R5G6B5_B1__SHIFT 16
#define NV04_PATTERN_PATTERN_R5G6B5_G1__MASK 0x07e00000
#define NV04_PATTERN_PATTERN_R5G6B5_G1__SHIFT 21
#define NV04_PATTERN_PATTERN_R5G6B5_R1__MASK 0xf8000000
#define NV04_PATTERN_PATTERN_R5G6B5_R1__SHIFT 27
#define NV04_PATTERN_PATTERN_X1R5G5B5(i0) (0x00000600 + 0x4*(i0))
#define NV04_PATTERN_PATTERN_X1R5G5B5__ESIZE 0x00000004
#define NV04_PATTERN_PATTERN_X1R5G5B5__LEN 0x00000020
#define NV04_PATTERN_PATTERN_X1R5G5B5_B0__MASK 0x0000001f
#define NV04_PATTERN_PATTERN_X1R5G5B5_B0__SHIFT 0
#define NV04_PATTERN_PATTERN_X1R5G5B5_G0__MASK 0x000003e0
#define NV04_PATTERN_PATTERN_X1R5G5B5_G0__SHIFT 5
#define NV04_PATTERN_PATTERN_X1R5G5B5_R0__MASK 0x00007c00
#define NV04_PATTERN_PATTERN_X1R5G5B5_R0__SHIFT 10
#define NV04_PATTERN_PATTERN_X1R5G5B5_B1__MASK 0x001f0000
#define NV04_PATTERN_PATTERN_X1R5G5B5_B1__SHIFT 16
#define NV04_PATTERN_PATTERN_X1R5G5B5_G1__MASK 0x03e00000
#define NV04_PATTERN_PATTERN_X1R5G5B5_G1__SHIFT 21
#define NV04_PATTERN_PATTERN_X1R5G5B5_R1__MASK 0x7c000000
#define NV04_PATTERN_PATTERN_X1R5G5B5_R1__SHIFT 26
#define NV04_PATTERN_PATTERN_X8R8G8B8(i0) (0x00000700 + 0x4*(i0))
#define NV04_PATTERN_PATTERN_X8R8G8B8__ESIZE 0x00000004
#define NV04_PATTERN_PATTERN_X8R8G8B8__LEN 0x00000040
#define NV04_PATTERN_PATTERN_X8R8G8B8_B__MASK 0x000000ff
#define NV04_PATTERN_PATTERN_X8R8G8B8_B__SHIFT 0
#define NV04_PATTERN_PATTERN_X8R8G8B8_G__MASK 0x0000ff00
#define NV04_PATTERN_PATTERN_X8R8G8B8_G__SHIFT 8
#define NV04_PATTERN_PATTERN_X8R8G8B8_R__MASK 0x00ff0000
#define NV04_PATTERN_PATTERN_X8R8G8B8_R__SHIFT 16
#define NV01_CLIP_DMA_NOTIFY 0x00000180
#define NV01_CLIP_POINT 0x00000300
#define NV01_CLIP_POINT_X__MASK 0x0000ffff
#define NV01_CLIP_POINT_X__SHIFT 0
#define NV01_CLIP_POINT_Y__MASK 0xffff0000
#define NV01_CLIP_POINT_Y__SHIFT 16
#define NV01_CLIP_SIZE 0x00000304
#define NV01_CLIP_SIZE_W__MASK 0x0000ffff
#define NV01_CLIP_SIZE_W__SHIFT 0
#define NV01_CLIP_SIZE_H__MASK 0xffff0000
#define NV01_CLIP_SIZE_H__SHIFT 16
#define NV01_ROP_DMA_NOTIFY 0x00000180
#define NV01_ROP_ROP 0x00000300
#define NV04_SURFACE_2D_DMA_NOTIFY 0x00000180
#define NV04_SURFACE_2D_DMA_IMAGE_SOURCE 0x00000184
#define NV04_SURFACE_2D_DMA_IMAGE_DESTIN 0x00000188
#define NV50_SURFACE_2D_SRC_LINEAR 0x00000200
#define NV50_SURFACE_2D_SRC_TILE_MODE 0x00000204
#define NV50_SURFACE_2D_SRC_WIDTH 0x00000208
#define NV50_SURFACE_2D_SRC_HEIGHT 0x0000020c
#define NV50_SURFACE_2D_UNK0210 0x00000210
#define NV50_SURFACE_2D_UNK0214 0x00000214
#define NV50_SURFACE_2D_DST_LINEAR 0x00000218
#define NV50_SURFACE_2D_DST_TILE_MODE 0x0000021c
#define NV50_SURFACE_2D_DST_WIDTH 0x00000220
#define NV50_SURFACE_2D_DST_HEIGHT 0x00000224
#define NV50_SURFACE_2D_UNK0228 0x00000228
#define NV50_SURFACE_2D_UNK022C 0x0000022c
#define NV50_SURFACE_2D_OFFSET_SOURCE_HIGH 0x00000230
#define NV50_SURFACE_2D_OFFSET_DESTIN_HIGH 0x00000234
#define NV04_SURFACE_2D_FORMAT 0x00000300
#define NV04_SURFACE_2D_FORMAT_Y8 0x00000001
#define NV04_SURFACE_2D_FORMAT_X1R5G5B5_Z1R5G5B5 0x00000002
#define NV04_SURFACE_2D_FORMAT_X1R5G5B5_X1R5G5B5 0x00000003
#define NV04_SURFACE_2D_FORMAT_R5G6B5 0x00000004
#define NV04_SURFACE_2D_FORMAT_Y16 0x00000005
#define NV04_SURFACE_2D_FORMAT_X8R8G8B8_Z8R8G8B8 0x00000006
#define NV04_SURFACE_2D_FORMAT_X8R8G8B8_X8R8G8B8 0x00000007
#define NV04_SURFACE_2D_FORMAT_X1A7R8G8B8_Z1A7R8G8B8 0x00000008
#define NV04_SURFACE_2D_FORMAT_X1A7R8G8B8_X1A7R8G8B8 0x00000009
#define NV04_SURFACE_2D_FORMAT_A8R8G8B8 0x0000000a
#define NV04_SURFACE_2D_FORMAT_Y32 0x0000000b
#define NV04_SURFACE_2D_PITCH 0x00000304
#define NV04_SURFACE_2D_PITCH_SOURCE__MASK 0x0000ffff
#define NV04_SURFACE_2D_PITCH_SOURCE__SHIFT 0
#define NV04_SURFACE_2D_PITCH_DESTIN__MASK 0xffff0000
#define NV04_SURFACE_2D_PITCH_DESTIN__SHIFT 16
#define NV04_SURFACE_2D_OFFSET_SOURCE 0x00000308
#define NV04_SURFACE_2D_OFFSET_DESTIN 0x0000030c
#define NV04_SURFACE_SWZ_DMA_NOTIFY 0x00000180
#define NV04_SURFACE_SWZ_DMA_IMAGE 0x00000184
#define NV04_SURFACE_SWZ_FORMAT 0x00000300
#define NV04_SURFACE_SWZ_FORMAT_COLOR__MASK 0x000000ff
#define NV04_SURFACE_SWZ_FORMAT_COLOR__SHIFT 0
#define NV04_SURFACE_SWZ_FORMAT_COLOR_Y8 0x00000001
#define NV04_SURFACE_SWZ_FORMAT_COLOR_X1R5G5B5_Z1R5G5B5 0x00000002
#define NV04_SURFACE_SWZ_FORMAT_COLOR_X1R5G5B5_X1R5G5B5 0x00000003
#define NV04_SURFACE_SWZ_FORMAT_COLOR_R5G6B5 0x00000004
#define NV04_SURFACE_SWZ_FORMAT_COLOR_Y16 0x00000005
#define NV04_SURFACE_SWZ_FORMAT_COLOR_X8R8G8B8_Z8R8G8B8 0x00000006
#define NV04_SURFACE_SWZ_FORMAT_COLOR_X8R8G8B8_X8R8G8B8 0x00000007
#define NV04_SURFACE_SWZ_FORMAT_COLOR_X1A7R8G8B8_Z1A7R8G8B8 0x00000008
#define NV04_SURFACE_SWZ_FORMAT_COLOR_X1A7R8G8B8_X1A7R8G8B8 0x00000009
#define NV04_SURFACE_SWZ_FORMAT_COLOR_A8R8G8B8 0x0000000a
#define NV04_SURFACE_SWZ_FORMAT_COLOR_Y32 0x0000000b
#define NV04_SURFACE_SWZ_FORMAT_BASE_SIZE_U__MASK 0x00ff0000
#define NV04_SURFACE_SWZ_FORMAT_BASE_SIZE_U__SHIFT 16
#define NV04_SURFACE_SWZ_FORMAT_BASE_SIZE_V__MASK 0xff000000
#define NV04_SURFACE_SWZ_FORMAT_BASE_SIZE_V__SHIFT 24
#define NV04_SURFACE_SWZ_OFFSET 0x00000304
#define NV01_POINT_PATCH 0x0000010c
#define NV01_POINT_DMA_NOTIFY 0x00000180
#define NV01_POINT_CLIP 0x00000184
#define NV01_POINT_PATTERN 0x00000188
#define NV01_POINT_ROP 0x0000018c
#define NV01_POINT_BETA 0x00000190
#define NV01_POINT_SURFACE_DST 0x00000194
#define NV01_POINT_OPERATION 0x000002fc
#define NV01_POINT_OPERATION_SRCCOPY_AND 0x00000000
#define NV01_POINT_OPERATION_ROP_AND 0x00000001
#define NV01_POINT_OPERATION_BLEND_AND 0x00000002
#define NV01_POINT_OPERATION_SRCCOPY 0x00000003
#define NV01_POINT_OPERATION_SRCCOPY_PREMULT 0x00000004
#define NV01_POINT_OPERATION_BLEND_PREMULT 0x00000005
#define NV01_POINT_COLOR_FORMAT 0x00000300
#define NV01_POINT_COLOR_FORMAT_X16A8Y8 0x00000001
#define NV01_POINT_COLOR_FORMAT_X24Y8 0x00000002
#define NV01_POINT_COLOR_FORMAT_X16A1R5G5B5 0x00000003
#define NV01_POINT_COLOR_FORMAT_X17R5G5B5 0x00000004
#define NV01_POINT_COLOR_FORMAT_A8R8G8B8 0x00000005
#define NV01_POINT_COLOR_FORMAT_X8R8G8B8 0x00000006
#define NV01_POINT_COLOR_FORMAT_A16Y16 0x00000007
#define NV01_POINT_COLOR_FORMAT_X16Y16 0x00000008
#define NV01_POINT_COLOR 0x00000304
#define NV01_POINT_POINT(i0) (0x00000400 + 0x4*(i0))
#define NV01_POINT_POINT__ESIZE 0x00000004
#define NV01_POINT_POINT__LEN 0x00000020
#define NV01_POINT_POINT_X__MASK 0x0000ffff
#define NV01_POINT_POINT_X__SHIFT 0
#define NV01_POINT_POINT_Y__MASK 0xffff0000
#define NV01_POINT_POINT_Y__SHIFT 16
#define NV01_POINT_POINT32_X(i0) (0x00000480 + 0x8*(i0))
#define NV01_POINT_POINT32_X__ESIZE 0x00000008
#define NV01_POINT_POINT32_X__LEN 0x00000010
#define NV01_POINT_POINT32_Y(i0) (0x00000484 + 0x8*(i0))
#define NV01_POINT_POINT32_Y__ESIZE 0x00000008
#define NV01_POINT_POINT32_Y__LEN 0x00000010
#define NV01_POINT_CPOINT_COLOR(i0) (0x00000500 + 0x8*(i0))
#define NV01_POINT_CPOINT_COLOR__ESIZE 0x00000008
#define NV01_POINT_CPOINT_COLOR__LEN 0x00000010
#define NV01_POINT_CPOINT_POINT(i0) (0x00000504 + 0x8*(i0))
#define NV01_POINT_CPOINT_POINT__ESIZE 0x00000008
#define NV01_POINT_CPOINT_POINT__LEN 0x00000010
#define NV01_POINT_CPOINT_POINT_X__MASK 0x0000ffff
#define NV01_POINT_CPOINT_POINT_X__SHIFT 0
#define NV01_POINT_CPOINT_POINT_Y__MASK 0xffff0000
#define NV01_POINT_CPOINT_POINT_Y__SHIFT 16
#define NV01_LINE_PATCH 0x0000010c
#define NV01_LINE_DMA_NOTIFY 0x00000180
#define NV01_LINE_CLIP 0x00000184
#define NV01_LINE_PATTERN 0x00000188
#define NV04_LIN_PATTERN 0x00000188
#define NV01_LINE_ROP 0x0000018c
#define NV01_LINE_BETA 0x00000190
#define NV01_LINE_SURFACE_DST 0x00000194
#define NV04_LIN_BETA4 0x00000194
#define NV04_LIN_SURFACE 0x00000198
#define NV01_LINE_OPERATION 0x000002fc
#define NV01_LINE_OPERATION_SRCCOPY_AND 0x00000000
#define NV01_LINE_OPERATION_ROP_AND 0x00000001
#define NV01_LINE_OPERATION_BLEND_AND 0x00000002
#define NV01_LINE_OPERATION_SRCCOPY 0x00000003
#define NV01_LINE_OPERATION_SRCCOPY_PREMULT 0x00000004
#define NV01_LINE_OPERATION_BLEND_PREMULT 0x00000005
#define NV01_LINE_COLOR_FORMAT 0x00000300
#define NV01_LINE_COLOR_FORMAT_A16R5G6B5 0x00000001
#define NV01_LINE_COLOR_FORMAT_X16A1R5G5B5 0x00000002
#define NV01_LINE_COLOR_FORMAT_A8R8G8B8 0x00000003
#define NV01_LINE_COLOR 0x00000304
#define NV01_LINE_LINE_POINT0(i0) (0x00000400 + 0x8*(i0))
#define NV01_LINE_LINE_POINT0__ESIZE 0x00000008
#define NV01_LINE_LINE_POINT0__LEN 0x00000010
#define NV01_LINE_LINE_POINT0_X__MASK 0x0000ffff
#define NV01_LINE_LINE_POINT0_X__SHIFT 0
#define NV01_LINE_LINE_POINT0_Y__MASK 0xffff0000
#define NV01_LINE_LINE_POINT0_Y__SHIFT 16
#define NV01_LINE_LINE_POINT1(i0) (0x00000404 + 0x8*(i0))
#define NV01_LINE_LINE_POINT1__ESIZE 0x00000008
#define NV01_LINE_LINE_POINT1__LEN 0x00000010
#define NV01_LINE_LINE_POINT1_X__MASK 0x0000ffff
#define NV01_LINE_LINE_POINT1_X__SHIFT 0
#define NV01_LINE_LINE_POINT1_Y__MASK 0xffff0000
#define NV01_LINE_LINE_POINT1_Y__SHIFT 16
#define NV01_LINE_LINE32_POINT0_X(i0) (0x00000480 + 0x10*(i0))
#define NV01_LINE_LINE32_POINT0_X__ESIZE 0x00000010
#define NV01_LINE_LINE32_POINT0_X__LEN 0x00000008
#define NV01_LINE_LINE32_POINT0_Y(i0) (0x00000484 + 0x10*(i0))
#define NV01_LINE_LINE32_POINT0_Y__ESIZE 0x00000010
#define NV01_LINE_LINE32_POINT0_Y__LEN 0x00000008
#define NV01_LINE_LINE32_POINT1_X(i0) (0x00000488 + 0x10*(i0))
#define NV01_LINE_LINE32_POINT1_X__ESIZE 0x00000010
#define NV01_LINE_LINE32_POINT1_X__LEN 0x00000008
#define NV01_LINE_LINE32_POINT1_Y(i0) (0x0000048c + 0x10*(i0))
#define NV01_LINE_LINE32_POINT1_Y__ESIZE 0x00000010
#define NV01_LINE_LINE32_POINT1_Y__LEN 0x00000008
#define NV01_LINE_POLYLINE(i0) (0x00000500 + 0x4*(i0))
#define NV01_LINE_POLYLINE__ESIZE 0x00000004
#define NV01_LINE_POLYLINE__LEN 0x00000020
#define NV01_LINE_POLYLINE_X__MASK 0x0000ffff
#define NV01_LINE_POLYLINE_X__SHIFT 0
#define NV01_LINE_POLYLINE_Y__MASK 0xffff0000
#define NV01_LINE_POLYLINE_Y__SHIFT 16
#define NV01_LINE_POLYLINE32_POINT_X(i0) (0x00000580 + 0x8*(i0))
#define NV01_LINE_POLYLINE32_POINT_X__ESIZE 0x00000008
#define NV01_LINE_POLYLINE32_POINT_X__LEN 0x00000010
#define NV01_LINE_POLYLINE32_POINT_Y(i0) (0x00000584 + 0x8*(i0))
#define NV01_LINE_POLYLINE32_POINT_Y__ESIZE 0x00000008
#define NV01_LINE_POLYLINE32_POINT_Y__LEN 0x00000010
#define NV01_LINE_CPOLYLINE_COLOR(i0) (0x00000600 + 0x8*(i0))
#define NV01_LINE_CPOLYLINE_COLOR__ESIZE 0x00000008
#define NV01_LINE_CPOLYLINE_COLOR__LEN 0x00000010
#define NV01_LINE_CPOLYLINE_POINT(i0) (0x00000604 + 0x8*(i0))
#define NV01_LINE_CPOLYLINE_POINT__ESIZE 0x00000008
#define NV01_LINE_CPOLYLINE_POINT__LEN 0x00000010
#define NV01_LINE_CPOLYLINE_POINT_X__MASK 0x0000ffff
#define NV01_LINE_CPOLYLINE_POINT_X__SHIFT 0
#define NV01_LINE_CPOLYLINE_POINT_Y__MASK 0xffff0000
#define NV01_LINE_CPOLYLINE_POINT_Y__SHIFT 16
#define NV01_TRI_PATCH 0x0000010c
#define NV01_TRI_DMA_NOTIFY 0x00000180
#define NV01_TRI_CLIP 0x00000184
#define NV01_TRI_PATTERN 0x00000188
#define NV04_TRI_PATTERN 0x00000188
#define NV01_TRI_ROP 0x0000018c
#define NV01_TRI_BETA 0x00000190
#define NV01_TRI_SURFACE_DST 0x00000194
#define NV04_TRI_BETA4 0x00000194
#define NV04_TRI_SURFACE 0x00000198
#define NV01_TRI_OPERATION 0x000002fc
#define NV01_TRI_OPERATION_SRCCOPY_AND 0x00000000
#define NV01_TRI_OPERATION_ROP_AND 0x00000001
#define NV01_TRI_OPERATION_BLEND_AND 0x00000002
#define NV01_TRI_OPERATION_SRCCOPY 0x00000003
#define NV01_TRI_OPERATION_SRCCOPY_PREMULT 0x00000004
#define NV01_TRI_OPERATION_BLEND_PREMULT 0x00000005
#define NV01_TRI_COLOR_FORMAT 0x00000300
#define NV01_TRI_COLOR_FORMAT_A16R5G6B5 0x00000001
#define NV01_TRI_COLOR_FORMAT_X16A1R5G5B5 0x00000002
#define NV01_TRI_COLOR_FORMAT_A8R8G8B8 0x00000003
#define NV01_TRI_COLOR 0x00000304
#define NV01_TRI_TRIANGLE_POINT0 0x00000310
#define NV01_TRI_TRIANGLE_POINT0_X__MASK 0x0000ffff
#define NV01_TRI_TRIANGLE_POINT0_X__SHIFT 0
#define NV01_TRI_TRIANGLE_POINT0_Y__MASK 0xffff0000
#define NV01_TRI_TRIANGLE_POINT0_Y__SHIFT 16
#define NV01_TRI_TRIANGLE_POINT1 0x00000314
#define NV01_TRI_TRIANGLE_POINT1_X__MASK 0x0000ffff
#define NV01_TRI_TRIANGLE_POINT1_X__SHIFT 0
#define NV01_TRI_TRIANGLE_POINT1_Y__MASK 0xffff0000
#define NV01_TRI_TRIANGLE_POINT1_Y__SHIFT 16
#define NV01_TRI_TRIANGLE_POINT2 0x00000318
#define NV01_TRI_TRIANGLE_POINT2_X__MASK 0x0000ffff
#define NV01_TRI_TRIANGLE_POINT2_X__SHIFT 0
#define NV01_TRI_TRIANGLE_POINT2_Y__MASK 0xffff0000
#define NV01_TRI_TRIANGLE_POINT2_Y__SHIFT 16
#define NV01_TRI_TRIANGLE32_POINT0_X 0x00000320
#define NV01_TRI_TRIANGLE32_POINT0_Y 0x00000324
#define NV01_TRI_TRIANGLE32_POINT1_X 0x00000328
#define NV01_TRI_TRIANGLE32_POINT1_Y 0x0000032c
#define NV01_TRI_TRIANGLE32_POINT2_X 0x00000330
#define NV01_TRI_TRIANGLE32_POINT2_Y 0x00000334
#define NV01_TRI_TRIMESH(i0) (0x00000400 + 0x4*(i0))
#define NV01_TRI_TRIMESH__ESIZE 0x00000004
#define NV01_TRI_TRIMESH__LEN 0x00000020
#define NV01_TRI_TRIMESH_X__MASK 0x0000ffff
#define NV01_TRI_TRIMESH_X__SHIFT 0
#define NV01_TRI_TRIMESH_Y__MASK 0xffff0000
#define NV01_TRI_TRIMESH_Y__SHIFT 16
#define NV01_TRI_TRIMESH32_POINT_X(i0) (0x00000480 + 0x8*(i0))
#define NV01_TRI_TRIMESH32_POINT_X__ESIZE 0x00000008
#define NV01_TRI_TRIMESH32_POINT_X__LEN 0x00000010
#define NV01_TRI_TRIMESH32_POINT_Y(i0) (0x00000484 + 0x8*(i0))
#define NV01_TRI_TRIMESH32_POINT_Y__ESIZE 0x00000008
#define NV01_TRI_TRIMESH32_POINT_Y__LEN 0x00000010
#define NV01_TRI_CTRIANGLE_COLOR(i0) (0x00000500 + 0x10*(i0))
#define NV01_TRI_CTRIANGLE_COLOR__ESIZE 0x00000010
#define NV01_TRI_CTRIANGLE_COLOR__LEN 0x00000008
#define NV01_TRI_CTRIANGLE_POINT0(i0) (0x00000504 + 0x10*(i0))
#define NV01_TRI_CTRIANGLE_POINT0__ESIZE 0x00000010
#define NV01_TRI_CTRIANGLE_POINT0__LEN 0x00000008
#define NV01_TRI_CTRIANGLE_POINT0_X__MASK 0x0000ffff
#define NV01_TRI_CTRIANGLE_POINT0_X__SHIFT 0
#define NV01_TRI_CTRIANGLE_POINT0_Y__MASK 0xffff0000
#define NV01_TRI_CTRIANGLE_POINT0_Y__SHIFT 16
#define NV01_TRI_CTRIANGLE_POINT1(i0) (0x00000508 + 0x10*(i0))
#define NV01_TRI_CTRIANGLE_POINT1__ESIZE 0x00000010
#define NV01_TRI_CTRIANGLE_POINT1__LEN 0x00000008
#define NV01_TRI_CTRIANGLE_POINT1_X__MASK 0x0000ffff
#define NV01_TRI_CTRIANGLE_POINT1_X__SHIFT 0
#define NV01_TRI_CTRIANGLE_POINT1_Y__MASK 0xffff0000
#define NV01_TRI_CTRIANGLE_POINT1_Y__SHIFT 16
#define NV01_TRI_CTRIANGLE_POINT2(i0) (0x0000050c + 0x10*(i0))
#define NV01_TRI_CTRIANGLE_POINT2__ESIZE 0x00000010
#define NV01_TRI_CTRIANGLE_POINT2__LEN 0x00000008
#define NV01_TRI_CTRIANGLE_POINT2_X__MASK 0x0000ffff
#define NV01_TRI_CTRIANGLE_POINT2_X__SHIFT 0
#define NV01_TRI_CTRIANGLE_POINT2_Y__MASK 0xffff0000
#define NV01_TRI_CTRIANGLE_POINT2_Y__SHIFT 16
#define NV01_TRI_CTRIMESH_COLOR(i0) (0x00000580 + 0x8*(i0))
#define NV01_TRI_CTRIMESH_COLOR__ESIZE 0x00000008
#define NV01_TRI_CTRIMESH_COLOR__LEN 0x00000010
#define NV01_TRI_CTRIMESH_POINT(i0) (0x00000584 + 0x8*(i0))
#define NV01_TRI_CTRIMESH_POINT__ESIZE 0x00000008
#define NV01_TRI_CTRIMESH_POINT__LEN 0x00000010
#define NV01_TRI_CTRIMESH_POINT_X__MASK 0x0000ffff
#define NV01_TRI_CTRIMESH_POINT_X__SHIFT 0
#define NV01_TRI_CTRIMESH_POINT_Y__MASK 0xffff0000
#define NV01_TRI_CTRIMESH_POINT_Y__SHIFT 16
#define NV01_RECT_PATCH 0x0000010c
#define NV01_RECT_DMA_NOTIFY 0x00000180
#define NV01_RECT_CLIP 0x00000184
#define NV01_RECT_PATTERN 0x00000188
#define NV04_RECT_PATTERN 0x00000188
#define NV01_RECT_ROP 0x0000018c
#define NV01_RECT_BETA 0x00000190
#define NV01_RECT_SURFACE_DST 0x00000194
#define NV04_RECT_BETA4 0x00000194
#define NV04_RECT_SURFACE 0x00000198
#define NV01_RECT_OPERATION 0x000002fc
#define NV01_RECT_OPERATION_SRCCOPY_AND 0x00000000
#define NV01_RECT_OPERATION_ROP_AND 0x00000001
#define NV01_RECT_OPERATION_BLEND_AND 0x00000002
#define NV01_RECT_OPERATION_SRCCOPY 0x00000003
#define NV01_RECT_OPERATION_SRCCOPY_PREMULT 0x00000004
#define NV01_RECT_OPERATION_BLEND_PREMULT 0x00000005
#define NV01_RECT_COLOR_FORMAT 0x00000300
#define NV01_RECT_COLOR_FORMAT_A16R5G6B5 0x00000001
#define NV01_RECT_COLOR_FORMAT_X16A1R5G5B5 0x00000002
#define NV01_RECT_COLOR_FORMAT_A8R8G8B8 0x00000003
#define NV01_RECT_COLOR 0x00000304
#define NV01_RECT_RECTANGLE_POINT(i0) (0x00000400 + 0x8*(i0))
#define NV01_RECT_RECTANGLE_POINT__ESIZE 0x00000008
#define NV01_RECT_RECTANGLE_POINT__LEN 0x00000010
#define NV01_RECT_RECTANGLE_POINT_X__MASK 0x0000ffff
#define NV01_RECT_RECTANGLE_POINT_X__SHIFT 0
#define NV01_RECT_RECTANGLE_POINT_Y__MASK 0xffff0000
#define NV01_RECT_RECTANGLE_POINT_Y__SHIFT 16
#define NV01_RECT_RECTANGLE_SIZE(i0) (0x00000404 + 0x8*(i0))
#define NV01_RECT_RECTANGLE_SIZE__ESIZE 0x00000008
#define NV01_RECT_RECTANGLE_SIZE__LEN 0x00000010
#define NV01_RECT_RECTANGLE_SIZE_W__MASK 0x0000ffff
#define NV01_RECT_RECTANGLE_SIZE_W__SHIFT 0
#define NV01_RECT_RECTANGLE_SIZE_H__MASK 0xffff0000
#define NV01_RECT_RECTANGLE_SIZE_H__SHIFT 16
#define NV01_BLIT_PATCH 0x0000010c
#define NV15_BLIT_WAIT_FOR_IDLE 0x00000108
#define NV15_BLIT_FLIP_SET_READ 0x00000120
#define NV15_BLIT_FLIP_SET_WRITE 0x00000124
#define NV15_BLIT_FLIP_MAX 0x00000128
#define NV15_BLIT_FLIP_INCR_WRITE 0x0000012c
#define NV15_BLIT_FLIP_WAIT 0x00000130
#define NV15_BLIT_FLIP_CRTC_INCR_READ 0x00000134
#define NV01_BLIT_DMA_NOTIFY 0x00000180
#define NV01_BLIT_COLOR_KEY 0x00000184
#define NV04_BLIT_COLOR_KEY 0x00000184
#define NV01_BLIT_CLIP 0x00000188
#define NV01_BLIT_PATTERN 0x0000018c
#define NV04_BLIT_PATTERN 0x0000018c
#define NV01_BLIT_ROP 0x00000190
#define NV01_BLIT_BETA 0x00000194
#define NV01_BLIT_SURFACE_SRC 0x00000198
#define NV01_BLIT_SURFACE_DST 0x0000019c
#define NV04_BLIT_BETA4 0x00000198
#define NV04_BLIT_SURFACES 0x0000019c
#define NV01_BLIT_OPERATION 0x000002fc
#define NV01_BLIT_OPERATION_SRCCOPY_AND 0x00000000
#define NV01_BLIT_OPERATION_ROP_AND 0x00000001
#define NV01_BLIT_OPERATION_BLEND_AND 0x00000002
#define NV01_BLIT_OPERATION_SRCCOPY 0x00000003
#define NV01_BLIT_OPERATION_SRCCOPY_PREMULT 0x00000004
#define NV01_BLIT_OPERATION_BLEND_PREMULT 0x00000005
#define NV01_BLIT_POINT_IN 0x00000300
#define NV01_BLIT_POINT_IN_X__MASK 0x0000ffff
#define NV01_BLIT_POINT_IN_X__SHIFT 0
#define NV01_BLIT_POINT_IN_Y__MASK 0xffff0000
#define NV01_BLIT_POINT_IN_Y__SHIFT 16
#define NV01_BLIT_POINT_OUT 0x00000304
#define NV01_BLIT_POINT_OUT_X__MASK 0x0000ffff
#define NV01_BLIT_POINT_OUT_X__SHIFT 0
#define NV01_BLIT_POINT_OUT_Y__MASK 0xffff0000
#define NV01_BLIT_POINT_OUT_Y__SHIFT 16
#define NV01_BLIT_SIZE 0x00000308
#define NV01_BLIT_SIZE_W__MASK 0x0000ffff
#define NV01_BLIT_SIZE_W__SHIFT 0
#define NV01_BLIT_SIZE_H__MASK 0xffff0000
#define NV01_BLIT_SIZE_H__SHIFT 16
#define NV04_INDEX_PATCH 0x0000010c
#define NV04_INDEX_DMA_NOTIFY 0x00000180
#define NV04_INDEX_DMA_LUT 0x00000184
#define NV04_INDEX_COLOR_KEY 0x00000188
#define NV04_INDEX_CLIP 0x0000018c
#define NV04_INDEX_PATTERN 0x00000190
#define NV04_INDEX_ROP 0x00000194
#define NV04_INDEX_BETA 0x00000198
#define NV04_INDEX_BETA4 0x0000019c
#define NV04_INDEX_SURFACE 0x000001a0
#define NV05_INDEX_SURFACE 0x000001a0
#define NV05_INDEX_COLOR_CONVERSION 0x000003e0
#define NV04_INDEX_OPERATION 0x000003e4
#define NV04_INDEX_COLOR_FORMAT 0x000003e8
#define NV04_INDEX_INDEX_FORMAT 0x000003ec
#define NV04_INDEX_LUT_OFFSET 0x000003f0
#define NV04_INDEX_POINT 0x000003f4
#define NV04_INDEX_SIZE_OUT 0x000003f8
#define NV04_INDEX_SIZE_IN 0x000003fc
#define NV04_INDEX_COLOR(i0) (0x00000400 + 0x4*(i0))
#define NV04_INDEX_COLOR__ESIZE 0x00000004
#define NV04_INDEX_COLOR__LEN 0x00000700
#define NV10_IFC_WAIT_FOR_IDLE 0x00000108
#define NV01_IFC_PATCH 0x0000010c
#define NV01_IFC_DMA_NOTIFY 0x00000180
#define NV01_IFC_COLOR_KEY 0x00000184
#define NV04_IFC_COLOR_KEY 0x00000184
#define NV01_IFC_CLIP 0x00000188
#define NV01_IFC_PATTERN 0x0000018c
#define NV04_IFC_PATTERN 0x0000018c
#define NV01_IFC_ROP 0x00000190
#define NV01_IFC_BETA 0x00000194
#define NV01_IFC_SURFACE_DST 0x00000198
#define NV04_IFC_BETA4 0x00000198
#define NV04_IFC_SURFACE 0x0000019c
#define NV05_IFC_COLOR_CONVERSION 0x000002f8
#define NV01_IFC_OPERATION 0x000002fc
#define NV01_IFC_OPERATION_SRCCOPY_AND 0x00000000
#define NV01_IFC_OPERATION_ROP_AND 0x00000001
#define NV01_IFC_OPERATION_BLEND_AND 0x00000002
#define NV01_IFC_OPERATION_SRCCOPY 0x00000003
#define NV01_IFC_OPERATION_SRCCOPY_PREMULT 0x00000004
#define NV01_IFC_OPERATION_BLEND_PREMULT 0x00000005
#define NV01_IFC_COLOR_FORMAT 0x00000300
#define NV01_IFC_COLOR_FORMAT_R5G6G5 0x00000001
#define NV01_IFC_COLOR_FORMAT_A1R5G5B5 0x00000002
#define NV01_IFC_COLOR_FORMAT_X1R5G5B5 0x00000003
#define NV01_IFC_COLOR_FORMAT_A8R8G8B8 0x00000004
#define NV01_IFC_COLOR_FORMAT_X8R8G8B8 0x00000005
#define NV01_IFC_POINT 0x00000304
#define NV01_IFC_POINT_X__MASK 0x0000ffff
#define NV01_IFC_POINT_X__SHIFT 0
#define NV01_IFC_POINT_Y__MASK 0xffff0000
#define NV01_IFC_POINT_Y__SHIFT 16
#define NV01_IFC_SIZE_OUT 0x00000308
#define NV01_IFC_SIZE_OUT_W__MASK 0x0000ffff
#define NV01_IFC_SIZE_OUT_W__SHIFT 0
#define NV01_IFC_SIZE_OUT_H__MASK 0xffff0000
#define NV01_IFC_SIZE_OUT_H__SHIFT 16
#define NV01_IFC_SIZE_IN 0x0000030c
#define NV01_IFC_SIZE_IN_W__MASK 0x0000ffff
#define NV01_IFC_SIZE_IN_W__SHIFT 0
#define NV01_IFC_SIZE_IN_H__MASK 0xffff0000
#define NV01_IFC_SIZE_IN_H__SHIFT 16
#define NV01_IFC_COLOR(i0) (0x00000400 + 0x4*(i0))
#define NV01_IFC_COLOR__ESIZE 0x00000004
#define NV01_IFC_COLOR__LEN 0x00000020
#define NV04_IFC_COLOR(i0) (0x00000400 + 0x4*(i0))
#define NV04_IFC_COLOR__ESIZE 0x00000004
#define NV04_IFC_COLOR__LEN 0x00000700
#define NV03_SIFC_PATCH 0x0000010c
#define NV03_SIFC_DMA_NOTIFY 0x00000180
#define NV03_SIFC_COLOR_KEY 0x00000184
#define NV04_SIFC_COLOR_KEY 0x00000184
#define NV03_SIFC_PATTERN 0x00000188
#define NV04_SIFC_PATTERN 0x00000188
#define NV03_SIFC_ROP 0x0000018c
#define NV03_SIFC_BETA 0x00000190
#define NV03_SIFC_SURFACE_DST 0x00000194
#define NV04_SIFC_BETA4 0x00000194
#define NV04_SIFC_SURFACE 0x00000198
#define NV05_SIFC_COLOR_CONVERSION 0x000002f8
#define NV03_SIFC_OPERATION 0x000002fc
#define NV03_SIFC_COLOR_FORMAT 0x00000300
#define NV03_SIFC_SIZE_IN 0x00000304
#define NV03_SIFC_SIZE_IN_W__MASK 0x0000ffff
#define NV03_SIFC_SIZE_IN_W__SHIFT 0
#define NV03_SIFC_SIZE_IN_H__MASK 0xffff0000
#define NV03_SIFC_SIZE_IN_H__SHIFT 16
#define NV03_SIFC_DX_DU 0x00000308
#define NV03_SIFC_DY_DV 0x0000030c
#define NV03_SIFC_CLIP_POINT 0x00000310
#define NV03_SIFC_CLIP_POINT_X__MASK 0x0000ffff
#define NV03_SIFC_CLIP_POINT_X__SHIFT 0
#define NV03_SIFC_CLIP_POINT_Y__MASK 0xffff0000
#define NV03_SIFC_CLIP_POINT_Y__SHIFT 16
#define NV03_SIFC_CLIP_SIZE 0x00000314
#define NV03_SIFC_CLIP_SIZE_W__MASK 0x0000ffff
#define NV03_SIFC_CLIP_SIZE_W__SHIFT 0
#define NV03_SIFC_CLIP_SIZE_H__MASK 0xffff0000
#define NV03_SIFC_CLIP_SIZE_H__SHIFT 16
#define NV03_SIFC_POINT12D4 0x00000318
#define NV03_SIFC_POINT12D4_X__MASK 0x0000ffff
#define NV03_SIFC_POINT12D4_X__SHIFT 0
#define NV03_SIFC_POINT12D4_Y__MASK 0xffff0000
#define NV03_SIFC_POINT12D4_Y__SHIFT 16
#define NV03_SIFC_COLOR(i0) (0x00000400 + 0x4*(i0))
#define NV03_SIFC_COLOR__ESIZE 0x00000004
#define NV03_SIFC_COLOR__LEN 0x00000700
#define NV10_SIFM_WAIT_FOR_IDLE 0x00000108
#define NV03_SIFM_DMA_NOTIFY 0x00000180
#define NV03_SIFM_DMA_IMAGE 0x00000184
#define NV03_SIFM_PATTERN 0x00000188
#define NV04_SIFM_PATTERN 0x00000188
#define NV03_SIFM_ROP 0x0000018c
#define NV03_SIFM_BETA 0x00000190
#define NV03_SIFM_SURFACE_DST 0x00000194
#define NV04_SIFM_BETA4 0x00000194
#define NV04_SIFM_SURFACE 0x00000198
#define NV05_SIFM_SURFACE 0x00000198
#define NV05_SIFM_COLOR_CONVERSION 0x000002fc
#define NV05_SIFM_COLOR_CONVERSION_DITHER 0x00000000
#define NV05_SIFM_COLOR_CONVERSION_TRUNCATE 0x00000001
#define NV05_SIFM_COLOR_CONVERSION_SUBTR_TRUNCATE 0x00000002
#define NV03_SIFM_COLOR_FORMAT 0x00000300
#define NV03_SIFM_COLOR_FORMAT_A1R5G5B5 0x00000001
#define NV03_SIFM_COLOR_FORMAT_X1R5G5B5 0x00000002
#define NV03_SIFM_COLOR_FORMAT_A8R8G8B8 0x00000003
#define NV03_SIFM_COLOR_FORMAT_X8R8G8B8 0x00000004
#define NV03_SIFM_COLOR_FORMAT_V8YB8U8YA8 0x00000005
#define NV03_SIFM_COLOR_FORMAT_YB8V8YA8U8 0x00000006
#define NV03_SIFM_COLOR_FORMAT_R5G6B5 0x00000007
#define NV03_SIFM_COLOR_FORMAT_Y8 0x00000008
#define NV03_SIFM_COLOR_FORMAT_AY8 0x00000009
#define NV03_SIFM_OPERATION 0x00000304
#define NV03_SIFM_OPERATION_SRCCOPY_AND 0x00000000
#define NV03_SIFM_OPERATION_ROP_AND 0x00000001
#define NV03_SIFM_OPERATION_BLEND_AND 0x00000002
#define NV03_SIFM_OPERATION_SRCCOPY 0x00000003
#define NV03_SIFM_OPERATION_SRCCOPY_PREMULT 0x00000004
#define NV03_SIFM_OPERATION_BLEND_PREMULT 0x00000005
#define NV03_SIFM_CLIP_POINT 0x00000308
#define NV03_SIFM_CLIP_POINT_X__MASK 0x0000ffff
#define NV03_SIFM_CLIP_POINT_X__SHIFT 0
#define NV03_SIFM_CLIP_POINT_Y__MASK 0xffff0000
#define NV03_SIFM_CLIP_POINT_Y__SHIFT 16
#define NV03_SIFM_CLIP_SIZE 0x0000030c
#define NV03_SIFM_CLIP_SIZE_W__MASK 0x0000ffff
#define NV03_SIFM_CLIP_SIZE_W__SHIFT 0
#define NV03_SIFM_CLIP_SIZE_H__MASK 0xffff0000
#define NV03_SIFM_CLIP_SIZE_H__SHIFT 16
#define NV03_SIFM_OUT_POINT 0x00000310
#define NV03_SIFM_OUT_POINT_X__MASK 0x0000ffff
#define NV03_SIFM_OUT_POINT_X__SHIFT 0
#define NV03_SIFM_OUT_POINT_Y__MASK 0xffff0000
#define NV03_SIFM_OUT_POINT_Y__SHIFT 16
#define NV03_SIFM_OUT_SIZE 0x00000314
#define NV03_SIFM_OUT_SIZE_W__MASK 0x0000ffff
#define NV03_SIFM_OUT_SIZE_W__SHIFT 0
#define NV03_SIFM_OUT_SIZE_H__MASK 0xffff0000
#define NV03_SIFM_OUT_SIZE_H__SHIFT 16
#define NV03_SIFM_DU_DX 0x00000318
#define NV03_SIFM_DV_DY 0x0000031c
#define NV03_SIFM_SIZE 0x00000400
#define NV03_SIFM_SIZE_W__MASK 0x0000ffff
#define NV03_SIFM_SIZE_W__SHIFT 0
#define NV03_SIFM_SIZE_H__MASK 0xffff0000
#define NV03_SIFM_SIZE_H__SHIFT 16
#define NV03_SIFM_FORMAT 0x00000404
#define NV03_SIFM_FORMAT_PITCH__MASK 0x0000ffff
#define NV03_SIFM_FORMAT_PITCH__SHIFT 0
#define NV03_SIFM_FORMAT_ORIGIN__MASK 0x00ff0000
#define NV03_SIFM_FORMAT_ORIGIN__SHIFT 16
#define NV03_SIFM_FORMAT_ORIGIN_CENTER 0x00010000
#define NV03_SIFM_FORMAT_ORIGIN_CORNER 0x00020000
#define NV03_SIFM_FORMAT_FILTER__MASK 0xff000000
#define NV03_SIFM_FORMAT_FILTER__SHIFT 24
#define NV03_SIFM_FORMAT_FILTER_POINT_SAMPLE 0x00000000
#define NV03_SIFM_FORMAT_FILTER_BILINEAR 0x01000000
#define NV03_SIFM_OFFSET 0x00000408
#define NV03_SIFM_POINT 0x0000040c
#define NV03_SIFM_POINT_U__MASK 0x0000ffff
#define NV03_SIFM_POINT_U__SHIFT 0
#define NV03_SIFM_POINT_V__MASK 0xffff0000
#define NV03_SIFM_POINT_V__SHIFT 16
#define NV50_SIFM_OFFSET_HIGH 0x00000410
#define NV50_SIFM_SRC_LINEAR 0x00000414
#define NV50_SIFM_SRC_TILE_MODE 0x00000418
#define NV03_GDI_DMA_NOTIFY 0x00000180
#define NV03_GDI_PATTERN 0x00000184
#define NV03_GDI_ROP 0x00000188
#define NV03_GDI_BETA 0x0000019c
#define NV03_GDI_SURFACE_DST 0x00000190
#define NV03_GDI_OPERATION 0x000002fc
#define NV03_GDI_COLOR_FORMAT 0x00000300
#define NV03_GDI_MONOCHROME_FORMAT 0x00000304
#define NV03_GDI_COLOR1_A 0x000003fc
#define NV03_GDI_UNCLIPPED_RECTANGLE_POINT(i0) (0x00000400 + 0x8*(i0))
#define NV03_GDI_UNCLIPPED_RECTANGLE_POINT__ESIZE 0x00000008
#define NV03_GDI_UNCLIPPED_RECTANGLE_POINT__LEN 0x00000040
#define NV03_GDI_UNCLIPPED_RECTANGLE_POINT_Y__MASK 0x0000ffff
#define NV03_GDI_UNCLIPPED_RECTANGLE_POINT_Y__SHIFT 0
#define NV03_GDI_UNCLIPPED_RECTANGLE_POINT_X__MASK 0xffff0000
#define NV03_GDI_UNCLIPPED_RECTANGLE_POINT_X__SHIFT 16
#define NV03_GDI_UNCLIPPED_RECTANGLE_SIZE(i0) (0x00000404 + 0x8*(i0))
#define NV03_GDI_UNCLIPPED_RECTANGLE_SIZE__ESIZE 0x00000008
#define NV03_GDI_UNCLIPPED_RECTANGLE_SIZE__LEN 0x00000040
#define NV03_GDI_UNCLIPPED_RECTANGLE_SIZE_H__MASK 0x0000ffff
#define NV03_GDI_UNCLIPPED_RECTANGLE_SIZE_H__SHIFT 0
#define NV03_GDI_UNCLIPPED_RECTANGLE_SIZE_W__MASK 0xffff0000
#define NV03_GDI_UNCLIPPED_RECTANGLE_SIZE_W__SHIFT 16
#define NV03_GDI_CLIP_POINT0_B 0x000007f4
#define NV03_GDI_CLIP_POINT0_B_L__MASK 0x0000ffff
#define NV03_GDI_CLIP_POINT0_B_L__SHIFT 0
#define NV03_GDI_CLIP_POINT0_B_T__MASK 0xffff0000
#define NV03_GDI_CLIP_POINT0_B_T__SHIFT 16
#define NV03_GDI_CLIP_POINT1_B 0x000007f8
#define NV03_GDI_CLIP_POINT1_B_R__MASK 0x0000ffff
#define NV03_GDI_CLIP_POINT1_B_R__SHIFT 0
#define NV03_GDI_CLIP_POINT1_B_B__MASK 0xffff0000
#define NV03_GDI_CLIP_POINT1_B_B__SHIFT 16
#define NV03_GDI_COLOR1_B 0x000007fc
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_0(i0) (0x00000800 + 0x8*(i0))
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_0__ESIZE 0x00000008
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_0__LEN 0x00000040
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_0_L__MASK 0x0000ffff
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_0_L__SHIFT 0
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_0_T__MASK 0xffff0000
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_0_T__SHIFT 16
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_1(i0) (0x00000804 + 0x8*(i0))
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_1__ESIZE 0x00000008
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_1__LEN 0x00000040
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_1_R__MASK 0x0000ffff
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_1_R__SHIFT 0
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_1_B__MASK 0xffff0000
#define NV03_GDI_CLIPPED_RECTANGLE_POINT_1_B__SHIFT 16
#define NV03_GDI_CLIP_C_POINT0 0x00000bec
#define NV03_GDI_CLIP_C_POINT0_L__MASK 0x0000ffff
#define NV03_GDI_CLIP_C_POINT0_L__SHIFT 0
#define NV03_GDI_CLIP_C_POINT0_T__MASK 0xffff0000
#define NV03_GDI_CLIP_C_POINT0_T__SHIFT 16
#define NV03_GDI_CLIP_C_POINT1 0x00000bf0
#define NV03_GDI_CLIP_C_POINT1_R__MASK 0x0000ffff
#define NV03_GDI_CLIP_C_POINT1_R__SHIFT 0
#define NV03_GDI_CLIP_C_POINT1_B__MASK 0xffff0000
#define NV03_GDI_CLIP_C_POINT1_B__SHIFT 16
#define NV03_GDI_COLOR1_C 0x00000bf4
#define NV03_GDI_SIZE_C 0x00000bf8
#define NV03_GDI_SIZE_C_W__MASK 0x0000ffff
#define NV03_GDI_SIZE_C_W__SHIFT 0
#define NV03_GDI_SIZE_C_H__MASK 0xffff0000
#define NV03_GDI_SIZE_C_H__SHIFT 16
#define NV03_GDI_POINT_C 0x00000bfc
#define NV03_GDI_POINT_C_X__MASK 0x0000ffff
#define NV03_GDI_POINT_C_X__SHIFT 0
#define NV03_GDI_POINT_C_Y__MASK 0xffff0000
#define NV03_GDI_POINT_C_Y__SHIFT 16
#define NV03_GDI_MONOCHROME_COLOR1_C(i0) (0x00000c00 + 0x4*(i0))
#define NV03_GDI_MONOCHROME_COLOR1_C__ESIZE 0x00000004
#define NV03_GDI_MONOCHROME_COLOR1_C__LEN 0x00000080
#define NV03_GDI_CLIP_D_POINT0 0x00000fe8
#define NV03_GDI_CLIP_D_POINT0_L__MASK 0x0000ffff
#define NV03_GDI_CLIP_D_POINT0_L__SHIFT 0
#define NV03_GDI_CLIP_D_POINT0_T__MASK 0xffff0000
#define NV03_GDI_CLIP_D_POINT0_T__SHIFT 16
#define NV03_GDI_CLIP_D_POINT1 0x00000fec
#define NV03_GDI_CLIP_D_POINT1_R__MASK 0x0000ffff
#define NV03_GDI_CLIP_D_POINT1_R__SHIFT 0
#define NV03_GDI_CLIP_D_POINT1_B__MASK 0xffff0000
#define NV03_GDI_CLIP_D_POINT1_B__SHIFT 16
#define NV03_GDI_COLOR1_D 0x00000ff0
#define NV03_GDI_SIZE_IN_D 0x00000ff4
#define NV03_GDI_SIZE_IN_D_W__MASK 0x0000ffff
#define NV03_GDI_SIZE_IN_D_W__SHIFT 0
#define NV03_GDI_SIZE_IN_D_H__MASK 0xffff0000
#define NV03_GDI_SIZE_IN_D_H__SHIFT 16
#define NV03_GDI_SIZE_OUT_D 0x00000ff8
#define NV03_GDI_SIZE_OUT_D_W__MASK 0x0000ffff
#define NV03_GDI_SIZE_OUT_D_W__SHIFT 0
#define NV03_GDI_SIZE_OUT_D_H__MASK 0xffff0000
#define NV03_GDI_SIZE_OUT_D_H__SHIFT 16
#define NV03_GDI_POINT_D 0x00000ffc
#define NV03_GDI_POINT_D_X__MASK 0x0000ffff
#define NV03_GDI_POINT_D_X__SHIFT 0
#define NV03_GDI_POINT_D_Y__MASK 0xffff0000
#define NV03_GDI_POINT_D_Y__SHIFT 16
#define NV03_GDI_MONOCHROME_COLOR1_D(i0) (0x00001000 + 0x4*(i0))
#define NV03_GDI_MONOCHROME_COLOR1_D__ESIZE 0x00000004
#define NV03_GDI_MONOCHROME_COLOR1_D__LEN 0x00000080
#define NV03_GDI_CLIP_E_POINT0 0x000013e4
#define NV03_GDI_CLIP_E_POINT0_L__MASK 0x0000ffff
#define NV03_GDI_CLIP_E_POINT0_L__SHIFT 0
#define NV03_GDI_CLIP_E_POINT0_T__MASK 0xffff0000
#define NV03_GDI_CLIP_E_POINT0_T__SHIFT 16
#define NV03_GDI_CLIP_E_POINT1 0x000013e8
#define NV03_GDI_CLIP_E_POINT1_R__MASK 0x0000ffff
#define NV03_GDI_CLIP_E_POINT1_R__SHIFT 0
#define NV03_GDI_CLIP_E_POINT1_B__MASK 0xffff0000
#define NV03_GDI_CLIP_E_POINT1_B__SHIFT 16
#define NV03_GDI_COLOR0_E 0x000013ec
#define NV03_GDI_COLOR1_E 0x000013f0
#define NV03_GDI_SIZE_IN_E 0x000013f4
#define NV03_GDI_SIZE_IN_E_W__MASK 0x0000ffff
#define NV03_GDI_SIZE_IN_E_W__SHIFT 0
#define NV03_GDI_SIZE_IN_E_H__MASK 0xffff0000
#define NV03_GDI_SIZE_IN_E_H__SHIFT 16
#define NV03_GDI_SIZE_OUT_E 0x000013f8
#define NV03_GDI_SIZE_OUT_E_W__MASK 0x0000ffff
#define NV03_GDI_SIZE_OUT_E_W__SHIFT 0
#define NV03_GDI_SIZE_OUT_E_H__MASK 0xffff0000
#define NV03_GDI_SIZE_OUT_E_H__SHIFT 16
#define NV03_GDI_POINT_E 0x000013fc
#define NV03_GDI_POINT_E_X__MASK 0x0000ffff
#define NV03_GDI_POINT_E_X__SHIFT 0
#define NV03_GDI_POINT_E_Y__MASK 0xffff0000
#define NV03_GDI_POINT_E_Y__SHIFT 16
#define NV03_GDI_MONOCHROME_COLOR01_E(i0) (0x00001400 + 0x4*(i0))
#define NV03_GDI_MONOCHROME_COLOR01_E__ESIZE 0x00000004
#define NV03_GDI_MONOCHROME_COLOR01_E__LEN 0x00000080
#define NV04_GDI_PATCH 0x0000010c
#define NV04_GDI_DMA_NOTIFY 0x00000180
#define NV04_GDI_DMA_FONTS 0x00000184
#define NV04_GDI_PATTERN 0x00000188
#define NV04_GDI_ROP 0x0000018c
#define NV04_GDI_BETA 0x00000190
#define NV04_GDI_BETA4 0x00000194
#define NV04_GDI_SURFACE 0x00000198
#define NV04_GDI_OPERATION 0x000002fc
#define NV04_GDI_OPERATION_SRCCOPY_AND 0x00000000
#define NV04_GDI_OPERATION_ROP_AND 0x00000001
#define NV04_GDI_OPERATION_BLEND_AND 0x00000002
#define NV04_GDI_OPERATION_SRCCOPY 0x00000003
#define NV04_GDI_OPERATION_SRCCOPY_PREMULT 0x00000004
#define NV04_GDI_OPERATION_BLEND_PREMULT 0x00000005
#define NV04_GDI_COLOR_FORMAT 0x00000300
#define NV04_GDI_COLOR_FORMAT_A16R5G6B5 0x00000001
#define NV04_GDI_COLOR_FORMAT_X16A1R5G5B5 0x00000002
#define NV04_GDI_COLOR_FORMAT_A8R8G8B8 0x00000003
#define NV04_GDI_MONOCHROME_FORMAT 0x00000304
#define NV04_GDI_MONOCHROME_FORMAT_CGA6 0x00000001
#define NV04_GDI_MONOCHROME_FORMAT_LE 0x00000002
#define NV04_GDI_COLOR1_A 0x000003fc
#define NV04_GDI_UNCLIPPED_RECTANGLE_POINT(i0) (0x00000400 + 0x8*(i0))
#define NV04_GDI_UNCLIPPED_RECTANGLE_POINT__ESIZE 0x00000008
#define NV04_GDI_UNCLIPPED_RECTANGLE_POINT__LEN 0x00000020
#define NV04_GDI_UNCLIPPED_RECTANGLE_POINT_Y__MASK 0x0000ffff
#define NV04_GDI_UNCLIPPED_RECTANGLE_POINT_Y__SHIFT 0
#define NV04_GDI_UNCLIPPED_RECTANGLE_POINT_X__MASK 0xffff0000
#define NV04_GDI_UNCLIPPED_RECTANGLE_POINT_X__SHIFT 16
#define NV04_GDI_UNCLIPPED_RECTANGLE_SIZE(i0) (0x00000404 + 0x8*(i0))
#define NV04_GDI_UNCLIPPED_RECTANGLE_SIZE__ESIZE 0x00000008
#define NV04_GDI_UNCLIPPED_RECTANGLE_SIZE__LEN 0x00000020
#define NV04_GDI_UNCLIPPED_RECTANGLE_SIZE_H__MASK 0x0000ffff
#define NV04_GDI_UNCLIPPED_RECTANGLE_SIZE_H__SHIFT 0
#define NV04_GDI_UNCLIPPED_RECTANGLE_SIZE_W__MASK 0xffff0000
#define NV04_GDI_UNCLIPPED_RECTANGLE_SIZE_W__SHIFT 16
#define NV04_GDI_CLIP_B_POINT0 0x000005f4
#define NV04_GDI_CLIP_B_POINT0_L__MASK 0x0000ffff
#define NV04_GDI_CLIP_B_POINT0_L__SHIFT 0
#define NV04_GDI_CLIP_B_POINT0_T__MASK 0xffff0000
#define NV04_GDI_CLIP_B_POINT0_T__SHIFT 16
#define NV04_GDI_CLIP_B_POINT1 0x000005f8
#define NV04_GDI_CLIP_B_POINT1_R__MASK 0x0000ffff
#define NV04_GDI_CLIP_B_POINT1_R__SHIFT 0
#define NV04_GDI_CLIP_B_POINT1_B__MASK 0xffff0000
#define NV04_GDI_CLIP_B_POINT1_B__SHIFT 16
#define NV04_GDI_COLOR1_B 0x000005fc
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_0(i0) (0x00000600 + 0x8*(i0))
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_0__ESIZE 0x00000008
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_0__LEN 0x00000020
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_0_L__MASK 0x0000ffff
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_0_L__SHIFT 0
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_0_T__MASK 0xffff0000
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_0_T__SHIFT 16
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_1(i0) (0x00000604 + 0x8*(i0))
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_1__ESIZE 0x00000008
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_1__LEN 0x00000020
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_1_R__MASK 0x0000ffff
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_1_R__SHIFT 0
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_1_B__MASK 0xffff0000
#define NV04_GDI_CLIPPED_RECTANGLE_POINT_1_B__SHIFT 16
#define NV04_GDI_CLIP_C_POINT0 0x000007ec
#define NV04_GDI_CLIP_C_POINT0_L__MASK 0x0000ffff
#define NV04_GDI_CLIP_C_POINT0_L__SHIFT 0
#define NV04_GDI_CLIP_C_POINT0_T__MASK 0xffff0000
#define NV04_GDI_CLIP_C_POINT0_T__SHIFT 16
#define NV04_GDI_CLIP_C_POINT1 0x000007f0
#define NV04_GDI_CLIP_C_POINT1_R__MASK 0x0000ffff
#define NV04_GDI_CLIP_C_POINT1_R__SHIFT 0
#define NV04_GDI_CLIP_C_POINT1_B__MASK 0xffff0000
#define NV04_GDI_CLIP_C_POINT1_B__SHIFT 16
#define NV04_GDI_COLOR1_C 0x000007f4
#define NV04_GDI_SIZE_C 0x000007f8
#define NV04_GDI_SIZE_C_W__MASK 0x0000ffff
#define NV04_GDI_SIZE_C_W__SHIFT 0
#define NV04_GDI_SIZE_C_H__MASK 0xffff0000
#define NV04_GDI_SIZE_C_H__SHIFT 16
#define NV04_GDI_POINT_C 0x000007fc
#define NV04_GDI_POINT_C_X__MASK 0x0000ffff
#define NV04_GDI_POINT_C_X__SHIFT 0
#define NV04_GDI_POINT_C_Y__MASK 0xffff0000
#define NV04_GDI_POINT_C_Y__SHIFT 16
#define NV04_GDI_MONOCHROME_COLOR1_C(i0) (0x00000800 + 0x4*(i0))
#define NV04_GDI_MONOCHROME_COLOR1_C__ESIZE 0x00000004
#define NV04_GDI_MONOCHROME_COLOR1_C__LEN 0x00000080
#define NV04_GDI_CLIP_E_POINT0 0x00000be4
#define NV04_GDI_CLIP_E_POINT0_L__MASK 0x0000ffff
#define NV04_GDI_CLIP_E_POINT0_L__SHIFT 0
#define NV04_GDI_CLIP_E_POINT0_T__MASK 0xffff0000
#define NV04_GDI_CLIP_E_POINT0_T__SHIFT 16
#define NV04_GDI_CLIP_E_POINT1 0x00000be8
#define NV04_GDI_CLIP_E_POINT1_R__MASK 0x0000ffff
#define NV04_GDI_CLIP_E_POINT1_R__SHIFT 0
#define NV04_GDI_CLIP_E_POINT1_B__MASK 0xffff0000
#define NV04_GDI_CLIP_E_POINT1_B__SHIFT 16
#define NV04_GDI_COLOR0_E 0x00000bec
#define NV04_GDI_COLOR1_E 0x00000bf0
#define NV04_GDI_SIZE_IN_E 0x00000bf4
#define NV04_GDI_SIZE_IN_E_W__MASK 0x0000ffff
#define NV04_GDI_SIZE_IN_E_W__SHIFT 0
#define NV04_GDI_SIZE_IN_E_H__MASK 0xffff0000
#define NV04_GDI_SIZE_IN_E_H__SHIFT 16
#define NV04_GDI_SIZE_OUT_E 0x00000bf8
#define NV04_GDI_SIZE_OUT_E_W__MASK 0x0000ffff
#define NV04_GDI_SIZE_OUT_E_W__SHIFT 0
#define NV04_GDI_SIZE_OUT_E_H__MASK 0xffff0000
#define NV04_GDI_SIZE_OUT_E_H__SHIFT 16
#define NV04_GDI_POINT_E 0x00000bfc
#define NV04_GDI_POINT_E_X__MASK 0x0000ffff
#define NV04_GDI_POINT_E_X__SHIFT 0
#define NV04_GDI_POINT_E_Y__MASK 0xffff0000
#define NV04_GDI_POINT_E_Y__SHIFT 16
#define NV04_GDI_MONOCHROME_COLOR01_E(i0) (0x00000c00 + 0x4*(i0))
#define NV04_GDI_MONOCHROME_COLOR01_E__ESIZE 0x00000004
#define NV04_GDI_MONOCHROME_COLOR01_E__LEN 0x00000080
#define NV04_GDI_FONT_F 0x00000ff0
#define NV04_GDI_FONT_F_OFFSET__MASK 0x0fffffff
#define NV04_GDI_FONT_F_OFFSET__SHIFT 0
#define NV04_GDI_FONT_F_PITCH__MASK 0xf0000000
#define NV04_GDI_FONT_F_PITCH__SHIFT 28
#define NV04_GDI_CLIP_F_POINT0 0x00000ff4
#define NV04_GDI_CLIP_F_POINT0_L__MASK 0x0000ffff
#define NV04_GDI_CLIP_F_POINT0_L__SHIFT 0
#define NV04_GDI_CLIP_F_POINT0_T__MASK 0xffff0000
#define NV04_GDI_CLIP_F_POINT0_T__SHIFT 16
#define NV04_GDI_CLIP_F_POINT1 0x00000ff8
#define NV04_GDI_CLIP_F_POINT1_R__MASK 0x0000ffff
#define NV04_GDI_CLIP_F_POINT1_R__SHIFT 0
#define NV04_GDI_CLIP_F_POINT1_B__MASK 0xffff0000
#define NV04_GDI_CLIP_F_POINT1_B__SHIFT 16
#define NV04_GDI_COLOR1_F 0x00000ffc
#define NV04_GDI_CHARACTER_COLOR1_F(i0) (0x00001000 + 0x4*(i0))
#define NV04_GDI_CHARACTER_COLOR1_F__ESIZE 0x00000004
#define NV04_GDI_CHARACTER_COLOR1_F__LEN 0x00000100
#define NV04_GDI_CHARACTER_COLOR1_F_INDEX__MASK 0x000000ff
#define NV04_GDI_CHARACTER_COLOR1_F_INDEX__SHIFT 0
#define NV04_GDI_CHARACTER_COLOR1_F_X__MASK 0x000fff00
#define NV04_GDI_CHARACTER_COLOR1_F_X__SHIFT 8
#define NV04_GDI_CHARACTER_COLOR1_F_Y__MASK 0xfff00000
#define NV04_GDI_CHARACTER_COLOR1_F_Y__SHIFT 20
#define NV04_GDI_FONT_G 0x000017f0
#define NV04_GDI_FONT_G_OFFSET__MASK 0x0fffffff
#define NV04_GDI_FONT_G_OFFSET__SHIFT 0
#define NV04_GDI_FONT_G_PITCH__MASK 0xf0000000
#define NV04_GDI_FONT_G_PITCH__SHIFT 28
#define NV04_GDI_CLIP_G_POINT0 0x000017f4
#define NV04_GDI_CLIP_G_POINT0_L__MASK 0x0000ffff
#define NV04_GDI_CLIP_G_POINT0_L__SHIFT 0
#define NV04_GDI_CLIP_G_POINT0_T__MASK 0xffff0000
#define NV04_GDI_CLIP_G_POINT0_T__SHIFT 16
#define NV04_GDI_CLIP_G_POINT1 0x000017f8
#define NV04_GDI_CLIP_G_POINT1_R__MASK 0x0000ffff
#define NV04_GDI_CLIP_G_POINT1_R__SHIFT 0
#define NV04_GDI_CLIP_G_POINT1_B__MASK 0xffff0000
#define NV04_GDI_CLIP_G_POINT1_B__SHIFT 16
#define NV04_GDI_COLOR1_G 0x000017fc
#define NV04_GDI_CHARACTER_COLOR1_G_POINT(i0) (0x00001800 + 0x8*(i0))
#define NV04_GDI_CHARACTER_COLOR1_G_POINT__ESIZE 0x00000008
#define NV04_GDI_CHARACTER_COLOR1_G_POINT__LEN 0x00000100
#define NV04_GDI_CHARACTER_COLOR1_G_POINT_X__MASK 0x0000ffff
#define NV04_GDI_CHARACTER_COLOR1_G_POINT_X__SHIFT 0
#define NV04_GDI_CHARACTER_COLOR1_G_POINT_Y__MASK 0xffff0000
#define NV04_GDI_CHARACTER_COLOR1_G_POINT_Y__SHIFT 16
#define NV04_GDI_CHARACTER_COLOR1_G_INDEX(i0) (0x00001804 + 0x8*(i0))
#define NV04_GDI_CHARACTER_COLOR1_G_INDEX__ESIZE 0x00000008
#define NV04_GDI_CHARACTER_COLOR1_G_INDEX__LEN 0x00000100
#define NV10_TEXUPLOAD_WAIT_FOR_IDLE 0x00000108
#define NV10_TEXUPLOAD_DMA_NOTIFY 0x00000180
#define NV10_TEXUPLOAD_SURFACE 0x00000184
#define NV10_TEXUPLOAD_COLOR_FORMAT 0x00000300
#define NV10_TEXUPLOAD_POINT 0x00000304
#define NV10_TEXUPLOAD_POINT_X__MASK 0x0000ffff
#define NV10_TEXUPLOAD_POINT_X__SHIFT 0
#define NV10_TEXUPLOAD_POINT_Y__MASK 0xffff0000
#define NV10_TEXUPLOAD_POINT_Y__SHIFT 16
#define NV10_TEXUPLOAD_SIZE 0x00000308
#define NV10_TEXUPLOAD_SIZE_W__MASK 0x0000ffff
#define NV10_TEXUPLOAD_SIZE_W__SHIFT 0
#define NV10_TEXUPLOAD_SIZE_H__MASK 0xffff0000
#define NV10_TEXUPLOAD_SIZE_H__SHIFT 16
#define NV10_TEXUPLOAD_CLIP_HORIZONTAL 0x0000030c
#define NV10_TEXUPLOAD_CLIP_HORIZONTAL_X__MASK 0x0000ffff
#define NV10_TEXUPLOAD_CLIP_HORIZONTAL_X__SHIFT 0
#define NV10_TEXUPLOAD_CLIP_HORIZONTAL_W__MASK 0xffff0000
#define NV10_TEXUPLOAD_CLIP_HORIZONTAL_W__SHIFT 16
#define NV10_TEXUPLOAD_CLIP_VERTICAL 0x00000310
#define NV10_TEXUPLOAD_CLIP_VERTICAL_Y__MASK 0x0000ffff
#define NV10_TEXUPLOAD_CLIP_VERTICAL_Y__SHIFT 0
#define NV10_TEXUPLOAD_CLIP_VERTICAL_H__MASK 0xffff0000
#define NV10_TEXUPLOAD_CLIP_VERTICAL_H__SHIFT 16
#define NV10_TEXUPLOAD_COLOR(i0) (0x00000400 + 0x4*(i0))
#define NV10_TEXUPLOAD_COLOR__ESIZE 0x00000004
#define NV10_TEXUPLOAD_COLOR__LEN 0x00000700
#endif /* _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV01_2D_XML */
xf86-video-nouveau-1.0.16/src/hwdefs/nvc0_m2mf.xml.h 0000644 0001750 0001756 00000017501 13423754626 016733 0000000 0000000 #ifndef _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NVC0_M2MF_XML
#define _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NVC0_M2MF_XML
/* Autogenerated file, DO NOT EDIT manually!
This file was generated by the rules-ng-ng headergen tool in this git repository:
http://0x04.net/cgit/index.cgi/rules-ng-ng
git clone git://0x04.net/rules-ng-ng
The rules-ng-ng source files this header was generated from are:
- /home/skeggsb/git/envytools/rnndb/nv_objects.xml ( 794 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/copyright.xml ( 6452 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_m2mf.xml ( 2696 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_object.xml ( 12672 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nvchipsets.xml ( 3617 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_defs.xml ( 4437 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv50_defs.xml ( 5468 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nvc0_m2mf.xml ( 2687 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv01_2d.xml ( 32584 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv04_dvd.xml ( 3000 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv03_3d.xml ( 5209 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv04_3d.xml ( 17759 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_3ddefs.xml ( 16394 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv10_3d.xml ( 18437 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv20_3d.xml ( 21107 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv30-40_3d.xml ( 31987 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv50_2d.xml ( 11113 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv50_3d.xml ( 65233 bytes, from 2011-11-30 05:49:35)
- /home/skeggsb/git/envytools/rnndb/nv50_compute.xml ( 14012 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv84_crypt.xml ( 2071 bytes, from 2011-11-30 05:49:35)
- /home/skeggsb/git/envytools/rnndb/nv31_mpeg.xml ( 2269 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nvc0_3d.xml ( 52547 bytes, from 2011-11-30 05:49:35)
- /home/skeggsb/git/envytools/rnndb/nvc0_compute.xml ( 10865 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/blob_nvc0_pcopy.xml ( 4516 bytes, from 2011-10-22 08:01:09)
Copyright (C) 2006-2011 by the following authors:
- Artur Huillet (ahuillet)
- Ben Skeggs (darktama, darktama_)
- B. R. (koala_br)
- Carlos Martin (carlosmn)
- Christoph Bumiller (calim, chrisbmr)
- Dawid Gajownik (gajownik)
- Dmitry Baryshkov
- Dmitry Eremin-Solenikov (lumag)
- EdB (edb_)
- Erik Waling (erikwaling)
- Francisco Jerez (curro)
- imirkin (imirkin)
- jb17bsome (jb17bsome)
- Jeremy Kolb (kjeremy)
- Laurent Carlier (lordheavy)
- Luca Barbieri (lb, lb1)
- Maarten Maathuis (stillunknown)
- Marcin Kościelnicki (mwk, koriakin)
- Mark Carey (careym)
- Matthieu Castet (mat-c)
- nvidiaman (nvidiaman)
- Patrice Mandin (pmandin, pmdata)
- Pekka Paalanen (pq, ppaalanen)
- Peter Popov (ironpeter)
- Richard Hughes (hughsient)
- Rudi Cilibrasi (cilibrar)
- Serge Martin
- Simon Raffeiner
- Stephane Loeuillet (leroutier)
- Stephane Marchesin (marcheu)
- sturmflut (sturmflut)
- Sylvain Munaut
- Victor Stinner (haypo)
- Wladmir van der Laan (miathan6)
- Younes Manton (ymanton)
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 COPYRIGHT OWNER(S) 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.
*/
#define NVC0_M2MF_TILING_MODE_IN 0x00000204
#define NVC0_M2MF_TILING_PITCH_IN 0x00000208
#define NVC0_M2MF_TILING_HEIGHT_IN 0x0000020c
#define NVC0_M2MF_TILING_DEPTH_IN 0x00000210
#define NVC0_M2MF_TILING_POSITION_IN_Z 0x00000214
#define NVC0_M2MF_TILING_MODE_OUT 0x00000220
#define NVC0_M2MF_TILING_PITCH_OUT 0x00000224
#define NVC0_M2MF_TILING_HEIGHT_OUT 0x00000228
#define NVC0_M2MF_TILING_DEPTH_OUT 0x0000022c
#define NVC0_M2MF_TILING_POSITION_OUT_Z 0x00000230
#define NVC0_M2MF_OFFSET_OUT_HIGH 0x00000238
#define NVC0_M2MF_OFFSET_OUT_LOW 0x0000023c
#define NVC0_M2MF_FIRMWARE(i0) (0x0000027c + 0x4*(i0))
#define NVC0_M2MF_FIRMWARE__ESIZE 0x00000004
#define NVC0_M2MF_FIRMWARE__LEN 0x00000020
#define NVC0_M2MF_EXEC 0x00000300
#define NVC0_M2MF_EXEC_PUSH 0x00000001
#define NVC0_M2MF_EXEC_LINEAR_IN 0x00000010
#define NVC0_M2MF_EXEC_LINEAR_OUT 0x00000100
#define NVC0_M2MF_EXEC_QUERY__MASK 0x00003000
#define NVC0_M2MF_EXEC_QUERY__SHIFT 12
#define NVC0_M2MF_EXEC_QUERY_NO 0x00000000
#define NVC0_M2MF_EXEC_QUERY_UNK1 0x00001000
#define NVC0_M2MF_EXEC_QUERY_YES 0x00002000
#define NVC0_M2MF_EXEC_BUF_NOTIFY 0x00030000
#define NVC0_M2MF_EXEC_QUERY_SHORT 0x00100000
#define NVC0_M2MF_DATA 0x00000304
#define NVC0_M2MF_UNK308 0x00000308
#define NVC0_M2MF_OFFSET_IN_HIGH 0x0000030c
#define NVC0_M2MF_OFFSET_IN_LOW 0x00000310
#define NVC0_M2MF_PITCH_IN 0x00000314
#define NVC0_M2MF_PITCH_OUT 0x00000318
#define NVC0_M2MF_LINE_LENGTH_IN 0x0000031c
#define NVC0_M2MF_LINE_COUNT 0x00000320
#define NVC0_M2MF_QUERY_ADDRESS_HIGH 0x0000032c
#define NVC0_M2MF_QUERY_ADDRESS_LOW 0x00000330
#define NVC0_M2MF_QUERY_SEQUENCE 0x00000334
#define NVC0_M2MF_COND_ADDRESS_HIGH 0x00000338
#define NVC0_M2MF_COND_ADDRESS_LOW 0x0000033c
#define NVC0_M2MF_COND_MODE 0x00000340
#define NVC0_M2MF_COND_MODE_NEVER 0x00000000
#define NVC0_M2MF_COND_MODE_ALWAYS 0x00000001
#define NVC0_M2MF_COND_MODE_RES_NON_ZERO 0x00000002
#define NVC0_M2MF_COND_MODE_EQUAL 0x00000003
#define NVC0_M2MF_COND_MODE_NOT_EQUAL 0x00000004
#define NVC0_M2MF_TILING_POSITION_IN_X 0x00000344
#define NVC0_M2MF_TILING_POSITION_IN_Y 0x00000348
#define NVC0_M2MF_TILING_POSITION_OUT_X 0x0000034c
#define NVC0_M2MF_TILING_POSITION_OUT_Y 0x00000350
#endif /* _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NVC0_M2MF_XML */
xf86-video-nouveau-1.0.16/src/hwdefs/nv_3ddefs.xml.h 0000644 0001750 0001756 00000010600 13423754626 017010 0000000 0000000 #ifndef _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV_3DDEFS_XML
#define _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV_3DDEFS_XML
/* Autogenerated file, DO NOT EDIT manually!
This file was generated by the rules-ng-ng headergen tool in this git repository:
http://0x04.net/cgit/index.cgi/rules-ng-ng
git clone git://0x04.net/rules-ng-ng
The rules-ng-ng source files this header was generated from are:
- /home/skeggsb/git/envytools/rnndb/nv_3ddefs.xml ( 16394 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/copyright.xml ( 6452 bytes, from 2011-10-22 08:01:09)
Copyright (C) 2006-2011 by the following authors:
- Artur Huillet (ahuillet)
- Ben Skeggs (darktama, darktama_)
- B. R. (koala_br)
- Carlos Martin (carlosmn)
- Christoph Bumiller (calim, chrisbmr)
- Dawid Gajownik (gajownik)
- Dmitry Baryshkov
- Dmitry Eremin-Solenikov (lumag)
- EdB (edb_)
- Erik Waling (erikwaling)
- Francisco Jerez (curro)
- imirkin (imirkin)
- jb17bsome (jb17bsome)
- Jeremy Kolb (kjeremy)
- Laurent Carlier (lordheavy)
- Luca Barbieri (lb, lb1)
- Maarten Maathuis (stillunknown)
- Marcin Kościelnicki (mwk, koriakin)
- Mark Carey (careym)
- Matthieu Castet (mat-c)
- nvidiaman (nvidiaman)
- Patrice Mandin (pmandin, pmdata)
- Pekka Paalanen (pq, ppaalanen)
- Peter Popov (ironpeter)
- Richard Hughes (hughsient)
- Rudi Cilibrasi (cilibrar)
- Serge Martin
- Simon Raffeiner
- Stephane Loeuillet (leroutier)
- Stephane Marchesin (marcheu)
- sturmflut (sturmflut)
- Sylvain Munaut
- Victor Stinner (haypo)
- Wladmir van der Laan (miathan6)
- Younes Manton (ymanton)
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 COPYRIGHT OWNER(S) 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.
*/
#define NV50_BLEND_FACTOR_ZERO 0x00004000
#define NV50_BLEND_FACTOR_ONE 0x00004001
#define NV50_BLEND_FACTOR_SRC_COLOR 0x00004300
#define NV50_BLEND_FACTOR_ONE_MINUS_SRC_COLOR 0x00004301
#define NV50_BLEND_FACTOR_SRC_ALPHA 0x00004302
#define NV50_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA 0x00004303
#define NV50_BLEND_FACTOR_DST_ALPHA 0x00004304
#define NV50_BLEND_FACTOR_ONE_MINUS_DST_ALPHA 0x00004305
#define NV50_BLEND_FACTOR_DST_COLOR 0x00004306
#define NV50_BLEND_FACTOR_ONE_MINUS_DST_COLOR 0x00004307
#define NV50_BLEND_FACTOR_SRC_ALPHA_SATURATE 0x00004308
#define NV50_BLEND_FACTOR_CONSTANT_COLOR 0x0000c001
#define NV50_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR 0x0000c002
#define NV50_BLEND_FACTOR_CONSTANT_ALPHA 0x0000c003
#define NV50_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA 0x0000c004
#define NV50_BLEND_FACTOR_SRC1_COLOR 0x0000c900
#define NV50_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR 0x0000c901
#define NV50_BLEND_FACTOR_SRC1_ALPHA 0x0000c902
#define NV50_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA 0x0000c903
#endif /* _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV_3DDEFS_XML */
xf86-video-nouveau-1.0.16/src/hwdefs/nv_m2mf.xml.h 0000644 0001750 0001756 00000017564 13423754626 016521 0000000 0000000 #ifndef _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV_M2MF_XML
#define _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV_M2MF_XML
/* Autogenerated file, DO NOT EDIT manually!
This file was generated by the rules-ng-ng headergen tool in this git repository:
http://0x04.net/cgit/index.cgi/rules-ng-ng
git clone git://0x04.net/rules-ng-ng
The rules-ng-ng source files this header was generated from are:
- /home/skeggsb/git/envytools/rnndb/nv_objects.xml ( 794 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/copyright.xml ( 6452 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_m2mf.xml ( 2696 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_object.xml ( 12672 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nvchipsets.xml ( 3617 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_defs.xml ( 4437 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv50_defs.xml ( 5468 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nvc0_m2mf.xml ( 2687 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv01_2d.xml ( 32584 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv04_dvd.xml ( 3000 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv03_3d.xml ( 5209 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv04_3d.xml ( 17759 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_3ddefs.xml ( 16394 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv10_3d.xml ( 18437 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv20_3d.xml ( 21107 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv30-40_3d.xml ( 31987 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv50_2d.xml ( 11113 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv50_3d.xml ( 65233 bytes, from 2011-11-30 05:49:35)
- /home/skeggsb/git/envytools/rnndb/nv50_compute.xml ( 14012 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv84_crypt.xml ( 2071 bytes, from 2011-11-30 05:49:35)
- /home/skeggsb/git/envytools/rnndb/nv31_mpeg.xml ( 2269 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nvc0_3d.xml ( 52547 bytes, from 2011-11-30 05:49:35)
- /home/skeggsb/git/envytools/rnndb/nvc0_compute.xml ( 10865 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/blob_nvc0_pcopy.xml ( 4516 bytes, from 2011-10-22 08:01:09)
Copyright (C) 2006-2011 by the following authors:
- Artur Huillet (ahuillet)
- Ben Skeggs (darktama, darktama_)
- B. R. (koala_br)
- Carlos Martin (carlosmn)
- Christoph Bumiller (calim, chrisbmr)
- Dawid Gajownik (gajownik)
- Dmitry Baryshkov
- Dmitry Eremin-Solenikov (lumag)
- EdB (edb_)
- Erik Waling (erikwaling)
- Francisco Jerez (curro)
- imirkin (imirkin)
- jb17bsome (jb17bsome)
- Jeremy Kolb (kjeremy)
- Laurent Carlier (lordheavy)
- Luca Barbieri (lb, lb1)
- Maarten Maathuis (stillunknown)
- Marcin Kościelnicki (mwk, koriakin)
- Mark Carey (careym)
- Matthieu Castet (mat-c)
- nvidiaman (nvidiaman)
- Patrice Mandin (pmandin, pmdata)
- Pekka Paalanen (pq, ppaalanen)
- Peter Popov (ironpeter)
- Richard Hughes (hughsient)
- Rudi Cilibrasi (cilibrar)
- Serge Martin
- Simon Raffeiner
- Stephane Loeuillet (leroutier)
- Stephane Marchesin (marcheu)
- sturmflut (sturmflut)
- Sylvain Munaut
- Victor Stinner (haypo)
- Wladmir van der Laan (miathan6)
- Younes Manton (ymanton)
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 COPYRIGHT OWNER(S) 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.
*/
#define NV03_M2MF_DMA_NOTIFY 0x00000180
#define NV03_M2MF_DMA_BUFFER_IN 0x00000184
#define NV03_M2MF_DMA_BUFFER_OUT 0x00000188
#define NV50_M2MF_LINEAR_IN 0x00000200
#define NV50_M2MF_TILING_MODE_IN 0x00000204
#define NV50_M2MF_TILING_PITCH_IN 0x00000208
#define NV50_M2MF_TILING_HEIGHT_IN 0x0000020c
#define NV50_M2MF_TILING_DEPTH_IN 0x00000210
#define NV50_M2MF_TILING_POSITION_IN_Z 0x00000214
#define NV50_M2MF_TILING_POSITION_IN 0x00000218
#define NV50_M2MF_TILING_POSITION_IN_X__MASK 0x0000ffff
#define NV50_M2MF_TILING_POSITION_IN_X__SHIFT 0
#define NV50_M2MF_TILING_POSITION_IN_Y__MASK 0xffff0000
#define NV50_M2MF_TILING_POSITION_IN_Y__SHIFT 16
#define NV50_M2MF_LINEAR_OUT 0x0000021c
#define NV50_M2MF_TILING_MODE_OUT 0x00000220
#define NV50_M2MF_TILING_PITCH_OUT 0x00000224
#define NV50_M2MF_TILING_HEIGHT_OUT 0x00000228
#define NV50_M2MF_TILING_DEPTH_OUT 0x0000022c
#define NV50_M2MF_TILING_POSITION_OUT_Z 0x00000230
#define NV50_M2MF_TILING_POSITION_OUT 0x00000234
#define NV50_M2MF_TILING_POSITION_OUT_X__MASK 0x0000ffff
#define NV50_M2MF_TILING_POSITION_OUT_X__SHIFT 0
#define NV50_M2MF_TILING_POSITION_OUT_Y__MASK 0xffff0000
#define NV50_M2MF_TILING_POSITION_OUT_Y__SHIFT 16
#define NV50_M2MF_OFFSET_IN_HIGH 0x00000238
#define NV50_M2MF_OFFSET_OUT_HIGH 0x0000023c
#define NV03_M2MF_OFFSET_IN 0x0000030c
#define NV03_M2MF_OFFSET_OUT 0x00000310
#define NV03_M2MF_PITCH_IN 0x00000314
#define NV03_M2MF_PITCH_OUT 0x00000318
#define NV03_M2MF_LINE_LENGTH_IN 0x0000031c
#define NV03_M2MF_LINE_COUNT 0x00000320
#define NV03_M2MF_FORMAT 0x00000324
#define NV03_M2MF_FORMAT_INPUT_INC__MASK 0x000000ff
#define NV03_M2MF_FORMAT_INPUT_INC__SHIFT 0
#define NV03_M2MF_FORMAT_INPUT_INC_1 0x00000001
#define NV03_M2MF_FORMAT_INPUT_INC_2 0x00000002
#define NV03_M2MF_FORMAT_INPUT_INC_4 0x00000004
#define NV50_M2MF_FORMAT_INPUT_INC_8 0x00000008
#define NV50_M2MF_FORMAT_INPUT_INC_16 0x00000010
#define NV03_M2MF_FORMAT_OUTPUT_INC__MASK 0x0000ff00
#define NV03_M2MF_FORMAT_OUTPUT_INC__SHIFT 8
#define NV03_M2MF_FORMAT_OUTPUT_INC_1 0x00000100
#define NV03_M2MF_FORMAT_OUTPUT_INC_2 0x00000200
#define NV03_M2MF_FORMAT_OUTPUT_INC_4 0x00000400
#define NV50_M2MF_FORMAT_OUTPUT_INC_8 0x00000800
#define NV50_M2MF_FORMAT_OUTPUT_INC_16 0x00001000
#define NV03_M2MF_BUF_NOTIFY 0x00000328
#endif /* _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV_M2MF_XML */
xf86-video-nouveau-1.0.16/src/hwdefs/nv_object.xml.h 0000644 0001750 0001756 00000027055 13423754626 017122 0000000 0000000 #ifndef _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV_OBJECT_XML
#define _HOME_SKEGGSB_GIT_ENVYTOOLS_RNNDB_NV_OBJECT_XML
/* WARNING ABOUT NOT EDITING AUTOGENERATED FILE IGNORED, _CLASS SUFFIX HAS
* BEEN ADDED TO ALL THE OBJECT CLASS DEFINITIONS TO AVOID CONFLICTS WITH
* THE RING MACROS WE WANT TO USE
*/
/* Autogenerated file, DO NOT EDIT manually!
This file was generated by the rules-ng-ng headergen tool in this git repository:
http://0x04.net/cgit/index.cgi/rules-ng-ng
git clone git://0x04.net/rules-ng-ng
The rules-ng-ng source files this header was generated from are:
- /home/skeggsb/git/envytools/rnndb/nv_object.xml ( 12672 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/copyright.xml ( 6452 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nvchipsets.xml ( 3617 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv_defs.xml ( 4437 bytes, from 2011-10-22 08:01:09)
- /home/skeggsb/git/envytools/rnndb/nv50_defs.xml ( 5468 bytes, from 2011-10-22 08:01:09)
Copyright (C) 2006-2011 by the following authors:
- Artur Huillet (ahuillet)
- Ben Skeggs (darktama, darktama_)
- B. R. (koala_br)
- Carlos Martin (carlosmn)
- Christoph Bumiller (calim, chrisbmr)
- Dawid Gajownik (gajownik)
- Dmitry Baryshkov
- Dmitry Eremin-Solenikov (lumag)
- EdB (edb_)
- Erik Waling (erikwaling)
- Francisco Jerez (curro)
- imirkin (imirkin)
- jb17bsome (jb17bsome)
- Jeremy Kolb (kjeremy)
- Laurent Carlier (lordheavy)
- Luca Barbieri (lb, lb1)
- Maarten Maathuis (stillunknown)
- Marcin Kościelnicki (mwk, koriakin)
- Mark Carey (careym)
- Matthieu Castet